@font-face {
  font-family: "Anton";
  src: url("/casino/virt-crabg/assets/Fonts/Anton-Regular.woff2") format("woff2"), url("/casino/virt-crabg/assets/Fonts/Anton-Regular.woff") format("woff");
  font-display: swap;
}

:root {
  --accent: #25e0d1;
  --balance: #abf3ed;
  --frame-bg: #095746;
  --icon-bg: #095746;
  --icon-border: #25e0d1;
  --num-red: #954016;
  --num-black: #2a2724;
  --num-black-text: #c9c9c9;
  --num-green: #1d5c47;
  --num-green-text: #5ee3a1;
  --cell-border: #d5dcd9;
  --hist-red: #954016;
  --hist-black: #1d1d1d;
  --hist-black-text: #fff;
  --hist-green: #13853c;
  --text-panel: #ffd700;
  --frame-w: clamp(420px, min(100vw - 16px, 720px, (100vh - 470px) * 4 / 3), 720px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
  color: #fff;
  background: #000 center / cover no-repeat fixed;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
img { -webkit-user-drag: none; }
.hide { display: none !important; }

.game-wrap { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 8px; }

.frame {
  position: relative;
  width: var(--frame-w);
  display: flex;
  flex-direction: column;
  border-radius: 10px 10px 50px;
  overflow: hidden;
  background: var(--frame-bg) center top / cover no-repeat;
  box-shadow: 0 0 24px rgba(0, 0, 0, .8);
}

/* ---------- header ---------- */
.header {
  position: relative;
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: linear-gradient(#2e2e2ecc, #3b3b3b 50%, #000 3%, #2e2e2e99);
  z-index: 5;
}
.header-icons { display: flex; gap: 5px; }
.header-icons img { width: 22px; height: 22px; cursor: pointer; opacity: .9; }
.header-icons img:hover { opacity: 1; filter: drop-shadow(0 0 3px var(--accent)); }
.header .logo { position: absolute; left: 50%; top: 2px; height: 36px; transform: translateX(-50%); pointer-events: none; }
.header-right { display: flex; align-items: center; gap: 10px; }
.Balance { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.Balance .label { font-size: 9px; font-weight: 700; color: var(--accent); letter-spacing: .5px; }
.Balance .amount { font-family: "Anton", sans-serif; font-size: 15px; color: var(--balance); letter-spacing: .5px; margin-top: 2px; }

.lang-switch { position: relative; }
.lang-btn { display: flex; align-items: center; padding: 2px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .4); }
.lang-btn img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; display: block; }
.lang-menu {
  position: absolute; right: 0; top: 28px; z-index: 30;
  min-width: 160px; max-height: 320px; overflow: auto;
  background: rgba(10, 10, 10, .95); border: 1px solid var(--accent); border-radius: 6px; padding: 4px;
}
.lang-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: 4px; font-size: 12px; text-align: left; }
.lang-item img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.lang-item:hover, .lang-item.on { background: rgba(37, 224, 209, .2); }

/* ---------- video ---------- */
.stage { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #000 url("/casino/virt-crabg/assets/Images/VideoPlaceHolder.jpg") center / cover; overflow: hidden; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#race-video { visibility: hidden; }
.stage.racing #race-video { visibility: visible; }
.stage.racing #lobby-video { visibility: hidden; }

.podium {
  position: absolute; left: 0; right: 0; bottom: 6%;
  display: flex; justify-content: center; align-items: flex-end; gap: 4%;
  opacity: 0; transform: translateY(20px); transition: opacity .35s, transform .35s;
  pointer-events: none;
}
.podium.show { opacity: 1; transform: none; }
.podium .mk { display: flex; flex-direction: column; align-items: center; width: 12%; }
.podium .mk img { width: 46%; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); margin-bottom: 6%; }
.podium .mk:nth-child(2) { width: 15%; }
.podium .box {
  width: 100%; aspect-ratio: 1.15; display: flex; align-items: center; justify-content: center;
  font-family: "Anton", sans-serif; font-size: calc(var(--frame-w) * .06);
  border: 2px solid #fff; border-radius: 6px; box-shadow: 0 3px 10px rgba(0, 0, 0, .7);
}

/* ---------- history ---------- */
.history-bar { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px; background: rgba(0, 0, 0, .55); border-top: 3px solid #138b80; }
.history-label { font-size: 11px; font-weight: 700; }
.history { display: flex; gap: 4px; overflow: hidden; }
.number { min-width: 20px; height: 18px; padding: 0 3px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border: 1px solid #fff; }
.number.red, .box.red { background: var(--hist-red); color: #fff; }
.number.black, .box.black { background: var(--hist-black); color: var(--hist-black-text); }
.number.green, .box.green { background: var(--hist-green); color: #fff; }

/* ---------- table ---------- */
.table-zone { position: relative; padding: 14px 20px 6px; }
.board {
  display: grid;
  grid-template-columns: 1fr repeat(4, 1.15fr) 1.15fr;
  grid-template-rows: repeat(3, 40px) repeat(2, 36px);
  max-width: 560px;
  margin: 0 auto;
  transition: opacity .3s;
}
.cell {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: "Anton", "Roboto Condensed", sans-serif; font-size: 19px; letter-spacing: .5px;
  color: #fff;
  border: 1px solid var(--cell-border);
  margin: 0 -1px -1px 0;
  transition: box-shadow .15s, filter .15s;
}
.cell:hover { filter: brightness(1.25); }
.cell.num.red { background: var(--num-red); }
.cell.num.black { background: var(--num-black); color: var(--num-black-text); }
.cell.num.green { background: var(--num-green); color: var(--num-green-text); font-size: 24px; }
.cell.side { font-size: 17px; }
.cell.diamond img { width: 26px; }
.cell.last-win { box-shadow: inset 0 0 0 3px var(--accent), 0 0 10px var(--accent); z-index: 2; }

.cell .mark { position: absolute; top: -8px; right: 4px; width: 14px; height: 20px; background: center / contain no-repeat; display: none; z-index: 3; }
.cell .mark.on { display: block; }
.cell .mark.gold { background-image: url("/casino/virt-crabg/assets/Images/Marker-Gold.png"); }
.cell .mark.silver { background-image: url("/casino/virt-crabg/assets/Images/Marker-Silver.png"); }
.cell .mark.bronze { background-image: url("/casino/virt-crabg/assets/Images/Marker-Bronze.png"); }

.stack { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; z-index: 2; }
.stack.on { display: flex; }
.stack img { position: absolute; width: 42px; height: 42px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.stack b { position: relative; font-family: "Anton", sans-serif; font-size: 10px; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }

.chips-zone { position: relative; height: 70px; margin-top: 8px; }
.chips { display: flex; justify-content: space-between; align-items: center; height: 100%; max-width: 600px; margin: 0 auto; }
.chip { position: relative; width: 54px; height: 54px; border-radius: 50%; transition: transform .15s, box-shadow .15s; }
.chip img { position: absolute; left: -24%; top: -24%; width: 148%; height: 148%; display: block; }
.chip b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: "Anton", sans-serif; font-size: 15px; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.chip:hover { transform: translateY(-2px); }
.chip.selected { box-shadow: 0 0 0 3px rgba(37, 224, 209, .55), 0 0 14px 4px var(--accent); transform: translateY(-3px); }

.text-panel {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center; text-align: center;
  font-size: 30px; font-weight: 700; color: var(--text-panel); text-shadow: 0 2px 4px rgba(0, 0, 0, .6);
}
.text-panel.win { color: var(--accent); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }

.frame:not([data-phase="betting"]) .board { pointer-events: none; }
.frame[data-phase="playing"] .board, .frame[data-phase="error"] .board { opacity: .55; }
.frame:not([data-phase="betting"]) .chips { visibility: hidden; }
.frame:not([data-phase="betting"]) .text-panel { display: flex; }

/* ---------- footer ---------- */
.footer {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding: 0 28px 0 34px;
  background: linear-gradient(180deg, #075f1d4d, #093614);
}
.stake-info { display: flex; flex-direction: column; align-items: center; line-height: 1.1; min-width: 90px; z-index: 1; }
.stake-info .label { font-size: 10px; font-weight: 700; }
.stake-info .total { font-family: "Anton", sans-serif; font-size: 16px; }
.stake-info .timer { display: flex; align-items: center; gap: 3px; font-size: 9px; margin-top: 3px; }
.stake-info .timer img { width: 10px; height: 10px; }
.stake-info .pl { font-family: "Anton", sans-serif; font-size: 13px; color: #fff; border-top: 1px solid rgba(255, 255, 255, .6); padding: 0 6px; }
.stake-info .pl.up { color: #3dff6a; }
.stake-info .pl.down { color: #ff4a4a; }

.buttons { display: flex; align-items: center; gap: 26px; z-index: 1; }
.icon {
  position: relative;
  width: 35px; height: 35px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--icon-bg); border: 2px solid var(--icon-border);
  box-shadow: 0 0 6px rgba(0, 0, 0, .5);
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.icon img { width: 60%; height: 60%; }
.icon:hover { box-shadow: 0 0 10px var(--icon-border); }
.icon:active { transform: scale(.94); }
.icon.disabled { opacity: .45; pointer-events: none; }
.icon.selected { background: var(--icon-border); }
.icon.selected img { filter: brightness(0); }
.icon .i-clear, .icon.is-clear .i-undo { display: none; }
.icon.is-clear .i-clear { display: block; }
.icon.play { width: 52px; height: 52px; margin-left: 20px; border-width: 3px; }
.icon.play .i-skip, .icon.play.skip .i-play { display: none; }
.icon.play.skip .i-skip { display: block; }

/* ---------- panels ---------- */
.panel {
  position: absolute; left: 10px; right: 10px; top: 46px; bottom: 80px; z-index: 20;
  display: flex; flex-direction: column;
  background: rgba(8, 18, 16, .94); border: 1px solid var(--accent); border-radius: 10px;
}
.panel header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid rgba(37, 224, 209, .4); }
.panel h3 { margin: 0; font-size: 16px; color: var(--accent); letter-spacing: .5px; }
.panel-close { font-size: 26px; line-height: 1; color: var(--accent); }
.panel-body { flex: 1; overflow: auto; padding: 10px 16px 16px; font-size: 13px; line-height: 1.45; }
.panel-body h4 { margin: 12px 0 4px; color: var(--accent); }
.panel-body p { margin: 0 0 6px; }
.panel-body .empty, .panel-body .sum { color: #bbb; }
.bet-entry { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.bet-entry .bet-num { min-width: 28px; height: 24px; font-size: 13px; }
.bet-entry.winning-bet .bet-pricing small { color: #3dff6a; }
.bet-details { flex: 1; display: flex; flex-direction: column; }
.bet-details small, .bet-pricing small { color: #999; font-size: 11px; }
.bet-pricing { display: flex; flex-direction: column; align-items: flex-end; }
.stats-clear { margin-top: 12px; padding: 6px 14px; border: 1px solid var(--accent); border-radius: 16px; color: var(--accent); font-size: 12px; }

.toast {
  position: absolute; left: 50%; bottom: 86px; transform: translate(-50%, 20px);
  max-width: 90%; padding: 9px 18px; border-radius: 18px;
  background: rgba(0, 0, 0, .85); border: 1px solid var(--accent);
  font-size: 13px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Crab Roulette Halloween ---------- */
.theme-crab {
  --frame-bg: #664c76;
  --icon-bg: #664c76bf;
  --icon-border: #07f2ff;
  --accent: #25e0d1;
  --text-panel: #00c8d3;
  --hist-red: #e943c2;
  --hist-black: #72e2fc;
  --hist-black-text: #12324a;
  --hist-green: #18750c;
  background-image: url("/casino/virt-crabg/assets/Images/Halloween/crab-halloween-bg-Desktop.jpg");
}
.theme-crab .frame { background-image: url("/casino/virt-crabg/assets/Images/Halloween/crab-halloween-bg.png"); }
.theme-crab .history-bar { border-top-color: #693774; }
.theme-crab .board { gap: 5px; grid-template-rows: repeat(3, 38px) repeat(2, 34px); }
.theme-crab .cell {
  border: 0; margin: 0;
  background: url("/casino/virt-crabg/assets/Images/Halloween/Table/Crab/Board-block.png") center / 100% 100% no-repeat;
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .65);
}
.theme-crab .cell.num { font-size: 22px; }
.theme-crab .cell.num.red, .theme-crab .cell.num.black, .theme-crab .cell.num.green { background-position: center; background-size: 100% 100%; background-repeat: no-repeat; }
.theme-crab .cell.num.red { background-image: url("/casino/virt-crabg/assets/Images/Halloween/Table/Crab/Board-Red.png"); background-color: transparent; }
.theme-crab .cell.num.black { background-image: url("/casino/virt-crabg/assets/Images/Halloween/Table/Crab/Board-Black.png"); background-color: transparent; color: #fff; }
.theme-crab .cell.num.green { background-image: url("/casino/virt-crabg/assets/Images/Halloween/Table/Crab/Board-Green.png"); background-color: transparent; color: #fff; font-size: 26px; }
.theme-crab .cell.diamond img { width: 30px; }
.theme-crab .cell.last-win { box-shadow: 0 0 0 3px var(--accent), 0 0 12px var(--accent); }
.theme-crab .text-panel { font-style: italic; letter-spacing: 1px; }
.theme-crab .footer { background: linear-gradient(180deg, #61219627, #380a44cc); border-top: 1px solid rgba(105, 55, 116, .6); }
.theme-crab .panel { background: rgba(30, 14, 40, .95); }
