/* ============================================================
   REDLINE — styles.css
   Design-Konzept: Cockpit/Dashboard bei Nacht. Die ganze App
   basiert auf einer binären Entscheidung (Push vs. Fold) —
   das Duotone aus Redline-Rot und Petrol-Blau spiegelt genau
   das wider. Signature-Element: die glühende Trennlinie im
   Range-Grid zwischen Push- und Fold-Zone.
   ============================================================ */

:root {
  --bg:            #101116;
  --surface:       #1B1D24;
  --surface-alt:   #22252D;
  --border:        #2A2D36;

  --push:          #E8392E;
  --push-glow:     rgba(232, 57, 46, 0.35);
  --fold:          #2FA6A2;
  --fold-glow:     rgba(47, 166, 162, 0.3);
  --warn:          #E0A62F;

  --text:          #EDEFF2;
  --text-dim:      #9195A0;
  --text-faint:    #5C6070;

  --font-display:  'Oswald', sans-serif;
  --font-mono:     'IBM Plex Mono', monospace;
  --font-body:     'Inter', sans-serif;

  --radius:        10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(232,57,46,0.08), transparent 60%);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  min-height: 100vh;
}

.hidden { display: none !important; }

.screen { display: none; animation: fade-in .25s ease; }
.screen.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 14px;
  border: none;
  border-radius: var(--radius);
  padding: 14px 20px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }

.btn-primary {
  background: var(--push);
  color: #fff;
  box-shadow: 0 0 24px var(--push-glow);
}
.btn-lg { width: 100%; padding: 16px 20px; font-size: 15px; margin-top: 8px; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  width: 100%;
  margin-top: 24px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 12px;
}

.btn-push, .btn-fold {
  flex: 1;
  padding: 20px;
  font-size: 17px;
  border-radius: var(--radius);
}
.btn-push { background: var(--push); color: #fff; box-shadow: 0 0 28px var(--push-glow); }
.btn-fold { background: var(--fold); color: #06201f; box-shadow: 0 0 28px var(--fold-glow); }

/* ---------- Dashboard ---------- */
.dash-hero { text-align: center; padding: 40px 0 28px; }
.dash-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.dash-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  background: linear-gradient(180deg, #fff, var(--push) 160%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px var(--push-glow);
}
.dash-subtitle {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 380px;
  margin: 14px auto 24px;
  line-height: 1.5;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s ease, transform .12s ease;
}
.dash-card:hover { border-color: var(--fold); transform: translateY(-2px); }
.dash-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.dash-card-desc { font-size: 12px; color: var(--text-faint); }

.dash-footer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 40px;
}

/* ---------- Generic screen header ---------- */
.screen-title {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 4px 0 2px;
}
.screen-subtitle { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; }

/* ---------- Setup ---------- */
.scope-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.scope-option {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
}
.scope-option input { position: absolute; top: 14px; right: 16px; accent-color: var(--push); }
.scope-option:has(input:checked) { border-color: var(--push); box-shadow: 0 0 0 1px var(--push) inset; }
.scope-option-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.scope-option-desc { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* ---------- Quiz ---------- */
.quiz-topbar { display: flex; justify-content: space-between; align-items: center; }
.quiz-score { font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); }

.quiz-spot-info { text-align: center; margin: 8px 0 20px; }
.quiz-spot-title { font-family: var(--font-display); font-size: 20px; margin: 0; }
.quiz-spot-subtitle { color: var(--text-faint); font-size: 13px; margin-top: 4px; }

.table-wrap {
  padding: 50px 16px 40px;
  margin-bottom: 20px;
}

/* Ovaler Pokertisch: Hero fest unten, die übrigen 3 Sitze
   verteilen sich links / oben / rechts am Rand der Ellipse. */
.poker-table {
  position: relative;
  aspect-ratio: 4 / 3;
  max-width: 380px;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, #1c3536 0%, #142627 70%, #0f1d1e 100%);
  border: 2px solid var(--border);
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.5),
    0 0 50px rgba(47,166,162,0.08);
}

.seat {
  position: absolute;
  width: 92px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  background: var(--surface-alt);
  transform: translate(-50%, -50%);
}
.seat.slot-hero  { left: 50%; top: 100%; }
.seat.slot-left  { left: 4%;  top: 32%; }
.seat.slot-top   { left: 50%; top: -4%; }
.seat.slot-right { left: 96%; top: 32%; }

.seat-pos { display: block; font-family: var(--font-display); font-size: 13px; letter-spacing: .05em; }
.seat-state { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); margin-top: 3px; letter-spacing: .05em; }

.seat.state-hero { border-color: var(--fold); box-shadow: 0 0 16px var(--fold-glow); z-index: 2; }
.seat.state-hero .seat-state { color: var(--fold); }
.seat.state-shoved { border-color: var(--push); }
.seat.state-shoved .seat-state { color: var(--push); }
.seat.state-called { border-color: var(--warn); }
.seat.state-called .seat-state { color: var(--warn); }
.seat.state-folded { opacity: 0.4; }
.seat.state-pending { opacity: 0.7; }

.table-center {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 100%;
}
.stack-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 12px;
  margin-bottom: 12px;
  background: var(--bg);
}
.cards { display: flex; justify-content: center; gap: 10px; }

.card {
  width: 64px;
  height: 90px;
  background: #F5F3EE;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.card-rank { font-size: 24px; font-weight: 700; line-height: 1; }
.card-suit { font-size: 20px; line-height: 1.2; }
.card-sp { color: #1a1c22; }
.card-hr { color: #d1352b; }
.card-dm { color: #2b6fd1; }
.card-cl { color: #2f9e57; }

.quiz-actions { display: flex; gap: 12px; margin-bottom: 16px; }

.feedback {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  min-height: 0;
  text-align: center;
}
.feedback:empty { display: none; }
.feedback-verdict { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.feedback-detail { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.feedback.is-correct { background: rgba(47,166,162,0.12); border: 1px solid var(--fold); }
.feedback.is-correct .feedback-verdict { color: var(--fold); }
.feedback.is-wrong { background: rgba(232,57,46,0.12); border: 1px solid var(--push); }
.feedback.is-wrong .feedback-verdict { color: var(--push); }

/* ---------- Explore ---------- */
.select {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 14px;
}
.grid-legend { display: flex; gap: 16px; margin-bottom: 14px; font-size: 12px; color: var(--text-dim); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-swatch.is-push { background: var(--push); }
.legend-swatch.is-fold { background: var(--fold); }

.range-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.grid-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255,255,255,0.85);
}
.grid-cell.is-push { background: var(--push); }
.grid-cell.is-fold { background: var(--surface-alt); color: var(--text-faint); }

/* ---------- Statistics ---------- */
.stats-canvas { width: 100%; height: 320px; margin-bottom: 8px; }

/* ---------- History ---------- */
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-row {
  display: grid;
  grid-template-columns: 50px 1fr 70px 24px;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
}
.hh-hand { font-family: var(--font-mono); font-weight: 600; }
.hh-spot { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-answer { font-family: var(--font-mono); color: var(--text-faint); }
.hh-result { text-align: center; font-weight: 700; }
.history-row.is-correct .hh-result { color: var(--fold); }
.history-row.is-wrong .hh-result { color: var(--push); }
.empty-hint { color: var(--text-faint); font-size: 13px; }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  .dash-title { font-size: 32px; }
  .card { width: 54px; height: 78px; }
  .card-rank { font-size: 20px; }
  .poker-table { max-width: 300px; }
  .seat { width: 78px; }
}
