.topbar {
    height: 74px;
    padding: 0 max(5vw,24px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(244,241,233,.92);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.brand {
    font-family: "Playfair Display",serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}

.brand span {
    color: var(--gold);
}

.language {
    display: flex;
    padding: 3px;
    background: #e8e5dc;
    border-radius: 9px;
}

.language button {
    border: 0;
    background: transparent;
    padding: 7px 11px;
    border-radius: 7px;
    color: #929b96;
    font-weight: 700;
    cursor: pointer;
}

.language .active {
    background: var(--card);
    color: var(--green);
    box-shadow: 0 2px 8px #26392d15;
}

.game-layout {
    display: grid;
    grid-template-columns: 1.5fr .8fr;
    gap: 28px;
    margin-top: 35px;
}

@media(max-width:850px) {
    .game-layout {
        grid-template-columns: 1fr;
    }
}

.topbar-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media(max-width:600px) {
    .topbar {
        height: auto;
        min-height: 68px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .topbar-tools {
        gap: 6px;
    }

    .language button {
        padding: 7px;
    }
}

.topbar-short-label {
    display: none;
}

@media(max-width:600px) {
    .topbar-long-label {
        display: none;
    }

    .topbar-short-label {
        display: inline;
    }
}

.topbar-link {
    color: var(--green);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.topbar-link:hover {
    text-decoration: underline;
}

.topbar-button {
    padding: 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.topbar-button:disabled {
    color: var(--muted);
    cursor: wait;
    text-decoration: none;
}

@media(max-width:600px) {
    .topbar-link {
        font-size: 11px;
    }
}

@media(max-width:850px) {
    .topbar {
        z-index: 40;
    }

    .game-layout {
        gap: 0;
        margin-top: 6px;
    }
}

.app-shell {
    font-size: clamp(15px,4.1vw,16px);
}

.mobile-game-shell,
.mobile-bottom-nav {
    display: none;
}

.mobile-game-shell :focus-visible,
.mobile-bottom-nav :focus-visible {
    outline: 3px solid #267454;
    outline-offset: 3px;
}

.desktop-game-shell {
    display: block;
}

@media(max-width:850px) {
    .desktop-game-shell {
        display: none;
    }

    .mobile-game-shell {
        display: block;
        width: 100%;
        max-width: 560px;
        margin: 0 auto;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 45;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        height: calc(70px + env(safe-area-inset-bottom));
        padding: 6px max(10px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(10px,env(safe-area-inset-left));
        border-top: 1px solid #d7d5cc;
        background: rgba(255,253,248,.97);
        box-shadow: 0 -8px 30px #223a2c14;
        backdrop-filter: blur(14px);
        grid-auto-flow: column;
        grid-auto-columns: minmax(0,1fr);
        gap: 4px;
        grid-template-columns: repeat(2,minmax(0,1fr)) minmax(130px,1.7fr);
    }

    .mobile-bottom-nav:has(>button:nth-child(4)) {
        grid-template-columns: repeat(3,minmax(0,1fr)) minmax(130px,1.7fr);
    }

    .mobile-bottom-nav .mobile-next-year {
        align-self: center;
        min-height: 54px;
        padding: 5px 8px;
        gap: 4px;
    }

    .mobile-next-year strong {
        font: 700 14px/1.15 "DM Sans",sans-serif;
        white-space: nowrap;
    }

    .mobile-next-year em {
        font: 700 13px/1 "DM Sans",sans-serif;
    }

    .mobile-bottom-nav button {
        display: grid;
        place-content: center;
        justify-items: center;
        gap: 3px;
        min-width: 0;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #77827b;
        font-family: "DM Sans",sans-serif;
        cursor: pointer;
    }

    .mobile-bottom-nav button>span {
        font-size: 24px;
        line-height: 1;
    }

    .mobile-bottom-nav button>small {
        font-size: 13px;
        font-weight: 800;
    }

    .mobile-bottom-nav button.active {
        background: #e8f1e9;
        color: var(--green);
    }

    .mobile-game-content {
        padding: 16px 14px 28px;
    }

    .mobile-destination-view {
        display: grid;
        gap: 14px;
    }
}

@media(max-width:390px) {
    .mobile-game-content {
        padding-right: 10px;
        padding-left: 10px;
    }

    .mobile-bottom-nav button>small {
        font-size: 13px;
    }
}

@media(min-width:851px) {
    .desktop-game-shell .game-layout {
        margin-top: 20px;
    }

    .desktop-year-view {
        display: flex;
        flex-direction: column;
        gap: 12px;
        min-width: 0;
        align-self: start;
    }

    .desktop-year-view {
        gap: 8px;
    }

    .topbar {
        padding-inline: max(var(--content-gutter),calc((100% - var(--content-max-width))/2 + var(--content-gutter)));
        background: var(--paper);
        backdrop-filter: none;
    }
}

@media(max-width:360px) {
    .mobile-bottom-nav button>small { font-size: 11.5px; }
}
