.solo-table {
  --felt: #491f38;
  --brass: #c98956;
  --warm: #ffe2a8;
  --table-edge: #3a1c2a;
  position: absolute;
  z-index: 1;
  inset: auto clamp(22px, 5vw, 100px) clamp(32px, 8vh, 100px) clamp(62px, 16vw, 320px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 27vw, 355px);
  max-width: 1200px;
  margin-inline: auto;
  border: 1px solid var(--brass);
  border-radius: 26px 16px 16px 26px;
  background: #241523;
  box-shadow: 0 6px var(--table-edge), 0 24px 54px #190c19b3;
}

.dice-stage {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(138px, 1fr) auto auto;
  align-content: center;
  padding: 16px clamp(18px, 3vw, 44px) 16px;
  border-radius: 25px 0 0 25px;
  background:
    radial-gradient(ellipse at 49% 42%, #a64b555e, transparent 71%),
    repeating-linear-gradient(135deg, #f1b98b0a 0 1px, transparent 1px 5px),
    var(--felt);
  box-shadow: inset 0 0 0 5px #2d1927, inset 0 0 0 6px #b877506b;
}
.table-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.table-topline h3 {
  margin: 0;
  color: var(--warm);
  font: 800 clamp(22px, 3vw, 36px)/1 var(--display);
  letter-spacing: -.06em;
  text-shadow: 0 2px #2c1627;
}
.play-money { display: flex; align-items: center; gap: 5px; color: #eac7ad; font-size: 11px; font-weight: 800; }
.play-money .pixel { width: 15px; height: 15px; }
.dice-arena {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 33px);
  min-height: clamp(138px, 22vh, 265px);
}
.dice-arena::before {
  content: "";
  position: absolute;
  inset: 30% 8% 2%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #2e172aa8, #2e172a00 70%);
  pointer-events: none;
}
.dice-cup {
  position: relative;
  z-index: 1;
  width: clamp(112px, 16vw, 243px);
  aspect-ratio: 1;
  flex: none;
  align-self: center;
  padding: 0;
  border: 0;
  border-radius: 36% 48% 38% 37%;
  background: transparent;
  transition: transform 160ms var(--ease-out);
}
.dice-cup img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 9px #241123b0);
  pointer-events: none;
  transform-origin: 50% 72%;
}
.percentile-pair { display: flex; align-items: center; gap: clamp(8px, 1.4vw, 20px); }
.percentile-die {
  --die-size: clamp(61px, 7vw, 106px);
  --turn: -13deg;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--die-size);
  aspect-ratio: 1;
  border: 2px solid #fff0c7;
  border-radius: 21%;
  background: linear-gradient(142deg, #fff0bf, #f4bb67 78%);
  color: #482a36;
  font: 800 clamp(28px, 4.3vw, 63px)/1 var(--display);
  letter-spacing: -.09em;
  text-indent: -.09em;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 4px #fbe2ac80, 0 7px #a56245, 3px 13px 12px #241022b5;
  transform: rotate(var(--turn));
}
.percentile-ones {
  --turn: 12deg;
  margin-top: 28px;
  border-color: #f1d7ff;
  background: linear-gradient(142deg, #f1ceff, #b27adb 80%);
  box-shadow: inset 0 0 0 4px #f2d7ff80, 0 7px #744b91, 3px 13px 12px #241022b5;
}
.roll-readout { min-height: 61px; text-align: center; text-shadow: 0 2px #2c1627; }
.roll-number {
  display: block;
  color: var(--warm);
  font: 800 clamp(26px, 3.5vw, 49px)/.98 var(--display);
  letter-spacing: -.06em;
}
.roll-result { min-height: 18px; margin-top: 4px; color: #f5d9d9; font-size: 13px; font-weight: 750; }
.dice-stage.win .roll-number { color: var(--green); }
.dice-stage.loss .roll-number { color: var(--red); }
.roll-track { --chance: 45%; --land: 50%; margin: 9px 2px 0; }
.roll-rail {
  height: 12px;
  position: relative;
  border: 1px solid #da967c81;
  border-radius: 4px;
  background: #8b4255;
  box-shadow: inset 0 2px #35192675;
}
.roll-zone {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--chance);
  border-radius: 3px 0 0 3px;
  background: repeating-linear-gradient(90deg, #bbd98b 0 12px, #a6c377 12px 13px);
}
.roll-marker {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: var(--land);
  width: 12px;
  height: 20px;
  border: 2px solid #fff8d8;
  border-radius: 3px;
  background: #e0a259;
  box-shadow: 0 0 0 2px #4c2537;
  translate: -50% -50%;
}
.dice-stage.win .roll-marker { background: #a9c778; }
.dice-stage.loss .roll-marker { background: #d17384; }
.roll-scale { display: flex; justify-content: space-between; margin-top: 5px; color: #f3c9c3; font-size: 11px; font-weight: 750; }
.roll-scale b { color: #d8eea7; }

.bet-table {
  min-width: 0;
  min-height: 352px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: flex-start;
  padding: 16px clamp(14px, 1.6vw, 24px);
  border-left: 1px solid #af7657;
  border-radius: 0 15px 15px 0;
  background: linear-gradient(152deg, #382032, #241523 80%);
}
.solo-games { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #211520; border-radius: 9px; }
.solo-games button {
  padding: 7px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #e0bccb;
  font-weight: 800;
}
.solo-games button[aria-pressed="true"] { color: var(--warm); border-color: #95694f; background: #51302f; }
.bet-table .risk-field { margin: 0; }
.bet-table .odd span { background: #321f2f; border-color: #775064; }
.bet-table .odd input:checked + span { background: #573a3b; border-color: var(--risk); box-shadow: inset 0 -2px #291a29; }
.stake-chips { display: flex; gap: 6px; margin-top: 7px; }
.stake-chips button { flex: 1; min-height: 31px; border-radius: 6px; }
.bet-table .stake-button { background: #4b2c3d; border-color: #86556a; }
.stake-chips button[aria-pressed="true"] { color: var(--warm); border-color: #cf9468; }
.bet-table .stake-input { background: #241623; border-color: #86556a; }
.bet-preview { margin: 0; min-height: 18px; color: #f5c99e; font-size: 12px; font-weight: 750; }
.solo-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.solo-actions button { min-width: 0; flex: 1; min-height: 42px; font-size: 16px; white-space: nowrap; }
.solo-actions .roll-button { padding-inline: 8px; }
.solo-actions .roll-button:disabled, .cash-button:disabled {
  color: #e0b9c7;
  background: #563646;
  border-color: #a27686;
  box-shadow: none;
}
.cash-button { padding: 4px 8px; background: #bbdc92; border-color: #def0b6; box-shadow: 0 4px #657f52; }
.ember-help { color: #e8c4bc; font-size: 12px; font-weight: 750; }
.ember-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  align-items: end;
  list-style: none;
  margin: 7px 0 0;
  padding: 0;
}
.ember-steps li {
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 47px;
  padding: 7px 2px;
  border: 1px solid #78485a;
  border-radius: 7px;
  background: #3c2335;
  color: #e3b5ae;
  font-size: 11px;
  font-weight: 750;
}
.ember-steps li:nth-child(2) { min-height: 53px; }
.ember-steps li:nth-child(3) { min-height: 59px; }
.ember-steps li:nth-child(4) { min-height: 65px; }
.ember-steps strong { color: #ffe5b2; font: 800 clamp(14px, 1.4vw, 20px)/1.1 var(--display); white-space: nowrap; }
.ember-steps li[data-state="cleared"] { border-color: #a6bd7f; background: #3d4534; color: #d7eab0; }
.ember-steps li[data-state="next"] { border-color: #ecae72; background: #66393c; color: #ffe0b5; }
.ember-steps li[data-state="lost"] { border-color: #ed99a9; background: #6b3247; color: #ffc0c8; }
.party-cup {
  position: absolute;
  width: clamp(190px, 26vw, 380px);
  height: auto;
  left: 35%;
  bottom: 14%;
  filter: drop-shadow(0 18px 17px #200e26c9);
}
.party-tavern:has(.party-room:not([hidden])) .party-cup { display: none; }
.party-entry { border-color: #c98956; background: linear-gradient(145deg, #41253b, #291923); }
.party-table-center { margin-top: 8px; padding: 12px 8px; border-radius: 50% / 23%; background: radial-gradient(ellipse, #6b2d48e6, #311c36bf); }
body[data-scene="taverne"] .gold-hud .production { display: none; }

@media (hover: hover) and (pointer: fine) {
  .dice-cup:hover:not(:disabled) { transform: translateY(-5px) rotate(-3deg); }
  .solo-actions .roll-button:hover:not(:disabled) { background: #ffe4a2; }
  .solo-actions .cash-button:hover:not(:disabled) { background: #d2ebac; }
}
.dice-cup:active:not(:disabled) { transform: translateY(2px) rotate(2deg) scale(.97); }

@media (max-width: 930px) {
  .solo-table { left: 5%; right: 5%; }
}
@media (max-width: 620px) {
  .tavern-world:has(.solo-table:not([hidden])) { display: block; padding: 305px 14px 38px; }
  #solo-tavern.solo-table { position: relative; inset: auto; display: grid; width: 100%; grid-template-columns: 1fr; gap: 0; margin: 0; }
  .dice-stage { border-radius: 25px 25px 0 0; }
  .bet-table { min-height: 0; border-left: 0; border-top: 1px solid #af7657; border-radius: 0 0 15px 15px; }
  .party-cup { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dice-cup { transition: none; }
  .dice-cup:hover:not(:disabled), .dice-cup:active:not(:disabled) { transform: none; }
}
