/* ============================================================
   game.css — IDEA RUSH gate (intro · arena · result)
   Reuses base.css + careers.css tokens
   ============================================================ */

/* ---- gate card (holds the 3 game states) ---- */
.gate-card {
  background: var(--panel); border: 1px solid var(--hairline); border-radius: 22px;
  padding: clamp(24px, 3.4vw, 46px); margin-bottom: clamp(40px, 6vw, 70px);
  box-shadow: 0 40px 90px rgba(0,0,0,0.45);
  opacity: 0; transform: translateY(34px);
  animation: cardIn 0.9s var(--ease) 0.15s forwards;
}
.gate-state { display: none; }
.gate-state.active { display: block; }

/* ---- STATE 1: intro ---- */
.gintro { text-align: center; }
.gintro .eyebrow { justify-content: center; margin-bottom: 22px; }
.gintro h2 { font-size: clamp(32px, 5vw, 60px); max-width: 16ch; margin: 0 auto; }
.gintro__sub { margin: clamp(18px, 2.4vw, 26px) auto 0; max-width: 54ch; color: #d4d4d0; font-size: clamp(14px, 1.3vw, 17px); line-height: 1.6; }
.gintro__stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(12px, 2vw, 22px);
  margin: clamp(28px, 3.6vw, 40px) auto clamp(30px, 3.6vw, 42px);
}
.gstat {
  display: flex; flex-direction: column; gap: 5px; align-items: center;
  border: 1px solid var(--hairline); border-radius: 14px; padding: 16px 22px; min-width: 124px; background: #0E0E10;
}
.gstat b { font-family: "Archivo", sans-serif; font-weight: 900; font-size: clamp(22px, 2.2vw, 30px); color: var(--lime); letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.gstat span { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.gintro__start { min-width: 220px; justify-content: center; }

/* ---- STATE 2: game ---- */
.gplay { }
.ghud {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  margin-bottom: 16px;
}
.ghud__score { display: flex; align-items: baseline; gap: 9px; }
.ghud__score .lbl { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.ghud__score b {
  font-family: "Archivo", sans-serif; font-weight: 900; font-size: clamp(28px, 4vw, 44px);
  color: var(--lime); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; display: inline-block;
}
.ghud__score b.bump { animation: scoreBump 0.28s var(--ease); }
@keyframes scoreBump { 0% { transform: scale(1); } 45% { transform: scale(1.22); color: #fff; } 100% { transform: scale(1); } }
.ghud__score b.hit { animation: scoreHit 0.34s var(--ease); }
@keyframes scoreHit { 0% { transform: scale(1); } 45% { transform: scale(0.84); color: var(--error); } 100% { transform: scale(1); } }

.ghud__timer { width: min(38vw, 260px); }
.ghud__timer .bar { height: 8px; border-radius: 100px; background: rgba(255,255,255,0.10); overflow: hidden; }
.ghud__timer .fill { height: 100%; width: 100%; background: var(--lime); border-radius: 100px; box-shadow: 0 0 10px rgba(196,255,61,0.55); transform-origin: left; }
.ghud__timer .fill.low { background: var(--error); box-shadow: 0 0 10px rgba(255,107,107,0.6); }
.ghud__timer .tlabel { display: block; text-align: center; margin-top: 7px; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.ghud__target { text-align: right; }
.ghud__target b { font-family: "Archivo", sans-serif; font-weight: 900; font-size: clamp(16px, 1.6vw, 20px); color: var(--text); letter-spacing: -0.02em; }
.ghud__target span { display: block; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.arena {
  position: relative; width: 100%; aspect-ratio: 720 / 460; border-radius: 20px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(196,255,61,0.08), transparent 60%),
    #0D0D0F;
  border: 1px solid var(--hairline); touch-action: none; cursor: none;
}
.arena__grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(196,255,61,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196,255,61,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 35%, transparent 85%);
  mask-image: radial-gradient(circle at 50% 50%, #000 35%, transparent 85%);
}
.arena canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; }
.arena__flash { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: rgba(255,107,107,0.34); opacity: 0; }
.arena__flash.on { animation: redFlash 0.36s var(--ease); }
@keyframes redFlash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.arena__hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3;
  font-size: 11px; letter-spacing: 0.08em; color: var(--muted); background: rgba(10,10,10,0.55);
  padding: 7px 14px; border-radius: 100px; border: 1px solid var(--hairline); white-space: nowrap;
  transition: opacity 0.5s var(--ease);
}
.arena.shake { animation: arenaShake 0.34s var(--ease); }
@keyframes arenaShake {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-7px,4px); }
  40% { transform: translate(6px,-5px); } 60% { transform: translate(-5px,-3px); } 80% { transform: translate(4px,5px); }
}

/* ---- STATE 3: result ---- */
.gresult { text-align: center; display: none; }
.gresult.active { display: block; }
.gresult__check {
  width: 100px; height: 100px; border-radius: 50%; background: var(--lime);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 28px;
  transform: scale(0); box-shadow: 0 0 56px rgba(196,255,61,0.45);
}
.gresult.win .gresult__check { animation: checkPop 0.6s var(--ease) forwards; }
.gresult__check svg { width: 48px; height: 48px; color: #0A0A0A; }
.gresult__check svg path { stroke-dasharray: 40; stroke-dashoffset: 40; }
.gresult.win .gresult__check svg path { animation: checkDraw 0.5s var(--ease) 0.35s forwards; }
.gresult h2 { font-size: clamp(34px, 5.4vw, 64px); margin-bottom: 18px; }
.gresult__line { max-width: 46ch; margin: 0 auto 30px; color: #d4d4d0; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.55; }
.gresult__line b { color: var(--lime); }
.gresult__btns { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.gresult__skip { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; transition: color 0.3s var(--ease); background: none; border: none; }
.gresult__skip:hover { color: var(--lime); }

/* win only: the unlocked note above the form */
.unlock-note {
  display: none; align-items: center; justify-content: center; gap: 10px;
  margin: 0 auto clamp(20px, 3vw, 30px); padding: 12px 20px; width: fit-content;
  border: 1px solid rgba(196,255,61,0.4); border-radius: 100px; background: rgba(196,255,61,0.07);
  color: var(--lime); font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
}
.unlock-note.show { display: flex; }

/* form locked until unlocked */
.cform-card.locked { display: none; }

/* ---- responsive ---- */
@media (max-width: 680px) {
  .ghud { grid-template-columns: 1fr 1fr; row-gap: 12px; }
  .ghud__timer { grid-column: 1 / -1; order: 3; width: 100%; }
  .ghud__target { order: 2; }
  .arena { aspect-ratio: 5 / 6; }
  .gstat { min-width: 0; flex: 1 1 40%; padding: 13px 12px; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .gate-card { opacity: 1 !important; transform: none !important; animation: none !important; }
  .arena.shake { animation: none !important; }
  .arena__flash.on { animation-duration: 0.6s; }
  .gresult.win .gresult__check { transform: scale(1) !important; animation: none !important; }
  .gresult.win .gresult__check svg path { stroke-dashoffset: 0 !important; animation: none !important; }
  .ghud__score b.bump, .ghud__score b.hit { animation: none !important; }
}
