.desktop-games-pane { display: none; }
.games-dialog { width: min(760px, 100%); max-width: none; height: min(920px, 100dvh); max-height: none; padding: 0; color: var(--text); background: var(--bg); border: 0; }
.games-dialog::backdrop { background: #000c; backdrop-filter: blur(8px); }
.games-host { min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.games-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--bg); }
.games-head { display: grid; grid-template-columns: 42px minmax(0,1fr) 42px; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 92%, var(--bg)); }
.games-head button { width: 42px; height: 42px; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 10px; font-size: 21px; }
.games-head-copy { min-width: 0; display: grid; gap: 2px; }
.games-head-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 17px; }
.games-head-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: 750 10px/1.3 ui-monospace, monospace; }
.games-body { min-height: 0; overflow: auto; padding: 18px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.games-intro { margin-bottom: 18px; padding: 18px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.games-intro span { color: var(--accent); font: 900 10px/1 ui-monospace, monospace; letter-spacing: .1em; }
.games-intro h2 { margin: 7px 0 6px; font-size: clamp(24px, 5vw, 42px); line-height: 1; }
.games-intro p { max-width: 680px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.game-card { min-width: 0; min-height: 156px; display: grid; grid-template-columns: auto minmax(0,1fr); grid-template-rows: auto 1fr auto; gap: 8px 12px; padding: 17px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; text-align: left; }
.game-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.game-card > i { grid-row: 1 / 3; width: 44px; height: 44px; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent); border-radius: 12px; font-size: 22px; font-style: normal; }
.game-card strong { align-self: end; font-size: 17px; }
.game-card p { grid-column: 2; align-self: start; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.game-card small { grid-column: 1 / 3; color: var(--accent); font: 850 10px/1.3 ui-monospace, monospace; }
.game-view { max-width: 900px; margin: 0 auto; display: grid; gap: 14px; }
.game-status, .game-panel, .game-result, .game-leaderboard { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.game-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-status strong { color: var(--accent); font: 900 13px/1.25 ui-monospace, monospace; }
.game-status small { color: var(--muted); font: 750 10px/1.35 ui-monospace, monospace; text-align: right; }
.game-panel h2, .game-result h2 { margin: 0 0 10px; font-size: clamp(22px, 5vw, 34px); }
.game-panel p, .game-result p { margin: 8px 0; line-height: 1.45; }
.game-quote { margin: 12px 0; padding: 18px; background: var(--field); border-left: 4px solid var(--accent); font-size: clamp(17px, 3vw, 24px); line-height: 1.45; white-space: pre-wrap; }
.game-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.game-actions.one { grid-template-columns: 1fr; }
.game-actions button, .game-primary { min-height: 50px; padding: 11px 14px; color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); border-radius: 10px; font-weight: 900; }
.game-actions button.secondary, .game-primary.secondary { color: var(--text); background: var(--field); border-color: var(--line); }
.game-actions button.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.game-actions button:disabled, .game-primary:disabled { opacity: .45; }
.game-candidates { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.game-candidate { min-height: 62px; display: grid; grid-template-columns: 40px minmax(0,1fr); align-items: center; gap: 9px; padding: 9px; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 10px; text-align: left; }
.game-candidate:hover { border-color: var(--accent); }
.game-avatar { width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); border-radius: 50%; font: 900 11px/1 ui-monospace, monospace; }
.game-avatar img { width: 100%; height: 100%; object-fit: cover; }
.game-candidate b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.game-feedback { padding: 12px; color: var(--text); background: color-mix(in srgb, var(--accent) 11%, var(--field)); border: 1px solid var(--accent); border-radius: 10px; font-weight: 800; line-height: 1.4; }
.game-feedback.bad { color: #ffb0b0; background: color-mix(in srgb, var(--danger) 12%, var(--field)); border-color: var(--danger); }
.game-leaderboard header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.game-leaderboard h3 { margin: 0; font-size: 14px; }
.game-tabs { display: flex; gap: 5px; }
.game-tabs button { padding: 6px 8px; color: var(--muted); background: var(--field); border: 1px solid var(--line); border-radius: 7px; font: 800 9px/1 ui-monospace, monospace; }
.game-tabs button.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.game-board { display: grid; gap: 6px; }
.game-board-row { display: grid; grid-template-columns: 28px 34px minmax(0,1fr) auto; align-items: center; gap: 8px; min-width: 0; padding: 7px 8px; background: var(--field); border-radius: 8px; }
.game-board-row > b:first-child { color: var(--accent); font: 900 11px/1 ui-monospace, monospace; }
.game-board-row .game-avatar { width: 34px; height: 34px; }
.game-board-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; }
.game-board-row > strong { color: var(--muted); font: 850 10px/1 ui-monospace, monospace; white-space: nowrap; }
.game-empty { padding: 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.tap-arena { min-height: min(48vh, 440px); display: grid; place-items: center; padding: 18px; background: var(--field); border: 1px solid var(--line); border-radius: 14px; }
.tap-button { width: min(280px, 72vw); aspect-ratio: 1; color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 50%; box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 14%, transparent), 0 22px 55px #0008; font-size: clamp(20px, 6vw, 38px); font-weight: 950; touch-action: manipulation; user-select: none; }
.tap-button:active { transform: scale(.94); }
.reaction-arena { min-height: min(48vh, 430px); display: grid; place-items: center; padding: 22px; background: #520f1b; border: 2px solid #ff4865; border-radius: 14px; text-align: center; touch-action: manipulation; user-select: none; }
.reaction-arena.ready { color: #05130a; background: #42f57b; border-color: #42f57b; }
.reaction-arena strong { font-size: clamp(28px, 8vw, 62px); }
.reaction-arena small { display: block; margin-top: 10px; font: 800 11px/1.4 ui-monospace, monospace; }
.swipe-card { min-height: min(46vh, 430px); display: grid; align-content: center; gap: 12px; padding: 24px; background: var(--field); border: 2px solid var(--line); border-radius: 18px; text-align: center; touch-action: pan-y; transition: transform .16s ease, opacity .16s ease; }
.swipe-card .game-avatar { width: 76px; height: 76px; margin: 0 auto; font-size: 18px; }
.swipe-card h3 { margin: 0; color: var(--accent); font-size: 20px; }
.swipe-card blockquote { margin: 0; font-size: clamp(18px, 4vw, 28px); line-height: 1.4; }
.run-stage { position: relative; height: min(48vh, 470px); overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 80%, var(--bg)), var(--field)); border: 2px solid var(--accent); border-radius: 14px; touch-action: none; user-select: none; }
.run-ground { position: absolute; right: 0; bottom: 58px; left: 0; height: 3px; background: var(--accent); }
.run-player { position: absolute; z-index: 2; left: 11%; bottom: 60px; font-size: 42px; transform-origin: 50% 100%; }
.run-player.running { animation: run-bob .24s steps(2) infinite; }
.run-player.airborne { animation: none; transform: translateY(-96px) rotate(-5deg); transition: transform .16s ease-out; }
.run-player.ducking { animation: none; transform: scaleY(.55) translateY(16px); }
@keyframes run-bob { 50% { transform: translateY(-5px) rotate(2deg); } }
.run-item { position: absolute; z-index: 1; font-size: 35px; transform: translateX(-50%); }
.run-item.ground { bottom: 60px; filter: drop-shadow(0 0 7px #ff304f); }
.run-item.air { bottom: 125px; filter: drop-shadow(0 0 7px #ff304f); }
.run-item.bonus { bottom: 190px; filter: drop-shadow(0 0 8px #ffd940); }
.run-item.tits { filter: drop-shadow(0 0 10px #45f58a); }
.run-hud { display: flex; justify-content: space-between; gap: 10px; color: var(--accent); font: 900 12px/1.2 ui-monospace, monospace; }
.run-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.run-controls button { min-height: 64px; color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 10px; font-weight: 950; touch-action: none; user-select: none; }
.game-loading { min-height: 300px; display: grid; place-items: center; color: var(--accent); font: 900 13px/1.4 ui-monospace, monospace; text-align: center; }
.game-loading::before { content: "⚙"; display: block; margin-bottom: 12px; font-size: 44px; animation: game-spin 1s linear infinite; }
@keyframes game-spin { to { transform: rotate(360deg); } }

@media (min-width: 1180px) and (pointer: fine) {
  .desktop-games-pane { grid-column: 2 !important; grid-row: 2 / -1; min-width: 0; min-height: 0; display: block; background: var(--bg); }
  .desktop-games-pane.hidden { display: none !important; }
  .desktop-games-pane .games-body { padding: 28px clamp(28px, 5vw, 72px); }
  .desktop-games-pane .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .desktop-games-pane .games-head .games-close { visibility: hidden; }
}

@media (max-width: 620px) {
  .games-dialog { width: 100%; height: var(--app-height, 100dvh); margin: 0; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); border-radius: 0; }
  .games-body { padding: 12px; }
  .games-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 128px; }
  .game-candidates { grid-template-columns: 1fr; }
  .game-status { align-items: flex-start; flex-direction: column; }
  .game-status small { text-align: left; }
  .game-board-row { grid-template-columns: 24px 32px minmax(0,1fr) auto; }
}

[data-theme="terminal"] .games-head button,
[data-theme="terminal"] .games-intro,
[data-theme="terminal"] .game-card,
[data-theme="terminal"] .game-status,
[data-theme="terminal"] .game-panel,
[data-theme="terminal"] .game-result,
[data-theme="terminal"] .game-leaderboard,
[data-theme="terminal"] .game-candidate,
[data-theme="terminal"] .game-board-row,
[data-theme="terminal"] .tap-arena,
[data-theme="terminal"] .reaction-arena,
[data-theme="terminal"] .swipe-card,
[data-theme="terminal"] .run-stage,
[data-theme="terminal"] .run-controls button { border-radius: 2px; }
