/*
  chance-games.css
  ~~~~~~~~~~~~~~~~
  Shared styles for all chance game pages (/chance-games/*).
  Game-specific styles (dice faces, roulette wheel, card deck, cup graphics, etc.)
  remain in each template's {% block extra_css %}.
*/

/* ── Hero / Page Header ─────────────────────────────────────────────────── */
.game-hero {
  color: #fff;
  padding: 48px 24px 40px;
  text-align: center;
}

.game-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin: 0 0 12px;
}

.game-hero p {
  font-size: 1.1rem;
  opacity: .88;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Game Area wrapper ──────────────────────────────────────────────────── */
.game-area {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* ── Stats grid ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.stat-card {
  background: #1e2d45;
  border: 1px solid #2d4060;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.stat-card .stat-val {
  font-size: 2rem;
  font-weight: 700;
}

.stat-card .stat-lbl {
  font-size: .78rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* ── Chart section ──────────────────────────────────────────────────────── */
.chart-section {
  background: #1e2d45;
  border: 1px solid #2d4060;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}

/* Note: timer.css defines .chart-bar-row, .chart-label, .chart-track,
   .chart-fill, .chart-pct globally. The chance games override sizing here. */
.game-area .chart-bar-row,
.chart-section .chart-bar-row {
  display: flex;
  align-items: center;
  margin: 8px 0;
  gap: 0;
}

.game-area .chart-label,
.chart-section .chart-label {
  font-size: 13px;
  color: #e2e8f0;
}

.game-area .chart-track,
.chart-section .chart-track {
  flex: 1;
  height: 14px;
  background: #2d4060;
  border-radius: 7px;
  margin: 0 10px;
}

.game-area .chart-fill,
.chart-section .chart-fill {
  height: 100%;
  border-radius: 7px;
  transition: width .5s ease;
}

.game-area .chart-pct,
.chart-section .chart-pct {
  width: 40px;
  text-align: right;
  font-size: 12px;
  color: #94a3b8;
}

/* ── Content / prose section ────────────────────────────────────────────── */
.content-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.content-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 32px 0 14px;
  border-bottom: 2px solid #2d4060;
  padding-bottom: 8px;
}

.content-section p {
  color: #94a3b8;
  line-height: 1.75;
  margin-bottom: 14px;
}

.content-section a {
  text-decoration: underline;
}

.content-section ul {
  color: #94a3b8;
  line-height: 1.8;
  padding-left: 20px;
}

/* ── FAQ accordion ──────────────────────────────────────────────────────── */
.content-section details {
  border: 1px solid #2d4060;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
}

.content-section details summary {
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
}

.content-section details p {
  color: #94a3b8 !important;
}

/* ── Related tools (chance-game style - .related-link not .related-card) ── */
.content-section .related-tools {
  background: #1e2d45;
  border-radius: 12px;
  padding: 24px;
  margin: 32px 0;
}

.content-section .related-tools h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0 0 16px;
  border: none;
  padding: 0;
}

.content-section .related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.related-link {
  display: block;
  background: #162036;
  border: 1px solid #2d4060;
  border-radius: 8px;
  padding: 12px 16px;
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 500;
  font-size: .9rem;
  transition: border-color .2s;
}

/* ---------------------------------------------------------------------------
   Unified chance-game surface
   --------------------------------------------------------------------------- */
.page-chance-game {
  background: var(--surface-page, #0b1120);
  color: #94a3b8;
}

.page-chance-game .game-hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 0;
  text-align: left;
  color: inherit;
  background: transparent !important;
}

.page-chance-game .game-hero .tool-header {
  margin-bottom: 28px;
}

.page-chance-game .game-hero .tool-title {
  color: #f8fafc;
}

.page-chance-game .game-hero .tool-intro {
  max-width: 720px;
  margin: 0;
  color: #a8b4c7;
}

.page-chance-game .game-area {
  max-width: 960px;
  margin: 0 auto 28px;
  padding: 32px;
  background: linear-gradient(180deg, #172033 0%, #111827 100%);
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0,0,0,.26);
}

.page-chance-game .stats-grid,
.page-chance-game .choice-row,
.page-chance-game .game-controls {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.page-chance-game .stat-card,
.page-chance-game .score-cell,
.page-chance-game .chart-section,
.page-chance-game .game-over-banner,
.page-chance-game .picker-result-area {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #e2e8f0;
}

.page-chance-game .stat-card .stat-val,
.page-chance-game .score-val,
.page-chance-game .result-display,
.page-chance-game .result-banner {
  color: #f97316;
}

.page-chance-game .stat-card .stat-lbl,
.page-chance-game .score-lbl,
.page-chance-game .streak-info,
.page-chance-game .table-note,
.page-chance-game .thinking,
.page-chance-game .chart-pct {
  color: #94a3b8;
}

.page-chance-game .choice-btn,
.page-chance-game .mode-btn,
.page-chance-game .btn-flip,
.page-chance-game .btn-dice,
.page-chance-game .btn-spin,
.page-chance-game .btn-game {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #111827;
  color: #f8fafc;
  font-weight: 700;
  transition: background-color .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}

.page-chance-game .choice-btn:hover,
.page-chance-game .mode-btn:hover,
.page-chance-game .btn-flip:hover,
.page-chance-game .btn-dice:hover,
.page-chance-game .btn-spin:hover,
.page-chance-game .btn-game:hover {
  background: #1f2937;
  border-color: #60a5fa;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
}

.page-chance-game .mode-btn.active,
.page-chance-game .btn-flip,
.page-chance-game .btn-dice,
.page-chance-game .btn-spin,
.page-chance-game .btn-game--primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.page-chance-game .content-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.page-chance-game .content-section h2 {
  color: #f8fafc;
  border-bottom: 1px solid #334155;
}

.page-chance-game .content-section h3,
.page-chance-game .content-section details summary {
  color: #e2e8f0;
}

.page-chance-game .content-section p,
.page-chance-game .content-section ul,
.page-chance-game .content-section details p {
  color: #a8b4c7 !important;
}

.page-chance-game .content-section a {
  color: #60a5fa;
}

.page-chance-game .content-section .related-card,
.page-chance-game .content-section .related-card:hover,
.page-chance-game .content-section .related-card:focus,
.page-chance-game .content-section .related-card .related-name {
  text-decoration: none;
}

.page-chance-game .content-section details,
.page-chance-game .content-section .related-tools {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 8px;
}

.page-chance-game .content-section .related-tools h2 {
  color: #f8fafc;
}

@media (max-width: 700px) {
  .page-chance-game .game-hero {
    padding: 28px 20px 0;
  }

  .page-chance-game .game-area {
    margin: 0 16px 24px;
    padding: 24px 16px;
  }

  .page-chance-game .content-section {
    padding: 0 20px 40px;
  }
}
