:root {
  color-scheme: dark;
  --page: #252220;
  --wood: #3b2014;
  --wood-dark: #21110b;
  --felt: #0f5d50;
  --felt-dark: #073c39;
  --felt-light: #168a74;
  --paper: #f3e4c8;
  --paper-soft: #fff6e4;
  --ink: #fff8e7;
  --muted: #cdbf9e;
  --gold: #d9a83d;
  --gold-bright: #ffd46e;
  --red: #b62f31;
  --blue: #28507c;
  --green: #43d18b;
  --line: rgba(255, 246, 228, 0.2);
  --shadow: rgba(0, 0, 0, 0.38);
  --app-font-family: "Geist Mono", Consolas, monospace;
  --ion-font-family: var(--app-font-family);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--app-font-family);
}

body {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--app-font-family);
  color: var(--ink);
}

ion-app {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

ion-content {
  --overflow: hidden;
}

ion-content::part(scroll) {
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: none;
}

ion-app,
ion-content,
ion-content::part(scroll),
input,
button,
select,
textarea {
  --ion-font-family: var(--app-font-family);
  font-family: var(--app-font-family) !important;
}

button {
  font: inherit;
}

.sakla-viewport {
  position: absolute;
  inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  overflow: hidden;
}

.sakla-canvas {
  --sakla-design-width: 411px;
  --sakla-design-height: 823px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--sakla-design-width);
  height: var(--sakla-design-height);
  overflow: hidden;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(var(--sakla-scale, 1));
  transform-origin: center;
}

.sakla-canvas.is-fitted {
  visibility: visible;
}

.socket-reconnect-modal {
  position: absolute;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.48);
}

.socket-reconnect-modal.is-open {
  display: flex;
}

.socket-reconnect-dialog {
  width: auto;
  min-width: 170px;
  max-width: min(360px, 100%);
  padding: 8px 12px;
  border: 1px solid rgba(255, 246, 228, 0.22);
  border-radius: 8px;
  background: rgba(255, 248, 231, 0.96);
  color: #15191e;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: left;
  flex-wrap: wrap;
}

.socket-reconnect-dialog .material-symbols-rounded {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(67, 209, 139, 0.18);
  color: #129c60;
  font-size: 16px;
  animation: socket-spin 1s linear infinite;
}

.socket-reconnect-dialog strong {
  display: inline;
  margin-top: 0;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.socket-reconnect-dialog p {
  display: none;
  margin: 0;
  color: #718096;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.socket-relogin-button {
  display: inline-flex;
  min-width: 118px;
  height: 34px;
  margin: 2px auto 0;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: #129c60;
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  cursor: pointer;
}

.socket-relogin-button[hidden] {
  display: none;
}

.socket-relogin-button:hover {
  filter: brightness(0.96);
}

@keyframes socket-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes win-result-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.sakla-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
}

.sakla-machine {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 212, 110, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(76, 41, 24, 0.96), rgba(17, 58, 53, 0.96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.live-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 212, 110, 0.18), transparent 24%),
    linear-gradient(180deg, #432516, #0a3836 42%, #31170f);
}

.video-window {
  position: absolute;
  inset: 58px 0 78px;
  overflow: hidden;
  border-top: 1px solid rgba(255, 224, 160, 0.28);
  border-bottom: 1px solid rgba(255, 224, 160, 0.28);
  background: #110b08;
}

.video-window::before,
.video-window::after {
  content: "";
  position: absolute;
  z-index: 9999;
  left: 0;
  right: 0;
  height: 22px;
  pointer-events: none;
}

.video-window::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent);
}

.video-window::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.34), transparent);
}

.preview-frame,
.live-video,
.stage-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.preview-frame {
  inset: auto;
  top: 50%;
  left: 50%;
  z-index: 0;
  border: 0;
  background: #110b08;
  pointer-events: none;
  cursor: default;
  transform: translate(-50%, -50%) scale(1.60);
  transform-origin: center center;
}

.preview-frame[hidden] {
  display: none;
}

.live-video {
  z-index: 1;
  object-fit: cover;
  background: #110b08;
}

.live-video:not([src]) {
  display: none;
}

.stage-scene {
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #064f40;
}

.stage-scene[hidden] {
  display: none;
}

.preview-connect-status {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: calc(100% - 28px);
  padding: 6px 11px;
  border: 1px solid rgba(255, 212, 110, 0.46);
  border-radius: 999px;
  background: rgba(33, 17, 11, 0.82);
  color: #fff0ad;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  white-space: nowrap;
}

.preview-connect-status[hidden] {
  display: none;
}

.preview-connect-status::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #20d47d;
  box-shadow: 0 0 0 rgba(32, 212, 125, 0.48);
  animation: preview-connect-pulse 1s ease-in-out infinite;
}

@keyframes preview-connect-pulse {
  0%,
  100% {
    opacity: 0.62;
    box-shadow: 0 0 0 rgba(32, 212, 125, 0.28);
  }

  50% {
    opacity: 1;
    box-shadow: 0 0 10px rgba(32, 212, 125, 0.72);
  }
}

.win-result-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 10020;
  display: none;
  min-width: 154px;
  padding: 11px 14px 12px;
  border: 1px solid rgba(255, 212, 110, 0.72);
  border-radius: 8px;
  background: rgba(40, 18, 10, 0.84);
  color: var(--gold-bright);
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.win-result-overlay.is-open {
  display: grid;
  gap: 5px;
  animation: win-result-pop 0.22s ease-out;
}

.win-result-overlay strong {
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.win-result-overlay span {
  color: var(--gold-bright);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.stage-table-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-34px);
}

.stage-fan {
  position: relative;
  width: 230px;
  height: 170px;
}

.stage-card {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 74px;
  aspect-ratio: 107 / 165;
  border-radius: 5px;
  object-fit: cover;
  transform-origin: 50% 100%;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.42);
}

.stage-card:nth-child(1) {
  transform: translateX(-112%) rotate(-23deg);
}

.stage-card:nth-child(2) {
  transform: translateX(-78%) rotate(-11deg);
}

.stage-card:nth-child(3) {
  transform: translateX(-50%) rotate(0deg);
}

.stage-card:nth-child(4) {
  transform: translateX(-22%) rotate(11deg);
}

.stage-card:nth-child(5) {
  transform: translateX(12%) rotate(23deg);
}

.dealer-nameplate {
  position: relative;
  min-width: 148px;
  margin-top: -36px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 212, 110, 0.42);
  border-radius: 7px;
  background: rgba(33, 17, 11, 0.82);
  text-align: center;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.32);
}

.dealer-nameplate span,
.dealer-nameplate strong {
  display: block;
}

.dealer-nameplate span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.dealer-nameplate strong {
  color: var(--gold-bright);
  font-size: 24px;
}

.stage-overlay {
  position: absolute;
  z-index: 9999;
  left: 0;
  right: 0;
}

.stage-overlay-top {
  top: 0;
  z-index: 9999;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 7px 10px;
}

.stage-overlay-top,
.recent-results-header {
  background: linear-gradient(180deg, rgba(59, 32, 20, 0.96), rgba(59, 32, 20, 0.8), rgba(59, 32, 20, 0));
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.22);
}

.stage-overlay-top::after,
.recent-results-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -20px;
  height: 20px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent);
}

.round-timer {
  position: absolute;
  top: calc(100% + 10px);
  right: 10px;
  z-index: 9999;
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(33, 17, 11, 0.94) 0 55%, transparent 57%),
    conic-gradient(from -90deg, var(--gold-bright) 0deg var(--timer-angle, 360deg), var(--red) var(--timer-angle, 360deg) 360deg);
  color: #ffffff;
  font-size: 30px;
  font-weight: 900;
  box-shadow:
    inset 0 0 0 2px rgba(255, 248, 231, 0.12),
    0 8px 22px rgba(0, 0, 0, 0.34);
  transition: background 0.35s linear;
}

.round-timer[hidden] {
  display: none;
}

.bet-status-banner {
  position: absolute;
  top: 68px;
  left: 0;
  right: 10px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 12px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.bet-status-banner.is-open {
  color: #43d18b;
}

.bet-status-banner.is-closed {
  color: #ff4d4d;
}

.bet-status-banner[hidden] {
  display: none;
}

.bet-status-banner .material-symbols-rounded,
.bet-status-banner strong {
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 12px;
}

.player-bet-id {
  position: absolute;
  top: 68px;
  left: 10px;
  z-index: 9999;
  max-width: 58%;
  overflow: hidden;
  color: rgba(255, 248, 231, 0.72);
  font-size: 10px;
  font-weight: 600;
  line-height: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.player-bet-id[hidden] {
  display: none;
}

.player-broadcast-marquee {
  position: relative;
  z-index: 9999;
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  pointer-events: none;
}

.player-broadcast-marquee.is-card-mode {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}

.player-broadcast-marquee.is-default-mode {
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-broadcast-marquee[hidden] {
  display: none;
}

.player-broadcast-card {
  flex: 0 0 auto;
  width: auto;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}

.player-broadcast-marquee-track {
  position: absolute;
  top: 0;
  left: 100%;
  white-space: nowrap;
  color: var(--gold-bright);
  font-size: 34px;
  font-weight: 900;
  line-height: 42px;
  text-shadow: 1px 2px 0 rgba(123, 27, 22, 0.75);
  animation: player-marquee-right-left 12s linear infinite;
}

.player-broadcast-default {
  display: block;
  width: 100%;
  color: var(--gold-bright);
  font-size: 30px;
  font-weight: 900;
  line-height: 42px;
  text-align: center;
  text-shadow: 1px 2px 0 rgba(123, 27, 22, 0.75);
  animation: player-default-blink 1.8s ease-in-out infinite;
}

@keyframes player-default-blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.42;
  }
}

@keyframes player-marquee-right-left {
  0% {
    left: 100%;
    transform: translateX(0);
  }

  100% {
    left: 0;
    transform: translateX(-100%);
  }
}

.stage-overlay-bottom {
  bottom: 0;
  height: 78px;
  min-height: 78px;
  display: flex;
  align-items: center;
  padding: 8px;
  overflow: hidden;
  background: linear-gradient(0deg, rgba(59, 32, 20, 0.96), rgba(59, 32, 20, 0.78), rgba(59, 32, 20, 0));
}

.recent-winner-strip {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  border: 1px solid rgba(255, 212, 110, 0.28);
  border-radius: 8px;
  background: rgba(33, 17, 11, 0.76);
}

.recent-results-toggle {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 1px solid #d9ac59;
  border-radius: 6px;
  background: linear-gradient(180deg, #855325 0%, #573219 48%, #35200f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 164, 0.42),
    inset 0 -1px 0 rgba(20, 10, 4, 0.55),
    0 3px 0 #180e07,
    0 4px 6px rgba(0, 0, 0, 0.4);
  color: var(--gold-bright);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

@media (hover: hover) and (pointer: fine) {
  .recent-results-toggle:not(:disabled):hover {
    border-color: #ffe09b;
    background: linear-gradient(180deg, #9b652e 0%, #684020 48%, #432813 100%);
  }
}

.recent-results-toggle:not(:disabled):active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 4px rgba(20, 10, 4, 0.4),
    0 1px 0 #180e07;
}

.recent-results-toggle > strong {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff0ad;
  font-size: 16px;
  font-style: italic;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-shadow: 1px 2px 0 #7b1b16;
}

.recent-results-toggle:disabled {
  opacity: 0.65;
  cursor: wait;
}

.recent-results-toggle[aria-busy="true"] > strong {
  font-size: 12px;
}

.top-bet-list {
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.top-bet-list::-webkit-scrollbar {
  display: none;
}

.recent-winner-item {
  position: relative;
  flex: 0 0 56px;
  min-width: 56px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 210, 93, 0.58);
  border-radius: 10px;
  background:
    radial-gradient(circle at 52% 0, rgba(255, 226, 145, 0.16), transparent 45%),
    linear-gradient(145deg, rgba(28, 113, 86, 0.96), rgba(3, 47, 40, 0.98) 72%),
    #063c34;
  box-shadow: inset 0 0 0 1px rgba(255, 246, 228, 0.08), inset 0 0 16px rgba(0, 21, 18, 0.44), inset 0 -8px 18px rgba(0, 20, 18, 0.28), 0 4px 9px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.recent-winner-cards {
  position: absolute;
  left: calc(50% + 1px);
  bottom: 0;
  width: 50px;
  height: 100%;
  overflow: hidden;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 20%, rgba(255, 226, 145, 0.08), transparent 46%);
}

.recent-winner-cards img {
  position: absolute;
  top: 12px;
  width: auto;
  height: calc(100% + 2px);
  aspect-ratio: 107 / 165;
  border: 1px solid rgba(255, 246, 228, 0.9);
  border-radius: 0;
  background: var(--paper);
  object-fit: contain;
  box-shadow: 0 7px 12px rgba(0, 0, 0, 0.45);
}

.recent-winner-cards img:first-child {
  left: 0;
  z-index: 1;
}

.recent-winner-cards img:nth-child(2) {
  left: 17px;
  z-index: 2;
}

.recent-winner-item strong {
  display: block;
  overflow: hidden;
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  color: var(--gold-bright);
  height: 13px;
  width: auto;
  padding: 0 2px;
  font-size: 8px;
  font-weight: 900;
  line-height: 13px;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(2, 45, 38, 0.78);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.34);
}

.betting-panel {
  flex: 0 0 calc(var(--sakla-design-height) * 0.4);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 5px 9px 7px;
}

html,
body,
ion-app,
.betting-panel,
.recent-results-sheet {
  background:
    linear-gradient(45deg, rgba(3, 25, 23, 0.22) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(3, 25, 23, 0.22) 1px, transparent 1px),
    linear-gradient(45deg, rgba(73, 143, 111, 0.08) 25%, transparent 25%, transparent 75%, rgba(73, 143, 111, 0.08) 75%),
    linear-gradient(45deg, rgba(9, 58, 53, 0.16) 25%, transparent 25%, transparent 75%, rgba(9, 58, 53, 0.16) 75%),
    radial-gradient(circle at 50% 0, rgba(255, 212, 110, 0.06), transparent 42%),
    linear-gradient(180deg, rgba(11, 74, 69, 0.98), rgba(7, 60, 57, 0.98));
  background-position: 0 0, 0 0, 0 0, 13px 13px, 0 0, 0 0;
  background-size: 26px 26px, 26px 26px, 26px 26px, 26px 26px, auto, auto;
}

.recent-results-panel {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  background: rgba(0, 0, 0, 0);
  visibility: hidden;
  pointer-events: none;
  transition: background 280ms ease, visibility 0s linear 280ms;
}

.recent-results-panel.is-open {
  background: rgba(0, 0, 0, 0.55);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.recent-results-sheet {
  width: 100%;
  height: 82%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 224, 160, 0.28);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(calc(100% + 20px));
  transition: transform 280ms cubic-bezier(0.22, 0.68, 0, 1);
}

.recent-results-panel.is-open .recent-results-sheet {
  transform: translateY(0);
}

.recent-results-header {
  position: relative;
  z-index: 1;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px 7px 16px;
  background-color: var(--wood);
}

.recent-results-header h2 {
  margin: 0;
  color: var(--gold-bright);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 1px 2px 0 rgba(123, 27, 22, 0.75);
}

.recent-results-close {
  flex: 0 0 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 212, 110, 0.28);
  border-radius: 8px;
  background: rgba(33, 17, 11, 0.6);
  color: var(--gold-bright);
  cursor: pointer;
}

.recent-results-toggle:focus-visible,
.mechanics-link:focus-visible,
.recent-results-close:focus-visible,
.recent-results-scroll:focus-visible,
.recent-results-breakdown > summary:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: -2px;
}

.recent-results-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.recent-results-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-results-entry {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 212, 110, 0.28);
  border-radius: 10px;
  background: rgba(3, 47, 40, 0.64);
}

.recent-results-row {
  display: grid;
  grid-template-columns: 24px 64px minmax(0, 1fr);
  grid-template-areas: "order cards details";
  align-items: start;
  gap: 6px 12px;
  min-height: 0;
  padding: 10px 14px 6px;
}

.recent-results-details {
  grid-area: details;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.recent-results-details p {
  margin: 0;
}

.recent-results-dealt-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding: 0 14px 10px;
}

.recent-results-dealt-cards img {
  width: 28px;
  height: auto;
  aspect-ratio: 107 / 165;
  object-fit: contain;
}

.recent-results-dealt-cards img.is-winning {
  outline: 2px solid var(--gold-bright);
  outline-offset: 0;
  box-shadow: 0 0 8px rgba(255, 212, 110, 0.8);
}

.recent-results-breakdown > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 212, 110, 0.2);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.recent-results-breakdown > summary::-webkit-details-marker {
  display: none;
}

.recent-results-breakdown > summary strong {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.recent-results-breakdown > summary::after {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.recent-results-breakdown[open] > summary::after {
  transform: rotate(225deg);
}

.recent-results-bets {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.recent-results-bets th,
.recent-results-bets td {
  padding: 7px 5px;
  border-top: 1px solid rgba(255, 212, 110, 0.12);
  text-align: right;
  overflow-wrap: anywhere;
}

.recent-results-bets th {
  color: var(--muted);
  font-size: 12px;
}

.recent-results-bets td {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.recent-results-bets th:first-child,
.recent-results-bets td:first-child {
  padding-left: 14px;
  text-align: left;
}

.recent-results-bets th:last-child,
.recent-results-bets td:last-child {
  padding-right: 14px;
}

.recent-results-breakdown .is-profit {
  color: var(--green);
}

.recent-results-breakdown .is-loss {
  color: #ff9292;
}

.recent-results-no-bets {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--muted);
  font-size: 12px;
}

.recent-results-order {
  grid-area: order;
  align-self: center;
  min-width: 24px;
  color: var(--muted);
  font-size: 12px;
}

.recent-results-cards {
  grid-area: cards;
  width: 64px;
  display: flex;
  align-items: center;
}

.recent-results-cards img {
  width: 35px;
  height: 54px;
  aspect-ratio: 107 / 165;
  border: 1px solid rgba(255, 246, 228, 0.9);
  background: var(--paper);
  object-fit: contain;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
}

.recent-results-cards img + img {
  margin-left: -6px;
}

.recent-results-round {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.recent-results-round-id {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-results-winner {
  flex: 0 0 auto;
  text-align: right;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 900;
}

.recent-results-empty {
  margin: 40px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .recent-results-panel,
  .recent-results-sheet {
    transition: none;
  }
}

.bet-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.bet-header strong {
  color: var(--gold-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mechanics-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold-bright);
  font-size: inherit;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.mechanics-link span {
  font-family: "Material Symbols Rounded";
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-transform: none;
}

.mechanics-content {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.mechanics-content h3 {
  margin: 0 0 8px;
  color: var(--gold-bright);
  font-size: 16px;
  line-height: 1.3;
}

.mechanics-content p {
  margin: 0 0 14px;
}

.mechanics-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 10px;
}

.mechanics-cards figure {
  min-width: 0;
  margin: 0;
  padding: 7px 5px 9px;
  border: 1px solid rgba(255, 212, 110, 0.35);
  border-radius: 8px;
  background: rgba(0, 28, 24, 0.5);
  text-align: center;
}

.mechanics-line-guide {
  height: 18px;
  display: grid;
  grid-template-columns: repeat(var(--line-count), minmax(0, 1fr));
  align-items: center;
  gap: 5px;
  margin: 0 2px 8px;
}

.mechanics-line-guide > span {
  height: 4px;
  border-radius: 1px;
  background: var(--gold-bright);
  box-shadow: 0 0 6px rgba(255, 212, 110, 0.3);
}

.mechanics-card-image {
  position: relative;
}

.mechanics-card-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.mechanics-card-highlight {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9%;
  border: 1px solid #e5ad37;
  background: rgba(255, 206, 78, 0.24);
  box-shadow: 0 0 0 2px rgba(255, 212, 110, 0.3);
  pointer-events: none;
}

.mechanics-cards figcaption {
  display: grid;
  gap: 4px;
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mechanics-cards figcaption strong {
  color: var(--gold-bright);
  font-size: 14px;
}

.mechanics-content .mechanics-card-hint {
  color: var(--muted);
  font-size: 12px;
}

.mechanics-rule,
.mechanics-payout {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 212, 110, 0.3);
  border-radius: 10px;
  background: rgba(0, 28, 24, 0.45);
}

.mechanics-rule p:last-child,
.mechanics-payout p:last-child {
  margin-bottom: 0;
}

.mechanics-payout {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(217, 168, 61, 0.13), rgba(0, 28, 24, 0.5));
}

.mechanics-payout-heading,
.mechanics-example {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mechanics-payout-heading h3 {
  margin: 0;
  font-size: 14px;
}

.mechanics-multiplier {
  color: var(--gold-bright);
  font-size: 38px;
  line-height: 1.2;
}

.mechanics-example {
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 212, 110, 0.3);
  font-size: 12px;
}

.mechanics-example strong {
  color: var(--gold-bright);
  font-size: 16px;
}

.mechanics-payout-note {
  color: var(--muted);
  font-size: 12px;
}

.bet-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.bet-tile {
  position: relative;
  align-self: start;
  min-height: 0;
  height: 46px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 210, 93, 0.58);
  border-radius: 10px;
  background:
    radial-gradient(circle at 52% 0, rgba(255, 226, 145, 0.16), transparent 45%),
    linear-gradient(145deg, rgba(28, 113, 86, 0.96), rgba(3, 47, 40, 0.98) 72%),
    #063c34;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 246, 228, 0.08), inset 0 0 16px rgba(0, 21, 18, 0.44), inset 0 -8px 18px rgba(0, 20, 18, 0.28), 0 4px 9px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.bet-tile:disabled {
  cursor: not-allowed;
  opacity: 0.54;
  filter: grayscale(0.35);
}

.bet-tile:hover,
.bet-tile.is-active {
  border-color: rgba(255, 210, 93, 0.58);
}

.bet-tile.is-active {
  transform: none;
  z-index: auto;
}

.bet-tile.is-active::after {
  content: none;
}

.bet-tile.is-active .bet-card-stack {
  box-shadow: none;
}

.bet-tile.is-winning,
.bet-tile.is-winning:disabled {
  opacity: 1;
  filter: none;
  border-color: #ffe179;
  animation: winning-pair-blink 0.78s ease-in-out infinite;
}

.bet-tile.is-winning .bet-card-stack {
  background: radial-gradient(circle at 50% 20%, rgba(255, 226, 145, 0.26), transparent 54%);
}

.bet-tile.is-winning .bet-label,
.bet-tile.is-winning .bet-money {
  color: #fff0a3;
}

@keyframes winning-pair-blink {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(255, 246, 228, 0.16), inset 0 0 16px rgba(0, 21, 18, 0.44), 0 0 0 rgba(255, 225, 121, 0);
  }

  50% {
    box-shadow: inset 0 0 0 1px rgba(255, 246, 228, 0.32), inset 0 0 18px rgba(255, 213, 93, 0.28), 0 0 16px rgba(255, 225, 121, 0.84);
  }
}

.bet-card-stack {
  position: relative;
  flex: 0 0 58%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  background: radial-gradient(circle at 50% 20%, rgba(255, 226, 145, 0.08), transparent 46%);
}

.bet-card {
  position: absolute;
  top: 6px;
  bottom: auto;
  height: calc(100% + 2px);
  width: auto;
  border: 1px solid rgba(255, 246, 228, 0.9);
  border-radius: 0;
  object-fit: contain;
  background: var(--paper);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.58);
}

.bet-card-1 {
  left: 4px;
  z-index: 1;
  transform: none;
}

.bet-card-2 {
  left: 42%;
  z-index: 2;
  border-radius: 0;
  transform: none;
}

.bet-meta {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 4px 5px 0 2px;
  text-align: right;
}

.bet-label,
.bet-money,
.bet-login,
.bet-count {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-label {
  margin-top: 2px;
  color: #f8ead0;
  width: 100%;
  font-size: 8px;
  font-weight: 700;
  text-align: right;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.34);
}

.bet-label::after {
  content: none;
}

.bet-money {
  margin-top: 2px;
  color: #ffd45c;
  width: 100%;
  font-size: 11px;
  line-height: 11px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.52);
}

.bet-money[data-size="long"] {
  font-size: 11px;
}

.bet-money[data-size="wide"] {
  font-size: 11px;
}

.bet-login {
  margin-top: 2px;
  color: #ff4d4d;
  width: 100%;
  font-size: 10px;
  line-height: 10px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.52);
}

.bet-count {
  color: #95d9cb;
  font-size: 7px;
  font-weight: 800;
}

.chip-strip {
  flex: 0 0 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.chip-label {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--muted);
  line-height: 1;
  text-align: left;
}

.chip-label:has(.chip-undo-button) {
  align-self: center;
  align-items: center;
  justify-content: center;
}

.chip-label span,
.chip-label strong {
  display: block;
  letter-spacing: 0;
}

.chip-label span {
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 900;
}

.chip-label strong {
  margin-top: 2px;
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 900;
}

.chip-undo-button {
  width: 54px;
  height: 30px;
  min-height: 0;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 3px;
  border: 1px solid rgba(255, 212, 110, 0.56);
  border-radius: 7px;
  background: rgba(53, 24, 16, 0.82);
  color: var(--gold-bright);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.chip-undo-button .material-symbols-rounded {
  font-size: 15px;
  line-height: 1;
}

.chip-undo-button strong {
  margin-top: 0;
  color: inherit;
  font-size: 10px;
  font-weight: 900;
}

.chip-undo-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chip-row {
  height: 34px;
  display: grid;
  grid-template-columns: repeat(8, 34px);
  align-items: center;
  justify-content: end;
  gap: 7px;
}

.quick-chip {
  width: 34px;
  height: 34px;
  position: relative;
  display: block;
  overflow: hidden;
  border: 2px solid rgba(245, 238, 218, 0.86);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--chip-center) 0 54%, var(--chip-center-line) 55% 58%, transparent 59%),
    radial-gradient(circle, transparent 0 68%, rgba(0, 0, 0, 0.18) 69% 71%, transparent 72%),
    conic-gradient(from 0deg, var(--chip-spot) 0 12deg, var(--chip-main) 12deg 60deg, var(--chip-spot) 60deg 72deg, var(--chip-main) 72deg 120deg, var(--chip-spot) 120deg 132deg, var(--chip-main) 132deg 180deg, var(--chip-spot) 180deg 192deg, var(--chip-main) 192deg 240deg, var(--chip-spot) 240deg 252deg, var(--chip-main) 252deg 300deg, var(--chip-spot) 300deg 312deg, var(--chip-main) 312deg 360deg);
  color: var(--chip-ink);
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  text-shadow: none;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), inset 0 3px 0 rgba(255, 255, 255, 0.08), 0 5px 10px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.quick-chip {
  text-align: center;
}

.quick-chip {
}

.quick-chip::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(49, 33, 21, 0.28);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 246, 228, 0.28);
  pointer-events: none;
}

.chip-value {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  line-height: 1;
  text-align: center;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.quick-chip[data-value="100"] .chip-value,
.quick-chip[data-value="5000"] .chip-value,
.quick-chip[data-value="10000"] .chip-value {
  letter-spacing: -0.4px;
  transform: translate(-50%, -49%);
}

.quick-chip[data-value="5"] {
  --chip-main: #b98526;
  --chip-spot: #f1ead8;
  --chip-center: #eadfc7;
  --chip-center-line: #c3a76c;
  --chip-ink: #1e1608;
}

.quick-chip[data-value="20"] {
  --chip-main: #3f778d;
  --chip-spot: #f1ead8;
  --chip-center: #eadfc7;
  --chip-center-line: #8faeb4;
  --chip-ink: #1a2224;
}

.quick-chip[data-value="50"] {
  --chip-main: #923d41;
  --chip-spot: #f1ead8;
  --chip-center: #eadfc7;
  --chip-center-line: #ba7b76;
  --chip-ink: #261111;
}

.quick-chip[data-value="100"] {
  --chip-main: #3f7c56;
  --chip-spot: #f1ead8;
  --chip-center: #eadfc7;
  --chip-center-line: #81a981;
  --chip-ink: #102015;
}

.quick-chip[data-value="500"] {
  --chip-main: #684b84;
  --chip-spot: #f1ead8;
  --chip-center: #eadfc7;
  --chip-center-line: #9b88ac;
  --chip-ink: #1e1429;
}

.quick-chip[data-value="1000"] {
  --chip-main: #3a3f42;
  --chip-spot: #f1ead8;
  --chip-center: #eadfc7;
  --chip-center-line: #7c8283;
  --chip-ink: #111416;
}

.quick-chip[data-value="5000"] {
  --chip-main: #161a17;
  --chip-spot: #cba75d;
  --chip-center: #272d29;
  --chip-center-line: #cba75d;
  --chip-ink: #f0cf82;
}

.quick-chip[data-value="10000"] {
  --chip-main: #a1642c;
  --chip-spot: #f1ead8;
  --chip-center: #eadfc7;
  --chip-center-line: #b9864f;
  --chip-ink: #211107;
}

.quick-chip.is-selected {
  border-color: #fff0a8;
  outline: 2px solid var(--gold-bright);
  outline-offset: 1px;
  transform: none;
  z-index: 2;
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.22),
    inset 0 3px 0 rgba(255, 255, 255, 0.08),
    0 4px 8px rgba(0, 0, 0, 0.3);
}

.quick-chip.is-selected::after {
  inset: 9%;
  border-color: rgba(49, 33, 21, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 246, 228, 0.28);
}

.quick-chip:disabled {
  cursor: not-allowed;
  opacity: 0.34;
  filter: grayscale(0.8) brightness(0.82);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.24);
}

.quick-chip:disabled.is-selected {
  border-color: rgba(245, 238, 218, 0.5);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.24);
}

.bet-limit-modal {
  position: absolute;
  inset: 0;
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.42);
}

.bet-limit-modal.is-open {
  display: flex;
}

.bet-limit-dialog {
  width: auto;
  min-width: 170px;
  max-width: min(320px, 100%);
  padding: 8px 12px;
  border: 1px solid rgba(255, 246, 228, 0.2);
  border-radius: 8px;
  background: rgba(255, 248, 231, 0.96);
  color: #15191e;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.bet-limit-dialog .material-symbols-rounded {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(216, 58, 65, 0.14);
  color: #d83a41;
  font-size: 16px;
}

.bet-limit-dialog strong {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.bet-result-modal {
  position: absolute;
  inset: 0;
  z-index: 1350;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.46);
}

.bet-result-modal.is-open {
  display: flex;
}

.bet-result-dialog {
  width: min(220px, 100%);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 246, 228, 0.2);
  border-radius: 8px;
  background: rgba(255, 248, 231, 0.98);
  color: #15191e;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
}

.bet-result-dialog .material-symbols-rounded {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 152, 93, 0.14);
  color: #00985d;
  font-size: 15px;
}

.bet-result-modal.is-cancelled .material-symbols-rounded {
  background: rgba(216, 58, 65, 0.14);
  color: #d83a41;
}

.bet-result-dialog strong {
  color: #15191e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.auth-mismatch-modal {
  position: absolute;
  inset: 0;
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.54);
}

.auth-mismatch-modal.is-open {
  display: flex;
}

.auth-mismatch-dialog {
  width: min(250px, 100%);
  padding: 12px;
  border: 1px solid rgba(255, 246, 228, 0.2);
  border-radius: 8px;
  background: rgba(255, 248, 231, 0.98);
  color: #15191e;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.auth-mismatch-dialog .material-symbols-rounded {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(216, 58, 65, 0.14);
  color: #d83a41;
  font-size: 14px;
}

.auth-mismatch-dialog strong {
  color: #15191e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.auth-mismatch-exit {
  min-width: 84px;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: #d83a41;
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-mismatch-exit:focus-visible {
  outline: 2px solid rgba(216, 58, 65, 0.4);
  outline-offset: 2px;
}

.wallet-bar {
  flex: 0 0 30px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #2c160e, #21110b);
  border-top: 1px solid rgba(255, 212, 110, 0.28);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.wallet-bar strong {
  color: var(--gold-bright);
}
