.game-hub h1 {
    margin-top: 0;
}

.game-hub .game-intro,
.game-hub .game-note,
.game-hub .game-lesson p,
.game-hub .myth-why,
.game-hub .bag-result p {
    max-width: 65ch;
}

.game-note {
    color: var(--text-muted);
    font-size: 1rem;
}

.game-tablist {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: 1.25rem 0 0;
    border-bottom: 3px solid var(--accent);
}

.game-hub .game-tab {
    flex: 1 1 12rem;
    min-height: 44px;
    margin: 0;
    padding: .55rem .9rem;
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
    border-bottom: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    font: inherit;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
}

.game-hub .game-tab[aria-selected="true"] {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.game-hub .game-tab:hover,
.game-hub .game-tab:focus-visible {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.game-panel {
    scroll-margin-top: 5.5rem;
    margin: 0 0 2rem;
    padding: 1rem 0 0;
    border-top: 3px solid var(--accent);
}

.game-hub[data-tabbed] .game-panel {
    border-top: 0;
}

.game-panel[hidden] {
    display: none;
}

.game-panel h2 {
    margin-top: .4rem;
}

.game-lesson {
    margin-top: 1rem;
}

.arcade-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .75rem;
}

.arcade-label,
.arcade-timer {
    display: inline-block;
    margin: 0 0 .45rem;
    padding: .15rem .5rem;
    font-family: ui-monospace, "Courier New", monospace;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .08em;
}

.arcade-label {
    background: var(--accent);
    color: #000;
    text-transform: uppercase;
}

.arcade-timer {
    background: #000;
    color: #ffd800;
    border: 2px solid #c9a800;
    font-variant-numeric: tabular-nums;
}

.arcade:fullscreen,
.arcade:-webkit-full-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    padding: 1rem;
    background: #000;
    overflow: auto;
}

.arcade:fullscreen .arcade-frame,
.arcade:-webkit-full-screen .arcade-frame {
    width: min(100%, calc((100vh - 14rem) * 320 / 180));
    width: min(100%, calc((100dvh - 14rem) * 320 / 180));
    margin-inline: auto;
}

.arcade:fullscreen .arcade-status,
.arcade:-webkit-full-screen .arcade-status {
    color: #fff6d0;
}

.arcade-frame {
    position: relative;
    background: #140c18;
    border: 4px solid #1a1a1a;
    box-shadow: 0 0 0 4px var(--accent), 0 0 0 8px #1a1a1a;
}

.arcade-frame canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #140c18;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    touch-action: none;
}

.arcade-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 1rem;
    background: rgba(20, 12, 24, .82);
    text-align: center;
}

.arcade-overlay[hidden] {
    display: none;
}

.arcade-overlay p {
    margin: 0;
    max-width: 36ch;
    color: #fff6d0;
    font-weight: 600;
}

.game-won {
    margin: .85rem 0 0;
    font-weight: 700;
}

.game-hub .game-won a {
    color: var(--link);
    text-underline-offset: .15em;
}

.game-hub .arcade-overlay .game-won,
.game-hub .arcade-overlay .game-won a {
    max-width: 36ch;
    color: #ffd800;
}

.arcade-controls,
.swipe-actions,
.bag-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.arcade-status,
.swipe-progress {
    min-height: 1.5em;
    color: var(--text-muted);
    font-size: 1rem;
}

.arcade-results,
.bag-results,
.swipe-explain,
.swipe-end {
    margin-top: 1rem;
    padding: .9rem;
    background: var(--bg-alt);
    border-left: 4px solid var(--accent);
}

.arcade-results[hidden],
.bag-results[hidden],
.swipe-explain[hidden],
.swipe-end[hidden],
.score-board[hidden] {
    display: none;
}

.score-board {
    margin-top: .85rem;
}

.score-board h3,
.score-board p,
.score-board li {
    margin: 0 0 .4rem;
}

.score-board ol {
    margin: .2rem 0 0;
    padding-left: 1.3rem;
}

.score-note {
    color: var(--text-muted);
    font-size: .95rem;
}

.arcade:fullscreen .score-board,
.arcade:-webkit-full-screen .score-board,
.arcade:fullscreen .score-note,
.arcade:-webkit-full-screen .score-note {
    color: #fff6d0;
}

.absorb-row {
    display: grid;
    grid-template-columns: minmax(7rem, 9rem) 1fr auto;
    gap: .5rem;
    align-items: center;
    margin-bottom: .55rem;
}

.absorb-track {
    display: block;
    height: .85rem;
    background: #fff;
    border: 2px solid var(--border);
}

.absorb-fill {
    display: block;
    height: 100%;
    background: #198754;
}

.absorb-flare .absorb-fill {
    background: #9a3412;
}

.absorb-pct {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.swipe-board {
    max-width: 36rem;
}

.swipe-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: .35rem;
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.swipe-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 13rem;
    padding: 1.5rem 2.4rem;
    background: var(--bg);
    border: 3px solid var(--border);
    border-radius: 18px;
    touch-action: none;
    user-select: none;
    cursor: grab;
}

.swipe-card:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

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

.swipe-card.lean-myth {
    border-color: #9a3412;
}

.swipe-card.lean-fact {
    border-color: #198754;
}

.swipe-statement {
    margin: 0;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
}

.swipe-edge {
    position: absolute;
    top: .7rem;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .35;
}

.swipe-edge-myth {
    left: .7rem;
}

.swipe-edge-fact {
    right: .7rem;
}

.swipe-card.lean-myth .swipe-edge-myth,
.swipe-card.lean-fact .swipe-edge-fact {
    opacity: 1;
}

.game-hub .swipe-actions button,
.game-hub .arcade-controls button,
.game-hub .bag-actions button,
.game-hub .arcade-overlay button,
.game-hub .swipe-explain button,
.game-hub .swipe-end button,
.game-hub .bag-item button {
    display: inline-flex;
    width: auto;
    min-height: 44px;
}

.game-hub .arcade-controls button[data-music][aria-pressed="true"],
.game-hub .arcade-controls button[data-fullscreen][aria-pressed="true"] {
    background: #c9a800;
    color: #000;
    border-color: #c9a800;
}

.game-hub .swipe-actions button[data-choice="myth"] {
    background: #fff;
    color: #000;
    border-color: #9a3412;
}

.game-hub .swipe-actions button[data-choice="fact"] {
    background: #fff;
    color: #000;
    border-color: #198754;
}

.game-read {
    margin-top: 1rem;
}

.game-read summary {
    min-height: 44px;
    cursor: pointer;
    font-weight: 700;
}

.myth-read {
    margin: .75rem 0 0;
    padding-left: 1.2rem;
}

.myth-read li {
    margin-bottom: 1rem;
}

.myth-statement {
    font-weight: 700;
    margin-bottom: .2rem;
}

.myth-tag {
    display: inline-block;
    margin: 0 0 .3rem;
    padding: .05rem .4rem;
    background: var(--accent);
    color: #000;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.bag-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.bag-layout h3 {
    margin-top: 0;
}

.bag-shelf,
.bag-contents,
.bag-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .45rem;
    padding: .35rem .35rem .35rem .7rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
}

.bag-handle {
    flex: 1;
    cursor: grab;
    font-weight: 700;
    touch-action: none;
}

.bag-why {
    display: none;
}

.bag-print {
    flex: none;
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap;
}

.bag-drop {
    min-height: 16rem;
    padding: .7rem;
    background: var(--bg-alt);
    border: 3px dashed var(--border);
    border-radius: 12px;
}

.bag-drop:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

.bag-drop.is-over {
    border-style: solid;
    border-color: var(--accent);
    box-shadow: inset 0 0 0 3px var(--accent);
}

.bag-drop-hint {
    margin: 0;
    color: var(--text-muted);
}

.bag-drop-hint[hidden] {
    display: none;
}

.bag-ghost {
    position: fixed;
    z-index: 50;
    padding: .4rem .7rem;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    pointer-events: none;
    border: 2px solid #000;
}

.bag-result {
    margin-bottom: .75rem;
    padding: .55rem .7rem;
    background: var(--bg);
    border-left: 4px solid var(--border);
}

.bag-result.is-correct {
    border-left-color: #198754;
}

.bag-result.is-miss {
    border-left-color: #9a3412;
}

.bag-result-title {
    font-weight: 700;
    margin-bottom: .25rem;
}

@media (max-width: 700px) {
    .bag-layout,
    .absorb-row {
        grid-template-columns: 1fr;
    }

    .game-tablist {
        gap: .5rem;
        border-bottom: 0;
    }

    .game-hub .game-tab {
        flex: 1 1 100%;
        border-bottom: 2px solid var(--primary);
        border-radius: var(--radius);
    }

    .game-hub .game-tab[aria-selected="true"] {
        border-color: var(--accent);
    }
}

@media print {
    .game-tablist {
        display: none;
    }

    .game-panel[hidden] {
        display: block;
    }
}

@media (prefers-color-scheme: dark) {
    .absorb-track {
        background: #2a2a2a;
    }
    .game-hub .swipe-actions button[data-choice="myth"],
    .game-hub .swipe-actions button[data-choice="fact"] {
        background: #1e1e1e;
        color: #fff;
    }
    .swipe-card {
        background: var(--bg);
    }
}
