/* Just for fun mini games. Shared by the game pages and the Mini games cards on /fun/.
   Kept apart from style.css so the games stay self-contained. */
.game-layout { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 40px; align-items: start; }
.game-stage {
  position: relative; margin: 0 auto;
  width: min(100%, 440px, calc((100svh - 120px) * 2 / 3)); min-width: min(100%, 280px);
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.game-stage canvas { display: block; width: 100%; height: 100%; outline: none; }
.game-panel {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 28px; text-align: center;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.game-panel[hidden] { display: none; }
.game-panel .gp-title { font-size: clamp(1.5rem, 6vw, 2rem); }
.game-panel .gp-score { font: 700 clamp(2.2rem, 10vw, 3rem)/1 var(--display); color: var(--accent); }
.game-panel .gp-score[hidden] { display: none; }
.game-panel .gp-note { color: var(--muted); max-width: 30ch; }
.game-panel .gp-best { font: 500 0.8rem/1.3 var(--mono); color: var(--gold); min-height: 1em; }
.game-panel .button { border: 0; font: 600 1rem/1 var(--body); cursor: pointer; align-self: center; padding: 14px 28px; margin-top: 6px; }
.game-panel .button:focus-visible, .game-pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.game-pause {
  position: absolute; right: 10px; bottom: 10px; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
  font: 600 0.8rem/1 var(--mono); display: none;
}
.game-stage[data-state="play"] .game-pause { display: block; }
.game-help { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.game-help ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; max-width: 60ch; }
.game-help .keys { font: 500 0.8rem/1.5 var(--mono); color: var(--muted); }
.game-help .note { padding: 16px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; }
.game-head { display: flex; flex-direction: column; gap: 10px; }
.game-head .back { font-weight: 600; text-decoration: none; }
@media (max-width: 860px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

/* Mini games cards on /fun/ */
.game-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.game-cards .fun-card .best { font: 500 0.78rem/1.3 var(--mono); color: var(--gold); min-height: 1em; }
.game-cards .fun-card svg { width: 100%; height: auto; max-height: 120px; }
.game-cards svg .gc-line { fill: none; stroke: var(--line); stroke-width: 3; }
.game-cards svg .gc-dash { fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 7 6; }
.game-cards svg .gc-ink { fill: var(--ink); }
.game-cards svg .gc-acc { fill: var(--accent); }
.game-cards svg .gc-pt { fill: var(--point); }
.game-cards svg .gc-muted { fill: var(--muted); }
.game-cards svg .gc-coin { fill: #E0A100; }
@media (max-width: 1000px) { .game-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .game-cards { grid-template-columns: minmax(0, 1fr); } }
/* The Mini games heading matches the Space facts heading above it (same size as the page h1). */
.fun-title { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -0.02em; }
