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

:root {
  --felt: #0d5c3d;
  --felt-deep: #084530;
  --felt-rim: #c9a227;
  --cream: #f5f0e6;
  --ink: #0f172a;
  --gold: #fbbf24;
  --win: #4ade80;
  --lose: #f87171;
  --panel: #0c1a14;
}

html,
body {
  height: 100%;
  background: #061a12;
  color: var(--cream);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(18, 122, 82, 0.22), transparent 55%),
    #061a12;
}

#hud {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: max(0.45rem, env(safe-area-inset-top)) 0.75rem 0.35rem;
  flex-shrink: 0;
}

.hud-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: flex-end;
}

.hud-block {
  min-width: 4.2rem;
}

.hud-block .label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 0.1rem;
}

.hud-block span:last-child {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.point-block span:last-child {
  color: var(--gold);
}

.point-off {
  opacity: 0.55 !important;
  color: var(--cream) !important;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.layout-toggle {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(253, 230, 138, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #fde68a;
  cursor: pointer;
}

.layout-toggle[aria-pressed="true"] {
  background: rgba(253, 230, 138, 0.15);
  border-color: rgba(253, 230, 138, 0.7);
}

.icon-btn {
  color: #86efac;
  text-decoration: none;
  font-size: 1.15rem;
  padding: 0.25rem 0.4rem;
}

.play-area {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(14rem, min(20rem, 30vw)) minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0 0.65rem 0.35rem;
  overflow: hidden;
}

/* Strategy */
.strategy {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
  overflow: hidden;
}

.strategy-head {
  padding: 0.75rem 0.85rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.strategy-head h2 {
  font-size: 0.95rem;
  color: #fde68a;
}

.strategy-sub {
  font-size: 0.68rem;
  opacity: 0.55;
  margin-top: 0.15rem;
}

.strategy-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.55rem 0.75rem 0.85rem;
}

.strat-block {
  margin-bottom: 0.85rem;
}

.strat-block h3 {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.35rem;
}

.guide-list {
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.85;
  padding-left: 1.1rem;
}

.guide-list li {
  margin-bottom: 0.3rem;
}

.odds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.odds-table th,
.odds-table td {
  text-align: left;
  padding: 0.28rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.odds-table th {
  opacity: 0.5;
  font-weight: 600;
}

.keys-legend {
  font-size: 0.75rem;
  opacity: 0.8;
  line-height: 1.6;
}

kbd {
  display: inline-block;
  min-width: 1.2rem;
  padding: 0.08rem 0.28rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

/* Table column */
.table-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.felt {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 50% / 18%;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, #127a52 0%, var(--felt) 45%, var(--felt-deep) 100%);
  box-shadow:
    inset 0 0 0 4px var(--felt-rim),
    0 12px 36px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.65rem 0.85rem 0.75rem;
}

.felt-logo {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: rgba(253, 230, 138, 0.55);
}

.felt-rules {
  font-size: 0.62rem;
  opacity: 0.45;
  margin-bottom: 0.25rem;
}

/* Squipy — compact on both layouts */
.shooter {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  pointer-events: none;
}

/* Simple layout: Squipy top-left; speech expands to the right */
.layout-simple .shooter {
  left: 0.4rem;
  top: 0.35rem;
  bottom: auto;
  transform: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: 0.4rem;
  row-gap: 0.12rem;
  max-width: min(28rem, calc(100% - 0.9rem));
  z-index: 8;
}

.layout-simple .shooter-sq {
  grid-column: 1;
  grid-row: 1;
}

.layout-simple .shooter-label {
  grid-column: 1;
  grid-row: 2;
  justify-self: center;
}

.layout-simple .speech-bubble {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: max-content;
  max-width: min(22rem, 52vw);
  font-size: 0.68rem;
  padding: 0.35rem 0.5rem;
  transform: none;
}

.layout-simple .speech-bubble::after {
  left: -0.2rem;
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%) rotate(45deg);
}

.shooter-sq {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.4rem;
  background: linear-gradient(160deg, #c4b5fd, #7c3aed 55%, #5b21b6);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.45);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.shooter-sq[data-mood="throw"] {
  animation: throw-hop 0.45s ease;
}

.shooter-sq[data-mood="win"] {
  transform: scale(1.08) rotate(-6deg);
}

.shooter-sq[data-mood="lose"] {
  transform: scale(0.96) rotate(4deg);
}

@keyframes throw-hop {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  40% {
    transform: translateY(-10px) rotate(-12deg);
  }
  70% {
    transform: translateY(-2px) rotate(8deg);
  }
}

.sq-face {
  position: relative;
  width: 1.15rem;
  height: 0.85rem;
  transform: scale(0.92);
}

.sq-face .brow {
  position: absolute;
  top: -0.08rem;
  width: 0.42rem;
  height: 0.1rem;
  background: #0f172a;
  border-radius: 2px;
}

.sq-face .brow.left {
  left: 0.12rem;
}

.sq-face .brow.right {
  right: 0.12rem;
}

.sq-face .eye {
  position: absolute;
  top: 0.18rem;
  width: 0.32rem;
  height: 0.32rem;
  background: #0f172a;
  border-radius: 50%;
}

.sq-face .eye.left {
  left: 0.14rem;
}

.sq-face .eye.right {
  right: 0.14rem;
}

.sq-face .eye::after {
  content: "";
  position: absolute;
  top: 0.04rem;
  right: 0.04rem;
  width: 0.1rem;
  height: 0.1rem;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
}

.sq-face .mouth {
  position: absolute;
  left: 50%;
  bottom: 0.02rem;
  width: 0.65rem;
  height: 0.28rem;
  border-bottom: 2.5px solid #0f172a;
  border-radius: 0 0 50% 50%;
  transform: translateX(-50%);
}

.sq-face .cheek {
  position: absolute;
  bottom: 0.28rem;
  width: 0.24rem;
  height: 0.16rem;
  border-radius: 50%;
  background: rgba(244, 114, 182, 0.55);
  opacity: 0;
}

.sq-face .cheek.left {
  left: 0;
}

.sq-face .cheek.right {
  right: 0;
}

.shooter-sq[data-mood="win"] .cheek,
.shooter-sq[data-mood="throw"] .cheek {
  opacity: 1;
}

.shooter-label {
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  opacity: 0.55;
  font-weight: 700;
}

.felt-brand {
  text-align: center;
  z-index: 2;
}

.felt-sub {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  opacity: 0.4;
  font-weight: 700;
}

.speech-bubble {
  position: absolute;
  left: 3.6rem;
  bottom: 2.4rem;
  max-width: 11rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.55rem;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.72rem;
  line-height: 1.3;
  font-weight: 650;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 6;
}

.speech-bubble[hidden] {
  display: none !important;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: -0.28rem;
  bottom: 0.55rem;
  width: 0.45rem;
  height: 0.45rem;
  background: #f8fafc;
  transform: rotate(45deg);
}

/* Dice */
.dice-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 4.5rem;
  margin: 0.35rem 0 0.25rem;
  position: relative;
  z-index: 2;
}

.die {
  width: 3rem;
  height: 3rem;
  border-radius: 0.45rem;
  background: linear-gradient(160deg, #fff, #e2e8f0);
  border: 2px solid rgba(15, 23, 42, 0.2);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  position: relative;
  transition: transform 0.08s linear;
}

.die.rolling {
  animation: die-roll 0.12s linear infinite;
}

@keyframes die-roll {
  0% {
    transform: rotate(0) translateY(0);
  }
  50% {
    transform: rotate(18deg) translateY(-4px);
  }
  100% {
    transform: rotate(-12deg) translateY(2px);
  }
}

.die .pip {
  position: absolute;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #0f172a;
  display: none;
}

/* pip positions via data-face */
.die[data-face="1"] .pip:nth-child(1) {
  display: block;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.die[data-face="2"] .pip:nth-child(1) {
  display: block;
  left: 18%;
  top: 18%;
}
.die[data-face="2"] .pip:nth-child(2) {
  display: block;
  right: 18%;
  bottom: 18%;
  left: auto;
  top: auto;
}

.die[data-face="3"] .pip:nth-child(1) {
  display: block;
  left: 18%;
  top: 18%;
}
.die[data-face="3"] .pip:nth-child(2) {
  display: block;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.die[data-face="3"] .pip:nth-child(3) {
  display: block;
  right: 18%;
  bottom: 18%;
  left: auto;
  top: auto;
}

.die[data-face="4"] .pip:nth-child(1) {
  display: block;
  left: 18%;
  top: 18%;
}
.die[data-face="4"] .pip:nth-child(2) {
  display: block;
  right: 18%;
  top: 18%;
  left: auto;
}
.die[data-face="4"] .pip:nth-child(3) {
  display: block;
  left: 18%;
  bottom: 18%;
  top: auto;
}
.die[data-face="4"] .pip:nth-child(4) {
  display: block;
  right: 18%;
  bottom: 18%;
  left: auto;
  top: auto;
}

.die[data-face="5"] .pip:nth-child(1) {
  display: block;
  left: 18%;
  top: 18%;
}
.die[data-face="5"] .pip:nth-child(2) {
  display: block;
  right: 18%;
  top: 18%;
  left: auto;
}
.die[data-face="5"] .pip:nth-child(3) {
  display: block;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.die[data-face="5"] .pip:nth-child(4) {
  display: block;
  left: 18%;
  bottom: 18%;
  top: auto;
}
.die[data-face="5"] .pip:nth-child(5) {
  display: block;
  right: 18%;
  bottom: 18%;
  left: auto;
  top: auto;
}

.die[data-face="6"] .pip:nth-child(1) {
  display: block;
  left: 18%;
  top: 16%;
}
.die[data-face="6"] .pip:nth-child(2) {
  display: block;
  right: 18%;
  top: 16%;
  left: auto;
}
.die[data-face="6"] .pip:nth-child(3) {
  display: block;
  left: 18%;
  top: 50%;
  transform: translateY(-50%);
}
.die[data-face="6"] .pip:nth-child(4) {
  display: block;
  right: 18%;
  top: 50%;
  left: auto;
  transform: translateY(-50%);
}
.die[data-face="6"] .pip:nth-child(5) {
  display: block;
  left: 18%;
  bottom: 16%;
  top: auto;
}
.die[data-face="6"] .pip:nth-child(6) {
  display: block;
  right: 18%;
  bottom: 16%;
  left: auto;
  top: auto;
}

.roll-sum {
  min-width: 2.4rem;
  padding: 0.25rem 0.45rem;
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(253, 230, 138, 0.45);
  font-weight: 900;
  font-size: 1.15rem;
  color: #fde68a;
  text-align: center;
}

.roll-sum[hidden] {
  display: none !important;
}

.table-message {
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.3rem;
  margin-bottom: 0.35rem;
  z-index: 2;
}

.table-message.win {
  color: var(--win);
  font-weight: 700;
}

.table-message.lose {
  color: var(--lose);
  font-weight: 700;
}


/* ── Bet board ── */
.bet-board {
  width: min(40rem, 96%);
  margin: 0.1rem auto 0.35rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  max-height: none;
  overflow: visible;
  padding-bottom: 0.15rem;
}

.bet-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.04rem;
  padding: 0.32rem 0.4rem;
  border-radius: 0.4rem;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  min-height: 2.15rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.bet-zone:hover:not(:disabled) {
  border-color: rgba(253, 230, 138, 0.7);
  background: rgba(0, 0, 0, 0.32);
}

.bet-zone:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bz-title { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; }
.bz-pay { font-size: 0.52rem; opacity: 0.55; line-height: 1.2; }
.bz-stack {
  margin-top: auto;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fde68a;
  min-height: 0.8rem;
}
.field-nums { font-size: 0.68rem; letter-spacing: 0.1em; opacity: 0.85; }
.field-nums b { color: #fde68a; }
.bet-zone kbd {
  position: absolute;
  top: 0.2rem;
  right: 0.22rem;
  font-size: 0.58rem;
  min-width: 1rem;
  padding: 0.04rem 0.2rem;
}

/* Simple layout: board fills the felt; Squipy overlays left edge */
.felt.layout-simple {
  border-radius: 1rem;
  padding: 0.4rem 0.55rem 0.45rem;
  align-items: stretch;
}

.layout-simple .felt-brand {
  flex-shrink: 0;
  text-align: center;
}

.layout-simple .bet-board {
  width: 100%;
  max-width: none;
  margin: 0.1rem 0 0.15rem;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.28rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(2.2rem, 1.1fr) minmax(2.2rem, 1.1fr) minmax(2.1rem, 1fr) minmax(1.9rem, 0.9fr) minmax(2.4rem, 1.2fr) auto;
  align-content: stretch;
}

.layout-simple .bet-zone.pass {
  grid-column: 1;
  grid-row: 1;
  border-color: rgba(74, 222, 128, 0.5);
  min-height: 0;
  height: 100%;
}

.layout-simple .rail-row {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.28rem;
  min-height: 0;
  height: 100%;
}

.layout-simple .rail-row .bet-zone {
  min-height: 0;
  height: 100%;
  padding: 0.28rem 0.32rem;
}

.layout-simple .bet-zone.field {
  grid-column: 1;
  grid-row: 2;
  border-color: rgba(125, 211, 252, 0.45);
  min-height: 0;
  height: 100%;
}

.layout-simple .box-numbers {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.22rem;
  min-height: 0;
  height: 100%;
}

.layout-simple .box-numbers .bet-zone {
  min-height: 0;
  height: 100%;
  padding: 0.18rem 0.12rem;
  align-items: center;
  text-align: center;
}

.layout-simple .box-numbers .bz-title {
  font-size: 0.85rem;
}

.layout-simple .box-numbers .bz-pay {
  font-size: 0.45rem;
}

.layout-simple .bet-zone.come {
  grid-column: 1;
  grid-row: 4;
  min-height: 0;
  height: 100%;
}

.layout-simple .bet-zone.odds {
  grid-column: 2;
  grid-row: 4;
  min-height: 0;
  height: 100%;
}

.layout-simple .prop-box {
  grid-column: 1 / -1;
  grid-row: 5;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.layout-simple .come-points {
  grid-column: 1 / -1;
  grid-row: 6;
}

.layout-simple .prop-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.18rem;
  flex: 1;
  min-height: 0;
}

.layout-simple .prop-label {
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  opacity: 0.5;
  margin-bottom: 0.15rem;
  font-weight: 700;
  flex-shrink: 0;
}

.layout-simple .bet-zone.prop {
  min-height: 0;
  height: 100%;
  padding: 0.15rem 0.1rem;
  align-items: center;
  text-align: center;
}

.layout-simple .bet-zone.prop .bz-title {
  font-size: 0.52rem;
  letter-spacing: 0;
}

.layout-simple .bet-zone.prop .bz-pay {
  font-size: 0.45rem;
}

.layout-simple .bet-zone.prop .bz-stack {
  font-size: 0.6rem;
  min-height: 0.65rem;
}

/* Shrink chrome on simple so more board fits */
.layout-simple .dice-stage {
  flex-shrink: 0;
  min-height: 3.1rem;
  margin: 0.15rem 0 0.1rem;
  gap: 0.45rem;
}

.layout-simple .die {
  width: 2.35rem;
  height: 2.35rem;
}

.layout-simple .table-message {
  flex-shrink: 0;
  font-size: 0.75rem;
  min-height: 1.05rem;
  margin-bottom: 0.2rem;
}

.layout-simple .point-pips {
  flex-shrink: 0;
}

.layout-simple .felt-logo {
  font-size: 0.68rem;
}

.layout-simple .felt-sub {
  font-size: 0.55rem;
}

/* ── Classic Las Vegas table ── */
.felt.layout-classic {
  border-radius: 1.25rem / 2.5rem;
  padding: 0.45rem 0.55rem 0.5rem;
  background:
    radial-gradient(ellipse 80% 70% at 50% 45%, #0f6b45 0%, #0a4d32 50%, #063824 100%);
  box-shadow:
    inset 0 0 0 5px #c9a227,
    inset 0 0 0 8px #0a3d28,
    0 14px 40px rgba(0, 0, 0, 0.5);
}

.felt.layout-classic .felt-brand {
  position: absolute;
  right: 0.75rem;
  top: 0.4rem;
  text-align: right;
  z-index: 3;
}
.felt.layout-classic .felt-logo {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: rgba(253, 230, 138, 0.65);
}
.felt.layout-classic .felt-sub {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  color: rgba(255, 255, 255, 0.35);
}

.felt.layout-classic .dice-stage {
  position: absolute;
  right: 0.85rem;
  top: 2.5rem;
  min-height: 0;
  margin: 0;
  gap: 0.35rem;
  z-index: 4;
}
.felt.layout-classic .die {
  width: 2.1rem;
  height: 2.1rem;
}
.felt.layout-classic .table-message {
  position: absolute;
  left: 50%;
  top: 0.35rem;
  transform: translateX(-50%);
  max-width: 50%;
  font-size: 0.72rem;
  margin: 0;
  z-index: 4;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Classic: Squipy small, near stickman / right rail */
.felt.layout-classic .shooter {
  left: auto;
  right: 0.45rem;
  bottom: 0.55rem;
  top: auto;
  transform: scale(0.92);
}
.felt.layout-classic .speech-bubble {
  left: auto;
  right: 2.6rem;
  bottom: 1.8rem;
  transform: none;
  max-width: 9.5rem;
  font-size: 0.65rem;
}
.felt.layout-classic .speech-bubble::after {
  left: auto;
  right: -0.22rem;
  bottom: 0.45rem;
  transform: rotate(45deg);
}

.felt.layout-classic .point-pips {
  position: absolute;
  left: 50%;
  bottom: 0.3rem;
  transform: translateX(-50%);
  margin: 0;
  z-index: 3;
}

.layout-classic .bet-board {
  width: min(46rem, 97%);
  margin: 1.85rem auto 1.7rem;
  gap: 0.22rem;
  max-height: none;
  overflow: visible;
}

/* Props diamond-ish block */
.layout-classic .prop-box {
  order: 1;
  border: 2px solid rgba(253, 230, 138, 0.55);
  border-radius: 0.35rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.3rem 0.35rem 0.4rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.layout-classic .prop-label {
  text-align: center;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: #fde68a;
  font-weight: 800;
  margin-bottom: 0.25rem;
}
.layout-classic .prop-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.2rem;
}
.layout-classic .bet-zone.prop {
  min-height: 2.35rem;
  padding: 0.2rem 0.15rem;
  align-items: center;
  text-align: center;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(40, 0, 0, 0.35);
  border-radius: 0.25rem;
}
.layout-classic .bet-zone.prop .bz-title {
  font-size: 0.58rem;
  letter-spacing: 0.02em;
}
.layout-classic .bet-zone.prop .bz-pay {
  font-size: 0.5rem;
  color: #fca5a5;
  opacity: 0.9;
}
.layout-classic .bet-zone.prop .bz-stack {
  font-size: 0.65rem;
  min-height: 0.75rem;
}

/* Place boxes — yellow-outlined like LV */
.layout-classic .box-numbers {
  order: 2;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.2rem;
}
.layout-classic .box-num {
  min-height: 3rem;
  padding: 0.2rem;
  align-items: center;
  text-align: center;
  border-radius: 0.2rem;
  border: 2px solid #eab308;
  background: rgba(0, 0, 0, 0.25);
}
.layout-classic .box-num .bz-title {
  font-size: 1.15rem;
  color: #fef9c3;
}
.layout-classic .box-num .bz-pay {
  font-size: 0.48rem;
  letter-spacing: 0.04em;
}

.layout-classic .bet-zone.come {
  order: 3;
  min-height: 2.5rem;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 40, 25, 0.4);
  align-items: center;
  text-align: center;
  letter-spacing: 0.2em;
}
.layout-classic .bet-zone.come .bz-title {
  font-size: 0.95rem;
  letter-spacing: 0.28em;
}

.layout-classic .bet-zone.field {
  order: 4;
  min-height: 3.4rem;
  border: 2px solid #facc15;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 12px,
      rgba(250, 204, 21, 0.04) 12px,
      rgba(250, 204, 21, 0.04) 13px
    ),
    rgba(0, 50, 30, 0.35);
  align-items: center;
  text-align: center;
}
.layout-classic .bet-zone.field .bz-title {
  font-size: 1rem;
  letter-spacing: 0.35em;
  color: #fef08a;
}
.layout-classic .field-nums {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: #fde68a;
}

.layout-classic .rail-row {
  order: 5;
  display: grid;
  grid-template-columns: 1.3fr 1.3fr 0.7fr 0.7fr;
  gap: 0.2rem;
}
.layout-classic .bet-zone.dont,
.layout-classic .bet-zone.dontcome {
  border-color: #facc15;
  background: rgba(20, 20, 0, 0.35);
  min-height: 2.6rem;
}
.layout-classic .bet-zone.big {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.28);
  align-items: center;
  text-align: center;
  min-height: 2.6rem;
}

.layout-classic .bet-zone.pass {
  order: 6;
  min-height: 2.75rem;
  border-radius: 0 0 1.4rem 1.4rem;
  border: 3px solid #f8fafc;
  background: rgba(0, 70, 40, 0.4);
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.9rem;
}
.layout-classic .bet-zone.pass .bz-title {
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  color: #fff;
}
.layout-classic .bet-zone.pass .bz-pay { flex: 1; }
.layout-classic .bet-zone.pass .bz-stack { margin-top: 0; }

.layout-classic .bet-zone.odds {
  order: 7;
  min-height: 2.2rem;
  border: 2px dashed rgba(253, 230, 138, 0.55);
  background: rgba(0, 0, 0, 0.2);
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}
.layout-classic .bet-zone.odds .bz-stack { margin-top: 0; }

.come-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
}
.come-points[hidden] { display: none !important; }
.cp {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.cp.come { border-color: rgba(134, 239, 172, 0.5); color: #bbf7d0; }
.cp.dc { border-color: rgba(252, 165, 165, 0.5); color: #fecaca; }

.point-pips {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  z-index: 2;
}
.point-pips span {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  opacity: 0.4;
}
.point-pips span.on {
  opacity: 1;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  color: #1c1917;
  border-color: #fff;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
}


/* Controls footer */
.controls {
  flex-shrink: 0;
  padding: 0.35rem 0.55rem max(0.55rem, env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.32));
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.35rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  align-items: center;
}

.chip {
  min-width: 2.9rem;
  padding: 0.4rem 0.5rem;
  border-radius: 999px;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 30% 30%, #fef3c7, #d97706 70%);
  color: #1c1917;
  font: inherit;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
}

.chip.active {
  outline: 2px solid #fde68a;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.chip[data-chip="all"] {
  background: radial-gradient(circle at 30% 30%, #fecaca, #dc2626 70%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  min-width: 3.6rem;
}

.chip[data-chip="all"].active {
  outline-color: #fca5a5;
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.5);
}

.btn {
  min-width: 5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.btn.primary {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-color: transparent;
  color: #1c1917;
}

.btn.ghost {
  background: transparent;
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn .key-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 800;
  color: #1c1917;
}

.btn.ghost .key-label {
  color: #fde68a;
}

.hint-keys {
  font-size: 0.65rem;
  opacity: 0.45;
  margin-top: 0.3rem;
}

.version {
  margin-top: 0.2rem;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  opacity: 0.4;
  color: #86efac;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #app {
    height: auto;
    min-height: calc(100dvh - var(--rg-bar));
    overflow: visible;
  }

  .play-area {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: none;
    gap: 0.45rem;
    padding: 0 0.45rem 0.35rem;
    overflow: visible;
    flex: none;
    height: auto;
    min-height: 0;
  }

  .strategy {
    max-height: none;
    flex: none;
    order: 2;
  }

  .table-col {
    order: 1;
    flex: none;
    height: auto;
    min-height: 0;
  }

  .felt {
    flex: none;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .layout-classic .prop-grid { grid-template-columns: repeat(4, 1fr); }
  .layout-classic .box-numbers { grid-template-columns: repeat(3, 1fr); }
  .layout-classic .rail-row { grid-template-columns: 1fr 1fr; }
  .layout-classic .bet-board {
    width: 100%;
    margin: 1.6rem auto 1.4rem;
  }

  .layout-simple .shooter {
    left: 0.25rem;
    top: 0.25rem;
    max-width: min(22rem, calc(100% - 0.5rem));
  }
  .layout-simple .speech-bubble {
    max-width: min(16rem, 58vw);
    font-size: 0.62rem;
  }

  /* Natural-height board — no squeeze into fr rows */
  .layout-simple .bet-board {
    width: 100%;
    margin: 0.15rem 0 0.35rem;
    flex: none;
    height: auto;
    min-height: 0;
    grid-template-rows: auto;
    grid-auto-rows: auto;
    align-content: start;
    gap: 0.35rem;
  }

  .layout-simple .bet-zone.pass,
  .layout-simple .bet-zone.field,
  .layout-simple .bet-zone.come,
  .layout-simple .bet-zone.odds,
  .layout-simple .rail-row .bet-zone,
  .layout-simple .box-numbers .bet-zone,
  .layout-simple .bet-zone.prop,
  .layout-simple .prop-box {
    height: auto;
    min-height: 2.35rem;
  }

  .layout-simple .prop-grid {
    grid-template-columns: repeat(4, 1fr);
    flex: none;
  }
  .layout-simple .box-numbers {
    grid-template-columns: repeat(3, 1fr);
    height: auto;
  }
  .layout-simple .rail-row {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    height: auto;
  }
  .layout-simple .box-numbers { grid-row: 4; }
  .layout-simple .bet-zone.come { grid-row: 5; }
  .layout-simple .bet-zone.odds { grid-row: 5; }
  .layout-simple .prop-box { grid-row: 6; height: auto; }
  .layout-simple .come-points { grid-row: 7; }

  .controls {
    position: sticky;
    bottom: 0;
    z-index: 12;
    background: linear-gradient(180deg, rgba(6, 26, 18, 0.92), #061a12 40%);
  }
}

@media (max-width: 560px) {
  #hud {
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: max(0.35rem, env(safe-area-inset-top)) 0.5rem 0.25rem;
  }
  .hud-block {
    min-width: 3.4rem;
  }
  .hud-block span:last-child {
    font-size: 0.88rem;
  }
  .layout-toggle {
    font-size: 0.65rem;
    padding: 0.3rem 0.4rem;
  }

  .strategy {
    order: 2;
    max-height: none;
  }

  .strategy-head {
    padding: 0.4rem 0.55rem 0.3rem;
  }
  .strategy-scroll {
    padding: 0.35rem 0.5rem 0.5rem;
    max-height: none;
    overflow: visible;
  }
  .guide-list,
  .odds-table {
    font-size: 0.68rem;
  }
  .felt {
    border-radius: 0.75rem;
    padding: 0.35rem 0.4rem 0.5rem;
  }
  .felt.layout-simple {
    padding-top: 0.35rem;
  }
  .layout-simple .dice-stage {
    min-height: 2.5rem;
  }
  .layout-simple .die {
    width: 1.95rem;
    height: 1.95rem;
  }
  .layout-simple .die .pip {
    width: 0.32rem;
    height: 0.32rem;
  }

  /* Keep Squipy readable on phone; bubble can wrap right */
  .layout-simple .shooter {
    display: grid;
    position: relative;
    left: auto;
    top: auto;
    margin: 0.15rem 0 0.25rem;
    max-width: 100%;
  }
  .layout-simple .speech-bubble {
    display: block;
    max-width: min(18rem, 70vw);
  }

  .layout-simple .bet-zone {
    min-height: 2.5rem;
    padding: 0.35rem 0.4rem;
  }
  .layout-simple .bz-title {
    font-size: 0.68rem;
  }
  .layout-simple .box-numbers .bz-title {
    font-size: 0.85rem;
  }
  .layout-simple .bet-zone.prop {
    min-height: 2.4rem;
  }

  .layout-classic .dice-stage {
    position: relative;
    right: auto;
    top: auto;
    margin: 0.25rem auto;
  }
  .layout-classic .die {
    width: 1.7rem;
    height: 1.7rem;
  }
  .layout-classic .prop-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .layout-classic .bet-board {
    margin: 0.5rem auto 0.75rem;
  }
  .layout-classic .felt-brand {
    position: relative;
    right: auto;
    top: auto;
    text-align: center;
  }
  .layout-classic .table-message {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    max-width: 100%;
    margin: 0.2rem 0;
  }
  .layout-classic .shooter {
    position: relative;
    right: auto;
    bottom: auto;
    margin: 0.25rem auto;
  }

  .chip {
    min-width: 2.5rem;
    padding: 0.35rem 0.4rem;
    font-size: 0.7rem;
  }
  .btn {
    min-width: 4.2rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
  }
  .hint-keys {
    display: none;
  }
  .controls {
    padding: 0.35rem 0.35rem max(0.55rem, env(safe-area-inset-bottom));
  }
}

@media (max-height: 700px) and (min-width: 901px) {
  .layout-simple .dice-stage {
    min-height: 2.3rem;
    margin: 0.05rem 0;
  }
  .layout-simple .die {
    width: 1.85rem;
    height: 1.85rem;
  }
  .layout-simple .table-message {
    font-size: 0.68rem;
    min-height: 0.9rem;
    margin-bottom: 0.1rem;
  }
  .strategy {
    max-height: 18vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shooter-sq,
  .die {
    animation: none !important;
    transition: none !important;
  }
}
