/* ==========================================================================
   Networking Games — shared UI for the timed practice games.
   Loaded ONLY by the game pages, so it needs no site-wide cache-bust bump.
   Uses the existing cinema design tokens (--gold, --card, --border, --text).
   ========================================================================== */

.game-shell {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  padding: clamp(18px, 3.4vw, 30px);
  margin: 22px 0 8px;
  position: relative;
  overflow: hidden;
}

/* ---------- HUD (timer / score / streak) ---------- */
.g-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.g-stat {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  background: rgba(212, 175, 55, .06);
}
.g-stat b {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 3.4vw, 1.7rem);
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.g-stat span {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.g-stat.warn b { color: #e8845f; }

/* ---------- timer bar ---------- */
.g-bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(212, 175, 55, .16);
  overflow: hidden;
  margin-bottom: 20px;
}
.g-bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-light, #e8cf82), var(--gold, #d4af37));
  transform-origin: left center;
  transition: transform .25s linear;
}
.g-bar.low i { background: linear-gradient(90deg, #e8845f, #c2553a); }

/* ---------- question ---------- */
.g-q {
  text-align: center;
  margin-bottom: 18px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.g-q .g-prompt {
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.g-q .g-value {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: clamp(1.35rem, 5.2vw, 2.3rem);
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
  line-height: 1.25;
}

/* ---------- options ---------- */
.g-opts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.g-opts.g-cols-1 { grid-template-columns: 1fr; }
@media (max-width: 560px) { .g-opts { grid-template-columns: 1fr; } }

.g-opt {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
  touch-action: manipulation;
}
.g-opt:hover:not(:disabled) { border-color: var(--gold, #d4af37); background: rgba(212, 175, 55, .1); }
.g-opt:active:not(:disabled) { transform: scale(.985); }
.g-opt:disabled { cursor: default; }
.g-opt.right { border-color: #5fbf8f; background: rgba(95, 191, 143, .18); color: #d8f5e6; }
.g-opt.wrong { border-color: #d4674a; background: rgba(212, 103, 74, .18); color: #ffdfd6; }

/* ---------- feedback line ---------- */
.g-feed {
  margin-top: 14px;
  min-height: 22px;
  text-align: center;
  font-size: .93rem;
  color: var(--muted);
}
.g-feed b { color: var(--gold-light, #e8cf82); }

/* ---------- start + end screens ---------- */
.g-panel { text-align: center; padding: 8px 0 4px; }
.g-panel h2 { font-size: clamp(1.3rem, 4vw, 1.9rem); margin: 0 0 8px; }
.g-panel p { color: var(--muted); max-width: 52ch; margin: 0 auto 16px; line-height: 1.6; }
.g-panel .btn { margin-top: 4px; }

.g-score {
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 11vw, 4.4rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(100deg, var(--gold-light, #e8cf82), var(--gold, #d4af37));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.g-sub { color: var(--muted); margin-top: 6px; font-size: .95rem; }
.g-best { margin-top: 10px; font-size: .9rem; color: var(--gold-light, #e8cf82); }

.g-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

/* ---------- missed-questions review ---------- */
.g-review {
  margin-top: 22px;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.g-review h3 { font-size: 1rem; margin: 0 0 10px; }
.g-review ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.g-review li {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
}
.g-review li b { color: #7fd6a6; }
.g-review li a { color: var(--gold-light, #e8cf82); }

/* ---------- games hub cards ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 24px 0; }
.game-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, border-color .18s ease;
}
.game-card:hover { transform: translateY(-3px); border-color: var(--gold, #d4af37); }
.game-card .gc-badge {
  align-self: flex-start;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-light, #e8cf82);
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 99px;
  padding: 4px 10px;
  margin-bottom: 12px;
}
.game-card h3 { margin: 0 0 8px; font-size: 1.18rem; }
.game-card p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.6; }
.game-card .gc-go { margin-top: 14px; color: var(--gold-light, #e8cf82); font-weight: 600; font-size: .92rem; }

@media (prefers-reduced-motion: reduce) {
  .g-bar i { transition: none; }
  .game-card, .g-opt { transition: none; }
  .game-card:hover { transform: none; }
}
