/* The Okona app (okona-tv W1 step 2). Dark only: a TV-style surface (the
   mockups, D33). Tokens come from /styles.css; its html/body reset clips
   overflow for the landing page, so this page scrolls again. */

html, body {
    height: auto;
    min-height: 100%;
    overflow: visible;
}

body.okapp {
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

body.okapp-playing {
    overflow: hidden;
}

.okapp a { color: inherit; text-decoration: none; }
.okapp img { display: block; }

.okapp :focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}
.okapp h1:focus { outline: none; }

.okapp-icon { display: inline-flex; }

.okapp-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.okapp-message {
    padding: 64px 56px;
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 500;
}

/* ---------- header ---------- */

.okapp-header {
    height: 76px;
    flex-shrink: 0;
    padding: 0 56px;
    display: flex;
    align-items: center;
    gap: 32px;
    border-bottom: 1px solid var(--bg-secondary);
}

.okapp-wordmark {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 6px;
}

.okapp-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: color var(--transition-fast);
}
.okapp-back:hover { color: var(--text-primary); }

.okapp-header-fill { flex: 1 1 auto; }

/* ---------- the top bar: who's connected + the QR (D40) ---------- */

.okapp-session {
    display: flex;
    align-items: center;
    gap: 20px;
}
.okapp-session[hidden] { display: none; }

.okapp-join {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px 6px 6px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.okapp-join:hover { background: var(--bg-surface); }
.okapp-join-qr {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    background: #FFFFFF;
    padding: 3px;
    flex-shrink: 0;
}
.okapp-join-qr.is-waiting,
.okapp-join-big.is-waiting {
    display: block;
    background: var(--bg-surface);
    animation: okapp-pulse 1.4s ease-in-out infinite;
}
.okapp-join-qr[hidden],
.okapp-join-big[hidden] { display: none; }
.okapp-join-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.okapp-join-text strong { font-size: 0.9375rem; }
.okapp-join-text span { font-size: 0.8125rem; color: var(--text-secondary); }
.okapp-inline-glyph { display: inline-flex; vertical-align: -2px; margin: 0 1px; }
.okapp-inline-glyph svg { width: 1em; height: 1em; }

/* The join pop-up: the big QR (join.js). */
.okapp-join-dialog {
    margin: auto;
    border: 0;
    border-radius: 20px;
    padding: 32px 48px 28px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
}
.okapp-join-dialog::backdrop { background: rgba(13, 27, 42, 0.85); }
.okapp-join-mark {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}
.okapp-join-big {
    display: block;
    width: min(420px, 70vw, calc(100vh - 300px));
    height: min(420px, 70vw, calc(100vh - 300px));
    margin: 0 auto 20px;
    background: #FFFFFF;
    padding: 14px;
    border-radius: 14px;
}
.okapp-join-title { font-size: 1.5rem; font-weight: 700; }
.okapp-join-sub { margin-top: 6px; color: var(--text-secondary); max-width: 420px; margin-left: auto; margin-right: auto; }
.okapp-join-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}
.okapp-join-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
}
.okapp-join-action:hover { background: var(--bg-surface-hover); }
.okapp-join-action:focus { outline: none; }
.okapp-join-action:focus-visible,
.okapp-join-action:focus,
.okapp-join-action.is-pad-focus { box-shadow: 0 0 0 3px var(--color-gold); }
.okapp-join-hint { margin-top: 18px; }

/* The emoji picker: one seat's emoji (avatar.js, D43). */
.okapp-avatar-dialog {
    margin: auto;
    border: 0;
    border-radius: 20px;
    padding: 28px 40px 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
}
.okapp-avatar-dialog::backdrop { background: rgba(13, 27, 42, 0.85); }
.okapp-avatar-title { font-size: 1.5rem; font-weight: 700; }
.okapp-avatar-sub { margin-top: 4px; color: var(--text-secondary); }
.okapp-avatar-grid {
    display: grid;
    grid-template-columns: repeat(8, 64px);
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}
.okapp-avatar-cell {
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 14px;
    background: var(--bg-surface);
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 2.125rem;
    line-height: 1;
    cursor: pointer;
}
.okapp-avatar-cell:hover { background: var(--bg-surface-hover); }
.okapp-avatar-cell.is-current { box-shadow: inset 0 0 0 2px var(--text-secondary); }
.okapp-avatar-cell:focus { outline: none; }
.okapp-avatar-cell:focus,
.okapp-avatar-cell:focus-visible,
.okapp-avatar-cell.is-pad-focus { box-shadow: 0 0 0 3px var(--color-gold); background: var(--bg-surface-hover); }

.okapp-seats {
    display: flex;
    gap: 8px;
}
.okapp-seat {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gold);
    color: var(--bg-primary);
    font-weight: 700;
    font-size: 0.9375rem;
    flex-shrink: 0;
}
/* In the top bar a seat is a button: a filled one opens its emoji picker (D43). */
button.okapp-seat {
    border: 0;
    padding: 0;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
}
button.okapp-seat:disabled { cursor: default; }
button.okapp-seat:not(:disabled):hover { box-shadow: 0 0 0 2px var(--text-primary); }
.okapp-seat-emoji {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.25rem;
    line-height: 1;
}
.okapp-seat.is-gamepad { background: #5BC0BE; }
.okapp-seat.is-away { opacity: 0.4; }
.okapp-seat.is-empty {
    background: transparent;
    border: 2px dashed var(--bg-surface-hover);
}
.okapp-seat-kind {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.okapp-seat-kind svg { width: 11px; height: 11px; }

/* A join code while the room is still being made. */
.okapp-menu-qr.is-waiting {
    display: block;
    background: var(--bg-surface);
    animation: okapp-pulse 1.4s ease-in-out infinite;
}
.okapp-menu-qr[hidden] { display: none; }
@keyframes okapp-pulse { 50% { opacity: 0.5; } }

/* ---------- the Okona menu (step 4) ---------- */

.okapp-menu {
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    overflow: visible;
}
.okapp-menu::backdrop { background: rgba(13, 27, 42, 0.92); }
.okapp-menu-panel {
    display: flex;
    gap: 40px;
    padding: 44px 48px;
    border-radius: 20px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 120px);
    overflow: auto;
}
.okapp-menu-side {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.okapp-menu-mark {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--text-secondary);
}
.okapp-menu-title {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}
.okapp-menu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.okapp-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 60px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.okapp-menu-item:hover { background: var(--bg-surface); }
.okapp-menu-item:focus { outline: none; }
.okapp-menu-item:focus-visible,
.okapp-menu-item:focus,
.okapp-menu-item.is-pad-focus {
    background: var(--bg-surface-hover);
    box-shadow: 0 0 0 3px var(--color-gold);
}
.okapp-menu-icon { display: inline-flex; color: var(--color-gold); }

.okapp-menu-join {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.okapp-menu-join h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.okapp-menu-players {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.okapp-menu-player {
    display: flex;
    align-items: center;
    gap: 14px;
}
.okapp-menu-player .okapp-seat { width: 42px; height: 42px; font-size: 1.0625rem; }
.okapp-menu-player .okapp-seat-emoji { font-size: 1.5rem; }
.okapp-menu-player-text { display: flex; flex-direction: column; line-height: 1.25; }
.okapp-menu-player-text strong { font-size: 1.125rem; }
.okapp-menu-player-text span { font-size: 0.875rem; color: var(--text-secondary); }
.okapp-menu-empty { color: var(--text-secondary); }
.okapp-menu-add {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-top: 6px;
    padding: 16px;
    border-radius: 14px;
    background: var(--bg-primary);
}
.okapp-menu-qr {
    width: 240px;
    height: 240px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #FFFFFF;
    padding: 10px;
}
.okapp-menu-add-text { display: flex; flex-direction: column; gap: 6px; max-width: 220px; }
.okapp-menu-add-text strong { font-size: 1.25rem; }
.okapp-menu-add-text span { font-size: 0.9375rem; color: #D6E0EA; line-height: 1.45; }
.okapp-menu-hint { margin-top: 18px; }

/* ---------- controller hints: position glyphs + labels ---------- */

.okapp-hints {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 32px;
    font-size: 1rem;
    color: var(--text-secondary);
}
.okapp-hint { display: inline-flex; align-items: center; gap: 8px; }
.okapp-hint-or { color: var(--text-muted); margin: 0 -2px; }
.okapp-hint-glyph { display: inline-flex; color: var(--text-primary); }
.okapp-hint-label { font-weight: 600; }

/* The hint bar on Okona's screens (controllers connected; never in a game). */
.okapp-hintbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 16px 56px calc(16px + env(safe-area-inset-bottom));
    background: var(--bg-primary);
    border-top: 1px solid var(--bg-secondary);
}
.okapp-hintbar[hidden] { display: none; }
.okapp-hintbar .okapp-hints { justify-content: flex-end; }
body.okapp-has-hintbar { padding-bottom: 66px; }

/* Controllers driving the page: a bold ring on whatever has focus.
   .is-pad-focus = the same ring drawn by the app (app.js syncPadFocus), so it
   shows while Chrome isn't the active window (Chrome draws :focus only there). */
.okapp-pad-nav .okapp-page a:focus,
.okapp-pad-nav .okapp-page button:focus,
.okapp-pad-nav .okapp-page a.is-pad-focus,
.okapp-pad-nav .okapp-page button.is-pad-focus,
.okapp-pad-nav .okapp-page input:focus,
.okapp-pad-nav .okapp-page input.is-pad-focus {
    outline: 3px solid var(--color-gold);
    outline-offset: 3px;
}
.okapp-pad-nav .okapp-tile:focus .okapp-tile-frame,
.okapp-pad-nav .okapp-tile.is-pad-focus .okapp-tile-frame {
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px var(--color-gold);
}
.okapp-pad-nav .okapp-page .okapp-tile:focus,
.okapp-pad-nav .okapp-page .okapp-tile.is-pad-focus { outline: none; }

/* ---------- buttons ---------- */

.okapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 28px;
    border: 0;
    border-radius: var(--radius-md);
    font: inherit;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.okapp-btn-play {
    background: var(--color-gold);
    color: var(--bg-primary);
}
.okapp-btn-play:hover { background: var(--color-gold-light); }

.okapp-btn-secondary {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    font-weight: 600;
}
.okapp-btn-secondary:hover { background: #35587F; }

.okapp-btn-wide { width: 100%; height: 56px; }

/* ---------- the catalog ---------- */

.okapp-home {
    padding: 28px 56px 64px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.okapp-hero {
    min-height: 400px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    display: flex;
    overflow: hidden;
}

.okapp-hero-copy {
    flex: 0 0 560px;
    max-width: 560px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.okapp-eyebrow {
    font-size: 0.875rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-gold);
    font-weight: 600;
}

.okapp-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.05;
}

.okapp-meta {
    font-size: 1rem;
    color: var(--text-secondary);
}

.okapp-hero-desc {
    font-size: 1.1875rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.okapp-hero-desc[hidden] { display: none; }   /* -webkit-box would beat the attribute */

.okapp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

/* Several featured games (2026-10-14): the hero swaps between them and the
   new one fades in; the pips show which one it is (never focusable). */
.okapp-hero.is-swapped .okapp-hero-copy,
.okapp-hero.is-swapped .okapp-hero-art { animation: okapp-hero-in 450ms ease-out; }
@keyframes okapp-hero-in { from { opacity: 0; } to { opacity: 1; } }
.okapp-hero-pips { display: flex; margin-top: 4px; }
.okapp-hero-pip {
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    opacity: 0.35;
    transition: opacity 300ms ease, background-color 300ms ease;
}
.okapp-hero-pip.is-current { background: var(--color-gold); opacity: 1; }

.okapp-hero-art {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--bg-surface);
    position: relative;
}
.okapp-hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* No screenshot: the icon, or the title as a word mark, centered. */
.okapp-hero-art.is-icon,
.okapp-tile-art.is-icon,
.okapp-stage-fallback.is-icon,
.okapp-hero-art.is-word,
.okapp-tile-art.is-word,
.okapp-stage-fallback.is-word {
    display: flex;
    align-items: center;
    justify-content: center;
}
.okapp-hero-art.is-icon img { width: 45%; max-width: 240px; height: auto; object-fit: contain; border-radius: 22%; }
.okapp-tile-art.is-icon img { width: 40%; height: auto; object-fit: contain; border-radius: 22%; }
.okapp-stage-fallback.is-icon img { width: 30%; height: auto; object-fit: contain; border-radius: 22%; }
.okapp-hero-art.is-word span,
.okapp-tile-art.is-word span,
.okapp-stage-fallback.is-word span {
    padding: 0 16px;
    text-align: center;
    font-weight: 700;
    color: var(--text-secondary);
}
.okapp-hero-art.is-word span { font-size: 2.5rem; }
.okapp-tile-art.is-word span { font-size: 1.25rem; }
.okapp-stage-fallback.is-word span { font-size: 2rem; }

.okapp-row h2 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.okapp-tiles {
    list-style: none;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    /* room for the focus ring and the hover lift inside the scroller */
    padding: 6px 6px 12px;
    margin: -6px -6px 0;
    scrollbar-width: thin;
}
.okapp-tiles > li { flex: 0 0 250px; }

.okapp-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.okapp-tile-frame {
    position: relative;
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.okapp-tile-art {
    aspect-ratio: 16 / 9;
    background: var(--bg-surface);
}
.okapp-tile-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.okapp-tile:hover .okapp-tile-frame,
.okapp-tile:focus-visible .okapp-tile-frame {
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px var(--color-gold);
}
.okapp-tile:focus-visible { outline: none; }

.okapp-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--color-gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.okapp-tile-title {
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- a game's page ---------- */

.okapp-game {
    padding: 40px 56px 64px;
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.okapp-game-media {
    flex: 0 1 800px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.okapp-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    overflow: hidden;
}
.okapp-stage > img,
.okapp-stage > iframe,
.okapp-stage-fallback {
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}
.okapp-btn-trailer {
    position: absolute;
    left: 20px;
    bottom: 20px;
    height: 44px;
    padding: 0 20px;
    font-size: 1rem;
    background: rgba(13, 27, 42, 0.85);
    color: var(--text-primary);
}
.okapp-btn-trailer:hover { background: var(--bg-primary); }

.okapp-shots h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.okapp-shots ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.okapp-shot {
    display: block;
    width: 190px;
    aspect-ratio: 16 / 9;
    border: 0;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    cursor: pointer;
}
.okapp-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition-fast);
}
.okapp-shot:hover img { opacity: 0.8; }

.okapp-game-info {
    flex: 1 1 360px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.okapp-game-info h1 {
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1.05;
    overflow-wrap: anywhere;
}
/* "by {studio}" under the game's title (D53) */
.okapp-by {
    margin-top: -0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gold);
}

.okapp-desc {
    font-size: 1.1875rem;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.okapp-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    padding: 24px;
    border-radius: 12px;
    background: var(--bg-secondary);
}
.okapp-facts dt {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.okapp-facts dd {
    font-size: 1.125rem;
    font-weight: 600;
}

.okapp-howto h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.okapp-howto ol {
    list-style: none;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.okapp-howto li {
    counter-increment: step;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.0625rem;
    color: #D6E0EA;
}
.okapp-howto li::before {
    content: counter(step);
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.okapp-notice {
    padding: 96px 56px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}
.okapp-notice h1 { font-size: 2rem; font-weight: 700; }
.okapp-notice p { color: var(--text-secondary); font-size: 1.0625rem; }

/* Okona Plus (W3): the gate page. */
.okapp-gate { max-width: 720px; }
.okapp-gate .okapp-auth-mark { margin-bottom: -8px; }

/* ---------- play ---------- */

.okapp-play {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #000;
}

.okapp-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.okapp-loading {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    transition: opacity 400ms ease;
}
.okapp-loading.is-done {
    opacity: 0;
    pointer-events: none;
}
.okapp-loading-mark {
    position: absolute;
    top: 32px;
    left: 40px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--text-secondary);
}
.okapp-loading-icon {
    width: 180px;
    height: 180px;
    border-radius: 36px;
    background: var(--bg-surface);
    object-fit: cover;
}
.okapp-loading-icon.is-word {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.okapp-loading h1 {
    font-size: 2.75rem;
    font-weight: 700;
    text-align: center;
    padding: 0 24px;
}
.okapp-loading p {
    font-size: 1.0625rem;
    color: var(--text-secondary);
}
.okapp-loading-bar {
    width: 360px;
    max-width: 80vw;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-secondary);
    overflow: hidden;
}
.okapp-loading-bar span {
    display: block;
    width: 35%;
    height: 100%;
    border-radius: 3px;
    background: var(--color-gold);
    animation: okapp-indeterminate 1.4s ease-in-out infinite;
}
@keyframes okapp-indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(290%); }
}

/* Focus sentinels around the game frame: Shift+Tab out of the game lands on
   one and opens the menu. Invisible, never drawn over the game. */
.okapp-sentinel {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.okapp-loading-hint {
    position: absolute;
    bottom: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--bg-secondary);
    color: #D6E0EA;
    font-size: 1rem;
    text-align: center;
}
.okapp-loading-hint-icon { display: inline-flex; color: var(--color-gold); }

/* The Shift+Tab hint over a game, after the Okona menu is closed by hand with
   nobody connected (D49): a few seconds, never focusable or clickable. */
.okapp-play-hint {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    margin: 0;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--bg-secondary);
    color: #D6E0EA;
    font-size: 1.125rem;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    transition: opacity 400ms ease;
}
.okapp-play-hint strong { color: var(--color-gold); }
.okapp-play-hint.is-done { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    .okapp-loading-bar span { animation-duration: 3s; }
    .okapp-tile-frame, .okapp-loading, .okapp-play-hint, .okapp-toast, .okapp-hero-pip { transition: none; }
    .okapp-hero.is-swapped .okapp-hero-copy, .okapp-hero.is-swapped .okapp-hero-art { animation: none; }
    .okapp-join-qr.is-waiting, .okapp-join-big.is-waiting, .okapp-menu-qr.is-waiting { animation: none; }
}

/* ---------- player accounts (okona-tv W2): the top-bar button, sign in, account ---------- */

.okapp-account-slot { display: flex; align-items: center; min-width: 44px; }
.okapp-signin { height: 44px; padding: 0 20px; font-size: 1rem; }
.okapp-account-badge-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gold);
    color: var(--bg-primary);
    font-weight: 700;
    font-size: 1.125rem;
}
.okapp-account-badge-btn:hover { background: var(--color-gold-light); }

.okapp-auth {
    display: flex;
    justify-content: center;
    padding: 56px 16px 80px;
}
.okapp-auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px 40px 32px;
    border-radius: 20px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
}
.okapp-auth-mark {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.okapp-auth-title { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.okapp-auth-sub { margin-top: 6px; color: var(--text-secondary); }
.okapp-auth-main, .okapp-auth-form { display: flex; flex-direction: column; }
.okapp-auth-main { margin-top: 24px; }
.okapp-auth-main[hidden], .okapp-auth-form[hidden], .okapp-auth-other[hidden] { display: none; }
.okapp-auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    font: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
}
.okapp-auth-google:hover { background: var(--bg-surface-hover); }
.okapp-auth-google:disabled { opacity: 0.6; cursor: default; }
.okapp-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.okapp-auth-divider::before, .okapp-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}
.okapp-auth-label { margin-top: 14px; margin-bottom: 6px; font-weight: 600; font-size: 0.9375rem; }
.okapp-input {
    height: 48px;
    width: 100%;
    padding: 0 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    font-size: 1rem;
}
.okapp-input:focus { outline: none; border-color: var(--color-gold); }
.okapp-auth-password { position: relative; }
.okapp-auth-password .okapp-input { padding-right: 72px; }
/* The TV's sign-in code typed on the phone (okona-tv T1 step 2). */
.okapp-tv-code { text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; font-size: 1.375rem; }
.okapp-auth-reveal {
    position: absolute;
    top: 6px;
    right: 6px;
    height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.okapp-auth-reveal:hover { color: var(--text-primary); }
.okapp-auth-hint { margin-top: 8px; font-size: 0.875rem; color: var(--text-secondary); }
.okapp-auth-submit { margin-top: 22px; width: 100%; }
.okapp-auth-submit:disabled { opacity: 0.6; cursor: default; }
.okapp-auth-error {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(229, 83, 75, 0.15);
    color: #FF8A80;
    font-size: 0.9375rem;
}
.okapp-auth-error[hidden], .okapp-auth-done[hidden] { display: none; }
.okapp-auth-done { margin-top: 20px; color: var(--text-primary); }
/* The email action page (action.js): its one way on. */
.okapp-action-body { margin-top: 24px; }
.okapp-action-go, .okapp-action-go:visited, .okapp-action-go:hover { text-decoration: none; width: 100%; color: var(--bg-primary); }
.okapp-auth-link { color: var(--color-gold); font-weight: 600; }
.okapp-auth-link:hover { text-decoration: underline; }
.okapp-auth-main > .okapp-auth-link { margin-top: 16px; align-self: flex-start; }
.okapp-auth-linkbtn { margin-top: 14px; align-self: center; border: 0; background: none; font: inherit; cursor: pointer; }
.okapp-auth-other { margin-top: 24px; color: var(--text-secondary); }

/* Get Okona Plus (W3, plus.js): the plan, then the payment. */
.okapp-plus-card { max-width: 520px; }
.okapp-plus-perks { margin: 20px 0 4px; padding: 0; list-style: none; }
.okapp-plus-perks li { position: relative; padding: 5px 0 5px 28px; color: var(--text-primary); }
.okapp-plus-perks li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 11px;
    width: 12px;
    height: 7px;
    border-left: 2.5px solid var(--color-gold);
    border-bottom: 2.5px solid var(--color-gold);
    transform: rotate(-45deg);
}
.okapp-plus-plans { display: flex; gap: 12px; margin-top: 20px; }
.okapp-plus-plan {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.okapp-plus-plan:hover { border-color: var(--text-secondary); }
.okapp-plus-plan.is-selected { border-color: var(--color-gold); box-shadow: 0 0 0 1px var(--color-gold); }
.okapp-plus-plan-name { font-weight: 700; font-size: 1.0625rem; }
.okapp-plus-plan-price strong { font-size: 1.5rem; }
.okapp-plus-plan-price span { margin-left: 2px; color: var(--text-secondary); }
.okapp-plus-plan-note {
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(232, 165, 37, 0.18);
    color: var(--color-gold);
    font-size: 0.8125rem;
    font-weight: 700;
}
.okapp-plus-summary { margin: 20px 0 4px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-primary); }
.okapp-plus-summary div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.okapp-plus-summary dt { color: var(--text-secondary); }
.okapp-plus-summary dd { margin: 0; text-align: right; }
.okapp-plus-element { min-height: 40px; }
.okapp-plus-legal { margin-top: 12px; }
@media (max-width: 480px) {
    .okapp-plus-plans { flex-direction: column; }
    .okapp-auth-card.okapp-plus-card { padding: 28px 20px 24px; }
}

.okapp-account { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.okapp-account-title { font-size: 2.25rem; font-weight: 700; margin-bottom: 24px; }
.okapp-account-card {
    border-radius: 16px;
    background: var(--bg-secondary);
    overflow: hidden;
}
.okapp-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
}
.okapp-account-row + .okapp-account-row { border-top: 1px solid var(--border-color); }
.okapp-account-row-label { font-weight: 700; }
.okapp-account-row-value { margin-top: 4px; }
.okapp-account-row-sub { margin-top: 4px; font-size: 0.9375rem; color: var(--text-secondary); }
.okapp-account-row-sub:empty { display: none; }
.okapp-account-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 700;
    vertical-align: 1px;
}
.okapp-account-badge.is-verified { background: rgba(91, 192, 190, 0.18); color: #5BC0BE; }
.okapp-account-verify .okapp-btn { flex-shrink: 0; height: 44px; font-size: 1rem; padding: 0 18px; }
.okapp-account-actions { margin-top: 24px; }
.okapp-account-section { margin-top: 28px; }
.okapp-account-section:first-child { margin-top: 0; }
.okapp-account-section-title { font-size: 1.125rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 10px; }
.okapp-account-card + .okapp-account-card { margin-top: 12px; }
.okapp-account-btn { flex-shrink: 0; height: 44px; font-size: 1rem; padding: 0 18px; }
.okapp-account-btn:disabled { opacity: 0.6; cursor: default; }
.okapp-account-row-wrap { align-items: flex-start; }
.okapp-account-confirm { margin-top: 12px; }

/* The toast (ui.js): top centre on Okona's own screens, never over a game. */
.okapp-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    max-width: calc(100vw - 32px);
    padding: 14px 24px;
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.0625rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    border: 1px solid var(--color-gold);
    transition: opacity 400ms ease;
}
.okapp-toast[hidden] { display: none; }
/* As a popover: undo the UA popover box (centred, bordered) and keep ours. */
.okapp-toast[popover] { margin: 0; inset: auto; top: 24px; left: 50%; overflow: visible; }
.okapp-toast.is-done { opacity: 0; }
body.okapp-playing .okapp-toast { display: none; }

/* The yes/no dialog (confirm.js). */
.okapp-confirm {
    margin: auto;
    border: 0;
    border-radius: 20px;
    padding: 32px 36px 28px;
    width: 460px;
    max-width: calc(100vw - 32px);
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.okapp-confirm::backdrop { background: rgba(13, 27, 42, 0.85); }
.okapp-confirm-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 12px; }
.okapp-confirm-message { margin: 0; color: var(--text-secondary); line-height: 1.5; }
.okapp-confirm-message[hidden] { display: none; }
.okapp-confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.okapp-confirm-btn { height: 48px; font-size: 1.0625rem; padding: 0 22px; }
.okapp-confirm-btn.is-pad-focus { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.okapp-account-confirm[hidden], .okapp-account-delete-panel[hidden], .okapp-account-btn[hidden] { display: none; }
.okapp-account-confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.okapp-account-delete {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}
.okapp-account-delete > .okapp-account-row-sub { margin: 0 0 16px; max-width: 560px; }
.okapp-account-delete-panel { margin-top: 16px; max-width: 420px; }
.okapp-account-delete-input { margin-top: 2px; max-width: 220px; letter-spacing: 2px; }
.okapp-btn-danger { background: #C0392B; color: #FFFFFF; }
.okapp-btn-danger:hover { background: #D64535; }
.okapp-btn-danger:disabled { opacity: 0.6; cursor: default; }
.okapp-btn-danger-ghost { background: transparent; color: #FF8A80; border: 2px solid rgba(229, 83, 75, 0.5); }
.okapp-btn-danger-ghost:hover { background: rgba(229, 83, 75, 0.12); }
.okapp-btn-danger-ghost:disabled { opacity: 0.6; cursor: default; }
/* Account → Membership (W3, membership.js): rows that open an editor below them. */
.okapp-plus-row { flex-wrap: wrap; align-items: flex-start; }
.okapp-plus-row > .okapp-plus-chooser, .okapp-plus-row > .okapp-plus-card-editor, .okapp-plus-row > .okapp-plus-history { flex-basis: 100%; }
.okapp-plus-chooser[hidden], .okapp-plus-card-editor[hidden] { display: none; }
.okapp-plus-chooser .okapp-plus-plans { margin-top: 4px; max-width: 460px; }
.okapp-plus-chooser .okapp-plus-plan.is-busy { opacity: 0.6; }
.okapp-plus-card-editor { max-width: 460px; }
.okapp-plus-card-editor .okapp-plus-element { margin-bottom: 12px; }
.okapp-plus-history { margin: 0; padding: 0; list-style: none; }
.okapp-plus-history li { display: flex; gap: 16px; align-items: baseline; padding: 6px 0; }
.okapp-plus-history li + li { border-top: 1px solid var(--border-color); }
.okapp-plus-history li > span:first-child { min-width: 120px; }
.okapp-plus-history li > span:nth-child(2) { min-width: 72px; font-weight: 600; }
.okapp-plus-history li > a { margin-left: auto; }
.okapp-account-gone { padding: 28px 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.okapp-account-gone .okapp-btn { margin-top: 10px; }

/* ---------- narrow windows ---------- */

@media (max-width: 900px) {
    .okapp-header { padding: 0 20px; gap: 20px; height: 64px; }
    .okapp-hintbar { padding-left: 20px; padding-right: 20px; }
    .okapp-hintbar .okapp-hints { justify-content: center; }
    .okapp-seat.is-empty, .okapp-join-text { display: none; }
    .okapp-session { gap: 12px; }
    .okapp-seat { width: 30px; height: 30px; }
    .okapp-join-qr { width: 40px; height: 40px; }
    .okapp-join-dialog { padding: 24px 20px; }
    .okapp-avatar-dialog { padding: 24px 16px 20px; }
    .okapp-back { white-space: nowrap; }
    .okapp-back + .okapp-wordmark { display: none; }   /* room for Sign in / the badge */
    .okapp-signin { height: 38px; padding: 0 14px; font-size: 0.9375rem; white-space: nowrap; }
    .okapp-account-badge-btn { width: 38px; height: 38px; }
    .okapp-auth { padding: 24px 12px 48px; }
    .okapp-auth-card { padding: 28px 20px 24px; }
    .okapp-account-row { flex-direction: column; align-items: flex-start; }
    .okapp-avatar-grid { grid-template-columns: repeat(6, 48px); gap: 8px; }
    .okapp-avatar-cell { width: 48px; height: 48px; font-size: 1.625rem; border-radius: 12px; }
    .okapp-menu-panel { flex-direction: column; padding: 28px 22px; gap: 24px; }
    .okapp-menu-side { flex: none; }
    .okapp-menu-add { flex-direction: column; align-items: flex-start; }
    .okapp-menu-qr { width: 200px; height: 200px; }
    .okapp-home { padding: 20px 16px 48px; gap: 32px; }
    .okapp-hero { flex-direction: column-reverse; min-height: 0; }
    .okapp-hero-copy { flex: none; max-width: none; padding: 24px; }
    .okapp-hero h1 { font-size: 2.25rem; }
    .okapp-hero-art { aspect-ratio: 16 / 9; }
    .okapp-tiles > li { flex-basis: 200px; }
    .okapp-game { flex-direction: column; padding: 20px 16px 48px; gap: 28px; }
    .okapp-game-media { flex: none; width: 100%; }
    .okapp-game-info { flex: none; width: 100%; }
    .okapp-game-info h1 { font-size: 2.25rem; }
    .okapp-shot { width: calc(50% - 6px); }
    .okapp-notice, .okapp-message { padding: 48px 16px; }
    .okapp-loading-icon { width: 120px; height: 120px; border-radius: 26px; }
    .okapp-loading h1 { font-size: 2rem; }
}

/* Terms · Privacy · Help (W5): the foot of every Okona screen, never over a game */
.okapp-footer {
    margin: 48px auto 0;
    padding: 20px 24px 28px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}
.okapp-footer a,
.okapp-auth-agree a {
    color: var(--text-secondary);
    text-decoration: underline;
}
.okapp-footer a:hover,
.okapp-auth-agree a:hover { color: var(--color-gold); }
body.okapp-has-hintbar .okapp-footer { padding-bottom: 72px; }
