.snakes-body {
  min-height: 100vh;
  background: #0a1f25;
}

.snakes-body [hidden] {
  display: none !important;
}

.snakes-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.75rem max(1rem, calc((100vw - 1280px) / 2));
  background: #123039;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.snakes-topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.snakes-topbar h1,
.snakes-topbar p {
  margin: 0;
}

.snakes-topbar h1 {
  font-size: 1.35rem;
  line-height: 1.1;
}

.snakes-topbar p {
  color: var(--muted);
  font-size: 0.82rem;
}

.snakes-topbar .status-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.snakes-topbar .status-strip > div {
  padding: 0.45rem 0.8rem;
  border-radius: 0.45rem;
  background: #0d252d;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.snakes-topbar .button {
  min-height: 2.75rem;
  border-radius: 0.45rem;
}

.snakes-layout {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  gap: 0;
  max-width: 1280px;
  min-height: calc(100vh - 4.25rem);
  margin: 0 auto;
  padding: 1.25rem 0;
}

.snakes-layout.stats-open {
  grid-template-columns: 18rem 18rem minmax(0, 1fr);
}

.snakes-body .live-stats-drawer {
  display: none;
  min-height: 100%;
  min-width: 18rem;
  padding: 1rem;
  background: #1c3942;
  border-radius: 0.35rem 0 0 0.35rem;
}

.snakes-layout.stats-open .live-stats-drawer {
  display: block;
}

.snakes-body .live-stats-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.snakes-body .live-stats-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  white-space: nowrap;
}

.snakes-body .live-stats-header h2 span,
.snakes-body .credit-dot {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.3rem;
  background: #25d884;
  color: #03150f;
  font-size: 0.58rem;
  font-weight: 950;
}

.snakes-body .credit-dot {
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  font-size: 0.42rem;
  vertical-align: 0.12rem;
}

.snakes-body .live-stats-header .icon-button,
.snakes-body .stats-filter-row .icon-button {
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1rem;
}

.snakes-body .stats-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.snakes-body .stats-filter-row select {
  width: 100%;
  min-width: 0;
}

.snakes-body .live-stats-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 0.45rem;
  background: #15313a;
}

.snakes-body .live-stats-metrics > div {
  min-width: 0;
  min-height: 3.5rem;
  padding: 0.2rem 0.7rem;
}

.snakes-body .live-stats-metrics > div:nth-child(odd) {
  border-right: 1px solid #3a5d66;
}

.snakes-body .live-stats-metrics strong {
  display: inline-block;
  max-width: 100%;
  margin-top: 0.05rem;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.snakes-body .stats-chart {
  height: 13.75rem;
  padding: 0.8rem;
  border-radius: 0.45rem;
  background: #0c242c;
  overflow: hidden;
}

.snakes-body .stats-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.snakes-body .chart-fill {
  fill: rgba(20, 244, 106, 0.22);
}

.snakes-body .chart-loss-fill {
  fill: rgba(255, 40, 84, 0.24);
}

.snakes-body .chart-line {
  fill: none;
  stroke: #14f46a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.snakes-body .chart-loss-line {
  fill: none;
  stroke: #ff2854;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.snakes-body .chart-zero {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 2;
}

.snakes-controls {
  display: flex;
  flex-direction: column;
  background: #1c3942;
  border-radius: 0.35rem 0 0 0.35rem;
}

.snakes-bet-panel {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.snakes-bet-panel .segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.25rem;
  border-radius: 999px;
  background: #0b2229;
}

.snakes-bet-panel .segmented button {
  min-height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #c8dce8;
  font-weight: 800;
  cursor: pointer;
}

.snakes-bet-panel .segmented button.active {
  background: #87a7b2;
  color: #061924;
}

.snakes-bet-panel input,
.snakes-bet-panel select,
.verifier-panel input,
.stats-filter-row select {
  width: 100%;
  min-height: 2.6rem;
  border: 1px solid #335b64;
  border-radius: 0.45rem;
  padding: 0.65rem 0.75rem;
  background: #0b2028;
  color: #f3fbff;
}

.mode-panel {
  display: grid;
  gap: 0.7rem;
}

.bet-action {
  width: 100%;
  min-height: 2.75rem;
  border-radius: 0.45rem;
  font-weight: 900;
}

.profit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.45rem;
  background: #15313a;
  color: #c6d8e2;
  font-size: 0.85rem;
}

.profit-card strong {
  color: #ffffff;
}

.auto-panel,
.auto-advanced {
  gap: 0.75rem;
}

.auto-advanced {
  display: grid;
}

.auto-rule {
  margin: 0;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
}

.auto-rule legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.auto-rule-row {
  display: grid;
  grid-template-columns: 4.4rem minmax(6.5rem, 1fr);
  gap: 0.35rem;
  align-items: center;
}

.auto-rule-row button,
.auto-rule-row label {
  min-width: 0;
  min-height: 2.35rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0e2730;
  color: #dcecf4;
  font-weight: 800;
}

.auto-rule-row button {
  cursor: pointer;
}

.auto-rule-row button.active {
  background: #87a7b2;
  color: #061924;
}

.auto-rule-row label {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.4rem;
}

.auto-rule-row input {
  width: 100%;
  min-width: 0;
  min-height: 2rem;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-weight: 900;
}

.auto-pacing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.custom-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.6rem;
}

.custom-switch-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-control {
  position: relative;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #385d68;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.switch-control::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #9eb5c3;
  transition: transform 0.16s ease, background 0.16s ease;
}

.custom-switch-row input:checked + .switch-control {
  background: #2778d8;
}

.custom-switch-row input:checked + .switch-control::after {
  transform: translateX(1.12rem);
  background: #ffffff;
}

.snakes-note {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border-radius: 0.45rem;
  background: #102f37;
  color: #bfd3df;
  font-size: 0.8rem;
  line-height: 1.45;
}

.snakes-note strong {
  color: #dff5ff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.text-button {
  min-height: 2.1rem;
  padding: 0.4rem 0.65rem;
  border: 0;
  border-radius: 0.35rem;
  background: #315261;
  color: #e3f2f8;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.text-button[aria-pressed="true"] {
  background: #1a8fff;
  color: #ffffff;
}

.snakes-stage {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 0 1.25rem;
}

.snakes-stage > * {
  min-width: 0;
}

.board-panel {
  position: relative;
  min-width: 0;
  padding: 1rem;
  border-radius: 0.45rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 45% 12%, rgba(45, 213, 132, 0.13), transparent 16rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 5rem 100%,
    #081f28;
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.board-head strong {
  display: block;
  margin-top: 0.1rem;
}

.dice-display {
  display: flex;
  gap: 0.35rem;
  min-height: 3rem;
  align-items: center;
}

.die {
  --pip-size: 0.34rem;
  position: relative;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 0.42rem;
  background: #dce7ef;
  box-shadow: inset 0 -0.18rem 0 rgba(0, 0, 0, 0.18);
}

.die::before {
  content: attr(data-value);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #11212a;
  font-size: 0.85rem;
  font-weight: 950;
}

.die.rolling {
  animation: die-pop 0.34s ease both;
}

.snake-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.board-space {
  min-height: 5.4rem;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
  background: #153540;
  color: #e6f3f7;
}

.board-space.start {
  background: #244756;
}

.board-space.safe {
  background: #123d35;
  border-color: rgba(37, 216, 132, 0.35);
}

.board-space.snake {
  background: #492034;
  border-color: rgba(255, 70, 112, 0.38);
}

.board-space.active {
  outline: 0.18rem solid #ffc20e;
  outline-offset: -0.18rem;
}

.board-space.passed {
  box-shadow: inset 0 0 0 0.12rem rgba(37, 216, 132, 0.45);
}

.space-index,
.space-kind {
  display: block;
}

.space-index {
  color: #b9d0da;
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.space-value {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.05rem;
  font-weight: 950;
}

.space-kind {
  margin-top: 0.2rem;
  color: #b9d0da;
  font-size: 0.72rem;
  font-weight: 800;
}

.round-banner {
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border-radius: 0.45rem;
  background: rgba(17, 49, 59, 0.95);
  color: #d8edf6;
  text-align: center;
  font-weight: 850;
  box-shadow: 0 0.6rem 1rem rgba(0, 0, 0, 0.18);
}

.round-banner.win {
  background: #0e6f55;
  color: #ffffff;
}

.round-banner.loss {
  background: #95233d;
  color: #ffffff;
}

.roll-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.roll-card {
  min-height: 6.6rem;
  padding: 0.65rem;
  border-radius: 0.5rem;
  background: #132f39;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.roll-card.revealed.safe {
  background: #123d35;
}

.roll-card.revealed.snake {
  background: #51213a;
}

.roll-card.active {
  outline: 0.16rem solid #ffc20e;
  outline-offset: -0.16rem;
}

.roll-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  color: #b9d0da;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.roll-outcome {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 1.05rem;
  font-weight: 950;
}

.roll-dice {
  display: flex;
  gap: 0.25rem;
}

.roll-dice .die {
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 0.34rem;
}

.snakes-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.snakes-result-grid > div,
.history-panel,
.verifier-panel {
  padding: 1rem;
  border-radius: 0.45rem;
  background: #12323b;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.snakes-result-grid strong {
  display: block;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
  font-size: 1.15rem;
}

.verifier-panel {
  color: #d7eaf2;
}

.verifier-panel summary {
  cursor: pointer;
  font-weight: 900;
}

.verifier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.verifier-grid code {
  display: block;
  min-height: 2.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
  background: #0b2028;
  border: 1px solid #335b64;
  color: #e6f4fb;
  overflow-wrap: anywhere;
}

.verifier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.9rem 0;
}

#resultOutput {
  min-height: 12rem;
  max-height: 31rem;
  overflow: auto;
  padding: 1rem;
  border-radius: 0.45rem;
  background: #081d25;
  color: #e5f7ff;
  font-size: 0.78rem;
  line-height: 1.45;
}

.history-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-panel table {
  width: 100%;
  border-collapse: collapse;
}

.history-panel th,
.history-panel td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  white-space: nowrap;
}

.profit-positive {
  color: #14f46a;
}

.profit-negative {
  color: #ff5776;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 13, 18, 0.72);
}

.info-dialog {
  width: min(36rem, 100%);
  border-radius: 0.55rem;
  background: #17333c;
  color: #dbeef7;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

.info-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.25rem;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.info-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.info-tabs {
  display: flex;
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0 auto 0.75rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: #0b2229;
}

.info-tabs button {
  min-width: 8rem;
  min-height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #d6e7ef;
  font-weight: 900;
  cursor: pointer;
}

.info-tabs button.active {
  background: #87a7b2;
  color: #061924;
}

.info-panel {
  padding: 0 1.25rem 1.25rem;
  line-height: 1.6;
}

.info-panel ol {
  margin: 0;
  padding-left: 1.2rem;
}

.max-list {
  display: grid;
  gap: 0.55rem;
}

.max-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.45rem;
  background: #0e2831;
}

@keyframes die-pop {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  45% {
    transform: translateY(-0.35rem) rotate(8deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@media (max-width: 1080px) {
  .snakes-topbar,
  .snakes-topbar .status-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .snakes-topbar .status-strip {
    width: 100%;
  }

  .snakes-layout,
  .snakes-layout.stats-open {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .snakes-body .live-stats-drawer,
  .snakes-controls {
    border-radius: 0;
  }

  .snakes-bet-panel {
    position: static;
  }

  .snakes-stage {
    padding: 1rem;
  }

  .snake-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .roll-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .snakes-result-grid,
  .verifier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .snakes-topbar {
    padding: 0.75rem;
  }

  .snakes-topbar .status-strip > div,
  .snakes-topbar .button {
    width: 100%;
  }

  .board-head,
  .auto-pacing {
    align-items: stretch;
    flex-direction: column;
  }

  .snake-board,
  .roll-track,
  .snakes-result-grid,
  .verifier-grid,
  .auto-rule-row,
  .auto-pacing {
    grid-template-columns: 1fr;
  }

  .board-space {
    min-height: 4.25rem;
  }

  .info-tabs {
    width: calc(100% - 2rem);
  }

  .info-tabs button {
    min-width: 0;
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .die.rolling {
    animation: none;
  }
}

/* 8-decimal live stats layout fix */
.snakes-body .live-stats-metrics {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.snakes-body .live-stats-metrics > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.18rem;
  padding-right: 0.55rem;
  padding-left: 0.55rem;
}

.snakes-body .live-stats-metrics > div:nth-child(1) {
  order: 1;
}

.snakes-body .live-stats-metrics > div:nth-child(3) {
  order: 2;
}

.snakes-body .live-stats-metrics > div:nth-child(2) {
  order: 3;
}

.snakes-body .live-stats-metrics > div:nth-child(4) {
  order: 4;
}

.snakes-body .live-stats-metrics > div:nth-child(1),
.snakes-body .live-stats-metrics > div:nth-child(3) {
  grid-column: 1 / -1;
  border-right: 0;
}

.snakes-body .live-stats-metrics > div:nth-child(1),
.snakes-body .live-stats-metrics > div:nth-child(3) {
  border-bottom: 1px solid rgba(177, 186, 211, 0.22);
}

.snakes-body .live-stats-metrics .label {
  grid-column: 1 / -1;
}

.snakes-body .live-stats-metrics strong {
  grid-column: 1;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
  font-size: clamp(0.86rem, 3.1vw, 1.06rem);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.snakes-body .live-stats-metrics .credit-dot {
  grid-column: 2;
  align-self: center;
  justify-self: end;
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  margin-left: 0;
  font-size: 0.4rem;
  vertical-align: 0;
}
/* /8-decimal live stats layout fix */

/* Geometry and motion measured from the owner's Snakes recording. */
.snakes-body.originals-body .board-panel { position: relative; height: 630px; min-height: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: #0f212e; box-shadow: none; }
.snakes-scene { position: absolute; top: 89px; left: 50%; width: min(416px, calc(100% - 32px)); aspect-ratio: 416 / 470; transform: translateX(-50%); container-type: inline-size; --snake-accent: #2e92ff; --snake-shadow: #1765c1; }
.snakes-body .snake-board { position: absolute; inset: 0 0 auto; width: 100%; aspect-ratio: 416 / 400; display: grid; grid-template: repeat(4, 1fr) / repeat(4, 1fr); gap: 1.45%; margin: 0; }
.snakes-body .board-space { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 15%; color: #d5dce9; background: #2f4553; box-shadow: 0 2.5cqw 0 #223946; font-size: 5cqw; font-weight: 800; outline: none; }
.snakes-body .board-space .space-value { margin: 0; font-size: inherit; font-weight: inherit; white-space: nowrap; }
.snakes-body .board-space .space-index, .snakes-body .board-space .space-kind { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.snakes-body .board-space.start { color: var(--snake-accent); }
.snake-start-arrow { width: 20%; fill: currentColor; }
.snake-head { width: 46%; height: 54%; color: #526c7e; }
.snakes-body .board-space.travelling { outline: 2px solid var(--snake-accent); outline-offset: -2px; box-shadow: 0 2.5cqw 0 #223946, 0 0 15px color-mix(in srgb, var(--snake-accent), transparent 65%); }
.snakes-body .board-space.active.safe { background: var(--snake-accent); box-shadow: 0 2.5cqw 0 var(--snake-shadow); color: #102534; }
.snakes-body .board-space.active.snake { background: #ed003e; box-shadow: 0 2.5cqw 0 #b10032; }
.snakes-body .board-space.active.snake .snake-head { color: #fff; }
.snakes-body #snakesStage[data-phase="landed"] .board-space.active,
.snakes-body #snakesStage[data-phase="snake"] .board-space.active { animation: snakes-land 180ms ease-out both; }
.snakes-centre { position: absolute; left: 31%; top: 28%; width: 38%; height: 33.2%; border-radius: 9%; background: #506a7c; }
.snakes-body .dice-display { position: absolute; left: 5%; top: -6.5%; width: 90%; height: 43%; min-height: 0; display: flex; justify-content: space-between; gap: 5%; align-items: start; perspective: 600px; }
.snakes-body .die { --die-depth: 8cqw; position: relative; flex: 1; width: 16cqw; height: 16cqw; padding: 0; border-radius: 0; background: none; box-shadow: none; transform-style: preserve-3d; transform: rotateX(var(--die-x, 0deg)) rotateY(var(--die-y, 0deg)); transition: transform 160ms ease-out; }
.snakes-body .die::before { display: none; }
.die-face { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 22%; gap: 12%; border-radius: 17%; background: #d2d5e7; box-shadow: inset 0 -2.3cqw 0 #b5bcd4; backface-visibility: hidden; }
.die-face:nth-child(1) { transform: translateZ(var(--die-depth)); }
.die-face:nth-child(2) { transform: rotateY(90deg) translateZ(var(--die-depth)); }
.die-face:nth-child(3) { transform: rotateX(90deg) translateZ(var(--die-depth)); }
.die-face:nth-child(4) { transform: rotateX(-90deg) translateZ(var(--die-depth)); }
.die-face:nth-child(5) { transform: rotateY(-90deg) translateZ(var(--die-depth)); }
.die-face:nth-child(6) { transform: rotateY(180deg) translateZ(var(--die-depth)); }
.die-pip { display: block; background: #111a29; border-radius: 50%; aspect-ratio: 1; }
.snakes-body .die.rolling { animation: snakes-dice-roll 460ms ease-in-out both; }
.snakes-body .die.rolling:nth-child(2) { animation-name: snakes-dice-roll-second; }
.snakes-multiplier { position: absolute; inset: 49% 5% 5%; display: grid; place-items: center; padding: 3%; border-radius: 9%; background: #0f212e; color: #e5eaf3; font-size: 6cqw; font-weight: 800; white-space: nowrap; }
.snakes-multiplier.safe { color: #00ed00; }
.snakes-multiplier.loss { color: #ed003e; }
.snakes-body .roll-track { position: absolute; top: 94%; left: 0; width: 100%; display: flex; justify-content: center; gap: 3.8%; margin: 0; }
.roll-dot { width: 5.3%; aspect-ratio: 1; border-radius: 50%; background: #2f4553; }
.roll-dot.safe { background: var(--snake-accent); }
.roll-dot.snake { background: #ed003e; }
.snakes-win { position: absolute; z-index: 5; left: 50%; top: 31.8%; width: 37%; min-height: 28%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqw; padding: 4cqw 2cqw; border: 1.4cqw solid #00ee00; border-radius: 4cqw; color: #00ed00; background: #1a2c38; font-size: 5.2cqw; text-align: center; }
.snakes-win span { width: 50%; height: 3px; background: #3e5664; }
.snakes-win.long-value { width: 70%; }
#snakesWinReturned { font-size: 3.5cqw; overflow-wrap: anywhere; }
.snakes-body .profit-card { display: grid; grid-template-columns: 1fr; gap: 7px; min-height: 0; padding: 0; background: transparent; color: #b1c3d1; font-size: 13px; }
.snakes-body .profit-card > span { display: flex; flex-wrap: wrap; gap: 4px; }
.snakes-body .profit-card > span strong { color: inherit; }
.snakes-body #profitPreview { min-height: 42px; padding: 11px; border: 1px solid #3c5464; border-radius: 5px; color: #e8f1f7; background: #1a2c38; }
.snakes-body #rollBtn { background: #3c5464; color: #e8f1f7; border: 0; box-shadow: none; }
.snakes-body #rollBtn:disabled { opacity: .45; }
.snakes-fast .die, .snakes-fast .board-space { animation: none !important; transition: none !important; }
@keyframes snakes-land { 0% { transform: translateY(0); } 55% { transform: translateY(-1cqw) scale(1.035); } 100% { transform: translateY(0); } }
@keyframes snakes-dice-roll { 0% { transform: rotateX(0deg) rotateY(0deg); } 45% { transform: translateY(-15%) rotateX(210deg) rotateY(180deg); } 100% { transform: rotateX(calc(var(--die-x) + 360deg)) rotateY(calc(var(--die-y) + 360deg)); } }
@keyframes snakes-dice-roll-second { 0% { transform: rotateX(0deg) rotateY(0deg); } 45% { transform: translateY(-10%) rotateX(-180deg) rotateY(200deg); } 100% { transform: rotateX(calc(var(--die-x) - 360deg)) rotateY(calc(var(--die-y) + 360deg)); } }
@media (max-width: 760px) {
  .snakes-body.originals-body .board-panel { height: clamp(370px, 123vw, 560px); }
  .snakes-scene { top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .snakes-body .die, .snakes-body .board-space { animation: none !important; transition: none !important; }
}
