:root {
    --french-blue: #002395;
    --french-white: #ffffff;
    --french-red: #ed2939;
    --bg: #1a1a2e;
    --card-bg: #16213e;
    --accent: #e94560;
    --gold: #f0c040;
    --text: #eee;
    --muted: #aaa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        "Segoe UI",
        "Poppins",
        system-ui,
        -apple-system,
        sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition:
        background 1.5s ease,
        color 1.5s ease;
}

/* ═══ LIGHT MODE ═══ */
body.light-mode {
    --bg: #fff8f0;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --muted: #888;
}
body.light-mode .fact-card {
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .stat-card {
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode h1 {
    background: linear-gradient(135deg, #002395, #ed2939);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══ FRENCH FILM MODE (grayscale) ═══ */
body.cinema {
    filter: grayscale(1) sepia(0.3);
    transition: filter 2s ease;
}

/* ═══ REVERSE PARTICLES ═══ */
body.reversed .particle {
    animation-name: floatDown !important;
}
@keyframes floatDown {
    0% {
        transform: translateY(-10vh) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(110vh) rotate(-720deg) scale(1.5);
        opacity: 0;
    }
}

/* ═══ PARTICLES ═══ */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.particle {
    position: absolute;
    font-size: 2rem;
    animation: floatUp linear infinite;
    opacity: 0;
    animation-fill-mode: backwards;
    pointer-events: auto;
    cursor: pointer;
    z-index: 5;
    user-select: none;
}
@keyframes floatUp {
    0% {
        transform: translateY(110vh) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-10vh) rotate(720deg) scale(1.5);
        opacity: 0;
    }
}

/* ═══ CONTAINER ═══ */
.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ═══ HEADER ═══ */
header {
    text-align: center;
    padding: 40px 20px 20px;
}
.logo {
    font-size: 5rem;
    animation: bounce 2s ease-in-out infinite;
    display: inline-block;
    cursor: pointer;
    user-select: none;
}
@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-20px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(-10px);
    }
}
h1 {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--french-blue), var(--french-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 10px 0;
    letter-spacing: -1px;
}
.subtitle {
    font-size: 1.2rem;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 10px;
}
.flag-stripe {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(
        90deg,
        var(--french-blue) 33.33%,
        var(--french-white) 33.33%,
        var(--french-white) 66.66%,
        var(--french-red) 66.66%
    );
    width: 200px;
    margin: 0 auto 15px;
    opacity: 0.7;
}
.flag-stripe.animate {
    animation: flagWave 0.8s ease-in-out;
}
@keyframes flagWave {
    0%,
    100% {
        transform: scaleX(1);
    }
    50% {
        transform: scaleX(2);
        opacity: 1;
    }
}

/* ═══ STATS ═══ */
.stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0;
}
.stat-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px 25px;
    text-align: center;
    min-width: 140px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    cursor: default;
}
.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(233, 68, 96, 0.2);
}
.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}
.stat-number {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent);
}
.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ═══ FACT CARD ═══ */
.fact-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 35px 30px;
    margin: 25px 0;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
}
.fact-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(233, 68, 96, 0.08) 0%,
        transparent 70%
    );
    animation: rotateGlow 8s linear infinite;
}
@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
.fact-emoji {
    font-size: 4rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}
.fact-emoji.wiggle {
    animation: wiggle 0.5s ease-in-out;
}
@keyframes wiggle {
    0%,
    100% {
        transform: rotate(0);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}
.fact-text {
    font-size: 1.4rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    line-height: 1.5;
    color: #fff;
    max-width: 90%;
}
.fact-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

/* ═══ BUTTONS ═══ */
.btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
}
.btn {
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #ff6b6b);
    color: white;
    box-shadow: 0 8px 25px rgba(233, 68, 96, 0.35);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(233, 68, 96, 0.5);
}
.btn-primary:active {
    transform: scale(0.95);
}
.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 2px solid rgba(255, 255, 255, 0.25);
}
.btn-secondary:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* ═══ TOAST ═══ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(150px);
    background: #2ed573;
    color: #000;
    padding: 15px 25px;
    border-radius: 50px;
    font-weight: 700;
    z-index: 999;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 40px rgba(46, 213, 115, 0.4);
    pointer-events: none;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast.error {
    background: #ff4757;
    color: white;
    box-shadow: 0 15px 40px rgba(255, 71, 87, 0.4);
}

/* ═══ RAGE METER ═══ */
.rage-meter {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    height: 18px;
    margin: 20px 0;
    overflow: hidden;
    position: relative;
}
.rage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--french-blue), var(--french-red));
    border-radius: 20px;
    transition: width 0.5s ease;
    position: relative;
}
.rage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 5px;
}

/* ═══ FOOTER ═══ */
footer {
    text-align: center;
    padding: 30px;
    color: var(--muted);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}
footer .disclaimer {
    margin-top: 8px;
    font-style: italic;
    opacity: 0.6;
    font-size: 0.7rem;
}

/* ═══ COMBO ═══ */
.combo-display {
    text-align: center;
    height: 40px;
    margin: 5px 0;
    overflow: hidden;
}
.combo-text {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(240, 192, 64, 0.6);
    display: inline-block;
}
.combo-text.pop {
    animation: comboIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes comboIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ═══ FACT POPUP ═══ */
.fact-popup {
    position: fixed;
    z-index: 100;
    pointer-events: none;
    font-weight: 900;
    font-size: 1.3rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: popUpFloat 2s ease-out forwards;
    white-space: nowrap;
}
@keyframes popUpFloat {
    0% {
        transform: translate(-50%, 0) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -120px) scale(1.4);
        opacity: 0;
    }
}

/* ═══ ACHIEVEMENTS ═══ */
.achievements {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px 25px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.achievement-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-align: center;
}
.achievement-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.achievement-hint {
    color: var(--muted);
    font-size: 0.8rem;
    font-style: italic;
}
.achievement-badge {
    background: linear-gradient(135deg, #2d1b69, #1a3a5c);
    border: 2px solid var(--gold);
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(240, 192, 64, 0.25);
    cursor: default;
    transition: transform 0.2s ease;
}
.achievement-badge.new-unlock {
    animation: achieveUnlock 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.achievement-badge:hover {
    transform: scale(1.08);
}
.achievement-badge.locked {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--muted);
    filter: grayscale(1);
    box-shadow: none;
}
@keyframes achieveUnlock {
    0% {
        transform: scale(0);
    }
    60% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ═══ SECRET HINT ═══ */
.secret-hint {
    margin-top: 10px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    font-style: italic;
    min-height: 18px;
    transition: color 0.5s ease;
}

/* ═══ RARE POPUP ═══ */
.rare-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #1a0533, #2d1b69, #5c0a4a);
    border: 3px solid #ffd700;
    border-radius: 24px;
    padding: 30px 40px;
    z-index: 1500;
    text-align: center;
    max-width: 90vw;
    box-shadow:
        0 0 60px rgba(255, 215, 0, 0.6),
        0 0 120px rgba(255, 215, 0, 0.3);
    animation:
        rareIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        rareGlow 2s ease-in-out infinite;
}
.rare-popup .rare-emoji {
    font-size: 5rem;
    display: block;
    margin-bottom: 10px;
}
.rare-popup .rare-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}
.rare-popup .rare-text {
    font-size: 0.9rem;
    color: #eee;
    margin-top: 6px;
}
@keyframes rareIn {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-20deg);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, -50%) scale(1.15) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}
@keyframes rareGlow {
    0%,
    100% {
        box-shadow:
            0 0 60px rgba(255, 215, 0, 0.6),
            0 0 120px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow:
            0 0 100px rgba(255, 215, 0, 0.9),
            0 0 200px rgba(255, 215, 0, 0.5);
    }
}

/* ═══ BOOST BANNER ═══ */
.boost-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #ffd700, #ff8c00, #ffd700);
    color: #000;
    text-align: center;
    padding: 10px;
    font-weight: 900;
    font-size: 1.1rem;
    z-index: 2000;
    letter-spacing: 1px;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
}
.boost-banner.active {
    transform: translateY(0);
}

/* ═══ ASCII EIFFELTURM ═══ */
.ascii-art {
    position: fixed;
    bottom: 60px;
    right: 10px;
    z-index: 50;
    font-family: monospace;
    font-size: 10px;
    line-height: 1.1;
    color: rgba(255, 255, 255, 0.15);
    pointer-events: none;
    white-space: pre;
    transition: opacity 1s ease;
}
.ascii-art.show {
    color: rgba(255, 255, 255, 0.4);
}

/* ═══ CONFETTI ═══ */
.confetti-piece {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    animation: confettiFall linear forwards;
}
@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(1080deg);
        opacity: 0;
    }
}

/* ═══ SHAKE ═══ */
body.shake {
    animation: bodyShake 0.6s ease-in-out;
}
@keyframes bodyShake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    50%,
    90% {
        transform: translateX(-6px);
    }
    30%,
    70% {
        transform: translateX(6px);
    }
}

/* ═══ FLASH ═══ */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    pointer-events: none;
    animation: flash 0.4s ease-out forwards;
}
@keyframes flash {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
    }
}

/* ═══ LIVE TRACKER ═══ */
.franzosen-tracker {
    background: linear-gradient(135deg, #0f0c29, #1a1340, #16213e);
    border: 2px solid rgba(237, 41, 57, 0.4);
    border-radius: 20px;
    padding: 20px 25px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 8px 30px rgba(237, 41, 57, 0.2);
    position: relative;
    overflow: hidden;
}
.franzosen-tracker::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 25px,
        rgba(255, 255, 255, 0.01) 25px,
        rgba(255, 255, 255, 0.01) 26px
    );
    pointer-events: none;
}
.tracker-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    margin-bottom: 8px;
}
.tracker-live-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2ed573;
    box-shadow:
        0 0 12px #2ed573,
        0 0 25px rgba(46, 213, 115, 0.6);
    animation: livePulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}
.tracker-live-dot.no-french {
    background: #ff4757;
    box-shadow:
        0 0 12px #ff4757,
        0 0 25px rgba(255, 71, 87, 0.6);
}
.tracker-live-dot.some-french {
    background: #ffa502;
    box-shadow:
        0 0 12px #ffa502,
        0 0 25px rgba(255, 165, 2, 0.6);
}
@keyframes livePulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.3);
    }
}
.tracker-label {
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
}
.tracker-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--french-red);
    text-shadow: 0 0 20px rgba(237, 41, 57, 0.6);
    min-width: 50px;
    display: inline-block;
    transition: all 0.3s ease;
}
.tracker-number.bump {
    animation: numberBump 0.3s ease-out;
}
@keyframes numberBump {
    0% {
        transform: scale(1.6);
    }
    100% {
        transform: scale(1);
    }
}
.tracker-emoji {
    font-size: 1.6rem;
}
.tracker-detail {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 5px;
}
.tracker-you {
    color: var(--gold);
    font-weight: 600;
}
.tracker-you.french {
    color: var(--french-red);
    animation: wiggle 0.5s ease-in-out;
}
.tracker-flags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    font-size: 0.7rem;
}
.tracker-flag-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 4px 10px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tracker-flag-badge.french {
    border-color: var(--french-red);
    animation: wiggle 2s ease-in-out infinite;
}

/* ═══ FLIP MODE (Kopfstand) ═══ */
body.flipped {
    transform: rotate(180deg);
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ═══ RARE PARTICLE ═══ */
.particle.rare-particle {
    filter: drop-shadow(0 0 8px #ffd700) drop-shadow(0 0 16px #ff8c00);
    animation-name: floatUpRare;
}
@keyframes floatUpRare {
    0% {
        transform: translateY(110vh) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-10vh) rotate(720deg) scale(1.5);
        opacity: 0;
    }
}

/* ═══ LEADERBOARD LINK ═══ */
.leaderboard-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    border-radius: 50px;
    font-weight: 900;
    font-size: 0.9rem;
    text-decoration: none;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
    animation: achieveUnlock 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.leaderboard-link:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.7);
}

/* ═══ SECRET GUIDE ═══ */
.secret-guide {
    background: linear-gradient(135deg, #0a0015, #1a0533, #0d1b2a);
    border: 3px solid #ffd700;
    border-radius: 20px;
    padding: 25px 30px;
    margin: 20px 0;
    box-shadow:
        0 0 40px rgba(255, 215, 0, 0.3),
        0 0 80px rgba(255, 215, 0, 0.1);
    animation: rareIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.guide-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: #ffd700;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 6px;
}
.guide-subtitle {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    margin-bottom: 20px;
    font-style: italic;
}
.guide-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.guide-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 12px 18px;
    font-size: 0.85rem;
    text-align: center;
    min-width: 160px;
    transition: transform 0.2s ease;
}
.guide-item.found {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
}
.guide-item:hover {
    transform: scale(1.05);
}
.guide-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 4px;
}
.guide-link {
    color: #ffd700;
    font-weight: 900;
    text-decoration: none;
    font-size: 1.1rem;
    letter-spacing: 1px;
    transition: color 0.2s ease;
}
.guide-link:hover {
    color: #fff;
}
.guide-footer {
    text-align: center;
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
@media (max-width: 600px) {
    .tracker-number {
        font-size: 1.8rem;
    }
    .tracker-main {
        font-size: 1rem;
        gap: 6px;
    }
    .tracker-detail {
        flex-direction: column;
        gap: 4px;
    }
    h1 {
        font-size: 2rem;
    }
    .fact-text {
        font-size: 1.1rem;
    }
    .stat-card {
        min-width: 100px;
        padding: 15px;
    }
    .stat-number {
        font-size: 1.6rem;
    }
    .achievement-badge {
        font-size: 0.7rem;
        padding: 6px 12px;
    }
    .ascii-art {
        font-size: 7px;
    }
}
