/* =============================================================================
 * IEC logo mini-game (/<locale>/game). Loaded only on that page via
 * {% block head_extra %}. Consumes the shared tokens; adds nothing global.
 * ========================================================================== */

.game-page {
  background: var(--color-surface);
}

.game-shell {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 1rem + 2vw, 2.75rem);
}

.game-head {
  max-width: 60ch;
}

.game-title {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  line-height: var(--lh-h1);
  font-weight: 700;
  color: var(--color-ink);
  margin: 0.5rem 0 0;
}

.game-intro {
  margin: 0.75rem 0 0;
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--color-muted);
}

/* ---- Layout: runner + logo panel ------------------------------------------ */
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 0.8rem + 2vw, 2.25rem);
  align-items: start;
}

@media (min-width: 960px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) clamp(280px, 26vw, 380px);
  }
}

/* ---- The runner --------------------------------------------------------- */
.game-stage {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.game-hud__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.game-hud__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.game-hud__value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-brand-deep);
  font-variant-numeric: tabular-nums;
}

.game-canvas-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-line);
}

.game-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #eef3ef;
  /* A tap on the canvas is a jump, not a scroll/zoom gesture. */
  touch-action: none;
}

/* ---- The start / game-over / win overlay ------------------------------- */
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  background: rgba(14, 74, 49, 0.82);
  color: var(--color-neutral-0);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

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

.game-overlay__title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem);
  font-weight: 700;
  margin: 0;
}

.game-overlay__body {
  margin: 0;
  max-width: 42ch;
  font-size: var(--text-body-sm);
  line-height: 1.6;
  color: var(--color-green-100);
}

.game-overlay__actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* `.btn`'s own `display` would otherwise beat the UA [hidden] rule, so the
   "rebuild" button (idle + paused) needs it restated. */
.game-overlay__actions .btn[hidden] {
  display: none;
}

.game-hint,
.game-motion-note {
  margin: 0;
  font-size: var(--text-caption);
  color: var(--color-muted);
}

.game-motion-note {
  color: var(--color-text-accent);
  font-weight: 600;
}

/* ---- The logo being uncovered ---------------------------------------- */
.game-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: clamp(1rem, 0.6rem + 1.5vw, 1.5rem);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.game-logo__canvas {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
}

.game-logo__text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-brand-deep);
  font-variant-numeric: tabular-nums;
}

.game-logo__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .game-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
