/* Prize-box mini game — reuses the site tokens from styles.css */
.game { padding-top: var(--section); }

.game__panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 40px);
  box-shadow: 0 1px 0 var(--rule), 0 30px 60px -40px rgba(38, 42, 63, 0.35);
}

/* status row: picks left + what you've won */
.game__status {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 20px; margin-bottom: clamp(20px, 2.5vw, 32px);
}
.game__picks { font-size: var(--step-small); color: var(--ink-soft); }
.game__picks b {
  display: inline-flex; min-width: 28px; height: 28px; padding: 0 9px; margin-left: 4px;
  align-items: center; justify-content: center; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-family: var(--font-head); font-weight: 700;
}
.game__won { display: flex; flex-wrap: wrap; gap: 8px; }
.game__won li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--lime); color: var(--navy);
  font-size: var(--step-small); font-weight: 600;
}
.game__won li svg { width: 15px; height: 15px; }
@media (prefers-reduced-motion: no-preference) {
  .game__won li { animation: prize-in 420ms var(--ease-out) both; }
}

/* the grid of boxes */
.game__grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gap);
}
@media (max-width: 900px) { .game__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .game__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* one box */
.gbox {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 18px;
  background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  perspective: 600px;
}
.gbox[disabled] { cursor: default; }

/* the closed gift */
.gbox__box {
  position: absolute; inset: 0; border-radius: 18px;
  background: linear-gradient(160deg, #2a37ff, var(--accent) 55%, var(--accent-strong));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 22px -14px rgba(5, 0, 255, 0.7);
  transition: transform var(--t-ui) var(--ease-out), opacity var(--t-ui) ease, box-shadow var(--t-hover) ease;
  overflow: hidden;
}
/* ribbon cross */
.gbox__box::before, .gbox__box::after {
  content: ""; position: absolute; background: var(--lime);
}
.gbox__box::before { left: 50%; top: 0; width: 22%; height: 100%; transform: translateX(-50%); }
.gbox__box::after { top: 50%; left: 0; height: 22%; width: 100%; transform: translateY(-50%); }
/* center "?" badge */
.gbox__hint {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: clamp(18px, 2.4vw, 28px);
  color: var(--navy);
}
.gbox__hint::before {
  content: ""; position: absolute; width: 46%; height: 46%; border-radius: 50%;
  background: var(--lime); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.5);
}
.gbox__hint span { position: relative; }

@media (hover: hover) and (pointer: fine) {
  .gbox:not([disabled]):hover .gbox__box { transform: translateY(-4px) scale(1.02); box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 18px 30px -16px rgba(5, 0, 255, 0.8); }
}
.gbox:not([disabled]):active .gbox__box { transform: scale(0.96); }

/* the revealed content, hidden until opened */
.gbox__out {
  position: absolute; inset: 0; z-index: 3; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-align: center; padding: 6px;
  opacity: 0; transform: scale(0.7); pointer-events: none;
  background: var(--surface-2); border: 1px solid var(--rule);
}
.gbox__out-ic { display: flex; align-items: center; justify-content: center; }
.gbox__out-ic svg { width: clamp(22px, 3vw, 30px); height: auto; }
.gbox__out-txt {
  font-family: var(--font-head); font-weight: 700; line-height: 1.1;
  font-size: clamp(11px, 1.5vw, 14px); letter-spacing: -0.01em;
}
.gbox__out-sub { font-size: 11px; font-weight: 600; color: var(--ink-soft); }

/* opened states */
.gbox.is-open .gbox__box { opacity: 0; transform: scale(0.6) rotate(-6deg); }
.gbox.is-open .gbox__out { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .gbox.is-open .gbox__out { animation: prize-pop 480ms var(--ease-expo) both; }
}
.gbox.is-win .gbox__out { background: var(--lime); border-color: transparent; color: var(--navy); }
.gbox.is-win .gbox__out-ic svg { color: var(--navy); }
.gbox.is-miss .gbox__out { color: var(--ink-soft); }
.gbox.is-miss .gbox__out-ic { opacity: 0.55; }
/* prize boxes the player never opened, shown faded at the end */
.gbox.is-spoil .gbox__box { opacity: 0; }
.gbox.is-spoil .gbox__out { opacity: 0.5; transform: none; }

/* result + actions */
.game__result { margin-top: clamp(20px, 2.5vw, 28px); }
.game__result[hidden] { display: none; }
.game__result-title { font-family: var(--font-head); font-weight: 700; font-size: var(--step-lead); letter-spacing: -0.015em; }
.game__result-text { margin-top: 6px; color: var(--ink-soft); max-width: 52ch; }
.game__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(18px, 2vw, 24px); }
.game__actions .btn[hidden] { display: none; }
.game__lock { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: var(--step-small); color: var(--ink-soft); }
.game__lock svg { width: 16px; height: 16px; flex: none; }
.game__lock b { color: var(--ink); font-variant-numeric: tabular-nums; }

@keyframes prize-pop {
  0% { opacity: 0; transform: scale(0.55); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes prize-in {
  from { opacity: 0; transform: translateY(6px) scale(0.9); }
  to { opacity: 1; transform: none; }
}
