:root {
  --paper: #f5f2e9;
  --card: #fdfbf6;
  --ink: #253b33;
  --muted: #7b8073;
  --line: #e6e6da;
  --green: #244f40;
  --orange: #dc784b;
  --orange-hover: #c96339;
  --mint: #c1dab1;
  --win: #3a7450;
  --loss: #b85942;
  --radius: 22px;
  font-family:
    Inter,
    "Avenir Next",
    Avenir,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button {
  touch-action: manipulation;
}
button:disabled {
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #cf7349;
  outline-offset: 4px;
}
button {
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  transition:
    background 0.18s,
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s,
    opacity 0.18s;
}
button:not(:disabled):active {
  transform: translateY(2px);
}
button:disabled {
  opacity: 0.45;
}
[hidden] {
  display: none !important;
}
p,
h1,
h2,
h3 {
  margin: 0;
}
svg {
  display: block;
}
.app {
  max-width: 1260px;
  margin: auto;
  padding: 0 44px;
}
.topbar {
  height: 100px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #dedfd3;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 29px;
  font-weight: 790;
  letter-spacing: -1.5px;
}
.brand-period {
  color: var(--orange);
}
.brand-mark {
  position: relative;
  width: 35px;
  height: 37px;
  display: block;
}
.brand-mark i {
  position: absolute;
  width: 18px;
  height: 26px;
  border-radius: 55% 45% 52% 48%;
  background: var(--green);
  transform: rotate(35deg);
  left: 1px;
  top: 1px;
}
.brand-mark i:after {
  content: "";
  position: absolute;
  inset: 6px 5px 5px 8px;
  border-left: 1.5px solid var(--paper);
  border-radius: 50%;
  transform: rotate(8deg);
}
.brand-mark i + i {
  background: var(--orange);
  left: 16px;
  top: 13px;
  transform: rotate(40deg);
  width: 15px;
  height: 22px;
}
.header-note {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #74796b;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #7b9676;
  border-radius: 50%;
  flex-shrink: 0;
}
.topbar nav {
  margin-left: auto;
  display: flex;
  gap: 22px;
  align-items: center;
}
.text-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  background: none;
  border: 0;
  font-size: 12px;
  font-weight: 600;
}
.text-button:hover {
  color: var(--orange);
}
.help-icon {
  border: 1.4px solid currentColor;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 11px;
  text-align: center;
  line-height: 14px;
}
.icon-button {
  border: 1px solid #dddfd4;
  background: transparent;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 9px;
  display: grid;
  place-items: center;
}
.icon-button:hover {
  background: #e9eadd;
}
.icon-button svg {
  width: 18px;
  height: 18px;
}
.sound-on {
  display: none;
}
[aria-pressed="true"] .sound-on {
  display: block;
}
[aria-pressed="true"] .sound-off {
  display: none;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 28px;
  gap: 20px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.7px;
  line-height: 1.5;
}
.intro .eyebrow {
  color: #8a8c7d;
  margin-bottom: 9px;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 39px;
  font-weight: 400;
  letter-spacing: -1.4px;
  line-height: 1.18;
}
h1 em {
  color: #aa6446;
  font-weight: 400;
}
.intro > p {
  font-size: 12px;
  line-height: 1.8;
  color: #7d8073;
}
.game-table {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(345px, 1fr);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px -25px #2c3c3440;
  overflow: hidden;
  background: var(--card);
  border: 1px solid #dedfd3;
}
.table-side {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: #efece0;
  background: radial-gradient(
    ellipse at 50% 38%,
    #325846 0%,
    #214436 48%,
    #193a30 100%
  );
  isolation: isolate;
}
.table-side:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.65' filter='url(%23n)'/%3E%3C/svg%3E");
}
.scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 30px;
  padding: 24px 0 17px;
  border-bottom: 1px solid #ffffff15;
  z-index: 1;
}
.label {
  display: block;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.7px;
  color: #bbc4ae;
}
.score-main > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 3px;
}
.score-main strong {
  font-size: 39px;
  font-weight: 500;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.points {
  font-size: 11px;
  color: #bdc9b4;
}
.score-change {
  font-size: 9px;
  margin-left: 7px;
  padding: 4px 7px;
  border-radius: 5px;
  background: #ffffff0a;
  color: #c0c8b6;
}
.score-change.positive {
  color: #d2eaa9;
  background: #cbe99413;
}
.score-change.negative {
  color: #ffc3ab;
  background: #eeac9c13;
}
.best-score {
  text-align: right;
}
.best-score .label {
  font-size: 7.5px;
  letter-spacing: 1.3px;
}
.best-score .label span {
  font-size: 15px;
  color: #d6b888;
  vertical-align: -1px;
}
.best-score strong {
  display: block;
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
  color: #dedac0;
}
.bag-stage {
  position: relative;
  min-height: 330px;
  flex: 1;
  overflow: hidden;
  perspective: 900px;
}
.stage-topline {
  position: absolute;
  left: 30px;
  right: 30px;
  top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #b7c1ac;
  letter-spacing: 0.25px;
  z-index: 4;
}
.round-badge {
  border: 1px solid #cedbc22a;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 8px;
  letter-spacing: 1.3px;
  color: #d5dccb;
}
.orbit {
  position: absolute;
  left: 50%;
  top: 49%;
  border: 1px solid #d9dec30c;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.orbit-one {
  width: 302px;
  height: 302px;
}
.orbit-two {
  width: 385px;
  height: 385px;
  border-style: dashed;
  border-color: #d9dec310;
}
.table-star {
  position: absolute;
  color: #bed0a6;
  opacity: 0.55;
  font-family: Georgia, serif;
}
.star-one {
  top: 27%;
  left: 24%;
  font-size: 22px;
}
.star-two {
  top: 60%;
  right: 20%;
  font-size: 28px;
  color: #f1c394;
}
.star-three {
  top: 67%;
  left: 18%;
  font-size: 14px;
  opacity: 0.35;
}
.bag-shadow {
  position: absolute;
  width: 208px;
  height: 22px;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  background: #071e1690;
  border-radius: 50%;
  filter: blur(9px);
}
.bag-graphic {
  position: absolute;
  width: 248px;
  height: 265px;
  left: calc(50% - 124px);
  bottom: 46px;
  transform-origin: 50% 90%;
  will-change: transform;
  transition:
    opacity 0.35s,
    filter 0.35s;
  animation: bag-arrive 0.8s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}
.sack-art {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 0 #f9dba318);
}
.bag-neck {
  position: absolute;
  width: 34%;
  height: 4%;
  left: 33%;
  top: 13%;
}
.bag-counts {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  align-items: center;
  white-space: nowrap;
  border: 1px solid #d0dec322;
  background: #122e2550;
  box-shadow: 0 4px 8px #0f2b2320;
  padding: 10px 17px;
  border-radius: 30px;
  font-size: 11px;
  color: #c6ccbb;
}
.bag-counts > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.bag-counts b {
  color: #f6f1df;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.count-divider {
  height: 13px;
  width: 1px;
  background: #e4e5cc22;
}
.animation-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}
.animated-bean {
  position: absolute;
  top: 0;
  left: 0;
  width: 29px;
  height: 33px;
}
.reveal-display {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 21px;
}
.reveal-rays {
  position: absolute;
  width: 220px;
  height: 220px;
  top: -65px;
  left: calc(50% - 110px);
  border: 1px solid #dfedc33a;
  border-radius: 50%;
  background: radial-gradient(circle, #d7eba41a, transparent 65%);
  box-shadow:
    0 0 0 21px #e4efb607,
    0 0 0 45px #e4efb605;
  animation: rays-in 0.6s ease-out both;
}
.reveal-color {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f4ecdb;
}
.reveal-display .bean {
  animation: reveal-in 0.48s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.game-table[data-mode="outcome"] .bag-graphic {
  opacity: 0.13;
  filter: blur(2px);
}
.game-table[data-mode="outcome"] .bag-shadow {
  opacity: 0.2;
}
.game-table[data-mode="drawing"] .orbit-one {
  box-shadow: 0 0 40px #d7d6a013;
  transition: box-shadow 0.2s;
}
.table-feedback {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 67px;
  padding: 8px 25px 15px;
  text-align: center;
}
.table-feedback p:first-child {
  font-family: Georgia, serif;
  font-size: 18px;
  letter-spacing: -0.2px;
  color: #ede8d5;
  line-height: 1.4;
}
.table-feedback p + p {
  font-size: 11px;
  color: #b7c2ae;
  margin-top: 4px;
  line-height: 1.5;
}
.table-feedback[data-result="win"] p:first-child {
  color: #d4eaa8;
}
.table-feedback[data-result="lose"] p:first-child {
  color: #ffc4a9;
}
.table-feedback[data-result] p:first-child {
  font-family: inherit;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.7px;
}
.next-button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #d5e6b752;
  border-radius: 8px;
  background: #d8e6c61a;
  padding: 11px 13px;
  color: #ecf1df;
  font-size: 11px;
  font-weight: 600;
}
.next-button:hover {
  background: #d8e6c633;
}
.trail-zone {
  margin: 0 30px;
  padding: 17px 0 19px;
  border-top: 1px solid #ffffff15;
}
.trail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.trail-heading h2 {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 1.6px;
  color: #c2ccb6;
}
.trail-heading > span {
  font-size: 9px;
  color: #a3b09b;
  font-variant-numeric: tabular-nums;
}
.trail {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: space-between;
  gap: 5px;
}
.trail-cell {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px dashed #d3dfc328;
  position: relative;
  font-size: 8px;
  color: #b3c2ab7a;
  flex: 0 1 32px;
  min-width: 0;
  aspect-ratio: 1;
}
.trail-cell.drawn {
  border-style: solid;
  border-color: #c5d4b336;
  background: #163b2e;
}
.trail-cell .bean {
  width: 22px;
  height: 24px;
}
.trail-cell.fresh {
  box-shadow: 0 0 0 3px #d8e9b421;
  animation: trail-pop 0.35s ease-out;
}
.trail-cell.won:after,
.trail-cell.lost:after {
  content: "";
  position: absolute;
  bottom: -4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d3e59b;
}
.trail-cell.lost:after {
  background: #e9a389;
}
.trail-note {
  font-size: 10px;
  color: #9dac96;
  text-align: center;
  margin-top: 12px;
}
.bean {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  border-radius: 48% 52% 46% 54%;
  transform: rotate(-25deg);
}
.bean:before {
  content: "";
  position: absolute;
  left: 21%;
  top: 10%;
  width: 40%;
  height: 32%;
  background: radial-gradient(ellipse, #ffffffa8, transparent 75%);
  border-radius: 50%;
  transform: rotate(-30deg);
}
.bean:after {
  content: "";
  position: absolute;
  top: 23%;
  left: 44%;
  width: 23%;
  height: 52%;
  border-left: 2px solid #ad926947;
  border-radius: 50%;
  transform: rotate(9deg);
}
.bean-white {
  background: radial-gradient(
    ellipse at 28% 23%,
    #fffdf1 0,
    #f5ecd4 40%,
    #e3d4b5 70%,
    #ad9c7a 100%
  );
  box-shadow:
    inset -2px -3px 5px #957d5433,
    1px 3px 4px #0003;
  border: 1px solid #cfbf9e;
}
.bean-black {
  background: radial-gradient(
    ellipse at 28% 23%,
    #777c73 0,
    #464c45 30%,
    #262e28 65%,
    #151d18 100%
  );
  box-shadow:
    inset -2px -3px 5px #07170b66,
    1px 3px 4px #0003;
  border: 1px solid #76817255;
}
.bean-black:after {
  border-color: #101a1499;
}
.bean-black:before {
  opacity: 0.5;
}
.bean-sm {
  width: 14px;
  height: 16px;
}
.bean-sm:after {
  border-left-width: 1px;
}
.bean-lg {
  width: 36px;
  height: 42px;
}
.bean-xl {
  width: 78px;
  height: 94px;
  box-shadow: 10px 19px 25px #09291b70;
}
.bean-xl:after {
  border-left-width: 3px;
}
.bet-panel {
  padding: 25px 27px 17px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-heading .eyebrow {
  font-size: 8px;
  color: #929281;
  letter-spacing: 1.5px;
}
.panel-heading h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 25px;
  letter-spacing: -0.7px;
  margin-top: 5px;
}
.panel-round {
  font-family: Georgia, serif;
  font-size: 33px;
  font-style: italic;
  color: #dddecf;
}
.flow-steps {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 22px 0 24px;
  gap: 0;
}
.flow-steps li {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  font-size: 11px;
  color: #91958a;
  position: relative;
}
.flow-steps li:not(:last-child):after {
  content: "";
  height: 1px;
  background: #e2e4d9;
  flex: 1;
  margin: 0 10px;
}
.flow-steps li:last-child {
  flex: 0;
}
.flow-steps li > span {
  border: 1px solid #dddfd2;
  border-radius: 50%;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  font-size: 8px;
}
.flow-steps .is-current {
  color: #315743;
  font-weight: 700;
}
.flow-steps .is-current > span {
  color: #fff;
  background: #315743;
  border-color: #315743;
  box-shadow: 0 0 0 3px #3157430a;
}
.flow-steps .is-complete > span {
  background: #e7eddc;
  color: #42603b;
  border-color: #e7eddc;
}
.color-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.color-fieldset legend,
.wager-section > label {
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 12px;
  padding: 0;
  display: block;
  line-height: 1.3;
}
.section-number {
  font-size: 8px;
  color: #9d9e8b;
  margin-right: 8px;
  font-weight: 500;
}
.color-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.color-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 17px 8px 12px;
  border: 1px solid #dedfd3;
  border-radius: 11px;
  background: #f7f6ee;
  gap: 0;
  box-shadow: 0 2px 1px #263e3210;
  min-height: 145px;
}
.color-card:hover:not(:disabled) {
  background: #f0f1e4;
  transform: translateY(-3px);
  box-shadow: 0 5px 10px #243b3210;
  border-color: #afbba1;
}
.color-card .bean {
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
  margin-bottom: 9px;
}
.color-card:hover:not(:disabled) .bean {
  transform: rotate(-10deg) translateY(-2px);
}
.color-card > strong {
  font-size: 13px;
  font-weight: 650;
}
.card-odds {
  font-size: 11px;
  color: #85897b;
  margin-top: 4px;
}
.card-odds b {
  font-weight: 500;
  color: #68725f;
}
.card-return {
  font-size: 10px;
  font-weight: 600;
  color: #717c61;
  letter-spacing: 0.3px;
  border-top: 1px solid #e3e5d8;
  padding-top: 7px;
  margin-top: 8px;
  width: 80%;
  text-align: center;
}
.selection-check {
  position: absolute;
  right: 9px;
  top: 9px;
  width: 16px;
  height: 16px;
  border: 1px solid #dbdfd0;
  border-radius: 50%;
  font-size: 9px;
  display: grid;
  place-items: center;
  color: transparent;
}
.color-card.is-selected {
  background: #edf1e2;
  border-color: #65805c;
  box-shadow:
    inset 0 0 0 1px #65805c,
    0 3px 5px #253b320a;
}
.color-card.is-selected .selection-check {
  background: #345943;
  border-color: #345943;
  color: white;
}
.color-card:disabled {
  opacity: 0.65;
}
.color-card.is-selected:disabled {
  opacity: 1;
}
.wager-section {
  position: relative;
  margin-top: 23px;
}
.available {
  position: absolute;
  right: 0;
  top: 1px;
  font-size: 10px;
  color: #909181;
}
.wager-row {
  height: 53px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #dfe1d3;
  border-radius: 8px;
  padding: 0 7px;
  background: #fffef9;
}
.step-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e7e7dd;
  background: #f5f5ec;
  font-size: 20px;
  line-height: 1;
  color: #67705d;
}
.step-button:hover:not(:disabled) {
  background: #e7ecd9;
  border-color: #c2cdaf;
}
.wager-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.wager-value input {
  width: 100px;
  min-width: 0;
  background: none;
  border: 0;
  text-align: center;
  font-size: 24px;
  letter-spacing: -1px;
  font-weight: 550;
  color: var(--ink);
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
  outline-offset: 0;
}
.wager-value > span {
  font-size: 9px;
  color: #939784;
}
.wager-value input[aria-invalid="true"] {
  color: var(--loss);
  outline: 2px solid var(--loss);
  border-radius: 3px;
}
.wager-slider {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  --fill: 9%;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    to right,
    #4e6d48 0%,
    #4e6d48 var(--fill),
    #e3e5d7 var(--fill),
    #e3e5d7 100%
  );
  margin: 16px 0;
  border-radius: 9px;
  cursor: pointer;
}
.wager-slider::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 3px solid var(--card);
  background: #4e6d48;
  box-shadow:
    0 0 0 1px #778967,
    0 2px 3px #18281c22;
}
.wager-slider::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 3px solid var(--card);
  background: #4e6d48;
  box-shadow: 0 0 0 1px #778967;
}
.chips {
  display: flex;
  gap: 5px;
}
.chip {
  flex: 1;
  padding: 7px 3px;
  border: 1px solid #e2e4d7;
  border-radius: 5px;
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
}
.chip:hover:not(:disabled) {
  background: #edf0e1;
  border-color: #b8c2a5;
}
.chip.is-active {
  background: #e6ebd9;
  border-color: #b5c4a1;
  color: #3d5838;
  font-weight: 700;
}
.chip-all {
  color: #b26743;
}
.bet-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 13px 14px;
  margin-top: 23px;
  background: #f0f2e7;
  border: 1px solid #e8ebde;
  border-radius: 8px;
  min-height: 74px;
}
.bet-preview > div:first-child > span {
  display: block;
  font-size: 9px;
  color: #7c856b;
  font-weight: 600;
  letter-spacing: 1px;
}
.bet-preview strong {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.8px;
  color: #43673f;
  display: block;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.bet-preview strong small {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  color: #889175;
}
.preview-detail {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: right;
  font-size: 11px;
  color: #748261;
}
.preview-detail span + span {
  font-size: 10px;
  color: #969985;
}
.wager-message {
  min-height: 24px;
  font-size: 11px;
  color: var(--loss);
  line-height: 1.4;
  padding: 5px 1px 3px;
}
.draw-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #cb6c42;
  border-radius: 9px;
  background: var(--orange);
  color: #fffdf2;
  width: 100%;
  padding: 16px 18px;
  font-size: 12px;
  font-weight: 650;
  box-shadow:
    0 3px 0 #b85d35,
    0 5px 10px #a4542320;
}
.draw-button:hover:not(:disabled) {
  background: var(--orange-hover);
  box-shadow:
    0 3px 0 #a9532e,
    0 6px 14px #a4542330;
  transform: translateY(-1px);
}
.draw-button:disabled {
  opacity: 0.6;
  box-shadow: 0 2px 0 #b85d3544;
}
.draw-button svg {
  height: 19px;
  width: 19px;
  flex-shrink: 0;
}
.bet-footnote {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.2px;
  color: #969988;
  padding-top: 14px;
}
.bet-footnote span {
  margin-right: 4px;
}
.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 26px;
  gap: 14px;
  font-size: 9px;
  color: #8a8e7e;
}
.game-footer > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.game-footer > p {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 12px;
  color: #989b8b;
}
.game-footer .text-button {
  font-size: 10px;
  font-weight: 500;
  color: #818775;
}
.game-footer .text-button:hover {
  color: var(--orange);
}
.game-footer .text-button span {
  font-size: 17px;
}
.modal {
  width: min(470px, calc(100% - 28px));
  max-height: calc(100dvh - 40px);
  border: 1px solid #e1e2d2;
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  padding: 33px;
  box-shadow: 0 25px 100px #0a241b70;
  overflow: auto;
}
.modal::backdrop {
  background: #102d26b8;
  backdrop-filter: blur(8px);
}
.modal[open] {
  animation: modal-in 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.modal h2 {
  font-family: Georgia, serif;
  font-size: 38px;
  letter-spacing: -1px;
  line-height: 1.15;
  font-weight: 400;
  margin: 12px 0 15px;
}
.modal h2 em {
  color: #a26344;
  font-weight: 400;
}
.modal .eyebrow {
  color: #92907c;
  font-size: 8px;
}
.modal > p:not(.eyebrow) {
  font-size: 12px;
  line-height: 1.8;
  color: #7e8574;
}
.modal-close {
  position: absolute;
  right: 15px;
  top: 15px;
  border: 0;
  font-size: 25px;
}
.rules-list {
  padding: 0;
  list-style: none;
  margin: 23px 0;
}
.rules-list li {
  display: flex;
  gap: 15px;
  margin: 20px 0;
}
.rules-list li > span {
  font-size: 10px;
  color: #ab8258;
  padding-top: 4px;
}
.rules-list h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.rules-list p {
  font-size: 11px;
  line-height: 1.7;
  color: #7d8574;
}
.rule-example {
  font-size: 11px;
  line-height: 1.8;
  background: #eef0e3;
  padding: 13px;
  border-radius: 8px;
  color: #5f7452;
}
.modal .rule-end {
  font-size: 10px !important;
  margin: 15px 0 20px;
}
.gameover-modal {
  text-align: center;
}
.final-score {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.final-score > span:first-child {
  font-size: 8px;
  letter-spacing: 1.8px;
  color: #939581;
}
.final-score strong {
  font-size: 62px;
  font-weight: 500;
  letter-spacing: -3px;
  margin: 3px 0;
}
.final-score > span:last-child {
  font-size: 11px;
  color: #818972;
}
.positive {
  color: var(--win) !important;
}
.negative {
  color: var(--loss) !important;
}
.score-change.positive {
  color: #d2eaa9 !important;
}
.score-change.negative {
  color: #ffc3ab !important;
}
.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 25px 0;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.end-stats > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.end-stats > div + div {
  border-left: 1px solid var(--line);
}
.end-stats strong {
  font-size: 19px;
  font-weight: 500;
}
.end-stats span {
  font-size: 8px;
  color: #90947e;
}
.scorecard-details {
  text-align: left;
  margin-bottom: 22px;
}
.scorecard-details summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
}
.scorecard-scroll {
  overflow-x: auto;
}
.scorecard {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 10px;
  white-space: nowrap;
}
.scorecard th {
  text-align: left;
  font-size: 8px;
  color: #92957f;
  font-weight: 500;
}
.scorecard td,
.scorecard th {
  padding: 8px 4px;
  border-bottom: 1px solid #e8e9dc;
}
.scorecard td:last-child,
.scorecard th:last-child {
  text-align: right;
}
.scorecard-details p {
  font-size: 9px;
  line-height: 1.6;
  color: #888c78;
}
.review-button {
  border: 0;
  background: none;
  padding: 18px 0 0;
  font-size: 10px;
  color: #8e9380;
}
.review-button:hover {
  color: var(--ink);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.spark {
  position: absolute;
  width: 5px;
  height: 8px;
  border-radius: 1px;
  background: #dceba7;
  top: 0;
  left: 0;
}
.spark:nth-child(2n) {
  background: #efa775;
}
.spark:nth-child(3n) {
  background: #fff1c5;
}
@keyframes bag-arrive {
  from {
    opacity: 0;
    transform: translateY(20px) rotate(-6deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}
@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(32px) rotate(-65deg) scale(0.35);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-25deg) scale(1);
  }
}
@keyframes rays-in {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes trail-pop {
  from {
    transform: scale(0.6);
  }
  70% {
    transform: scale(1.12);
  }
  to {
    transform: scale(1);
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (min-width: 1500px) {
  .app {
    max-width: 1320px;
  }
  .topbar {
    height: 110px;
  }
  .intro {
    padding: 38px 0;
  }
  .bag-stage {
    min-height: 360px;
  }
  .bag-graphic {
    width: 267px;
    height: 285px;
    left: calc(50% - 133.5px);
    bottom: 49px;
  }
  .bet-panel {
    padding: 30px 32px 23px;
  }
  .color-card {
    min-height: 155px;
  }
  .flow-steps {
    margin: 25px 0 27px;
  }
  .wager-section {
    margin-top: 26px;
  }
  .bet-preview {
    margin-top: 26px;
  }
}
@media (max-width: 1050px) {
  .app {
    padding: 0 28px;
  }
  .header-note {
    display: none;
  }
  .intro h1 {
    font-size: 33px;
  }
  .intro > p {
    font-size: 11px;
  }
  .game-table {
    grid-template-columns: minmax(0, 1.25fr) minmax(325px, 1fr);
  }
  .bet-panel {
    padding: 23px 22px 18px;
  }
  .scoreboard {
    margin: 0 23px;
  }
  .score-change {
    display: none;
  }
  .trail-zone {
    margin: 0 23px;
  }
  .trail-cell {
    height: auto;
  }
  .trail-cell .bean {
    width: 18px;
    height: 21px;
  }
  .table-feedback {
    gap: 10px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .next-button {
    font-size: 10px;
    padding: 10px;
  }
  .table-feedback[data-result] p:first-child {
    font-size: 20px;
  }
  .best-score .label {
    font-size: 7px;
  }
  .bag-graphic {
    width: 232px;
    height: 247px;
    left: calc(50% - 116px);
  }
  .stage-topline {
    left: 23px;
    right: 23px;
  }
  .star-one {
    left: 16%;
  }
  .star-two {
    right: 13%;
  }
}
/* Keep the whole table within a typical laptop viewport. */
@media (min-width: 741px) and (max-height: 950px) {
  .topbar {
    height: 76px;
  }
  .intro {
    padding: 18px 0;
  }
  .bet-panel {
    padding-top: 19px;
    padding-bottom: 16px;
  }
  .flow-steps {
    margin: 14px 0 15px;
  }
  .color-card {
    min-height: 139px;
    padding-top: 13px;
    padding-bottom: 10px;
  }
  .wager-section {
    margin-top: 16px;
  }
  .bet-preview {
    margin-top: 16px;
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 68px;
  }
  .game-footer {
    padding: 9px 0 12px;
  }
}
@media (min-width: 741px) and (max-height: 800px) {
  .topbar {
    height: 64px;
  }
  .intro {
    padding: 17px 0;
  }
  .intro h1 {
    font-size: 32px;
  }
  .intro .eyebrow {
    margin-bottom: 5px;
  }
  .bet-panel {
    padding-top: 18px;
    padding-bottom: 13px;
  }
  .panel-heading h2 {
    font-size: 23px;
  }
  .flow-steps {
    margin: 15px 0;
  }
  .color-card {
    min-height: 125px;
    padding-top: 10px;
    padding-bottom: 9px;
  }
  .color-card .bean {
    width: 30px;
    height: 35px;
    margin-bottom: 6px;
  }
  .wager-section {
    margin-top: 15px;
  }
  .color-fieldset legend,
  .wager-section > label {
    margin-bottom: 9px;
  }
  .wager-row {
    height: 47px;
  }
  .bet-preview {
    margin-top: 15px;
    min-height: 63px;
    padding: 9px 13px;
  }
  .bet-footnote {
    padding-top: 10px;
  }
  .bag-stage {
    min-height: 300px;
  }
  .game-footer {
    padding-top: 9px;
    padding-bottom: 10px;
  }
}
.round-action .draw-button {
  width: 100%;
}

/* A viewport-sized phone game: flexible stage, thumb controls at the bottom.
   dvh follows browser chrome; safe-area padding clears notches/home indicators. */
@media (max-width: 740px), (max-width: 1000px) and (max-height: 500px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .app {
    width: 100%;
    max-width: 540px;
    height: 100vh;
    height: 100dvh;
    padding: env(safe-area-inset-top, 0px)
      max(10px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px))
      max(10px, env(safe-area-inset-left, 0px));
    display: flex;
    flex-direction: column;
  }
  .topbar {
    height: 48px;
    flex: 0 0 48px;
    border: 0;
    gap: 8px;
  }
  .brand {
    font-size: 23px;
    gap: 7px;
  }
  .brand-mark {
    transform: scale(0.8);
    width: 29px;
  }
  .topbar nav {
    gap: 2px;
  }
  .topbar .icon-button,
  .topbar .text-button {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    border: 0;
    flex-shrink: 0;
  }
  .help-icon {
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 18px;
  }
  #play-again-top {
    font-size: 25px;
  }
  .header-note,
  .help-text,
  .restart-text,
  .intro,
  .game-footer,
  .panel-heading,
  .bet-footnote,
  .trail-heading,
  .trail-note,
  .wager-slider {
    display: none;
  }
  .app > main {
    flex: 1;
    min-height: 0;
    display: flex;
  }
  .game-table {
    width: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    border-radius: 18px;
  }
  .table-side {
    min-height: 0;
    overflow: hidden;
  }
  .scoreboard {
    margin: 0 16px;
    padding: 9px 0 7px;
    gap: 8px;
    flex-shrink: 0;
  }
  .score-main strong {
    font-size: 28px;
  }
  .score-main > div {
    margin-top: 0;
  }
  .score-change {
    display: none;
  }
  .label {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .best-score .label {
    font-size: 7px;
    letter-spacing: 0.7px;
  }
  .best-score strong {
    font-size: 18px;
    margin-top: 1px;
  }
  .bag-stage {
    flex: 1;
    min-height: 0;
  }
  .stage-topline {
    top: 7px;
    left: 14px;
    right: 14px;
    font-size: 9px;
  }
  .round-badge {
    font-size: 8px;
    padding: 4px 6px;
  }
  .bag-graphic {
    height: calc(100% - 40px);
    max-height: 230px;
    width: auto;
    aspect-ratio: 300 / 320;
    left: 50%;
    translate: -50% 0;
    bottom: 24px;
  }
  .bag-shadow {
    width: 120px;
    height: 12px;
    bottom: 24px;
  }
  .bag-counts {
    bottom: 0;
    padding: 4px 12px;
    font-size: 10px;
    gap: 10px;
  }
  .bag-counts .bean {
    width: 10px;
    height: 12px;
  }
  .orbit-one {
    width: 180px;
    height: 180px;
  }
  .orbit-two {
    width: 270px;
    height: 270px;
  }
  .star-one {
    font-size: 16px;
    top: 35%;
  }
  .star-two {
    font-size: 20px;
  }
  .table-feedback {
    flex-shrink: 0;
    min-height: 0;
    padding: 5px 12px;
  }
  .table-feedback p:first-child {
    font-size: 15px;
    line-height: 1.25;
  }
  .table-feedback p + p {
    font-size: 10px;
    line-height: 1.3;
    margin-top: 2px;
  }
  .game-table[data-mode="bet"] .table-feedback,
  .game-table[data-mode="intro"] .table-feedback {
    display: none;
  }
  .table-feedback[data-result] p:first-child {
    font-size: 20px;
  }
  .trail-zone {
    flex-shrink: 0;
    padding: 6px 0 9px;
    margin: 0 16px;
    border: 0;
  }
  .trail {
    gap: 4px;
    justify-content: center;
  }
  .trail-cell {
    flex: 0 1 21px;
    width: 21px;
    height: 21px;
    font-size: 7px;
  }
  .trail-cell .bean {
    width: 12px;
    height: 14px;
  }
  .reveal-display {
    top: 48%;
    gap: 8px;
  }
  .reveal-display .bean {
    width: 42px;
    height: 50px;
  }
  .reveal-color {
    font-size: 9px;
  }
  .reveal-rays {
    width: 110px;
    height: 110px;
    top: -29px;
    left: calc(50% - 55px);
  }
  .bet-panel {
    padding: 10px 12px 12px;
    gap: 8px;
  }
  .flow-steps {
    margin: 0 0 2px;
  }
  .flow-steps li {
    font-size: 11px;
  }
  .flow-steps li > span {
    width: 18px;
    height: 18px;
  }
  .color-fieldset legend,
  .wager-section > label {
    margin-bottom: 5px;
    font-size: 11px;
  }
  .section-number {
    margin-right: 5px;
  }
  .color-cards {
    gap: 8px;
  }
  .color-card {
    min-height: 68px;
    padding: 9px 8px;
    display: grid;
    grid-template-columns: 26px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 7px;
    text-align: left;
    align-content: center;
    border-radius: 10px;
  }
  .color-card .bean {
    grid-row: 1 / 4;
    width: 22px;
    height: 27px;
    margin: 0;
  }
  .color-card > strong {
    font-size: 13px;
  }
  .card-odds {
    font-size: 10px;
    margin-top: 2px;
  }
  .card-return {
    width: auto;
    text-align: left;
    font-size: 9px;
    letter-spacing: 0;
    margin-top: 2px;
    padding: 0;
    border: 0;
  }
  .selection-check {
    right: 6px;
    top: 6px;
    width: 13px;
    height: 13px;
    font-size: 8px;
  }
  .wager-section {
    margin: 0;
  }
  .available {
    font-size: 10px;
  }
  .wager-row {
    height: 48px;
    padding: 1px;
  }
  .step-button {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }
  .wager-value input {
    height: 44px;
    font-size: 23px;
    width: 85px;
  }
  .chips {
    gap: 5px;
    margin-top: 6px;
  }
  .chip {
    min-width: 44px;
    height: 44px;
    padding: 0 3px;
    font-size: 11px;
  }
  .chip[data-amount="5"],
  .chip[data-amount="50"] {
    display: none;
  }
  .bet-preview {
    margin: 0;
    padding: 6px 10px;
    min-height: 49px;
  }
  .bet-preview > div:first-child > span {
    font-size: 8px;
    letter-spacing: 0.6px;
  }
  .bet-preview strong {
    font-size: 21px;
    margin-top: 1px;
  }
  .preview-detail {
    font-size: 10px;
    gap: 3px;
  }
  .preview-detail span + span {
    font-size: 10px;
  }
  .wager-message {
    min-height: 0;
    padding: 0;
    font-size: 11px;
  }
  .wager-message:empty {
    display: none;
  }
  .round-action {
    flex-shrink: 0;
  }
  .round-action .draw-button,
  .round-action .next-button {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    justify-content: space-between;
  }
  .round-action .next-button {
    background: var(--green);
    color: #fff9e9;
    border-color: var(--green);
  }
  .round-action .next-button:hover {
    background: #193d30;
  }
  .game-table[data-mode="outcome"] #pick-btn {
    display: none;
  }
  /* Once a wager is locked, give the reveal the space previously used to bet. */
  .game-table:is(
      [data-mode="drawing"],
      [data-mode="outcome"],
      [data-mode="drain"],
      [data-mode="gameover"]
    )
    .color-fieldset,
  .game-table:is(
      [data-mode="drawing"],
      [data-mode="outcome"],
      [data-mode="drain"],
      [data-mode="gameover"]
    )
    .wager-section {
    display: none;
  }
  .game-table[data-mode="outcome"] .reveal-display .bean {
    width: 62px;
    height: 74px;
  }
  .modal {
    padding: 24px 20px;
    max-height: calc(100dvh - 24px);
    overscroll-behavior: contain;
  }
  .modal-close {
    width: 44px;
    height: 44px;
    top: 5px;
    right: 5px;
  }
  .modal h2 {
    font-size: 30px;
  }
  .modal .draw-button {
    min-height: 48px;
  }
  .review-button,
  .scorecard-details summary {
    min-height: 44px;
  }
  .scorecard-details summary {
    align-items: center;
  }
  .final-score {
    margin-top: 12px;
  }
  .final-score strong {
    font-size: 48px;
  }
  .end-stats {
    margin: 14px 0;
    padding: 12px 0;
  }
  .scorecard-details {
    margin-bottom: 10px;
  }
  .app.is-editing-wager {
    height: var(--keyboard-height);
  }
  .is-editing-wager .game-table {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  .is-editing-wager .table-side,
  .is-editing-wager .color-fieldset,
  .is-editing-wager .flow-steps {
    display: none;
  }
  .is-editing-wager .bet-panel {
    justify-content: end;
  }
  .is-editing-wager .chips {
    display: none;
  }
  .is-editing-wager .wager-section {
    display: block;
  }
}
/* Short phones trade decorative space for the same full-size touch targets. */
@media (max-width: 740px) and (max-height: 650px) {
  .topbar {
    height: 44px;
    flex-basis: 44px;
  }
  .bet-panel {
    gap: 6px;
    padding: 8px 10px;
  }
  .flow-steps {
    display: none;
  }
  .scoreboard {
    padding: 6px 0 4px;
  }
  .score-main strong {
    font-size: 25px;
  }
  .table-feedback p + p {
    display: none;
  }
  .trail-zone {
    padding-top: 4px;
    padding-bottom: 7px;
  }
}
/* A rotated phone keeps the table beside the controls. */
@media (max-width: 740px) and (max-height: 600px) {
  .wager-section {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    column-gap: 6px;
  }
  .wager-section > label {
    grid-column: 1 / -1;
  }
  .chips {
    margin: 0;
    align-items: center;
  }
  .chip[data-amount="10"],
  .chip[data-amount="25"] {
    display: none;
  }
  .wager-value input {
    width: 44px;
  }
  .wager-value > span {
    display: none;
  }
  .step-button {
    flex-shrink: 0;
  }
}
@media (min-width: 500px) and (max-width: 1000px) and (max-height: 500px) {
  .app {
    max-width: none;
  }
  .game-table {
    grid-template-columns: minmax(0, 1fr) minmax(270px, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .bet-panel {
    gap: 5px;
    padding: 8px 10px;
    justify-content: end;
  }
  .flow-steps,
  .chips,
  .color-fieldset legend {
    display: none;
  }
  .wager-section {
    display: block;
  }
  .color-fieldset legend,
  .wager-section > label {
    margin-bottom: 3px;
  }
  .color-card {
    min-height: 60px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .bet-preview {
    min-height: 44px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .round-action .draw-button,
  .round-action .next-button {
    min-height: 48px;
  }
}
.mode-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #d9dece;
  border-radius: 24px;
  background: #ebeede;
  font-size: 12px;
  font-weight: 650;
  flex-shrink: 0;
}
.game-table[data-returning="true"] .bag-graphic {
  opacity: 1;
  filter: none;
}
.mode-button:hover {
  background: #dfe7d1;
}
.stats-button {
  background: none;
  border: 0;
  padding: 0 0 0 10px;
  min-height: 44px;
  min-width: 95px;
}
.stats-button:hover {
  filter: brightness(1.2);
}
.stats-button .pace-positive {
  color: #d2eaa9;
}
.stats-button .pace-negative {
  color: #ffc3ab;
}
.american-odds {
  font-size: 11px;
  font-weight: 650;
  color: #46634b;
  margin-top: 4px;
}
.card-return {
  margin-top: 5px;
  padding-top: 5px;
}
.mode-options {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}
.mode-option {
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: left;
  padding: 18px;
  border: 1px solid #d9dece;
  border-radius: 14px;
  background: #f1f3e7;
}
.mode-option:hover {
  background: #e7edda;
  border-color: #7b936e;
  transform: translateY(-2px);
}
.mode-symbol {
  width: 42px;
  font:
    italic 36px Georgia,
    serif;
  color: #a36641;
  flex-shrink: 0;
  text-align: center;
}
.mode-option strong {
  display: block;
  font-size: 18px;
}
.mode-option small {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  color: #74806b;
  margin: 5px 0 12px;
}
.mode-option b {
  font-size: 12px;
  color: #46634b;
}
.performance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
  margin: 18px 0;
}
.performance-grid > div {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.performance-grid strong {
  display: block;
  font-size: 23px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.performance-grid span {
  display: block;
  font-size: 10px;
  color: #74806b;
  margin-top: 3px;
}
.modal > p.metric-explainer {
  font-size: 11px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.stats-modal .review-button {
  display: block;
  margin: auto;
  min-height: 44px;
  padding-top: 8px;
}
.modal > p.final-performance {
  font-size: 11px;
  color: #46634b;
  margin: -4px 0 10px;
}
@media (max-width: 740px), (max-width: 1000px) and (max-height: 500px) {
  .topbar .brand > span:last-child {
    display: none;
  }
  .topbar .brand {
    width: 34px;
    flex-shrink: 0;
  }
  .topbar {
    gap: 8px;
  }
  .mode-button {
    font-size: 12px;
    padding: 0 11px;
    gap: 8px;
  }
  .color-card {
    grid-template-rows: repeat(4, auto);
    min-height: 76px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
  .color-card .bean {
    grid-row: 1 / 5;
  }
  .american-odds {
    font-size: 10px;
    margin-top: 2px;
  }
  .card-return {
    margin-top: 2px;
    padding: 0;
  }
  .stats-button strong {
    font-size: 21px;
  }
  .performance-grid {
    margin: 10px 0;
  }
  .performance-grid > div {
    padding: 7px 0;
  }
  .performance-grid strong {
    font-size: 21px;
  }
  .performance-grid span {
    font-size: 9px;
  }
  .stats-modal h2 {
    font-size: 28px;
    margin: 8px 0;
  }
  .modal > p.metric-explainer {
    font-size: 10px;
    margin-bottom: 9px;
  }
  .gameover-modal h2 {
    font-size: 28px;
    margin: 8px 0;
  }
  .gameover-modal .end-stats {
    margin: 10px 0;
  }
  .modal > p.final-performance {
    font-size: 10px;
    margin: 0 0 6px;
  }
}
@media (min-width: 500px) and (max-width: 1000px) and (max-height: 500px) {
  .color-card {
    min-height: 66px;
    padding: 3px 8px;
  }
}
/* A warm invitation to the next draw, with a steady highlight in reduced motion. */
.next-button,
.round-action .next-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(115deg, #bd572e, #d7783b 65%, #b95428);
  border: 1px solid #ffcd87;
  color: #fffaf0;
  font-weight: 750;
  box-shadow:
    0 3px 0 #914021,
    0 0 0 3px #edb77024,
    0 5px 20px #e9a65b55;
}
.next-cluster:not([hidden]) .next-button:not(:disabled) {
  animation:
    next-arrive 0.45s cubic-bezier(0.2, 1.5, 0.5, 1) both,
    next-glow 2.6s ease-in-out 0.5s infinite;
}
.next-button::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 25%,
    #fff0c954 50%,
    transparent 75%
  );
  transform: translateX(-140%);
}
.next-button:not([hidden]):not(:disabled)::before {
  animation: next-shimmer 3.2s ease-in-out 0.8s infinite;
}
.next-button > span {
  position: relative;
}
.next-arrow {
  font-size: 21px;
  line-height: 1;
}
.next-button:not([hidden]):not(:disabled) .next-arrow {
  animation: next-arrow-nudge 2.6s ease-in-out 0.5s infinite;
}
.next-button:hover,
.round-action .next-button:hover {
  background: linear-gradient(115deg, #ac4924, #cb692f 65%, #a74620);
}
.next-button:disabled {
  animation: none;
}
@keyframes next-arrive {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes next-glow {
  0%,
  100% {
    box-shadow:
      0 3px 0 #914021,
      0 0 0 3px #edb77024,
      0 5px 16px #e9a65b44;
  }
  50% {
    box-shadow:
      0 3px 0 #914021,
      0 0 0 5px #edb77038,
      0 5px 27px #e9a65b88;
  }
}
@keyframes next-shimmer {
  0%,
  30% {
    transform: translateX(-140%);
  }
  70%,
  100% {
    transform: translateX(140%);
  }
}
@keyframes next-arrow-nudge {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(3px, -2px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bag-graphic {
    will-change: auto;
  }
}
/* The run drawn as a line: a dashed opening score, the path the score took,
   and markers on the high point and the finish. Colour follows the outcome. */
.run-graph {
  margin: 22px 0 4px;
  padding: 0;
  color: var(--win);
}
.run-graph[data-trend="down"] {
  color: var(--loss);
}
.run-graph[data-trend="flat"] {
  color: #8d9382;
}
.run-graph-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 8px;
  letter-spacing: 1.8px;
  color: #939581;
}
#run-graph-legend {
  font-size: 9px;
  letter-spacing: 0.3px;
  color: #8b8f7b;
  white-space: nowrap;
}
.run-graph svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 7px;
  overflow: visible;
}
.run-graph-base {
  stroke: #c8cab6;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.run-graph-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.run-graph-dots circle {
  fill: currentColor;
  stroke: var(--card);
  stroke-width: 1.6;
  opacity: 0.85;
}
.run-graph-peak {
  fill: var(--card);
  stroke: #c8a44c;
  stroke-width: 2;
}
.run-graph-end {
  fill: currentColor;
  stroke: var(--card);
  stroke-width: 3;
}
/* Re-applied each time the dialog opens, so the line redraws every run. */
.gameover-modal[open] .run-graph-line {
  animation: run-graph-draw 0.9s cubic-bezier(0.3, 0.7, 0.3, 1) 0.1s backwards;
}
.gameover-modal[open] .run-graph-area {
  animation: run-graph-fade 0.6s ease-out 0.85s backwards;
}
.gameover-modal[open] .run-graph-dots {
  animation: run-graph-fade 0.5s ease-out 1s backwards;
}
.gameover-modal[open] .run-graph-end,
.gameover-modal[open] .run-graph-peak {
  animation: run-graph-pop 0.4s cubic-bezier(0.2, 1.6, 0.5, 1) 1.05s backwards;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes run-graph-draw {
  from {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
  }
  to {
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
  }
}
@keyframes run-graph-fade {
  from {
    opacity: 0;
  }
}
@keyframes run-graph-pop {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
}
/* The invitation to play again: big, warm, and unmistakably the way onward. */
.play-again-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-height: 78px;
  padding: 14px 20px;
  border: 2px solid #ffd489;
  border-radius: 16px;
  background: linear-gradient(
    118deg,
    #8b3fa8 0%,
    #c94b6a 26%,
    #e0793a 52%,
    #f2b141 74%,
    #b6449c 100%
  );
  background-size: 260% 100%;
  color: #fffaf0;
  text-shadow: 0 1px 2px #6c2a1e5c;
  box-shadow:
    0 4px 0 #8f3f57,
    0 0 0 4px #f4c07a2e,
    0 10px 30px #d0705c66;
}
.play-again-label {
  position: relative;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.1;
}
.play-again-sub {
  position: relative;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: #fff3d0;
}
.play-again-sub span {
  color: #ffe8ac;
}
.play-again-button:focus-visible {
  outline-color: #ffd489;
}
.play-again-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 0 #8f3f57,
    0 0 0 6px #f4c07a45,
    0 14px 38px #d0705c88;
}
.play-again-button:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 #8f3f57,
    0 0 0 4px #f4c07a2e,
    0 6px 18px #d0705c55;
}
/* The shimmer sweep, over the gradient but under the label. */
.play-again-button::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 30%,
    #fff5d980 50%,
    transparent 70%
  );
  transform: translateX(-140%);
}
.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sparkles i {
  position: absolute;
  width: 13px;
  height: 13px;
  background: #fff6d8;
  clip-path: polygon(
    50% 0%,
    60% 40%,
    100% 50%,
    60% 60%,
    50% 100%,
    40% 60%,
    0% 50%,
    40% 40%
  );
  opacity: 0.85;
}
.sparkles i:nth-child(1) {
  top: 14%;
  left: 8%;
}
.sparkles i:nth-child(2) {
  top: 62%;
  left: 17%;
  width: 9px;
  height: 9px;
}
.sparkles i:nth-child(3) {
  top: 20%;
  left: 30%;
  width: 8px;
  height: 8px;
}
.sparkles i:nth-child(4) {
  top: 70%;
  left: 43%;
  width: 11px;
  height: 11px;
}
.sparkles i:nth-child(5) {
  top: 12%;
  left: 62%;
  width: 10px;
  height: 10px;
}
.sparkles i:nth-child(6) {
  top: 66%;
  left: 74%;
}
.sparkles i:nth-child(7) {
  top: 26%;
  left: 87%;
  width: 9px;
  height: 9px;
}
.sparkles i:nth-child(8) {
  top: 78%;
  left: 92%;
  width: 8px;
  height: 8px;
}
.gameover-modal[open] .play-again-button {
  animation:
    play-again-arrive 0.5s cubic-bezier(0.2, 1.5, 0.5, 1) 0.15s backwards,
    play-again-drift 7s linear 0.6s infinite,
    play-again-glow 2.4s ease-in-out 0.6s infinite;
}
.gameover-modal[open] .play-again-button::before {
  animation: play-again-shimmer 3s ease-in-out 1s infinite;
}
.gameover-modal[open] .sparkles i {
  animation: sparkle-twinkle 2.2s ease-in-out infinite;
}
.sparkles i:nth-child(2) {
  animation-delay: 0.9s;
}
.sparkles i:nth-child(3) {
  animation-delay: 1.5s;
}
.sparkles i:nth-child(4) {
  animation-delay: 0.4s;
}
.sparkles i:nth-child(5) {
  animation-delay: 1.8s;
}
.sparkles i:nth-child(6) {
  animation-delay: 1.1s;
}
.sparkles i:nth-child(7) {
  animation-delay: 0.6s;
}
.sparkles i:nth-child(8) {
  animation-delay: 2s;
}
@keyframes play-again-arrive {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
}
@keyframes play-again-drift {
  to {
    background-position: 260% 0;
  }
}
@keyframes play-again-glow {
  0%,
  100% {
    box-shadow:
      0 4px 0 #8f3f57,
      0 0 0 4px #f4c07a2e,
      0 10px 26px #d0705c55;
  }
  50% {
    box-shadow:
      0 4px 0 #8f3f57,
      0 0 0 7px #f4c07a4d,
      0 12px 40px #e0854c99;
  }
}
@keyframes play-again-shimmer {
  0%,
  35% {
    transform: translateX(-140%);
  }
  75%,
  100% {
    transform: translateX(140%);
  }
}
@keyframes sparkle-twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.3) rotate(0deg);
  }
  15% {
    opacity: 1;
    transform: scale(1.15) rotate(35deg);
  }
  40% {
    opacity: 0.25;
    transform: scale(0.7) rotate(80deg);
  }
}
@media (max-width: 740px), (max-width: 1000px) and (max-height: 500px) {
  .run-graph {
    margin: 12px 0 2px;
  }
  #run-graph-legend {
    font-size: 8px;
  }
  .play-again-button {
    min-height: 68px;
    padding: 12px 16px;
  }
  .play-again-label {
    font-size: 23px;
  }
  .play-again-sub {
    font-size: 11px;
    letter-spacing: 2px;
  }
}
/* One decision at a time. The colour cards hold the panel on their own until
   a colour is picked; the wager then unfolds beneath them, and the draw
   button arrives last. Nothing appears or vanishes without moving. */
.stage-reveal {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 0.45s cubic-bezier(0.2, 0.8, 0.3, 1),
    opacity 0.35s ease 0.08s;
}
.stage-reveal-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  /* Room for focus rings without adding height to the collapsed state. */
  padding-inline: 6px;
  margin-inline: -6px;
}
.game-table[data-stage="choose"] .stage-reveal {
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.6, 1),
    opacity 0.2s ease;
}
.color-fieldset legend {
  transition:
    font-size 0.4s cubic-bezier(0.2, 0.8, 0.3, 1),
    color 0.3s;
}
.game-table[data-stage="choose"] .color-fieldset legend {
  font-size: 16px;
  color: var(--ink);
}
.color-card {
  transition:
    min-height 0.45s cubic-bezier(0.2, 0.8, 0.3, 1),
    padding 0.45s cubic-bezier(0.2, 0.8, 0.3, 1),
    background 0.18s,
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s,
    opacity 0.18s;
}
/* With the panel to itself, the choice takes the room it has (to a point). */
.game-table[data-stage="choose"] .color-fieldset {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.game-table[data-stage="choose"] .color-cards {
  flex: 1 1 auto;
  max-height: 240px;
}
.game-table[data-stage="choose"] .color-card {
  min-height: 172px;
  padding: 24px 8px 18px;
  justify-content: center;
}
.game-table[data-stage="choose"] .color-card .bean {
  animation: card-invite 3.4s ease-in-out infinite;
}
.game-table[data-stage="choose"] #card-black .bean {
  animation-delay: 1.7s;
}
.color-card:hover:not(:disabled) .bean,
.color-card.is-selected .bean {
  animation: none;
}
/* Until a colour is chosen the draw button has nothing to say, so it folds
   away rather than sitting there greyed out. */
#pick-btn {
  overflow: hidden;
  max-height: 120px;
  transition:
    max-height 0.42s cubic-bezier(0.2, 0.8, 0.3, 1),
    min-height 0.42s cubic-bezier(0.2, 0.8, 0.3, 1),
    padding 0.42s cubic-bezier(0.2, 0.8, 0.3, 1),
    opacity 0.28s ease,
    background 0.18s,
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
.game-table[data-stage="choose"] #pick-btn {
  max-height: 0;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
  opacity: 0;
  box-shadow: none;
}
.game-table[data-stage="wager"] .wager-section {
  animation: stage-rise 0.42s cubic-bezier(0.2, 0.8, 0.3, 1) 0.08s backwards;
}
.game-table[data-stage="wager"] .bet-preview {
  animation: stage-rise 0.42s cubic-bezier(0.2, 0.8, 0.3, 1) 0.16s backwards;
}
.game-table[data-stage="wager"] #pick-btn {
  animation: stage-rise 0.42s cubic-bezier(0.2, 0.8, 0.3, 1) 0.24s backwards;
}
@keyframes stage-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes card-invite {
  0%,
  70%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  35% {
    transform: translateY(-4px) rotate(-6deg);
  }
}
@media (max-width: 740px), (max-width: 1000px) and (max-height: 500px) {
  .game-table[data-stage="choose"] .color-fieldset legend {
    font-size: 15px;
    margin-bottom: 9px;
  }
  .game-table[data-stage="choose"] .color-card {
    min-height: 112px;
    padding: 14px 10px;
    grid-template-columns: 34px 1fr;
    column-gap: 11px;
  }
  .game-table[data-stage="choose"] .color-card .bean {
    width: 30px;
    height: 37px;
  }
  .game-table[data-stage="choose"] .color-card > strong {
    font-size: 15px;
  }
}

/* --- Auto-advance ------------------------------------------------------- */
.next-cluster {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.auto-next {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #a9b5a1;
  user-select: none;
  transition: color 0.18s;
}
.auto-next:hover {
  color: #dbe4d2;
}
.auto-next input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.auto-next-box {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1px solid #d5e6b755;
  background: #d8e6c614;
  display: grid;
  place-items: center;
  transition:
    background 0.18s,
    border-color 0.18s;
}
.auto-next-box::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #cfe6a3;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.auto-next input:checked + .auto-next-box {
  border-color: #cfe6a3aa;
  background: #cfe6a32e;
}
.auto-next input:checked + .auto-next-box::after {
  transform: scale(1);
}
.auto-next input:focus-visible + .auto-next-box {
  outline: 3px solid #cf7349;
  outline-offset: 3px;
}
/* The wait, drawn as a ring that empties. It only exists while armed, so the
   button keeps its normal width when the next round is a plain click. */
.next-countdown {
  display: none;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}
.next-cluster.is-counting .next-countdown {
  display: block;
}
.next-countdown svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}
.next-countdown-ring {
  fill: none;
  stroke: #ffe6bd;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  opacity: 0.85;
}
.next-cluster.is-counting .next-countdown-ring {
  animation: countdown-drain var(--countdown, 3000ms) linear forwards;
}
@keyframes countdown-drain {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: 100;
  }
}
@media (max-width: 740px), (max-width: 1000px) and (max-height: 500px) {
  .next-cluster {
    width: 100%;
    gap: 9px;
  }
  /* On phones this sits on the pale panel, not the dark table, so it needs
     the ink colours rather than the ones that read against deep green. */
  .auto-next {
    font-size: 11px;
    color: #5f6a59;
  }
  .auto-next:hover {
    color: var(--ink);
  }
  .auto-next-box {
    border-color: #2c4b3d55;
    background: #2c4b3d0f;
  }
  .auto-next input:checked + .auto-next-box {
    border-color: var(--green);
    background: var(--green);
  }
  .auto-next input:checked + .auto-next-box::after {
    background: #eaf3dd;
  }
}
/* The ring is information, not decoration: it must still run the full wait
   when animation is otherwise switched off. */
@media (prefers-reduced-motion: reduce) {
  .next-cluster.is-counting .next-countdown-ring {
    animation-duration: var(--countdown, 3000ms) !important;
  }
}
