/* =========================================================
   Sysbox Craps — table felt, chips, dice tray, HUD
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0c0f0d;
  color: #f4f4ee;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

/* Wood cabinet rail wraps the whole table */
.cabinet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 18px 18px;
  gap: 8px;
  background:
    radial-gradient(ellipse at top, #1a120c 0%, #07050a 90%);
}

/* ---------- Topbar: brand + player strip + timer ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #1a1a1a, #0d0d0d);
  border: 1px solid #2a2a2a;
  border-radius: 10px;
}
.brand-mark {
  font-family: "Georgia", serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.3em;
  color: #ffe267;
  padding: 0 8px;
  border-right: 1px solid #2a2a2a;
}
.players-strip {
  flex: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  padding: 2px;
  min-width: 0;
}
.players-strip::-webkit-scrollbar { height: 4px; }
.players-strip::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

.player-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  min-width: 0;
  flex-shrink: 0;
  font-size: 13px;
  transition: box-shadow 0.2s, background 0.2s;
}
.player-pill.shooter {
  background: linear-gradient(180deg, #2a2010, #1a1408);
  border-color: #ffe267;
  box-shadow: 0 0 0 1px #ffe267aa, 0 0 14px rgba(255,226,103,0.35);
}
.player-pill.me { border-color: #6ec0ff; }
.player-pill .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 -1px 2px rgba(0,0,0,0.4);
}
.player-pill .pname {
  font-weight: 600;
  color: #f4f4ee;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-pill .pbal {
  color: #ffe267;
  font-family: "Georgia", serif;
  font-weight: 600;
}

/* Last-5-rolls history pills */
.recent-rolls {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.recent-rolls .rp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 6px;
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  font-family: "Georgia", serif;
  font-weight: 700;
  font-size: 14px;
  color: #f4f4ee;
}
.recent-rolls .rp.r-7    { background: #4a1816; color: #ff8a7a; border-color: #6a1f1c; } /* seven */
.recent-rolls .rp.r-2,
.recent-rolls .rp.r-3,
.recent-rolls .rp.r-12   { background: #3a1f0a; color: #ffb96a; border-color: #553010; } /* craps */
.recent-rolls .rp.r-11   { background: #103a18; color: #8be08b; border-color: #1a5026; } /* yo */
.recent-rolls .rp.r-pt   { background: #1f2a3f; color: #b9c7ff; border-color: #2a3a5a; } /* point number */
.recent-rolls .rp.latest { box-shadow: 0 0 0 1px #ffe267aa, 0 0 8px rgba(255,226,103,0.4); }

.timer {
  font-family: "Georgia", serif;
  font-weight: 700;
  font-size: 16px;
  color: #ffe267;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  background: rgba(0,0,0,0.4);
  border-radius: 6px;
  white-space: nowrap;
  min-width: 130px;
  text-align: center;
}
.timer.warn   { color: #ff8c42; }
.timer.danger { color: #ff5a4a; animation: timerPulse 0.6s ease-in-out infinite alternate; }
@keyframes timerPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* ---------- Name overlay ---------- */
.name-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(ellipse at center, rgba(12,15,13,0.95) 0%, rgba(0,0,0,0.98) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s;
}
.name-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.name-modal {
  background:
    radial-gradient(ellipse at top, #1b6b3a 0%, #0e4322 70%);
  border: 2px solid #835535;
  border-radius: 16px;
  padding: 36px 40px;
  width: min(420px, 90vw);
  text-align: center;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.8),
    inset 0 0 80px rgba(0,0,0,0.4);
}
.name-modal .brand {
  font-family: "Georgia", serif;
  font-size: 36px;
  font-weight: 700;
  color: #ffe267;
  letter-spacing: 0.3em;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
.name-modal .tagline {
  font-size: 13px;
  color: #c9c9b3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.name-modal input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 2px solid #835535;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 18px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0.05em;
}
.name-modal input:focus {
  outline: none;
  border-color: #ffe267;
  box-shadow: 0 0 0 3px rgba(255,226,103,0.2);
}
.join-btn {
  margin-top: 14px;
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  border: 2px solid #1c6b30;
  background: linear-gradient(180deg, #1b8a3a, #0c4d20);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s;
}
.join-btn:hover  { background: linear-gradient(180deg, #25a847, #0e5b27); }
.join-btn:active { transform: scale(0.98); }
.name-error {
  min-height: 18px;
  margin-top: 10px;
  color: #ff8c42;
  font-size: 13px;
  letter-spacing: 0.05em;
}
.table-count {
  margin-top: 8px;
  color: #888;
  font-size: 12px;
  letter-spacing: 0.1em;
}

/* ---------- Table ---------- */

.table {
  position: relative;
  flex: 1;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at center, #6a3514 0%, #3b1d0a 75%);
  box-shadow:
    inset 0 0 0 14px #2a1607,
    inset 0 0 0 16px #835535,
    0 18px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}

/* Wood rails — subtle highlight strips */
.rail {
  position: absolute;
  background:
    repeating-linear-gradient(90deg,
      rgba(255,255,255,0.04) 0,
      rgba(255,255,255,0.04) 2px,
      transparent 2px,
      transparent 14px);
  pointer-events: none;
}
.rail-top { top: 0; left: 0; right: 0; height: 36px; }
.rail-bottom { bottom: 0; left: 0; right: 0; height: 36px; }
.rail-left { top: 0; left: 0; bottom: 0; width: 36px; }
.rail-right { top: 0; right: 0; bottom: 0; width: 36px; }

/* The felt — actual playable area, inset from the wood rail */
.felt {
  position: absolute;
  top: 36px;
  left: 36px;
  right: 36px;
  bottom: 36px;
  background:
    radial-gradient(ellipse at 35% 45%, #1b6b3a 0%, #0e4322 70%, #082b16 100%);
  border-radius: 10px;
  box-shadow: inset 0 0 80px rgba(0,0,0,0.45);
  font-family: "Georgia", "Times New Roman", serif;

  /* Grid layout for the felt — left col = Don't Come bar, center = main bet
     stack, right col = dice tray (row 1) + prop panel (rows 2-5).
     Place row is generous (170 px) for huge tappable numbers; Come is the
     largest middle region; Field + Pass Line are compact strips. */
  display: grid;
  grid-template-columns: 64px 1fr 290px;
  grid-template-rows: 170px 1.7fr 0.9fr 56px 0.9fr;
  grid-template-areas:
    "dc   place    tray"
    "dc   come     props"
    "dc   field    props"
    "dc   dpass    props"
    "dc   pass     props";
}

/* ---------- Zones (bet areas) ---------- */

.zone {
  position: relative;
  border: 1.5px solid #d9d24f;
  color: #ffe267;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.15s, box-shadow 0.15s;
  min-width: 0;
  min-height: 0;
}

.bet {
  cursor: pointer;
}

.bet:hover {
  background: rgba(255,255,180,0.08);
  box-shadow: inset 0 0 24px rgba(255,255,180,0.25);
}

.bet.armed {
  outline: 2px solid #ffd24a;
  outline-offset: -3px;
}

/* DON'T COME BAR — far-left tall column */
.dont-come-bar {
  grid-area: dc;
  border-left: none;
  font-size: 14px;
  font-weight: 600;
  color: #f7f7f7;
  text-transform: none;
}
.vert {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.2em;
  padding: 12px 0;
}

/* PLACE ROW — 4 5 SIX 8 NINE 10 across the top */
.place-row {
  grid-area: place;
  border: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding: 0;
}
.place {
  position: relative;
  border: 1.5px solid #d9d24f;
  color: #ffe267;
  font-family: "Georgia", serif;
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14px;
}
.place .num {
  font-size: clamp(56px, 7vw, 96px);
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* COME — large box below place row */
.come {
  grid-area: come;
  font-size: 56px;
  color: #d63b2f;
  font-weight: 700;
  font-family: "Georgia", serif;
  letter-spacing: 0.04em;
}

/* FIELD — below COME */
.field {
  grid-area: field;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  justify-content: center;
}
.field-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 22px;
  color: #ffe267;
  font-family: "Georgia", serif;
}
.field-numbers .two,
.field-numbers .twelve {
  font-size: 28px;
  border: 1.5px solid #ffe267;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.field-numbers .dot { color: #8fc18a; }
.field .label {
  font-family: "Georgia", serif;
  font-size: 36px;
  font-style: italic;
  color: #f4f4ee;
  letter-spacing: 0.06em;
}
.field-pays {
  font-size: 11px;
  color: #c9c9b3;
  font-family: -apple-system, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* DON'T PASS BAR — horizontal strip below field */
.dont-pass {
  grid-area: dpass;
  font-style: italic;
  font-size: 22px;
  color: #f4f4ee;
  text-transform: none;
  gap: 14px;
}
.dont-pass .bar-icon { font-size: 14px; opacity: 0.7; }

/* PASS LINE — bottom strip */
.pass-line {
  grid-area: pass;
  font-size: 44px;
  font-weight: 700;
  color: #f4f4ee;
  letter-spacing: 0.12em;
  font-family: "Georgia", serif;
}

/* L-wrap variants — kept in DOM for click forgiveness on desktop but hidden;
   real pass-line click target is the bottom strip. */
.pass-line-vert, .dont-pass-vert, .big-numbers { display: none; }

/* ---------- Prop panel (right side on desktop) ---------- */
.prop-panel {
  grid-area: props;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}

.dice-tray {
  grid-area: tray;
  margin: 6px;
  border-radius: 8px;
  /* Match the felt's green so the dice sit on the table, not on a metal tray. */
  background:
    radial-gradient(ellipse at 50% 40%, #1b6b3a 0%, #0e4322 70%, #082b16 100%);
  border: 1.5px solid #d9d24f;
  box-shadow:
    inset 0 0 30px rgba(0,0,0,0.45);
  position: relative;
}
#dice-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.props-block {
  border: 1.5px solid #d9d24f;
  border-radius: 4px;
  background: rgba(0,0,0,0.08);
  padding: 6px;
  position: relative;
}
.block-title {
  text-align: center;
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.18em;
  font-weight: 700;
  margin-bottom: 4px;
}

.hardways .hard-grid,
.horn .horn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.hard, .horn-cell {
  background: rgba(0,0,0,0.15);
  border: 1px solid #6c8a4c;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  position: relative;
}
.hard .pips, .horn-cell .pips {
  font-size: 22px;
  color: #6e9f4a;
  letter-spacing: 2px;
  line-height: 1;
}
.hard .pay, .horn-cell .pay {
  margin-top: 2px;
  font-size: 13px;
  color: #ffe267;
  font-weight: 700;
}

.any-seven, .any-craps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}
.any-seven .title,
.any-craps .title {
  color: #d63b2f;
  font-family: "Georgia", serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.18em;
}
.any-seven .pay-l, .any-seven .pay-r,
.any-craps .pay-l, .any-craps .pay-r {
  color: #ffe267;
  font-weight: 700;
  font-size: 16px;
}

/* ---------- ON/OFF puck ---------- */
.puck {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.08em;
  border: 4px solid #fff;
  box-shadow:
    0 6px 14px rgba(0,0,0,0.6),
    inset 0 -3px 6px rgba(0,0,0,0.3),
    inset 0 3px 6px rgba(255,255,255,0.25);
  transition: top 0.4s cubic-bezier(.5,.1,.2,1), left 0.4s cubic-bezier(.5,.1,.2,1), background 0.2s;
  pointer-events: none;
  z-index: 50;
}
.puck.off {
  background: #1c1c1c;
  color: #fff;
  /* Park in the top-left corner of the Don't Come bar so it doesn't sit
     on top of the "4" place box. */
  top: 6px;
  left: 4px;
  width: 48px;
  height: 48px;
  font-size: 15px;
}
.puck.on {
  background: #f6f6f6;
  color: #1b6b3a;
}

/* ---------- Chip overlay (rendered chip stacks on bets) ---------- */
.chip-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}
.chip-stack {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Generic chip */
.chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  border: 3px dashed rgba(255,255,255,0.85);
  box-shadow:
    0 4px 8px rgba(0,0,0,0.6),
    inset 0 -3px 4px rgba(0,0,0,0.35),
    inset 0 3px 4px rgba(255,255,255,0.25);
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}
.chip-1   { background: #f7f7f7; color: #222; border-color: rgba(50,50,50,0.5); }
.chip-5   { background: #d63b2f; }
.chip-25  { background: #2c8b2c; }
.chip-100 { background: #232323; }
.chip-500 { background: #6a3aa6; }
.chip-1000{ background: #d4a02b; color: #2a1f08; }

.chip-big {
  width: 56px;
  height: 56px;
  font-size: 16px;
}

/* ---------- HUD (bottom bar) ---------- */
.hud {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px 0;
  height: 88px;
}
.meter {
  background: linear-gradient(180deg, #1c1c1c, #0a0a0a);
  border: 1px solid #2a2a2a;
  padding: 10px 18px;
  border-radius: 8px;
  min-width: 140px;
}
.meter-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #aaa;
  text-transform: uppercase;
}
.meter-value {
  font-size: 22px;
  font-weight: 700;
  color: #ffe267;
  font-family: "Georgia", serif;
}

.controls {
  display: flex;
  gap: 8px;
}
.ctrl {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #555;
  background: linear-gradient(180deg, #2a2a2a, #111);
  color: #ddd;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s, background 0.15s;
}
.ctrl:hover {
  background: linear-gradient(180deg, #3a3a3a, #222);
  color: #fff;
}
.ctrl:active { transform: scale(0.94); }
.ctrl:disabled { opacity: 0.4; cursor: not-allowed; }
.ctrl.small { width: 36px; height: 36px; font-size: 18px; }
.ctrl.danger { border-color: #c44; color: #fbb; }
.ctrl.roll {
  background: linear-gradient(180deg, #1b8a3a, #0c4d20);
  border-color: #1c6b30;
  color: #fff;
  font-size: 26px;
  width: 64px;
  height: 64px;
}
.ctrl.roll:hover { background: linear-gradient(180deg, #25a847, #0e5b27); }

.chip-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.chip-display {
  width: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message {
  position: absolute;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.78);
  color: #ffe267;
  padding: 10px 22px;
  border-radius: 24px;
  font-family: "Georgia", serif;
  font-size: 18px;
  letter-spacing: 0.05em;
  border: 1px solid #ffe26755;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 200;
}
.message.show { opacity: 1; }

/* ---------- Win flash on a bet ---------- */
.bet.win {
  animation: winFlash 1.2s ease-out;
}
@keyframes winFlash {
  0%   { background: rgba(255,255,180,0.55); box-shadow: inset 0 0 36px rgba(255,224,80,0.9); }
  100% { background: transparent; box-shadow: none; }
}
.bet.lose {
  animation: loseFlash 0.6s ease-out;
}
@keyframes loseFlash {
  0%   { background: rgba(214,59,47,0.45); }
  100% { background: transparent; }
}

/* ---------- Responsiveness ---------- */

/* Mid-range desktop tighten — shrink the right column */
@media (max-width: 1100px) and (orientation: landscape) {
  .felt { grid-template-columns: 50px 1fr 250px; }
  .come { font-size: 46px; }
  .place .num { font-size: 44px; }
}

/* ----- iPhone / portrait stack ----- */
@media (max-width: 900px), (orientation: portrait) {
  html, body { overflow: auto; height: auto; }
  body { min-height: 100dvh; }

  .cabinet {
    position: static;
    padding:
      max(env(safe-area-inset-top), 6px)
      max(env(safe-area-inset-right), 6px)
      max(env(safe-area-inset-bottom), 6px)
      max(env(safe-area-inset-left), 6px);
    min-height: 100dvh;
  }

  .table {
    flex: none;
    border-radius: 14px;
    box-shadow:
      inset 0 0 0 8px #2a1607,
      inset 0 0 0 9px #835535,
      0 8px 24px rgba(0,0,0,0.6);
  }

  /* Hide / shrink the wood rails on mobile */
  .rail-top, .rail-bottom { height: 14px; }
  .rail-left, .rail-right { width: 14px; }

  .felt {
    position: relative;
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: auto;
    inset: auto;
    margin: 14px;
    width: calc(100% - 28px);
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas: none;
    grid-auto-rows: min-content;
    gap: 6px;
    padding: 8px;
    border-radius: 6px;
  }
  /* On mobile, position by order (above), not by named area */
  .dont-come-bar, .place-row, .come, .field, .dont-pass, .pass-line,
  .prop-panel, .dice-tray { grid-area: auto; }

  /* Reset all absolute-positioned zones into the grid flow */
  .zone, .dice-tray, .prop-panel, .come, .field, .dont-pass, .pass-line,
  .dont-come-bar, .place-row, .pass-line-vert, .dont-pass-vert {
    position: relative;
    top: auto; left: auto; right: auto; bottom: auto;
    width: auto;
    height: auto;
  }

  /* Hide redundant vertical wrap variants on mobile */
  .pass-line-vert, .dont-pass-vert, .big-numbers { display: none; }

  /* Order the stack: dice → place → come → field → don't pass → pass line → props */
  .dice-tray         { order: 1; height: 110px; }
  .place-row         { order: 2; height: 200px; }
  .come              { order: 3; height: 60px; font-size: 28px; }
  .field             { order: 4; height: 78px; }
  .dont-come-bar     { order: 5; height: 34px; }
  .dont-pass         { order: 6; height: 38px; font-size: 16px; }
  .pass-line         { order: 7; height: 52px; font-size: 24px; padding-top: 8px; }
  .prop-panel        { order: 8; padding: 0; gap: 6px; }

  /* Place numbers as a 2×3 grid on mobile — tappable cells, big numbers. */
  .place-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0;
  }
  .place {
    padding-top: 6px;
    align-items: center;     /* center the number vertically in 100px-tall cell */
  }
  .place .num { font-size: 56px; }

  .field-numbers { font-size: 16px; gap: 6px; }
  .field-numbers .two,
  .field-numbers .twelve { width: 30px; height: 30px; font-size: 18px; }
  .field .label { font-size: 22px; }
  .field-pays { font-size: 9px; }

  .dont-come-bar { writing-mode: horizontal-tb; }
  .dont-come-bar .vert {
    writing-mode: horizontal-tb;
    transform: none;
    padding: 0;
    letter-spacing: 0.15em;
    font-size: 12px;
  }

  /* Puck stays absolute relative to the felt; recalibrate to grid */
  #puck {
    top: 8px;
    left: 8px;
    width: 44px;
    height: 44px;
    font-size: 14px;
  }

  /* Props block — Hardways + Horn share row 1, Any Seven / Any Craps each take
     their own full-width row. `dense` back-fills row 1 col 2 since Horn comes
     AFTER Any Seven in DOM order. */
  .prop-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: dense;
    gap: 6px;
  }
  .props-block.hardways   { grid-column: 1; grid-row: 1; }
  .props-block.horn       { grid-column: 2; grid-row: 1; }
  .props-block.any-seven  { grid-column: 1 / 3; }
  .props-block.any-craps  { grid-column: 1 / 3; }
  .hard .pips, .horn-cell .pips { font-size: 18px; }
  .hard .pay, .horn-cell .pay   { font-size: 12px; }
  .block-title { font-size: 13px; }
  .any-seven .title, .any-craps .title { font-size: 15px; }

  /* OFF puck shouldn't land on the dice tray on mobile. Park it tucked into
     the top-left of the felt as a small badge. ON puck still snaps to the
     active place number by JS. */
  #puck.off {
    top: 4px;
    left: 4px;
    width: 38px;
    height: 38px;
    font-size: 12px;
    z-index: 60;
  }

  /* HUD: compact 2-row layout */
  .hud {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 8px max(env(safe-area-inset-bottom), 10px);
    gap: 8px;
    justify-content: center;
  }
  .meter { min-width: 0; flex: 1 1 120px; padding: 6px 12px; }
  .meter-value { font-size: 18px; }
  .meter-label { font-size: 10px; }

  .controls { gap: 6px; }
  .ctrl { width: 44px; height: 44px; font-size: 18px; }
  .ctrl.small { width: 32px; height: 32px; font-size: 14px; }
  .ctrl.roll { width: 56px; height: 56px; font-size: 22px; }

  .chip-selector { margin-left: 0; }
  .chip-big { width: 44px; height: 44px; font-size: 13px; }

  .message {
    bottom: auto;
    top: 80px;
    font-size: 14px;
    padding: 6px 14px;
  }

  /* Chips placed on bet areas — smaller on mobile */
  .chip { width: 34px; height: 34px; font-size: 11px; border-width: 2px; }
}

/* Mobile-specific topbar tightening */
@media (max-width: 900px), (orientation: portrait) {
  .topbar { height: 48px; padding: 4px 6px; gap: 6px; }
  .brand-mark { display: none; }
  .timer { min-width: 80px; font-size: 12px; padding: 4px 6px; }
  .player-pill { padding: 4px 8px; font-size: 12px; }
  .player-pill .pname { max-width: 70px; }
  .recent-rolls .rp { min-width: 24px; height: 24px; font-size: 11px; padding: 0 4px; }
  .recent-rolls { gap: 2px; }
  .name-modal { padding: 28px 22px; }
  .name-modal .brand { font-size: 26px; }
  .name-modal .tagline { font-size: 11px; margin-bottom: 18px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .come { font-size: 30px; height: 70px; }
  .place .num { font-size: 20px; }
  .pass-line { font-size: 24px; }
}
