.game-demo {
  --game-tint: #214478;
  --game-highlight: #9bd2ff;
  padding: clamp(12px, 3vw, 26px);
  border-radius: 20px;
  background: linear-gradient(150deg, var(--game-tint), #081831 72%);
  color: #f7faff;
  box-shadow: 0 16px 36px #0a244437;
}

.game-demo[data-game="baccarat"] {
  --game-tint: #205759;
  --game-highlight: #99e9d8;
}

.game-demo[data-game="slots"] {
  --game-tint: #46336b;
  --game-highlight: #f3c8ff;
}

.game-demo[data-game="dice"] {
  --game-tint: #4d3044;
  --game-highlight: #ffce9e;
}

.game-playfield {
  display: grid;
  gap: 18px;
  padding: clamp(12px, 3vw, 26px);
  border: 1px solid #e6f5ff30;
  border-radius: 14px;
  background: #07182b59;
}

.game-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.game-controls button,
.game-number-grid button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
}

.game-controls button {
  padding: 8px 18px;
}

.game-action {
  background: var(--orange, #f5a323);
  color: #142135;
}

.game-action:not(:disabled):hover {
  background: #ffbf60;
}

.game-action:disabled {
  border-color: #e6f5ff30;
  background: #54627b;
  color: #eef3fb;
  cursor: default;
}

.game-controls .game-reset {
  border-color: #e6f5ff52;
  background: #dff1ff12;
  color: #fff;
}

.game-reset:hover {
  background: #dff1ff23;
}

.game-demo button:focus-visible {
  outline: 3px solid var(--game-highlight);
  outline-offset: 3px;
}

.game-demo .game-status {
  min-height: 3.15em;
  margin: 12px 0 0;
  color: #e5eefc;
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: center;
}

.game-demo[data-game="baccarat"] .game-playfield {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 18px);
}

.game-hand {
  min-width: 0;
  padding: clamp(8px, 2vw, 16px);
  border: 1px solid #e8fbff28;
  border-radius: 12px;
  background: #e3fff60a;
}

.game-hand-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 2px 12px;
  margin-bottom: 12px;
  font-size: 0.875rem;
}

.game-hand-score {
  color: var(--game-highlight);
  font-size: 1.125rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.game-hand-cards {
  display: flex;
  justify-content: center;
  gap: clamp(5px, 1.5vw, 10px);
}

.game-card {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(34px, 11vw, 65px);
  max-width: calc(50% - 4px);
  aspect-ratio: 3 / 4;
  border: 1px solid #eaf4ffb3;
  border-radius: 7px;
  background: linear-gradient(155deg, #fff, #e8f2ff);
  box-shadow: 0 5px 14px #06102559;
  color: #172244;
  line-height: 1;
}

.game-card[data-color="red"] {
  color: #ab1839;
}

.game-card-rank {
  position: absolute;
  top: 8%;
  left: 12%;
  font-size: clamp(0.65rem, 2vw, 0.875rem);
  font-weight: 900;
}

.game-card-suit {
  padding-top: 12%;
  font-size: clamp(1.25rem, 4vw, 2rem);
}

.game-card-back {
  border: 3px solid #d9efff;
  background: repeating-linear-gradient(45deg, #294775 0 3px, #345783 3px 6px);
}

.game-reels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1.7vw, 14px);
  width: min(100%, 500px);
  margin-inline: auto;
  padding: clamp(6px, 1.6vw, 12px);
  border: 1px solid #e0c2fb64;
  border-radius: 12px;
  background: #130d2ea6;
}

.game-reel {
  display: flex;
  min-width: 0;
  min-height: clamp(68px, 13vw, 104px);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  border: 1px solid #d7c0f364;
  border-radius: 7px;
  background: linear-gradient(#eee8ff, #fff 50%, #e8e2f7);
  color: #412a65;
  text-align: center;
}

.game-reel-match {
  border-color: #ffa830;
  box-shadow: inset 0 0 0 2px #f8b246;
}

.game-reel-symbol {
  font-size: clamp(1.45rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1;
}

.game-reel-name {
  padding-inline: 2px;
  color: #453957;
  font-size: clamp(0.6rem, 1.6vw, 0.75rem);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.game-reel[data-color="ruby"] { color: #b72541; }
.game-reel[data-color="gold"] { color: #8f5800; }
.game-reel[data-color="sky"] { color: #1e5aa9; }
.game-reel[data-color="mint"] { color: #18735b; }
.game-reel[data-color="lilac"] { color: #7731a8; }

.game-dice {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2vw, 16px);
}

.game-die {
  display: grid;
  width: clamp(46px, 16vw, 76px);
  max-width: calc(33.33% - 8px);
  aspect-ratio: 1;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  place-items: center;
  padding: clamp(6px, 1.7vw, 11px);
  border: 1px solid #ffd9d4;
  border-radius: 12px;
  background: linear-gradient(140deg, #fff, #f4e7ee);
  box-shadow: 0 5px 12px #080e2991;
  color: #642442;
  font-weight: 900;
}

.game-die-empty {
  grid-template: 1fr / 1fr;
}

.game-pip {
  width: 70%;
  aspect-ratio: 1;
  grid-row: var(--pip-row);
  grid-column: var(--pip-column);
  border-radius: 50%;
  background: #692346;
}

.game-dice-total {
  justify-self: center;
  padding: 4px 14px;
  border: 1px solid #ffe0c459;
  border-radius: 12px;
  color: var(--game-highlight);
  font-size: 0.875rem;
}

.game-dice-total strong {
  margin-left: 6px;
  color: #fff;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.game-number-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.875rem;
}

.game-number-heading span {
  color: var(--game-highlight);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.game-number-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.game-number-grid button {
  border-color: #b4d0ff51;
  background: #cbe3ff14;
  color: #f1f8ff;
  font-variant-numeric: tabular-nums;
}

.game-number-grid button:hover {
  border-color: #b4d0ffac;
}

.game-number-grid button[aria-pressed="true"] {
  border-color: #a5cfff;
  background: #bde0ff;
  color: #142d54;
}

.game-lottery-result {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #d8eaff38;
  font-size: 0.875rem;
}

.game-lottery-result[hidden] {
  display: none;
}

.game-lottery-result > div {
  display: grid;
  grid-template-columns: 7em 1fr;
  align-items: center;
  gap: 8px;
}

.game-draw-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.game-draw-number {
  display: grid;
  place-items: center;
  width: 1.85rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #d8e8ff;
  color: #143051;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.game-number-match {
  background: #ffcf78;
  box-shadow: 0 0 0 1px #ffcf78;
}

.game-reveal {
  animation: game-reveal 160ms ease-out;
}

@keyframes game-reveal {
  from { opacity: 0.65; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 540px) {
  .game-number-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .game-hand-heading {
    font-size: 0.8rem;
  }
}

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