/* ==========================================================================
   Jumping Arcade — game page & game shell styles
   ========================================================================== */

.game-header { padding: 12px 0 4px; display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.game-header h1 { margin-bottom: .2em; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); }
.game-header .game-intro { color: var(--text-muted); margin: 0 0 8px; max-width: 48em; }
.game-header .card-meta { margin: 0; }
.game-header-actions { display: flex; gap: 8px; align-items: center; }

.game-wrap { padding: 8px 0 16px; }
.game-shell {
    max-width: 980px; margin: 0 auto; background: #0f1020; border-radius: 18px; padding: 10px;
    box-shadow: var(--shadow-lg); color: #fff;
}
.game-shell:fullscreen { max-width: none; border-radius: 0; display: flex; flex-direction: column; justify-content: center; padding: 12px; }
.game-shell:-webkit-full-screen { max-width: none; border-radius: 0; }

.game-hud { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 4px 10px; flex-wrap: wrap; }
.hud-scores { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .95rem; }
.hud-item { color: #b9b8d9; }
.hud-item strong { color: #fff; font-size: 1.15rem; font-variant-numeric: tabular-nums; margin-left: 4px; }
.hud-extra { background: rgba(255,255,255,.1); padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: #ffe066; font-variant-numeric: tabular-nums; }
.hud-actions { display: flex; gap: 6px; }
.hud-btn {
    width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.08); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.hud-btn:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.hud-btn:disabled { opacity: .4; cursor: not-allowed; }
.hud-btn svg { width: 22px; height: 22px; }
.hud-btn .icon-play, .hud-btn.is-paused .icon-pause { display: none; }
.hud-btn.is-paused .icon-play { display: block; }
.hud-btn .icon-muted, .hud-btn.is-muted .icon-sound { display: none; }
.hud-btn.is-muted .icon-muted { display: block; }

.game-stage { position: relative; margin: 0 auto; border-radius: 12px; overflow: hidden; background: #0f1020; }
.game-stage canvas { width: 100%; height: 100%; touch-action: manipulation; outline: none; }
.is-playing .game-stage canvas { touch-action: none; }
.game-stage[data-orientation="portrait"] { aspect-ratio: 9 / 16; width: min(100%, calc((100vh - 230px) * 9 / 16)); min-width: min(100%, 280px); }
.game-stage[data-orientation="landscape"] { aspect-ratio: 16 / 9; width: min(100%, calc((100vh - 230px) * 16 / 9)); min-width: min(100%, 300px); }
.game-stage[data-orientation="square"] { aspect-ratio: 1 / 1; width: min(100%, calc(100vh - 230px)); min-width: min(100%, 280px); }
@supports (height: 100svh) {
    .game-stage[data-orientation="portrait"] { width: min(100%, calc((100svh - 230px) * 9 / 16)); }
    .game-stage[data-orientation="landscape"] { width: min(100%, calc((100svh - 230px) * 16 / 9)); }
    .game-stage[data-orientation="square"] { width: min(100%, calc(100svh - 230px)); }
}
.game-shell:fullscreen .game-stage[data-orientation] { width: min(100%, calc((100vh - 170px) * 9 / 16)); }
.game-shell:fullscreen .game-stage[data-orientation="landscape"] { width: min(100%, calc((100vh - 170px) * 16 / 9)); }
.game-shell:fullscreen .game-stage[data-orientation="square"] { width: min(100%, calc(100vh - 170px)); }
.game-stage[data-error]::after {
    content: attr(data-error); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 20px; background: rgba(15,16,32,.95); color: #fff;
}
.game-stage noscript p { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; margin: 0; }

.game-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(12, 11, 30, .72);
}
.game-overlay[hidden] { display: none; }
.overlay-card { text-align: center; max-width: 340px; width: 100%; }
.overlay-title { font-family: var(--font-display); font-size: clamp(1.4rem, 1rem + 2vw, 2rem); font-weight: 900; margin: 0 0 8px; color: #fff; }
.is-record .overlay-title { color: #ffe066; }
.overlay-text { color: #d7d5f2; font-size: .95rem; margin: 0 0 14px; line-height: 1.5; }
.overlay-score { display: flex; flex-direction: column; gap: 2px; margin: 0 0 14px; }
.overlay-score[hidden] { display: none; }
.overlay-score-main { font-size: 1.8rem; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.overlay-score-best { color: #b9b8d9; font-weight: 700; }
.overlay-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.overlay-actions .btn { min-width: 180px; }
.game-overlay .btn-primary { background: #ffd43b; color: #2b1f00; }
.game-overlay .btn-primary:hover { background: #ffe066; color: #2b1f00; }
.game-overlay .btn-secondary { color: #fff; border-color: rgba(255,255,255,.35); }
.game-overlay .btn-secondary:hover { color: #fff; border-color: #fff; }
.game-overlay .btn[hidden] { display: none; }
.overlay-hint { font-size: .8rem; color: #a9a7cc; margin: 12px 0 0; }

.game-toast {
    position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(255,255,255,.95); color: #17152e;
    padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; opacity: 0; transition: opacity .2s; pointer-events: none;
    max-width: 90%; text-align: center;
}
.game-toast.is-visible { opacity: 1; }

/* on-screen controls: always available; large on touch screens */
.touch-controls { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px 2px; user-select: none; -webkit-user-select: none; }
.touch-group { display: flex; gap: 10px; }
.touch-btn {
    min-width: 64px; height: 56px; border-radius: 14px; border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.1); color: #fff; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer;
    touch-action: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px;
    -webkit-tap-highlight-color: transparent;
}
.touch-btn svg { width: 24px; height: 24px; }
.touch-btn.is-active { background: rgba(255,212,59,.35); border-color: #ffd43b; }
.touch-btn-jump { min-width: 120px; background: rgba(255,212,59,.18); border-color: rgba(255,212,59,.5); }
.touch-controls[data-mode="one"] { justify-content: center; }
.touch-controls[data-mode="one"] .touch-btn-jump { width: 100%; max-width: 420px; }
@media (pointer: fine) {
    .touch-btn { height: 44px; min-width: 52px; }
}
.keys-hint { text-align: center; font-size: .82rem; color: #a9a7cc; margin: 8px 0 0; }
@media (pointer: coarse) { .keys-hint { display: none; } }

/* ---------- info sections below the game ---------- */
.game-info { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; padding: 24px 0 8px; }
.game-info section { margin-bottom: 32px; }
.game-info h2 { font-size: 1.5rem; }
.controls-table td:first-child { white-space: nowrap; }
.tip-list { list-style: none; padding: 0; counter-reset: tip; }
.tip-list li { position: relative; padding-left: 40px; margin-bottom: 12px; }
.tip-list li::before {
    counter-increment: tip; content: counter(tip); position: absolute; left: 0; top: 1px;
    width: 28px; height: 28px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
    font-weight: 900; display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.difficulty-badge { display: inline-flex; gap: 6px; align-items: center; font-size: 1rem; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 10px; }
.side-facts { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: 84px; }
.side-facts h2 { font-size: 1.05rem; font-family: var(--font); }
.side-facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: .93rem; }
.side-facts dt { color: var(--text-muted); }
.side-facts dd { margin: 0; font-weight: 600; }
