/* ============================================================
   Felt Trainer — Craps game-specific styles
   Tokens, resets, setup screen, header bar, modals, toasts,
   and tooltips live in shared/styles.css.
   ============================================================ */

/* ==================== Game Layout ==================== */
.game-screen { display: flex; flex-direction: column; min-height: 100vh; }

.phase-badge {
  padding: 5px 14px; border-radius: 20px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
}
.phase-comeout {
  background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(91,142,201,.4);
  transition: all .3s ease;
}
.phase-point {
  background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(229,184,74,.4);
  transition: all .3s ease;
  animation: phase-shift .5s ease;
}
@keyframes phase-shift {
  0% { transform: scale(0.85); opacity: 0.5; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.btn-mode-toggle {
  border-color: var(--gold); color: var(--gold); font-size: 12px;
  padding: 5px 12px; font-weight: 600;
}
.btn-mode-toggle:hover { background: rgba(229,184,74,.08); }
.btn-mode-active { background: var(--gold-dim); color: var(--gold); border-color: var(--gold); }

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

/* ====================================================
   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(229,184,74,.12);
}

/* --- Interior --- */

.table-interior {
  border: 3px solid rgba(255,255,255,.75);
  border-radius: 4px;
  /* overflow stays visible so hover tooltips on the top number row aren't
     clipped — the children are transparent felt, so nothing else shows. */
  overflow: visible;
  position: relative;
  z-index: 3;
  /* Authentic half-table geometry: main betting block + proposition rail. */
  display: grid;
  grid-template-columns: 1fr 150px;
}

/* Left: main betting block (Don't Come + numbers, Come, Field, Don't Pass) */
.table-main { display: flex; flex-direction: column; position: relative; }

/* Top row: Don't Come box beside the six place-number boxes */
.tbl-top {
  display: grid;
  grid-template-columns: 60px 1fr;
  border-bottom: 3px solid rgba(255,255,255,.7);
}
.tbl-top .tbl-dont-come {
  border-right: 3px solid rgba(255,255,255,.6);
  border-bottom: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 3px; padding: 6px 4px; min-height: 0;
}
.tbl-dont-come .dc-text { font-size: 10px; letter-spacing: 1px; line-height: 1.15; }
.tbl-dont-come .bar-text { font-size: 9px; }

/* ==================== Bet tooltips ====================
   Uses the shared [data-tooltip] system (shared/styles.css). The felt bets
   and quick-bet buttons carry longer explanations than the shared nowrap
   default fits, so wrap them and float them above everything on the table. */
.craps-table [data-tooltip]::after,
.qbtn[data-tooltip]::after,
.btn-roll[data-tooltip]::after {
  white-space: normal;
  width: max-content;
  max-width: 220px;
  text-align: center;
  line-height: 1.45;
  z-index: 50;
  /* Don't inherit text-transform from the host (e.g. the uppercase Roll button) */
  text-transform: none;
}

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

.tbl-numbers {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}

.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(229,184,74,.2);
}
/* Highlight uses ::before so it never collides with the tooltip's ::after */
.tbl-num-box.available::before {
  content: '';
  position: absolute; inset: 0;
  border: 2.5px solid rgba(229,184,74,.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: #f3d24e;
  text-shadow: 1px 2px 5px rgba(0,0,0,.55), 0 0 12px rgba(243,210,78,.18);
  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: 16px 16px;
  min-height: 84px;
  cursor: pointer;
}
.tbl-come:hover { background: rgba(255,255,255,.03); }
.tbl-come.available {
  box-shadow: inset 0 0 28px rgba(229,184,74,.15);
}
.tbl-come.available::before {
  content: '';
  position: absolute; inset: 0;
  border: 2.5px solid rgba(229,184,74,.4);
  pointer-events: none;
  animation: pulse-glow 2s ease-in-out infinite;
}

.come-text {
  font-size: 40px; font-weight: 900;
  color: #e04646;
  letter-spacing: 14px;
  text-shadow: 1px 2px 6px rgba(0,0,0,.55), 0 0 22px rgba(224,70,70,.18);
}

/* --- FIELD --- */

.tbl-field {
  padding: 12px 16px;
  min-height: 88px;
  flex: 1;               /* absorb any extra interior height here, not in COME */
  flex-direction: column; gap: 8px;
}

.field-layout {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; width: 100%;
}
.field-word {
  font-size: 19px; font-weight: 900;
  color: #e04646;
  letter-spacing: 7px;
  text-shadow: 1px 2px 4px rgba(0,0,0,.45);
}
.field-nums {
  display: flex; gap: 16px; 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: #e05252;
  border-color: #e05252;
  text-shadow: 0 0 8px rgba(224,82,82,.25);
}
.fn-triple {
  color: #e05252;
  border-color: #e05252;
  text-shadow: 0 0 8px rgba(224,82,82,.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 --- */

/* --- Bottom band: Big 6/8 (own section) + Don't Pass (wraps inside Pass Line) --- */
.table-bottom {
  display: flex; align-items: stretch;
  position: relative; z-index: 3;
}
.big-6-8 {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0; padding: 4px 12px;
  border: 3px solid rgba(255,255,255,.55);
  border-top: none;
  background: rgba(0,0,0,.12);
  cursor: pointer;
}
.dp-band {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  position: relative;
  min-height: 42px; padding: 8px 16px;
  border: 3px solid rgba(255,255,255,.55);
  border-top: none;
  border-radius: 0 0 45% 45% / 0 0 60px 60px;
  background: rgba(160,35,35,.16);
  cursor: pointer;
}

/* Don't Pass continuation up the rails (decorative — makes it wrap) */
.dp-rail {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  color: rgba(255,255,255,.5); text-align: center; line-height: 1.12;
  pointer-events: none; z-index: 2;
}
.dp-rail-left { left: 38px; }
.dp-rail-right { right: 38px; }

/* Inline mini-dice (e.g. Yo = 5 and 6) */
.prop-left { display: inline-flex; align-items: center; gap: 5px; }
.prop-dice-sm .dice-pair { width: 26px; height: 13px; margin: 0; }
.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: #e05252;
  line-height: 1.05;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* --- Proposition Bets — right rail --- */

.tbl-props {
  border-left: 3px solid rgba(255,255,255,.7);
  padding: 8px 7px;
  background: rgba(0,0,0,.16);
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.props-hardways {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
}
.props-singles { display: flex; flex-direction: column; gap: 4px; }

.prop-box {
  position: relative;
  padding: 5px 4px; text-align: center;
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.85);
  border: 1.5px solid rgba(255,255,255,.28);
  border-radius: 4px; cursor: pointer;
  transition: background .15s, box-shadow .2s;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  line-height: 1.25;
}
.prop-name { font-size: 9px; font-weight: 800; letter-spacing: .3px; }
.prop-odds { font-size: 9px; font-weight: 800; color: #f3d24e; }

/* Single / split / buy bets read as horizontal label + odds rows */
.prop-single, .prop-split, .prop-buy {
  flex-direction: row; justify-content: space-between; padding: 5px 8px;
}
.prop-single .prop-name, .prop-split .prop-name, .prop-buy .prop-name { font-size: 10px; }

/* Any Seven — the worst bet — gets the red felt treatment from the photo */
.prop-single[data-bet="anySeven"] { border-color: rgba(224,70,70,.5); }
.prop-single[data-bet="anySeven"] .prop-name,
.prop-single[data-bet="anySeven"] .prop-odds { color: #e04646; }

.prop-box:hover { background: rgba(255,255,255,.06); }
.prop-box.available {
  box-shadow: inset 0 0 12px rgba(229,184,74,.15);
  border-color: rgba(229,184,74,.4);
}
.prop-box.unavailable { opacity: .35; cursor: default; }
.prop-box.has-bet { border-color: rgba(201,61,61,.6); background: rgba(201,61,61,.08); }

/* SVG dice pips on the hardways */
.dice-pair { width: 40px; height: 19px; display: block; margin: 0 auto 1px; }
.dice-pair .die rect { fill: #fbfbf5; stroke: #1a1a1a; stroke-width: 1.2; }
.dice-pair circle { r: 1.9px; fill: #161616; }

/* Chip style for props */
.chip-prop { background: #6b35b8; }
.chip-prop::before { border-color: rgba(107,53,184,.25); }
.chip-buy  { background: #0d7f75; }
.chip-buy::before { border-color: rgba(13,127,117,.25); }

/* Bet row styles for sidebar */
.bet-row-prop  { background: rgba(107,53,184,.1); border-left: 3px solid #6b35b8; }
.bet-row-buy   { background: rgba(13,127,117,.1); border-left: 3px solid #0d7f75; }
.bet-row-hard  { background: rgba(212,118,42,.1); border-left: 3px solid var(--orange); }

/* ==================== 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(229,184,74,.2); }
.chip-dont   { background: #7a2050; }
.chip-dont::before { border-color: rgba(180,80,130,.25); }
.chip-field  { background: #9a4a10; }
.chip-big    { background: #8a1a1a; }

/* --- 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(229,184,74,.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::before,
.tbl-dont-pass.available::before,
.tbl-field.available::before {
  content: '';
  position: absolute; inset: 0;
  border: 2px solid rgba(229,184,74,.3);
  pointer-events: none;
  animation: pulse-glow 2s ease-in-out infinite;
}

.big-6-8.available {
  cursor: pointer;
  box-shadow: 0 0 12px rgba(229,184,74,.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; }

/* --- Lock glyph: marks advanced areas as Full-Table-only in Easy mode --- */
.lock-glyph {
  position: absolute; top: 4px; right: 6px;
  font-size: 11px; line-height: 1;
  display: none; pointer-events: none; z-index: 6;
}
.props-lock { top: 5px; right: 7px; }

/* --- Easy mode: keep the REAL table shape, just recede the advanced bets so
   beginners focus on Pass Line + Come + Odds (and place numbers) without being
   misled about how the table is laid out. Gray + dim + lock, not hidden. --- */
.craps-table.table-easy .tbl-props,
.craps-table.table-easy .tbl-dont-come,
.craps-table.table-easy .tbl-field,
.craps-table.table-easy .tbl-dont-pass,
.craps-table.table-easy .dp-rail,
.craps-table.table-easy .big-6-8 {
  filter: grayscale(.8) brightness(.6);
  opacity: .6;
}
.craps-table.table-easy .tbl-props .lock-glyph,
.craps-table.table-easy .tbl-dont-come .lock-glyph,
.craps-table.table-easy .tbl-field .lock-glyph,
.craps-table.table-easy .tbl-dont-pass .lock-glyph { display: block; }

/* Easy-mode callout — one clear message instead of per-bet "full mode" pills.
   Centered over the main betting block; only shown in Easy mode. */
.easy-notice { display: none; }
.craps-table.table-easy .easy-notice {
  display: flex; align-items: center; gap: 6px;
  position: absolute; left: 50%; top: 70%;
  transform: translate(-50%, -50%);
  z-index: 9;
  background: rgba(8,26,15,.92);
  border: 1px solid rgba(229,184,74,.55);
  color: #f3d24e;
  font-size: 12px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,.55);
  white-space: nowrap; pointer-events: none;
}
.easy-notice strong { color: #fff; }

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

.dice-strip {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; padding: 16px 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 8px rgba(0,0,0,.3), inset 0 -1px 3px rgba(0,0,0,.1);
}
.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: 13px 40px; background: var(--green); color: #fff; border: none;
  border-radius: var(--radius); font-size: 16px; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: 1.5px;
  font-family: var(--font-body);
  box-shadow: 0 2px 10px rgba(45,159,95,.3);
  transition: all .15s;
}
.btn-roll:hover { background: var(--green-bright); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(45,159,95,.4); }
.btn-roll:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(45,159,95,.2); }

.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; font-family: var(--font-body); outline: none;
}
.die-input:focus { border-color: var(--green); }
.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;
  font-family: var(--font-body);
  transition: all .15s;
}
.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: 8px 0; flex-wrap: wrap; min-height: 34px;
}
.hist {
  width: 30px; height: 30px; 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 .15s, box-shadow .15s;
  border: 1px solid transparent;
}
.hist:hover { transform: scale(1.2); box-shadow: 0 0 10px rgba(255,255,255,.12); }
.hist-win  { background: var(--green-dim); color: var(--green); border-color: rgba(45,159,95,.3); }
.hist-loss { background: var(--red-dim); color: var(--red); border-color: rgba(201,61,61,.3); }
.hist-seven { background: var(--red); color: #fff; border-color: var(--red); font-weight: 800; }
.hist-point { background: var(--green); color: #fff; border-color: var(--green); font-weight: 800; }
.hist-streak { box-shadow: 0 0 6px currentColor; }

/* 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: 16px; margin-top: 8px;
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.feedback-events { margin-bottom: 12px; }
.event-line {
  padding: 8px 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(45,159,95,.06); }
.event-line.evt-loss { border-left-color: var(--red); background: rgba(201,61,61,.06); }
.event-line.evt-seven { border-left-color: var(--red); background: rgba(201,61,61,.1); 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: 10px 14px; margin-top: 8px;
  border-radius: var(--radius);
  background: var(--surface-3);
  font-size: 14px; font-weight: 600;
  text-align: center; letter-spacing: .3px;
}
.grade-line {
  padding: 8px 12px; margin-bottom: 4px; border-radius: var(--radius);
  font-size: 12px; line-height: 1.6; border-left: 3px solid var(--border);
}
.grade-great { border-left-color: var(--green); background: rgba(45,159,95,.06); }
.grade-good  { border-left-color: var(--blue);  background: rgba(91,142,201,.05); }
.grade-ok    { border-left-color: var(--orange); background: rgba(212,118,42,.05); }
.grade-miss  { border-left-color: var(--red);    background: rgba(201,61,61,.05); }
.grade-warn  { border-left-color: var(--red);    background: rgba(201,61,61,.06); }
.grade-caution { border-left-color: var(--orange); background: rgba(212,118,42,.05); }

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

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

.bets-list .bet-row {
  padding: 6px 10px; margin-bottom: 4px; border-radius: 5px;
  font-size: 12px; font-weight: 600; display: flex;
  justify-content: space-between; align-items: center;
}
.bet-row-pass  { background: rgba(178,40,40,.1); border-left: 3px solid var(--chip-red); }
.bet-row-odds  { background: rgba(37,84,160,.08);  border-left: 3px solid var(--chip-blue); }
.bet-row-come  { background: rgba(26,138,66,.08);  border-left: 3px solid var(--chip-green); }
.bet-row-place { background: rgba(229,184,74,.06); border-left: 3px solid var(--gold); }
.bet-row-dont  { background: rgba(122,32,80,.1); border-left: 3px solid #7a2050; }
.bet-row-field { background: rgba(154,74,16,.08); border-left: 3px solid #9a4a10; }
.bet-row-big   { background: rgba(138,26,26,.08); border-left: 3px solid #8a1a1a; }
.bets-list .empty {
  color: var(--text-dim); font-size: 12px; text-align: center; padding: 16px 12px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  line-height: 1.5;
}
.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: var(--red-bright); }
.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 panel — elevated as primary sidebar element */
.coaching-list .coach-card {
  padding: 10px 12px; margin-bottom: 6px; border-radius: var(--radius);
  font-size: 13px; line-height: 1.7; 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: 3px 12px; background: var(--green); color: #fff; border: none;
  border-radius: 10px; font-size: 10px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.btn-reveal:hover { background: var(--green-bright); }
.btn-reveal.hidden { display: none; }

.quick-bets-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.qbtn {
  padding: 8px 6px; 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: 2px; }
.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: var(--red); }

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

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

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

/* ==================== Modals ==================== */
/* Base .modal-overlay/.modal-card/.modal-header/.btn-close in shared/styles.css */

#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: 20px; }
.summary-section h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-dim); margin-bottom: 8px; font-weight: 700;
}
.summary-row {
  display: flex; justify-content: space-between; padding: 6px 0;
  font-size: 13px; border-bottom: 1px solid var(--surface-3);
}
.summary-net { font-weight: 700; font-size: 15px; border-bottom: none; padding-top: 8px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.assessment {
  font-size: 13px; line-height: 1.7; color: var(--text-muted);
  padding: 12px; background: var(--surface-2); border-radius: var(--radius);
}

/* ==================== 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-num { font-size: 18px; }
  .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: 6px;
    flex-wrap: wrap; justify-content: center;
  }
  .header-left { width: 100%; justify-content: center; gap: 8px; }
  .header-left h2 { font-size: 14px; }
  .header-stats {
    width: 100%; justify-content: space-around; gap: 4px;
    padding: 6px 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; gap: 8px; }
  .btn-hdr { font-size: 16px; padding: 6px 10px; }
  .btn-mode-toggle { font-size: 11px; }

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

  /* 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; }

  /* Bottom band on mobile */
  .dp-rail { display: none; }          /* decorative rails off; bottom band carries Don't Pass */
  .dp-band { min-height: 32px; padding: 5px 8px; border-width: 2px; border-radius: 0 0 40% 40% / 0 0 30px 30px; }
  .big-6-8 { padding: 2px 8px; border-width: 2px; }
  .big-label { font-size: 6px; }
  .big-num { font-size: 14px; }
  /* Narrow screens: the props rail won't fit beside the table, so drop the
     interior to one column and stack props as a full-width strip below. The
     authentic side-rail geometry stays on desktop. */
  .table-interior { grid-template-columns: 1fr; }
  .tbl-top { grid-template-columns: 56px 1fr; }
  .tbl-top .tbl-dont-come { border-right-width: 2px; }

  .tbl-props {
    border-left: none;
    border-top: 2px solid rgba(255,255,255,.6);
    padding: 6px; gap: 5px;
  }
  .props-hardways { grid-template-columns: repeat(4, 1fr); }
  .props-singles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .prop-single, .prop-split, .prop-buy { flex-direction: column; padding: 5px 4px; gap: 1px; }
  .prop-box { font-size: 9px; }
  .prop-name { font-size: 8px; }
  .prop-odds { font-size: 8px; }
  .dice-pair { width: 32px; height: 15px; }

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

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

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

  /* Sidebar panels */
  .sidebar { padding: 10px; gap: 10px; }
  .sb-panel { padding: 12px 14px; }

  /* 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: 20px; }
  .modal-header h2 { font-size: 17px; }
}

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

.mp-divider {
  text-align: center; margin: 24px 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;
  font-family: var(--font-body);
}
.btn-mp-create { background: var(--blue); color: #fff; width: 100%; }
.btn-mp-create:hover { background: #6d9ed4; }
.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(--green); }
.btn-mp-join { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); }
.btn-mp-join:hover { border-color: var(--green); color: var(--green); }

/* Game bar */
.mp-game-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--blue-dim); border-bottom: 1px solid rgba(91,142,201,.3);
  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: #1a1a1a; 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: #fff; 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; }

/* ==================== Win/loss animations ==================== */
/* Confetti styles moved to shared/confetti.css */

.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(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
