:root {
  color-scheme: light;
  --bg: #f3f4ee;
  --surface: #ffffff;
  --surface-strong: #fff8e8;
  --ink: #1d2024;
  --muted: #6b6f73;
  --line: rgba(29, 32, 36, 0.14);
  --primary: #d62828;
  --primary-ink: #ffffff;
  --accent: #009a8f;
  --accent-2: #f2a51a;
  --chip: #ffffff;
  --felt: #143f34;
  --felt-line: rgba(255, 255, 255, 0.16);
  --shadow: 0 18px 48px rgba(26, 24, 20, 0.18);
  --panel-shadow: 0 10px 30px rgba(26, 24, 20, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 10%, transparent) 0 1px, transparent 1px 24px),
    linear-gradient(135deg, color-mix(in srgb, var(--bg) 88%, var(--surface)), var(--bg));
  color: var(--ink);
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

svg {
  display: block;
}

.app-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 76px;
  margin-bottom: 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--panel-shadow);
}

.brand-mark svg {
  width: 32px;
  fill: var(--primary);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 3rem);
}

h2 {
  font-size: clamp(1.35rem, 2vw, 2.2rem);
}

.event-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--panel-shadow);
}

.event-cell {
  display: grid;
  min-width: 0;
  min-height: 46px;
  align-content: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-strong) 54%, var(--surface));
}

.event-cell span,
.event-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-cell span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.event-cell strong {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 900;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) minmax(200px, 250px);
  gap: 16px;
  align-items: stretch;
}

.side-panel,
.table-zone {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 620px;
  padding: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
}

.icon-dot {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
}

.icon-dot svg {
  width: 19px;
  height: 19px;
}

.icon-dot path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.stat-stack {
  display: grid;
  gap: 10px;
}

.stat-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-strong) 36%, var(--surface));
}

.stat-line span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.stat-line strong {
  font-size: 1.06rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-items: center;
  gap: 10px;
  min-width: min(100%, 278px);
}

.chip {
  --chip-edge: var(--primary);
  --chip-face: #fffaf0;
  position: relative;
  display: grid;
  width: min(58px, 100%);
  aspect-ratio: 1;
  min-height: 0;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--chip-edge) 72%, #ffffff);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--chip-face) 0 35%, transparent 36%),
    repeating-conic-gradient(from 10deg, var(--chip-edge) 0 18deg, color-mix(in srgb, var(--chip-edge) 48%, #111) 18deg 30deg);
  color: var(--ink);
  isolation: isolate;
  font-weight: 900;
  transition:
    box-shadow 160ms ease,
    transform 160ms ease,
    filter 160ms ease;
  box-shadow: var(--panel-shadow);
}

.chip::before {
  position: absolute;
  inset: 7px;
  z-index: -1;
  border: 1px dashed color-mix(in srgb, var(--chip-edge) 70%, #ffffff);
  border-radius: inherit;
  content: "";
}

.chip[data-chip="50"] {
  --chip-edge: var(--primary);
}

.chip[data-chip="100"] {
  --chip-edge: var(--accent);
}

.chip[data-chip="250"] {
  --chip-edge: var(--accent-2);
}

.chip[data-chip="500"] {
  --chip-edge: #4b5560;
}

.chip.is-selected {
  outline: 4px solid color-mix(in srgb, var(--accent-2) 80%, #ffffff);
  outline-offset: 3px;
  transform: translateY(-4px) scale(1.08);
  filter: saturate(1.18) contrast(1.05);
  box-shadow:
    0 0 0 7px color-mix(in srgb, var(--primary) 24%, transparent),
    0 12px 26px color-mix(in srgb, var(--primary) 30%, rgba(0, 0, 0, 0.2)),
    inset 0 0 0 3px color-mix(in srgb, #ffffff 78%, var(--accent-2));
}

.chip.is-selected::after {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 19px;
  height: 19px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.24);
  content: "";
}

.chip.is-selected span,
.chip.is-selected::before {
  filter: none;
}

.chip.is-selected::after {
  background:
    linear-gradient(135deg, transparent 0 43%, #ffffff 44% 56%, transparent 57%),
    linear-gradient(45deg, transparent 0 48%, #ffffff 49% 61%, transparent 62%),
    var(--accent);
  background-size: 7px 10px, 12px 10px, auto;
  background-position: 4px 8px, 7px 5px, center;
  background-repeat: no-repeat;
}

.table-zone {
  min-height: 620px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 25%, transparent 25% 50%, rgba(255, 255, 255, 0.08) 50% 75%, transparent 75%),
    linear-gradient(90deg, rgba(255, 214, 102, 0.12), transparent 34%, rgba(0, 154, 143, 0.18)),
    var(--felt);
  background-size: 38px 38px, 100% 100%, auto;
  color: color-mix(in srgb, var(--primary-ink) 74%, #fff);
  overflow: hidden;
}

.round-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 64px;
  margin-bottom: 18px;
}

.round-meter {
  display: inline-grid;
  grid-template-columns: 28px auto;
  align-items: center;
  gap: 8px;
  min-width: 76px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 12%, transparent);
  font-size: 1.1rem;
}

.round-meter svg {
  width: 26px;
  height: 26px;
}

.round-meter circle,
.round-meter path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.dice-stage {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin: 6px 0 22px;
}

.play-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  width: min(100%, 680px);
  gap: 14px;
}

.dice-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(54px, 1fr));
  gap: 12px;
  width: min(100%, 680px);
}

.die {
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, #fff);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, #ffffff 96%, var(--accent)), color-mix(in srgb, #ffffff 70%, var(--accent-2))),
    #fff;
  box-shadow:
    inset 0 -10px 24px rgba(0, 0, 0, 0.08),
    0 14px 28px rgba(0, 0, 0, 0.2);
  color: var(--primary);
  transition:
    transform 260ms ease,
    box-shadow 260ms ease;
}

.die.is-rolling {
  transform: translateY(-6px) rotate(4deg);
}

.die svg {
  width: 58%;
  max-width: 58px;
  height: 58%;
}

.die path,
.die circle,
.die polygon,
.die rect,
.die line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.roll-button {
  display: inline-grid;
  grid-template-columns: 22px auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 900;
  box-shadow: var(--panel-shadow);
}

.roll-button svg {
  width: 22px;
  height: 22px;
}

.roll-button path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.bet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.bet-tile {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 116px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 14%, transparent);
  color: inherit;
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.bet-tile:hover,
.bet-tile.is-hot,
.bet-tile.has-bet {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent-2) 80%, currentColor);
  background: color-mix(in srgb, var(--surface) 22%, transparent);
}

.bet-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--primary);
}

.bet-icon svg {
  width: 30px;
  height: 30px;
}

.bet-icon path,
.bet-icon circle,
.bet-icon polygon,
.bet-icon rect,
.bet-icon line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.bet-copy {
  min-width: 0;
}

.bet-copy strong,
.bet-copy span {
  display: block;
}

.bet-copy strong {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-copy span {
  margin-top: 4px;
  color: color-mix(in srgb, currentColor 68%, transparent);
  font-size: 0.78rem;
  font-weight: 800;
}

.bet-state {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.chip-stack {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 34px;
}

.empty-stack {
  color: color-mix(in srgb, currentColor 52%, transparent);
  font-size: 0.78rem;
  font-weight: 800;
}

.stake-chip {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-left: -8px;
  border: 2px solid color-mix(in srgb, #ffffff 82%, var(--accent-2));
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fffaf0 0 38%, transparent 39%),
    repeating-conic-gradient(from 10deg, var(--stake-edge) 0 20deg, color-mix(in srgb, var(--stake-edge) 52%, #111) 20deg 32deg);
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22);
}

.stake-chip:first-child {
  margin-left: 0;
}

.stake-chip-50 {
  --stake-edge: var(--primary);
}

.stake-chip-100 {
  --stake-edge: var(--accent);
}

.stake-chip-250 {
  --stake-edge: var(--accent-2);
}

.stake-chip-500,
.stake-chip-more {
  --stake-edge: #4b5560;
}

.bet-amount {
  min-width: 76px;
  color: var(--accent-2);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.bet-amount.is-empty {
  color: color-mix(in srgb, currentColor 50%, transparent);
}

.trend-list {
  display: grid;
  gap: 10px;
}

.trend-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-strong) 26%, var(--surface));
}

.trend-symbol {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
}

.trend-symbol svg {
  width: 19px;
  height: 19px;
}

.trend-symbol path,
.trend-symbol circle,
.trend-symbol polygon,
.trend-symbol rect,
.trend-symbol line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.trend-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-pay {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.settlement-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-strong) 36%, var(--surface));
}

.settlement-head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

.settlement-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
}

.settlement-icon svg {
  width: 18px;
  height: 18px;
}

.settlement-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.settlement-list {
  display: grid;
  gap: 8px;
}

.settlement-empty,
.settlement-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

.settlement-item {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
}

.settlement-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.settlement-line strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.settlement-line span {
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 900;
}

.settlement-item.is-win .settlement-line span {
  color: var(--accent);
}

.rules-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-strong) 32%, var(--surface));
}

.rules-head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

.rules-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent-2) 18%, var(--surface));
  color: var(--primary);
}

.rules-icon svg {
  width: 18px;
  height: 18px;
}

.rules-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.rules-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

.rules-list li::marker {
  color: var(--accent);
  font-weight: 900;
}

.sound-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.toggle {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 28%, var(--surface));
}

.toggle span {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 180ms ease;
}

.toggle.is-on {
  background: var(--accent);
}

.toggle.is-on span {
  transform: translateX(22px);
}

@media (max-width: 1120px) {
  .topbar,
  .game-layout {
    grid-template-columns: 1fr;
  }

  .event-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .side-panel {
    min-height: auto;
  }

  .player-panel {
    display: grid;
    grid-template-columns: auto minmax(240px, 1fr) minmax(220px, 320px);
    align-items: start;
  }

  .history-panel {
    min-height: auto;
  }

  .trend-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .settlement-card,
  .rules-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .settlement-head,
  .rules-head {
    min-width: 118px;
  }

  .sound-row {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 8px;
  }

  .topbar {
    gap: 7px;
    min-height: auto;
    margin-bottom: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-mark svg {
    width: 24px;
  }

  h1 {
    font-size: 1.32rem;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 0.62rem;
  }

  .event-strip {
    width: 100%;
    gap: 5px;
    padding: 4px;
  }

  .event-cell {
    min-height: 32px;
    gap: 1px;
    padding: 5px 7px;
  }

  .event-cell span {
    font-size: 0.62rem;
  }

  .event-cell strong {
    font-size: 0.76rem;
  }

  .game-layout {
    gap: 8px;
  }

  .player-panel {
    order: 2;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .player-panel .panel-head {
    display: none;
  }

  .stat-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .stat-line {
    min-height: 34px;
    gap: 4px;
    padding: 6px 7px;
  }

  .stat-line span {
    font-size: 0.62rem;
  }

  .stat-line strong {
    font-size: 0.82rem;
  }

  .table-zone {
    order: 1;
    min-height: auto;
    padding: 10px;
  }

  .round-strip {
    min-height: 38px;
    margin-bottom: 8px;
  }

  h2 {
    font-size: 1.08rem;
  }

  .round-meter {
    grid-template-columns: 20px auto;
    min-width: 60px;
    min-height: 34px;
    gap: 5px;
    padding: 6px 9px;
    font-size: 0.92rem;
  }

  .round-meter svg {
    width: 20px;
    height: 20px;
  }

  .dice-stage {
    gap: 8px;
    margin: 0 0 9px;
  }

  .dice-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: min(100%, 300px);
  }

  .die svg {
    width: 52%;
    height: 52%;
  }

  .play-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
  }

  .quick-actions {
    gap: 6px;
    min-width: 0;
  }

  .chip {
    width: min(40px, 100%);
    border-width: 1px;
    font-size: 0.72rem;
  }

  .chip::before {
    inset: 5px;
  }

  .chip.is-selected {
    outline-width: 3px;
    outline-offset: 2px;
    transform: translateY(-3px) scale(1.04);
    box-shadow:
      0 0 0 5px color-mix(in srgb, var(--primary) 24%, transparent),
      0 8px 18px color-mix(in srgb, var(--primary) 28%, rgba(0, 0, 0, 0.2)),
      inset 0 0 0 2px color-mix(in srgb, #ffffff 78%, var(--accent-2));
  }

  .chip.is-selected::after {
    top: 1px;
    right: 1px;
    width: 16px;
    height: 16px;
  }

  .roll-button {
    grid-template-columns: 18px auto;
    min-width: 78px;
    min-height: 38px;
    gap: 5px;
    padding-inline: 10px;
    font-size: 0.86rem;
  }

  .roll-button svg {
    width: 18px;
    height: 18px;
  }

  .bet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .bet-tile {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 76px;
    gap: 6px;
    padding: 7px;
  }

  .bet-icon {
    width: 28px;
    height: 28px;
  }

  .bet-icon svg {
    width: 20px;
    height: 20px;
  }

  .bet-copy strong {
    font-size: 0.78rem;
  }

  .bet-copy span {
    margin-top: 2px;
    font-size: 0.64rem;
  }

  .bet-state {
    min-height: 22px;
    gap: 4px;
    padding-top: 5px;
  }

  .empty-stack {
    display: none;
  }

  .stake-chip {
    width: 22px;
    height: 22px;
    margin-left: -6px;
    border-width: 1px;
    font-size: 0.48rem;
  }

  .bet-amount {
    min-width: 0;
    font-size: 0.62rem;
    text-align: right;
  }

  .history-panel {
    order: 3;
  }

  .trend-list {
    grid-template-columns: 1fr;
  }

  .settlement-card,
  .rules-card {
    grid-template-columns: 1fr;
  }

  .settlement-head,
  .rules-head {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .event-strip {
    gap: 5px;
    padding: 4px;
  }

  .event-cell {
    padding-inline: 7px;
  }

  .dice-row {
    gap: 8px;
  }

  .bet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 340px) {
  .app-shell {
    padding: 6px;
  }

  .topbar {
    gap: 6px;
    margin-bottom: 6px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  h1 {
    font-size: 1.18rem;
  }

  .event-cell strong {
    font-size: 0.7rem;
  }

  .table-zone {
    padding: 8px;
  }

  .dice-row {
    gap: 6px;
    width: min(100%, 278px);
  }

  .chip {
    width: min(40px, 100%);
  }

  .roll-button {
    min-width: 72px;
    min-height: 36px;
    padding-inline: 8px;
  }

  .bet-grid {
    gap: 5px;
  }

  .bet-tile {
    min-height: 70px;
    padding: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
