/* Think of a Number — prompt, number buttons, reveal, and mini chart.
   Shared page, button, and stats styles live in /assets/site.css. The purple
   stays purple in dark mode. */

body.game-number {
  --game-bg: #7A3CE0;
  --game-deep: #5522B0;
  --game-accent: #7A3CE0;
  --card-line: #EEE6FB;
}

/* ── Layout ────────────────────────────────────────────── */

.number-block {
  width: 100%;
  max-width: 440px;
  padding: 8px 16px 0;
}

/* Desktop and wide: the button block grows to 560px (still two rows of five). */
@media (min-width: 900px) {
  .number-block { max-width: 592px; }
}

.prompt-area {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  margin-bottom: 16px;
  text-align: center;
}

.prompt {
  margin: 0;
  font-size: clamp(26px, 7.4vw, 36px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* ── Number buttons: always 2 rows × 5 ─────────────────── */

.num-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(56px, 1fr));
  gap: 10px;
}

@media (min-width: 900px) { .num-grid { gap: 14px; } }

.num {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  border-radius: 16px;
  background: #FFFFFF;
  color: var(--game-bg);
  font: 900 clamp(26px, 8vw, 44px)/1 var(--ws-font);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--game-deep);
  transition: transform 80ms ease, box-shadow 80ms ease, background 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 900px) { .num { font-size: 48px; border-radius: 20px; } }

.num:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--game-deep); }

.num.is-picked {
  background: var(--game-yellow);
  color: #2A1540;
  box-shadow: 0 5px 0 #C9A21E;
}

.num:disabled { cursor: default; }
.num:disabled:not(.is-picked) { opacity: 0.55; }

.num .kbd {
  position: absolute;
  top: 6px;
  right: 6px;
  margin: 0;
  font-size: 10px;
}

/* ── Reveal ────────────────────────────────────────────── */

.reveal { width: 100%; }
.reveal[hidden], .after[hidden] { display: none; }

.reveal-main {
  margin: 0;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 800;
  line-height: 1.2;
}

.reveal-main .share { color: var(--game-yellow); }

.reveal-computer {
  margin: 10px 0 0;
  font-size: 17px;
  font-weight: 600;
}

.chip {
  display: inline-block;
  min-width: 2.2em;
  margin: 0 2px;
  padding: 1px 8px;
  border: 2px solid #FFFFFF;
  border-radius: 8px;
  font: 700 17px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.reveal-match {
  min-height: 1.3em;
  margin: 6px 0 0;
  color: var(--game-yellow);
  font-size: 16px;
  font-weight: 700;
}

.after {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Mini bar chart of all picks, 1–10, the visitor's number in yellow. */
.mini-chart {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: end;
  gap: 6px;
  width: 100%;
  height: 130px;
  margin: 22px 0 26px;
  padding-bottom: 20px;
}

.mini-bar {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.mini-bar i {
  display: block;
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: rgba(255, 255, 255, 0.9);
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mini-bar.is-you i { background: var(--game-yellow); }
.mini-chart.is-grown .mini-bar i { transform: scaleY(1); }

.mini-bar b {
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  opacity: 0.85;
}

.mini-bar.is-you b { color: var(--game-yellow); opacity: 1; }

.mini-ten {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .mini-bar i, .num { transition: none; }
}

@media (hover: hover) and (pointer: fine) {
  .num:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--game-deep); }
}
