/* ============================================================
   Craps Trainer — Realistic casino felt table
   ============================================================ */

:root {
  --bg: #0c1117;
  --surface: #161d27;
  --surface-2: #1e2a36;
  --surface-3: #283644;
  --border: #344455;
  --text: #e2e8f0;
  --text-muted: #8a9bb0;
  --text-dim: #556677;

  /* Felt greens */
  --felt: #0d6b2c;
  --felt-dark: #095420;
  --felt-light: #0f7d34;

  /* Table lines */
  --line: rgba(255,255,255,.65);
  --line-heavy: rgba(255,255,255,.8);

  /* Colors */
  --green: #22c55e;
  --green-dim: #14532d;
  --red: #ef4444;
  --red-dim: #7f1d1d;
  --gold: #facc15;
  --gold-dim: #854d0e;
  --blue: #3b82f6;
  --blue-dim: #1e3a5f;
  --cyan: #06b6d4;
  --orange: #f97316;

  /* Chips */
  --chip-red: #dc2626;
  --chip-white: #e8e8e8;
  --chip-blue: #2563eb;
  --chip-green: #16a34a;
  --chip-black: #1e293b;

  --radius: 8px;
  --radius-lg: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.5; min-height: 100vh;
}

.hidden { display: none !important; }

/* ==================== Setup ==================== */
.setup-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.setup-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; max-width: 440px; width: 100%;
}
.setup-card h1 { font-size: 24px; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.setup-card .subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px;
}
.form-group input, .form-group select {
  width: 100%; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 15px; outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--blue); }
.btn-start {
  width: 100%; padding: 14px; background: var(--green); color: #000; border: none;
  border-radius: var(--radius); font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 8px;
}
.btn-start:hover { background: #2dd870; }

/* ==================== Game Layout ==================== */
.game-screen { display: flex; flex-direction: column; min-height: 100vh; }
.header-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 20px; gap: 16px; flex-wrap: wrap;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left h2 { font-size: 15px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.phase-badge {
  padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}
.phase-comeout { background: var(--blue-dim); color: var(--blue); border: 1px solid var(--blue); }
.phase-point { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold); }
.header-stats { display: flex; gap: 20px; }
.stat { text-align: center; }
.stat-label { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); }
.stat-value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.header-actions { display: flex; gap: 6px; }
.btn-hdr {
  padding: 5px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-muted); font-size: 12px; cursor: pointer;
}
.btn-hdr:hover { background: var(--surface-3); color: var(--text); }
.btn-mode-toggle { border-color: var(--gold); color: var(--gold); }
.btn-mode-toggle:hover { background: rgba(250,204,21,.1); }
.btn-mode-active { background: var(--gold-dim); color: var(--gold); border-color: var(--gold); }

.main-content {
  display: grid; grid-template-columns: 1fr 310px;
  flex: 1; gap: 0;
}
.center-col { padding: 16px 20px; overflow-y: auto; }
.sidebar {
  border-left: 1px solid var(--border); background: var(--surface);
  padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
}

/* ====================================================
   CRAPS TABLE — Realistic casino felt
   Stadium-shaped end with wrap-around Pass Line band.
   The outer padding IS the Pass Line.
   ==================================================== */

.craps-table {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  /* Layered felt texture */
  background:
    repeating-conic-gradient(rgba(0,0,0,.015) 0% 25%, transparent 0% 50%) 0 0 / 4px 4px,
    radial-gradient(ellipse at 50% 15%, rgba(255,255,255,.07) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 95%, rgba(0,0,0,.22) 0%, transparent 40%),
    radial-gradient(ellipse at 15% 50%, rgba(0,0,0,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 50%, rgba(0,0,0,.06) 0%, transparent 50%),
    linear-gradient(180deg, #0f7e34 0%, #0c6d2b 20%, #0a6226 50%, #085a20 80%, #06501c 100%);
  /* Wooden rail */
  border: 9px solid #6b5630;
  border-radius: 8px 8px 50% 50% / 8px 8px 130px 130px;
  /* Pass Line = padding band */
  padding: 0 62px 84px 62px;
  box-shadow:
    inset 0 0 100px rgba(0,0,0,.2),
    0 0 0 2px #4a3a1e,
    0 0 0 5px rgba(60,45,20,.4),
    0 10px 50px rgba(0,0,0,.5);
  user-select: none;
}

/* --- Pass Line labels --- */

.pass-label {
  position: absolute;
  color: rgba(255,255,255,.92);
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  pointer-events: none;
  text-shadow: 0 2px 5px rgba(0,0,0,.5);
}

.pass-label-bottom {
  bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 24px; letter-spacing: 10px;
  pointer-events: auto; cursor: pointer;
  padding: 6px 28px; border-radius: 4px;
}
.pass-label-bottom:hover { background: rgba(255,255,255,.06); }

.pass-label-left {
  left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 15px; line-height: 1.15; text-align: center;
  letter-spacing: 3px;
}
.pass-label-right {
  right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 15px; line-height: 1.15; text-align: center;
  letter-spacing: 3px;
}

/* Pass line chip area */
.pass-chips {
  position: absolute;
  bottom: 50px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; align-items: center;
  z-index: 4;
}

/* Pass Line clickable overlay */
.craps-table::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 84px;
  border-radius: 0 0 50% 50% / 0 0 130px 130px;
  cursor: pointer;
  z-index: 1;
  transition: background .15s;
}
.craps-table.pass-available::before {
  box-shadow: inset 0 0 30px rgba(250,204,21,.12);
}

/* --- Interior --- */

.table-interior {
  border: 3px solid rgba(255,255,255,.75);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  z-index: 3;
}

/* --- Number boxes --- */

.tbl-numbers {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 3px solid rgba(255,255,255,.7);
}

.tbl-num-box {
  position: relative;
  text-align: center;
  padding: 16px 4px 20px;
  min-height: 105px;
  border-right: 2.5px solid rgba(255,255,255,.6);
  cursor: pointer;
  transition: background .15s, box-shadow .2s;
}
.tbl-num-box:last-child { border-right: none; }
.tbl-num-box:hover { background: rgba(255,255,255,.04); }

.tbl-num-box.available {
  box-shadow: inset 0 0 20px rgba(250,204,21,.2);
}
.tbl-num-box.available::after {
  content: '';
  position: absolute; inset: 0;
  border: 2.5px solid rgba(250,204,21,.5);
  pointer-events: none;
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}
.tbl-num-box.unavailable { opacity: .4; cursor: default; }

.num-main {
  font-size: 34px; font-weight: 900;
  color: #fff;
  text-shadow: 1px 2px 5px rgba(0,0,0,.5);
  line-height: 1.1;
  letter-spacing: 1px;
}

/* ON puck — realistic black/white disc */
.num-puck {
  position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #111;
  letter-spacing: .5px;
  background: radial-gradient(circle at 40% 35%, #fff 0%, #f0f0f0 50%, #ccc 100%);
  box-shadow:
    0 0 14px rgba(255,255,255,.5),
    0 3px 8px rgba(0,0,0,.5),
    inset 0 -2px 4px rgba(0,0,0,.12);
  border: 3px solid #222;
  z-index: 5;
}
.num-puck.puck-on { display: flex; }

/* Chips inside number boxes */
.num-chip-area {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 3px; margin-top: 8px; min-height: 22px;
}

/* --- Generic table rows --- */

.tbl-row {
  position: relative;
  border-bottom: 3px solid rgba(255,255,255,.65);
  display: flex; align-items: center; justify-content: center;
  gap: 14px; transition: background .15s, box-shadow .2s;
}
.tbl-row:last-child { border-bottom: none; }

.row-chips {
  position: absolute; right: 18%; top: 50%; transform: translateY(-50%);
  display: flex; gap: 4px; z-index: 4;
}

/* --- Don't Come Bar --- */

.tbl-dont-come {
  padding: 9px 16px; min-height: 36px;
  background: rgba(160,35,35,.14);
}
.dc-text {
  font-size: 14px; font-weight: 700; color: rgba(255,255,255,.7);
  letter-spacing: 2px; text-transform: uppercase;
}
.bar-text {
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,.45);
  letter-spacing: 1px;
}

/* --- COME --- */

.tbl-come {
  padding: 30px 16px;
  min-height: 126px;
  cursor: pointer;
}
.tbl-come:hover { background: rgba(255,255,255,.03); }
.tbl-come.available {
  box-shadow: inset 0 0 28px rgba(250,204,21,.15);
}
.tbl-come.available::after {
  content: '';
  position: absolute; inset: 0;
  border: 2.5px solid rgba(250,204,21,.4);
  pointer-events: none;
  animation: pulse-glow 2s ease-in-out infinite;
}

.come-text {
  font-size: 40px; font-weight: 900;
  color: #ffd700;
  letter-spacing: 10px;
  text-shadow: 1px 2px 6px rgba(0,0,0,.5), 0 0 24px rgba(255,215,0,.12);
}

/* --- FIELD --- */

.tbl-field {
  padding: 14px 16px;
  min-height: 88px;
  flex-direction: column; gap: 4px;
}

.field-layout {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%;
}
.field-top {
  display: flex; align-items: center; justify-content: center;
}
.field-word {
  font-size: 22px; font-weight: 900;
  color: #ffd700;
  letter-spacing: 8px;
  text-shadow: 1px 2px 4px rgba(0,0,0,.4);
}
.field-nums {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  flex-wrap: wrap;
}
.fn {
  font-size: 21px; font-weight: 800; color: rgba(255,255,255,.88);
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* Circled 2 and 12 with payout callouts */
.fn-circle {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0;
  border: 2.5px solid;
  border-radius: 50%;
  width: 56px; height: 56px;
  padding: 2px;
}
.fn-circle .fn-num {
  font-size: 19px; font-weight: 900; line-height: 1;
}
.fn-circle .fn-pay {
  font-size: 7px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
  line-height: 1.1; text-align: center;
}
.fn-double {
  color: #ef4444;
  border-color: #ef4444;
  text-shadow: 0 0 8px rgba(239,68,68,.25);
}
.fn-triple {
  color: #ef4444;
  border-color: #ef4444;
  text-shadow: 0 0 8px rgba(239,68,68,.25);
}

/* --- Don't Pass Bar --- */

.tbl-dont-pass {
  padding: 9px 16px; min-height: 36px;
  background: rgba(160,35,35,.14);
}
.dp-text {
  font-size: 14px; font-weight: 700; color: rgba(255,255,255,.7);
  letter-spacing: 2px; text-transform: uppercase;
}

/* --- Coaching pill (subtle "higher edge" indicator) --- */

.coach-pill {
  position: absolute;
  right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 8px; font-weight: 600;
  color: rgba(255,255,255,.28);
  text-transform: uppercase; letter-spacing: .5px;
  background: rgba(0,0,0,.2);
  padding: 2px 8px; border-radius: 10px;
  pointer-events: none;
}

/* --- Big 6 & 8 corner decoration --- */

.big-6-8 {
  position: absolute;
  left: 66px; bottom: 88px;
  display: flex; flex-direction: column; align-items: center;
  gap: 0; z-index: 4;
  padding: 4px 10px;
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 6px;
  background: rgba(0,0,0,.08);
}
.big-label {
  font-size: 8px; font-weight: 800; color: rgba(255,255,255,.55);
  letter-spacing: 1px; text-transform: uppercase;
  line-height: 1;
}
.big-num {
  font-size: 22px; font-weight: 900;
  color: #ef4444;
  line-height: 1.05;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* --- Proposition Bets (center section) --- */

.tbl-props {
  border-bottom: 3px solid rgba(255,255,255,.65);
  padding: 8px 10px;
  background: rgba(0,0,0,.12);
}
.props-header {
  font-size: 9px; font-weight: 800; color: rgba(255,255,255,.5);
  text-transform: uppercase; letter-spacing: 2px;
  text-align: center; margin-bottom: 6px;
}
.props-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.prop-box {
  position: relative;
  padding: 6px 4px;
  text-align: center;
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.8);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s, box-shadow .2s;
  line-height: 1.3;
}
.prop-box:hover { background: rgba(255,255,255,.06); }
.prop-box.available {
  box-shadow: inset 0 0 12px rgba(250,204,21,.15);
  border-color: rgba(250,204,21,.4);
}
.prop-box.unavailable { opacity: .35; cursor: default; }
.prop-box.has-bet { border-color: rgba(239,68,68,.6); background: rgba(239,68,68,.08); }

.prop-dice { display: block; font-size: 14px; line-height: 1; margin-bottom: 1px; }
.prop-odds {
  display: block; font-size: 8px; font-weight: 600;
  color: rgba(255,255,255,.45); margin-top: 1px;
}

/* Buy bets span full width on their row */
.prop-buy { grid-column: span 2; }

/* Chip style for props */
.chip-prop { background: #7c3aed; }
.chip-prop::before { border-color: rgba(124,58,237,.25); }
.chip-buy  { background: #0d9488; }
.chip-buy::before { border-color: rgba(13,148,136,.25); }

/* Bet row styles for sidebar */
.bet-row-prop  { background: rgba(124,58,237,.1); border-left: 3px solid #7c3aed; }
.bet-row-buy   { background: rgba(13,148,136,.1); border-left: 3px solid #0d9488; }
.bet-row-hard  { background: rgba(234,88,12,.1); border-left: 3px solid #ea580c; }

/* ==================== Chip tokens ==================== */

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 24px; border-radius: 13px;
  font-size: 10px; font-weight: 800; color: #fff;
  padding: 0 7px;
  border: 2.5px solid rgba(255,255,255,.5);
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
  box-shadow: 0 2px 4px rgba(0,0,0,.4), inset 0 -1px 2px rgba(0,0,0,.2);
  position: relative;
}
/* Chip edge dashes (like real casino chips) */
.chip::before {
  content: '';
  position: absolute; inset: -2px;
  border: 2.5px dashed rgba(255,255,255,.25);
  border-radius: 15px;
  pointer-events: none;
}

.chip-pass   { background: var(--chip-red); }
.chip-odds   { background: var(--chip-blue); }
.chip-come   { background: var(--chip-green); }
.chip-place  { background: var(--chip-black); border-color: var(--gold); color: var(--gold); }
.chip-place::before { border-color: rgba(250,204,21,.2); }
.chip-dont   { background: #8b2252; }
.chip-dont::before { border-color: rgba(200,100,150,.25); }
.chip-field  { background: #b45309; }
.chip-big    { background: #991b1b; }

/* --- Full-mode interactive states for Don't Come, Field, Don't Pass, Big 6/8 --- */

.tbl-dont-come.available,
.tbl-dont-pass.available,
.tbl-field.available {
  cursor: pointer;
  box-shadow: inset 0 0 20px rgba(250,204,21,.12);
}
.tbl-dont-come.available:hover,
.tbl-dont-pass.available:hover,
.tbl-field.available:hover {
  background: rgba(255,255,255,.04);
}
.tbl-dont-come.available::after,
.tbl-dont-pass.available::after,
.tbl-field.available::after {
  content: '';
  position: absolute; inset: 0;
  border: 2px solid rgba(250,204,21,.3);
  pointer-events: none;
  animation: pulse-glow 2s ease-in-out infinite;
}

.big-6-8.available {
  cursor: pointer;
  box-shadow: 0 0 12px rgba(250,204,21,.2);
}
.big-6-8.available:hover {
  background: rgba(255,255,255,.06);
}

/* Mode gating: hide coach pills when active, show interactive elements only in full mode */
.tbl-dont-come.active .coach-pill,
.tbl-dont-pass.active .coach-pill,
.tbl-field.active .coach-pill { display: none; }

/* ==================== Dice strip ==================== */

.dice-strip {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; padding: 14px 0; flex-wrap: wrap;
}
.dice-display { display: flex; align-items: center; gap: 10px; }
.die {
  font-size: 38px; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: #111; border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.die-seven { background: #fecaca; color: var(--red); }
.dice-total { font-size: 26px; font-weight: 800; min-width: 38px; text-align: center; }
.total-seven { color: var(--red); }

.btn-roll {
  padding: 12px 36px; background: var(--green); color: #000; border: none;
  border-radius: var(--radius); font-size: 17px; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: 1px;
}
.btn-roll:hover { background: #2dd870; transform: translateY(-1px); }
.btn-roll:active { transform: translateY(0); }

.manual-roll { display: flex; align-items: center; gap: 4px; }
.die-input {
  width: 40px; height: 36px; text-align: center; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
  font-size: 15px; font-weight: 700; outline: none;
}
.die-input:focus { border-color: var(--blue); }
.btn-sm {
  padding: 6px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-muted); font-size: 12px; cursor: pointer;
}
.btn-sm:hover { background: var(--surface-3); color: var(--text); }

.rolling { animation: shake .35s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px) rotate(-4deg); }
  50% { transform: translateX(6px) rotate(4deg); }
  75% { transform: translateX(-3px) rotate(-1deg); }
}

/* ==================== Roll history ==================== */

.history-ribbon {
  display: flex; gap: 5px; padding: 6px 0; flex-wrap: wrap; min-height: 32px;
}
.hist {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--surface-3); color: var(--text-dim);
  cursor: pointer; transition: transform .1s, box-shadow .15s;
}
.hist:hover { transform: scale(1.15); box-shadow: 0 0 8px rgba(255,255,255,.15); }
.hist-win  { background: var(--green-dim); color: var(--green); }
.hist-loss { background: var(--red-dim); color: var(--red); }

/* Roll detail popup */
.hist-detail {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  margin-top: 8px; animation: slideUp .2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.hd-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.hd-title { font-size: 14px; font-weight: 700; }
.hd-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.hd-close:hover { color: var(--text); }
.hd-phase {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-dim); margin-bottom: 10px;
}
.hd-events { margin-bottom: 10px; }
.hd-evt {
  padding: 4px 8px; margin-bottom: 3px; border-radius: 4px;
  font-size: 12px; line-height: 1.5; background: var(--surface-2);
}
.hd-win   { border-left: 3px solid var(--green); }
.hd-loss  { border-left: 3px solid var(--red); }
.hd-seven { border-left: 3px solid var(--red); font-weight: 600; }
.hd-point { border-left: 3px solid var(--green); font-weight: 600; }
.hd-net {
  padding: 6px 10px; border-radius: var(--radius);
  background: var(--surface-3); font-size: 13px; font-weight: 600;
  text-align: center;
}

/* ==================== Feedback panel ==================== */

.feedback-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px; margin-top: 6px;
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.feedback-events { margin-bottom: 10px; }
.event-line {
  padding: 7px 12px; margin-bottom: 4px; border-radius: var(--radius);
  background: var(--surface-2); font-size: 13px; line-height: 1.5;
  border-left: 3px solid var(--border);
}
.event-line.evt-win  { border-left-color: var(--green); background: rgba(34,197,94,.08); }
.event-line.evt-loss { border-left-color: var(--red); background: rgba(239,68,68,.08); }
.event-line.evt-seven { border-left-color: var(--red); background: rgba(239,68,68,.12); font-weight: 600; }
.event-line.evt-info { border-left-color: var(--text-dim); }

.evt-amount { font-weight: 700; }
.evt-pos { color: var(--green); }
.evt-neg { color: var(--red); }

.event-summary {
  padding: 8px 12px; margin-top: 6px;
  border-radius: var(--radius);
  background: var(--surface-3);
  font-size: 14px; font-weight: 600;
  text-align: center; letter-spacing: .3px;
}
.grade-line {
  padding: 7px 10px; margin-bottom: 3px; border-radius: var(--radius);
  font-size: 12px; line-height: 1.5; border-left: 3px solid var(--border);
}
.grade-great { border-left-color: var(--green); background: rgba(34,197,94,.08); }
.grade-good  { border-left-color: var(--blue);  background: rgba(59,130,246,.06); }
.grade-ok    { border-left-color: var(--orange); background: rgba(249,115,22,.06); }
.grade-miss  { border-left-color: var(--red);    background: rgba(239,68,68,.06); }
.grade-warn  { border-left-color: var(--red);    background: rgba(239,68,68,.08); }
.grade-caution { border-left-color: var(--orange); background: rgba(249,115,22,.06); }

/* ==================== Sidebar ==================== */

.sb-panel {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.sb-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-dim); margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.sb-title.clickable { cursor: pointer; }

.bets-list .bet-row {
  padding: 5px 8px; margin-bottom: 3px; border-radius: 4px;
  font-size: 12px; font-weight: 600; display: flex;
  justify-content: space-between; align-items: center;
}
.bet-row-pass  { background: rgba(220,38,38,.12); border-left: 3px solid var(--chip-red); }
.bet-row-odds  { background: rgba(37,99,235,.1);  border-left: 3px solid var(--chip-blue); }
.bet-row-come  { background: rgba(22,163,74,.1);  border-left: 3px solid var(--chip-green); }
.bet-row-place { background: rgba(250,204,21,.08); border-left: 3px solid var(--gold); }
.bet-row-dont  { background: rgba(139,34,82,.12); border-left: 3px solid #8b2252; }
.bet-row-field { background: rgba(180,83,9,.1); border-left: 3px solid #b45309; }
.bet-row-big   { background: rgba(153,27,27,.1); border-left: 3px solid #991b1b; }
.bets-list .empty { color: var(--text-dim); font-size: 12px; text-align: center; padding: 10px; }
.remove-x {
  background: none; border: none; color: var(--red); cursor: pointer;
  font-size: 14px; font-weight: 700; line-height: 1; padding: 0 4px;
}
.remove-x:hover { color: #f87171; }
.bet-lock {
  font-size: 8px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--surface-3); padding: 1px 5px; border-radius: 3px;
  margin-left: 4px; vertical-align: middle;
}

.coaching-list .coach-card {
  padding: 8px 10px; margin-bottom: 5px; border-radius: var(--radius);
  font-size: 12px; line-height: 1.6; background: var(--surface);
  border-left: 3px solid var(--border);
}
.coach-card.r-best { border-left-color: var(--green); }
.coach-card.r-good { border-left-color: var(--blue); }
.coach-card.r-acceptable { border-left-color: var(--orange); }
.coach-card.r-info { border-left-color: var(--text-dim); }

.coaching-hidden .coaching-list { filter: blur(6px); pointer-events: none; }
#coaching-wrapper { position: relative; }
.btn-reveal {
  padding: 2px 10px; background: var(--blue); color: #fff; border: none;
  border-radius: 10px; font-size: 10px; font-weight: 600; cursor: pointer;
}
.btn-reveal:hover { background: #5b9bf7; }
.btn-reveal.hidden { display: none; }

.quick-bets-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.qbtn {
  padding: 7px 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 11px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; text-align: center;
  transition: all .15s;
}
.qbtn:hover:not(.qbtn-disabled) { background: var(--surface-3); color: var(--text); border-color: var(--gold); }
.qbtn-disabled { opacity: .3; cursor: default; }
.qbtn-badge { display: block; font-size: 9px; font-weight: 600; margin-top: 1px; }
.qbtn-badge.badge-best { color: var(--green); }
.qbtn-badge.badge-good { color: var(--blue); }
.qbtn-badge.badge-ok   { color: var(--orange); }
.qbtn-badge.badge-warn { color: #ef4444; }

.ref-panel { border: 1px solid var(--border); border-radius: var(--radius); }
.ref-panel summary { padding: 10px 12px; cursor: pointer; list-style: none; }
.ref-panel summary::-webkit-details-marker { display: none; }
.ref-content {
  padding: 0 12px 10px; font-size: 11px; color: var(--text-muted); line-height: 1.8;
}
.ref-content hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

/* ==================== Bet picker ==================== */

.bet-picker {
  position: fixed; z-index: 50;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  min-width: 240px;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.picker-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.picker-info { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
.picker-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.preset-btn {
  padding: 6px 14px; background: var(--green); color: #000;
  border: none; border-radius: var(--radius); font-size: 13px;
  font-weight: 700; cursor: pointer;
}
.preset-btn:hover { background: #2dd870; }
.preset-btn.preset-max { background: var(--gold); color: #000; }
.picker-custom { display: flex; gap: 6px; margin-bottom: 8px; }
.picker-input {
  flex: 1; padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 14px; outline: none;
}
.btn-confirm { background: var(--green); color: #000; border-color: var(--green); font-weight: 700; }
.btn-cancel { width: 100%; background: var(--surface-2); }

/* ==================== Modals ==================== */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  max-width: 500px; width: 100%; max-height: 85vh; overflow-y: auto;
}
.modal-wide { max-width: 780px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.modal-header h2 { font-size: 18px; color: var(--gold); }
.btn-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 24px; cursor: pointer; padding: 0 4px; line-height: 1;
}
.btn-close:hover { color: var(--text); }

#bankroll-canvas { width: 100%; height: auto; display: block; margin-bottom: 12px; }
.graph-legend { display: flex; gap: 20px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 24px; height: 3px; border-radius: 2px; }
.legend-bankroll { background: var(--green); }
.legend-total { background: var(--blue); }
.legend-start { background: var(--text-dim); height: 1px; border-top: 2px dashed var(--text-dim); }

.summary-section { margin-bottom: 18px; }
.summary-section h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-dim); margin-bottom: 6px;
}
.summary-row {
  display: flex; justify-content: space-between; padding: 5px 0;
  font-size: 13px; border-bottom: 1px solid var(--surface-3);
}
.summary-net { font-weight: 700; font-size: 15px; border-bottom: none; padding-top: 6px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.assessment {
  font-size: 13px; line-height: 1.6; color: var(--text-muted);
  padding: 10px; background: var(--surface-2); border-radius: var(--radius);
}

/* ==================== Toast ==================== */

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: #fff; padding: 10px 24px;
  border-radius: var(--radius); font-size: 14px; font-weight: 600;
  z-index: 200; transition: opacity .3s;
}
.toast.show { opacity: 1; }
.toast.hidden { opacity: 0; pointer-events: none; }

/* ==================== Responsive ==================== */

/* --- Tablet / narrow desktop --- */
@media (max-width: 860px) {
  .main-content { grid-template-columns: 1fr; }
  .sidebar { border-left: none; border-top: 1px solid var(--border); }
  .craps-table { padding: 0 42px 64px 42px; }
  .pass-label-bottom { font-size: 18px; letter-spacing: 6px; bottom: 18px; }
  .pass-label-left, .pass-label-right { font-size: 12px; }
  .pass-chips { bottom: 38px; }
  .craps-table::before { height: 64px; }
  .num-main { font-size: 26px; }
  .tbl-num-box { min-height: 85px; padding: 12px 4px 16px; }
  .come-text { font-size: 30px; letter-spacing: 6px; }
  .field-word { font-size: 18px; }
  .fn-circle { width: 46px; height: 46px; }
  .fn-circle .fn-num { font-size: 16px; }
  .big-6-8 { left: 46px; bottom: 68px; }
  .big-num { font-size: 18px; }
  .props-grid { grid-template-columns: repeat(3, 1fr); }
  .prop-box { font-size: 9px; padding: 5px 3px; }
  .prop-dice { font-size: 12px; }
}

/* --- Phone --- */
@media (max-width: 520px) {
  /* Header: stack into rows */
  .header-bar {
    padding: 8px 12px; gap: 8px;
    flex-wrap: wrap; justify-content: center;
  }
  .header-left { width: 100%; justify-content: center; gap: 8px; }
  .header-left h2 { font-size: 13px; }
  .header-stats {
    width: 100%; justify-content: space-around; gap: 4px;
    padding: 4px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  }
  .stat-label { font-size: 8px; }
  .stat-value { font-size: 14px; }
  .header-actions { width: 100%; justify-content: center; }
  .btn-hdr { font-size: 11px; padding: 4px 8px; }

  /* Center column */
  .center-col { padding: 8px 8px; }

  /* Table: tighter pass line band */
  .craps-table {
    padding: 0 24px 48px 24px;
    border-width: 6px;
    border-radius: 6px 6px 50% 50% / 6px 6px 80px 80px;
  }
  .craps-table::before {
    height: 48px;
    border-radius: 0 0 50% 50% / 0 0 80px 80px;
  }
  .pass-label-bottom {
    font-size: 13px; letter-spacing: 4px;
    bottom: 12px; padding: 4px 16px;
  }
  .pass-label-left, .pass-label-right {
    font-size: 9px; letter-spacing: 1px;
  }
  .pass-label-left { left: 4px; }
  .pass-label-right { right: 4px; }
  .pass-chips { bottom: 26px; }
  .pass-chips .chip { min-width: 26px; height: 20px; font-size: 8px; padding: 0 4px; }

  /* Table interior border */
  .table-interior { border-width: 2px; }
  .tbl-numbers { border-bottom-width: 2px; }

  /* Number boxes: compact */
  .tbl-num-box {
    min-height: 62px; padding: 6px 2px 10px;
    border-right-width: 1.5px;
  }
  .num-main { font-size: 18px; letter-spacing: 0; }
  .num-puck { width: 26px; height: 26px; font-size: 8px; border-width: 2px; top: 2px; }
  .num-chip-area { margin-top: 4px; min-height: 18px; }
  .num-chip-area .chip { min-width: 24px; height: 18px; font-size: 7px; padding: 0 3px; }

  /* Table rows */
  .tbl-row { border-bottom-width: 2px; gap: 8px; }
  .tbl-dont-come, .tbl-dont-pass { padding: 5px 8px; min-height: 28px; }
  .dc-text, .dp-text { font-size: 10px; letter-spacing: 1px; }
  .bar-text { font-size: 9px; }
  .coach-pill { font-size: 7px; right: 4px; padding: 1px 5px; }

  /* Come */
  .tbl-come { padding: 16px 8px; min-height: 70px; }
  .come-text { font-size: 22px; letter-spacing: 4px; }
  .row-chips .chip { min-width: 24px; height: 18px; font-size: 7px; padding: 0 3px; }

  /* Field */
  .tbl-field { padding: 8px 6px; min-height: 60px; }
  .field-word { font-size: 14px; letter-spacing: 4px; }
  .field-nums { gap: 4px; }
  .fn { font-size: 15px; }
  .fn-circle { width: 34px; height: 34px; border-width: 2px; }
  .fn-circle .fn-num { font-size: 13px; }
  .fn-circle .fn-pay { font-size: 5px; }

  /* Big 6/8 */
  .big-6-8 { left: 26px; bottom: 52px; padding: 2px 6px; border-width: 1.5px; }
  .big-label { font-size: 6px; }
  .big-num { font-size: 14px; }
  .tbl-props { padding: 6px 6px; }
  .props-header { font-size: 7px; margin-bottom: 4px; }
  .props-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .prop-box { font-size: 8px; padding: 4px 2px; }
  .prop-dice { font-size: 10px; }
  .prop-odds { font-size: 7px; }

  /* Dice strip */
  .dice-strip { gap: 8px; padding: 10px 0; }
  .die { font-size: 28px; width: 40px; height: 40px; border-radius: 8px; }
  .dice-total { font-size: 20px; min-width: 30px; }
  .btn-roll { padding: 10px 24px; font-size: 14px; }
  .manual-roll { gap: 3px; }
  .die-input { width: 32px; height: 30px; font-size: 13px; }

  /* History */
  .hist { width: 24px; height: 24px; font-size: 10px; }

  /* Feedback */
  .feedback-panel { padding: 10px; }
  .event-line { padding: 5px 8px; font-size: 12px; }
  .event-summary { font-size: 12px; padding: 6px 8px; }
  .grade-line { font-size: 11px; padding: 5px 8px; }

  /* Sidebar panels */
  .sidebar { padding: 8px; gap: 8px; }

  /* Bet picker */
  .bet-picker {
    min-width: 0; width: calc(100vw - 32px);
    left: 16px; right: 16px; transform: translate(0, -50%);
  }

  /* Win banner */
  .win-text { font-size: 36px; letter-spacing: 4px; }
  .win-amount { font-size: 18px; }

  /* Modals */
  .modal-overlay { padding: 12px; }
  .modal-card { padding: 16px; }
  .modal-header h2 { font-size: 16px; }
}

/* ==================== Multiplayer ==================== */

.mp-divider {
  text-align: center; margin: 20px 0 12px;
  position: relative; color: var(--text-dim); font-size: 12px;
}
.mp-divider::before, .mp-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 30%; height: 1px; background: var(--border);
}
.mp-divider::before { left: 0; }
.mp-divider::after { right: 0; }

.mp-setup { overflow: hidden; transition: max-height .35s ease, opacity .35s ease; }
.mp-collapsed { max-height: 0; opacity: 0; pointer-events: none; }
.mp-setup:not(.mp-collapsed) { max-height: 300px; opacity: 1; }
.mp-divider { cursor: pointer; }
.mp-divider:hover { color: var(--text-muted); }

.mp-btns { display: flex; flex-direction: column; gap: 8px; }
.btn-mp {
  padding: 10px 16px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.btn-mp-create { background: var(--blue); color: #fff; width: 100%; }
.btn-mp-create:hover { background: #5b9bf7; }
.mp-join-row { display: flex; gap: 6px; }
.mp-code-input {
  flex: 1; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 15px;
  font-family: monospace; letter-spacing: 2px; text-transform: lowercase; outline: none;
}
.mp-code-input:focus { border-color: var(--blue); }
.btn-mp-join { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); }
.btn-mp-join:hover { border-color: var(--blue); color: var(--blue); }

/* Game bar */
.mp-game-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--blue-dim); border-bottom: 1px solid var(--blue);
  padding: 8px 20px; flex-wrap: wrap;
}
.mp-room-info {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.mp-room-info strong {
  font-family: monospace; font-size: 14px; color: var(--text);
  letter-spacing: 2px;
}
.btn-mp-copy {
  padding: 2px 8px; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 4px; font-size: 10px; color: var(--text-muted); cursor: pointer;
}
.btn-mp-copy:hover { color: var(--text); }

.mp-players-list {
  display: flex; gap: 8px; flex: 1; flex-wrap: wrap;
}
.mp-player {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: var(--surface-3); border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.mp-player.mp-you { border: 1px solid var(--blue); }
.mp-player.mp-inactive { opacity: .45; }
.mp-player-name { color: var(--text); }
.mp-player-bankroll { color: var(--text-muted); }
.mp-shooter-badge {
  font-size: 8px; font-weight: 700; text-transform: uppercase;
  background: var(--gold); color: #000; padding: 1px 5px; border-radius: 3px;
  letter-spacing: .5px;
}
.mp-shot-clock {
  font-size: 9px; font-weight: 700; color: var(--red);
  margin-left: 4px; font-variant-numeric: tabular-nums;
}
.mp-shot-clock::before { content: '\23f1\00a0'; font-size: 8px; }

.btn-mp-start {
  background: var(--green); color: #000; font-size: 12px; padding: 6px 14px;
}
.btn-mp-start:disabled { opacity: .5; cursor: default; }
.btn-mp-leave {
  background: transparent; color: var(--text-dim); font-size: 11px;
  padding: 4px 10px; border: 1px solid var(--border);
}
.btn-mp-leave:hover { color: var(--red); border-color: var(--red); }

/* Disabled roll button in multiplayer */
.btn-roll:disabled {
  opacity: .5; cursor: default; background: var(--surface-3); color: var(--text-dim);
}
.btn-roll:disabled:hover { transform: none; }

/* ==================== Tutorial ==================== */

.btn-tutorial {
  width: 100%; padding: 12px; background: transparent; color: var(--blue);
  border: 2px solid var(--blue); border-radius: var(--radius);
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px;
  transition: all .15s;
}
.btn-tutorial:hover { background: rgba(59,130,246,.1); }

.tutorial-card {
  position: fixed; z-index: 60;
  bottom: 24px; right: 24px;
  width: 380px; max-width: calc(100vw - 48px);
  background: var(--surface); border: 1px solid var(--blue);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(59,130,246,.2);
  overflow: hidden;
  animation: tutSlideIn .3s ease;
}
@keyframes tutSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.tut-progress-bar {
  height: 3px; background: var(--surface-3); width: 100%;
}
.tut-progress-fill {
  height: 100%; background: var(--blue);
  transition: width .4s ease;
}
.tut-step-count {
  padding: 12px 16px 0;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--blue);
}
.tut-title {
  padding: 4px 16px 0;
  font-size: 16px; font-weight: 700; color: var(--text);
}
.tut-body {
  padding: 10px 16px;
  font-size: 13px; line-height: 1.7; color: var(--text-muted);
}
.tut-body strong { color: var(--text); font-weight: 700; }
.tut-actions {
  padding: 0 16px 12px;
}
.tut-btn {
  padding: 10px 20px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.tut-btn-next {
  background: var(--blue); color: #fff;
}
.tut-btn-next:hover { background: #5b9bf7; }
.tut-btn-finish {
  background: var(--green); color: #000;
}
.tut-btn-finish:hover { background: #2dd870; }
.tut-hint {
  font-size: 12px; color: var(--blue); font-weight: 600;
  padding: 6px 0;
  animation: tutPulse 2s ease-in-out infinite;
}
@keyframes tutPulse {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}
.tut-skip {
  display: block; width: 100%;
  padding: 8px; background: var(--surface-2); border: none; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 11px; cursor: pointer;
  transition: color .15s;
}
.tut-skip:hover { color: var(--text-muted); }

/* Spotlight target */
.tut-spotlight-target {
  position: relative; z-index: 10;
  box-shadow: 0 0 0 4px rgba(59,130,246,.5), 0 0 20px rgba(59,130,246,.3) !important;
  border-radius: 4px;
}
.tut-pulse {
  animation: tutTargetPulse 1.5s ease-in-out 2;
}
@keyframes tutTargetPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(59,130,246,.5), 0 0 20px rgba(59,130,246,.3); }
  50% { box-shadow: 0 0 0 8px rgba(59,130,246,.6), 0 0 30px rgba(59,130,246,.5); }
}

@media (max-width: 860px) {
  .tutorial-card {
    bottom: 12px; right: 12px; left: 12px;
    width: auto; max-width: none;
  }
}
@media (max-width: 520px) {
  .tutorial-card {
    bottom: auto; top: 60px; right: 8px; left: 8px;
    width: auto; max-width: none;
    max-height: 45vh; overflow-y: auto;
  }
  .tut-title { font-size: 14px; }
  .tut-body { font-size: 12px; padding: 8px 12px; line-height: 1.6; }
  .tut-step-count { padding: 8px 12px 0; }
  .tut-actions { padding: 0 12px 8px; }
}

/* ==================== Win/loss animations ==================== */

.confetti-container {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}

/* WIN! banner */
.win-banner {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  animation: win-pop 2s ease-out forwards;
  z-index: 310;
}
.win-text {
  font-size: 56px; font-weight: 900;
  color: #facc15;
  text-shadow: 0 0 20px rgba(250,204,21,.6), 0 2px 8px rgba(0,0,0,.7);
  letter-spacing: 6px;
}
.win-amount {
  font-size: 24px; font-weight: 800;
  color: #22c55e;
  text-shadow: 0 0 12px rgba(34,197,94,.5), 0 2px 6px rgba(0,0,0,.7);
  margin-top: -4px;
}
@keyframes win-pop {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  25% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(0.8); opacity: 0; }
}

/* Confetti pieces — explode outward from center, then fall */
.confetti-piece {
  position: absolute;
  opacity: 1;
  animation: confetti-explode 1.5s ease-out forwards;
}

@keyframes confetti-explode {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  40% {
    transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(calc(var(--spin, 360deg) * 0.5)) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx, 0px), calc(var(--dy, 0px) + var(--fall, 200px))) rotate(var(--spin, 360deg)) scale(0.2);
    opacity: 0;
  }
}

.screen-shake {
  animation: shake-hard 0.4s ease-out;
}

@keyframes shake-hard {
  0%, 100% { transform: translateX(0) translateY(0); }
  10% { transform: translateX(-4px) translateY(2px); }
  20% { transform: translateX(6px) translateY(-2px); }
  30% { transform: translateX(-6px) translateY(1px); }
  40% { transform: translateX(4px) translateY(-1px); }
  50% { transform: translateX(-2px) translateY(2px); }
  60% { transform: translateX(3px); }
  70% { transform: translateX(-1px); }
}

/* ==================== Scrollbar ==================== */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
