

html:root {
    --bg: #f7f2e7;
    --surface: #ffffff;
    --surface-2: #fbf7ee;
    --ink: #191726;
    --ink-soft: #5a5470;
    --ink-faint: #9089a3;
    --accent: #e0432b;
    --accent-2: #c23621;
    --accent-soft: rgba(224, 67, 43, 0.12);
    --gold: #b4870a;
    --gold-soft: rgba(239, 176, 0, 0.18);
    --line: #e7dec7;
    --line-strong: #d8cba8;
    --good: #2f9e58;
    --good-soft: #e6f4ea;
    --bad: #d64545;
    --bad-soft: #fbe9e9;

    --shadow-sm: 0 1px 2px rgba(25, 23, 38, 0.06), 0 1px 1px rgba(25, 23, 38, 0.04);
    --shadow-md: 0 10px 24px -8px rgba(25, 23, 38, 0.16), 0 2px 8px -2px rgba(25, 23, 38, 0.06);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);

    --serif: "Futura", "Avenir Next", Avenir, "Century Gothic", system-ui, sans-serif;
    --sans: "Avenir Next", Avenir, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

    --color-nom: #1d5fa6; --color-nom-bg: #e5eef8;
    --color-acc: #e0432b; --color-acc-bg: #fbe7e3;
    --color-irr: #b4870a; --color-irr-bg: #faf1d6;
    --color-coo: #0f7168; --color-coo-bg: #e2f2f0;
    --color-sub: #6c4ba6; --color-sub-bg: #eee8f7;
    --color-neg: #b8355f; --color-neg-bg: #f8e5eb;

    --radius: 20px;
}

@media (prefers-color-scheme: dark) {
    html:root {
        --bg: #131220;
        --surface: #1c1a2c; --surface-2: #211f34;
        --ink: #f3eee1; --ink-soft: #b3abc9; --ink-faint: #867f9c;
        --accent: #ff5b41; --accent-2: #ff7b62; --accent-soft: rgba(255, 91, 65, 0.16);
        --gold: #ffcb3d; --gold-soft: rgba(255, 203, 61, 0.18);
        --line: #33304a; --line-strong: #413c5c;
        --good: #6bc98a; --good-soft: rgba(107, 201, 138, 0.14);
        --bad: #e58080; --bad-soft: rgba(229, 128, 128, 0.14);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 10px 28px -10px rgba(0, 0, 0, 0.55);

        --color-nom: #5b98e8; --color-nom-bg: rgba(91, 152, 232, 0.16);
        --color-acc: #ff5b41; --color-acc-bg: rgba(255, 91, 65, 0.16);
        --color-irr: #ffcb3d; --color-irr-bg: rgba(255, 203, 61, 0.18);
        --color-coo: #2fb6a8; --color-coo-bg: rgba(47, 182, 168, 0.16);
        --color-sub: #9a7bd6; --color-sub-bg: rgba(154, 123, 214, 0.18);
        --color-neg: #e06a94; --color-neg-bg: rgba(224, 106, 148, 0.18);
    }
}

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

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

.brand-word {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    color: var(--ink);
}

.brand-word b {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (min-width: 861px) {
    .nav-links {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}

.nav-links > a {
    font-family: var(--mono);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--ink-soft);
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-links > a:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.navbar .dropdown-item {
    position: relative;
}

.navbar .dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--ink-soft);
    text-decoration: none;
    border: none;
    background: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.navbar .dropdown-trigger:hover,
.navbar .dropdown-item.open .dropdown-trigger {
    background: var(--surface-2);
    color: var(--ink);
}

.navbar .dropdown-trigger.active {
    color: var(--accent);
}

.navbar .caret {
    transition: transform 0.18s ease;
    font-size: 0.7em;
}

.navbar .dropdown-item.open .caret {
    transform: rotate(180deg);
}

.navbar .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 230px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    padding: 14px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
    overflow: hidden;
}

.navbar .dropdown-menu::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--gold), var(--color-nom));
}

.navbar .dropdown-item.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.navbar .dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink-soft);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.navbar .dropdown-menu a:hover {
    background: var(--surface-2);
    color: var(--ink);
    transform: translateX(2px);
}

.dropdown-flag {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.15s ease;
}

.dropdown-flag-de {
    background: linear-gradient(to bottom, #1a1a1a 0 33.33%, #dd0000 33.33% 66.66%, #ffce00 66.66% 100%);
}

.dropdown-flag-fr {
    background: linear-gradient(to right, #0055a4 0 33.33%, #ffffff 33.33% 66.66%, #ef4135 66.66% 100%);
}

.navbar .dropdown-menu a:hover .dropdown-flag-de {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 0 0 3px var(--gold-soft);
}

.navbar .dropdown-menu a:hover .dropdown-flag-fr {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 0 0 3px var(--color-nom-bg);
}

.dropdown-lang-name {
    flex: 1;
}

.dropdown-soon-badge {
    font-family: var(--mono);
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gold);
    background: var(--gold-soft);
    padding: 3px 7px;
    border-radius: 999px;
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 860px) {
    .nav-links {
        position: fixed;
        inset: 60px 0 auto 0;
        background: var(--surface);
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
        gap: 2px;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links > a,
    .navbar .dropdown-trigger {
        width: 100%;
    }

    .navbar .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 14px;
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }

    .navbar .dropdown-menu::before {
        display: none;
    }

    .navbar .dropdown-item.open .dropdown-menu {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }
}

.levels-main {
    padding: 128px 24px 40px;
    max-width: 1180px;
    margin: 0 auto;
}

.levels-hero {
    position: relative;
    text-align: center;
    max-width: 620px;
    margin: 0 auto 56px;
}

.levels-hero::before {
    content: "";
    position: absolute;
    inset: -40px -20%;
    background: linear-gradient(to bottom,
        #c60b1e 0% 25%,
        #ffc400 25% 75%,
        #c60b1e 75% 100%);
    opacity: 0.16;
    filter: blur(32px);
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 45%, #000 40%, transparent 85%);
    mask-image: radial-gradient(ellipse 70% 80% at 50% 45%, #000 40%, transparent 85%);
    pointer-events: none;
    z-index: 0;
}

.levels-hero h1 {
    font-family: var(--serif);
    font-size: clamp(2.1rem, 4.6vw, 3rem);
    font-weight: 500;
    color: var(--ink);
    text-wrap: balance;
    margin-bottom: 14px;
}

.levels-hero-sub {
    color: var(--ink-soft);
    font-size: 1.02rem;
    line-height: 1.65;
}

.levels-path {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    column-gap: 20px;
    row-gap: 66px;
    padding-top: 68px;
}

.levels-path-line,
.levels-path-fill {
    position: absolute;
    top: 68px;
    left: calc(10% + 11px);
    right: calc(10% + 11px);
    height: 3px;
    border-radius: 999px;
    transform: translateY(-50%);
}

.levels-path-line {
    background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px);
}

.levels-path-fill {
    width: 0%;
    background: linear-gradient(90deg, var(--color-nom), var(--color-coo));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.level-node {
    position: absolute;
    top: 0;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface);
    border: 2.5px solid var(--level-color);
    transform: translate(-50%, -50%);
    z-index: 2;
}

.level-word-stat {
    position: absolute;
    top: -46px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    pointer-events: none;
}

.level-word-total {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--level-color);
    white-space: nowrap;
}

.level-word-delta {
    font-family: var(--mono);
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink-faint);
    white-space: nowrap;
}

.is-locked .level-node {
    border-color: var(--line-strong);
    background: var(--bg);
}

.level-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--level-color);
    border-radius: 18px;
    padding: 28px 20px 22px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}

.level-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(180px 140px at 0% 0%, var(--level-bg), transparent 70%);
    opacity: 0.8;
    pointer-events: none;
}

.level-card[hidden] { display: none; }

.level-card.is-available { cursor: pointer; }
.level-card.is-available:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--level-color);
}
.level-card.is-available:active { transform: translateY(-2px); }

.level-card.is-locked {
    cursor: not-allowed;
    opacity: 0.82;
}

@keyframes levelCardShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}
.level-card.is-locked.is-shaking { animation: levelCardShake 0.4s ease; }

.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--level-color);
    background: var(--level-bg);
}

.level-status {
    position: absolute;
    top: 22px;
    right: 20px;
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
}
.level-status.status-available { background: var(--good-soft); color: var(--good); }
.level-status.status-locked { background: var(--surface-2); color: var(--ink-faint); }

.level-card h2 {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--ink);
    margin-top: 4px;
}

.level-card p {
    color: var(--ink-soft);
    font-size: 0.86rem;
    line-height: 1.55;
    flex: 1;
}

.level-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--level-color);
    margin-top: 4px;
}

.level-cta svg { transition: transform 0.18s ease; }
.level-card.is-available:hover .level-cta svg { transform: translateX(3px); }

.level-cta-locked { color: var(--ink-faint); }

.levels-path-note {
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.88rem;
    margin-top: 32px;
}
.levels-path-note strong { color: var(--ink); font-family: var(--serif); }

.signup-section {
    max-width: 420px;
    margin: 48px auto 0;
    text-align: center;
}

.signup-card {
    align-items: stretch;
}

.signup-note {
    color: var(--ink-soft);
    font-size: 0.95rem;
    margin-bottom: 16px;
    text-align: center;
}

.signup-form { text-align: left; }

.signup-form-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
    margin-bottom: 8px;
}

.signup-form-row {
    display: flex;
    gap: 10px;
}

.signup-form-input {
    flex: 1;
    min-width: 0;
    font-family: var(--sans);
    font-size: 0.92rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 12px 18px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.signup-form-input::placeholder { color: var(--ink-faint); }
.signup-form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.signup-form-input.is-invalid {
    border-color: var(--bad);
    box-shadow: 0 0 0 3px var(--bad-soft);
}

.signup-submit-btn {
    flex-shrink: 0;
    font-family: var(--sans);
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--accent);
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}
.signup-submit-btn:hover { background: var(--accent-2); }
.signup-submit-btn:active { transform: scale(0.97); }
.signup-submit-btn:disabled { opacity: 0.6; cursor: default; }

.signup-form-status {
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 1.2em;
}
.signup-form-status.is-success { color: var(--good); }
.signup-form-status.is-error { color: var(--bad); }

@media (max-width: 480px) {
    .signup-form-row { flex-direction: column; }
    .signup-submit-btn { width: 100%; }
}

.reveal-io { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
    .reveal-io {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }
    .reveal-io.is-visible { opacity: 1; transform: none; }
}

.site-footer { text-align: center; padding: 28px 20px 44px; color: var(--ink-faint); font-size: 0.82rem; }

@media (max-width: 980px) {
    .levels-path { grid-template-columns: repeat(3, 1fr); gap: 18px; row-gap: 64px; }
    .levels-path-line, .levels-path-fill { display: none; }
}

@media (max-width: 620px) {
    .levels-main { padding: 108px 18px 32px; }
    .levels-path { grid-template-columns: 1fr; row-gap: 40px; }
    .level-status { position: static; align-self: flex-start; order: -1; }
}
