/* Family Games: the shell (ported from LB5's app.css) plus the few page styles the scaffold uses. Colours come from
   MudBlazor's --mud-palette-* variables (FamilyGamesTheme), so dark mode needs nothing here. */

.muted {
    color: var(--mud-palette-text-secondary);
}

body {
    background: var(--mud-palette-background);
}

/* ── App shell ────────────────────────────────────────────────────────────
   position:fixed so the shell itself can never scroll (on iOS a document-level scroll drags fixed bars along),
   sized with 100dvh rather than inset:0/100vh (which overshoots the visible area on iOS). Only .app-main scrolls. */

html:has(.app-shell),
body:has(.app-shell) {
    height: 100%;
    overflow: hidden;
}

.app-shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-background);
}

.app-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ── Floating header pill ── */

.app-top {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.app-top > * {
    pointer-events: auto;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 1240px;
    height: 60px;
    padding: 0 10px 0 18px;
    border-radius: 999px;
    background: var(--mud-palette-appbar-background);
    color: var(--mud-palette-appbar-text);
    box-shadow: 0 10px 30px rgba(60, 20, 120, 0.16);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    flex-shrink: 0;
}

.app-logo {
    font-size: 1.6rem;
    line-height: 1;
}

.app-wordmark {
    font-family: Fredoka, Nunito, system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
}

.app-wordmark-accent {
    color: var(--mud-palette-secondary);
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

.user-chip {
    font-weight: 800;
    max-width: 180px;
}

/* Desktop links, centred in the pill; hidden on phones (the tab bar takes over). */
.top-nav {
    display: none;
    flex: 1 1 auto;
    justify-content: center;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.top-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--mud-palette-text-secondary);
    font-weight: 800;
    text-decoration: none;
}

.top-nav-link:hover {
    background: var(--mud-palette-background-gray);
}

.top-nav-link.active {
    color: var(--mud-palette-primary);
    background: var(--mud-palette-background-gray);
}

@media (max-width: 599px) {
    .app-top {
        top: calc(8px + env(safe-area-inset-top));
        left: 8px;
        right: 8px;
    }

    .app-header {
        height: 52px;
    }

    .app-wordmark {
        font-size: 1.15rem;
    }
}

/* ── Main content ── */

.app-main {
    flex: 1 1 auto;
    min-height: 0;   /* a flex item won't shrink below its content without this, and then it can't scroll */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Room for the floating header, which sits below the status bar in the apps (edge to edge). */
.sticky-content {
    padding-top: calc(96px + env(safe-area-inset-top));
    padding-bottom: 48px;
}

@media (max-width: 599px) {
    .sticky-content {
        padding-top: calc(80px + env(safe-area-inset-top));
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* ── Bottom tab bar (phone) ── a flow element at the bottom of the flex column, not fixed. */

.sticky-bottom-nav {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: color-mix(in srgb, var(--mud-palette-surface) 92%, transparent);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-top: 1px solid var(--mud-palette-lines-default);
    padding-bottom: env(safe-area-inset-bottom);
}

.sticky-bottom-nav .sbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 0 6px;
    text-decoration: none;
    color: var(--mud-palette-text-secondary);
    font-size: 11px;
    font-weight: 800;
}

.sticky-bottom-nav .sbn-item .mud-icon-root {
    font-size: 26px;
}

.sticky-bottom-nav .sbn-item.active {
    color: var(--mud-palette-primary);
}

/* ── Desktop (>=900px): links in the header replace the tab bar. Pure CSS, so no flash and it works in MAUI. ── */
@media (min-width: 900px) {
    .top-nav {
        display: flex;
    }

    .sticky-bottom-nav {
        display: none;
    }

    .sticky-content {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}

/* ── Boot (first launch signs the device in) ── */

.boot-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: var(--mud-palette-background);
}

.boot-logo {
    font-size: 64px;
    animation: boot-bounce 900ms ease-in-out infinite alternate;
}

@keyframes boot-bounce {
    from { transform: translateY(0) rotate(-8deg); }
    to { transform: translateY(-12px) rotate(8deg); }
}

@media (prefers-reduced-motion: reduce) {
    .boot-logo { animation: none; }
}

/* ── Cards and pages ── */

.card {
    border-radius: 20px !important;
    border: 1px solid var(--mud-palette-lines-default);
}

.hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--mud-palette-primary) 14%, var(--mud-palette-surface)),
                                        color-mix(in srgb, var(--mud-palette-secondary) 12%, var(--mud-palette-surface)));
}

.hero-avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    font-size: 40px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.hero-title {
    overflow-wrap: anywhere;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 16px;
}

.game-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    border-radius: 20px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
}

.game-tile-empty {
    border-style: dashed;
}

.game-tile-icon {
    font-size: 36px;
}

.avatar-picker,
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.avatar-choice {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid transparent;
    font-size: 28px;
    cursor: pointer;
}

.color-choice {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
}

.avatar-choice.selected,
.color-choice.selected {
    border-color: var(--mud-palette-text-primary);
}

.avatar-choice:focus-visible,
.color-choice:focus-visible {
    outline: 3px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.login-wrap {
    max-width: 420px;
    margin: 0 auto;
}

.login-logo {
    font-size: 56px;
    text-align: center;
}

.player-badge {
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    line-height: 1;
}

/* ── Nearby ── */

.nearby-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 20px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    color: inherit;
    text-decoration: none;
}

.nearby-cta:hover {
    border-color: var(--mud-palette-primary);
}

.nearby-cta-icon {
    font-size: 32px;
}

.nearby-cta-title {
    display: block;
    font-weight: 800;
}

.nearby-cta-sub {
    display: block;
    font-size: .9rem;
}

.nearby-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}

.location-steps {
    text-align: left;
    padding-left: 1.4em;
    margin-top: 0;
    line-height: 1.5;
}

.location-steps li + li {
    margin-top: 6px;
}

.nearby-radar {
    font-size: 48px;
    margin-bottom: 8px;
}

.nearby-radar.pulse {
    animation: nearby-pulse 1.6s ease-in-out infinite;
}

@keyframes nearby-pulse {
    50% { transform: scale(1.12); opacity: .7; }
}

@media (prefers-reduced-motion: reduce) {
    .nearby-radar.pulse { animation: none; }
}

.nearby-visible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.nearby-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nearby-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
}

.nearby-who {
    flex: 1 1 auto;
    min-width: 0;
}

.nearby-name {
    font-weight: 800;
    overflow-wrap: anywhere;
}

.nearby-what {
    font-size: .9rem;
}

.game-tile-link {
    color: inherit;
    text-decoration: none;
    transition: transform 120ms ease, border-color 120ms ease;
}

.game-tile-link:hover {
    border-color: var(--mud-palette-primary);
    transform: translateY(-2px);
}

/* ── Tank Tussle ── */

.tt-hero {
    display: flex;
    align-items: center;
    gap: 18px;
}

.tt-hero-icon {
    font-size: 56px;
}

.tt-start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 16px;
}

.tt-code-input input {
    text-transform: uppercase;
    letter-spacing: .3em;
    font-weight: 800;
    font-size: 1.3rem;
    max-width: 8ch;
}

.tt-lobby {
    display: grid;
    gap: 16px;
}

.tt-code-card {
    text-align: center;
}

.tt-code {
    font-family: Fredoka, Nunito, system-ui, sans-serif;
    font-size: 3.2rem;
    font-weight: 600;
    letter-spacing: .25em;
    color: var(--mud-palette-secondary);
}

.tt-players {
    display: grid;
    gap: 8px;
}

.tt-player {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tt-player-name {
    font-weight: 800;
    overflow-wrap: anywhere;
}

.tt-arenas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
    gap: 10px;
}

.tt-arena {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
    border: 3px solid transparent;
    background: var(--mud-palette-background-gray);
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.tt-arena.selected {
    border-color: var(--mud-palette-secondary);
}

.tt-arena:disabled {
    cursor: default;
}

.tt-arena:disabled:not(.selected) {
    opacity: .55;
}

.arena-thumb {
    width: 100%;
    aspect-ratio: 32 / 20;
    border-radius: 8px;
}

.tt-lobby-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.tt-scoreboard {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tt-score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: var(--mud-palette-surface);
    border: 2px solid var(--tt-color);
    font-weight: 800;
}

.tt-score.mine {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tt-color) 35%, transparent);
}

.tt-score-name {
    max-width: 12ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt-score-value {
    font-family: Fredoka, Nunito, system-ui, sans-serif;
    font-size: 1.2rem;
}

.tt-clock {
    margin-left: auto;
    font-family: Fredoka, Nunito, system-ui, sans-serif;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
}

.tt-stage {
    position: relative;
}

.tt-stage.tt-hidden {
    display: none;
}

.tt-canvas {
    display: block;
    width: 100%;
    border-radius: 16px;
    touch-action: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.tt-results {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, .35);
    border-radius: 16px;
}

.tt-results-card {
    width: min(100%, 420px);
}

.tt-standings {
    display: grid;
    gap: 8px;
}

.tt-standing {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.tt-standing-score {
    margin-left: auto;
    font-family: Fredoka, Nunito, system-ui, sans-serif;
    font-size: 1.3rem;
}

/* Controls: a thumb-stick and a Fire button on touch screens; a keyboard hint elsewhere. */
.tt-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    user-select: none;
    -webkit-user-select: none;
}

.tt-stick,
.tt-fire {
    display: none;
}

.tt-keys {
    margin: 0 auto;
}

@media (pointer: coarse) {
    .tt-keys {
        display: none;
    }

    .tt-stick {
        display: grid;
        place-items: center;
        width: 132px;
        height: 132px;
        border-radius: 50%;
        background: color-mix(in srgb, var(--mud-palette-primary) 16%, var(--mud-palette-surface));
        border: 2px solid var(--mud-palette-lines-default);
        touch-action: none;
    }

    .tt-knob {
        width: 58px;
        height: 58px;
        border-radius: 50%;
        background: var(--mud-palette-primary);
        box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
        pointer-events: none;
    }

    .tt-fire {
        display: block;
        width: 112px;
        height: 112px;
        border-radius: 50%;
        border: 0;
        background: var(--mud-palette-secondary);
        color: #fff;
        font-family: Fredoka, Nunito, system-ui, sans-serif;
        font-size: 1.3rem;
        font-weight: 700;
        letter-spacing: .05em;
        box-shadow: 0 8px 18px color-mix(in srgb, var(--mud-palette-secondary) 45%, transparent);
        touch-action: none;
    }

    .tt-fire:active {
        transform: scale(.94);
    }
}

.tt-bot-level {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.tt-bot-level-label {
    font-weight: 800;
    margin-right: 4px;
}

.tt-level {
    padding: 6px 12px;
    border-radius: 999px;
    border: 2px solid var(--mud-palette-lines-inputs);
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.tt-level.selected {
    border-color: var(--mud-palette-secondary);
    background: color-mix(in srgb, var(--mud-palette-secondary) 14%, transparent);
}

.tt-level:disabled {
    cursor: default;
}

.tt-level:disabled:not(.selected) {
    opacity: .55;
}

/* ── Tank Tussle on a phone ──
   Portrait: a hint to turn sideways. Landscape (a phone, so a short screen): the match takes the whole screen — the
   app's header and tab bar step aside, the arena is sized to the screen's height, and the thumb-stick and Fire button
   sit either side of it. The page marks a match (and its results) with .tt-playing. */

.tt-rotate-hint {
    display: none;
}

@media (pointer: coarse) and (orientation: portrait) {
    .tt-game.tt-playing .tt-rotate-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 10px;
        color: var(--mud-palette-text-secondary);
        font-size: .9rem;
        font-weight: 700;
    }

    .tt-rotate-icon {
        display: inline-block;
        animation: tt-rotate 2.4s ease-in-out infinite;
    }

    @keyframes tt-rotate {
        0%, 30% { transform: rotate(0); }
        50%, 80% { transform: rotate(-90deg); }
        100% { transform: rotate(0); }
    }

    @media (prefers-reduced-motion: reduce) {
        .tt-rotate-icon { animation: none; }
    }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
    .app-shell:has(.game-fullscreen) .app-top,
    .app-shell:has(.game-fullscreen) .sticky-bottom-nav {
        display: none;
    }

    .app-shell:has(.game-fullscreen) .app-main {
        overflow: hidden;
    }

    .app-shell:has(.game-fullscreen) .sticky-content {
        max-width: none;
        padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(10px, env(safe-area-inset-left)) !important;
    }

    .tt-game.tt-playing {
        --tt-side: 132px;          /* each control column */
        --tt-top: 46px;            /* the scoreboard row */
        height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: var(--tt-side) 1fr var(--tt-side);
        grid-template-rows: var(--tt-top) 1fr;
        align-items: center;
        column-gap: 10px;
    }

    .tt-game.tt-playing .tt-scoreboard {
        grid-column: 1 / -1;
        grid-row: 1;
        margin: 0;
        justify-content: center;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .tt-game.tt-playing .tt-score {
        padding: 2px 8px 2px 2px;
        font-size: .85rem;
    }

    .tt-game.tt-playing .tt-score .player-badge {
        width: 24px !important;
        height: 24px !important;
        font-size: 13px !important;
    }

    .tt-game.tt-playing .tt-clock {
        margin-left: 12px;
    }

    .tt-game.tt-playing .tt-stage {
        grid-column: 2;
        grid-row: 2;
        justify-self: center;
        /* As big as fits: the full width between the controls, or the height left under the scoreboard (32:20). */
        width: min(100%, calc((100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--tt-top) - 8px) * 1.6));
    }

    .tt-game.tt-playing .tt-canvas {
        border-radius: 10px;
    }

    .tt-game.tt-playing .tt-controls {
        display: contents;
    }

    .tt-game.tt-playing .tt-stick {
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
        width: 120px;
        height: 120px;
    }

    .tt-game.tt-playing .tt-fire {
        grid-column: 3;
        grid-row: 2;
        justify-self: center;
        width: 100px;
        height: 100px;
    }
}

.tt-results-card {
    max-height: 100%;
    overflow-y: auto;
}

/* ── Paddle Royale ── a square arena; in landscape on a phone it's as tall as the screen. */

.pr-stage {
    position: relative;
    width: min(100%, 640px);
    margin: 0 auto;
}

.pr-stage.tt-hidden {
    display: none;
}

.pr-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 20px;
    touch-action: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

.pr-pill {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-weight: 800;
    font-size: .9rem;
    white-space: nowrap;
}

.pr-hint {
    text-align: center;
    margin-top: 12px;
}

.pr-rank {
    font-family: Fredoka, Nunito, system-ui, sans-serif;
    width: 2.2em;
    color: var(--mud-palette-text-secondary);
}

@media (pointer: coarse) {
    .pr-hint { display: none; }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
    .pr-game.pr-playing {
        height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        display: grid;
        place-items: center;
    }

    .pr-game.pr-playing .pr-stage {
        width: min(100%, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 8px));
    }
}

/* ── Name That Tune ── (the original's stage animations: fade-up per state, pulsing countdown, preview sweep,
   equalizer, champion shimmer). The TV screen (.ntt-screen) scales everything up for across-the-room reading. */

.ntt-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 12px;
}

.ntt-mode {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 16px;
    border-radius: 18px;
    border: 3px solid transparent;
    background: var(--mud-palette-surface);
    color: inherit;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--mud-palette-lines-default);
}

.ntt-mode.selected {
    border-color: var(--mud-palette-secondary);
}

.ntt-mode-icon { font-size: 32px; }
.ntt-mode-title { font-weight: 800; font-size: 1.05rem; }
.ntt-mode-detail { font-size: .9rem; }

.ntt-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ntt-sound {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 12px;
    border: 0;
    border-radius: 14px;
    background: var(--mud-palette-secondary);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.ntt-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 720px;
    margin: 0 auto;
    animation: ntt-in 400ms ease both;
}

@keyframes ntt-in {
    from { opacity: 0; transform: translateY(10px); }
}

.ntt-round {
    font-weight: 800;
    color: var(--mud-palette-text-secondary);
    letter-spacing: .04em;
}

.ntt-countdown {
    font-family: Fredoka, Nunito, system-ui, sans-serif;
    font-size: 7rem;
    line-height: 1;
    color: var(--mud-palette-secondary);
    animation: ntt-pulse 1s ease-in-out infinite;
}

@keyframes ntt-pulse {
    50% { transform: scale(1.12); }
}

.ntt-caption {
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
    text-align: center;
}

.ntt-sweep {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--mud-palette-lines-default);
    overflow: hidden;
}

.ntt-sweep span {
    display: block;
    height: 100%;
    background: var(--mud-palette-secondary);
    animation: ntt-sweep var(--ntt-ms, 3000ms) linear both;
}

@keyframes ntt-sweep {
    from { width: 0; }
    to { width: 100%; }
}

.ntt-choices {
    display: grid;
    gap: 10px;
    width: 100%;
}

.ntt-choice {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 68px;
    padding: 12px 16px;
    border: 0;
    border-radius: 16px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 120ms ease, opacity 300ms ease;
}

.ntt-choice:not(:disabled):active {
    transform: scale(.97);
}

.ntt-choice:disabled:not(.gone) {
    opacity: .75;
    cursor: default;
}

.ntt-choice.gone {
    opacity: .12;
    transform: scale(.96);
    cursor: default;
}

.ntt-choice-artist {
    font-weight: 800;
    font-size: 1.2rem;
}

.ntt-choice-title {
    font-size: .95rem;
    opacity: .8;
}

.ntt-locked {
    padding: 16px 22px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--mud-palette-success) 18%, transparent);
    color: var(--mud-palette-success);
    font-weight: 800;
    font-size: 1.2rem;
}

.ntt-timer {
    font-family: Fredoka, Nunito, system-ui, sans-serif;
    font-size: 2.4rem;
    font-variant-numeric: tabular-nums;
}

.ntt-timer.big {
    font-size: 6rem;
    line-height: 1;
}

.ntt-timer small {
    font-size: .5em;
    margin-left: 2px;
}

.ntt-eq {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 48px;
}

.ntt-eq span {
    width: 10px;
    height: 55%;   /* at rest (reduced motion): still an equalizer */
    border-radius: 4px;
    background: var(--mud-palette-secondary);
    animation: ntt-eq 900ms ease-in-out infinite alternate;
}

.ntt-eq span:nth-child(2) { animation-delay: -200ms; }
.ntt-eq span:nth-child(3) { animation-delay: -450ms; }
.ntt-eq span:nth-child(4) { animation-delay: -650ms; }
.ntt-eq span:nth-child(5) { animation-delay: -100ms; }

@keyframes ntt-eq {
    from { height: 15%; }
    to { height: 100%; }
}

.ntt-locks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 10px;
    width: 100%;
}

.ntt-lock {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
}

.ntt-lock-name { font-weight: 800; }

.ntt-lock-state {
    margin-left: auto;
    color: var(--mud-palette-text-secondary);
    animation: ntt-blink 1.2s ease-in-out infinite;
}

.ntt-lock.in .ntt-lock-state {
    color: var(--mud-palette-success);
    font-weight: 800;
    animation: none;
}

@keyframes ntt-blink {
    50% { opacity: .3; }
}

.ntt-verdict {
    font-family: Fredoka, Nunito, system-ui, sans-serif;
    font-size: 3rem;
    animation: ntt-pop 450ms cubic-bezier(.2, 1.4, .4, 1) both;
}

.ntt-verdict.right { color: var(--mud-palette-success); }
.ntt-verdict.wrong { color: var(--mud-palette-error); }

@keyframes ntt-pop {
    from { transform: scale(.6); opacity: 0; }
}

.ntt-reveal {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ntt-art {
    width: 120px;
    height: 120px;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
    animation: ntt-pop 500ms cubic-bezier(.2, 1.4, .4, 1) both;
}

.ntt-art.big {
    width: 200px;
    height: 200px;
}

.ntt-reveal-artist {
    font-weight: 800;
    font-size: 1.4rem;
}

.ntt-reveal-title {
    color: var(--mud-palette-text-secondary);
}

.ntt-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 12px;
    width: 100%;
}

.ntt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-weight: 700;
}

.ntt-row.faded { opacity: .5; }
.ntt-row-name { overflow-wrap: anywhere; }
.ntt-row-time { margin-left: auto; color: var(--mud-palette-text-secondary); font-variant-numeric: tabular-nums; }
.ntt-row-pts { min-width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; }
.ntt-row-pts.right { color: var(--mud-palette-success); }
.ntt-row-pts.wrong { color: var(--mud-palette-error); }
.ntt-standings .ntt-row-name { flex: 1; }

.ntt-standings.final {
    width: 100%;
    max-width: 520px;
}

.ntt-row.champion {
    padding: 8px 10px;
    border-radius: 12px;
    background: linear-gradient(100deg, #FFE066 0%, #FFD43B 40%, #FFF3BF 50%, #FFD43B 60%, #FFE066 100%);
    background-size: 200% 100%;
    color: #3B2A00;
    animation: ntt-shimmer 2.4s linear infinite;
}

@keyframes ntt-shimmer {
    to { background-position: -200% 0; }
}

.ntt-gameover {
    font-family: Fredoka, Nunito, system-ui, sans-serif;
    font-size: 3rem;
}

.ntt-total {
    font-weight: 800;
    font-size: 1.2rem;
}

.pr-pill.static {
    position: static;
    transform: none;
}

/* The shared screen is read from across the room. */
.ntt-screen .ntt-stage { max-width: 1100px; }
.ntt-screen .ntt-countdown { font-size: 12rem; }
.ntt-screen .ntt-round, .ntt-screen .ntt-caption { font-size: 1.5rem; }
.ntt-screen .ntt-reveal-artist { font-size: 2.2rem; }
.ntt-screen .ntt-reveal-title { font-size: 1.4rem; }
.ntt-screen .ntt-row { font-size: 1.15rem; }

@media (prefers-reduced-motion: reduce) {
    .ntt-stage, .ntt-countdown, .ntt-eq span, .ntt-verdict, .ntt-art, .ntt-row.champion, .ntt-lock-state { animation: none; }
}

/* A game's "nearby players can join" strip (NearbyBeacon), above the lobby. */
.nearby-beacon {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.nearby-beacon-icon {
    font-size: 28px;
    flex: none;
}

.nearby-beacon-icon.pulse {
    animation: nearby-pulse 1.6s ease-in-out infinite;
}

.nearby-beacon-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.35;
}

.nearby-beacon .mud-button-root {
    flex: none;
}
