/* ====== GENERAL ====== */
:root {
  --app-bg: #0f1923;
  --app-bg2: #12212e;
  --panel-bg: #1a2c38;
  --panel-bg2: #213743;
  --panel-border: #2f4553;
  --text-main: #ffffff;
  --text-muted: #b1bad3;
  --success: #00e701;
  --danger: #ff4d4d;
  --info: #2ea0ff;
  --ui-scale: 1;
  --sage-brand-font: "Brush Script MT", "Segoe Script", "Snell Roundhand", "Lucida Handwriting", cursive;
  --sage-brand-scale: 5;
  --sage-brand-ink: rgba(237, 246, 255, 0.9);
  --sage-brand-glow: 0 2px 8px rgba(6, 18, 34, 0.68), 0 0 16px rgba(94, 172, 255, 0.45);
  --sage-brand-stroke: rgba(7, 18, 31, 0.42);
}

#casino-container.poker-classic-fullbleed {
  padding: 0;
  border: 0;
  background: transparent;
}

.casino-poker-classic {
  --room-green-a: #003b32;
  --room-green-b: #03261f;
  --table-purple-a: #6a3b78;
  --table-purple-b: #5e316d;
  --table-border: #252832;
  --table-gold: #f0b434;
  --panel: #102236;
  --panel-soft: rgba(11, 20, 33, 0.85);
  --text: #edf2ff;
  --muted: #9fb0c9;
  --danger: #d55353;
  --money: #45d35f;
  position: relative;
  width: 100%;
  height: calc(100vh - 70px);
  min-height: 560px;
  display: grid;
  place-items: center;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(11, 140, 109, 0.35), transparent 48%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.45), transparent 72%),
    linear-gradient(155deg, #003d35, #032922 62%, #021f1a);
}

.casino-poker-classic * {
  box-sizing: border-box;
}

.casino-poker-classic .ambient {
  position: absolute;
  inset: -20vh -20vw;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.2), transparent 44%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.62), transparent 78%);
}

.casino-poker-classic #poker-table {
  position: relative;
  width: min(95vw, 1140px);
  height: min(78vh, 620px);
  border-radius: 50% / 36%;
  background: linear-gradient(160deg, var(--table-purple-a), var(--table-purple-b));
  border: 10px solid #3a4356;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.04),
    inset 0 -22px 55px rgba(0, 0, 0, 0.22),
    0 24px 60px rgba(0, 0, 0, 0.58);
}

.casino-poker-classic #poker-table::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50% / 36%;
  border: 5px solid #f2be32;
  box-shadow: 0 0 14px rgba(240, 180, 52, 0.4);
  pointer-events: none;
}

.casino-poker-classic #poker-table::after {
  content: "";
  position: absolute;
  inset: 32px;
  border-radius: 50% / 35%;
  border: 2px solid rgba(201, 176, 230, 0.24);
  pointer-events: none;
}

.casino-poker-classic .table-hud,
.casino-poker-classic .action-log-wrap {
  display: none;
}

.casino-poker-classic .center-area {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  width: min(90%, 690px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  z-index: 6;
}

.casino-poker-classic #pot-wrap {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  min-width: 186px;
  border-radius: 999px;
  background: rgba(7, 17, 32, 0.95);
  border: 1px solid rgba(128, 157, 201, 0.42);
  color: #f4f7ff;
  font-weight: 800;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  z-index: 25;
  order: 2;
  margin-top: -2px;
}

.casino-poker-classic #pot-wrap #pot {
  display: inline-block;
  min-width: 5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.casino-poker-classic #pot-wrap::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--money);
  box-shadow: 0 0 8px rgba(69, 211, 95, 0.8);
}

.casino-poker-classic #pot-wrap.live {
  animation: pot-flash 0.35s ease;
}

@keyframes pot-flash {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
  100% { filter: brightness(1); }
}

.casino-poker-classic #pot-chips {
  position: relative;
  width: 220px;
  height: 92px;
  margin: 0 auto 6px;
  display: none;
  pointer-events: none;
  overflow: visible;
  z-index: 40;
  will-change: transform;
}

.casino-poker-classic #pot-chips.live {
  animation: chips-bump 0.3s ease;
}

@keyframes chips-bump {
  0% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

.casino-poker-classic .pot-chip {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #8d0d21;
  background: repeating-conic-gradient(from -8deg, #b0122a 0deg 18deg, #f5f7fa 18deg 32deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.casino-poker-classic .pot-chip::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9cad, #cf1231 70%);
  border: 2px solid rgba(247, 241, 242, 0.9);
}

.casino-poker-classic .pot-chip::after {
  content: "♠";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  font-size: 11px;
  font-weight: 700;
  color: #6b0718;
  line-height: 1;
}

.casino-poker-classic #comm-cards {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 14px;
  min-height: 130px;
  margin-bottom: 0;
  order: 1;
}

.casino-poker-classic #status {
  min-height: 1.4em;
  font-size: 1.05rem;
  color: rgba(235, 243, 255, 0.78);
  letter-spacing: 0.04em;
  order: 3;
}

.casino-poker-classic .card {
  position: relative;
  width: 92px;
  height: 134px;
  border-radius: 8px;
  background: #f8f9fd;
  color: #141418;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 2.4rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36);
}

.casino-poker-classic .card.red {
  color: #d53b45;
}

.casino-poker-classic .card.black {
  color: #141418;
}

.casino-poker-classic .card small {
  position: absolute;
  top: 7px;
  left: 7px;
  font-size: 0.94rem;
  line-height: 1;
}

.casino-poker-classic .card.card-back {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: repeating-linear-gradient(45deg, #3a8be8, #3a8be8 6px, #1768c0 6px, #1768c0 12px);
}

.casino-poker-classic .player-seat {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: transform 0.2s ease, opacity 0.25s ease, filter 0.2s ease;
}

.casino-poker-classic .player-seat.empty-seat {
  gap: 2px;
}

.casino-poker-classic .player-seat.empty-seat .p-cards {
  display: none;
  min-height: 0;
}

.casino-poker-classic .player-seat.empty-seat .p-hand-readout,
.casino-poker-classic .player-seat.empty-seat .p-profit-readout {
  display: none !important;
}

.casino-poker-classic .p-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 300;
  color: #c9d7ed;
  background: rgba(41, 63, 95, 0.85);
  border: 4px solid rgba(142, 170, 202, 0.7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.casino-poker-classic .player-seat.empty-seat .p-avatar {
  color: #ffdbe2;
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 136, 160, 0.35), rgba(124, 24, 46, 0.92) 64%),
    linear-gradient(180deg, #9f2e49, #5e1628);
  border-color: rgba(255, 171, 191, 0.82);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.4);
}

.casino-poker-classic .p-cards {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-height: 66px;
}

.casino-poker-classic .p-cards .card {
  width: 46px;
  height: 66px;
  font-size: 1.36rem;
}

.casino-poker-classic .p-cards .card small {
  font-size: 0.64rem;
  top: 3px;
  left: 4px;
}

.casino-poker-classic .hero-seat .p-cards {
  gap: 5px;
  min-height: 88px;
}

.casino-poker-classic .hero-seat .p-cards .card {
  width: 62px;
  height: 88px;
  font-size: 1.9rem;
}

.casino-poker-classic .hero-seat .p-cards .card small {
  font-size: 0.78rem;
  top: 4px;
  left: 5px;
}

.casino-poker-classic .p-profit-readout {
  display: none;
}

.casino-poker-classic .hero-seat .p-profit-readout {
  display: block;
  position: absolute;
  left: calc(100% + 10px);
  top: calc(58% + 30px);
  transform: translateY(-50%);
  min-width: 132px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid rgba(133, 172, 219, 0.54);
  background: rgba(6, 12, 21, 0.94);
  color: #dff2ff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.casino-poker-classic .hero-seat .p-profit-readout.is-up {
  color: #84ff9d;
  border-color: rgba(134, 234, 165, 0.6);
}

.casino-poker-classic .hero-seat .p-profit-readout.is-down {
  color: #ff9cb0;
  border-color: rgba(242, 136, 164, 0.6);
}

.casino-poker-classic .hero-seat .p-hand-readout {
  position: absolute;
  left: calc(100% + 10px);
  top: 58%;
  transform: translateY(-50%);
  min-width: 108px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(184, 205, 234, 0.48);
  background: rgba(8, 14, 24, 0.92);
  color: #f2f6ff;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  display: none;
}

.casino-poker-classic .hero-seat .p-hand-readout.show {
  display: block;
}

.casino-poker-classic .p-info {
  min-width: 108px;
  text-align: center;
  background: rgba(13, 23, 42, 0.92);
  border: 1px solid rgba(121, 149, 191, 0.5);
  border-radius: 10px;
  padding: 7px 9px;
}

.casino-poker-classic .p-name {
  font-size: 0.94rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e6edff;
}

.casino-poker-classic .p-bank {
  margin-top: 3px;
  font-size: 1.12rem;
  color: #dbf9dd;
}

.casino-poker-classic .p-bank::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--money);
  margin-right: 5px;
  box-shadow: 0 0 6px rgba(69, 211, 95, 0.65);
}

.casino-poker-classic .p-bank:empty::before {
  display: none;
}

.casino-poker-classic .folded {
  opacity: 0.65;
}

.casino-poker-classic .turn-active .p-avatar {
  border-color: rgba(244, 212, 124, 0.95);
  box-shadow: 0 0 0 3px rgba(244, 212, 124, 0.22), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.casino-poker-classic .winner-glow {
  transform: translateY(-2px) scale(1.05);
}

.casino-poker-classic .winner-glow .p-avatar {
  border-color: #f4d37a !important;
  box-shadow: 0 0 16px rgba(244, 211, 122, 0.75) !important;
}

.casino-poker-classic .speech-bubble {
  position: absolute;
  top: -18px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  color: #f4f8ff;
  background: rgba(11, 18, 31, 0.92);
  border: 1px solid rgba(164, 185, 216, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.casino-poker-classic .speech-bubble.show {
  opacity: 1;
}

.casino-poker-classic #controls {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 122px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(7, 14, 23, 0.92);
  border: 1px solid rgba(145, 170, 208, 0.42);
  border-radius: 10px;
  padding: 10px;
}

.casino-poker-classic .btn-action {
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 8px 6px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  background: #d8e4fa;
  color: #1a2435;
  transition: transform 0.12s ease, filter 0.14s ease;
}

.casino-poker-classic .btn-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.casino-poker-classic .btn-action.red {
  background: var(--danger);
  color: #fff;
}

.casino-poker-classic .btn-action.gold {
  background: var(--table-gold);
  color: #1f232b;
}

.casino-poker-classic #btn-check,
.casino-poker-classic #btn-call {
  color: #000;
}

.casino-poker-classic .raise-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.casino-poker-classic .raise-box label {
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93abc8;
}

.casino-poker-classic #raise-input {
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(167, 188, 217, 0.32);
  background: #f7fbff;
  color: #18243a;
  text-align: center;
  font-weight: 700;
  padding: 6px;
}

.casino-poker-classic #deal-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: transparent;
}

.casino-poker-classic #msg-overlay {
  pointer-events: auto;
  margin-bottom: 12px;
  font-size: clamp(1.15rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
}

.casino-poker-classic #tie-choice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.casino-poker-classic #tie-choice-row .btn-lrg {
  min-width: 170px;
  padding: 12px 20px;
  font-size: clamp(0.95rem, 2.1vw, 1.25rem);
}

.casino-poker-classic #tie-choice-row.hidden {
  display: none;
}

.casino-poker-classic .btn-lrg {
  pointer-events: auto;
  border: 2px solid rgba(252, 222, 149, 0.9);
  border-radius: 12px;
  padding: 14px 30px;
  font-size: clamp(1rem, 2.6vw, 1.55rem);
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  color: #19222f;
  background: linear-gradient(180deg, #f9db96, #e3a941);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.casino-poker-classic .btn-lrg:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.05);
}

.casino-poker-classic .hidden {
  opacity: 0;
  pointer-events: none !important;
}

@media (max-width: 900px) {
  .casino-poker-classic #poker-table {
    width: 98vw;
    height: 90vh;
    border-radius: 50% / 34%;
    border-width: 10px;
  }

  .casino-poker-classic #poker-table::before {
    inset: 6px;
    border-radius: 50% / 34%;
    border-width: 3px;
  }

  .casino-poker-classic #poker-table::after {
    inset: 18px;
    border-radius: 50% / 33%;
  }

  .casino-poker-classic .center-area {
    top: 46%;
    width: calc(100% - 18px);
  }

  .casino-poker-classic #pot-wrap {
    left: auto;
    top: auto;
    transform: none;
    margin-top: -2px;
  }

  .casino-poker-classic #pot-wrap.live {
    animation: none;
  }

  .casino-poker-classic #pot-chips {
    width: 160px;
    height: 70px;
    margin: 1px auto 8px;
  }

  .casino-poker-classic .pot-chip {
    width: 20px;
    height: 20px;
  }

  .casino-poker-classic .pot-chip::before {
    inset: 4px;
  }

  .casino-poker-classic .pot-chip::after {
    font-size: 9px;
  }

  .casino-poker-classic #comm-cards {
    min-height: 92px;
    gap: 6px;
  }

  .casino-poker-classic .card {
    width: 56px;
    height: 82px;
    font-size: 1.66rem;
  }

  .casino-poker-classic .player-seat {
    gap: 4px;
  }

  .casino-poker-classic .p-avatar {
    width: 52px;
    height: 52px;
    font-size: 1.7rem;
    border-width: 2px;
  }

  .casino-poker-classic .p-info {
    min-width: 64px;
    padding: 3px 5px;
  }

  .casino-poker-classic .p-name {
    font-size: 0.62rem;
  }

  .casino-poker-classic .p-bank {
    font-size: 0.68rem;
  }

  .casino-poker-classic .p-cards .card {
    width: 34px;
    height: 49px;
    font-size: 1.06rem;
  }

  .casino-poker-classic .hero-seat .p-cards .card {
    width: 42px;
    height: 60px;
    font-size: 1.25rem;
  }

  .casino-poker-classic .hero-seat .p-cards .card small {
    font-size: 0.62rem;
    top: 3px;
    left: 4px;
  }

  .casino-poker-classic .hero-seat .p-hand-readout {
    left: calc(100% + 6px);
    min-width: 86px;
    padding: 4px 6px;
    font-size: 0.62rem;
  }

  .casino-poker-classic .hero-seat .p-profit-readout {
    left: calc(100% + 6px);
    top: calc(58% + 24px);
    min-width: 108px;
    padding: 4px 6px;
    font-size: 0.62rem;
  }

  .casino-poker-classic #controls {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    transform: none;
    width: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .casino-poker-classic .raise-box {
    grid-column: span 2;
  }

  .casino-poker-classic #tie-choice-row {
    flex-direction: column;
    gap: 8px;
  }

  .casino-poker-classic #tie-choice-row .btn-lrg {
    min-width: 150px;
  }
}

body {
  background:
    radial-gradient(900px 500px at 75% -10%, rgba(0, 231, 1, 0.16), transparent 60%),
    radial-gradient(800px 450px at 10% 0%, rgba(0, 231, 1, 0.06), transparent 55%),
    linear-gradient(180deg, var(--app-bg2), var(--app-bg));
  color: var(--text-main);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: calc(16px * var(--ui-scale));
  text-align: center;
  margin: 0;
}

#appVersionTag {
  position: fixed;
  top: 8px;
  left: 10px;
  z-index: 12000;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(112, 150, 182, 0.55);
  background: rgba(9, 20, 31, 0.8);
  color: #dceaf8;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  pointer-events: none;
}

h1 {
  margin: 20px 0 10px;
  font-size: clamp(1.4rem, 2.3vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.game-title-logo {
  position: relative;
  isolation: isolate;
  margin: 14px auto 10px;
  width: fit-content;
  padding: 10px 24px 12px;
  border-radius: 14px;
  text-transform: uppercase;
  font-size: clamp(1.22rem, 2.6vw, 2.06rem);
  font-weight: 900;
  letter-spacing: 0.17em;
  line-height: 1;
  backdrop-filter: blur(3px);
  color: #eaf5ff;
  text-shadow:
    0 2px 0 rgba(3, 8, 14, 0.98),
    0 0 12px rgba(126, 184, 236, 0.48),
    0 0 30px rgba(68, 131, 190, 0.3);
  -webkit-text-stroke: 0.4px rgba(6, 18, 30, 0.9);
  animation: titleNeonPulse 3.8s ease-in-out infinite;
}

.game-title-logo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -2;
  border: 1px solid rgba(128, 167, 200, 0.62);
  background:
    radial-gradient(130% 95% at 50% -35%, rgba(157, 211, 255, 0.3), transparent 68%),
    linear-gradient(180deg, rgba(14, 28, 42, 0.96), rgba(7, 16, 25, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(231, 245, 255, 0.22),
    0 6px 22px rgba(2, 8, 14, 0.48),
    0 0 0 1px rgba(7, 20, 34, 0.78);
}

.game-title-logo::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 5px;
  height: 2px;
  border-radius: 999px;
  z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(197, 231, 255, 0.9), transparent);
  box-shadow: 0 0 12px rgba(138, 193, 241, 0.52);
  opacity: 0.82;
}

@keyframes titleNeonPulse {
  0%, 100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.09) saturate(1.08);
  }
}

#nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 14px;
}

#nav button {
  background: linear-gradient(180deg, #2f4553, #243746);
  color: var(--text-main);
  border: 1px solid #3a5565;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

#nav button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  border-color: #4b6a7d;
}

.phone-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #04120a;
  background: #00e701;
}

.phone-badge.hidden {
  display: none !important;
}

.phone-overlay {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 16, 0.66);
  backdrop-filter: blur(3px);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 260ms ease, visibility 0ms linear;
}

.phone-overlay.hidden {
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms ease, visibility 0ms linear 260ms;
}

.phone-scene-brand {
  position: absolute;
  top: 50%;
  z-index: 2;
  font-family: var(--sage-brand-font);
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.phone-scene-brand.side-left {
  left: calc(50% - (min(420px, 95vw) / 2) - clamp(74px, 9vw, 112px));
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
}

.phone-scene-brand.side-right {
  right: calc(50% - (min(420px, 95vw) / 2) - clamp(74px, 9vw, 112px));
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
}

.phone-device {
  position: relative;
  width: min(420px, 95vw);
  height: min(840px, 94vh);
  border-radius: 40px;
  padding: 10px;
  background: linear-gradient(160deg, #2d3238, #0d0f12 42%, #1b2027);
  box-shadow:
    0 28px 52px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -12px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(0) scale(1);
  opacity: 1;
  transition: transform 420ms cubic-bezier(0.16, 0.86, 0.2, 1), opacity 280ms ease;
}

.phone-overlay.hidden .phone-device {
  transform: translateY(30px) scale(0.94);
  opacity: 0;
}

.phone-overlay.phone-opening .phone-device {
  animation: phoneDeviceOpenPop 620ms cubic-bezier(0.2, 0.88, 0.24, 1) both;
}

.phone-side-btn {
  position: absolute;
  right: -3px;
  width: 4px;
  border-radius: 4px;
  background: #59606a;
}

.phone-side-btn.one { top: 168px; height: 42px; }
.phone-side-btn.two { top: 228px; height: 72px; }
.phone-side-btn.three { top: 316px; height: 72px; }

.phone-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(120% 90% at 80% -25%, rgba(90, 180, 255, 0.22), transparent 55%),
    linear-gradient(180deg, #172b39, #122330);
  border: 1px solid #455463;
  border-radius: 32px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 -30px 50px rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.phone-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.1), transparent 32%);
  opacity: 0.32;
  z-index: 0;
}

.phone-shell::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 126px;
  height: 5px;
  border-radius: 999px;
  background: rgba(233, 244, 255, 0.82);
  transform: translateX(-50%) translateY(0) scaleX(1);
  opacity: 0;
  will-change: transform, opacity;
  pointer-events: none;
  z-index: 5;
  display: none;
}

.phone-shell.phone-home-fly-active::after {
  animation: phoneHomeBarRise 760ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.phone-shell > * {
  position: relative;
  z-index: 1;
}

.phone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 152px;
  height: 28px;
  border-radius: 18px;
  background: #0a1017;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 4;
}

.phone-statusbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 14px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #cfe4f4;
}

#phoneStatusTime {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  justify-self: start;
}

.phone-dynamic-island {
  justify-self: center;
  width: 140px;
  height: 30px;
  border-radius: 999px;
  background: #060a10;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: block;
}

.phone-status-icons {
  color: #d4dfeb;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.phone-status-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.phone-status-actions button {
  border: 1px solid #3c586a;
  background: #1e3241;
  color: #d9e9f6;
  border-radius: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 10px;
  border-bottom: 1px solid #2c4458;
}

.phone-header button {
  border: 1px solid #3a5667;
  background: #213644;
  color: #d8e9f6;
  border-radius: 8px;
  padding: 4px 9px;
  cursor: pointer;
}

.phone-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #2a4154;
  background: rgba(7, 17, 25, 0.25);
}

.phone-tab {
  border: 1px solid #365367;
  background: #1c3242;
  color: #d8e9f6;
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.phone-tab.active {
  background: linear-gradient(180deg, #00e701, #1e76d8);
  color: #fff;
  border-color: rgba(176, 220, 255, 0.65);
}

.phone-body {
  position: relative;
  padding: 8px 10px 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(9, 15, 26, 0.7), rgba(12, 16, 30, 0.55));
}

.phone-body.phone-home-smooth {
  animation: phoneHomeSmoothUp 560ms cubic-bezier(0.22, 0.82, 0.22, 1);
}

.phone-body.phone-home-transitioning {
  overflow: hidden;
}

.phone-body.phone-app-opening {
  overflow: hidden;
}

.phone-body.phone-app-opening::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 24, 0.9);
  opacity: 1;
  z-index: 3;
  pointer-events: none;
}

.phone-app {
  position: absolute;
  inset: 0;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

.phone-app.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.phone-app.phone-app-exit-up,
.phone-app.phone-app-exit-to-icon,
.phone-app.phone-home-enter-preview {
  display: block !important;
  position: absolute;
  inset: 0;
  overflow: auto;
  visibility: visible !important;
  pointer-events: none;
}

.phone-app.phone-home-enter-preview {
  z-index: 2;
  animation: phoneHomeReveal 760ms cubic-bezier(0.18, 0.86, 0.2, 1) both;
}

.phone-app.phone-app-exit-up {
  z-index: 3;
  will-change: clip-path, opacity, transform;
  animation: phoneAppExitUp 760ms cubic-bezier(0.2, 0.86, 0.22, 1) both;
}

.phone-app.phone-app-exit-to-icon {
  z-index: 3;
  will-change: transform, opacity, border-radius;
}

.phone-app.phone-app-enter-zoom {
  display: block !important;
  position: absolute;
  inset: 0;
  overflow: auto;
  visibility: visible !important;
  pointer-events: none;
  z-index: 4;
  will-change: transform, opacity, border-radius;
}

.phone-app.phone-app-underlay-dim {
  filter: none;
  opacity: 0;
  pointer-events: none;
}

.phone-home-screen {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 10px;
  padding: 8px 4px 2px;
  background:
    radial-gradient(130% 90% at 80% -15%, rgba(71, 140, 255, 0.35), rgba(19, 24, 45, 0.2) 56%, rgba(13, 17, 31, 0.78) 100%),
    linear-gradient(180deg, rgba(20, 34, 68, 0.84), rgba(13, 17, 32, 0.92));
  border-radius: 20px;
}

.phone-app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 8px;
  align-content: start;
  padding: 0 2px;
  overflow: auto;
  padding-right: 4px;
}

.phone-icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.phone-home-app {
  position: relative;
  border: 0;
  background: none;
  color: #e9f4fc;
  border-radius: 12px;
  min-height: 88px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 1px;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.phone-home-app-badge {
  position: absolute;
  top: -2px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff2d55;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 3;
}

.phone-home-app-badge.hidden {
  display: none;
}

.phone-home-app:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.06);
}

.phone-home-app.is-locked,
.phone-tab.is-locked {
  opacity: 0.5;
  filter: grayscale(0.35);
}

.phone-home-app.is-locked .phone-home-icon::after {
  content: "🔒";
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(10, 20, 33, 0.9);
  border: 1px solid rgba(187, 206, 230, 0.5);
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
}

.casino-secret-unlock-btn {
  position: fixed;
  right: 8px;
  bottom: 8px;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  cursor: default;
}

.casino-secret-unlock-btn.active {
  pointer-events: auto;
}

.casino-secret-unlock-btn.in-achievements {
  position: absolute;
  top: 36px;
  right: 10px;
  width: 130px;
  height: 20px;
  z-index: 12;
}

.phone-home-icon {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: #fff;
  background: linear-gradient(155deg, #2f3241, #1e212e 68%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 10px 18px rgba(0, 0, 0, 0.35);
}

.phone-home-svg {
  width: 34px;
  height: 34px;
  color: #f8fbff;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.22));
}

.icon-messages { background: linear-gradient(155deg, #39d16a, #137d39 68%); }
.icon-bank { background: linear-gradient(155deg, #3ea2ff, #1b5db4 68%); }
.icon-portfolio { background: linear-gradient(155deg, #6a61ff, #322ea8 68%); }
.icon-casino { background: linear-gradient(155deg, #f24d76, #ab2447 68%); }
.icon-missions { background: linear-gradient(155deg, #f4be44, #c98714 68%); }
.icon-settings { background: linear-gradient(155deg, #7f8ea5, #4a566a 68%); }
.icon-mail { background: linear-gradient(155deg, #58c7d9, #2a7288 68%); }
.icon-market { background: linear-gradient(155deg, #7bd95d, #388a2d 68%); }
.icon-roulette { background: linear-gradient(155deg, #f06f59, #a43e2f 68%); }
.icon-slots { background: linear-gradient(155deg, #d05dff, #7f2eb3 68%); }
.icon-safe { background: linear-gradient(155deg, #f6d14f, #ba8622 68%); }
.icon-achievements { background: linear-gradient(155deg, #ff8f47, #b94e1f 68%); }

.phone-home-app-name {
  line-height: 1.1;
  color: #f4f7ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.phone-home-mini-game-app {
  min-height: 82px;
}

.phone-mini-game-icon {
  --icon-fill: #f4fbff;
  --icon-stroke: #f4fbff;
  --icon-glow: rgba(255, 255, 255, 0.45);
  width: 52px;
  height: 52px;
  border-radius: 14px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(155deg, #39546a, #263a4c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 8px 14px rgba(0, 0, 0, 0.3);
}

.phone-mini-game-glyph {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #f8fcff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.phone-mini-game-icon svg {
  width: 78%;
  height: 78%;
  filter:
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 8px var(--icon-glow));
}

.phone-mini-game-icon .stroke {
  fill: none;
  stroke: var(--icon-stroke);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.phone-mini-game-icon .fill {
  fill: var(--icon-fill);
}

.phone-mini-game-icon[data-game="dice"] {
  --icon-fill: #fff5d2;
  --icon-stroke: #ff4b75;
  --icon-glow: rgba(255, 188, 86, 0.65);
  background: linear-gradient(155deg, #8a44ff, #5f33d8);
}

.phone-mini-game-icon[data-game="plinko"] {
  --icon-fill: #ffe082;
  --icon-stroke: #fff6ca;
  --icon-glow: rgba(255, 214, 107, 0.72);
  background: linear-gradient(155deg, #b84bf4, #ff4f8e);
}

.phone-mini-game-icon[data-game="mines"] {
  --icon-fill: #ffe06b;
  --icon-stroke: #1e2230;
  --icon-glow: rgba(255, 224, 107, 0.72);
  background: linear-gradient(155deg, #1388ff, #07b4ff);
}

.phone-mini-game-icon[data-game="crash"] {
  --icon-fill: #8ff3ff;
  --icon-stroke: #fff3a0;
  --icon-glow: rgba(147, 232, 255, 0.72);
  background: linear-gradient(155deg, #f7c732, #2f78ff);
}

.phone-mini-game-icon[data-game="hilo"] {
  --icon-fill: #c7f9ff;
  --icon-stroke: #fff8a8;
  --icon-glow: rgba(191, 255, 185, 0.7);
  background: linear-gradient(155deg, #00b057, #1f7ce7);
}

.phone-mini-game-icon[data-game="dragontower"] {
  --icon-fill: #ffe19f;
  --icon-stroke: #ffd25f;
  --icon-glow: rgba(255, 224, 156, 0.75);
  background: linear-gradient(155deg, #ff9b3b, #dd4f4f);
}

.phone-mini-game-icon[data-game="keno"] {
  --icon-fill: #8ff3ff;
  --icon-stroke: #f6ffb4;
  --icon-glow: rgba(143, 243, 255, 0.78);
  background: linear-gradient(155deg, #2272ff, #15c2ff);
}

.phone-mini-game-icon[data-game="roulette"] {
  --icon-fill: #ff7a7a;
  --icon-stroke: #ffe8a3;
  --icon-glow: rgba(255, 147, 147, 0.72);
  background: linear-gradient(155deg, #00b55b, #0f7a3f);
}

.phone-mini-game-icon[data-game="slide"] {
  --icon-fill: #ffe5a0;
  --icon-stroke: #dbf2ff;
  --icon-glow: rgba(199, 232, 255, 0.72);
  background: linear-gradient(155deg, #57a9ff, #3f6fdf);
}

.phone-mini-game-icon[data-game="blackjack"] {
  --icon-fill: #ff8fa5;
  --icon-stroke: #f4fbff;
  --icon-glow: rgba(255, 143, 165, 0.6);
  background: linear-gradient(155deg, #2f3c47, #111b24);
}

.phone-mini-game-icon[data-game="diamonds"] {
  --icon-fill: #90f7ff;
  --icon-stroke: #e1fcff;
  --icon-glow: rgba(137, 243, 255, 0.72);
  background: linear-gradient(155deg, #24c7c8, #0d87a3);
}

.phone-mini-game-icon[data-game="poker"] {
  --icon-fill: #ffe7a4;
  --icon-stroke: #fff6df;
  --icon-glow: rgba(255, 214, 120, 0.72);
  background: linear-gradient(155deg, #ff6c5d, #f4aa3d);
}

.phone-mini-game-icon[data-game="crossyroad"] {
  --icon-fill: #fff2a8;
  --icon-stroke: #ffe07c;
  --icon-glow: rgba(174, 255, 174, 0.72);
  background: linear-gradient(155deg, #18c45d, #169aa8);
}

.phone-mini-game-icon[data-game="slots"] {
  --icon-fill: #ffe28f;
  --icon-stroke: #f0fbff;
  --icon-glow: rgba(181, 223, 255, 0.72);
  background: linear-gradient(155deg, #7a4dff, #3f8fff);
}

.phone-mini-game-app {
  padding: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #15283b, #101f2f);
}

.phone-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.phone-mini-header strong {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #eaf4fb;
}

.phone-mini-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.phone-mini-reload,
.phone-mini-open-full {
  border: 1px solid #3d5d76;
  background: #1f3a50;
  color: #dceaf6;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.phone-mini-close {
  border: 1px solid #3d5d76;
  background: #1f3a50;
  color: #dceaf6;
  border-radius: 8px;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.phone-mini-frame-wrap {
  position: relative;
  min-height: 0;
  height: 100%;
  border: 1px solid #2b4861;
  border-radius: 12px;
  overflow: hidden;
  background: #081625;
  box-shadow: inset 0 0 0 1px rgba(111, 170, 214, 0.12);
}

.phone-mini-game-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #041120;
}

.phone-mini-frame-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  color: #c6dcef;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(8, 17, 29, 0.92), rgba(7, 15, 26, 0.9));
  z-index: 2;
}

.phone-mini-frame-loading[hidden] {
  display: none;
}

.phone-home-search-pill {
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(140, 160, 205, 0.35);
  background: rgba(20, 25, 42, 0.72);
  color: #dde8f6;
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 14px;
}

.phone-home-dock {
  border: 1px solid rgba(151, 175, 220, 0.34);
  background: rgba(14, 17, 31, 0.6);
  border-radius: 18px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.phone-home-app.dock-app {
  min-height: auto;
  gap: 0;
  padding: 0;
}

.phone-home-app.dock-app .phone-home-icon {
  width: 56px;
  height: 56px;
}

.phone-list {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.phone-list.compact {
  max-height: 148px;
  overflow: auto;
  padding-right: 2px;
}

.phone-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.phone-subheader button {
  border: 1px solid #365367;
  background: #1a2e3d;
  color: #d4e6f4;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}

.phone-message-item {
  text-align: left;
  padding: 8px 9px;
  border-radius: 9px;
  border: 1px solid #355063;
  background: linear-gradient(180deg, #1a3040, #172a38);
}

.phone-message-item .meta {
  font-size: 11px;
  color: #99b2c6;
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
}

.phone-message-item.good { border-color: rgba(0, 231, 1, 0.4); }
.phone-message-item.bad { border-color: rgba(255, 77, 77, 0.45); }
.phone-message-item.bank { border-color: rgba(0, 255, 204, 0.45); }
.phone-message-item.achievement { border-color: rgba(255, 210, 84, 0.5); }
.phone-message-item.bank-positive { border-color: rgba(0, 231, 1, 0.45); }
.phone-message-item.bank-negative { border-color: rgba(255, 77, 77, 0.45); }

.phone-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.phone-stat-grid > div {
  text-align: left;
  padding: 8px;
  border: 1px solid #355063;
  border-radius: 9px;
  background: #162c3b;
}

.phone-stat-grid span {
  display: block;
  font-size: 11px;
  color: #9eb6c8;
  margin-bottom: 2px;
}

.phone-inline-controls {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
}

.phone-inline-controls input,
.phone-setting-row input[type="number"] {
  width: 100%;
  min-width: 0;
  border: 1px solid #3b576a;
  background: #132532;
  color: #e4f0f9;
  border-radius: 8px;
  padding: 7px 8px;
}

.phone-inline-controls button,
#phoneAppBank > button {
  border: 1px solid #3a5667;
  background: #1d3241;
  color: #d8e8f5;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}

#phoneAppBank > button {
  width: 100%;
  margin-top: 8px;
}

#phoneAppBank > button:disabled,
.phone-inline-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#phoneAppBank .phone-inline-controls + .phone-inline-controls {
  margin-top: 6px;
}

.phone-bank-progress {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(16, 31, 42, 0.9);
  border: 1px solid #315062;
  overflow: hidden;
}

#phoneBankProgressBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00e701, #00e701);
}

#phonePortfolioChart {
  width: 100%;
  height: 130px;
  border: 1px solid #385568;
  border-radius: 10px;
  background: linear-gradient(180deg, #10212d, #0d1b26);
  margin-top: 8px;
}

.phone-quick-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.phone-quick-grid button {
  border: 1px solid #3b576a;
  background: #19303f;
  color: #def0fc;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.phone-mission {
  text-align: left;
  border: 1px solid #365266;
  border-radius: 9px;
  padding: 8px;
  background: #152a39;
}

.phone-mission-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.phone-mission-tab {
  border: 1px solid #355367;
  background: #142a39;
  color: #cde1f1;
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.phone-mission-tab.active {
  border-color: rgba(0, 231, 1, 0.55);
  background: linear-gradient(180deg, #245074, #1a3f5c);
  color: #e7f3ff;
}

.phone-mission-panel {
  display: none;
}

.phone-mission-panel.active {
  display: block;
}

.mission-bank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mission-bank-head strong {
  font-size: 11px;
  color: #b9d2e7;
}

.phone-mission-bank-meta {
  border: 1px solid #355468;
  border-radius: 9px;
  background: #132838;
  padding: 8px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  align-items: center;
}

.phone-mission-bank-meta span {
  font-size: 12px;
  color: #b7cddd;
}

.phone-mission-bank-meta strong {
  color: #ebf6ff;
}

.phone-mission-bank-meta button {
  grid-column: 1 / -1;
  border: 1px solid rgba(0, 231, 1, 0.45);
  background: linear-gradient(180deg, #1fd764, #119b49);
  color: #07270f;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.phone-mission-bank-meta button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.phone-mission-level-track {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 999px;
  border: 1px solid #35556b;
  background: #0f2230;
  overflow: hidden;
}

#phoneMissionLevelFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00e701, #00e701);
  transition: width 160ms ease;
}

.phone-mission-level-note {
  grid-column: 1 / -1;
  font-size: 11px;
  color: #aecae0;
}

.phone-mission h4 {
  margin: 0 0 4px;
  font-size: 13px;
}

.phone-mission p {
  margin: 0;
  font-size: 12px;
  color: #a8bfd0;
}

.phone-mission .row {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.phone-mission .row h4 {
  margin: 0;
}

.phone-mission button {
  border: 1px solid rgba(0, 231, 1, 0.45);
  background: linear-gradient(180deg, #1fd764, #119b49);
  color: #07270f;
  font-size: 12px;
  font-weight: 800;
  border-radius: 7px;
  padding: 5px 8px;
  cursor: pointer;
}

.phone-mission.done {
  border-color: rgba(0, 231, 1, 0.45);
}

.phone-mission.claimable {
  border-color: rgba(0, 231, 1, 0.6);
  box-shadow: 0 0 0 1px rgba(0, 231, 1, 0.2) inset;
}

.phone-mission.claimed button {
  opacity: 0.6;
  cursor: not-allowed;
}

.phone-mission button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.phone-mission .reward-line {
  margin-top: 5px;
  font-size: 11px;
  color: #bad0df;
}

.phone-mission .status-chip {
  border: 1px solid #445f73;
  border-radius: 999px;
  background: #223b4f;
  color: #d9e9f7;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.phone-mission .status-chip.claimable {
  border-color: rgba(0, 231, 1, 0.55);
  background: rgba(13, 74, 38, 0.8);
  color: #cffff3;
}

.phone-mission .status-chip.claimed {
  border-color: #6d5aa6;
  background: #3e3561;
  color: #d8cbff;
}

.phone-mission .status-chip.progress {
  border-color: #5086b2;
  background: #274a66;
}

.phone-mission .status-chip.locked {
  border-color: #445c72;
  background: #223446;
  color: #b8cad9;
}

.phone-mission .progress-track {
  margin-top: 6px;
  height: 6px;
  border-radius: 999px;
  background: #102233;
  border: 1px solid #2f4b61;
  overflow: hidden;
}

.phone-mission .progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00e701, #00e701);
  transition: width 150ms ease;
}

.phone-mission .progress-label {
  margin-top: 4px;
  font-size: 11px;
  color: #98b4c8;
}

.phone-perk-item {
  border: 1px solid #37556a;
  border-radius: 9px;
  padding: 8px;
  background: #142a39;
}

.phone-perk-item.unlocked {
  border-color: rgba(0, 231, 1, 0.5);
}

.phone-perk-item .perk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #e2f0ff;
}

.phone-perk-item .status-chip {
  border: 1px solid #445f73;
  border-radius: 999px;
  background: #223b4f;
  color: #d9e9f7;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.phone-perk-item .status-chip.claimable {
  border-color: rgba(0, 231, 1, 0.55);
  background: rgba(13, 74, 38, 0.8);
  color: #cffff3;
}

.phone-perk-item .status-chip.locked {
  border-color: #445c72;
  background: #223446;
  color: #b8cad9;
}

.phone-perk-item .perk-line {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  color: #a8bfd0;
}

.phone-mission-toast {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translate(-50%, -10px);
  background: rgba(8, 24, 34, 0.96);
  color: #e8f4ff;
  border: 1px solid rgba(62, 138, 189, 0.62);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 40;
  transition: opacity 140ms ease, transform 140ms ease;
}

.phone-mission-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.phone-setting-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  text-align: left;
  padding: 8px;
  border: 1px solid #344f63;
  border-radius: 9px;
  background: #152a39;
}

.phone-setting-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.phone-setting-row input[type="range"] {
  width: 180px;
  max-width: 100%;
}

.phone-setting-danger {
  border-color: rgba(239, 96, 122, 0.45);
  background: #2b1b26;
}

.phone-danger-btn {
  border: 1px solid rgba(255, 152, 173, 0.6);
  border-radius: 8px;
  background: linear-gradient(155deg, #b43756, #8f2746);
  color: #fff;
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer;
}

.phone-danger-btn:hover {
  filter: brightness(1.07);
}

.phone-home-bar {
  justify-self: center;
  width: 126px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  margin: 6px 0 10px;
  cursor: pointer;
  position: relative;
}

.phone-home-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 5px;
  border-radius: 999px;
  background: rgba(233, 244, 255, 0.62);
  transition: opacity 180ms ease;
}

.phone-home-bar.phone-home-bar-hidden::before {
  opacity: 0;
}

@keyframes phoneHomeSmoothUp {
  0% {
    transform: translateY(30px);
    opacity: 0.5;
  }
  55% {
    opacity: 0.86;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes phoneHomeEnterUp {
  0% {
    transform: translateY(52px) scale(0.97);
    opacity: 0.16;
  }
  55% {
    opacity: 0.82;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes phoneHomeReveal {
  0% {
    transform: scale(0.985);
    opacity: 0.45;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes phoneAppExitUp {
  0% {
    -webkit-clip-path: inset(0 0 0 0);
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
    opacity: 1;
  }
  70% {
    opacity: 0.72;
  }
  100% {
    -webkit-clip-path: inset(0 0 100% 0);
    clip-path: inset(0 0 100% 0);
    transform: translateY(-6px);
    opacity: 0.2;
  }
}

@keyframes phoneHomeBarRise {
  0% {
    transform: translateX(-50%) translateY(0) scaleX(1);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  78% {
    opacity: 0.95;
  }
  100% {
    transform: translateX(-50%) translateY(calc(-1 * var(--phone-home-fly-distance, 620px))) scaleX(0.8);
    opacity: 0;
  }
}

@keyframes phoneDeviceOpenPop {
  0% {
    transform: translateY(34px) scale(0.9);
    opacity: 0;
  }
  56% {
    transform: translateY(-3px) scale(1.01);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

body.reduced-anim *,
body.reduced-anim *::before,
body.reduced-anim *::after {
  transition: none !important;
  animation: none !important;
}

#trading-section {
  padding: 6px 14px 20px;
}

.chart-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.chart-canvas-wrap {
  position: relative;
  width: min(900px, 100%);
}

.chart-side-column {
  width: 170px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-left-column {
  align-items: stretch;
}

#chart {
  background: linear-gradient(180deg, #101b25, #0b131a);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

#side-price-container {
  min-width: 120px;
  background: linear-gradient(180deg, var(--panel-bg2), var(--panel-bg));
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

#side-xp-container {
  min-width: 120px;
  background: linear-gradient(180deg, var(--panel-bg2), var(--panel-bg));
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  text-align: left;
}

#side-xp-container .label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.xp-level-value {
  font-size: 1.3rem;
  font-weight: 900;
  margin: 4px 0 8px;
  color: #e7f6ff;
}

.xp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.xp-row strong {
  color: #dff3ff;
  font-size: 0.84rem;
}

.xp-track {
  height: 8px;
  border-radius: 999px;
  border: 1px solid #35556b;
  background: #0f2230;
  overflow: hidden;
  margin: 8px 0 7px;
}

#tradingMissionLevelFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00e701, #00e701);
  transition: width 170ms ease;
}

.xp-perk-note {
  font-size: 0.72rem;
  color: #aecae0;
}

#side-price-container .label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

#side-price {
  font-size: 1.3rem;
  font-weight: 900;
  margin: 4px 0;
}

#avg-buy-price {
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 4px;
}

#side-price-container hr {
  border: none;
  border-top: 1px solid #314a5b;
  margin: 8px 0;
}

/* TRADING BUTTONS */
#controls {
  position: relative;
  z-index: 5005;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#controls button {
  position: relative;
  z-index: 5006;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  pointer-events: auto;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
}

#buy, #buyAll {
  background: linear-gradient(180deg, #1ccf72, #109157);
  border-color: rgba(28, 207, 114, 0.4);
}

#sell, #sellAll {
  background: linear-gradient(180deg, #ff5d64, #cf3742);
  border-color: rgba(255, 93, 100, 0.4);
}

#next {
  background: linear-gradient(180deg, #00e701, #1f74d1);
  border-color: rgba(0, 231, 1, 0.4);
}

#pause {
  background: linear-gradient(180deg, #6c8ca3, #4b6577);
  border-color: rgba(108, 140, 163, 0.4);
}

/* SPEED */
#speed-controls {
  position: relative;
  z-index: 5005;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.speed-btn {
  position: relative;
  z-index: 5006;
  background: #1b2f3d;
  color: #d6e6f2;
  border: 1px solid #3b5465;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  font-weight: 700;
}

#controls button:hover,
.speed-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* CASINO */
#casino-section {
  position: relative;
}

#casino-section .casino-kickout-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 12, 18, 0.78);
  backdrop-filter: blur(2px);
}

#casino-section .casino-kickout-overlay.hidden {
  display: none;
}

#casino-section .casino-kickout-panel {
  width: min(480px, 92vw);
  padding: 18px 18px 16px;
  border-radius: 14px;
  border: 1px solid rgba(119, 158, 186, 0.55);
  background: linear-gradient(165deg, #173041, #101e2a);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.46);
  color: #e7f5ff;
  text-align: center;
}

#casino-section .casino-kickout-panel h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  letter-spacing: 0.02em;
}

#casino-section .casino-kickout-panel p {
  margin: 0 0 14px;
  color: rgba(220, 238, 248, 0.92);
  line-height: 1.35;
}

#casino-section .casino-kickout-panel button {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  width: min(280px, 100%);
  font-weight: 800;
  cursor: pointer;
  color: #062013;
  background: linear-gradient(160deg, #19dc6a, #11b755);
  box-shadow: 0 8px 18px rgba(16, 86, 48, 0.38);
}

#casino-section .casino-corner-brand {
  position: absolute;
  font-size: clamp(0.9rem, 1.5vw, 1.15rem);
  font-weight: 900;
  letter-spacing: 0.22em;
  color: rgba(149, 195, 228, 0.32);
  text-shadow: 0 0 12px rgba(0, 231, 1, 0.18);
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

#casino-section .casino-corner-brand.corner-tl {
  top: 8px;
  left: 10px;
}

#casino-section .casino-corner-brand.corner-tr {
  top: 8px;
  right: 10px;
}

#casino-section .casino-corner-brand.corner-bl {
  bottom: 8px;
  left: 10px;
}

#casino-section .casino-corner-brand.corner-br {
  bottom: 8px;
  right: 10px;
}

.crypto-slot-root,
.blackjack-root,
.casino-poker-classic,
.poker-wrapper,
.dragon-root,
.dice-root,
.slide-root,
.crash-root,
.roulette-root.mobile-roulette,
.diamond-root,
.keno-root,
#casino-horserace-screen .horserace-root {
  position: relative;
}

.crypto-slot-root .sage-brand,
.blackjack-root .sage-brand,
.casino-poker-classic .sage-brand,
.poker-wrapper .sage-brand,
.dragon-root .sage-brand,
.dice-root .sage-brand,
.slide-root .sage-brand,
.crash-root .sage-brand,
.roulette-root.mobile-roulette .sage-brand,
.diamond-root .sage-brand,
.keno-root .sage-brand {
  position: absolute;
  z-index: 12;
  font-size: calc(clamp(0.78rem, 1.05vw, 0.92rem) * var(--sage-brand-scale));
  font-family: var(--sage-brand-font);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
  pointer-events: none;
  user-select: none;
}

.crypto-slot-root .sage-brand.sage-top-left,
.blackjack-root .sage-brand.sage-top-left,
.casino-poker-classic .sage-brand.sage-top-left,
.poker-wrapper .sage-brand.sage-top-left,
.dragon-root .sage-brand.sage-top-left,
.dice-root .sage-brand.sage-top-left,
.slide-root .sage-brand.sage-top-left,
.crash-root .sage-brand.sage-top-left,
.roulette-root.mobile-roulette .sage-brand.sage-top-left,
.diamond-root .sage-brand.sage-top-left,
.keno-root .sage-brand.sage-top-left {
  top: 10px;
  left: 12px;
}

.slide-root .sage-brand.sage-top-left {
  font-size: calc(clamp(0.66rem, 0.88vw, 0.78rem) * var(--sage-brand-scale));
}

.casino-poker-classic .sage-brand.sage-top-left {
  top: 44px;
  left: 32px;
  z-index: 30;
}

.crypto-slot-root .sage-brand.sage-bottom-left,
.blackjack-root .sage-brand.sage-bottom-left,
.casino-poker-classic .sage-brand.sage-bottom-left,
.poker-wrapper .sage-brand.sage-bottom-left,
.dragon-root .sage-brand.sage-bottom-left,
.dice-root .sage-brand.sage-bottom-left,
.slide-root .sage-brand.sage-bottom-left,
.crash-root .sage-brand.sage-bottom-left,
.roulette-root.mobile-roulette .sage-brand.sage-bottom-left,
.diamond-root .sage-brand.sage-bottom-left,
.keno-root .sage-brand.sage-bottom-left {
  bottom: 10px;
  left: 12px;
}

.hilo-root .sage-hilo-note {
  margin: 6px 0 4px;
  text-align: center;
  font-size: calc(0.8rem * var(--sage-brand-scale));
  font-family: var(--sage-brand-font);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
  pointer-events: none;
  user-select: none;
}

.crossy-root .sage-crossy-row {
  margin: 4px auto 0;
  width: min(460px, calc(100% - 26px));
  display: flex;
  justify-content: center;
  gap: clamp(18px, 3.8vw, 36px);
  align-items: center;
  font-size: calc(0.8rem * var(--sage-brand-scale));
  font-family: var(--sage-brand-font);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
  opacity: 0.56;
  pointer-events: none;
  user-select: none;
}

#casino-horserace-screen .sage-horse-footer {
  margin-top: 2px;
  padding-top: 4px;
  text-align: center;
  font-size: calc(0.82rem * var(--sage-brand-scale));
  font-family: var(--sage-brand-font);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
  pointer-events: none;
  user-select: none;
}

.mines-root .grid .tile::before {
  content: "SAGE";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-size: calc(0.62rem * var(--sage-brand-scale));
  font-family: var(--sage-brand-font);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(237, 246, 255, 0.66);
  text-shadow: 0 1px 4px rgba(7, 18, 31, 0.52), 0 0 8px rgba(94, 172, 255, 0.35);
  -webkit-text-stroke: 1px rgba(7, 18, 31, 0.34);
  pointer-events: none;
  user-select: none;
}

.mines-root .grid .tile.revealed::before {
  color: rgba(237, 246, 255, 0.42);
}

.mines-root .grid .tile .icon {
  z-index: 2;
}

body.game-fullscreen #casino-section .casino-corner-brand,
body.phone-embedded-mini-mode #casino-section .casino-corner-brand {
  display: none !important;
}

#casino-games {
  max-width: 980px;
  margin: 10px auto 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

#casino-games .casino-game-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  --icon-fill: #f4fbff;
  --icon-stroke: #f4fbff;
  --icon-glow: rgba(255, 255, 255, 0.45);
  background: linear-gradient(155deg, #39546a, #263a4c);
  color: #fff;
  border: 1px solid rgba(164, 196, 219, 0.35);
  border-radius: 12px;
  cursor: pointer;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  aspect-ratio: 1 / 1;
  min-height: 104px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}

#casino-games .casino-game-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 86% 78%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 44%);
  opacity: 0.9;
}

#casino-games .casino-game-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  z-index: 0;
  background: linear-gradient(180deg, rgba(5, 12, 18, 0), rgba(5, 12, 18, 0.42));
}

#casino-games .casino-game-btn:hover {
  transform: translateY(-3px) scale(1.01);
  filter: brightness(1.07) saturate(1.06);
  border-color: rgba(222, 238, 255, 0.65);
}

#casino-games .casino-game-btn:active {
  transform: translateY(-1px) scale(0.995);
}

#casino-games .game-icon {
  position: relative;
  z-index: 1;
  width: clamp(42px, 5vw, 56px);
  height: clamp(42px, 5vw, 56px);
  display: grid;
  place-items: center;
  line-height: 1;
  filter:
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 8px var(--icon-glow));
}

#casino-games .game-icon svg {
  width: 100%;
  height: 100%;
}

#casino-games .game-icon .stroke {
  fill: none;
  stroke: var(--icon-stroke);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#casino-games .game-icon .fill {
  fill: var(--icon-fill);
}

#casino-games .game-title {
  position: absolute;
  z-index: 1;
  left: 10px;
  right: 10px;
  bottom: 9px;
  font-size: clamp(0.75rem, 1.3vw, 0.92rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

#casino-games .game-meta {
  position: absolute;
  z-index: 1;
  left: 10px;
  right: 10px;
  bottom: 25px;
  font-size: clamp(0.6rem, 1.05vw, 0.72rem);
  font-weight: 700;
  color: rgba(238, 248, 255, 0.88);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

#casino-games #pokerSessionMeta.is-up {
  color: rgba(165, 255, 188, 0.95);
}

#casino-games #pokerSessionMeta.is-down {
  color: rgba(255, 176, 194, 0.95);
}

#casino-games .casino-game-btn[data-game="dice"] {
  --icon-fill: #fff5d2;
  --icon-stroke: #ff4b75;
  --icon-glow: rgba(255, 188, 86, 0.65);
  background: linear-gradient(155deg, #8a44ff, #5f33d8);
}

#casino-games .casino-game-btn[data-game="mines"] {
  --icon-fill: #ffe06b;
  --icon-stroke: #1e2230;
  --icon-glow: rgba(255, 224, 107, 0.72);
  background: linear-gradient(155deg, #1388ff, #07b4ff);
}

#casino-games .casino-game-btn[data-game="crash"] {
  --icon-fill: #8ff3ff;
  --icon-stroke: #fff3a0;
  --icon-glow: rgba(147, 232, 255, 0.72);
  background: linear-gradient(155deg, #f7c732, #2f78ff);
}

#casino-games .casino-game-btn[data-game="hilo"] {
  --icon-fill: #c7f9ff;
  --icon-stroke: #fff8a8;
  --icon-glow: rgba(191, 255, 185, 0.7);
  background: linear-gradient(155deg, #00b057, #1f7ce7);
}

#casino-games .casino-game-btn[data-game="horseracing"] {
  --icon-fill: #ffd7a8;
  --icon-stroke: #fff2bf;
  --icon-glow: rgba(255, 195, 141, 0.74);
  background: linear-gradient(155deg, #ff8c3a, #d9462b);
}

#casino-games .casino-game-btn[data-game="dragontower"] {
  --icon-fill: #ffe19f;
  --icon-stroke: #ffd25f;
  --icon-glow: rgba(255, 224, 156, 0.75);
  background: linear-gradient(155deg, #ff9b3b, #dd4f4f);
}

#casino-games .casino-game-btn[data-game="keno"] {
  --icon-fill: #8ff3ff;
  --icon-stroke: #f6ffb4;
  --icon-glow: rgba(143, 243, 255, 0.78);
  background: linear-gradient(155deg, #2272ff, #15c2ff);
}

#casino-games .casino-game-btn[data-game="plinko"] {
  --icon-fill: #f9ffd0;
  --icon-stroke: #ffef8c;
  --icon-glow: rgba(255, 212, 128, 0.76);
  background: linear-gradient(155deg, #7a44ff, #ff4f8e);
}

#casino-games .casino-game-btn[data-game="roulette"] {
  --icon-fill: #ff7a7a;
  --icon-stroke: #ffe8a3;
  --icon-glow: rgba(255, 147, 147, 0.72);
  background: linear-gradient(155deg, #00b55b, #0f7a3f);
}

#casino-games .casino-game-btn[data-game="slide"] {
  --icon-fill: #ffe5a0;
  --icon-stroke: #dbf2ff;
  --icon-glow: rgba(199, 232, 255, 0.72);
  background: linear-gradient(155deg, #57a9ff, #3f6fdf);
}

#casino-games .casino-game-btn[data-game="blackjack"] {
  --icon-fill: #ff8fa5;
  --icon-stroke: #f4fbff;
  --icon-glow: rgba(255, 143, 165, 0.6);
  background: linear-gradient(155deg, #2f3c47, #111b24);
}

#casino-games .casino-game-btn[data-game="diamonds"] {
  --icon-fill: #90f7ff;
  --icon-stroke: #e1fcff;
  --icon-glow: rgba(137, 243, 255, 0.72);
  background: linear-gradient(155deg, #24c7c8, #0d87a3);
}

#casino-games .casino-game-btn[data-game="crossyroad"] {
  --icon-fill: #fff2a8;
  --icon-stroke: #ffe07c;
  --icon-glow: rgba(174, 255, 174, 0.72);
  background: linear-gradient(155deg, #18c45d, #169aa8);
}

#casino-games .casino-game-btn[data-game="slots"] {
  --icon-fill: #ffe28f;
  --icon-stroke: #f0fbff;
  --icon-glow: rgba(181, 223, 255, 0.72);
  background: linear-gradient(155deg, #7a4dff, #3f8fff);
}

#casino-games .casino-game-btn[data-game="poker"] {
  --icon-fill: #ffd3a0;
  --icon-stroke: #fff2b3;
  --icon-glow: rgba(255, 189, 126, 0.74);
  background: linear-gradient(155deg, #ff9151, #d54d3f);
}

#casinoLiveFeed {
  max-width: 980px;
  margin: 8px auto 0;
  padding: 10px 12px;
  border: 1px solid #2f4659;
  border-radius: 10px;
  background: linear-gradient(180deg, #182b39, #132331);
}

#casinoLiveFeed .feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #b7cad8;
  margin-bottom: 8px;
}

#casinoLiveFeedList {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 18px) / 4);
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding-bottom: 2px;
}

#casinoLiveFeedList::-webkit-scrollbar {
  height: 8px;
}

#casinoLiveFeedList::-webkit-scrollbar-thumb {
  background: rgba(92, 126, 152, 0.8);
  border-radius: 999px;
}

#casinoLiveFeedList li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #284054;
  border-radius: 8px;
  background: rgba(12, 27, 39, 0.7);
  font-size: 0.78rem;
  color: #dbe8f2;
  min-width: 0;
  scroll-snap-align: start;
}

#casinoLiveFeedList li:only-child {
  min-width: 100%;
}

#casinoLiveFeedList li .vip {
  color: #f4d27a;
  font-weight: 800;
}

#casinoLiveFeedList li .amt {
  color: #8dffbc;
  font-weight: 800;
}

#casino-container {
  background: linear-gradient(180deg, #14232f, #0f1b25);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 15px;
  margin-top: 20px;
  min-height: 150px;
}

#stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 14px auto 0;
  max-width: 980px;
}

#stats span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #1f3342, #162733);
  border: 1px solid #314a5b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

#stats span > span {
  color: var(--text-main);
  font-weight: 800;
}

#achievements-panel {
  position: relative;
  max-width: 980px;
  margin: 12px auto 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #314a5b;
  background: linear-gradient(180deg, #1a2d3a, #142430);
  text-align: left;
}

#achievements-panel h3 {
  margin: 0 0 8px;
  color: #d9e7f3;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

#achievements-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.achievement-section-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 2px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #cfe0ee;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.achievement-item {
  border: 1px solid #3a5263;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(16, 30, 39, 0.6);
}

.achievement-item.unlocked {
  border-color: rgba(76, 226, 106, 0.55);
  box-shadow: 0 0 0 1px rgba(76, 226, 106, 0.2) inset;
}

.achievement-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #e6f3ff;
}

.achievement-desc {
  margin-top: 2px;
  font-size: 0.76rem;
  color: #99afc0;
}

.achievement-progress {
  margin-top: 5px;
  font-size: 0.72rem;
  color: #b9cede;
  font-weight: 700;
}

/* SLOT MACHINE */
#slot-reels {
  display: grid;
  grid-template-rows: repeat(3, 64px);
  grid-template-columns: repeat(3, 64px);
  gap: 10px;
  justify-content: center;
  margin: 25px 0;
}

.slot-cell {
  font-size: 48px;
  text-align: center;
  line-height: 64px;
  color: #ff0;
  text-shadow:
    0 0 8px #ff0,
    0 0 18px #ff9900,
    0 0 30px #ff6600;
  border-radius: 8px;
}

#spinSlot {
  background: linear-gradient(145deg,#ffcc00,#ff6600);
  color:#000;
  font-weight:bold;
  border:none;
  padding:12px 28px;
  font-size:18px;
  border-radius:10px;
  cursor:pointer;
  box-shadow:0 0 15px #ff9900;
  transition:0.2s;
}

#spinSlot:hover {
  transform:translateY(-2px);
  box-shadow:0 0 25px #ffcc00;
}

#slot-message {
  font-size:20px;
  margin-top:15px;
  color:#0f0;
  text-shadow:0 0 5px #0f0;
}

#slotBet {
  width: 60px;
  margin-left: 10px;
  border-radius: 6px;
  border: 1px solid #0ff;
  background: #111;
  color: #0ff;
  padding: 4px;
  font-size: 16px;
  text-align: center;
}

#news {
  width: 100%;
  min-height: 24px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid #2f4553;
  background: rgba(15, 31, 44, 0.65);
  color: #9fd7ff;
  font-size: 0.86rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

#casino-win-popup-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 12050;
}

#casino-win-popup-layer.big-win-flash::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 120px, rgba(255, 235, 125, 0.25), rgba(255, 255, 255, 0) 45%),
    radial-gradient(circle at 50% 120px, rgba(104, 240, 255, 0.16), rgba(255, 255, 255, 0) 56%);
  animation: casinoBigWinPulse 520ms ease-in-out 2;
}

#casino-win-popup {
  position: absolute;
  top: 96px;
  left: 50%;
  width: min(84vw, 280px);
  min-height: 170px;
  transform: translateX(-50%) translateY(16px) scale(0.96);
  opacity: 0;
  border: 3px solid #05f318;
  border-radius: 14px;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, #1a3245 0%, #163145 100%);
  color: #7dfd83;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 0 12px rgba(5, 243, 24, 0.24);
  box-shadow:
    0 0 0 1px rgba(5, 243, 24, 0.24),
    0 0 28px rgba(5, 243, 24, 0.24),
    0 16px 24px rgba(0, 0, 0, 0.35);
}

#casino-win-popup.big-win {
  top: 78px;
  width: min(94vw, 760px);
  min-height: 96px;
  padding: 14px 22px;
  border-color: #ffd85f;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 237, 158, 0.28), rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg, #233f56 0%, #18354c 100%);
  color: #ffe18b;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 14px;
  box-shadow:
    0 0 0 1px rgba(255, 216, 95, 0.4),
    0 0 34px rgba(255, 216, 95, 0.45),
    0 18px 28px rgba(0, 0, 0, 0.45);
}

#casino-win-popup.big-win .casino-win-mult {
  font-size: clamp(1.3rem, 3vw, 2rem);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

#casino-win-popup.big-win .casino-win-divider {
  width: 100%;
  height: 3px;
}

#casino-win-popup.big-win .casino-win-amount {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #ffe18b;
  text-shadow: 0 0 16px rgba(255, 216, 95, 0.55), 0 1px 0 rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

#casino-win-popup .casino-win-mult {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
}

#casino-win-popup .casino-win-divider {
  width: 70px;
  height: 5px;
  border-radius: 999px;
  background: rgba(191, 220, 237, 0.28);
}

#casino-win-popup .casino-win-amount {
  font-size: clamp(1.45rem, 4.2vw, 2rem);
  font-weight: 900;
  line-height: 1;
  color: #64f972;
}

#casino-win-popup.show {
  animation: casinoWinPopupInOut 2200ms cubic-bezier(0.2, 0.86, 0.22, 1) both;
}

#casino-win-popup.big-win.show {
  animation: casinoWinPopupBigInOut 3000ms cubic-bezier(0.2, 0.86, 0.22, 1) both;
}

.casino-win-confetti {
  position: absolute;
  left: 50%;
  top: 140px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  background: var(--c, #ffd85f);
  opacity: 0;
  transform: translate(-50%, 0);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  animation: casinoConfettiFly var(--dur, 1200ms) ease-out var(--delay, 0ms) forwards;
}

@keyframes casinoWinPopupInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(16px) scale(0.96);
  }
  18% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  82% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px) scale(1.02);
  }
}

@keyframes casinoWinPopupBigInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.9);
  }
  12% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.04);
  }
  22% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  82% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-14px) scale(1.04);
  }
}

@keyframes casinoConfettiFly {
  0% {
    opacity: 0;
    transform: translate(-50%, -6px) rotate(0deg) scale(0.8);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx, 0px)), var(--ty, 140px)) rotate(var(--rot, 120deg)) scale(1);
  }
}

@keyframes casinoBigWinPulse {
  0% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.65;
  }
}

@media (max-width: 900px) {
  #casino-win-popup.big-win {
    width: min(95vw, 520px);
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 16px;
  }

  #casino-win-popup.big-win .casino-win-divider {
    width: 56px;
    height: 4px;
  }

  #stats {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  #casino-games {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #casino-games {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 460px) {
  #casino-games .casino-game-btn {
    min-height: 94px;
    border-radius: 10px;
  }
}

/* ===============================
   BLACKJACK (HI-LO STYLE)
   =============================== */
.blackjack-root {
  --bj-bg: #0f1923;
  --bj-panel: #1a2c38;
  --bj-panel-2: #213743;
  --bj-accent: #00e701;
  --bj-muted: #b5c7d3;
  --bj-light: #ffffff;
  --bj-danger: #e53935;
}

.blackjack-root .app {
  display: flex;
  gap: 16px;
  width: 100%;
  min-height: 520px;
}

.blackjack-root .sidebar {
  width: 32%;
  min-width: 260px;
  background: var(--bj-panel);
  padding: 18px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.blackjack-root .title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--bj-light);
}

.blackjack-root .balance {
  font-size: 0.92rem;
  color: var(--bj-muted);
}

.blackjack-root .bet-box {
  background: var(--bj-panel-2);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blackjack-root .bet-box label {
  font-size: 0.82rem;
  color: var(--bj-muted);
}

.blackjack-root .bet-box input,
.blackjack-root .bet-box select {
  width: 100%;
  border: 1px solid #2f4553;
  border-radius: 8px;
  padding: 10px;
  background: #172734;
  color: var(--bj-light);
  outline: none;
}

.blackjack-root .bet-box input:focus,
.blackjack-root .bet-box select:focus {
  border-color: #3f6d83;
}

.blackjack-root .bj-bet-list {
  gap: 6px;
}

.blackjack-root .bj-bet-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}

.blackjack-root .bj-bet-row-label {
  font-size: 0.78rem;
  color: var(--bj-muted);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.blackjack-root .btn {
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.blackjack-root .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.blackjack-root .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.blackjack-root .btn.ready {
  box-shadow: 0 0 0 1px rgba(166, 202, 235, 0.55), 0 0 16px rgba(121, 181, 238, 0.24);
  animation: bjReadyPulse 1.1s ease-in-out infinite;
}

.blackjack-root .btn-deal {
  background: var(--bj-accent);
  color: #06120b;
}

.blackjack-root .actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.blackjack-root .btn-hit {
  background: #00e701;
  color: #fff;
}

.blackjack-root .btn-stand {
  background: #ffcc00;
  color: #000;
}

.blackjack-root .btn-double {
  background: #7f8cff;
  color: #fff;
}

.blackjack-root .btn-split {
  background: #f28f2d;
  color: #fff;
}

.blackjack-root .main {
  width: 68%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.blackjack-root .table-panel {
  background: var(--bj-panel);
  border-radius: 12px;
  padding: 14px 128px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.blackjack-root .deck-area {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.blackjack-root .deck-stack {
  width: 82px;
  height: 114px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      45deg,
      #2d4d63,
      #2d4d63 8px,
      #1f3a4b 8px,
      #1f3a4b 16px
    );
  border: 2px solid #dbe9f3;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.32);
  position: relative;
}

.blackjack-root .deck-stack::before,
.blackjack-root .deck-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 2px solid rgba(219, 233, 243, 0.72);
  background: rgba(23, 39, 52, 0.45);
}

.blackjack-root .deck-stack::before {
  transform: translate(-7px, 5px);
  z-index: -1;
}

.blackjack-root .deck-stack::after {
  transform: translate(-13px, 10px);
  z-index: -2;
}

.blackjack-root .deck-stack.draw {
  animation: bjDeckDraw 220ms ease;
}

.blackjack-root .deck-count {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--bj-muted);
  letter-spacing: 0.01em;
}

.blackjack-root .table-panel.dealing {
  box-shadow: 0 0 0 1px rgba(0, 231, 1, 0.28), 0 12px 28px rgba(0, 0, 0, 0.28);
}

.blackjack-root .table-panel.win-burst {
  animation: bjTableWinBurst 760ms ease;
}

.blackjack-root .table-panel.loss-burst {
  animation: bjTableLossBurst 760ms ease;
}

.blackjack-root .table-panel.push-burst {
  animation: bjTablePushBurst 700ms ease;
}

.blackjack-root .hand-block {
  background: var(--bj-panel-2);
  border-radius: 10px;
  padding: 12px;
}

.blackjack-root .hand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.blackjack-root .hand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bj-light);
}

.blackjack-root .hand-score {
  font-size: 0.82rem;
  color: var(--bj-muted);
  font-weight: 700;
}

.blackjack-root .cards-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 126px;
  perspective: 1200px;
}

.blackjack-root .player-hands {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  perspective: 1200px;
}

.blackjack-root .player-hand {
  flex: 1 1 220px;
  min-width: 220px;
  border: 1px solid #2f4553;
  border-radius: 10px;
  background: #172734;
  padding: 8px;
}

.blackjack-root .player-hand.active {
  border-color: #4fa2ff;
  box-shadow: 0 0 0 1px rgba(79, 162, 255, 0.35);
}

.blackjack-root .player-hand.active-switch {
  animation: bjActiveSwitch 320ms cubic-bezier(0.2, 0.9, 0.24, 1);
}

.blackjack-root .player-hand-meta {
  font-size: 0.8rem;
  color: var(--bj-muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.blackjack-root .bj-card {
  --bj-tilt: 0deg;
  width: 90px;
  height: 126px;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform-origin: center center;
  backface-visibility: hidden;
}

.blackjack-root .bj-card.deal-in {
  animation: bjDealIn 620ms cubic-bezier(0.18, 0.88, 0.22, 1);
  animation-delay: var(--deal-delay, 0ms);
  animation-fill-mode: both;
}

.blackjack-root .bj-card.reveal-in {
  animation: bjRevealIn 440ms cubic-bezier(0.16, 0.86, 0.26, 1);
}

.blackjack-root .bj-card.hit-pop {
  animation: bjHitPop 360ms cubic-bezier(0.2, 0.9, 0.26, 1);
}

.blackjack-root .bj-card.settle-in {
  animation: bjSettleIn 140ms ease-out;
}

.blackjack-root .bj-card.red {
  color: var(--bj-danger);
}

.blackjack-root .bj-card.black {
  color: #111;
}

.blackjack-root .bj-card .rank {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

.blackjack-root .bj-card .rank.bottom {
  align-self: flex-end;
  transform: rotate(180deg);
}

.blackjack-root .bj-card .suit {
  font-size: 2.2rem;
  align-self: center;
  line-height: 1;
}

.blackjack-root .bj-card.back {
  background:
    repeating-linear-gradient(
      45deg,
      #2d4d63,
      #2d4d63 8px,
      #1f3a4b 8px,
      #1f3a4b 16px
    );
  border: 2px solid #dbe9f3;
}

.blackjack-root .bj-card.back .rank,
.blackjack-root .bj-card.back .suit {
  visibility: hidden;
}

.blackjack-root .message {
  border-radius: 10px;
  padding: 12px;
  background: #172734;
  color: #dce9f5;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blackjack-root .message.win {
  color: #8dffb2;
}

.blackjack-root .message.loss {
  color: #ff9aa1;
}

.blackjack-root .message.push {
  color: #d4e4f1;
}

.blackjack-root .message.pulse {
  animation: bjMessagePulse 280ms ease;
}

@keyframes bjDealIn {
  0% {
    transform: translate(var(--deal-from-x, -200px), var(--deal-from-y, -140px))
      rotate(var(--bj-tilt)) scale(0.62);
    opacity: 0;
    filter: blur(2px);
  }
  60% {
    transform: translateX(6px) translateY(3px) rotate(calc(var(--bj-tilt) * -0.24)) scale(1.04);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes bjDeckDraw {
  0% {
    transform: translateX(0) scale(1);
    filter: brightness(1);
  }
  50% {
    transform: translateX(-3px) scale(1.02);
    filter: brightness(1.08);
  }
  100% {
    transform: translateX(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes bjSettleIn {
  0% {
    transform: translateY(4px) scale(0.985);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes bjHitPop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: translateY(-3px) scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bjRevealIn {
  0% {
    transform: rotateY(90deg) scale(0.96);
    opacity: 0.1;
  }
  100% {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
}

@keyframes bjActiveSwitch {
  0% {
    transform: translateY(6px) scale(0.98);
    opacity: 0.7;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes bjMessagePulse {
  0% {
    transform: scale(0.98);
    opacity: 0.6;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bjReadyPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.07);
  }
}

@keyframes bjTableWinBurst {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 255, 151, 0);
    transform: scale(1);
  }
  45% {
    box-shadow: 0 0 0 1px rgba(99, 255, 151, 0.65), 0 0 24px rgba(99, 255, 151, 0.4);
    transform: scale(1.01);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 255, 151, 0);
    transform: scale(1);
  }
}

@keyframes bjTableLossBurst {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 92, 113, 0);
    transform: scale(1);
  }
  45% {
    box-shadow: 0 0 0 1px rgba(255, 92, 113, 0.65), 0 0 20px rgba(255, 92, 113, 0.34);
    transform: scale(0.996);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 92, 113, 0);
    transform: scale(1);
  }
}

@keyframes bjTablePushBurst {
  0% {
    box-shadow: 0 0 0 0 rgba(148, 179, 206, 0);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(148, 179, 206, 0.62), 0 0 18px rgba(148, 179, 206, 0.3);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(148, 179, 206, 0);
  }
}

@media (max-width: 900px) {
  .blackjack-root .app {
    flex-direction: column;
  }

  .blackjack-root .sidebar,
  .blackjack-root .main {
    width: 100%;
  }

  .blackjack-root .table-panel {
    padding-right: 14px;
  }

  .blackjack-root .deck-area {
    position: static;
    align-self: flex-end;
    margin-bottom: 2px;
  }
}

/* ===== COMPACT LOAN HUD ===== */
#loan-section {
  display:flex;
  align-items:center;
  gap:10px;
  background:#0b0b0b;
  border-bottom:2px solid #0ff;
  padding:6px 10px;
  font-size:14px;
  box-shadow:0 0 8px #0ff;
}

#loan-section span { white-space:nowrap; }

#loan-progress {
  flex:1;
  height:6px;
  background:#222;
  border-radius:3px;
  overflow:hidden;
}

#loan-progress-bar {
  height:100%;
  width:0%;
  background:linear-gradient(90deg,#00ffcc,#009977);
}

#loanInput {
  width:70px;
  font-size:12px;
  padding:3px;
  background:#111;
  color:#0ff;
  border:1px solid #0ff;
  border-radius:4px;
}

#loan-section button {
  padding:3px 8px;
  font-size:14px;
  border:none;
  border-radius:4px;
  background:#00ffcc;
  cursor:pointer;
}

/* ================= BANK SLIDE PANEL ================= */
#loan-panel {
  position: fixed;
  top: 0;
  right: -340px;
  width: 320px;
  height: 100%;
  background: #0b0b0b;
  border-left: 2px solid #0ff;
  box-shadow: -5px 0 20px rgba(0,255,255,0.3);
  transition: right 0.35s ease;
  z-index: 1000;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

#loan-panel.open { right: 0; }

#loan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  margin-bottom: 10px;
  color: #0ff;
}

#closeBankBtn {
  background: none;
  border: none;
  color: #0ff;
  font-size: 18px;
  cursor: pointer;
}

/* Override compact HUD layout for panel */
#loan-section {
  flex-direction: column;
  align-items: stretch;
  border-bottom: none;
  box-shadow: none;
}

#loan-section .loan-action-row,
#loan-section .auto-savings-row,
#loan-section .bank-transfer-row,
#loan-section .bank-buy-row,
#loan-section .bank-claim-row,
#loan-section .bank-admin-auth-row {
  display: grid;
  gap: 6px;
  align-items: center;
}

#loan-section .loan-action-row {
  grid-template-columns: 1fr 48px 48px;
}

#loan-section .auto-savings-row {
  grid-template-columns: 1fr 92px 92px;
}

#loan-section .bank-transfer-row {
  grid-template-columns: 1fr 110px;
}

#loan-section .bank-buy-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#loan-section .bank-claim-row {
  grid-template-columns: 1fr 1fr 120px;
  margin-top: 6px;
}

#loan-section .bank-claim-row select,
#loan-section .bank-claim-row input,
#loan-section .bank-admin-auth-row input {
  width: 100%;
  font-size: 12px;
  padding: 6px 7px;
  background: #111;
  color: #0ff;
  border: 1px solid #0ff;
  border-radius: 4px;
}

#loan-section .bank-claim-status {
  margin-top: 5px;
  font-size: 12px;
  color: #b9d1df;
}

#loan-section .bank-admin-panel {
  margin-top: 6px;
  border: 1px solid #29445b;
  border-radius: 6px;
  padding: 6px;
  background: rgba(11, 22, 30, 0.5);
}

#loan-section .bank-admin-panel summary {
  cursor: pointer;
  font-size: 12px;
  color: #9fc2de;
  user-select: none;
}

#loan-section .bank-admin-auth-row {
  grid-template-columns: 1fr 90px;
  margin-top: 6px;
}

#loan-section .bank-admin-claims {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

#loan-section .bank-admin-claim {
  border: 1px solid #2d495f;
  border-radius: 6px;
  padding: 6px;
  background: rgba(9, 20, 28, 0.7);
  font-size: 12px;
  color: #d8e9f5;
}

#loan-section .bank-admin-claim-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

#loan-section .bank-admin-claim-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

#loan-section .bank-admin-claim-actions button {
  flex: 1;
  font-size: 11px;
}

#loan-section .bank-vip-row {
  display: grid;
  gap: 6px;
  align-items: center;
  grid-template-columns: 1fr;
}

#loan-section #vipStatusText {
  font-size: 0.78rem;
  color: #b9d1df;
}

#loan-section #loanInput,
#loan-section #autoSavingsInput,
#loan-section #withdrawSavingsInput {
  width: 100%;
  font-size: 13px;
  padding: 6px 7px;
  background: #111;
  color: #0ff;
  border: 1px solid #0ff;
  border-radius: 4px;
}

#loan-section button {
  width: 100%;
  padding: 6px 8px;
}

#loan-section #withdrawAllSavingsBtn {
  margin-top: 2px;
}

#loan-section .bank-buy-row button {
  font-size: 11px;
  line-height: 1.2;
}

#loan-section button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bank-divider {
  width: 100%;
  height: 1px;
  background: rgba(0, 255, 255, 0.28);
  margin: 4px 0 2px;
}

/* ============================
   INTEGRATED POKER STYLES
   ============================ */
.poker-wrapper,
.poker-root {
  position: relative;
  width: min(1200px, 100%);
  height: min(760px, calc(100vh - 92px));
  margin: 0 auto;
  padding: 18px;
  border-radius: 26px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(950px 520px at 50% 50%, rgba(18, 93, 75, 0.5), rgba(2, 34, 32, 0.2) 58%, rgba(1, 20, 23, 0.95) 100%),
    linear-gradient(180deg, #003639, #02262d 65%, #021c24);
  border: 1px solid rgba(95, 136, 133, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 36px rgba(0, 0, 0, 0.52);
}

#poker-table {
  position: relative;
  width: min(1120px, 100%);
  height: min(700px, 100%);
  border-radius: 43% / 34%;
  box-sizing: border-box;
  border: 4px solid #f2b840;
  background:
    radial-gradient(circle at 50% 45%, #7d488f 0%, #693a81 56%, #532f69 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 233, 168, 0.34),
    inset 0 0 0 16px rgba(18, 16, 38, 0.3),
    inset 0 0 88px rgba(0, 0, 0, 0.28),
    0 22px 40px rgba(0, 0, 0, 0.46);
}

#poker-table::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 43% / 34%;
  border: 2px solid rgba(245, 189, 72, 0.5);
  pointer-events: none;
}

#poker-table::after {
  content: "";
  position: absolute;
  inset: 33px;
  border-radius: 42% / 33%;
  border: 2px solid rgba(206, 166, 231, 0.26);
  pointer-events: none;
}

.center-area {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: min(520px, 64%);
  pointer-events: none;
  z-index: 2;
}

#pot-wrap {
  font-size: 1rem;
  font-weight: 800;
  color: #e8f6ff;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  background: rgba(4, 22, 40, 0.82);
  border: 1px solid rgba(124, 182, 229, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  display: inline-block;
}

#pot-chips {
  position: relative;
  width: min(390px, 92%);
  height: 104px;
  margin: 0 auto 5px;
  pointer-events: none;
}

.pot-chip {
  --chip-x: 0px;
  --chip-y: 0px;
  --chip-rot: 0deg;
  --chip-color: #ff174c;
  --chip-edge: #ffd6df;
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--chip-edge);
  background: radial-gradient(circle at 50% 42%, #ff2a5b 0%, var(--chip-color) 62%, #d50039 100%);
  transform: translateX(var(--chip-x)) translateY(calc(var(--chip-y) * -1)) rotate(var(--chip-rot));
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: rgba(7, 20, 31, 0.9);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  animation: potChipDrop 220ms ease both;
}

.pot-chip::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 4px dashed #ffffff;
  opacity: 1;
}

.pot-chip::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 2px solid #ff4d73;
  background: #ff0f43;
}

@keyframes potChipDrop {
  from {
    opacity: 0;
    transform: translateX(var(--chip-x)) translateY(calc(var(--chip-y) * -1 - 10px)) rotate(var(--chip-rot)) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(var(--chip-x)) translateY(calc(var(--chip-y) * -1)) rotate(var(--chip-rot)) scale(1);
  }
}

#comm-cards {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 82px;
  margin-bottom: 8px;
  pointer-events: auto;
}

#poker-status {
  font-size: 0.9rem;
  color: #ddefff;
  min-height: 1.5em;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.poker-card {
  width: 52px;
  height: 74px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #ecf2f8);
  border: 1px solid rgba(18, 40, 58, 0.22);
  color: #162332;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 21px;
  position: relative;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.poker-card.red {
  color: #db2f45;
}

.poker-card.card-back {
  background:
    linear-gradient(135deg, #2b5fa8, #214882),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 6px, transparent 6px 12px);
  border: 1px solid rgba(232, 244, 255, 0.48);
}

.poker-card small {
  font-size: 17px;
  position: absolute;
  top: 3px;
  left: 4px;
  font-weight: 700;
}

.player-seat {
  position: absolute;
  width: 126px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border-radius: 14px;
  background: transparent;
  border: none;
  z-index: 3;
  transition: opacity 0.45s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.p-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  font-size: 42px;
  line-height: 1;
  font-weight: 500;
  color: #b2d4e8;
  background:
    radial-gradient(circle at 32% 30%, rgba(122, 162, 188, 0.3), rgba(32, 69, 92, 0.95) 64%),
    linear-gradient(180deg, #335975, #1b3c53);
  border: 2px solid rgba(172, 212, 236, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 14px rgba(0, 0, 0, 0.35);
}

.player-seat.is-user .p-avatar {
  color: #e5f6ff;
  border-color: rgba(123, 214, 255, 0.88);
  background:
    radial-gradient(circle at 32% 28%, rgba(115, 184, 240, 0.35), rgba(14, 83, 126, 0.92) 64%),
    linear-gradient(180deg, #1f5f88, #114061);
}

.player-seat.seat-empty .p-avatar {
  color: #ffdbe2;
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 136, 160, 0.35), rgba(124, 24, 46, 0.92) 64%),
    linear-gradient(180deg, #9f2e49, #5e1628);
  border-color: rgba(255, 171, 191, 0.82);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

.player-seat.seat-empty .p-cards,
.player-seat.seat-empty .p-hand-label {
  display: none;
}

.p-hand-label {
  min-height: 18px;
  margin-bottom: 4px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 800;
  color: #e3f2ff;
  background: rgba(12, 35, 58, 0.72);
  border: 1px solid rgba(122, 167, 201, 0.35);
  border-radius: 999px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-seat.is-user .p-hand-label {
  color: #ffd772;
}

.p-cards {
  display: flex;
  justify-content: center;
  gap: 4px;
  align-items: flex-end;
  height: 66px;
  margin-bottom: 6px;
}

.p-cards .poker-card {
  width: 40px;
  height: 58px;
  font-size: 17px;
}

.p-cards .poker-card small {
  font-size: 14px;
}

.p-info {
  width: 100%;
  max-width: 118px;
  text-align: center;
  background: rgba(6, 23, 39, 0.88);
  border-radius: 10px;
  padding: 2px 7px;
  border: 1px solid rgba(128, 162, 186, 0.35);
}

.p-name {
  font-size: 10px;
  font-weight: 800;
  color: #f5fbff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-bank {
  font-size: 10px;
  color: #87ffab;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.seat-folded {
  opacity: 0.5;
  filter: grayscale(80%);
}

.turn-active {
  box-shadow: 0 0 0 1px rgba(127, 219, 255, 0.38), 0 0 20px rgba(127, 219, 255, 0.42);
  transform: translateY(-2px);
}

.winner-glow {
  border-color: rgba(255, 220, 92, 0.92) !important;
  box-shadow: 0 0 0 1px rgba(255, 220, 92, 0.42), 0 0 30px rgba(255, 220, 92, 0.65) !important;
  background: rgba(255, 220, 92, 0.14) !important;
  transform: scale(1.08);
  z-index: 100;
}

.speech-bubble {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(238, 246, 255, 0.95);
  color: #0f2231;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 10;
}

.speech-bubble:after {
  content: none;
}

.speech-bubble.show {
  opacity: 1;
  transform: translateX(-50%) translateY(3px);
}

.player-seat.seat-top .speech-bubble {
  top: 76px;
  bottom: auto;
}

.player-seat.seat-top .speech-bubble:after {
  content: none;
}

.player-seat.seat-top .speech-bubble.show {
  top: 76px;
  bottom: auto;
}

#poker-controls {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: none;
  z-index: 150;
  width: 138px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(9, 23, 37, 0.9);
  border: 1px solid rgba(112, 146, 173, 0.45);
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.btn-poker {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 8px 7px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  color: #f3f8ff;
  background: linear-gradient(180deg, #4f6f85, #365367);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.btn-poker:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-poker:active {
  transform: translateY(0);
}

.btn-poker:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

.btn-poker.red {
  background: linear-gradient(180deg, #e15b6d, #b23a51);
}

.btn-poker.gold {
  background: linear-gradient(180deg, #ffbe52, #de8c26);
}

.raise-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 0;
}

#raise-input {
  width: 100%;
  padding: 6px 8px;
  text-align: center;
  border-radius: 7px;
  border: 1px solid rgba(133, 164, 188, 0.45);
  background: rgba(5, 17, 27, 0.95);
  color: #eef8ff;
  font-weight: 700;
  outline: none;
}

#deal-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, rgba(6, 20, 32, 0.42), rgba(4, 12, 22, 0.62));
}

#msg-overlay {
  pointer-events: auto;
  font-size: 2rem;
  margin-bottom: 16px;
  font-weight: 900;
  color: #f4fbff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

.btn-lrg {
  pointer-events: auto;
  border: 0;
  border-radius: 12px;
  padding: 13px 32px;
  font-size: 1.08rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #03310d;
  background: linear-gradient(180deg, #2eff4b, #00d713);
  box-shadow: 0 0 0 1px rgba(191, 255, 183, 0.62), 0 12px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-lrg:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.poker-hidden {
  opacity: 0;
  pointer-events: none !important;
}

.plinko-phone-app {
  --bg-0: #0f1923;
  --bg-1: #14202b;
  --panel: #1a242d;
  --panel-2: #0f1923;
  --ink: #ffffff;
  --muted: #8b9bb4;
  --accent: #00e701;
  --danger: #ff0055;
  --line: #2f3b4b;
  --line-soft: rgba(255, 255, 255, 0.1);
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background:
    radial-gradient(120% 70% at 50% -20%, rgba(0, 231, 1, 0.09) 0%, transparent 58%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  color: var(--ink);
  font-family: "Segoe UI", "Tahoma", "Arial", sans-serif;
}

.plinko-phone-app * {
  box-sizing: border-box;
}

.plinko-phone-app .phone-shell {
  height: 100%;
  width: min(430px, 100vw);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 36, 45, 0.98), rgba(13, 23, 34, 0.98));
}

.plinko-phone-app .app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(26, 36, 45, 0.98);
}

.plinko-phone-app .app-title {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.04em;
  font-weight: 800;
  line-height: 1.05;
}

.plinko-phone-app .title-main {
  display: block;
}

.plinko-phone-app .title-brand {
  display: block;
  margin-top: 2px;
  font-size: calc(0.52rem * var(--sage-brand-scale));
  font-family: var(--sage-brand-font);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
}

.plinko-phone-app .title-brand span {
  color: var(--accent);
}

.plinko-phone-app .header-actions {
  display: inline-flex;
  gap: 8px;
}

.plinko-phone-app .icon-btn {
  height: 32px;
  min-width: 32px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.plinko-phone-app .board-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

#casino-container.poker-classic-fullbleed {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.plinko-phone-app .status-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.plinko-phone-app .stat-pill {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(15, 25, 35, 0.92), rgba(17, 29, 41, 0.95));
  padding: 8px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.plinko-phone-app .stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  margin-bottom: 3px;
}

.plinko-phone-app .stat-value {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.plinko-phone-app .board-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(120% 85% at 50% -15%, rgba(0, 231, 1, 0.08) 0%, transparent 65%),
    linear-gradient(180deg, rgba(26, 36, 45, 0.98), rgba(15, 25, 35, 0.98));
  box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.35);
}

.plinko-phone-app canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.plinko-phone-app .bins-row {
  position: absolute;
  display: grid;
  gap: 1px;
  padding: 1px;
  box-sizing: border-box;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(168, 194, 220, 0.34);
  background: rgba(7, 13, 20, 0.8);
}

.plinko-phone-app .bin {
  border: 1px solid rgba(8, 13, 20, 0.46);
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.67rem;
  font-weight: 700;
  color: #071017;
  user-select: none;
  transition: filter 120ms ease;
  font-variant-numeric: tabular-nums;
  will-change: transform, filter;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.plinko-phone-app .bin.is-hit {
  animation: plinkoPhoneBinHit 620ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

@keyframes plinkoPhoneBinHit {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  30% {
    transform: translateY(-3px) scale(1.08);
    filter: brightness(1.28);
  }
  55% {
    transform: translateY(1px) scale(0.98);
    filter: brightness(1.12);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

.plinko-phone-app .hit-banner {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%) translateY(-8px);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 18, 26, 0.94);
  border: 1px solid var(--line-soft);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.plinko-phone-app .hit-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.plinko-phone-app .odds-tooltip {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 12, 20, 0.9);
  color: #eff6ff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 4;
}

.plinko-phone-app .odds-tooltip.show {
  opacity: 1;
}

.plinko-phone-app .control-bar {
  padding: 10px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 8px;
  align-items: stretch;
  background: rgba(26, 36, 45, 0.98);
}

.plinko-phone-app .bet-group {
  display: grid;
  gap: 3px;
}

.plinko-phone-app .bet-group span {
  font-size: 0.67rem;
  color: var(--muted);
}

.plinko-phone-app input,
.plinko-phone-app select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 0.9rem;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.plinko-phone-app input:focus,
.plinko-phone-app select:focus,
.plinko-phone-app button:focus-visible {
  box-shadow: 0 0 0 2px rgba(0, 231, 1, 0.2);
}

.plinko-phone-app input[type="range"] {
  padding: 0;
}

.plinko-phone-app .action-btn {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  color: #0d1a24;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.plinko-phone-app .drop-btn {
  background: linear-gradient(180deg, #3cff3c 0%, #00e701 100%);
}

.plinko-phone-app .auto-btn {
  background: linear-gradient(180deg, #415062 0%, #2f3b4b 100%);
  color: #ffffff;
}

.plinko-phone-app .auto-btn.is-running {
  background: linear-gradient(180deg, #ff3d7f 0%, #ff0055 100%);
}

.plinko-phone-app button:disabled,
.plinko-phone-app input:disabled,
.plinko-phone-app select:disabled {
  opacity: 0.5;
}

.plinko-phone-app .control-more {
  font-size: 1.35rem;
}

.plinko-phone-app .sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 15, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.plinko-phone-app .settings-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: min(430px, 100vw);
  max-height: 72dvh;
  background: linear-gradient(180deg, #1a242d 0%, #131f2b 100%);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  transition: transform 160ms ease;
}

.plinko-phone-app .sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.plinko-phone-app .sheet-header h2 {
  margin: 0;
  font-size: 0.95rem;
}

.plinko-phone-app .sheet-body {
  overflow-y: auto;
  padding: 10px 12px 14px;
  display: grid;
  gap: 10px;
}

.plinko-phone-app .sheet-field {
  display: grid;
  gap: 6px;
}

.plinko-phone-app .sheet-field label {
  font-size: 0.77rem;
  color: var(--muted);
}

.plinko-phone-app .sheet-field.sheet-field-toggle label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plinko-phone-app .sheet-field.sheet-field-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #00e701;
}

.plinko-phone-app.sheet-open .sheet-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.plinko-phone-app.sheet-open .settings-sheet {
  transform: translate(-50%, 0);
}
/* ======= P L I N K O  S C O P E D  C S S ======= */
.plinko-root {
  --bg-color: #0f1923;
  --card-bg: #1a242d;
  --accent: #00e701;
  --loss: #ff0055;
  --text: #ffffff;
}

.plinko-root .app-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
}

.plinko-root .game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.plinko-mini {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.plinko-mini .app-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  gap: 0;
  align-items: stretch;
}

.plinko-mini .game-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  padding: 0;
}

.plinko-mini .controls {
  border-radius: 14px;
  padding: 8px 10px;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.plinko-mini .stats {
  gap: 8px;
}

.plinko-mini .stat-box {
  min-width: 88px;
  padding: 6px 10px;
}

.plinko-mini .canvas-wrapper {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.plinko-casino {
  width: 100%;
  min-height: calc(100vh - 86px);
}

#casino-container > #plinko-casino-screen {
  width: 100%;
}

.phone-embed-shell #plinko-mini-screen,
body.phone-embedded-mini-mode #plinko-mini-screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.plinko-casino .app-layout {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(120px, 14vw, 180px);
  gap: clamp(12px, 1.8vw, 24px);
  align-items: stretch;
  padding: clamp(10px, 1.6vw, 20px);
}

.plinko-casino .game-container {
  width: min(100%, 1200px);
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(8px, 1.4vh, 14px);
}

.plinko-casino .controls {
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.plinko-casino .canvas-wrapper {
  width: min(100%, clamp(520px, 68vw, 920px));
  min-height: 0;
  height: auto;
  aspect-ratio: 1 / 1.02;
  max-height: min(76vh, calc(100vh - 250px));
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

.plinko-casino .history-column {
  width: clamp(120px, 14vw, 180px);
  height: 100%;
  max-height: none;
  min-height: 0;
}

.plinko-root .controls {
  display: flex;
  gap: 15px;
  background: var(--card-bg);
  padding: 15px 30px;
  border-radius: 50px;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.plinko-root .brand {
  font-family: var(--sage-brand-font);
  font-weight: 700;
  font-size: calc(0.9rem * var(--sage-brand-scale));
  margin-right: 15px;
  letter-spacing: 0.04em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
}

.plinko-root .input-group {
  display: flex;
  flex-direction: column;
}

.plinko-root .input-group label {
  font-size: 0.7rem;
  color: #8b9bb4;
  margin-bottom: 2px;
}

.plinko-root input,
.plinko-root select {
  background: #0f1923;
  border: 1px solid #2f3b4b;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: bold;
  outline: none;
}

.plinko-root input[type=range] {
  -webkit-appearance: none;
  width: 80px;
  height: 6px;
  background: #2f3b4b;
  border-radius: 3px;
  outline: none;
  padding: 0;
  margin-top: 5px;
}

.plinko-root input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}

.plinko-root input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.plinko-root .action-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 10px 30px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  text-transform: uppercase;
}

.plinko-root .action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(0, 231, 1, 0.4);
}

.plinko-root .action-btn:active {
  transform: translateY(0);
}

.plinko-root .auto-btn {
  background: #2f3b4b;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  width: 80px;
  padding: 10px 0;
  text-align: center;
}

.plinko-root .auto-btn.running {
  background: var(--loss);
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.4);
  animation: pulse 1.5s infinite;
  border-color: var(--loss);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.plinko-root .stats {
  display: flex;
  gap: 20px;
  width: 100%;
  justify-content: center;
}

.plinko-root .stat-box {
  background: var(--card-bg);
  padding: 8px 25px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.plinko-root .stat-box span:first-child {
  font-size: 0.75rem;
  color: #8b9bb4;
}

.plinko-root .stat-box span:last-child {
  font-size: 1.1rem;
  font-weight: bold;
}

.plinko-root .highlight {
  color: var(--accent);
}

.plinko-root .canvas-wrapper {
  position: relative;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow: hidden;
}

.plinko-root .plinko-hit-popup {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translate(-50%, -10px) scale(0.92);
  opacity: 0;
  z-index: 25;
  pointer-events: none;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(118, 255, 139, 0.66);
  background: rgba(8, 24, 14, 0.88);
  color: #79ff8b;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-shadow: 0 0 8px rgba(121, 255, 139, 0.45);
}

.plinko-root .plinko-hit-popup.show {
  animation: plinkoHitPopup 920ms cubic-bezier(0.2, 0.9, 0.25, 1.08);
}

@keyframes plinkoHitPopup {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.9);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.96);
  }
}

.plinko-root canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.poker-plinko-root .app-layout {
  width: 100%;
  max-width: 1460px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: stretch;
  padding: 16px 20px;
}

.poker-plinko-root .game-container {
  width: 100%;
}

.poker-plinko-root .canvas-wrapper {
  width: 100%;
}

.poker-plinko-root canvas {
  width: 100%;
  max-width: none;
}

.plinko-root .multiplier-container {
  --plinko-bins: 1;
  display: grid;
  grid-template-columns: repeat(var(--plinko-bins), minmax(0, 1fr));
  justify-content: stretch;
  width: 100%;
  position: absolute;
  bottom: 15px;
  left: 0;
  height: 30px;
  gap: 0;
  box-sizing: border-box;
  z-index: 10;
}

.plinko-root .multiplier {
  box-sizing: border-box;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.6rem;
  font-weight: bold;
  color: #000;
  border-radius: 4px;
  height: 30px;
  transition: transform 0.1s, filter 0.1s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  margin: 0;
  cursor: help;
}

.plinko-root .multiplier::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.plinko-root .multiplier:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

.plinko-root .multiplier.active {
  z-index: 2;
  filter: brightness(1.35) saturate(1.12) drop-shadow(0 0 14px rgba(255, 255, 255, 0.65));
}

.plinko-root .multiplier.active::after {
  animation: plinkoMultiplierRing 720ms ease-out;
}

@keyframes plinkoMultiplierHit {
  0% {
    transform: translateY(0) scale(1);
  }
  18% {
    transform: translateY(8px) scale(1.2);
  }
  42% {
    transform: translateY(-4px) scale(1.08);
  }
  62% {
    transform: translateY(3px) scale(1.04);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes plinkoMultiplierRing {
  0% {
    opacity: 0.95;
    transform: scale(0.92);
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

.plinko-root .odds-tooltip {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  border: 1px solid rgba(255,255,255,0.2);
  z-index: 20;
}

.plinko-root .history-column {
  width: 120px;
  height: 580px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.poker-plinko-root .history-column {
  width: 140px;
  height: 600px;
}

@media (max-width: 1100px) {
  .poker-plinko-root .app-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .poker-plinko-root .history-column {
    display: none;
  }
}

.plinko-root .history-header {
  text-align: center;
  font-weight: 900;
  font-size: 0.9rem;
  color: #8b9bb4;
  margin-bottom: 15px;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 10px;
}

.plinko-root .history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  height: 100%;
}

.plinko-root .history-item {
  width: 100%;
  padding: 10px 0;
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
  font-size: 0.9rem;
  color: #000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  animation: slideIn 0.3s ease-out;
  border: 1px solid rgba(255,255,255,0.1);
}

.plinko-mini-root .plinko-mini-history {
  display: none;
}

#plinko-casino-screen .history-column {
  height: 100%;
  max-height: none;
}

#plinko-casino-screen .app-layout {
  width: 100%;
}

#plinko-casino-screen .game-container {
  width: 100%;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================
   HI-LO CASINO GAME
   ========================= */
.hilo-root {
  --hilo-bg: #0f1923;
  --hilo-panel: #1a2c38;
  --hilo-panel-2: #213743;
  --hilo-accent: #00e701;
  --hilo-muted: #b5c7d3;
  --hilo-danger: #e53935;
  --hilo-light: #ffffff;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.hilo-root .app {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 520px;
  overflow: hidden;
}

.hilo-root .sidebar {
  width: 32%;
  flex: 0 0 32%;
  max-width: 420px;
  min-width: 260px;
  background: var(--hilo-panel);
  padding: 18px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.hilo-root .balance {
  font-size: 14px;
  color: var(--hilo-muted);
}

.hilo-root .potential-profits {
  background: var(--hilo-panel-2);
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  display: grid;
  gap: 6px;
}

.hilo-root .potential-profit {
  font-weight: 600;
}

.hilo-root .bet-input {
  background: var(--hilo-panel-2);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
}

.hilo-root .bet-input input {
  background: none;
  border: none;
  color: var(--hilo-light);
  flex: 1;
  font-size: 16px;
  outline: none;
}

.hilo-root .currency {
  font-weight: 700;
}

.hilo-root .bet-actions button {
  background: #2a3f4d;
  border: none;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.hilo-root .bet-actions button:hover {
  background: #355263;
}

.hilo-root .probabilities {
  background: var(--hilo-panel-2);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
}

.hilo-root .prob-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.hilo-root .prob-row.up {
  color: #00e701;
}

.hilo-root .prob-row.down {
  color: #3fa9f5;
}

.hilo-root .prob-row.same {
  color: #ffd54f;
}

.hilo-root .btn-bet {
  background: var(--hilo-accent);
  border: none;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  color: #000;
}

.hilo-root .btn-cashout {
  background: #ffcc00;
  border: none;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  color: #000;
  margin-top: 4px;
}

.hilo-root .btn-cashout:hover {
  background: #ffdb4d;
}

.hilo-root .guess-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hilo-root .guess-buttons button {
  background: var(--hilo-panel-2);
  border: 1px solid #2f4553;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.hilo-root .guess-buttons button:hover {
  background: #2a3f4d;
}

.hilo-root .guess-buttons .skip-button {
  grid-column: 1 / -1;
  background: #2b3440;
}

.hilo-root .main {
  width: 68%;
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
}

.hilo-root .cards-zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hilo-root .ghost {
  opacity: 0.15;
  text-align: center;
}

.hilo-root .ghost span {
  font-size: 11px;
}

.hilo-root .ghost-card {
  width: 90px;
  height: 120px;
  border: 2px dashed #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
}

.hilo-root .active-card .card {
  width: 140px;
  height: 200px;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  color: var(--hilo-danger);
  box-shadow: 0 0 25px rgba(229, 57, 53, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hilo-root .active-card {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.hilo-root .current-card-label {
  font-size: 12px;
  color: #a9bfd0;
  letter-spacing: 0.01em;
}

.hilo-root .rank {
  font-size: 28px;
  font-weight: 700;
}

.hilo-root .rank.bottom {
  align-self: flex-end;
  transform: rotate(180deg);
}

.hilo-root .suit {
  font-size: 48px;
  align-self: center;
}

.hilo-root .profit-bar {
  background: var(--hilo-panel-2);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  font-size: 14px;
  text-align: center;
}

.hilo-root .history {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding-bottom: 8px;
}

.hilo-root .history::-webkit-scrollbar {
  height: 8px;
}

.hilo-root .history::-webkit-scrollbar-thumb {
  background: #2a3f4d;
  border-radius: 4px;
}

.hilo-root .history-item {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
}

.hilo-root .history-card {
  width: 70px;
  height: 100px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 6px;
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
}

.hilo-root .history-card .rank {
  font-size: 18px;
  font-weight: 700;
}

.hilo-root .history-card .suit {
  font-size: 36px;
  margin: 4px 0;
}

.hilo-root .history-card .rank.bottom {
  transform: rotate(180deg);
}

.hilo-root .history-item .pill {
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.hilo-root .pill.green {
  background: #00e701;
  color: #000;
}

.hilo-root .pill.red {
  background: #e53935;
  color: #fff;
}

.hilo-root .btn-bet:disabled,
.hilo-root .btn-cashout:disabled,
.hilo-root .guess-buttons button:disabled,
.hilo-root .bet-actions button:disabled,
.hilo-root .bet-input input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes hilo-card-deal {
  0% {
    transform: translateY(-14px) scale(0.98);
    opacity: 0;
  }
  60% {
    transform: translateY(2px) scale(1.01);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.hilo-root .card-animate {
  animation: hilo-card-deal 280ms ease;
}

@media (max-width: 900px) {
  .hilo-root .app {
    flex-direction: column;
  }
  .hilo-root .sidebar,
  .hilo-root .main {
    width: 100%;
  }
}

/* ============================
   ROULETTE
   ============================ */
.roulette-root {
  --bg-main: #071b2a;
  --panel-left: #23384b;
  --panel-main: #062033;
  --line-soft: #365975;
  --text: #e4efff;
  --muted: #9fb5c9;
  --green-bright: #00e701;
  --red: #ff1f4e;
  --black-cell: #31495e;
  min-height: 100%;
  color: var(--text);
  background: linear-gradient(180deg, #0a2438, #071c2d 60%, #061a2a);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.roulette-root * {
  box-sizing: border-box;
}

.roulette-root button {
  font: inherit;
  color: inherit;
}

.roulette-root .app-shell {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(190px, 220px);
  background: #071f31;
}

.roulette-root .left-panel {
  border-right: 1px solid #20415b;
  background: linear-gradient(180deg, #23384b, #22384b 80%);
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.roulette-root .mode-tabs {
  background: #10273b;
  border-radius: 14px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.roulette-root .mode-btn {
  border: 0;
  border-radius: 11px;
  padding: 9px 10px;
  font-weight: 700;
  background: transparent;
  cursor: pointer;
}

.roulette-root .mode-btn.active {
  background: #3a5065;
}

.roulette-root .control-block {
  display: grid;
  gap: 8px;
}

.roulette-root .label-line {
  margin: 0;
  color: #c8d8e8;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.roulette-root .chip-strip {
  border: 1px solid #3b586f;
  background: #2c4255;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
}

.roulette-root .strip-arrow {
  border: 0;
  background: #2a4154;
  height: 100%;
  font-size: 24px;
  color: #8aa4bb;
  cursor: pointer;
}

.roulette-root .strip-arrow:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.roulette-root .chips-row {
  overflow-x: auto;
  display: flex;
  gap: 8px;
  padding: 9px 8px;
  scrollbar-width: thin;
}

.roulette-root .chips-row::-webkit-scrollbar {
  height: 6px;
}

.roulette-root .chip-option {
  min-width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.45), transparent 36%),
    radial-gradient(circle, #b46b45, #713f2c);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.roulette-root .chip-option.active {
  box-shadow: 0 0 0 2px rgba(0, 231, 1, 0.45);
  border-color: rgba(255, 255, 255, 0.9);
}

.roulette-root .chip-option:disabled {
  opacity: 0.45;
}

.roulette-root .total-box {
  border: 1px solid #3a596f;
  background: #32495e;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  font-weight: 700;
}

.roulette-root .quick-pill {
  margin-left: auto;
  color: #8ea5ba;
  border-left: 1px solid #42627d;
  padding-left: 9px;
  font-size: 12px;
}

.roulette-root .play-btn {
  border: 1px solid #00ca0f;
  border-radius: 5px;
  background: #00e701;
  color: #194c1e;
  height: 54px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.roulette-root .play-btn.auto-running {
  border-color: #ff7f94;
  background: #ff315d;
  color: #fff;
}

.roulette-root .play-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.roulette-root .secondary-btn {
  border-color: #52718a;
  background: #2f4a60;
  color: #dfefff;
  margin-top: -2px;
}

.roulette-root .meta-lines {
  padding-top: 4px;
  border-top: 1px solid #355772;
}

.roulette-root .meta-lines p {
  margin: 5px 0;
  color: #d2e0f1;
}

.roulette-root .main-panel {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: radial-gradient(circle at 50% -20%, #0c2f48, #072236 58%, #061f31);
}

.roulette-root .profit-popup {
  position: absolute;
  left: 50%;
  top: 104px;
  transform: translate(-50%, -10px) scale(0.92);
  width: min(230px, 62vw);
  border-radius: 12px;
  border: 2px solid #66ff5f;
  background: rgba(29, 54, 74, 0.97);
  box-shadow:
    0 0 0 1px rgba(102, 255, 95, 0.32),
    0 12px 28px rgba(0, 0, 0, 0.38);
  padding: 14px 12px 12px;
  display: grid;
  justify-items: center;
  gap: 9px;
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
  z-index: 20;
}

.roulette-root .profit-popup.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.roulette-root .profit-multiplier {
  font-size: clamp(28px, 3.2vw, 48px);
  font-weight: 900;
  color: #62f657;
  letter-spacing: 0.02em;
}

.roulette-root .profit-divider {
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: rgba(188, 209, 224, 0.38);
}

.roulette-root .profit-amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.roulette-root .profit-amount {
  color: #62f657;
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 800;
}

.roulette-root .profit-currency {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #e5bb45;
  color: #21313f;
  font-size: 16px;
  font-weight: 900;
}

.roulette-root .history-panel {
  border-left: 1px solid #20415b;
  background: linear-gradient(180deg, #1f3448, #172b3d 85%);
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  align-self: start;
  max-height: calc(100vh - 70px);
}

.roulette-root .history-panel h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #d9e8f8;
}

.roulette-root .history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
  min-height: 130px;
  scrollbar-width: thin;
}

.roulette-root .history-list::-webkit-scrollbar {
  width: 6px;
}

.roulette-root .history-empty {
  color: var(--muted);
  font-size: 13px;
  padding-top: 4px;
}

.roulette-root .history-chip {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #43657f;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.roulette-root .history-chip.red {
  background: var(--red);
  border-color: #ff6f8e;
}

.roulette-root .history-chip.black {
  background: var(--black-cell);
  border-color: #4f6a83;
}

.roulette-root .history-chip.green {
  background: #3f9f42;
  border-color: #6ec572;
}

.roulette-root .top-stage {
  padding: 10px 16px 2px;
  display: grid;
  justify-items: center;
}

.roulette-root .result-pill {
  min-width: 180px;
  text-align: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #43647f;
  background: #0b2f46;
  font-weight: 700;
  margin-bottom: 10px;
}

.roulette-root .wheel-stage {
  position: relative;
  width: min(44vw, 250px);
  aspect-ratio: 1;
  margin-bottom: 8px;
}

.roulette-root .wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 12px solid #03233a;
  box-shadow: inset 0 0 0 10px #07283d, 0 10px 24px rgba(0, 0, 0, 0.45);
  transition: transform 3400ms cubic-bezier(0.12, 0.8, 0.18, 1);
}

.roulette-root .wheel::after {
  content: "";
  position: absolute;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #001f33;
  box-shadow: inset 0 0 0 7px #03273f;
}

.roulette-root .pocket-label {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}

.roulette-root .pocket-label.red {
  color: #ffdce3;
}

.roulette-root .pocket-label.black {
  color: #d7e9ff;
}

.roulette-root .pocket-label.green {
  color: #d0ffd8;
}

.roulette-root .spokes {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.roulette-root .spokes span {
  position: absolute;
  width: 30%;
  height: 4px;
  background: #f6bf09;
  border-radius: 999px;
  transform-origin: center;
}

.roulette-root .spokes span:nth-child(1) {
  transform: rotate(18deg) translateX(14%);
}

.roulette-root .spokes span:nth-child(2) {
  transform: rotate(138deg) translateX(14%);
}

.roulette-root .spokes span:nth-child(3) {
  transform: rotate(258deg) translateX(14%);
}

.roulette-root .ball-orbit {
  position: absolute;
  inset: 30px;
  transform: rotate(0deg);
  will-change: transform;
}

.roulette-root .ball-orbit.is-spinning .ball {
  animation: roulette-ball-bounce 300ms ease-in-out infinite;
}

.roulette-root .ball {
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #fff, #dfe8f8 60%, #9aaec3);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 2px 6px rgba(0, 0, 0, 0.4);
}

@keyframes roulette-ball-bounce {
  0%,
  100% {
    top: 1px;
  }
  25%,
  75% {
    top: 3px;
  }
  50% {
    top: 2px;
  }
}

.roulette-root .last-result,
.roulette-root .status-line {
  margin: 2px 0;
  color: #bfd0df;
  font-weight: 600;
}

.roulette-root .status-line {
  min-height: 22px;
}

.roulette-root .table-stage {
  padding: 4px 16px 0;
  display: grid;
  justify-content: center;
  gap: 8px;
}

.roulette-root .number-board-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  gap: 4px;
  align-items: stretch;
}

.roulette-root .zero-cell {
  border: 1px solid #4ea552;
  border-radius: 5px;
  background: #449f41;
  font-size: 30px;
  font-weight: 800;
  min-height: 156px;
}

.roulette-root .number-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(36px, 52px));
  grid-template-rows: repeat(3, minmax(46px, 52px));
  gap: 3px;
}

.roulette-root .overlay-layer {
  position: absolute;
  left: 56px;
  right: 56px;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.roulette-root .bet-area {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: #e9f3ff;
  font-weight: 800;
  cursor: pointer;
  transition: filter 120ms ease, box-shadow 120ms ease;
}

.roulette-root .bet-area:hover {
  box-shadow: 0 0 0 1px rgba(0, 231, 1, 0.45), 0 0 9px rgba(0, 231, 1, 0.35);
  filter: brightness(1.07);
}

.roulette-root .number-cell {
  font-size: 14px;
}

.roulette-root .number-cell.red {
  background: var(--red);
}

.roulette-root .number-cell.black {
  background: var(--black-cell);
}

.roulette-root .column-bets {
  display: grid;
  grid-template-rows: repeat(3, minmax(46px, 52px));
  gap: 3px;
}

.roulette-root .side-bet {
  background: #092238;
  font-size: 14px;
}

.roulette-root .dozens-row,
.roulette-root .outside-row {
  display: grid;
  gap: 3px;
}

.roulette-root .dozens-row {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.roulette-root .outside-row {
  grid-template-columns: repeat(6, minmax(76px, 1fr));
}

.roulette-root .outside-bet {
  min-height: 50px;
  background: #0a243a;
  font-size: 13px;
}

.roulette-root .red-bet {
  background: var(--red);
}

.roulette-root .black-bet {
  background: var(--black-cell);
}

.roulette-root .combo-spot {
  position: absolute;
  border: 0;
  border-radius: 3px;
  background: rgba(113, 180, 255, 0.06);
  color: transparent;
  font-size: 0;
  pointer-events: auto;
}

.roulette-root .combo-spot:hover {
  background: rgba(0, 231, 1, 0.18);
}

.roulette-root .placed-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.55), transparent 34%),
    radial-gradient(circle, #1fc96a, #118346);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.roulette-root .table-footer {
  border-top: 1px solid #21445f;
  margin-top: 8px;
  padding: 10px 14px 12px;
  display: flex;
  justify-content: space-between;
}

.roulette-root .footer-btn {
  border: 0;
  background: transparent;
  color: #d8e8f7;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.roulette-root .footer-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.roulette-root .result-pill.red {
  border-color: rgba(255, 31, 78, 0.75);
}

.roulette-root .result-pill.black {
  border-color: rgba(111, 151, 185, 0.9);
}

.roulette-root .result-pill.green {
  border-color: rgba(57, 161, 65, 0.9);
}

.roulette-root .result-win {
  box-shadow: 0 0 0 1px rgba(0, 231, 1, 0.5), 0 0 14px rgba(0, 231, 1, 0.5) !important;
}

.roulette-root .number-hit {
  filter: saturate(1.18) brightness(1.1);
}

.roulette-root .placed-chip.chip-win {
  animation: roulette-chip-pulse 450ms ease-in-out infinite alternate;
}

@keyframes roulette-chip-pulse {
  to {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 0 14px rgba(0, 231, 1, 0.75);
  }
}

@media (max-width: 1200px) {
  .roulette-root .app-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .roulette-root .left-panel {
    border-right: 0;
    border-bottom: 1px solid #20415b;
  }

  .roulette-root .history-panel {
    border-left: 0;
    border-top: 1px solid #20415b;
    align-self: stretch;
    max-height: none;
  }

  .roulette-root .table-stage {
    overflow-x: auto;
    justify-content: start;
  }
}

@media (max-width: 760px) {
  .roulette-root .profit-popup {
    top: 86px;
  }

  .roulette-root .wheel-stage {
    width: min(72vw, 230px);
  }

  .roulette-root .number-grid {
    grid-template-columns: repeat(12, 40px);
    grid-template-rows: repeat(3, 44px);
  }

  .roulette-root .column-bets {
    grid-template-rows: repeat(3, 44px);
  }

  .roulette-root .zero-cell {
    min-height: 138px;
  }
}

/* ============================
   CASINO GAME FULLSCREEN VIEW
   ============================ */
body.game-fullscreen {
  overflow: hidden;
}

body.game-fullscreen h1,
body.game-fullscreen #nav,
body.game-fullscreen #loan-panel,
body.game-fullscreen #trading-section {
  display: none !important;
}

body.game-fullscreen #casino-section {
  display: block !important;
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 0;
  margin: 0;
  background: #050505;
  overflow: auto;
}

body.game-fullscreen #casino-section > h2,
body.game-fullscreen #casino-section > p,
body.game-fullscreen #casino-games,
body.game-fullscreen #backToTrading {
  display: none !important;
}

body.game-fullscreen #casino-container {
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
  min-height: 100vh;
  padding: 70px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.game-fullscreen #casino-container.casino-fullbleed {
  padding: 70px 0 0;
  align-items: stretch;
}

body.game-fullscreen #casino-container.casino-fullbleed > .crypto-slot-root,
body.game-fullscreen #casino-container.casino-fullbleed > .poker-wrapper,
body.game-fullscreen #casino-container.casino-fullbleed > .casino-poker-classic,
body.game-fullscreen #casino-container.casino-fullbleed > .dice-root,
body.game-fullscreen #casino-container.casino-fullbleed > .slide-root,
body.game-fullscreen #casino-container.casino-fullbleed > #casino-horserace-screen,
body.game-fullscreen #casino-container.casino-fullbleed > .diamond-root,
body.game-fullscreen #casino-container.casino-fullbleed > .mines-root,
body.game-fullscreen #casino-container.casino-fullbleed > .roulette-root,
body.game-fullscreen #casino-container.casino-fullbleed > .keno-root,
body.game-fullscreen #casino-container.casino-fullbleed > .blackjack-root {
  width: 100%;
  min-height: calc(100vh - 70px);
}

body.phone-embedded-mini-mode {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #070f19;
  color: #e9f2ff;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

html.phone-embedded-mini-mode {
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

body.phone-embedded-mini-mode h1,
body.phone-embedded-mini-mode #nav,
body.phone-embedded-mini-mode #loan-panel,
body.phone-embedded-mini-mode #trading-section,
body.phone-embedded-mini-mode #phoneBtn,
body.phone-embedded-mini-mode #phoneOverlay {
  display: none !important;
}

body.phone-embedded-mini-mode #casino-section {
  display: block !important;
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  background: #0a1320;
  overflow: hidden;
}

body.phone-embedded-mini-mode #casino-section > h2,
body.phone-embedded-mini-mode #casino-section > p,
body.phone-embedded-mini-mode #casino-games,
body.phone-embedded-mini-mode #backToTrading,
body.phone-embedded-mini-mode #game-exit-bar {
  display: none !important;
}

body.phone-embedded-mini-mode #casino-container {
  display: block !important;
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
  background: transparent;
}

body.phone-embedded-mini-mode #casino-container .phone-statusbar,
body.phone-embedded-mini-mode #casino-container .phone-status-time,
body.phone-embedded-mini-mode #casino-container .phone-dynamic-island,
body.phone-embedded-mini-mode #casino-container .phone-status-actions,
body.phone-embedded-mini-mode #casino-container .phone-status-icons {
  display: none !important;
}

body.phone-embedded-mini-mode #casino-container,
body.phone-embedded-mini-mode #casino-container * {
  overscroll-behavior: none;
}

body.phone-embedded-mini-mode #casino-container .phone-embed-scaled {
  width: 100%;
  max-width: 100% !important;
  overflow: hidden;
}

body.phone-embedded-mini-mode .phone-casino-shell {
  position: relative;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  overscroll-behavior: none;
  background: linear-gradient(180deg, #0e1727, #091220 62%, #070f1a);
}

body.phone-embedded-mini-mode .phone-casino-top {
  display: grid;
  grid-template-rows: auto;
  z-index: 10;
  background: rgba(10, 18, 31, 0.94);
  border-bottom: 1px solid rgba(101, 129, 164, 0.25);
  backdrop-filter: blur(10px);
}

body.phone-embedded-mini-mode .phone-casino-status {
  display: none !important;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #d6e4f6;
  padding: calc(env(safe-area-inset-top) + 7px) 10px 6px;
}

body.phone-embedded-mini-mode .phone-casino-time {
  letter-spacing: 0.02em;
}

body.phone-embedded-mini-mode .phone-casino-notch {
  justify-self: center;
  width: min(140px, 44vw);
  height: 20px;
  border-radius: 999px;
  background: #02070f;
  border: 1px solid rgba(50, 72, 98, 0.52);
}

body.phone-embedded-mini-mode .phone-casino-status-right {
  justify-self: end;
}

body.phone-embedded-mini-mode .phone-casino-status #phoneEmbedCloseBtn {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(81, 107, 133, 0.6);
  border-radius: 10px;
  background: #1b2f43;
  color: #dbe8f7;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

body.phone-embedded-mini-mode .phone-casino-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px;
}

body.phone-embedded-mini-mode .phone-casino-header h2 {
  margin: 0;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #edf5ff;
}

body.phone-embedded-mini-mode .phone-casino-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.phone-embedded-mini-mode .phone-casino-header-actions button {
  border: 1px solid #3d5772;
  border-radius: 10px;
  background: #1b2f43;
  color: #e5f1ff;
  font-size: 11px;
  font-weight: 700;
  min-height: 30px;
  padding: 0 10px;
}

body.phone-embedded-mini-mode .phone-casino-header-actions #phoneEmbedCloseBtn {
  width: 30px;
  min-width: 30px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}

body.phone-embedded-mini-mode .phone-casino-stage {
  min-height: 0;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#casino-section .phone-casino-outside-brand {
  display: none;
}

body.phone-embedded-mini-mode .phone-casino-side-brand {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-casino-outside-brand {
  position: absolute;
  top: 50%;
  z-index: 25;
  font-family: var(--sage-brand-font);
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

body.phone-embedded-mini-mode .phone-casino-outside-brand {
  display: none !important;
}

body.phone-embedded-mini-mode #casino-container .sage-brand,
body.phone-embedded-mini-mode #casino-container .sage-hilo-note,
body.phone-embedded-mini-mode #casino-container .sage-crossy-row,
body.phone-embedded-mini-mode #casino-container .sage-horse-footer,
body.phone-embedded-mini-mode #casino-container .plinko-phone-app .title-brand,
body.phone-embedded-mini-mode #casino-container .plinko-root .controls .brand {
  display: none !important;
}

body.phone-embedded-mini-mode #casino-container .mines-root .grid .tile::before {
  content: none !important;
}

body.phone-embedded-mini-mode .phone-casino-outside-brand.side-left {
  left: 6px;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
}

body.phone-embedded-mini-mode .phone-casino-outside-brand.side-right {
  right: 6px;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
}

body.phone-embedded-mini-mode .phone-casino-content {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 8px 8px;
  padding-left: max(8px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
}

body.phone-embedded-mini-mode .phone-casino-actionbar {
  display: grid;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(10, 18, 31, 0.95);
  border-top: 1px solid rgba(101, 129, 164, 0.25);
  z-index: 11;
}

body.phone-embedded-mini-mode .phone-casino-actionbar[hidden] {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-action-balance {
  font-size: 12px;
  color: #bad0e7;
}

body.phone-embedded-mini-mode .phone-action-balance strong {
  color: #f0f7ff;
}

body.phone-embedded-mini-mode .phone-action-row {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) auto auto auto;
  gap: 6px;
}

body.phone-embedded-mini-mode .phone-action-bet,
body.phone-embedded-mini-mode .phone-action-primary,
body.phone-embedded-mini-mode .phone-action-secondary,
body.phone-embedded-mini-mode .phone-action-more {
  min-height: 44px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

body.phone-embedded-mini-mode .phone-action-bet {
  width: 100%;
  border: 1px solid #3c5873;
  background: #13263a;
  color: #e8f2ff;
  padding: 0 10px;
}

body.phone-embedded-mini-mode .phone-action-primary {
  border: 0;
  background: linear-gradient(180deg, #20eb45, #12b532);
  color: #05240c;
  padding: 0 14px;
}

body.phone-embedded-mini-mode .phone-action-secondary {
  border: 1px solid #57d37b;
  background: #143125;
  color: #c9ffe0;
  padding: 0 14px;
}

body.phone-embedded-mini-mode .phone-action-more {
  border: 1px solid #3c5873;
  background: #182d42;
  color: #dfeeff;
  width: 44px;
  padding: 0;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-roulette .phone-casino-actionbar {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-roulette .phone-casino-top {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-roulette {
  grid-template-rows: minmax(0, 1fr);
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-plinko-native .phone-casino-actionbar {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-plinko-native {
  grid-template-rows: auto minmax(0, 1fr);
}

/* Hosted inside the in-phone iframe panel: avoid duplicate app header/top chrome. */
body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-hosted {
  grid-template-rows: minmax(0, 1fr) auto;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-hosted .phone-casino-top {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-hosted .phone-casino-content {
  padding-top: 8px;
}

body.phone-embedded-mini-mode .phone-casino-sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(3, 7, 14, 0.58);
  backdrop-filter: blur(1px);
}

body.phone-embedded-mini-mode .phone-casino-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  max-height: min(72%, calc(100% - 72px - env(safe-area-inset-top)));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #0f1f31;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 1px solid #355168;
  box-shadow: 0 -20px 36px rgba(0, 0, 0, 0.38);
  transform: translateY(105%);
  transition: transform 220ms ease;
}

body.phone-embedded-mini-mode .phone-casino-sheet.open {
  transform: translateY(0);
}

body.phone-embedded-mini-mode .phone-casino-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #30475d;
}

body.phone-embedded-mini-mode .phone-casino-sheet > header strong {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #deebf9;
}

body.phone-embedded-mini-mode .phone-casino-sheet > header button {
  min-height: 36px;
  border-radius: 9px;
  border: 1px solid #3e5b74;
  background: #183147;
  color: #deebf9;
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
}

body.phone-embedded-mini-mode .phone-casino-sheet-body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  display: grid;
  gap: 10px;
}

body.phone-embedded-mini-mode .phone-sheet-section {
  border: 1px solid #36526a;
  border-radius: 12px;
  background: #142a3f;
  padding: 8px;
  display: grid;
  gap: 8px;
}

body.phone-embedded-mini-mode .phone-sheet-section > h3 {
  margin: 0;
  font-size: 12px;
  color: #c9ddf2;
  letter-spacing: 0.03em;
}

body.phone-embedded-mini-mode .phone-sheet-empty {
  border: 1px solid #36526a;
  border-radius: 12px;
  background: #142a3f;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: #c2d5e9;
}

/* Style normalization for panels moved into More sheet.
   Prevents bright desktop panel backgrounds from looking like white blocks on phone. */
body.phone-embedded-mini-mode .phone-casino-sheet-body .left-panel,
body.phone-embedded-mini-mode .phone-casino-sheet-body .sidebar,
body.phone-embedded-mini-mode .phone-casino-sheet-body .side-panel,
body.phone-embedded-mini-mode .phone-casino-sheet-body .panel,
body.phone-embedded-mini-mode .phone-casino-sheet-body .history-panel,
body.phone-embedded-mini-mode .phone-casino-sheet-body .control-card,
body.phone-embedded-mini-mode .phone-casino-sheet-body .control-box,
body.phone-embedded-mini-mode .phone-casino-sheet-body .controls,
body.phone-embedded-mini-mode .phone-casino-sheet-body .controls-card,
body.phone-embedded-mini-mode .phone-casino-sheet-body .stats,
body.phone-embedded-mini-mode .phone-casino-sheet-body .panel-section,
body.phone-embedded-mini-mode .phone-casino-sheet-body .meta-panels,
body.phone-embedded-mini-mode .phone-casino-sheet-body .odds-strip,
body.phone-embedded-mini-mode .phone-casino-sheet-body .bet-feed-card,
body.phone-embedded-mini-mode .phone-casino-sheet-body .potential-profits,
body.phone-embedded-mini-mode .phone-casino-sheet-body .stats-box,
body.phone-embedded-mini-mode .phone-casino-sheet-body .chart-box,
body.phone-embedded-mini-mode .phone-casino-sheet-body .status-panel,
body.phone-embedded-mini-mode .phone-casino-sheet-body .drawn-numbers,
body.phone-embedded-mini-mode .phone-casino-sheet-body .field-head,
body.phone-embedded-mini-mode .phone-casino-sheet-body .mode-switch,
body.phone-embedded-mini-mode .phone-casino-sheet-body .mode-toggle {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 8px !important;
  margin: 0 !important;
  border: 1px solid #35526c !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, #1b3147, #16293d) !important;
  color: #deebf9 !important;
  box-shadow: none !important;
}

body.phone-embedded-mini-mode .phone-casino-sheet-body .control-block,
body.phone-embedded-mini-mode .phone-casino-sheet-body .field-block,
body.phone-embedded-mini-mode .phone-casino-sheet-body .card,
body.phone-embedded-mini-mode .phone-casino-sheet-body .stat-box,
body.phone-embedded-mini-mode .phone-casino-sheet-body .history-item,
body.phone-embedded-mini-mode .phone-casino-sheet-body .history-chip,
body.phone-embedded-mini-mode .phone-casino-sheet-body .odds-cell,
body.phone-embedded-mini-mode .phone-casino-sheet-body .draw-chip {
  background: #183148 !important;
  color: #deebf9 !important;
  border: 1px solid #34516a !important;
  border-radius: 9px !important;
}

body.phone-embedded-mini-mode .phone-casino-sheet-body input,
body.phone-embedded-mini-mode .phone-casino-sheet-body select,
body.phone-embedded-mini-mode .phone-casino-sheet-body textarea {
  width: 100%;
  background: #102437 !important;
  color: #ebf5ff !important;
  border: 1px solid #3a5a76 !important;
  border-radius: 9px !important;
}

body.phone-embedded-mini-mode .phone-casino-sheet-body button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #3d5d79 !important;
  background: linear-gradient(180deg, #2a4760, #223d53) !important;
  color: #e8f3ff !important;
  border-radius: 9px !important;
}

body.phone-embedded-mini-mode .phone-casino-sheet-body .block-title,
body.phone-embedded-mini-mode .phone-casino-sheet-body label,
body.phone-embedded-mini-mode .phone-casino-sheet-body .label-line,
body.phone-embedded-mini-mode .phone-casino-sheet-body dt {
  color: #bcd2e8 !important;
}

body.phone-embedded-mini-mode .phone-casino-sheet-body strong,
body.phone-embedded-mini-mode .phone-casino-sheet-body dd,
body.phone-embedded-mini-mode .phone-casino-sheet-body .highlight {
  color: #eff7ff !important;
}

body.phone-embedded-mini-mode .phone-casino-sheet-body .phone-sheet-section > :not(h3) {
  min-width: 0;
}

body.phone-embedded-mini-mode .phone-casino-sheet-body .bet-btn,
body.phone-embedded-mini-mode .phone-casino-sheet-body .play-btn,
body.phone-embedded-mini-mode .phone-casino-sheet-body .start-btn,
body.phone-embedded-mini-mode .phone-casino-sheet-body #playBtn,
body.phone-embedded-mini-mode .phone-casino-sheet-body #spinBtn,
body.phone-embedded-mini-mode .phone-casino-sheet-body #startBtn,
body.phone-embedded-mini-mode .phone-casino-sheet-body .auto-action {
  background: linear-gradient(180deg, #22f33f, #00ca26) !important;
  border-color: #18c73c !important;
  color: #08350f !important;
  font-weight: 800 !important;
}

body.phone-embedded-mini-mode .phone-casino-sheet-body .secondary-btn,
body.phone-embedded-mini-mode .phone-casino-sheet-body .footer-btn,
body.phone-embedded-mini-mode .phone-casino-sheet-body .mini-btn,
body.phone-embedded-mini-mode .phone-casino-sheet-body .adjust-btn {
  background: linear-gradient(180deg, #28435a, #20374c) !important;
  color: #deecfb !important;
}

body.phone-embedded-mini-mode .phone-casino-sheet-body canvas {
  border-radius: 8px;
  border: 1px solid rgba(78, 114, 144, 0.5);
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-roulette .phone-casino-sheet-body .number-board-wrap,
body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-roulette .phone-casino-sheet-body .dozens-row,
body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-roulette .phone-casino-sheet-body .outside-row,
body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-roulette .phone-casino-sheet-body .table-footer {
  background: rgba(9, 19, 34, 0.88);
  border: 1px solid rgba(79, 103, 133, 0.45);
  border-radius: 12px;
  padding: 8px;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-roulette .phone-casino-sheet-body .number-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(3, 32px);
  gap: 3px;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-roulette .phone-casino-sheet-body .column-bets {
  grid-template-rows: repeat(3, 32px);
  gap: 3px;
}

body.phone-embedded-mini-mode .phone-game-root,
body.phone-embedded-mini-mode .phone-game-root * {
  box-sizing: border-box;
}

body.phone-embedded-mini-mode .phone-game-root {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none !important;
  width: auto;
  margin: 0 !important;
  overflow: hidden;
  transform-origin: top left;
}

body.phone-embedded-mini-mode .phone-game-root button,
body.phone-embedded-mini-mode .phone-game-root input,
body.phone-embedded-mini-mode .phone-game-root select {
  min-height: 44px;
}

body.phone-embedded-mini-mode .phone-game-root button {
  touch-action: manipulation;
}

body.phone-embedded-mini-mode .phone-game-root button:active {
  transform: scale(0.985);
}

body.phone-embedded-mini-mode .phone-game-root input[type="number"] {
  font-size: 16px;
}

body.phone-embedded-mini-mode .phone-game-root canvas,
body.phone-embedded-mini-mode .phone-game-root svg,
body.phone-embedded-mini-mode .phone-game-root img {
  max-width: 100%;
}

/* Shared no-scroll mobile layout system:
   sidebars and advanced panels are moved into the More bottom sheet. */
body.phone-embedded-mini-mode .phone-game-root .app-shell,
body.phone-embedded-mini-mode .phone-game-root .main-layout {
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  min-height: 0;
}

body.phone-embedded-mini-mode .phone-game-root .left-panel,
body.phone-embedded-mini-mode .phone-game-root .sidebar,
body.phone-embedded-mini-mode .phone-game-root .history-panel {
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
}

body.phone-embedded-mini-mode .phone-game-root .phone-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.phone-embedded-mini-mode .phone-game-root .phone-inline-actions button {
  min-height: 40px;
}

/* Per-game mobile overrides for dense layouts */
body.phone-embedded-mini-mode .phone-game-plinko.plinko-root {
  padding: 0;
  min-height: 0;
  height: 100%;
}

body.phone-embedded-mini-mode .phone-game-plinko.plinko-root .app-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 0;
  padding: 0;
  height: 100%;
  min-height: 0;
}

body.phone-embedded-mini-mode .phone-game-plinko.plinko-root .game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 0;
}

body.phone-embedded-mini-mode .phone-game-plinko.plinko-root .controls,
body.phone-embedded-mini-mode .phone-game-plinko.plinko-root .history-column,
body.phone-embedded-mini-mode .phone-game-plinko.plinko-root .stats {
  display: none;
}

body.phone-embedded-mini-mode .phone-game-plinko.plinko-root .canvas-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  height: 100%;
  width: min(100%, 520px);
  max-width: 100%;
  min-height: 240px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

body.phone-embedded-mini-mode .phone-game-plinko.plinko-root #plinkoCanvas {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  background: #121e2b;
  border-radius: 10px;
}

body.phone-embedded-mini-mode .phone-game-plinko.plinko-root .multiplier-container {
  bottom: 8px;
  height: 36px;
  padding: 0;
}

body.phone-embedded-mini-mode .phone-game-plinko.plinko-root .multiplier {
  height: 34px;
  min-width: 0;
  margin: 0;
  font-size: 0.62rem !important;
  border-radius: 5px;
}

body.phone-embedded-mini-mode .phone-game-slots .crypto-slot-root .app-shell {
  --reel-height: clamp(220px, 38vh, 320px);
  padding: 4px;
}

body.phone-embedded-mini-mode .phone-game-slots .phone-inline-slots-actions {
  justify-content: center;
  margin: 0 0 8px;
}

body.phone-embedded-mini-mode .phone-game-slots .phone-inline-slots-actions #betBtn {
  width: min(210px, 100%);
}

body.phone-embedded-mini-mode .phone-game-blackjack .blackjack-root .table-panel {
  padding-left: 236px;
}

body.phone-embedded-mini-mode .phone-game-blackjack .phone-inline-bj-actions {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 216px;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
}

body.phone-embedded-mini-mode .phone-game-blackjack .phone-inline-bj-actions .btn {
  min-height: 64px;
  padding: 14px 12px;
  font-size: 17px;
  font-weight: 800;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .board-area {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: stretch center;
  justify-items: center;
  align-items: stretch;
  gap: 0;
  padding: clamp(2px, 0.6vh, 6px) clamp(2px, 1.5vw, 6px);
  min-height: 0;
  overflow: hidden;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .board-area::before,
body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .board-area::after {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .app {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  gap: 0;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .side-panel {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-dragontower .phone-inline-dragon-actions {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-dragontower .phone-inline-dragon-actions .btn {
  width: 100%;
  padding: 10px 6px;
  font-size: 11px;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .tower {
  width: max-content;
  max-width: none;
  max-height: none;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .tower::before,
body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .tower::after,
body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .tower-chrome {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .tower-inner {
  border-radius: 10px;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .slot {
  width: 52px;
  height: 52px;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .tile {
  width: 32px;
  height: 42px;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .tile.fail {
  width: 42px;
  height: 42px;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .board {
  width: max-content;
  margin: 0 auto;
  padding: 10px 8px;
  gap: 7px;
}

body.phone-embedded-mini-mode .phone-game-dragontower.dragon-root .row {
  gap: 7px;
}

body.phone-embedded-mini-mode .phone-game-dice .dice-root .game-panel {
  padding: 10px;
  min-height: 0;
}

body.phone-embedded-mini-mode .phone-game-dice .phone-inline-dice-actions {
  margin-bottom: 8px;
}

body.phone-embedded-mini-mode .phone-game-dice .phone-inline-dice-actions #rollBtn {
  width: 100%;
  margin-top: 0;
}

body.phone-embedded-mini-mode .phone-game-dice .dice-root .slider-display-area {
  padding: 34px 14px 18px;
}

body.phone-embedded-mini-mode .phone-game-slide .slide-root .top-bar {
  padding: 8px 10px;
  gap: 8px;
}

body.phone-embedded-mini-mode .phone-game-slide .phone-inline-slide-actions #bet-btn {
  margin: 0;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.95rem;
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root {
  padding: 0;
  min-height: 0;
  height: 100%;
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root #app {
  width: 100%;
  border-radius: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root .game-shell {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root .chart-panel {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root .top-history-wrap,
body.phone-embedded-mini-mode .phone-game-crash .crash-root .top-history-list {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root .top-history-wrap {
  display: none;
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root .display-area {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root #curveCanvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  z-index: 1;
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root .side-payouts {
  display: none;
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root .multiplier {
  z-index: 2;
  background: transparent !important;
  pointer-events: none;
}

body.phone-embedded-mini-mode .phone-game-crash .crash-root .crash-overlay {
  z-index: 3;
}

body.phone-embedded-mini-mode .phone-game-mines .mines-root .app {
  grid-template-columns: 1fr;
  padding: 0.35rem;
  min-height: 0;
}

body.phone-embedded-mini-mode .phone-game-mines .mines-root .panel {
  display: none;
}

body.phone-embedded-mini-mode .phone-game-mines .mines-root .game-area {
  border-radius: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  place-items: center;
  min-height: 0;
}

body.phone-embedded-mini-mode .phone-game-mines .mines-root .grid {
  width: min(100%, 330px);
  gap: 0.42rem;
}

body.phone-embedded-mini-mode .phone-game-mines .mines-root .tile {
  aspect-ratio: 1 / 1;
}

body.phone-embedded-mini-mode .phone-game-mines .mines-root #roundOverlay {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .panel-bet {
  display: none;
}

body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .panel-game {
  padding: 8px;
}

body.phone-embedded-mini-mode .phone-game-diamonds .phone-action-row {
  grid-template-columns: minmax(96px, 1fr) auto auto;
}

body.phone-embedded-mini-mode .phone-game-diamonds .phone-action-secondary {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .result-header,
body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .history {
  display: none;
}

body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root {
  padding: 0;
  min-height: 0;
  height: 100%;
}

body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .app {
  grid-template-columns: 1fr;
  width: 100%;
  height: 100%;
  margin: 0;
  gap: 0;
}

body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .panel-game {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}

body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .diamond-grid {
  margin-top: 0;
  width: min(100%, 340px);
  gap: 8px;
}

body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .slot {
  min-height: 110px;
}

body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .payout-ladder {
  display: block;
  width: min(100%, 340px);
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(15, 33, 46, 0.9);
  border: 1px solid #2d4554;
}

body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .payout-rows {
  max-height: 120px;
  overflow: auto;
}

body.phone-embedded-mini-mode .phone-game-hilo .hilo-root .app {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 0;
  height: 100%;
}

body.phone-embedded-mini-mode .phone-game-hilo .hilo-root .sidebar {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-hilo .hilo-root .main {
  width: 100%;
  min-width: 0;
  padding: 8px;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

body.phone-embedded-mini-mode .phone-game-hilo .hilo-root .guess-buttons {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.phone-embedded-mini-mode .phone-game-hilo .hilo-root .phone-inline-hilo-guesses {
  width: min(100%, 360px);
  margin-inline: auto;
}

body.phone-embedded-mini-mode .phone-game-hilo .hilo-root .cards-zone {
  justify-content: center;
}

body.phone-embedded-mini-mode .phone-game-hilo .hilo-root .ghost {
  display: none;
}

body.phone-embedded-mini-mode .phone-game-hilo .hilo-root .active-card {
  margin-inline: auto;
}

body.phone-embedded-mini-mode .phone-game-hilo .hilo-root .active-card .card {
  width: 110px;
  height: 156px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root {
  height: 100%;
  overflow: hidden;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .app-shell {
  grid-template-columns: 1fr !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100%;
  min-height: 0;
  background: #070a19;
  border-radius: 14px;
  overflow: hidden;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .left-panel,
body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .history-panel {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .main-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: radial-gradient(150% 110% at 50% 0%, #133936, #090e20 48%, #060914 100%);
  overflow: hidden;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .top-stage {
  padding: 8px 8px 8px;
  gap: 8px;
  border-bottom: 1px solid rgba(95, 113, 141, 0.3);
  background: linear-gradient(180deg, #090f23, #070c1b 68%, #060910);
  overflow: hidden;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-toolbtn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(95, 118, 148, 0.5);
  border-radius: 10px;
  background: #121e33;
  color: #f0d067;
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-balance-pill {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid rgba(85, 105, 132, 0.54);
  border-radius: 999px;
  background: rgba(17, 29, 52, 0.86);
  color: #f4f7ff;
  font-size: 17px;
  font-weight: 800;
  padding: 0 14px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .result-pill {
  display: none;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .wheel-stage {
  --wheel-size: min(460px, calc(100% + 120px));
  position: relative;
  width: 100%;
  height: clamp(180px, 38vh, 292px);
  margin: 2px auto 0;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #0a5b3d, #0b4737 55%, #10253b);
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .wheel-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid #f5c339;
  z-index: 11;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .wheel {
  position: absolute;
  left: 50%;
  top: 10px;
  width: var(--wheel-size);
  height: var(--wheel-size);
  margin-left: calc(var(--wheel-size) / -2);
  border-width: 6px;
  border-color: rgba(222, 191, 84, 0.95);
  box-shadow: inset 0 0 0 4px rgba(8, 35, 58, 0.94), 0 10px 24px rgba(0, 0, 0, 0.45);
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .wheel::after {
  width: 62%;
  box-shadow: inset 0 0 0 7px #03273f;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .ball-orbit {
  position: absolute;
  left: 50%;
  top: 10px;
  width: var(--wheel-size);
  height: var(--wheel-size);
  margin-left: calc(var(--wheel-size) / -2);
  padding: 18px;
  box-sizing: border-box;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .spokes {
  position: absolute;
  left: 50%;
  top: 10px;
  width: var(--wheel-size);
  height: var(--wheel-size);
  margin-left: calc(var(--wheel-size) / -2);
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .pocket-label {
  width: 22px;
  font-size: clamp(9px, 1.6vw, 12px);
  font-weight: 900;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  z-index: 8;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .last-result,
body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .status-line {
  display: none;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .status-line {
  color: #d8e6f8;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .table-stage {
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 10px 8px 8px;
  gap: 8px;
  border-radius: 16px;
  border: 1px solid rgba(96, 112, 141, 0.34);
  background: linear-gradient(180deg, rgba(7, 10, 20, 0.98), rgba(5, 8, 18, 0.98));
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-zero-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-zero-btn {
  min-height: 52px;
  border-radius: 16px;
  border-color: #52c95d;
  background: linear-gradient(180deg, #41cb5b, #2da54a);
  color: #f6fff7;
  font-size: 26px;
  line-height: 1;
  display: grid;
  gap: 0;
  place-items: center;
  padding: 2px 0 4px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-zero-btn span {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.9;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .number-board-wrap {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  border: 1px solid rgba(78, 99, 125, 0.48);
  border-radius: 14px;
  padding: 8px;
  background: rgba(9, 14, 25, 0.86);
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .zero-cell {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .number-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .column-bets {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .overlay-layer {
  display: none;
  pointer-events: none;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .combo-spot {
  pointer-events: none !important;
  background: transparent !important;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .number-cell,
body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .side-bet {
  min-height: 42px;
  border-radius: 12px;
  font-size: clamp(12px, 2.2vw, 16px);
  font-weight: 800;
  position: relative;
  padding-bottom: 10px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .number-cell::after {
  content: "36:1";
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: rgba(223, 236, 250, 0.75);
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .outside-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .outside-low-bet,
body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .outside-high-bet {
  display: none !important;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .outside-bet {
  min-height: 46px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 8px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .outside-bet[data-bet-id="outside-even"],
body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .outside-bet[data-bet-id="outside-odd"] {
  background: linear-gradient(180deg, #ffd534, #f0bf00);
  color: #241d03;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .outside-bet.red-bet {
  background: linear-gradient(180deg, #ff3f5e, #ef2149);
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .outside-bet.black-bet {
  background: linear-gradient(180deg, #3c5164, #2e4358);
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .outside-bet::after {
  content: "2:1";
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: rgba(236, 243, 251, 0.72);
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .dozens-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .dozens-row .outside-bet {
  min-height: 44px;
  border-radius: 14px;
  background: linear-gradient(180deg, #b568ff, #9353dd);
  font-size: 14px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .dozens-row .outside-bet::after {
  content: "3:1";
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .table-footer {
  display: none;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-footer {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(95, 113, 141, 0.45);
  padding: 8px 4px 10px;
  background: linear-gradient(180deg, #070b18, #050712);
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-total {
  border: 1px solid rgba(115, 96, 46, 0.85);
  border-radius: 999px;
  background: rgba(9, 11, 20, 0.92);
  color: #fff0cb;
  font-size: 16px;
  font-weight: 800;
  padding: 2px 14px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-textbtn {
  border: 0;
  background: transparent;
  color: #ff666d;
  font-size: 15px;
  font-weight: 800;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-textbtn:disabled {
  opacity: 0.45;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-footer-row {
  display: grid;
  grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  gap: 8px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-mini-btn {
  min-height: 48px;
  border: 1px solid #41716d;
  border-radius: 12px;
  background: rgba(19, 50, 41, 0.88);
  color: #d8fff4;
  font-size: 16px;
  font-weight: 800;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-spin-btn {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #5450e9, #9034f1, #6f31ff);
  color: #efe6ff;
  letter-spacing: 0.14em;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 9px 16px rgba(69, 52, 171, 0.42);
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-mini-btn:disabled,
body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .phone-roulette-spin-btn:disabled {
  opacity: 0.46;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .placed-chip {
  min-width: 18px;
  height: 18px;
  left: auto;
  right: 3px;
  top: 3px;
  transform: none;
  border-width: 1px;
  background: radial-gradient(circle, #ffdb3d, #f0b100);
  color: #2f2300;
  font-size: 9px;
  font-weight: 900;
  padding: 0 4px;
}

body.phone-embedded-mini-mode .phone-game-roulette.roulette-root .outside-bet .placed-chip {
  right: 5px;
  top: 5px;
}

body.phone-embedded-mini-mode .phone-game-keno .keno-root .app-shell {
  grid-template-columns: 1fr !important;
}

body.phone-embedded-mini-mode .phone-game-keno .keno-root .tile {
  min-height: clamp(52px, 11vw, 64px);
}

body.phone-embedded-mini-mode .phone-game-crossyroad.crossy-root .road-shell,
body.phone-embedded-mini-mode .phone-game-crossyroad .crossy-root .road-shell {
  width: 100% !important;
  margin: 0 auto !important;
}

body.phone-embedded-mini-mode .phone-game-crossyroad.crossy-root .stage-card,
body.phone-embedded-mini-mode .phone-game-crossyroad .crossy-root .stage-card {
  height: min(46vh, 360px) !important;
}

body.phone-embedded-mini-mode #plinkoPhoneApp.phone-game-plinko .phone-shell {
  width: 100%;
  max-width: 100%;
}

body.phone-embedded-mini-mode #plinkoPhoneApp.phone-game-plinko .app-header {
  padding: 8px 10px;
}

body.phone-embedded-mini-mode #plinkoPhoneApp.phone-game-plinko .board-panel {
  padding: 6px;
  gap: 6px;
}

body.phone-embedded-mini-mode #plinkoPhoneApp.phone-game-plinko .status-row {
  gap: 6px;
}

body.phone-embedded-mini-mode #plinkoPhoneApp.phone-game-plinko .stat-pill {
  padding: 6px 8px;
}

body.phone-embedded-mini-mode #plinkoPhoneApp.phone-game-plinko .control-bar {
  padding: 8px;
  gap: 6px;
}

body.phone-embedded-mini-mode #plinkoPhoneApp.phone-game-plinko .board-stage {
  min-height: 0;
}

body.phone-embedded-mini-mode .phone-game-dice .dice-root .main-layout,
body.phone-embedded-mini-mode .phone-game-slide .slide-root .app,
body.phone-embedded-mini-mode .phone-game-diamonds .diamond-root .app,
body.phone-embedded-mini-mode .phone-game-mines .mines-root .game-shell,
body.phone-embedded-mini-mode .phone-game-poker .poker-wrapper {
  width: 100% !important;
  max-width: 100% !important;
}

body.phone-embedded-mini-mode.game-fullscreen #casino-section,
body.phone-embedded-mini-mode.game-fullscreen #casino-container {
  z-index: auto;
}

body.game-fullscreen #casino-container.slots-fullbleed .crypto-slot-root .app-shell {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 70px);
  height: calc(100vh - 70px);
  border-radius: 0;
  grid-template-columns: minmax(220px, 23vw) 1fr;
  gap: 8px;
  padding: 6px;
}

body.game-fullscreen #casino-container.slots-fullbleed .crypto-slot-root {
  --reel-height: clamp(260px, 38vh, 380px);
}

body.game-fullscreen #casino-container.slots-fullbleed .crypto-slot-root .left-panel {
  max-height: calc(100vh - 82px);
  overflow: auto;
  gap: 6px;
}

body.game-fullscreen #casino-container.slots-fullbleed .crypto-slot-root .control-block {
  padding: 6px;
}

body.game-fullscreen #casino-container.slots-fullbleed .crypto-slot-root .right-panel {
  gap: 6px;
}

body.game-fullscreen #casino-container.slots-fullbleed .crypto-slot-root .slot-machine {
  min-height: 0;
}

body.game-fullscreen #casino-container.slots-fullbleed .crypto-slot-root #resultsChart {
  height: 110px;
}

body.game-fullscreen #casino-container.poker-fullbleed .poker-wrapper {
  width: 100%;
  max-width: none;
  height: calc(100vh - 70px);
  min-height: calc(100vh - 70px);
  border-radius: 0;
  padding: 18px;
  border: 0;
}

body.game-fullscreen #casino-container.poker-fullbleed #poker-table {
  width: min(1260px, 100%);
  height: min(760px, 100%);
  border-radius: 43% / 34%;
  border-width: 4px;
}

body.game-fullscreen #casino-container.poker-fullbleed #poker-controls {
  right: auto;
  bottom: auto;
}

body.game-fullscreen #casino-container.poker-fullbleed #deal-overlay {
  border-radius: 20px;
}

body.game-fullscreen #casino-container.dice-fullbleed .dice-root .main-layout {
  max-width: none;
  width: 100%;
  margin: 0;
  border-radius: 0;
  min-height: calc(100vh - 70px - 64px);
}

body.game-fullscreen #casino-container.slide-fullbleed .slide-root {
  height: calc(100vh - 70px);
}

body.game-fullscreen #casino-container.blackjack-fullbleed .blackjack-root {
  min-height: calc(100vh - 70px);
  padding: 0;
}

body.game-fullscreen #casino-container.blackjack-fullbleed .blackjack-root .app {
  min-height: calc(100vh - 70px - 64px);
  gap: 20px;
}

body.game-fullscreen #casino-container.blackjack-fullbleed .blackjack-root .sidebar {
  width: 28%;
  min-width: 300px;
}

body.game-fullscreen #casino-container.blackjack-fullbleed .blackjack-root .main {
  width: 72%;
}

body.game-fullscreen #casino-container.blackjack-fullbleed .blackjack-root .table-panel {
  flex: 1;
  min-height: 0;
}

body.game-fullscreen #casino-container.horse-fullbleed #casino-horserace-screen {
  min-height: calc(100vh - 70px);
}

body.game-fullscreen #casino-container.diamond-fullbleed .diamond-root {
  padding: 0;
}

body.game-fullscreen #casino-container.diamond-fullbleed .diamond-root .app {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: calc(100vh - 70px);
}

body.game-fullscreen #casino-container.keno-fullbleed .keno-root .app-shell {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 70px);
  margin: 0;
  border-radius: 0;
  grid-template-columns: minmax(240px, 300px) 1fr;
}

body.game-fullscreen #casino-container.keno-fullbleed .keno-root .sidebar {
  border-right: 1px solid #2e465b;
  border-bottom: 0;
}

body.game-fullscreen #casino-container.mines-fullbleed .mines-root .app {
  min-height: calc(100vh - 70px);
  padding: 0;
}

body.game-fullscreen #casino-container.roulette-fullbleed .roulette-root .app-shell {
  min-height: calc(100vh - 70px);
  height: calc(100vh - 70px);
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(170px, 220px);
}

body.game-fullscreen #casino-container.roulette-fullbleed .roulette-root .left-panel {
  overflow: auto;
}

body.game-fullscreen #casino-container.roulette-fullbleed .roulette-root .history-panel {
  max-height: calc(100vh - 70px);
}

body.game-fullscreen #casino-container.roulette-fullbleed .roulette-root .table-stage {
  overflow: auto;
}

body.game-fullscreen #casino-container > .plinko-casino,
body.game-fullscreen #casino-container > .dragon-root,
body.game-fullscreen #casino-container > .crossy-root {
  width: 100%;
  min-height: calc(100vh - 70px);
}

body.game-fullscreen #casino-container > .plinko-casino .app-layout {
  width: 100%;
  max-width: none;
  height: calc(100vh - 70px);
  min-height: calc(100vh - 70px);
  margin: 0;
  padding: clamp(10px, 1.6vw, 20px);
  gap: clamp(12px, 1.8vw, 24px);
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) clamp(120px, 14vw, 180px);
}

body.game-fullscreen #casino-container > .plinko-casino .game-container {
  flex: 1 1 auto;
  min-width: 0;
  width: min(100%, 1260px);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  gap: clamp(8px, 1.4vh, 14px);
  align-items: center;
  justify-content: flex-start;
}

body.game-fullscreen #casino-container > .plinko-casino .controls {
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: min(100%, clamp(560px, 72vw, 980px));
}

body.game-fullscreen #casino-container > .plinko-casino .brand {
  font-size: 1rem;
  margin-right: 6px;
}

body.game-fullscreen #casino-container > .plinko-casino input,
body.game-fullscreen #casino-container > .plinko-casino select {
  padding: 6px 10px;
  font-size: 0.9rem;
}

body.game-fullscreen #casino-container > .plinko-casino .action-btn {
  padding: 8px 16px;
}

body.game-fullscreen #casino-container > .plinko-casino .stats {
  gap: 10px;
}

body.game-fullscreen #casino-container > .plinko-casino .stat-box {
  min-width: 88px;
  padding: 6px 14px;
}

body.game-fullscreen #casino-container > .plinko-casino .canvas-wrapper {
  flex: 1 1 auto;
  width: min(100%, clamp(520px, 68vw, 920px));
  min-height: 0;
  height: auto;
  aspect-ratio: 1 / 1.02;
  max-height: min(76vh, calc(100vh - 250px));
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 0 auto;
  overflow: hidden;
}

body.game-fullscreen #casino-container > .plinko-casino canvas {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

body.game-fullscreen #casino-container > .plinko-casino .history-column {
  width: clamp(120px, 14vw, 180px);
  height: 100%;
  max-height: none;
  min-height: 0;
  padding: 10px;
}

body.game-fullscreen #casino-container > .plinko-casino .history-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
}

body.game-fullscreen #casino-container > .poker-plinko-root .app-layout {
  max-width: none;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 150px;
}

body.game-fullscreen #casino-container > .dragon-root .app {
  min-height: calc(100vh - 70px);
  height: calc(100vh - 70px);
  grid-template-columns: minmax(260px, 26vw) 1fr;
  gap: 14px;
  padding: 10px;
}

body.game-fullscreen #casino-container > .dragon-root .side-panel {
  overflow: auto;
  padding: 12px;
  gap: 10px;
}

body.game-fullscreen #casino-container > .dragon-root .panel-section {
  padding: 10px;
}

body.game-fullscreen #casino-container > .dragon-root .board-area {
  padding: 18px;
}

body.game-fullscreen #casino-container > .dragon-root .tower {
  width: min(500px, 60vh, 92vw);
}

body.game-fullscreen #casino-container > .dragon-root .board {
  padding: 14px;
  gap: 8px;
}

body.game-fullscreen #casino-container > .dragon-root .slot {
  width: 68px;
  height: 68px;
}

body.game-fullscreen #casino-container > .dragon-root .tile {
  width: 42px;
  height: 54px;
}

body.game-fullscreen #casino-container > .dragon-root .tile.fail {
  width: 52px;
  height: 52px;
}

body.game-fullscreen #casino-container > .crossy-root .road-shell {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 70px);
  margin: 0;
  border-radius: 0;
}

body.game-fullscreen #casino-container > .crossy-root .stage-card {
  height: clamp(250px, 54vh, 520px);
  min-height: 250px;
}

body.game-fullscreen #casino-container > .crossy-root .control-card {
  padding: 10px 12px 0;
}

body.game-fullscreen #casino-container > .crossy-root .control-row {
  gap: 10px;
}

body.game-fullscreen #casino-container > .crossy-root .control-block {
  min-height: 90px;
  padding: 10px;
}

body.game-fullscreen #casino-container > .crossy-root #betInput,
body.game-fullscreen #casino-container > .crossy-root .mini-btn,
body.game-fullscreen #casino-container > .crossy-root .difficulty-btn {
  height: 44px;
  font-size: 1.1rem;
}

body.game-fullscreen #casino-container > .crossy-root .notice-pill {
  font-size: 1rem;
  padding: 7px 9px;
}

body.game-fullscreen #casino-container > .crossy-root .start-btn {
  height: 50px;
  font-size: 1rem;
  line-height: 1.05;
}

body.game-fullscreen #casino-container > .crossy-root .sub-stats {
  font-size: 1rem;
}

body.game-fullscreen #casino-container > .crossy-root .mode-tabs {
  margin-top: 8px;
  gap: 14px;
}

body.game-fullscreen #casino-container > .crossy-root .tab-btn {
  font-size: 1rem;
  padding: 9px 6px 11px;
}

body.game-fullscreen #casino-container > .crossy-root .status-text {
  margin: 8px 12px 12px;
  font-size: 1rem;
}

/* ============================
   CASINO-ONLY POLISH
   (phone apps excluded)
   ============================ */
body:not(.phone-embedded-mini-mode) #casino-container.blackjack-fullbleed .blackjack-root .sage-brand.sage-bottom-left {
  left: 30px;
  bottom: 30px;
}

body:not(.phone-embedded-mini-mode) #casino-container.blackjack-fullbleed .blackjack-root {
  min-height: calc(100vh - 70px);
  background: linear-gradient(180deg, #0e1822 0%, #121f2b 48%, #0f1923 100%);
}

body:not(.phone-embedded-mini-mode) #casino-container.blackjack-fullbleed .blackjack-root .app {
  min-height: calc(100vh - 70px);
  height: calc(100vh - 70px);
}

body:not(.phone-embedded-mini-mode) #casino-container.blackjack-fullbleed .blackjack-root .main {
  min-height: 0;
  padding-bottom: 4px;
}

body:not(.phone-embedded-mini-mode) #casino-container.blackjack-fullbleed .blackjack-root .table-panel {
  flex: 1 1 auto;
  min-height: 0;
}

body:not(.phone-embedded-mini-mode) #casino-container.slots-fullbleed .crypto-slot-root .sage-brand.sage-bottom-left {
  left: calc(50% + 40px);
  bottom: 14px;
  transform: translateX(-50%);
  opacity: 0.52;
}

body:not(.phone-embedded-mini-mode) #casino-container.poker-classic-fullbleed .casino-poker-classic .sage-brand.sage-top-left {
  top: 94px;
  left: 22px;
}

body:not(.phone-embedded-mini-mode) #casino-container.poker-classic-fullbleed .casino-poker-classic #poker-table {
  transform: translateY(86px) scale(0.82);
  transform-origin: center top;
}

#casino-container.poker-classic-fullbleed .casino-poker-classic #poker-table {
  transform: translateY(86px) scale(0.82) !important;
  transform-origin: center top !important;
}

body:not(.phone-embedded-mini-mode) #casino-container.poker-classic-fullbleed {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 46%, rgba(11, 140, 109, 0.34), transparent 50%),
    linear-gradient(155deg, #003d35, #033128 62%, #032a23 100%) !important;
}

body:not(.phone-embedded-mini-mode) #casino-container.poker-classic-fullbleed .casino-poker-classic {
  min-height: 100vh;
  height: 100vh;
  background:
    radial-gradient(circle at 50% 48%, rgba(11, 140, 109, 0.34), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.28), transparent 74%),
    linear-gradient(155deg, #003d35, #033128 62%, #032a23 100%);
}

body:not(.phone-embedded-mini-mode) #casino-container.poker-classic-fullbleed .casino-poker-classic .ambient {
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.12), transparent 46%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.32), transparent 80%);
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon {
  overflow: hidden;
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon .app-layout {
  height: calc(100vh - 70px);
  min-height: 0;
  align-items: center;
  gap: 6px;
  padding: 6px;
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon .controls {
  padding: 6px 10px;
  gap: 6px;
  border-radius: 12px;
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon .stats {
  gap: 6px;
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon .stat-box {
  padding: 4px 10px;
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon .game-container {
  gap: 6px;
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon .controls .brand {
  font-size: calc(0.46rem * var(--sage-brand-scale));
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon canvas {
  width: auto !important;
  height: min(76vh, 820px) !important;
  max-width: 100%;
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon .history-column {
  width: 108px;
  padding: 10px;
  height: min(42vh, 390px);
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon .controls .input-group label {
  font-size: 0.62rem;
}

body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon .controls input,
body:not(.phone-embedded-mini-mode) #casino-container.plinko-neon-fullbleed > .plinko-casino-neon .controls select {
  padding: 6px 8px;
  font-size: 0.86rem;
}

body:not(.phone-embedded-mini-mode) #casino-container.slide-fullbleed .slide-root {
  --sidebar-width: clamp(300px, 23vw, 360px);
}

body:not(.phone-embedded-mini-mode) #casino-container.slide-fullbleed .slide-root .sidebar {
  padding: 18px 16px;
  gap: 14px;
}

body:not(.phone-embedded-mini-mode) #casino-container.slide-fullbleed .slide-root .top-bar {
  height: 56px;
  padding: 0 14px;
}

body:not(.phone-embedded-mini-mode) #casino-container.slide-fullbleed .slide-root #bet-btn {
  margin-top: 2px;
  padding: 12px;
  font-size: 1rem;
}

body:not(.phone-embedded-mini-mode) #casino-container.slide-fullbleed .slide-root .game-area {
  position: relative;
}

body:not(.phone-embedded-mini-mode) #casino-container.slide-fullbleed .slide-root .slide-line-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: calc(0.4rem * var(--sage-brand-scale));
  font-family: var(--sage-brand-font);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
  opacity: 0.48;
  pointer-events: none;
  user-select: none;
  z-index: 6;
}

body:not(.phone-embedded-mini-mode) #casino-container.slide-fullbleed .slide-root .slide-line-brand-top {
  top: 10px;
}

body:not(.phone-embedded-mini-mode) #casino-container.slide-fullbleed .slide-root .slide-line-brand-bottom {
  bottom: 10px;
}

body:not(.phone-embedded-mini-mode) #casino-container.casino-fullbleed > .crash-root .sage-brand.sage-bottom-left {
  left: 62px;
}

body:not(.phone-embedded-mini-mode) #casino-container.crossy-fullbleed > .crossy-root .status-text:empty {
  display: none;
}

body:not(.phone-embedded-mini-mode) #casino-container.crossy-fullbleed > .crossy-root .sage-crossy-row {
  margin: 8px auto 14px;
}

body:not(.phone-embedded-mini-mode) #casino-container.casino-roulette-classic-fullbleed .casino-roulette-root .number-board-wrap {
  --casino-cell-height: 52px;
  --casino-cell-gap: 3px;
}

body:not(.phone-embedded-mini-mode) #casino-container.casino-roulette-classic-fullbleed .casino-roulette-root .zero-cell {
  display: grid;
  place-items: center;
  min-height: calc(var(--casino-cell-height) * 3 + var(--casino-cell-gap) * 2);
  height: calc(var(--casino-cell-height) * 3 + var(--casino-cell-gap) * 2);
  line-height: 1;
}

body:not(.phone-embedded-mini-mode) #casino-container.casino-roulette-classic-fullbleed .casino-roulette-root .number-grid {
  grid-template-rows: repeat(3, var(--casino-cell-height));
  gap: var(--casino-cell-gap);
}

body:not(.phone-embedded-mini-mode) #casino-container.casino-roulette-classic-fullbleed .casino-roulette-root .column-bets {
  grid-template-rows: repeat(3, var(--casino-cell-height));
  gap: var(--casino-cell-gap);
}

@media (max-width: 760px) {
  body:not(.phone-embedded-mini-mode) #casino-container.casino-roulette-classic-fullbleed .casino-roulette-root .number-board-wrap {
    --casino-cell-height: 44px;
    --casino-cell-gap: 3px;
  }

  body:not(.phone-embedded-mini-mode) #casino-container.casino-roulette-classic-fullbleed .casino-roulette-root .zero-cell {
    min-height: calc(var(--casino-cell-height) * 3 + var(--casino-cell-gap) * 2);
    height: calc(var(--casino-cell-height) * 3 + var(--casino-cell-gap) * 2);
  }
}

body:not(.phone-embedded-mini-mode) #casino-container.keno-fullbleed .keno-root .tile.match::after {
  content: "◆";
  position: absolute;
  right: 6px;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  color: #d8ffe8;
  background: radial-gradient(circle at 30% 28%, #8fffc0, #22c76f 72%);
  box-shadow: 0 0 0 1px rgba(9, 48, 27, 0.75), 0 0 10px rgba(57, 240, 143, 0.55);
  pointer-events: none;
  z-index: 7;
}

body:not(.phone-embedded-mini-mode) #casino-container .hilo-root {
  background: #0d121a;
  min-height: calc(100vh - 70px);
}

body:not(.phone-embedded-mini-mode) #casino-container .hilo-root .main {
  background: linear-gradient(180deg, #111722, #0d121a);
  border-radius: 12px;
}

body:not(.phone-embedded-mini-mode).game-fullscreen #casino-container > .hilo-root {
  width: 100%;
}

body:not(.phone-embedded-mini-mode).game-fullscreen #casino-container > .hilo-root .app {
  min-height: calc(100vh - 70px);
  height: calc(100vh - 70px);
}

body:not(.phone-embedded-mini-mode).game-fullscreen #casino-container > .hilo-root .main {
  min-height: 0;
  padding-bottom: 18px;
}

body:not(.phone-embedded-mini-mode) #casino-container.dragon-fullbleed .dragon-root .sage-brand.sage-bottom-left {
  display: none !important;
}

body:not(.phone-embedded-mini-mode) #casino-container.mines-fullbleed .mines-root .grid .tile::before {
  font-size: calc(0.38rem * var(--sage-brand-scale));
}

body:not(.phone-embedded-mini-mode) #casino-container.casino-roulette-classic-fullbleed .casino-roulette-root {
  position: relative;
}

body:not(.phone-embedded-mini-mode) #casino-container.casino-roulette-classic-fullbleed .casino-roulette-root .sage-brand.sage-roulette-corner {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 15;
  font-size: calc(0.54rem * var(--sage-brand-scale));
  font-family: var(--sage-brand-font);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
  opacity: 0.52;
  pointer-events: none;
  user-select: none;
}

body:not(.phone-embedded-mini-mode) #casino-container.horse-fullbleed #casino-horserace-screen {
  padding: 6px 8px 2px;
}

body:not(.phone-embedded-mini-mode) #casino-container.horse-fullbleed #casino-horserace-screen .horserace-root {
  grid-template-rows: auto 1fr auto;
  gap: 6px;
}

body:not(.phone-embedded-mini-mode) #casino-container.horse-fullbleed #casino-horserace-screen .hr-layout {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(170px, 205px);
  gap: 8px;
}

body:not(.phone-embedded-mini-mode) #casino-container.horse-fullbleed #casino-horserace-screen .hr-race,
body:not(.phone-embedded-mini-mode) #casino-container.horse-fullbleed #casino-horserace-screen .hr-controls,
body:not(.phone-embedded-mini-mode) #casino-container.horse-fullbleed #casino-horserace-screen .hr-history {
  padding: 8px;
}

body:not(.phone-embedded-mini-mode) #casino-container.horse-fullbleed #casino-horserace-screen .track-wrap {
  padding: 6px 5px 6px 6px;
}

body:not(.phone-embedded-mini-mode) #casino-container.horse-fullbleed #casino-horserace-screen .sage-horse-footer {
  margin: 0;
  padding-top: 2px;
}

body.game-fullscreen #casino-container.plinko-neon-fullbleed > .plinko-casino-neon {
  width: 100%;
  min-height: calc(100vh - 70px);
}

.plinko-casino-neon {
  --bg-color: #0f1923;
  --card-bg: #1a242d;
  --accent: #00e701;
  --loss: #ff0055;
  --text: #ffffff;
  width: 100%;
  min-height: calc(100vh - 70px);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-color);
  overflow: hidden;
}

.plinko-casino-neon .app-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  width: 100%;
  min-height: calc(100vh - 70px);
}

.plinko-casino-neon .game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.plinko-casino-neon .controls {
  display: flex;
  gap: 15px;
  background: var(--card-bg);
  padding: 15px 30px;
  border-radius: 50px;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.plinko-casino-neon .brand {
  font-family: var(--sage-brand-font);
  font-weight: 700;
  font-size: calc(0.9rem * var(--sage-brand-scale));
  margin-right: 15px;
  letter-spacing: 0.04em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
}

.plinko-casino-neon .input-group {
  display: flex;
  flex-direction: column;
}

.plinko-casino-neon .input-group label {
  font-size: 0.7rem;
  color: #8b9bb4;
  margin-bottom: 2px;
}

.plinko-casino-neon input,
.plinko-casino-neon select {
  background: #0f1923;
  border: 1px solid #2f3b4b;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: bold;
  outline: none;
}

.plinko-casino-neon input[type="range"] {
  -webkit-appearance: none;
  width: 80px;
  height: 6px;
  background: #2f3b4b;
  border-radius: 3px;
  outline: none;
  padding: 0;
  margin-top: 5px;
}

.plinko-casino-neon input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}

.plinko-casino-neon input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.plinko-casino-neon .action-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 10px 30px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  text-transform: uppercase;
}

.plinko-casino-neon .action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(0, 231, 1, 0.4);
}

.plinko-casino-neon .action-btn:active {
  transform: translateY(0);
}

.plinko-casino-neon .auto-btn {
  background: #2f3b4b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 80px;
  padding: 10px 0;
  text-align: center;
}

.plinko-casino-neon .auto-btn.running {
  background: var(--loss);
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.4);
  animation: plinkoNeonPulse 1.5s infinite;
  border-color: var(--loss);
}

@keyframes plinkoNeonPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.plinko-casino-neon .stats {
  display: flex;
  gap: 20px;
  width: 100%;
  justify-content: center;
}

.plinko-casino-neon .stat-box {
  background: var(--card-bg);
  padding: 8px 25px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.plinko-casino-neon .stat-box span:first-child {
  font-size: 0.75rem;
  color: #8b9bb4;
}

.plinko-casino-neon .stat-box span:last-child {
  font-size: 1.1rem;
  font-weight: bold;
}

.plinko-casino-neon .highlight {
  color: var(--accent);
}

.plinko-casino-neon .canvas-wrapper {
  position: relative;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.plinko-casino-neon canvas {
  display: block;
  width: 600px;
}

.plinko-casino-neon .multiplier-container {
  display: flex;
  justify-content: center;
  width: 100%;
  position: absolute;
  bottom: 15px;
  left: 0;
  height: 30px;
  z-index: 10;
}

.plinko-casino-neon .multiplier {
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.6rem;
  font-weight: bold;
  color: #000;
  border-radius: 4px;
  height: 30px;
  transition: transform 0.1s, filter 0.1s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  margin: 0 2px;
  cursor: help;
}

.plinko-casino-neon .multiplier:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

.plinko-casino-neon .multiplier.active {
  transform: translateY(5px) scale(1.1);
  filter: brightness(1.3);
}

.plinko-casino-neon .odds-tooltip {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 20;
}

.plinko-casino-neon .history-column {
  width: 120px;
  height: 600px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.plinko-casino-neon .history-header {
  text-align: center;
  font-weight: 900;
  font-size: 0.9rem;
  color: #8b9bb4;
  margin-bottom: 15px;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.plinko-casino-neon .history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  height: 100%;
}

.plinko-casino-neon .history-item {
  width: 100%;
  padding: 10px 0;
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
  font-size: 0.9rem;
  color: #000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  animation: plinkoNeonSlideIn 0.3s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes plinkoNeonSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#game-exit-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: rgba(8, 8, 8, 0.95);
  border-bottom: 1px solid #222;
  backdrop-filter: blur(8px);
  z-index: 10000;
}

#exitGameBtn {
  background: #0077cc;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: bold;
}

#game-exit-bar .game-title {
  flex: 1;
  font-weight: bold;
  text-align: center;
  color: #fff;
}

#game-exit-bar .game-cash {
  color: #0ff;
  font-weight: bold;
  font-family: monospace;
}

/* ============================
   DRAGON TOWER (SCOPED)
   ============================ */
.dragon-root {
  --bg0: #05070b;
  --bg1: #0a0f17;
  --text: rgba(246, 245, 240, 0.94);
  --muted: rgba(223, 219, 208, 0.72);
  --panel-bg-soft: rgba(18, 24, 34, 0.94);
  --panel-bg-soft-2: rgba(14, 18, 26, 0.94);
  --panel-stroke: rgba(255, 255, 255, 0.08);
  --panel-stroke-2: rgba(255, 255, 255, 0.12);
  --panel-text: rgba(234, 242, 255, 0.92);
  --panel-muted: rgba(171, 188, 214, 0.72);
  --panel-blue: #2ea0ff;
  --panel-blue-2: #33c2ff;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.62);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  width: 100%;
}

.dragon-root * {
  box-sizing: border-box;
}

@keyframes dt-grain-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-2%, 1.5%, 0);
  }
}

.dragon-root .app {
  min-height: min(820px, 90vh);
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  padding: 16px;
}

.dragon-root .side-panel {
  --text: var(--panel-text);
  --muted: var(--panel-muted);
  --stroke: var(--panel-stroke);
  --stroke2: var(--panel-stroke-2);
  --accent: var(--panel-blue-2);
  --accent2: var(--panel-blue);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, var(--panel-bg-soft), var(--panel-bg-soft-2));
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(12px);
}

.dragon-root .panel-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dragon-root .auto-only {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}

.dragon-root .app.mode-auto .auto-only {
  display: block;
}

.dragon-root .game-title {
  font-weight: 900;
  letter-spacing: 0.3px;
  font-size: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.18));
}

.dragon-root .panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dragon-root .tab {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.dragon-root .tab.active {
  border-color: rgba(0, 231, 1, 0.35);
  color: var(--text);
  background: linear-gradient(180deg, rgba(0, 231, 1, 0.22), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 0 1px rgba(0, 231, 1, 0.12) inset;
}

.dragon-root .tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dragon-root .panel-section {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.dragon-root .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.dragon-root .field:last-child {
  margin-bottom: 0;
}

.dragon-root label {
  font-size: 12px;
  letter-spacing: 0.2px;
  color: var(--muted);
}

.dragon-root .field-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.dragon-root input,
.dragon-root select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  color: var(--text);
  background:
    radial-gradient(320px 120px at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    rgba(255, 255, 255, 0.04);
  outline: none;
}

.dragon-root input:focus,
.dragon-root select:focus {
  border-color: rgba(0, 231, 1, 0.38);
  box-shadow: 0 0 0 3px rgba(0, 231, 1, 0.16);
}

.dragon-root .chip {
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.18)),
    rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.dragon-root .chip:hover {
  border-color: var(--stroke2);
}

.dragon-root .button-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.dragon-root .btn {
  border-radius: 12px;
  border: 1px solid var(--stroke);
  padding: 12px 14px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #06120b;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.dragon-root .btn:active:not(:disabled) {
  transform: translateY(1px);
}

.dragon-root .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dragon-root .btn.primary {
  color: #06120b;
  border-color: rgba(43, 209, 117, 0.35);
  background: linear-gradient(180deg, rgba(43, 209, 117, 1), rgba(18, 172, 92, 1));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.dragon-root .btn.accent {
  color: #061015;
  border-color: rgba(0, 231, 1, 0.35);
  background: linear-gradient(180deg, rgba(0, 231, 1, 1), rgba(33, 120, 219, 1));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.dragon-root .btn.danger {
  color: #fff;
  border-color: rgba(255, 90, 111, 0.35);
  background: linear-gradient(180deg, rgba(255, 90, 111, 1), rgba(139, 28, 45, 1));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.dragon-root .btn.ghost {
  color: var(--text);
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}

.dragon-root .btn:hover:not(:disabled) {
  filter: brightness(1.03);
}

.dragon-root .panel-section.stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dragon-root .stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background:
    radial-gradient(260px 70px at 50% 0%, rgba(0, 231, 1, 0.12), transparent 62%),
    rgba(255, 255, 255, 0.03);
}

.dragon-root .stat .k {
  color: var(--muted);
  font-weight: 800;
}

.dragon-root .stat .v {
  font-weight: 900;
}

.dragon-root .message {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 12px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--text);
  text-align: center;
  font-size: 13px;
  min-height: 44px;
  display: grid;
  place-items: center;
}

.dragon-root .message.is-brand {
  font-family: var(--sage-brand-font);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.2vw, 1.95rem);
  letter-spacing: 0.03em;
  color: var(--sage-brand-ink);
  text-shadow: var(--sage-brand-glow);
  -webkit-text-stroke: 1px var(--sage-brand-stroke);
}

.dragon-root .message.update {
  animation: dt-panel-pulse 0.5s ease;
}

@keyframes dt-panel-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.dragon-root .bump {
  display: inline-block;
  animation: dt-bump 0.22s ease-out;
  transform-origin: 50% 60%;
}

@keyframes dt-bump {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-1px) scale(1.08);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.dragon-root .board-area {
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  padding: 36px;
  border-radius: 18px;
  background:
    radial-gradient(1000px 620px at 70% 6%, rgba(233, 193, 94, 0.13), transparent 62%),
    radial-gradient(900px 600px at 20% 0%, rgba(255, 140, 64, 0.07), transparent 60%),
    radial-gradient(900px 600px at 50% 92%, rgba(127, 214, 255, 0.06), transparent 55%),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02) 0 18px,
      rgba(0, 0, 0, 0.02) 18px 36px
    ),
    linear-gradient(180deg, rgba(11, 14, 18, 0.92), rgba(5, 7, 11, 0.92));
  box-shadow: inset 0 0 0 1px rgba(233, 193, 94, 0.08);
}

.dragon-root .board-area::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.38;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.06) 0 2px, transparent 3px),
    radial-gradient(circle at 35% 65%, rgba(255, 255, 255, 0.05) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.05) 0 2px, transparent 3px);
  background-size: 220px 220px;
  filter: blur(0.2px);
  z-index: 0;
}

.dragon-root .board-area::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http%3A//www.w3.org/2000/svg'%20width='220'%20height='220'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='.85'%20numOctaves='3'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='220'%20height='220'%20filter='url(%23n)'%20opacity='.55'/%3E%3C/svg%3E");
  animation: dt-grain-drift 10s linear infinite;
  z-index: 0;
}

.dragon-root .tower {
  width: min(560px, 96vw);
  border-radius: 18px;
  position: relative;
  box-shadow: var(--shadow);
  z-index: 1;
}

.dragon-root .tower.rumble {
  animation: dt-rumble 0.52s ease-in-out;
}

@keyframes dt-rumble {
  0% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-3px);
  }
  30% {
    transform: translateX(3px);
  }
  45% {
    transform: translateX(-2px);
  }
  60% {
    transform: translateX(2px);
  }
  100% {
    transform: translateX(0);
  }
}

.dragon-root .tower::before,
.dragon-root .tower::after {
  content: "";
  position: absolute;
  top: 34px;
  width: 130px;
  height: 280px;
  pointer-events: none;
  opacity: 0.28;
  filter: blur(1px);
  background:
    radial-gradient(closest-side at 50% 35%, rgba(255, 140, 64, 0.55), transparent 70%),
    radial-gradient(closest-side at 50% 65%, rgba(233, 193, 94, 0.18), transparent 70%);
  animation: dt-torch-flicker 2.8s ease-in-out infinite;
}

.dragon-root .tower::before {
  left: -22px;
  animation-delay: -0.9s;
}

.dragon-root .tower::after {
  right: -22px;
  animation-delay: -1.6s;
}

@keyframes dt-torch-flicker {
  0% {
    opacity: 0.18;
    transform: translateY(0) scaleX(1);
  }
  35% {
    opacity: 0.33;
    transform: translateY(-2px) scaleX(1.03);
  }
  65% {
    opacity: 0.24;
    transform: translateY(1px) scaleX(0.99);
  }
  100% {
    opacity: 0.3;
    transform: translateY(-1px) scaleX(1.02);
  }
}

.dragon-root .tower-chrome {
  position: absolute;
  inset: -16px -16px -18px -16px;
  border-radius: 22px;
  background:
    radial-gradient(800px 360px at 50% 0%, rgba(233, 193, 94, 0.16), transparent 62%),
    radial-gradient(700px 260px at 50% 92%, rgba(0, 0, 0, 0.35), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(233, 193, 94, 0.18);
}

.dragon-root .tower-inner {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(233, 193, 94, 0.18);
  background:
    radial-gradient(900px 600px at 50% 0%, rgba(233, 193, 94, 0.09), transparent 62%),
    radial-gradient(700px 420px at 50% 88%, rgba(0, 0, 0, 0.35), transparent 62%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0 14px,
      rgba(0, 0, 0, 0.03) 14px 28px
    ),
    linear-gradient(180deg, rgba(14, 16, 20, 0.92), rgba(6, 8, 11, 0.94));
  overflow: hidden;
}

.dragon-root .tower-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.09), transparent 55%),
    radial-gradient(circle at 50% 80%, rgba(0, 0, 0, 0.35), transparent 55%);
}

.dragon-root .board {
  position: relative;
  padding: 18px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

.dragon-root .row {
  display: flex;
  gap: 10px;
  justify-content: center;
  opacity: 0.35;
  transform: translateZ(0);
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.dragon-root .row.activate {
  animation: dt-row-activate 0.26s ease-out both;
}

@keyframes dt-row-activate {
  0% {
    transform: translateY(8px);
    opacity: 0.6;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.dragon-root .row.active {
  opacity: 1;
  filter: saturate(1.05);
}

.dragon-root .row.revealing {
  animation: dt-row-reveal-glow 0.68s ease-out both;
}

@keyframes dt-row-reveal-glow {
  0% {
    filter: brightness(1) saturate(1);
  }
  45% {
    filter: brightness(1.08) saturate(1.12);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

.dragon-root .row.active .slot {
  animation: dt-slot-pulse 1.7s ease-in-out infinite;
}

@keyframes dt-slot-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.05);
  }
}

.dragon-root .slot {
  width: 82px;
  height: 82px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(100px 70px at 50% 10%, rgba(255, 255, 255, 0.07), transparent 60%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0 10px,
      rgba(0, 0, 0, 0.03) 10px 20px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.16));
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.38) inset;
  display: grid;
  place-items: center;
}

.dragon-root .slot.picked {
  animation: dt-slot-pick 0.22s ease-out;
}

@keyframes dt-slot-pick {
  0% {
    transform: translateY(0) scale(1);
  }
  55% {
    transform: translateY(-2px) scale(1.04);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.dragon-root .tile {
  width: 50px;
  height: 64px;
  border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.09) 56%),
    radial-gradient(circle at 66% 62%, rgba(127, 214, 255, 0.1), transparent 60%),
    radial-gradient(circle at 40% 72%, rgba(0, 0, 0, 0.22), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.28));
  box-shadow:
    0 12px 18px rgba(0, 0, 0, 0.32),
    0 0 0 3px rgba(0, 0, 0, 0.25) inset;
  cursor: pointer;
  transform: translateZ(0);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}

.dragon-root .row.active .tile:not(.safe):not(.fail) {
  animation: dt-egg-idle 2.2s ease-in-out infinite;
}

@keyframes dt-egg-idle {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-2px) rotate(-0.35deg);
  }
}

.dragon-root .tile::after {
  content: "";
  position: absolute;
  inset: 10px 11px 16px 11px;
  border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.22), transparent 60%);
  opacity: 0.9;
}

.dragon-root .row.active .tile:hover {
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.06);
  box-shadow:
    0 16px 22px rgba(0, 0, 0, 0.38),
    0 0 0 3px rgba(233, 193, 94, 0.12) inset;
}

.dragon-root .tile.safe {
  border-color: rgba(60, 210, 120, 0.42);
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.1) 56%),
    radial-gradient(circle at 24% 24%, rgba(120, 255, 190, 0.65), transparent 58%),
    radial-gradient(circle at 70% 60%, rgba(50, 190, 120, 0.42), transparent 55%),
    radial-gradient(circle at 58% 74%, rgba(18, 110, 70, 0.4), transparent 60%),
    linear-gradient(180deg, rgba(70, 235, 140, 1), rgba(18, 120, 70, 1));
  box-shadow:
    0 16px 24px rgba(0, 0, 0, 0.42),
    0 0 0 4px rgba(60, 210, 120, 0.12) inset,
    0 0 18px rgba(60, 210, 120, 0.22);
}

.dragon-root .tile.safe.picked {
  border-color: rgba(233, 193, 94, 0.55);
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.14) 56%),
    radial-gradient(circle at 24% 24%, rgba(255, 232, 170, 0.72), transparent 58%),
    radial-gradient(circle at 70% 60%, rgba(233, 193, 94, 0.5), transparent 55%),
    radial-gradient(circle at 58% 74%, rgba(164, 116, 39, 0.45), transparent 60%),
    linear-gradient(180deg, rgba(233, 193, 94, 1), rgba(164, 116, 39, 1));
  box-shadow:
    0 18px 28px rgba(0, 0, 0, 0.48),
    0 0 0 4px rgba(233, 193, 94, 0.16) inset,
    0 0 26px rgba(233, 193, 94, 0.38);
}

.dragon-root .tile.safe.reveal,
.dragon-root .tile.fail.reveal {
  --i: 0;
  animation-delay: calc(var(--i) * 70ms), calc(var(--i) * 70ms + 360ms), calc(var(--i) * 70ms + 360ms);
  animation-fill-mode: both, both, both;
  transform-origin: 50% 65%;
}

.dragon-root .tile.safe.reveal {
  animation-name: dt-reveal-pop, dt-safe-glow, none;
  animation-duration: 0.36s, 1.1s, 0s;
  animation-timing-function: cubic-bezier(0.18, 0.9, 0.22, 1.2), ease-in-out, linear;
  animation-iteration-count: 1, 2, 1;
}

.dragon-root .tile.safe.picked.reveal {
  animation-name: dt-reveal-pop, dt-gold-glow, none;
}

.dragon-root .tile.fail {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.12) 55%),
    radial-gradient(circle at 52% 45%, rgba(255, 90, 111, 0.55), transparent 62%),
    linear-gradient(180deg, rgba(255, 90, 111, 1), rgba(139, 28, 45, 1));
  box-shadow:
    0 16px 24px rgba(0, 0, 0, 0.42),
    0 0 0 4px rgba(255, 90, 111, 0.12) inset,
    0 0 18px rgba(255, 90, 111, 0.26);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http%3A//www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%3E%3Cpath%20fill='white'%20d='M32%206c-12.1%200-22%209.9-22%2022%200%208.2%204.5%2015.4%2011.2%2019.2V54c0%202.2%201.8%204%204%204h13.6c2.2%200%204-1.8%204-4v-6.8C49.5%2043.4%2054%2036.2%2054%2028%2054%2015.9%2044.1%206%2032%206z'/%3E%3Cellipse%20fill='black'%20cx='23.5'%20cy='29'%20rx='6.2'%20ry='5.5'/%3E%3Cellipse%20fill='black'%20cx='40.5'%20cy='29'%20rx='6.2'%20ry='5.5'/%3E%3Cpath%20fill='black'%20d='M32%2034.5c-2.2%200-4%201.9-4%204.1%200%202.7%202%204.4%204%206.4%202-2%204-3.7%204-6.4%200-2.2-1.8-4.1-4-4.1z'/%3E%3Cpath%20fill='white'%20d='M24%2047c0%206%204%2011%208%2011s8-5%208-11H24z'/%3E%3Crect%20fill='black'%20x='25.5'%20y='50'%20width='2.4'%20height='8'%20rx='1.2'/%3E%3Crect%20fill='black'%20x='30.8'%20y='49.2'%20width='2.4'%20height='8.8'%20rx='1.2'/%3E%3Crect%20fill='black'%20x='36.1'%20y='50'%20width='2.4'%20height='8'%20rx='1.2'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http%3A//www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%3E%3Cpath%20fill='white'%20d='M32%206c-12.1%200-22%209.9-22%2022%200%208.2%204.5%2015.4%2011.2%2019.2V54c0%202.2%201.8%204%204%204h13.6c2.2%200%204-1.8%204-4v-6.8C49.5%2043.4%2054%2036.2%2054%2028%2054%2015.9%2044.1%206%2032%206z'/%3E%3Cellipse%20fill='black'%20cx='23.5'%20cy='29'%20rx='6.2'%20ry='5.5'/%3E%3Cellipse%20fill='black'%20cx='40.5'%20cy='29'%20rx='6.2'%20ry='5.5'/%3E%3Cpath%20fill='black'%20d='M32%2034.5c-2.2%200-4%201.9-4%204.1%200%202.7%202%204.4%204%206.4%202-2%204-3.7%204-6.4%200-2.2-1.8-4.1-4-4.1z'/%3E%3Cpath%20fill='white'%20d='M24%2047c0%206%204%2011%208%2011s8-5%208-11H24z'/%3E%3Crect%20fill='black'%20x='25.5'%20y='50'%20width='2.4'%20height='8'%20rx='1.2'/%3E%3Crect%20fill='black'%20x='30.8'%20y='49.2'%20width='2.4'%20height='8.8'%20rx='1.2'/%3E%3Crect%20fill='black'%20x='36.1'%20y='50'%20width='2.4'%20height='8'%20rx='1.2'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.dragon-root .tile.fail.picked {
  box-shadow:
    0 18px 28px rgba(0, 0, 0, 0.52),
    0 0 0 4px rgba(255, 90, 111, 0.18) inset,
    0 0 34px rgba(255, 90, 111, 0.46);
}

.dragon-root .tile.fail.reveal {
  animation-name: dt-reveal-pop, dt-fail-shake, dt-fail-pulse;
  animation-duration: 0.36s, 0.55s, 0.85s;
  animation-timing-function: cubic-bezier(0.18, 0.9, 0.22, 1.2), ease-in-out, ease-out;
  animation-iteration-count: 1, 1, 1;
}

@keyframes dt-reveal-pop {
  0% {
    transform: scale(0.75) translateY(6px);
    filter: brightness(0.95);
  }
  60% {
    transform: scale(1.08) translateY(-2px);
    filter: brightness(1.08);
  }
  100% {
    transform: scale(1) translateY(0);
    filter: brightness(1);
  }
}

@keyframes dt-safe-glow {
  0%,
  100% {
    box-shadow:
      0 16px 24px rgba(0, 0, 0, 0.42),
      0 0 0 4px rgba(60, 210, 120, 0.12) inset,
      0 0 18px rgba(60, 210, 120, 0.22);
  }
  50% {
    box-shadow:
      0 18px 26px rgba(0, 0, 0, 0.46),
      0 0 0 4px rgba(60, 210, 120, 0.16) inset,
      0 0 26px rgba(60, 210, 120, 0.34);
  }
}

@keyframes dt-gold-glow {
  0%,
  100% {
    box-shadow:
      0 18px 28px rgba(0, 0, 0, 0.48),
      0 0 0 4px rgba(233, 193, 94, 0.16) inset,
      0 0 26px rgba(233, 193, 94, 0.38);
  }
  50% {
    box-shadow:
      0 20px 30px rgba(0, 0, 0, 0.54),
      0 0 0 4px rgba(233, 193, 94, 0.22) inset,
      0 0 38px rgba(233, 193, 94, 0.58);
  }
}

@keyframes dt-fail-shake {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  22% {
    transform: translateX(-2px) rotate(-1deg);
  }
  44% {
    transform: translateX(2px) rotate(1deg);
  }
  66% {
    transform: translateX(-1px) rotate(-0.5deg);
  }
  100% {
    transform: translateX(0) rotate(0deg);
  }
}

@keyframes dt-fail-pulse {
  0% {
    box-shadow:
      0 16px 24px rgba(0, 0, 0, 0.42),
      0 0 0 4px rgba(255, 90, 111, 0.12) inset,
      0 0 18px rgba(255, 90, 111, 0.26);
  }
  60% {
    box-shadow:
      0 20px 28px rgba(0, 0, 0, 0.5),
      0 0 0 4px rgba(255, 90, 111, 0.18) inset,
      0 0 34px rgba(255, 90, 111, 0.52);
  }
  100% {
    box-shadow:
      0 16px 24px rgba(0, 0, 0, 0.42),
      0 0 0 4px rgba(255, 90, 111, 0.12) inset,
      0 0 22px rgba(255, 90, 111, 0.34);
  }
}

.dragon-root .tile.safe {
  position: relative;
  overflow: hidden;
}

.dragon-root .tile.safe::before {
  content: "";
  position: absolute;
  inset: -20% -40%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 35%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.08) 65%,
    transparent 100%
  );
  transform: translateX(-60%) rotate(0.001deg);
  opacity: 0;
  pointer-events: none;
}

.dragon-root .tile.safe.reveal::before {
  opacity: 1;
  animation: dt-shimmer 1.05s ease-in-out 1;
}

@keyframes dt-shimmer {
  0% {
    transform: translateX(-70%);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: translateX(70%);
    opacity: 0;
  }
}

@supports not ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
  .dragon-root .tile.fail {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 1px solid rgba(255, 90, 111, 0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dragon-root .board-area::after,
  .dragon-root .tower.rumble,
  .dragon-root .row.activate,
  .dragon-root .row.revealing,
  .dragon-root .row.active .slot,
  .dragon-root .slot.picked,
  .dragon-root .row.active .tile:not(.safe):not(.fail),
  .dragon-root .tile.safe.reveal,
  .dragon-root .tile.fail.reveal,
  .dragon-root .tower::before,
  .dragon-root .tower::after {
    animation: none !important;
  }
}

@media (max-width: 920px) {
  .dragon-root .app {
    grid-template-columns: 1fr;
  }

  .dragon-root .tower {
    width: min(560px, 94vw);
  }
}

@media (max-width: 520px) {
  .dragon-root .slot {
    width: 70px;
    height: 70px;
  }
  .dragon-root .tile {
    width: 46px;
    height: 58px;
  }
  .dragon-root .tile.fail {
    width: 58px;
    height: 58px;
  }
  .dragon-root .board {
    padding: 14px;
  }
}

/* ============================
   DICE (SCOPED)
   ============================ */
.dice-root {
  --bg-dark: #0f212e;
  --bg-panel: #213743;
  --input-bg: #0f212e;
  --text-white: #ffffff;
  --text-grey: #b1bad3;
  --accent-green: #00e701;
  --accent-red: #ff4d4d;
  --accent-blue: #2f4553;
  color: var(--text-white);
  width: 100%;
  min-height: 100%;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

.dice-root * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.dice-root {
  background-color: var(--bg-dark);
  display: flex;
  flex-direction: column;
}

.dice-root .top-nav {
  background-color: #1a2c38;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dice-root .logo {
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 1px;
}

.dice-root .nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dice-root #balanceDisplay {
  color: var(--accent-green);
  font-weight: bold;
}

.dice-root .wallet-btn {
  background-color: #1475e1;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  cursor: default;
}

.dice-root .main-layout {
  display: flex;
  flex: 1;
  max-width: 1100px;
  width: 95%;
  margin: 30px auto;
  background-color: var(--bg-panel);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dice-root .sidebar {
  width: 320px;
  padding: 25px;
  background-color: var(--bg-panel);
  border-right: 1px solid #2f4553;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dice-root .control-group label {
  display: block;
  color: var(--text-grey);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.dice-root .input-complex {
  display: flex;
  align-items: center;
  background-color: var(--input-bg);
  border: 1px solid var(--accent-blue);
  border-radius: 4px;
  padding: 5px;
}

.dice-root .input-complex:focus-within {
  border-color: var(--text-grey);
}

.dice-root .input-icon {
  color: var(--text-grey);
  padding: 0 10px;
  font-weight: bold;
}

.dice-root .input-complex input {
  background: transparent;
  border: none;
  color: white;
  width: 100%;
  font-weight: 600;
  outline: none;
  font-size: 0.95rem;
}

.dice-root .input-actions button {
  background-color: var(--accent-blue);
  border: none;
  color: var(--text-grey);
  width: 35px;
  height: 30px;
  margin-left: 5px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
}

.dice-root .input-actions button:hover {
  background-color: #3e5866;
  color: white;
}

.dice-root .mode-toggle {
  display: flex;
  background-color: var(--input-bg);
  padding: 4px;
  border-radius: 20px;
}

.dice-root .mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-grey);
  padding: 10px;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.dice-root .mode-btn.active {
  background-color: var(--accent-blue);
  color: white;
}

.dice-root .action-btn {
  background-color: var(--accent-green);
  color: #0d1d29;
  border: none;
  padding: 18px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  margin-top: 10px;
  transition: 0.2s;
}

.dice-root .action-btn:hover {
  filter: brightness(1.1);
}

.dice-root .action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dice-root .game-panel {
  flex: 1;
  background-color: var(--bg-dark);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dice-root .slider-display-area {
  background-color: var(--bg-panel);
  border-radius: 12px;
  padding: 60px 30px 40px 30px;
  position: relative;
  margin-bottom: 20px;
}

.dice-root .range-markers {
  display: flex;
  justify-content: space-between;
  color: var(--text-grey);
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 15px;
  padding: 0 5px;
}

.dice-root .slider-wrapper {
  position: relative;
  width: 100%;
  height: 12px;
}

.dice-root .result-marker {
  position: absolute;
  top: -8px;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background-color: white;
  transform: translateX(-50%) scale(0);
  z-index: 10;
  pointer-events: none;
  border: 3px solid #213743;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: left 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28), transform 0.2s, background-color 0.2s;
}

.dice-root .result-marker.show {
  transform: translateX(-50%) scale(1);
}

.dice-root .result-marker.win {
  background-color: var(--accent-green);
  box-shadow: 0 0 15px var(--accent-green);
}

.dice-root .result-marker.lose {
  background-color: var(--accent-red);
  box-shadow: 0 0 15px var(--accent-red);
}

.dice-root input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 12px;
  background: #2f4553;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

.dice-root input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 24px;
  width: 24px;
  background: white;
  border: 4px solid white;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 5;
}

.dice-root input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 12px;
  background: transparent;
  border-radius: 6px;
}

.dice-root .stats-container {
  display: flex;
  gap: 15px;
  background-color: var(--bg-panel);
  padding: 20px;
  border-radius: 8px;
}

.dice-root .stat-box {
  flex: 1;
}

.dice-root .stat-input-wrapper {
  background-color: var(--input-bg);
  border: 1px solid var(--accent-blue);
  border-radius: 4px;
  padding: 10px;
}

.dice-root .stat-input-wrapper input {
  background: transparent;
  border: none;
  color: white;
  width: 100%;
  text-align: center;
  font-weight: 600;
}

.dice-root .result-popup {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-dark);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 2rem;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, top 0.3s;
  border: 2px solid transparent;
}

.dice-root .result-popup.show {
  opacity: 1;
  top: 20px;
}

.dice-root .result-popup.win {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.dice-root .result-popup.lose {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

@media (max-width: 768px) {
  .dice-root .main-layout {
    flex-direction: column;
  }

  .dice-root .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #2f4553;
  }
}

/* ============================
   SLIDE (SCOPED)
   ============================ */
.slide-root {
  --bg-dark: #0f1923;
  --bg-panel: #1a2c38;
  --accent-green: #00e701;
  --accent-blue: #007aff;
  --accent-gold: #ffa500;
  --accent-red: #ff4444;
  --text-white: #ffffff;
  --text-grey: #8b9bb4;
  --card-width: 120px;
  --card-gap: 10px;
  --sidebar-width: clamp(360px, 28vw, 460px);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-white);
  width: 100%;
  min-height: 100%;
  display: flex;
  overflow: hidden;
}

.slide-root .sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-panel);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid #2c3b49;
  z-index: 10;
}

.slide-root .sidebar-subtext {
  margin: -12px 0 0;
  color: var(--text-grey);
  font-size: 0.9rem;
}

.slide-root .control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slide-root label {
  font-size: 0.95rem;
  color: var(--text-grey);
  font-weight: 700;
}

.slide-root .input-box {
  background-color: #0f1923;
  border: 1px solid #2c3b49;
  padding: 14px;
  border-radius: 6px;
  color: white;
  display: flex;
  align-items: center;
}

.slide-root input {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.05rem;
  width: 100%;
  outline: none;
}

.slide-root .quick-bet-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.slide-root .quick-bet-btn {
  border: 1px solid #2f4553;
  border-radius: 6px;
  background: #0f1923;
  color: #dce8f5;
  font-weight: 700;
  padding: 9px 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.slide-root .quick-bet-btn:hover {
  background: #162633;
  border-color: #3f5f77;
}

.slide-root .quick-bet-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slide-root .slide-stats-panel {
  border: 1px solid #2c3b49;
  background: #0f1923;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.slide-root .slide-auto-panel {
  border: 1px solid #2c3b49;
  background: #0f1923;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.slide-root .slide-auto-head {
  font-size: 0.9rem;
  color: #d9e8f7;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.slide-root .slide-auto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  align-items: center;
}

.slide-root .slide-auto-grid label {
  font-size: 0.75rem;
  color: #8b9bb4;
  font-weight: 700;
}

.slide-root .slide-auto-grid input {
  background: #0a141d;
  border: 1px solid #2f4553;
  border-radius: 6px;
  color: #eaf2fb;
  font-size: 0.85rem;
  padding: 6px 8px;
  width: 100%;
  outline: none;
}

.slide-root .auto-btn {
  border: 1px solid #3b5a6e;
  border-radius: 6px;
  background: #2a3f50;
  color: #e8f2fc;
  font-weight: 800;
  padding: 11px 12px;
  cursor: pointer;
}

.slide-root .auto-btn.running {
  border-color: #ff6f8e;
  background: #ff315d;
  color: #fff;
}

.slide-root .auto-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.slide-root .auto-status {
  margin: 0;
  min-height: 16px;
  font-size: 0.78rem;
  color: #b7c8da;
}

.slide-root .slide-stat-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.slide-root .slide-stat-line .k {
  color: var(--text-grey);
  font-size: 0.86rem;
  font-weight: 700;
}

.slide-root .slide-stat-line .v {
  color: #eaf2fb;
  font-size: 0.9rem;
  font-weight: 900;
}

.slide-root #bet-btn {
  background-color: var(--accent-green);
  color: #000;
  border: none;
  padding: 16px;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.2s, transform 0.06s;
}

.slide-root #bet-btn:hover {
  opacity: 0.92;
}

.slide-root #bet-btn:active {
  transform: translateY(1px);
}

.slide-root #bet-btn:disabled {
  background-color: #354b35;
  cursor: not-allowed;
  color: #666;
  transform: none;
}

.slide-root input:disabled {
  opacity: 0.55;
}

.slide-root .main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
}

.slide-root .top-bar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background-color: var(--bg-panel);
  gap: 16px;
}

.slide-root .history-row {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.slide-root .history-pill {
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 800;
  background: #2c3b49;
  color: #ddd;
  white-space: nowrap;
}

.slide-root .pill-win {
  color: var(--accent-green);
}

.slide-root .pill-loss {
  color: var(--accent-red);
}

.slide-root .balance-display {
  background-color: #0f1923;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent-green);
  font-weight: 900;
  white-space: nowrap;
}

.slide-root .game-area {
  flex-grow: 1;
  position: relative;
  background: radial-gradient(circle at center, #233545 0%, #0f1923 100%);
  overflow: hidden;
}

.slide-root .track-viewport {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 220px;
  display: flex;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
}

.slide-root .center-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--accent-gold);
  z-index: 10;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 14px rgba(255, 165, 0, 0.35);
}

.slide-root .center-marker {
  position: absolute;
  left: 50%;
  top: 16px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 14px solid var(--accent-gold);
  transform: translateX(-50%);
  z-index: 11;
  pointer-events: none;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.35));
}

.slide-root .slide-track {
  display: flex;
  gap: var(--card-gap);
  transform: translateX(0px);
  will-change: transform;
  pointer-events: auto;
}

.slide-root .card {
  width: var(--card-width);
  height: 180px;
  background-color: #253646;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text-grey);
  flex-shrink: 0;
  position: relative;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, outline-color 0.2s;
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.slide-root .card.is-blue {
  border-bottom-color: var(--accent-blue);
  color: white;
  background: linear-gradient(180deg, #253646 0%, rgba(0, 122, 255, 0.2) 100%);
}

.slide-root .card.is-gold {
  border-bottom-color: var(--accent-gold);
  color: var(--accent-gold);
  background: linear-gradient(180deg, #253646 0%, rgba(255, 165, 0, 0.2) 100%);
}

.slide-root .card.is-grey {
  border-bottom-color: #555;
}

.slide-root .card.landed {
  outline-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px) scale(1.03);
}

.slide-root .card::before {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.2);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  z-index: 0;
}

.slide-root .card span {
  z-index: 1;
}

.slide-root #result-message {
  position: absolute;
  bottom: 18%;
  font-size: 2.1rem;
  font-weight: 1000;
  opacity: 0;
  transition: opacity 0.25s;
  text-align: center;
  padding: 0 16px;
}

@media (max-width: 900px) {
  .slide-root {
    --sidebar-width: 340px;
    --card-width: 108px;
  }
}

/* ============================
   HORSE RACING (SCOPED)
   ============================ */
#casino-horserace-screen {
  --bg-0: #0a1119;
  --bg-1: #0f1e2c;
  --panel: rgba(15, 30, 45, 0.92);
  --panel-border: rgba(134, 178, 215, 0.35);
  --text: #eaf5ff;
  --muted: #9cbad3;
  --ok: #6be18f;
  --bad: #ff8ea0;
  width: 100%;
  height: 100%;
  padding: 10px;
  overflow: hidden;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 18% 8%, #1a3550 0%, var(--bg-0) 48%, var(--bg-1) 100%);
}

#casino-horserace-screen * {
  box-sizing: border-box;
}

#casino-horserace-screen .horserace-root {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  overflow: hidden;
}

#casino-horserace-screen .hr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(9, 19, 30, 0.8);
}

#casino-horserace-screen .hr-balance-source {
  display: none;
}

#casino-horserace-screen .hr-header h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
}

#casino-horserace-screen .hr-balance {
  color: #b7daff;
}

#casino-horserace-screen .hr-balance strong {
  color: #7ef5d3;
}

#casino-horserace-screen .hr-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(190px, 225px);
  gap: 10px;
}

#casino-horserace-screen.phone-no-history .hr-layout {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
}

#casino-horserace-screen.phone-no-history .hr-race {
  order: 1;
}

#casino-horserace-screen.phone-no-history .hr-controls {
  order: 2;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing .hr-header {
  display: none !important;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing .horserace-root {
  grid-template-rows: 1fr;
  gap: 6px;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .hr-layout {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(136px, 34%) !important;
  gap: 6px;
  height: 100%;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .hr-race {
  min-height: 0;
  padding: 5px;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .hr-controls {
  min-height: 136px;
  max-height: 34dvh;
  align-self: end;
  margin-top: 2px;
  padding: 5px;
  gap: 3px;
  grid-template-rows: auto auto auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .horse-options {
  height: 84px;
  gap: 3px;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .horse-card {
  padding: 3px;
  gap: 3px;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .horse-main {
  font-size: 0.62rem;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .horse-odds {
  font-size: 0.6rem;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .horse-mult {
  font-size: 0.5rem;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .status {
  display: none;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .field label {
  display: none;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .field input {
  padding: 5px 7px;
  font-size: 0.78rem;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .hr-buttons {
  gap: 3px;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .hr-buttons button {
  font-size: 0.56rem;
  padding: 5px 4px;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .race-hud {
  padding: 5px 6px;
  font-size: 0.72rem;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .track-wrap {
  padding: 3px;
  min-height: 0;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .lanes {
  grid-template-rows: repeat(6, minmax(44px, 1fr));
  min-height: 0;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .lane {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 4px;
}

body.phone-embedded-mini-mode #casino-horserace-screen.phone-game-horseracing.phone-no-history .lane-head {
  font-size: 0.6rem;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-horse .phone-casino-actionbar {
  padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
  gap: 3px;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-horse .phone-casino-actionbar .phone-action-balance {
  text-align: center;
  font-size: 11px;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-horse .phone-casino-actionbar .phone-action-balance strong {
  font-size: 12px;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-horse .phone-casino-actionbar .phone-action-row {
  grid-template-columns: minmax(72px, 1fr) auto auto auto;
  gap: 4px;
}

body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-horse .phone-casino-actionbar .phone-action-bet,
body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-horse .phone-casino-actionbar .phone-action-primary,
body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-horse .phone-casino-actionbar .phone-action-secondary,
body.phone-embedded-mini-mode .phone-casino-shell.phone-casino-shell-horse .phone-casino-actionbar .phone-action-more {
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

#casino-horserace-screen .card {
  min-height: 0;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  padding: 10px;
  overflow: hidden;
}

#casino-horserace-screen .hr-controls {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 8px;
}

#casino-horserace-screen .field {
  display: grid;
  gap: 4px;
}

#casino-horserace-screen .field label {
  font-size: 0.82rem;
  color: var(--muted);
}

#casino-horserace-screen .field input {
  width: 100%;
  border: 1px solid rgba(116, 159, 196, 0.5);
  border-radius: 8px;
  background: #091824;
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.95rem;
}

#casino-horserace-screen .horse-options {
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

#casino-horserace-screen .horse-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(116, 159, 196, 0.34);
  border-radius: 8px;
  background: rgba(8, 20, 31, 0.76);
  padding: 8px;
  cursor: pointer;
}

#casino-horserace-screen .horse-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

#casino-horserace-screen .horse-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
}

#casino-horserace-screen .horse-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#casino-horserace-screen .horse-chip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--horse-color, #fff);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.34);
}

#casino-horserace-screen .horse-odds,
#casino-horserace-screen .horse-mult {
  color: var(--muted);
  font-size: 0.8rem;
}

#casino-horserace-screen .horse-mult {
  font-size: 0.72rem;
  white-space: nowrap;
}

#casino-horserace-screen .horse-card input:checked ~ .horse-main,
#casino-horserace-screen .horse-card input:checked ~ .horse-odds,
#casino-horserace-screen .horse-card input:checked ~ .horse-mult {
  color: #93ffe8;
}

#casino-horserace-screen .hr-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

#casino-horserace-screen button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(155deg, #2f79c7, #3f53cd);
  color: #ebf8ff;
  font-weight: 800;
  font-size: 0.76rem;
  padding: 8px 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

#casino-horserace-screen button.secondary {
  background: linear-gradient(155deg, #526b83, #3d4f64);
}

#casino-horserace-screen button.alt {
  background: linear-gradient(155deg, #247e61, #24a07d);
}

#casino-horserace-screen button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

#casino-horserace-screen .status {
  margin: 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.8rem;
}

#casino-horserace-screen .hr-race {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

#casino-horserace-screen .race-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(111, 157, 195, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(9, 24, 37, 0.75);
  font-size: 0.82rem;
}

#casino-horserace-screen #raceState {
  letter-spacing: 0.08em;
  color: #7bdfff;
}

#casino-horserace-screen .track-wrap {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(107, 156, 197, 0.36);
  border-radius: 10px;
  padding: 8px 6px 8px 8px;
  background: linear-gradient(180deg, #0f2738, #0c1f2f);
  overflow: hidden;
}

#casino-horserace-screen .finish-line {
  position: absolute;
  right: 14px;
  top: 8px;
  bottom: 8px;
  width: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.92);
  border-right: 2px dashed rgba(255, 255, 255, 0.55);
}

#casino-horserace-screen .horserace-root.is-racing .finish-line {
  animation: finish-line-pulse 0.42s linear infinite;
}

#casino-horserace-screen .lanes {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 0;
}

#casino-horserace-screen .lane {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

#casino-horserace-screen .lane-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.82rem;
  color: #c9deef;
  white-space: nowrap;
}

#casino-horserace-screen .lane-head span:last-child {
  margin-left: auto;
  color: #9fc9e8;
}

#casino-horserace-screen .runway {
  position: relative;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0, rgba(255, 255, 255, 0.045) 15px, rgba(255, 255, 255, 0.01) 15px, rgba(255, 255, 255, 0.01) 30px),
    #102537;
  background-size: 56px 100%, auto;
  background-position: 0 0, 0 0;
  overflow: hidden;
}

#casino-horserace-screen .horse {
  position: absolute;
  left: 0;
  top: 1px;
  min-width: 84px;
  height: calc(100% - 2px);
  border-radius: 999px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.3), var(--horse-color));
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  font-size: clamp(18px, 2.5vh, 32px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  will-change: transform;
}

#casino-horserace-screen .horse::after {
  content: "";
  position: absolute;
  right: calc(100% - 5px);
  top: 50%;
  width: 18px;
  height: 48%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(185, 220, 255, 0.36), rgba(185, 220, 255, 0));
  opacity: 0;
  pointer-events: none;
}

#casino-horserace-screen .horserace-root.is-racing .horse::after {
  animation: horse-trail 0.34s linear infinite;
}

#casino-horserace-screen .horse-emoji {
  font-size: 1em;
  display: inline-block;
  transform: scaleX(-1);
  transform-origin: center;
}

#casino-horserace-screen .horserace-root.is-racing .horse-emoji {
  animation: horse-gallop 0.17s ease-in-out infinite alternate;
}

#casino-horserace-screen .horse-id {
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  display: inline-grid;
  place-items: center;
  font-size: 0.6em;
}

#casino-horserace-screen .horserace-root.is-racing .horse-id {
  animation: horse-id-bob 0.21s ease-in-out infinite alternate;
}

#casino-horserace-screen .horse.is-leader {
  filter: saturate(1.18) brightness(1.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 18px rgba(145, 245, 255, 0.5);
}

#casino-horserace-screen .horse.is-finished {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 244, 174, 0.35), 0 0 18px rgba(255, 221, 143, 0.62);
}

#casino-horserace-screen .horserace-root.is-racing .lane {
  animation: lane-vibe 0.52s ease-in-out infinite;
}

#casino-horserace-screen .horserace-root.is-racing .lane:nth-child(2n) {
  animation-delay: -0.16s;
}

#casino-horserace-screen .horserace-root.is-racing .lane:nth-child(3n) {
  animation-delay: -0.27s;
}

#casino-horserace-screen .horserace-root.is-racing #raceState {
  animation: race-state-pulse 0.74s ease-in-out infinite alternate;
}

@keyframes horse-gallop {
  from {
    transform: scaleX(-1) rotate(-7deg) translateY(1px);
  }
  to {
    transform: scaleX(-1) rotate(5deg) translateY(-1px);
  }
}

@keyframes horse-id-bob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-1px);
  }
}

@keyframes horse-trail {
  0% {
    opacity: 0;
    transform: translate(-1px, -50%) scale(0.75);
  }
  40% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
    transform: translate(-10px, -50%) scale(1.1);
  }
}

@keyframes finish-line-pulse {
  0% {
    opacity: 0.72;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.2));
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
  }
}

@keyframes lane-vibe {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.8px);
  }
}

@keyframes race-state-pulse {
  from {
    letter-spacing: 0.08em;
    color: #7bdfff;
  }
  to {
    letter-spacing: 0.1em;
    color: #9cf3ff;
  }
}

#casino-horserace-screen .hr-history {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

#casino-horserace-screen .hr-history h2 {
  margin: 0;
  font-size: 0.9rem;
}

#casino-horserace-screen .history-list {
  min-height: 0;
  display: grid;
  grid-auto-rows: minmax(0, 1fr);
  gap: 6px;
}

#casino-horserace-screen .history-item,
#casino-horserace-screen .history-empty {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  border-radius: 7px;
  border: 1px solid rgba(111, 155, 191, 0.28);
  background: rgba(9, 24, 37, 0.74);
  padding: 7px 8px;
  font-size: 0.73rem;
}

#casino-horserace-screen .history-item span:last-child {
  text-align: right;
  font-weight: 700;
}

#casino-horserace-screen .history-item.win span:last-child {
  color: var(--ok);
}

#casino-horserace-screen .history-item.loss span:last-child {
  color: var(--bad);
}

#casino-horserace-screen .history-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
}

#casino-horserace-screen .result-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(430px, calc(100% - 36px));
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(126, 180, 220, 0.52);
  background: rgba(7, 20, 32, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  text-align: center;
  z-index: 3;
}

#casino-horserace-screen .result-panel h3,
#casino-horserace-screen .result-panel p {
  margin: 0 0 8px;
}

#casino-horserace-screen #resultNet.win {
  color: var(--ok);
  font-weight: 700;
}

#casino-horserace-screen #resultNet.loss {
  color: var(--bad);
  font-weight: 700;
}

#casino-horserace-screen .horserace-root.is-racing .horse-card,
#casino-horserace-screen .horserace-root.is-racing .hr-buttons button {
  pointer-events: none;
}

@media (max-width: 1220px) {
  #casino-horserace-screen .hr-layout {
    grid-template-columns: minmax(235px, 280px) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }

  #casino-horserace-screen .hr-history {
    grid-column: 1 / -1;
  }

  #casino-horserace-screen .history-list {
    grid-auto-rows: minmax(0, 30px);
  }
}

@media (max-width: 900px) {
  #casino-horserace-screen {
    padding: 8px;
  }

  #casino-horserace-screen .horserace-root {
    gap: 8px;
  }

  #casino-horserace-screen .hr-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  #casino-horserace-screen .horse-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }

  #casino-horserace-screen .lane {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  #casino-horserace-screen .lane-head,
  #casino-horserace-screen .history-item {
    font-size: 0.7rem;
  }
}

@media (max-height: 820px) {
  #casino-horserace-screen {
    padding: 6px;
  }

  #casino-horserace-screen .horserace-root {
    gap: 6px;
  }

  #casino-horserace-screen .track-wrap {
    padding: 6px;
  }

  #casino-horserace-screen .horse {
    min-width: 72px;
    height: calc(100% - 2px);
    padding: 0 8px;
  }

  #casino-horserace-screen .horse-emoji {
    font-size: 1em;
  }

  #casino-horserace-screen .horse-id {
    width: 1.05em;
    height: 1.05em;
    font-size: 0.6em;
  }
}

.keno-root {
  --bg-main: #071b2c;
  --bg-panel: #21384b;
  --bg-panel-soft: #1a3043;
  --line: #2b455a;
  --text-main: #d5e5f2;
  --text-soft: #9db2c4;
  --green: #00ec22;
  --green-dark: #00c700;
  --blue: #41a2ff;
  --gold: #f3bf39;
  --danger: #f36c70;
  width: 100%;
}

.keno-root * {
  box-sizing: border-box;
}

.keno-root .app-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  border-left: 1px solid #1f3a4f;
  border-right: 1px solid #1f3a4f;
  border-bottom: 1px solid #1f3a4f;
  background: linear-gradient(180deg, #0a2439 0%, #06192b 100%);
}

.keno-root .sidebar {
  background: var(--bg-panel);
  border-right: 1px solid #2e465b;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keno-root .mode-switch {
  background: #10293d;
  border: 1px solid #315067;
  border-radius: 999px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.keno-root .mode-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 0;
  color: #9cb0c1;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

.keno-root .mode-btn.active {
  color: #e8f1f8;
  background: #28445b;
}

.keno-root .control-box {
  display: grid;
  gap: 8px;
}

.keno-root .field-block {
  background: var(--bg-panel-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px;
  display: grid;
  gap: 6px;
}

.keno-root .field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.keno-root .field-head strong {
  color: var(--text-main);
  font-size: 0.76rem;
}

.keno-root label {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.keno-root input[type="number"],
.keno-root select {
  width: 100%;
  border: 1px solid #35536a;
  border-radius: 3px;
  background: #102638;
  color: #e3eef8;
  padding: 8px;
  font-size: 0.95rem;
}

.keno-root .bet-row {
  display: grid;
  grid-template-columns: 1fr 38px 38px;
  gap: 4px;
}

.keno-root .chip-btn {
  border: 1px solid #35546d;
  border-radius: 3px;
  background: #1a3449;
  color: #bdd2e3;
  font-weight: 700;
  cursor: pointer;
}

.keno-root .control-btn,
.keno-root .auto-action {
  border: 1px solid #35536a;
  border-radius: 3px;
  background: #2a4257;
  color: #d2e2ef;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
}

.keno-root .bet-btn {
  border: none;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  color: #003307;
  font-weight: 700;
  padding: 11px;
  cursor: pointer;
}

.keno-root .control-btn:hover:not(:disabled),
.keno-root .auto-action:hover:not(:disabled),
.keno-root .bet-btn:hover:not(:disabled),
.keno-root .chip-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.keno-root .auto-controls {
  display: none;
  gap: 7px;
  background: #1a3044;
  border: 1px solid #2f4a5f;
  border-radius: 4px;
  padding: 8px;
}

.keno-root .auto-controls.show {
  display: grid;
}

.keno-root .auto-inputs {
  display: grid;
  gap: 6px;
}

.keno-root .inline-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
}

.keno-root .instant-toggle {
  margin-top: 2px;
  color: #adbfcd;
}

.keno-root .board-area {
  background: #0b2236;
  padding: 12px 10px;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 10px;
}

.keno-root .grid-stage {
  position: relative;
}

.keno-root .grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
}

.keno-root .grid.locked {
  pointer-events: none;
}

.keno-root .tile {
  border: 1px solid #3a566c;
  border-radius: 6px;
  min-height: 76px;
  background: linear-gradient(180deg, #375065 0%, #304b60 100%);
  color: #dceaf4;
  font-size: 1.4rem;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}

.keno-root .tile:hover:not(:disabled) {
  background: #38566f;
  transform: translateY(-1px);
}

.keno-root .tile-label {
  position: relative;
  z-index: 6;
}

.keno-root .tile.selected {
  border-color: #a66dff;
  background: linear-gradient(180deg, #7a38f2 0%, #5a23cf 55%, #4a1fae 100%);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(227, 201, 255, 0.35), 0 0 14px rgba(153, 89, 255, 0.42);
}

.keno-root .tile.drawn-miss {
  border-color: #3d5367;
  background: linear-gradient(180deg, #273d51 0%, #23384a 100%);
  color: #ef4c73;
}

.keno-root .tile.match {
  border: 6px solid #7645e2;
  border-radius: 6px;
  background: #281e52;
  color: #b8beb8;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(176, 144, 255, 0.32), inset 0 0 0 1px #533598, 0 0 0 1px rgba(20, 12, 44, 0.95);
}

.keno-root .profit-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 250px;
  background: linear-gradient(180deg, #1d3144 0%, #162739 100%);
  border: 4px solid #1fe145;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45), 0 0 14px rgba(27, 240, 72, 0.52);
  text-align: center;
  padding: 12px 14px 11px;
  display: none;
  z-index: 8;
}

.keno-root .profit-overlay.show {
  display: block;
}

.keno-root .profit-overlay.loss {
  border-color: #f36c70;
}

.keno-root .profit-overlay.big-win-banner {
  top: 20%;
  min-width: min(420px, 92vw);
  padding: 12px 24px 14px;
}

.keno-root .overlay-big-win-icon {
  display: none;
  margin: 0 auto 6px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 225, 140, 0.7);
  background: linear-gradient(180deg, rgba(255, 226, 129, 0.25) 0%, rgba(255, 193, 74, 0.14) 100%);
  color: #ffe18b;
}

.keno-root .profit-overlay.big-win .overlay-big-win-icon {
  display: inline-flex;
}

.keno-root #overlayMultiplier {
  margin: 0;
  font-size: 3rem;
  line-height: 1;
  font-weight: 900;
  color: #25ec4d;
}

.keno-root .profit-overlay.big-win-banner #overlayMultiplier {
  color: #ffe18b;
  font-size: 2.1rem;
  letter-spacing: 0.08em;
}

.keno-root #overlayProfit {
  margin: 8px 0 0;
  color: #21db44;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 700;
}

.keno-root .profit-overlay.big-win-banner #overlayProfit {
  margin-top: 6px;
  color: #64f972;
  font-size: 2.35rem;
  font-weight: 900;
}

.keno-root .odds-strip {
  display: grid;
  gap: 5px;
}

.keno-root .odds-row {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 4px;
}

.keno-root .odds-cell {
  text-align: center;
  background: #21384c;
  border: 1px solid #36526a;
  border-radius: 3px;
  color: #d2e0ec;
  font-size: 0.68rem;
  font-weight: 700;
  min-height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.keno-root .odds-cell.hits {
  font-size: 0.64rem;
  color: #b8ccdc;
}

.keno-root .odds-cell.active {
  background: linear-gradient(180deg, #16ea2c 0%, #06c51f 100%);
  border-color: #17ef2c;
  color: #03290c;
}

.keno-root .odds-cell.dim {
  opacity: 0.45;
}

.keno-root .status-panel {
  background: #132a3f;
  border: 1px solid #2b4359;
  border-radius: 4px;
  padding: 8px;
  display: grid;
  gap: 5px;
}

.keno-root .status-panel.win {
  border-color: #28cb8b;
  box-shadow: 0 0 16px rgba(17, 209, 143, 0.25);
}

.keno-root .status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.keno-root #payoutSummary {
  color: #a9bfd0;
}

.keno-root .badge {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.keno-root .badge.idle {
  background: #244158;
}

.keno-root .badge.betting {
  background: #2f66a6;
}

.keno-root .badge.result {
  background: #2e8358;
}

.keno-root #message {
  margin: 0;
  font-size: 0.84rem;
}

.keno-root .bottom-strip {
  background: #29435a;
  border: 1px solid #35536a;
  border-radius: 3px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keno-root #pickCounter {
  margin: 0;
  font-size: 0.82rem;
  color: #c7d9e8;
  font-weight: 600;
}

.keno-root .meta-panels {
  display: grid;
  gap: 6px;
}

.keno-root .drawn-numbers {
  min-height: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keno-root .draw-chip {
  min-width: 24px;
  text-align: center;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--blue);
  color: #f4f9ff;
  font-weight: 700;
  font-size: 0.72rem;
}

.keno-root .draw-chip.match {
  background: var(--gold);
  color: #3d2a00;
}

.keno-root #historyList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.keno-root .history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid #30495f;
  border-radius: 3px;
  background: #173046;
  font-size: 0.74rem;
}

.keno-root .history-item .result {
  font-weight: 700;
}

.keno-root .history-item .win {
  color: #31e39d;
}

.keno-root .history-item .loss {
  color: var(--danger);
}

.keno-root button:disabled,
.keno-root input:disabled,
.keno-root select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 1050px) {
  .keno-root .app-shell {
    grid-template-columns: 1fr;
  }

  .keno-root .sidebar {
    border-right: none;
    border-bottom: 1px solid #2e465b;
  }
}

@media (max-width: 620px) {
  .keno-root .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .keno-root .tile {
    min-height: 60px;
    font-size: 1.2rem;
  }

  .keno-root .odds-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ============================
   DIAMOND MATCH (SCOPED)
   ============================ */
.diamond-root {
  --bg: #0f212e;
  --panel: #1a2c38;
  --panel-soft: #213744;
  --panel-2: #2f4553;
  --text: #b1bad3;
  --text-strong: #ffffff;
  --line: #304553;
  --green: #00e701;
  --green-2: #00c700;
  --danger: #d9425e;
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 18% 12%, #153042 0%, rgba(21, 48, 66, 0) 30%), var(--bg);
  color: var(--text);
  padding: 18px;
}

.diamond-root * {
  box-sizing: border-box;
}

.diamond-root .app {
  width: min(1140px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
}

.diamond-root .panel {
  background: var(--panel);
  border-radius: 10px;
  border: 1px solid #243745;
  padding: 14px;
}

.diamond-root .title {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.35rem;
}

.diamond-root .subtitle {
  margin: 6px 0 14px;
  font-size: 0.9rem;
}

.diamond-root .mode-toggle {
  background: #0d1c28;
  border: 1px solid #233848;
  border-radius: 999px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}

.diamond-root .mode-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 8px;
  background: transparent;
  color: #7f8fad;
  font-weight: 700;
  cursor: pointer;
}

.diamond-root .mode-btn.active {
  background: #2f4553;
  color: var(--text-strong);
}

.diamond-root .stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.diamond-root .stat-card {
  background: #0f212e;
  border: 1px solid #233848;
  border-radius: 8px;
  padding: 10px;
}

.diamond-root .label,
.diamond-root .small-label {
  display: block;
  color: #93a6c9;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.diamond-root .stat-card strong {
  color: var(--text-strong);
  font-size: 1.15rem;
}

.diamond-root .bet-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.diamond-root .bet-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 6px;
}

.diamond-root input[type="number"] {
  width: 100%;
  background: #0f212e;
  border: 1px solid #2f4553;
  border-radius: 6px;
  color: #f4f8ff;
  padding: 10px 12px;
  font-size: 1rem;
}

.diamond-root input[type="number"]:focus {
  outline: 2px solid #4f6af4;
  outline-offset: 0;
}

.diamond-root .chip-btn {
  min-width: 46px;
  border: 0;
  border-radius: 6px;
  background: #2f4553;
  color: #dbe4f6;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.diamond-root .chip-btn:hover {
  filter: brightness(1.12);
}

.diamond-root .controls {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.diamond-root .btn {
  border: 0;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.diamond-root .btn:disabled,
.diamond-root .chip-btn:disabled,
.diamond-root .mode-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.diamond-root .btn-play {
  background: linear-gradient(180deg, var(--green), var(--green-2));
  color: #03340e;
}

.diamond-root .btn-reset {
  background: #3d4f60;
  color: #f0f4fc;
}

.diamond-root .message {
  margin: 10px 2px 0;
  min-height: 1.35em;
  color: #d4def0;
  font-weight: 600;
}

.diamond-root .result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.diamond-root .result-header h2 {
  margin: 4px 0 0;
  color: #ffffff;
  font-size: 1.25rem;
}

.diamond-root .last-payout strong {
  color: #ffffff;
  font-size: 1.15rem;
}

.diamond-root .payout-ladder {
  background: #0f212e;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.diamond-root .table-label {
  margin: 0 0 8px;
}

.diamond-root .payout-rows {
  display: grid;
  gap: 6px;
}

.diamond-root .payout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #1b2f3d;
  border: 1px solid #2b4050;
  border-radius: 6px;
  padding: 6px 10px;
}

.diamond-root .payout-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diamond-root .mini-diamonds {
  display: flex;
  gap: 5px;
}

.diamond-root .mini-diamond {
  width: 11px;
  height: 11px;
  display: inline-block;
  clip-path: polygon(50% 0%, 84% 18%, 98% 50%, 78% 84%, 22% 84%, 2% 50%, 16% 18%);
  background: #2d4454;
  border: 1px solid #3e596d;
}

.diamond-root .mini-diamond.filled {
  box-shadow: 0 0 8px rgba(167, 124, 255, 0.45);
}

.diamond-root .mini-diamond.filled-purple {
  background: linear-gradient(140deg, #b39dff, #8f6cff);
  border-color: #9675ff;
  box-shadow: 0 0 8px rgba(167, 124, 255, 0.45);
}

.diamond-root .mini-diamond.filled-red {
  background: linear-gradient(140deg, #ff7b93, #e84f6e);
  border-color: #f16d86;
  box-shadow: 0 0 8px rgba(255, 96, 126, 0.45);
}

.diamond-root .payout-name {
  font-size: 0.78rem;
  color: #dbe6fc;
}

.diamond-root .payout-multi {
  color: #f3f8ff;
  font-weight: 800;
}

.diamond-root .diamond-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.diamond-root .slot {
  background: linear-gradient(180deg, #1f3645, #132733);
  border: 1px solid #365466;
  border-radius: 8px;
  min-height: 140px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.diamond-root .slot .stand {
  width: 78%;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, #2e4556, #172935);
  border: 1px solid #466276;
  transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.diamond-root .diamond {
  width: 62px;
  height: 62px;
  opacity: 0.2;
  transform: translateY(7px) scale(0.92);
  transition: opacity 180ms ease, transform 180ms ease, filter 220ms ease;
  clip-path: polygon(50% 0%, 84% 18%, 98% 50%, 78% 84%, 22% 84%, 2% 50%, 16% 18%);
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 42%),
    conic-gradient(from 215deg at 50% 52%, rgba(0, 0, 0, 0.34), rgba(255, 255, 255, 0.24), rgba(0, 0, 0, 0.2));
  border: 2px solid rgba(255, 255, 255, 0.24);
  position: relative;
}

.diamond-root .diamond::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
}

.diamond-root .slot.revealed .diamond {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.diamond-root .slot.placeholder .diamond {
  background: #1b2f3d;
  border-color: #355264;
}

.diamond-root .slot.match {
  border-color: #77e1ff;
  box-shadow: 0 0 0 1px rgba(119, 225, 255, 0.45), 0 0 18px rgba(79, 211, 255, 0.35);
}

.diamond-root .history {
  margin-top: 14px;
  background: #0f212e;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.diamond-root #historyList {
  margin: 8px 0 0;
  padding-left: 20px;
  max-height: 152px;
  overflow: auto;
}

.diamond-root #historyList li {
  margin: 3px 0;
  font-size: 0.9rem;
}

.diamond-root .gain {
  color: #6ef596;
}

.diamond-root .loss {
  color: #ff869e;
}

@media (max-width: 980px) {
  .diamond-root .app {
    grid-template-columns: 1fr;
  }

  .diamond-root .diamond {
    width: 55px;
    height: 55px;
  }

  .diamond-root .slot {
    min-height: 118px;
  }
}

/* ============================
   CRASH GAME (SCOPED)
   ============================ */
.crash-root {
  --bg-0: #0b1a29;
  --bg-1: #102638;
  --bg-2: #17344a;
  --shell: #112a3d;
  --panel: #263f52;
  --panel-dark: #1d3347;
  --line: #34546f;
  --text: #edf5ff;
  --muted: #9ab0c5;
  --green: #00f20f;
  --green-dark: #00ca0c;
  --amber: #ffb21a;
  --amber-dark: #e69d10;
  --red: #f25a5a;
  margin: 0;
  width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, #294865 0%, transparent 35%),
    radial-gradient(circle at 95% 12%, #1f3956 0%, transparent 34%),
    linear-gradient(165deg, var(--bg-0), var(--bg-1) 50%, var(--bg-2));
}

.crash-root * {
  box-sizing: border-box;
}

.crash-root #app {
  width: min(1500px, 100%);
  border: 1px solid #2e4a62;
  border-radius: 10px;
  background: linear-gradient(180deg, #132d42, #122a3d);
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.crash-root .game-shell {
  display: grid;
  grid-template-columns: 370px 1fr;
  min-height: 700px;
}

.crash-root .left-panel {
  border-right: 1px solid var(--line);
  padding: 0.95rem;
  background: linear-gradient(180deg, #2b465b, #243f54);
}

.crash-root .left-panel h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.crash-root .card {
  border: 1px solid #3b5b76;
  border-radius: 8px;
  padding: 0.72rem;
  background: rgba(24, 44, 61, 0.95);
}

.crash-root .balance-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.65rem;
  margin-bottom: 0.6rem;
}

.crash-root .balance-card span {
  font-size: 0.86rem;
  color: #c0d0df;
}

.crash-root .balance-card strong {
  color: #9af6bd;
  font-size: 1.15rem;
}

.crash-root .controls-card {
  display: grid;
  gap: 0.52rem;
}

.crash-root .mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.25rem;
  border: 1px solid #32526b;
  border-radius: 999px;
  background: #0f273a;
}

.crash-root .mode-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #9cb3c8;
  padding: 0.62rem 0.4rem;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.crash-root .mode-btn.active {
  color: #eaf4fd;
  background: linear-gradient(180deg, #4a6a86, #3b5c77);
}

.crash-root .visually-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.crash-root .controls-card label {
  color: #b6cadc;
  font-size: 0.82rem;
  font-weight: 600;
}

.crash-root .bet-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.38rem;
}

.crash-root .auto-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: center;
}

.crash-root .toggle-label {
  color: #98b3c9;
  font-size: 0.82rem;
}

.crash-root input[type="number"] {
  width: 100%;
  border: 1px solid #3b5f7c;
  border-radius: 6px;
  background: #0e2437;
  color: var(--text);
  padding: 0.62rem 0.7rem;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
}

.crash-root input[type="number"]:focus {
  border-color: #70a4d6;
}

.crash-root .auto-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #3b5f7c;
  border-radius: 6px;
  background: #0e2437;
  padding: 0 0.3rem 0 0.15rem;
}

.crash-root .auto-input-wrap input[type="number"] {
  width: 84px;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.35rem;
}

.crash-root .auto-input-wrap span {
  color: #94afc5;
  font-weight: 700;
}

.crash-root .profit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #3a5a75;
  border-radius: 6px;
  background: #2f4a60;
  padding: 0.58rem 0.64rem;
}

.crash-root .profit-row span {
  font-size: 0.8rem;
  color: #d2dfe9;
}

.crash-root .profit-row strong {
  color: #cbf6de;
  font-size: 0.95rem;
}

.crash-root .mini-btn,
.crash-root .primary-btn,
.crash-root .cashout-btn,
.crash-root .ghost-btn {
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.crash-root .mini-btn {
  min-width: 54px;
  background: #2d4b67;
  color: #d9e6f5;
}

.crash-root .button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.crash-root .primary-btn {
  background: linear-gradient(180deg, var(--green), var(--green-dark));
  color: #09200b;
  padding: 0.8rem 0.8rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.crash-root .cashout-btn {
  background: linear-gradient(180deg, #ffcc4d, var(--amber));
  color: #1b1e22;
  padding: 0.8rem 0.8rem;
}

.crash-root .ghost-btn {
  background: #2a445c;
  color: #e4edf8;
  border: 1px solid #3e617e;
  padding: 0.65rem 0.8rem;
}

.crash-root .mini-btn:disabled,
.crash-root .primary-btn:disabled,
.crash-root .cashout-btn:disabled,
.crash-root .ghost-btn:disabled,
.crash-root .mode-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.crash-root .hint {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.8rem;
  color: #9ab5cb;
}

.crash-root .bet-feed-card {
  margin-top: 0.62rem;
  padding: 0.55rem;
  background: rgba(15, 33, 48, 0.95);
}

.crash-root .feed-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #d7e4ee;
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
}

.crash-root .feed-top b {
  color: #ecf5ff;
  font-size: 0.92rem;
}

.crash-root .feed-top strong {
  color: #f4fafc;
  font-size: 0.98rem;
}

.crash-root .feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
  overflow: hidden;
  min-height: 128px;
}

.crash-root .feed-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.75rem;
  border-radius: 5px;
  padding: 0.08rem 0.14rem;
  opacity: 0.98;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease, filter 220ms ease;
}

.crash-root .feed-list li.feed-enter {
  opacity: 0;
  transform: translateY(-8px);
}

.crash-root .feed-list li.feed-enter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.crash-root .feed-list li.feed-exit {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(0.6px);
}

.crash-root .feed-list span {
  color: #e2edf6;
}

.crash-root .feed-list em {
  color: #d7e8f7;
  font-style: normal;
  font-weight: 700;
}

.crash-root .feed-list strong {
  color: #26dd67;
  font-weight: 800;
}

.crash-root .feed-list li.live {
  background: rgba(44, 66, 86, 0.28);
}

.crash-root .feed-list li.live em {
  color: #f0dca0;
}

.crash-root .feed-list li.live strong {
  color: #cce2f5;
}

.crash-root .feed-list li.won em,
.crash-root .feed-list li.won strong {
  color: #31e472;
}

.crash-root .feed-list li.bust {
  opacity: 0.75;
}

.crash-root .feed-list li.bust em,
.crash-root .feed-list li.bust strong {
  color: #f58c8c;
}

.crash-root .chart-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: #10283d;
}

.crash-root .chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.58rem 1rem;
  border-bottom: 1px solid #284660;
  background: #10293d;
}

.crash-root .badge {
  border: 1px solid #3f607f;
  border-radius: 999px;
  background: #2c4964;
  padding: 0.26rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.crash-root .message {
  color: #9bb2c6;
  font-size: 0.84rem;
}

.crash-root .top-history-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid #25435c;
  background: #11293d;
}

.crash-root .top-history-list {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  max-width: calc(100% - 58px);
  scrollbar-width: thin;
}

.crash-root .top-history-list::-webkit-scrollbar {
  height: 6px;
}

.crash-root .top-history-list::-webkit-scrollbar-thumb {
  background: #325372;
  border-radius: 999px;
}

.crash-root .history-chip {
  flex: 0 0 auto;
  border: 1px solid #51616f;
  border-radius: 999px;
  background: #3e4956;
  color: #e3edf7;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.22rem 0.58rem;
}

.crash-root .history-chip.win {
  border-color: #2f8a4e;
  background: #1c3f2c;
  color: #9df4bf;
}

.crash-root .history-chip.lose {
  border-color: #a65a5a;
  background: #4b2b33;
  color: #ffc9c9;
}

.crash-root .history-chip.neutral {
  border-color: #5f6c78;
  background: #3e4a58;
  color: #d6e1ea;
}

.crash-root .user-pill {
  border: 1px solid #3e607d;
  border-radius: 999px;
  background: #2a4562;
  color: #dbe8f4;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.24rem 0.56rem;
  white-space: nowrap;
}

.crash-root .display-area {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #0a2134, #0b2236 72%, #123048);
}

.crash-root #curveCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crash-root .multiplier {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(2.2rem, 7vw, 5.1rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 0 #172533, 0 0 18px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  user-select: none;
  transform: translateY(-4%);
}

.crash-root .crash-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(2rem, 8vw, 4.4rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffe5e5;
  background: rgba(255, 60, 60, 0.24);
  pointer-events: none;
}

.crash-root .side-payouts {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-38%);
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  overflow: hidden;
  height: 240px;
  align-content: start;
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 74%,
    rgba(0, 0, 0, 0.45) 90%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 74%,
    rgba(0, 0, 0, 0.45) 90%,
    rgba(0, 0, 0, 0) 100%
  );
}

.crash-root .side-payouts li {
  min-width: 230px;
  border: 1px solid #3e586f;
  border-radius: 999px;
  background: rgba(39, 61, 82, 0.9);
  color: #cddaea;
  padding: 0.45rem 0.8rem;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0.98;
  transform: translateY(0);
  transition: opacity 250ms ease, transform 250ms ease, filter 250ms ease;
}

.crash-root .side-payouts li.side-enter {
  opacity: 0;
  transform: translateY(-8px);
}

.crash-root .side-payouts li.side-enter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.crash-root .side-payouts li.side-exit {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(1px);
}

.crash-root .side-payouts strong {
  color: #2fe072;
  font-size: 1.03rem;
}

.crash-root .side-payouts li.live strong {
  color: #c6ddf5;
}

.crash-root .side-payouts li.won strong {
  color: #2fe072;
}

.crash-root .side-payouts li.bust strong {
  color: #f58c8c;
}

.crash-root .hidden {
  display: none;
}

.crash-root #app.state-running {
  border-color: #3b7f59;
  box-shadow: 0 24px 64px rgba(12, 87, 47, 0.32);
}

.crash-root #app.state-running .badge {
  border-color: #408a5f;
  background: #265c3c;
}

.crash-root #app.state-running .multiplier {
  color: #e8fff0;
}

.crash-root #app.state-cashed_out .multiplier {
  color: #bff8d4;
}

.crash-root #app.state-crashed {
  border-color: #954848;
  box-shadow: 0 24px 64px rgba(114, 24, 24, 0.42);
}

.crash-root #app.state-crashed .badge {
  border-color: #a96060;
  background: #683737;
}

.crash-root #app.state-crashed .multiplier {
  color: #ffd2d2;
}

.crash-root #app.state-crashed.flash {
  animation: crashFlash 220ms ease-in-out 2;
}

@keyframes crashFlash {
  0% {
    box-shadow: 0 0 0 rgba(255, 0, 0, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 62, 62, 0.4), 0 24px 64px rgba(153, 17, 17, 0.5);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 0, 0, 0);
  }
}

@media (max-width: 1150px) {
  .crash-root .side-payouts {
    display: none;
  }
}

@media (max-width: 980px) {
  .crash-root .game-shell {
    grid-template-columns: 1fr;
  }

  .crash-root .left-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .crash-root .chart-panel {
    min-height: 560px;
  }

  .crash-root .top-history-wrap {
    justify-content: flex-start;
  }

  .crash-root .top-history-list {
    max-width: calc(100% - 48px);
  }
}

@media (max-width: 620px) {
  .crash-root {
    padding: 0.55rem;
  }

  .crash-root .left-panel {
    padding: 0.75rem;
  }

  .crash-root .chart-header,
  .crash-root .top-history-wrap {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .crash-root .button-row {
    grid-template-columns: 1fr;
  }

  .crash-root .auto-row {
    grid-template-columns: 1fr;
    gap: 0.32rem;
  }

  .crash-root .feed-list {
    max-height: 190px;
  }
}

/* ============================
   MINES GAME (SCOPED)
   ============================ */
.mines-root {
  --page: #0b1e2c;
  --panel: #243646;
  --panel-edge: #31485d;
  --surface: #1f3142;
  --surface-2: #162b3f;
  --board: #0a1f31;
  --tile: #071d30;
  --tile-hover: #0b273f;
  --tile-hidden-face: #3b4e62;
  --tile-hidden-face-hover: #43586d;
  --tile-hidden-edge: #23384b;
  --tile-hidden-shadow: #132c3f;
  --text: #d8e0ea;
  --text-strong: #f1f7ff;
  --muted: #95a6b8;
  --green: #67e347;
  --green-press: #56ca39;
  --danger: #ef4c58;
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 15% 10%, #16324a, transparent 36%), var(--page);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  animation: mines-bg-drift 13s ease-in-out infinite alternate;
}

.mines-root * {
  box-sizing: border-box;
}

.mines-root input,
.mines-root select,
.mines-root button {
  font: inherit;
}

@keyframes mines-bg-drift {
  0% {
    background-position: 0% 0%, 0 0;
  }
  100% {
    background-position: 10% 6%, 0 0;
  }
}

.mines-root .app {
  min-height: 100vh;
  padding: 1.15rem;
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 0;
}

.mines-root .panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  animation: mines-panel-in 420ms ease both;
}

.mines-root .panel-card,
.mines-root .card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.75rem;
}

.mines-root .panel-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mines-root .toggle-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: #13293d;
}

.mines-root .mode-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.58rem 0.7rem;
  color: #d6e4f3;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.mines-root .mode-btn.active {
  background: #3a4e62;
  color: #f3f8ff;
}

.mines-root .field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}

.mines-root .field-head.single {
  margin-top: 0.05rem;
}

.mines-root .auto-settings {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.2rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mines-root .auto-settings input {
  height: 2.6rem;
  font-size: 1rem;
}

.mines-root label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #d7e2ee;
}

.mines-root .field-head strong {
  color: #9eb0c3;
  font-family: "Consolas", "Courier New", monospace;
}

.mines-root .bet-row {
  display: grid;
  grid-template-columns: 1fr auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #2f4560;
}

.mines-root input,
.mines-root select {
  border: 1px solid #2f4560;
  border-radius: 8px;
  background: #10283d;
  color: var(--text-strong);
  height: 3.1rem;
  padding: 0 0.7rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.mines-root #betAmount {
  border: 0;
  border-radius: 0;
  min-width: 0;
}

.mines-root input::-webkit-outer-spin-button,
.mines-root input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mines-root input[type="number"] {
  appearance: textfield;
}

.mines-root .bet-adjust {
  display: flex;
  background: #2c4259;
}

.mines-root .bet-adjust button {
  width: 3.35rem;
  border: 0;
  color: #d5e3f3;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.mines-root .bet-adjust button + button {
  border-left: 1px solid #3b516b;
}

.mines-root .bet-adjust button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mines-root select {
  width: 100%;
  height: 3.2rem;
  font-size: 1.2rem;
}

.mines-root .btn {
  width: 100%;
  border: 0;
  border-radius: 8px;
  height: 3.45rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #10231a;
  cursor: pointer;
  transition: filter 120ms ease, transform 120ms ease;
}

.mines-root .btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.mines-root .btn:active:not(:disabled) {
  transform: translateY(1px);
}

.mines-root .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mines-root .primary,
.mines-root .success {
  background: linear-gradient(180deg, #6be649, var(--green));
}

.mines-root .primary:active:not(:disabled),
.mines-root .success:active:not(:disabled) {
  background: var(--green-press);
}

.mines-root .stats {
  background: var(--surface-2);
  display: grid;
  gap: 0.4rem;
  padding: 0.85rem;
}

.mines-root .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.mines-root .row span {
  color: var(--muted);
}

.mines-root .row strong {
  color: var(--text-strong);
  font-family: "Consolas", "Courier New", monospace;
  letter-spacing: 0.02em;
}

.mines-root #multiplier.multiplier-pop {
  animation: mines-pop 200ms ease;
}

@keyframes mines-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
  }
}

.mines-root .history-card {
  padding: 0.75rem;
}

.mines-root h2 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: #a8b8ca;
  font-weight: 700;
}

.mines-root .history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  max-height: 160px;
  overflow-y: auto;
}

.mines-root .history li {
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  background: #12293d;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.mines-root .history li.win {
  border-left: 3px solid #54d96a;
}

.mines-root .history li.loss {
  border-left: 3px solid #de5260;
}

.mines-root .message {
  margin: 0;
  min-height: 1.2rem;
  color: #b9c9da;
  font-size: 0.88rem;
}

.mines-root .game-area {
  position: relative;
  border-radius: 0 12px 12px 0;
  background: var(--board);
  border: 1px solid #1e3549;
  overflow: hidden;
  padding: 1.25rem;
  animation: mines-panel-in 520ms ease both;
}

.mines-root .game-area::before {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 20%, rgba(102, 227, 71, 0.08), transparent 46%);
  animation: mines-aura-sway 7s ease-in-out infinite alternate;
}

@keyframes mines-panel-in {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mines-aura-sway {
  0% {
    transform: translateX(-3%) translateY(-1%);
  }
  100% {
    transform: translateX(3%) translateY(1%);
  }
}

.mines-root .grid {
  width: min(76vmin, 790px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.mines-root .grid.board-enter .tile {
  animation-name: mines-tile-rise, mines-tile-pulse;
  animation-duration: 380ms, 2.6s;
  animation-delay: var(--stagger, 0ms), calc(var(--stagger, 0ms) + 380ms);
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1), ease-in-out;
  animation-fill-mode: both, both;
  animation-iteration-count: 1, infinite;
}

.mines-root .tile {
  position: relative;
  border: 1px solid var(--tile-hidden-edge);
  border-radius: 12px;
  background: linear-gradient(180deg, #41566b, var(--tile-hidden-face));
  box-shadow:
    0 6px 0 0 var(--tile-hidden-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
  animation: mines-tile-pulse 2.6s ease-in-out infinite;
  animation-delay: var(--pulse-delay, 0ms);
}

.mines-root .tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 18%, rgba(255, 255, 255, 0.06) 50%, transparent 80%);
  opacity: 0;
  transform: translateX(-140%);
  transition: opacity 180ms ease;
  pointer-events: none;
}

.mines-root .tile:not(.revealed):not(.disabled):hover::after {
  opacity: 1;
  animation: mines-sheen 700ms ease;
}

.mines-root .tile:hover:not(.revealed):not(.disabled) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #4a6075, var(--tile-hidden-face-hover));
  box-shadow:
    0 7px 0 0 var(--tile-hidden-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.mines-root .tile.revealed {
  animation: mines-tile-reveal-flip 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both !important;
  border-color: #0c2a40;
  background: linear-gradient(180deg, #072036, var(--tile));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

@keyframes mines-tile-reveal-flip {
  0% {
    transform: rotateY(0deg) scale(1);
  }
  45% {
    transform: rotateY(90deg) scale(1.03);
  }
  100% {
    transform: rotateY(180deg) scale(1);
  }
}

@keyframes mines-tile-rise {
  0% {
    transform: translateY(12px) scale(0.95);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes mines-tile-pulse {
  0%,
  100% {
    box-shadow:
      0 6px 0 0 var(--tile-hidden-shadow),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  50% {
    box-shadow:
      0 6px 0 0 var(--tile-hidden-shadow),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
}

@keyframes mines-sheen {
  0% {
    transform: translateX(-140%);
  }
  100% {
    transform: translateX(140%);
  }
}

.mines-root .tile .icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: rotateY(180deg) scale(0.78);
  transition: opacity 160ms ease, transform 160ms ease;
  overflow: hidden;
  pointer-events: none;
}

.mines-root .tile.revealed .icon {
  opacity: 1;
  transform: rotateY(180deg) scale(1);
}

.mines-root .gem-svg {
  width: 62%;
  height: 62%;
  filter: drop-shadow(0 0 10px rgba(106, 240, 102, 0.28));
}

.mines-root .mine-svg {
  width: 54%;
  height: 54%;
}

.mines-root .tile.mine.muted .mine-svg {
  opacity: 0.42;
}

.mines-root .tile.mine.explode .icon {
  animation: mines-mine-burst-icon 320ms ease;
}

@keyframes mines-mine-burst-icon {
  0% {
    transform: rotateY(180deg) scale(1);
    filter: drop-shadow(0 0 0 rgba(239, 76, 88, 0));
  }
  50% {
    transform: rotateY(180deg) scale(1.16);
    filter: drop-shadow(0 0 10px rgba(239, 76, 88, 0.85));
  }
  100% {
    transform: rotateY(180deg) scale(1);
    filter: drop-shadow(0 0 4px rgba(239, 76, 88, 0.5));
  }
}

.mines-root .tile.sparkle .icon::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: #b9ff9a;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(185, 255, 154, 0.3),
    18px -10px 0 -3px rgba(185, 255, 154, 0.8),
    -16px 8px 0 -4px rgba(185, 255, 154, 0.75),
    6px 18px 0 -4px rgba(185, 255, 154, 0.8);
  animation: mines-sparkle-burst 640ms ease-out both;
}

@keyframes mines-sparkle-burst {
  0% {
    transform: scale(0.35);
    opacity: 0.1;
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: scale(2.3);
    opacity: 0;
  }
}

.mines-root .overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #f3f8ff;
  pointer-events: none;
}

.mines-root .overlay.loss {
  background: rgba(113, 19, 29, 0.45);
  animation: mines-overlay-in 220ms ease both;
}

.mines-root .overlay.win {
  background: rgba(19, 95, 44, 0.36);
  animation: mines-overlay-in 220ms ease both;
}

@keyframes mines-overlay-in {
  0% {
    opacity: 0;
    transform: scale(0.97);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.mines-root .game-area.board-shake {
  animation: mines-board-shake 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes mines-board-shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(7px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(4px);
  }
  100% {
    transform: translateX(0);
  }
}

.mines-root .hidden {
  display: none !important;
}

@media (max-width: 1060px) {
  .mines-root .app {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .mines-root .panel,
  .mines-root .game-area {
    border-radius: 12px;
    border-right: 1px solid var(--panel-edge);
  }

  .mines-root .grid {
    width: min(92vw, 700px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mines-root * {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================
   CROSSY ROAD (SCOPED)
   ============================ */
.crossy-root {
  --page-bg: #040922;
  --card-bg: #0b1139;
  --panel-bg: #0d1241;
  --panel-edge: #151c58;
  --text-main: #eef0ff;
  --text-soft: #9ca4df;
  --purple: #6f42fb;
  --purple-dark: #352974;
  --yellow: #f6c307;
  --yellow-shadow: #8e6505;
  background: linear-gradient(180deg, #030817 0%, #03071a 100%);
  color: var(--text-main);
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

.crossy-root * {
  box-sizing: border-box;
}

.crossy-root .road-shell {
  width: min(99vw, 1680px);
  margin: 20px auto;
  border: 1px solid #0f1b5a;
  border-radius: 16px;
  overflow: hidden;
  background: #060c2a;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.55);
}

.crossy-root .stage-card {
  position: relative;
  height: min(72vh, 700px);
  min-height: 380px;
  background: #30356d;
}

.crossy-root #gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crossy-root .result-panel {
  position: absolute;
  right: 20px;
  top: 20px;
  z-index: 2;
  min-width: 240px;
  background: rgba(10, 14, 44, 0.92);
  border: 2px solid #6f42fb;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.crossy-root .result-panel h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.crossy-root .result-panel p {
  margin: 4px 0;
  color: #dbe0ff;
}

.crossy-root .hidden {
  display: none !important;
}

.crossy-root .control-card {
  background: var(--card-bg);
  border-top: 3px solid #070c2b;
  padding: 16px 18px 0;
}

.crossy-root .control-row {
  display: grid;
  grid-template-columns: 1.25fr 1.2fr 1.25fr;
  gap: 14px;
}

.crossy-root .control-block {
  background: var(--panel-bg);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 12px;
  min-height: 108px;
}

.crossy-root .block-title {
  font-size: 1.03rem;
  font-weight: 700;
  color: #d9ddff;
  margin-bottom: 10px;
}

.crossy-root .bet-input-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 6px;
  align-items: center;
}

.crossy-root .bet-prefix {
  color: #d0d7ff;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

.crossy-root #betInput {
  width: 100%;
  border: 1px solid #212d75;
  border-radius: 9px;
  background: #050a2a;
  color: #ffffff;
  font-size: 2.15rem;
  font-weight: 800;
  height: 56px;
  padding: 4px 10px;
}

.crossy-root #betInput:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.crossy-root .mini-btn {
  border: 1px solid #2f3a86;
  background: #1a235c;
  color: #f0f2ff;
  border-radius: 9px;
  height: 56px;
  min-width: 68px;
  font-size: 1.72rem;
  font-weight: 700;
  cursor: pointer;
}

.crossy-root .mini-btn:hover {
  background: #263071;
}

.crossy-root .mini-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #121a46;
}

.crossy-root .difficulty-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.crossy-root .difficulty-btn {
  border: 1px solid #2f387d;
  background: #1b2459;
  color: #dbe1ff;
  border-radius: 10px;
  height: 56px;
  font-size: 1.76rem;
  font-weight: 700;
  cursor: pointer;
}

.crossy-root .difficulty-btn.active {
  background: linear-gradient(180deg, #764dff, #6139e9);
  color: #ffffff;
}

.crossy-root .difficulty-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.crossy-root .notice-pill {
  border: 1px solid #5d3bd7;
  background: #4e31bb;
  color: #d9cbff;
  border-radius: 10px;
  font-size: 1.62rem;
  font-weight: 700;
  text-align: center;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.crossy-root .start-btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  height: 62px;
  background: linear-gradient(165deg, #ffd636 0%, #f4bd07 62%, #dba103 100%);
  color: #fef8d9;
  font-size: 1.42rem;
  line-height: 1.05;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 -4px 0 var(--yellow-shadow);
}

.crossy-root .start-btn:active {
  transform: translateY(1px);
}

.crossy-root .sub-stats {
  margin-top: 8px;
  font-size: 1.55rem;
  color: var(--text-soft);
}

.crossy-root .sub-stats span {
  color: #f5f7ff;
  font-weight: 800;
}

.crossy-root .right-text {
  text-align: right;
}

.crossy-root .mode-tabs {
  margin-top: 12px;
  border-top: 1px solid #1a2368;
  display: flex;
  gap: 26px;
  padding: 0 8px;
}

.crossy-root .tab-btn {
  border: 0;
  background: none;
  color: #9ca5dc;
  font-size: 1.75rem;
  font-weight: 700;
  padding: 12px 8px 14px;
  position: relative;
  cursor: pointer;
}

.crossy-root .tab-btn.active {
  color: #f3f5ff;
}

.crossy-root .tab-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: #6f42fb;
}

.crossy-root .status-text {
  margin: 10px 18px 18px;
  color: #9fa5d7;
  font-size: 1.35rem;
}

@media (max-width: 1280px) {
  .crossy-root .control-row {
    grid-template-columns: 1fr;
  }

  .crossy-root #betInput,
  .crossy-root .mini-btn,
  .crossy-root .difficulty-btn {
    font-size: 1.2rem;
    height: 44px;
  }

  .crossy-root .notice-pill {
    font-size: 1rem;
  }

  .crossy-root .start-btn {
    height: 52px;
    font-size: 1.25rem;
  }

  .crossy-root .sub-stats,
  .crossy-root .tab-btn,
  .crossy-root .status-text {
    font-size: 1rem;
  }
}

@media (max-width: 760px) {
  .crossy-root .road-shell {
    margin: 10px auto;
    border-radius: 10px;
  }

  .crossy-root .stage-card {
    height: 54vh;
  }

  .crossy-root .control-card {
    padding: 12px 12px 0;
  }

.crossy-root .mode-tabs {
    gap: 14px;
  }
}

/* ===============================
   CRYPTO SLOTS (SCOPED)
   =============================== */
.crypto-slot-root {
  --bg-main: #071c2c;
  --bg-alt: #08192a;
  --panel: #213b4d;
  --panel-deep: #1a3243;
  --panel-border: #2b4a61;
  --input-bg: #20394b;
  --slot-divider: #18374d;
  --text-main: #e7f1f8;
  --text-soft: #89a3b7;
  --green-main: #00e600;
  --green-dark: #00bd00;
  --green-glow: rgba(74, 255, 66, 0.55);
  --blue-highlight: #57b2e7;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --reel-height: 470px;
  color: var(--text-main);
}

.crypto-slot-root *,
.crypto-slot-root *::before,
.crypto-slot-root *::after {
  box-sizing: border-box;
}

.crypto-slot-root .app-shell {
  max-width: 1360px;
  min-height: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 10px;
  background: linear-gradient(180deg, rgba(8, 30, 49, 0.96), rgba(6, 25, 42, 0.98));
  border: 1px solid rgba(62, 98, 122, 0.35);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 8px;
}

.crypto-slot-root .panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-deep));
  border: 1px solid rgba(72, 106, 129, 0.55);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -10px 14px rgba(0, 0, 0, 0.16);
}

.crypto-slot-root .left-panel,
.crypto-slot-root .right-panel {
  padding: 8px;
}

.crypto-slot-root .left-panel {
  display: grid;
  gap: 8px;
  align-content: start;
}

.crypto-slot-root .control-block {
  background: linear-gradient(180deg, #274055, #22394b);
  border: 1px solid rgba(65, 96, 117, 0.62);
  border-radius: var(--radius-md);
  padding: 8px;
}

.crypto-slot-root .block-title {
  margin: 0 0 6px;
  font-size: 0.73rem;
  color: #9eb5c5;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.crypto-slot-root .mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border-radius: 999px;
  background: #102536;
  border: 1px solid rgba(66, 96, 118, 0.72);
}

.crypto-slot-root .mode-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #c5d8e6;
  font-size: 0.82rem;
  font-weight: 700;
  height: 30px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 120ms ease;
}

.crypto-slot-root .mode-btn:hover {
  background: rgba(72, 112, 138, 0.28);
}

.crypto-slot-root .mode-btn.active {
  background: linear-gradient(180deg, #304f65, #284357);
  color: #f2f7fc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.crypto-slot-root .bet-control,
.crypto-slot-root .per-line-wrap {
  display: grid;
  align-items: center;
  gap: 6px;
}

.crypto-slot-root .bet-control {
  grid-template-columns: 30px 1fr 30px;
}

.crypto-slot-root .per-line-wrap {
  grid-template-columns: auto 1fr;
  border-radius: var(--radius-sm);
  background: #162b3b;
  border: 1px solid rgba(71, 102, 124, 0.7);
  padding: 6px 8px;
}

.crypto-slot-root .dot-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a8ff9d, #38df3e);
  box-shadow: 0 0 8px rgba(84, 255, 88, 0.72);
}

.crypto-slot-root .adjust-btn {
  border: 1px solid rgba(76, 109, 132, 0.78);
  border-radius: 7px;
  background: linear-gradient(180deg, #2c485d, #243d50);
  color: #e3eef7;
  font-size: 0.98rem;
  font-weight: 800;
  height: 34px;
  cursor: pointer;
  transition: border-color 140ms ease, transform 120ms ease;
}

.crypto-slot-root .adjust-btn:hover {
  border-color: rgba(108, 156, 188, 0.9);
}

.crypto-slot-root .adjust-btn:active {
  transform: translateY(1px);
}

.crypto-slot-root .numeric-input,
.crypto-slot-root .numeric-select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(76, 109, 132, 0.8);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: #eff7ff;
  font-size: 0.98rem;
  font-weight: 700;
  padding: 8px 10px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.crypto-slot-root .numeric-input:focus,
.crypto-slot-root .numeric-select:focus {
  border-color: var(--blue-highlight);
  box-shadow: 0 0 0 3px rgba(86, 170, 228, 0.2);
}

.crypto-slot-root .bet-action-wrap {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.crypto-slot-root .bet-btn {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #1ef218, #05c902);
  color: #033102;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(11, 186, 21, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: box-shadow 140ms ease, transform 120ms ease, filter 140ms ease;
}

.crypto-slot-root .bet-btn:hover:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(147, 255, 139, 0.7), 0 0 18px var(--green-glow), 0 12px 20px rgba(11, 186, 21, 0.3);
  filter: brightness(1.03);
}

.crypto-slot-root .bet-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.crypto-slot-root .bet-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2) brightness(0.86);
  box-shadow: none;
}

.crypto-slot-root .stats-box,
.crypto-slot-root .chart-box {
  padding: 8px;
}

.crypto-slot-root .stats-grid {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.crypto-slot-root .stats-grid dt {
  margin: 0;
  color: #89a2b4;
  font-size: 0.68rem;
  font-weight: 700;
}

.crypto-slot-root .stats-grid dd {
  margin: 1px 0 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.crypto-slot-root #resultsChart {
  width: 100%;
  height: 146px;
  border-radius: 6px;
  background: linear-gradient(180deg, #3c2034 0%, #2a1625 100%);
  border: 1px solid rgba(93, 67, 90, 0.6);
}

.crypto-slot-root .right-panel {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 10px;
  background: linear-gradient(180deg, #062037 0%, #051b2f 100%);
}

.crypto-slot-root .payout-display {
  position: relative;
  justify-self: center;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #4a6476, #3f596b);
  border: 1px solid rgba(129, 154, 173, 0.48);
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 1.12rem;
  font-weight: 800;
  color: #f6fbff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.crypto-slot-root .slot-machine {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 590px;
}

.crypto-slot-root .slot-frame {
  position: relative;
  width: min(100%, 980px);
  border-radius: 18px;
  padding: 10px;
  background: #305269;
  border: 1px solid rgba(101, 134, 157, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 26px rgba(0, 0, 0, 0.35);
}

.crypto-slot-root .frame-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(60, 86, 104, 0.45);
}

.crypto-slot-root .reels {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: var(--reel-height);
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(8, 36, 59, 0.78) 0%, rgba(7, 31, 51, 0.78) 100%);
  border: 1px solid rgba(24, 57, 80, 0.9);
}

.crypto-slot-root .reel {
  position: relative;
  overflow: hidden;
  border-right: 2px solid var(--slot-divider);
}

.crypto-slot-root .reel:last-child {
  border-right: 0;
}

.crypto-slot-root .reel-strip {
  will-change: transform;
}

.crypto-slot-root .reel.is-spinning .symbol {
  filter: blur(1px);
}

.crypto-slot-root .symbol {
  height: calc(var(--reel-height) / 3);
  display: grid;
  place-items: center;
  position: relative;
  padding: 4px;
}

.crypto-slot-root .symbol-inner {
  --symbol-glow: rgba(113, 182, 255, 0.35);
  width: clamp(72px, 7vw, 94px);
  height: clamp(72px, 7vw, 94px);
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.03) 44%),
    linear-gradient(160deg, rgba(56, 86, 110, 0.56), rgba(13, 35, 51, 0.46));
  border: 1px solid rgba(137, 174, 200, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -8px 12px rgba(0, 0, 0, 0.38), 0 8px 14px rgba(0, 0, 0, 0.3),
    0 0 14px var(--symbol-glow);
}

.crypto-slot-root .symbol-icon {
  width: 88%;
  height: 88%;
}

.crypto-slot-root .symbol-icon .stroke {
  stroke: rgba(235, 247, 255, 0.85);
  stroke-width: 6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crypto-slot-root .symbol-icon text {
  fill: #eefcff;
  font-weight: 800;
  font-size: 52px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  dominant-baseline: middle;
  text-anchor: middle;
}

.crypto-slot-root .symbol-club .symbol-inner {
  --symbol-glow: rgba(164, 109, 255, 0.42);
}

.crypto-slot-root .symbol-spade .symbol-inner {
  --symbol-glow: rgba(99, 168, 255, 0.4);
}

.crypto-slot-root .symbol-heart .symbol-inner {
  --symbol-glow: rgba(255, 99, 130, 0.45);
}

.crypto-slot-root .symbol-triangle .symbol-inner {
  --symbol-glow: rgba(255, 197, 77, 0.4);
}

.crypto-slot-root .symbol-pentagon .symbol-inner {
  --symbol-glow: rgba(159, 114, 255, 0.42);
}

.crypto-slot-root .symbol-chip .symbol-inner {
  --symbol-glow: rgba(101, 177, 255, 0.44);
}

.crypto-slot-root .symbol-diamond .symbol-inner {
  --symbol-glow: rgba(93, 235, 131, 0.44);
}

.crypto-slot-root .symbol-crystal .symbol-inner {
  --symbol-glow: rgba(116, 244, 255, 0.46);
}

.crypto-slot-root .symbol-coin .symbol-inner {
  --symbol-glow: rgba(255, 204, 96, 0.46);
}

.crypto-slot-root .symbol-wild .symbol-inner {
  --symbol-glow: rgba(126, 232, 255, 0.56);
}

.crypto-slot-root .symbol-scatter .symbol-inner {
  --symbol-glow: rgba(255, 210, 112, 0.54);
}

.crypto-slot-root .symbol.win-highlight .symbol-inner {
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(114, 255, 137, 0.88), 0 0 24px rgba(91, 255, 112, 0.8);
  animation: crypto-slot-pulse-glow 460ms ease-in-out 2;
}

.crypto-slot-root .payline-overlay {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  pointer-events: none;
}

.crypto-slot-root .payline-overlay.back {
  z-index: 1;
  opacity: 0.58;
}

.crypto-slot-root .payline-overlay.front {
  z-index: 5;
}

.crypto-slot-root .payline-path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(96, 178, 240, 0.42));
}

.crypto-slot-root .payline-path.is-winning {
  stroke-width: 4;
  opacity: 0.95;
  filter: drop-shadow(0 0 10px rgba(106, 255, 139, 0.78)) drop-shadow(0 0 20px rgba(106, 255, 139, 0.38));
}

.crypto-slot-root .payline-numbers {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  gap: 11px;
  pointer-events: none;
}

.crypto-slot-root .payline-numbers.left {
  left: 8px;
}

.crypto-slot-root .payline-numbers.right {
  right: 8px;
}

.crypto-slot-root .payline-numbers span {
  min-width: 18px;
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: #dce8f0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.crypto-slot-root .message-line {
  text-align: center;
  color: #c8d9e6;
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 1.4em;
}

.crypto-slot-root .slot-frame.win-pulse {
  animation: crypto-slot-frame-pulse 650ms ease;
}

.crypto-slot-root .slot-frame.loss-tint {
  animation: crypto-slot-loss-tint 420ms ease;
}

.crypto-slot-root .flash-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0));
  opacity: 0;
  pointer-events: none;
}

.crypto-slot-root .flash-overlay.active {
  animation: crypto-slot-flash-burst 330ms ease;
}

.crypto-slot-root .particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff4af, #f7bb2a);
  box-shadow: 0 0 8px rgba(247, 194, 56, 0.8);
  pointer-events: none;
}

.crypto-slot-root .app-shell.big-win-shake {
  animation: crypto-slot-big-win-shake 420ms ease;
}

.crypto-slot-root .profit-pos {
  color: #43e84e;
}

.crypto-slot-root .profit-neg {
  color: #ff7082;
}

.crypto-slot-root .bet-btn.warn {
  animation: crypto-slot-warn-pulse 360ms ease;
}

.crypto-slot-root .fx-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1200;
  overflow: hidden;
}

.crypto-slot-root .fx-overlay.fx-overlay-bigmode::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 52%, rgba(70, 148, 210, 0.24), rgba(5, 20, 36, 0.08) 40%, rgba(5, 20, 36, 0) 68%);
  animation: crypto-slot-overlay-pulse 820ms ease-in-out infinite;
}

.crypto-slot-root .fx-toast {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 22px) scale(0.9);
  opacity: 0;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  transition: transform 240ms ease, opacity 240ms ease;
}

.crypto-slot-root .fx-toast-win {
  color: #59ff77;
  font-size: clamp(1.6rem, 3.3vw, 2.4rem);
  filter: drop-shadow(0 0 14px rgba(76, 255, 106, 0.52));
}

.crypto-slot-root .fx-toast.active {
  transform: translate(-50%, -8px) scale(1);
  opacity: 1;
}

.crypto-slot-root .fx-toast.leave {
  transform: translate(-50%, -44px) scale(1.04);
  opacity: 0;
}

.crypto-slot-root .fx-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: min(88vw, 520px);
  transform: translate(-50%, -50%) scale(0.78);
  opacity: 0;
  text-align: center;
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px solid rgba(158, 187, 209, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 24px 36px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
}

.crypto-slot-root .fx-banner.active {
  animation: crypto-slot-banner-in 360ms cubic-bezier(0.2, 0.88, 0.24, 1.1) forwards, crypto-slot-banner-pulse 980ms ease-in-out 250ms infinite;
}

.crypto-slot-root .fx-banner.leave {
  animation: crypto-slot-banner-out 320ms ease forwards;
}

.crypto-slot-root .fx-banner-title {
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #f4fbff;
}

.crypto-slot-root .fx-banner-amount {
  margin-top: 6px;
  font-size: clamp(2rem, 6.2vw, 3.4rem);
  line-height: 1;
  font-weight: 900;
  color: #7dff7f;
  text-shadow: 0 0 20px rgba(124, 255, 131, 0.58), 0 3px 0 rgba(0, 0, 0, 0.35);
}

.crypto-slot-root .fx-banner-subtitle {
  margin-top: 8px;
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  color: #cfe0ed;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crypto-slot-root .fx-banner-big {
  background: linear-gradient(160deg, rgba(44, 83, 115, 0.92), rgba(23, 45, 63, 0.94));
  border-color: rgba(162, 207, 231, 0.62);
}

.crypto-slot-root .fx-banner-big.fx-tier-big .fx-banner-amount {
  color: #63ff7e;
}

.crypto-slot-root .fx-banner-big.fx-tier-mega .fx-banner-amount {
  color: #6df7ff;
}

.crypto-slot-root .fx-banner-big.fx-tier-epic .fx-banner-amount {
  color: #ffd772;
}

.crypto-slot-root .fx-banner-big.fx-tier-legendary .fx-banner-amount {
  color: #ff9ec4;
}

.crypto-slot-root .fx-banner-freespins {
  background: linear-gradient(170deg, rgba(33, 85, 120, 0.88), rgba(16, 45, 67, 0.9));
}

@keyframes crypto-slot-frame-pulse {
  0% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 26px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 2px rgba(92, 255, 122, 0.65), 0 0 28px rgba(92, 255, 122, 0.55); }
  100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 26px rgba(0, 0, 0, 0.35); }
}

@keyframes crypto-slot-loss-tint {
  0% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 26px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: inset 0 0 0 999px rgba(216, 79, 96, 0.14), 0 0 0 1px rgba(255, 112, 130, 0.35); }
  100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 26px rgba(0, 0, 0, 0.35); }
}

@keyframes crypto-slot-pulse-glow {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes crypto-slot-flash-burst {
  0% { opacity: 0; }
  30% { opacity: 0.62; }
  100% { opacity: 0; }
}

@keyframes crypto-slot-big-win-shake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
  100% { transform: translate(0, 0); }
}

@keyframes crypto-slot-warn-pulse {
  0% { box-shadow: 0 0 0 rgba(255, 120, 137, 0); }
  50% { box-shadow: 0 0 0 2px rgba(255, 120, 137, 0.65), 0 0 16px rgba(255, 120, 137, 0.45); }
  100% { box-shadow: 0 0 0 rgba(255, 120, 137, 0); }
}

@keyframes crypto-slot-banner-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.78); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes crypto-slot-banner-out {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes crypto-slot-banner-pulse {
  0% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 24px 36px rgba(0, 0, 0, 0.42); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 0 0 1px rgba(136, 224, 255, 0.35), 0 0 28px rgba(116, 219, 255, 0.4), 0 24px 36px rgba(0, 0, 0, 0.42); }
  100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 24px 36px rgba(0, 0, 0, 0.42); }
}

@keyframes crypto-slot-overlay-pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

@media (max-width: 980px) {
  .crypto-slot-root .app-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .crypto-slot-root .left-panel {
    order: 2;
  }

  .crypto-slot-root .right-panel {
    order: 1;
  }

  .crypto-slot-root .slot-machine {
    min-height: 500px;
  }
}

@media (max-width: 620px) {
  .crypto-slot-root {
    --reel-height: 320px;
  }

  .crypto-slot-root .symbol-inner {
    width: 60px;
    height: 60px;
  }
}

/* Mobile Roulette (standalone replacement) */
.roulette-root.mobile-roulette {
  --bg-deep: #06090b;
  --bg-mid: #0d1318;
  --ink: #f4f7ff;
  --muted: #98a1c2;
  --action-green: #00e701;
  --action-green-2: #12c800;
  --gold: #d7b44f;
  --tile-radius: 0.82rem;
  --red: #ef304f;
  --black: #181b2b;
  --green: #45d35f;
  --yellow: #f2cf2c;
  --blue: #1f78e2;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 8%, #102018 0%, var(--bg-mid) 42%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

.roulette-root.mobile-roulette * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.roulette-root.mobile-roulette .app {
  width: min(100vw, 420px);
  height: min(100dvh, 860px);
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr auto;
  gap: clamp(5px, 0.75vh, 8px);
  padding: 8px 8px 10px;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(165deg, #182128 0%, #0f161c 45%, #0a1014 100%),
    radial-gradient(circle at 85% 0%, rgba(0, 231, 1, 0.13) 0%, transparent 52%);
  box-shadow: inset 0 0 0 1px rgba(123, 145, 160, 0.2), 0 18px 46px rgba(0, 0, 0, 0.55);
}

.roulette-root.mobile-roulette .wheel-area {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #00642d 0%, #044023 100%);
  min-height: clamp(138px, 25vh, 190px);
}

.roulette-root.mobile-roulette .wheel-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 0;
  border-bottom: 24px solid #efcf54;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55));
  z-index: 3;
}

.roulette-root.mobile-roulette .wheel-shell {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: start center;
  overflow: hidden;
  padding-top: 10px;
}

.roulette-root.mobile-roulette .wheel-track {
  --wheel-size: min(88vw, 372px);
  width: var(--wheel-size);
  height: var(--wheel-size);
  border-radius: 50%;
  position: relative;
  border: 4px solid var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 189, 0.5), 0 8px 20px rgba(0, 0, 0, 0.5);
  transform: rotate(0deg);
}

.roulette-root.mobile-roulette .wheel-track::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 232, 175, 0.4);
  pointer-events: none;
}

.roulette-root.mobile-roulette .wheel-labels {
  position: absolute;
  inset: 0;
}

.roulette-root.mobile-roulette .wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center;
  color: #f8fbff;
  font-weight: 800;
  font-size: clamp(0.68rem, 1.65vw, 0.9rem);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.01em;
}

.roulette-root.mobile-roulette .wheel-label.green {
  color: #8af7a3;
}

.roulette-root.mobile-roulette .wheel-label.win {
  color: #fff6b3;
  text-shadow: 0 0 9px rgba(255, 245, 171, 0.95);
}

.roulette-root.mobile-roulette .wheel-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16%;
  height: 16%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe08a 0%, #957532 55%, #352505 100%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.55);
}

.roulette-root.mobile-roulette .zero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.roulette-root.mobile-roulette .numbers-section {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
  border: 1px solid #2d3942;
  border-radius: 12px;
  background: linear-gradient(180deg, #1b242c 0%, #121a21 100%);
}

.roulette-root.mobile-roulette .numbers-section .bet-btn {
  min-height: 35px;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 5px rgba(0, 0, 0, 0.3);
}

.roulette-root.mobile-roulette .outside-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.roulette-root.mobile-roulette .dozens-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.roulette-root.mobile-roulette .info-panel {
  min-height: 0;
  border: 1px solid #2c373f;
  border-radius: 14px;
  background: radial-gradient(circle at 80% 20%, rgba(0, 231, 1, 0.14) 0%, transparent 42%), linear-gradient(180deg, #1a232b 0%, #10171d 100%);
  padding: 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.roulette-root.mobile-roulette .panel-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #90a29a;
  font-weight: 700;
}

.roulette-root.mobile-roulette .last-hit-card {
  border-radius: 12px;
  border: 1px solid #334049;
  background: linear-gradient(180deg, #1d2731 0%, #131c23 100%);
  padding: 8px 10px;
}

.roulette-root.mobile-roulette .last-hit-main {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.roulette-root.mobile-roulette .last-hit-value {
  font-size: clamp(1.18rem, 4vw, 1.5rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.roulette-root.mobile-roulette .last-hit-badge {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #daf0e1;
  border: 1px solid #2e8541;
  background: #1f552d;
}

.roulette-root.mobile-roulette .last-hit-badge.red {
  color: #ffdbe2;
  border-color: #a82f47;
  background: #5c1d2f;
}

.roulette-root.mobile-roulette .last-hit-badge.black {
  color: #ecf1ff;
  border-color: #4a516e;
  background: #22283f;
}

.roulette-root.mobile-roulette .last-hit-badge.green {
  color: #ddffea;
  border-color: #2e8650;
  background: #205236;
}

.roulette-root.mobile-roulette .history-card {
  min-height: 0;
  border-radius: 12px;
  border: 1px solid #2c3942;
  background: linear-gradient(180deg, #1c252f 0%, #131a21 100%);
  padding: 8px 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
}

.roulette-root.mobile-roulette .history-track {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
}

.roulette-root.mobile-roulette .history-empty {
  color: #82958e;
  font-size: 0.78rem;
}

.roulette-root.mobile-roulette .history-pill {
  min-width: 30px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  font-size: 0.78rem;
  font-weight: 900;
  color: #f7f9ff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.roulette-root.mobile-roulette .history-pill.red {
  background: linear-gradient(180deg, #f53f61 0%, #c91d42 100%);
}

.roulette-root.mobile-roulette .history-pill.black {
  background: linear-gradient(180deg, #374060 0%, #20263c 100%);
}

.roulette-root.mobile-roulette .history-pill.green {
  background: linear-gradient(180deg, #3ad366 0%, #219f4a 100%);
}

.roulette-root.mobile-roulette .bet-btn {
  min-height: 40px;
  border: 0;
  border-radius: var(--tile-radius);
  color: #f5f7ff;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
  padding: 2px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 3px 8px rgba(0, 0, 0, 0.35);
}

.roulette-root.mobile-roulette .bet-btn:disabled {
  cursor: default;
  opacity: 0.64;
}

.roulette-root.mobile-roulette .bet-main {
  display: block;
  font-size: clamp(0.9rem, 2.4vw, 1.12rem);
  font-weight: 900;
}

.roulette-root.mobile-roulette .bet-odds {
  display: block;
  margin-top: 1px;
  font-size: clamp(0.58rem, 1.7vw, 0.68rem);
  opacity: 0.85;
}

.roulette-root.mobile-roulette .straight.red {
  background: linear-gradient(180deg, #ff3f5f 0%, #dc1c3f 100%);
}

.roulette-root.mobile-roulette .straight.black {
  background: linear-gradient(180deg, #2f3245 0%, #171a27 100%);
}

.roulette-root.mobile-roulette .straight.green,
.roulette-root.mobile-roulette .zero {
  background: linear-gradient(180deg, #39df67 0%, #23a64d 100%);
}

.roulette-root.mobile-roulette .outside.red {
  background: linear-gradient(180deg, #ff3d5d 0%, #dc1f42 100%);
}

.roulette-root.mobile-roulette .outside.black {
  background: linear-gradient(180deg, #2b2f44 0%, #171a27 100%);
}

.roulette-root.mobile-roulette .outside.odd {
  color: #1a1806;
  background: linear-gradient(180deg, #ffe055 0%, #f0bf12 100%);
}

.roulette-root.mobile-roulette .outside.even {
  background: linear-gradient(180deg, #3499ff 0%, #1c6fd3 100%);
}

.roulette-root.mobile-roulette .dozen {
  background: linear-gradient(180deg, #36424d 0%, #1f2932 100%);
  border: 1px solid rgba(0, 231, 1, 0.24);
  color: #d8f2df;
}

.roulette-root.mobile-roulette .chip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display: none;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 900;
  background: radial-gradient(circle at 35% 35%, #fffce4 0%, #f3de82 45%, #d8b746 100%);
  color: #211500;
  box-shadow: 0 0 0 2px #1d1833;
  pointer-events: none;
  z-index: 6;
}

.roulette-root.mobile-roulette .bet-btn.has-bet .chip {
  display: grid;
}

.roulette-root.mobile-roulette .bet-btn.win {
  outline: 2px solid #f6ee92;
  box-shadow: 0 0 16px rgba(246, 238, 146, 0.95);
}

.roulette-root.mobile-roulette .total-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}

.roulette-root.mobile-roulette .total-pill {
  border-radius: 999px;
  border: 1px solid #33414a;
  padding: 6px 12px;
  background: linear-gradient(180deg, #1a232b 0%, #11181f 100%);
  font-size: clamp(0.8rem, 2vw, 0.92rem);
  color: #d3d8f9;
}

.roulette-root.mobile-roulette .total-pill span {
  color: #ffffff;
  font-size: clamp(1rem, 3.2vw, 1.3rem);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.roulette-root.mobile-roulette .clear-btn {
  border: 0;
  background: none;
  color: #f0585f;
  font-size: clamp(0.82rem, 2.2vw, 0.94rem);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.roulette-root.mobile-roulette .rebet-btn {
  min-height: 40px;
  min-width: 76px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: linear-gradient(180deg, #37424d 0%, #212a33 100%);
  color: #d7e0e6;
  font-size: clamp(0.72rem, 2vw, 0.84rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 3px 7px rgba(0, 0, 0, 0.35);
}

.roulette-root.mobile-roulette .rebet-btn:disabled {
  opacity: 0.45;
}

.roulette-root.mobile-roulette .clear-icon {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ef474e;
  color: #1f0f13;
  font-size: 0.68rem;
  font-weight: 900;
}

.roulette-root.mobile-roulette .spin-btn {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--action-green) 0%, var(--action-green-2) 100%);
  color: #091006;
  font-size: clamp(1.18rem, 4.7vw, 1.6rem);
  font-weight: 900;
  letter-spacing: 0.14em;
  box-shadow: 0 0 26px rgba(0, 231, 1, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.roulette-root.mobile-roulette .spin-btn:disabled {
  opacity: 0.82;
}

.roulette-root.mobile-roulette .spin-btn.spinning {
  letter-spacing: 0.08em;
}

.roulette-root.mobile-roulette .spin-btn.inline-spin {
  width: auto;
  min-width: 108px;
  min-height: 40px;
  padding: 0 14px;
  font-size: clamp(0.84rem, 2.4vw, 0.96rem);
  letter-spacing: 0.08em;
  box-shadow: 0 0 16px rgba(0, 231, 1, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

@media (max-height: 760px) {
  .roulette-root.mobile-roulette .app {
    gap: 5px;
    padding: 7px;
  }

  .roulette-root.mobile-roulette .wheel-area {
    min-height: clamp(126px, 21vh, 156px);
  }

  .roulette-root.mobile-roulette .wheel-track {
    --wheel-size: min(86vw, 330px);
  }

  .roulette-root.mobile-roulette .bet-btn {
    min-height: 36px;
  }

  .roulette-root.mobile-roulette .numbers-section .bet-btn {
    min-height: 31px;
  }

  .roulette-root.mobile-roulette .info-panel {
    padding: 8px;
    gap: 8px;
  }

  .roulette-root.mobile-roulette .history-pill {
    min-width: 28px;
    height: 22px;
    font-size: 0.72rem;
  }

  .roulette-root.mobile-roulette .spin-btn.inline-spin {
    min-width: 96px;
    min-height: 36px;
    padding: 0 12px;
  }

  .roulette-root.mobile-roulette .rebet-btn {
    min-height: 36px;
    min-width: 68px;
    padding: 0 8px;
  }
}

/* === Isolated Casino Roulette (desktop) === */
.casino-roulette-root {
  --bg-main: #071b2a;
  --panel-left: #23384b;
  --panel-main: #062033;
  --line-soft: #365975;
  --text: #e4efff;
  --muted: #9fb5c9;
  --green-bright: #00e701;
  --red: #ff1f4e;
  --black-cell: #31495e;
  min-height: 100%;
  color: var(--text);
  background: linear-gradient(180deg, #0a2438, #071c2d 60%, #061a2a);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.casino-roulette-root * {
  box-sizing: border-box;
}

.casino-roulette-root button {
  font: inherit;
  color: inherit;
}

.casino-roulette-root .app-shell {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(190px, 220px);
  background: #071f31;
}

.casino-roulette-root .left-panel {
  border-right: 1px solid #20415b;
  background: linear-gradient(180deg, #23384b, #22384b 80%);
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.casino-roulette-root .mode-tabs {
  background: #10273b;
  border-radius: 14px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.casino-roulette-root .mode-btn {
  border: 0;
  border-radius: 11px;
  padding: 9px 10px;
  font-weight: 700;
  background: transparent;
  cursor: pointer;
}

.casino-roulette-root .mode-btn.active {
  background: #3a5065;
}

.casino-roulette-root .control-block {
  display: grid;
  gap: 8px;
}

.casino-roulette-root .label-line {
  margin: 0;
  color: #c8d8e8;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.casino-roulette-root .chip-strip {
  border: 1px solid #3b586f;
  background: #2c4255;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
}

.casino-roulette-root .strip-arrow {
  border: 0;
  background: #2a4154;
  height: 100%;
  font-size: 24px;
  color: #8aa4bb;
  cursor: pointer;
}

.casino-roulette-root .strip-arrow:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.casino-roulette-root .chips-row {
  overflow-x: auto;
  display: flex;
  gap: 8px;
  padding: 9px 8px;
  scrollbar-width: thin;
}

.casino-roulette-root .chips-row::-webkit-scrollbar {
  height: 6px;
}

.casino-roulette-root .chip-option {
  min-width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.45), transparent 36%),
    radial-gradient(circle, #b46b45, #713f2c);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.casino-roulette-root .chip-option.active {
  box-shadow: 0 0 0 2px rgba(0, 231, 1, 0.45);
  border-color: rgba(255, 255, 255, 0.9);
}

.casino-roulette-root .chip-option:disabled {
  opacity: 0.45;
}

.casino-roulette-root .total-box {
  border: 1px solid #3a596f;
  background: #32495e;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  font-weight: 700;
}

.casino-roulette-root .quick-pill {
  margin-left: auto;
  color: #8ea5ba;
  border-left: 1px solid #42627d;
  padding-left: 9px;
  font-size: 12px;
}

.casino-roulette-root .play-btn {
  border: 1px solid #00ca0f;
  border-radius: 5px;
  background: #00e701;
  color: #194c1e;
  height: 54px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.casino-roulette-root .play-btn.auto-running {
  border-color: #ff7f94;
  background: #ff315d;
  color: #fff;
}

.casino-roulette-root .play-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.casino-roulette-root .secondary-btn {
  border-color: #52718a;
  background: #2f4a60;
  color: #dfefff;
  margin-top: -2px;
}

.casino-roulette-root .meta-lines {
  padding-top: 4px;
  border-top: 1px solid #355772;
}

.casino-roulette-root .meta-lines p {
  margin: 5px 0;
  color: #d2e0f1;
}

.casino-roulette-root .main-panel {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: radial-gradient(circle at 50% -20%, #0c2f48, #072236 58%, #061f31);
}

.casino-roulette-root .profit-popup {
  position: absolute;
  left: 50%;
  top: 104px;
  transform: translate(-50%, -10px) scale(0.92);
  width: min(230px, 62vw);
  border-radius: 12px;
  border: 2px solid #66ff5f;
  background: rgba(29, 54, 74, 0.97);
  box-shadow:
    0 0 0 1px rgba(102, 255, 95, 0.32),
    0 12px 28px rgba(0, 0, 0, 0.38);
  padding: 14px 12px 12px;
  display: grid;
  justify-items: center;
  gap: 9px;
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
  z-index: 20;
}

.casino-roulette-root .profit-popup.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.casino-roulette-root .profit-multiplier {
  font-size: clamp(28px, 3.2vw, 48px);
  font-weight: 900;
  color: #62f657;
  letter-spacing: 0.02em;
}

.casino-roulette-root .profit-divider {
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: rgba(188, 209, 224, 0.38);
}

.casino-roulette-root .profit-amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.casino-roulette-root .profit-amount {
  color: #62f657;
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 800;
}

.casino-roulette-root .profit-currency {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #e5bb45;
  color: #21313f;
  font-size: 16px;
  font-weight: 900;
}

.casino-roulette-root .history-panel {
  border-left: 1px solid #20415b;
  background: linear-gradient(180deg, #1f3448, #172b3d 85%);
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  align-self: start;
  max-height: calc(100vh - 70px);
}

.casino-roulette-root .history-panel h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #d9e8f8;
}

.casino-roulette-root .history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
  min-height: 130px;
  scrollbar-width: thin;
}

.casino-roulette-root .history-list::-webkit-scrollbar {
  width: 6px;
}

.casino-roulette-root .history-empty {
  color: var(--muted);
  font-size: 13px;
  padding-top: 4px;
}

.casino-roulette-root .history-chip {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #43657f;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.casino-roulette-root .history-chip.red {
  background: var(--red);
  border-color: #ff6f8e;
}

.casino-roulette-root .history-chip.black {
  background: var(--black-cell);
  border-color: #4f6a83;
}

.casino-roulette-root .history-chip.green {
  background: #3f9f42;
  border-color: #6ec572;
}

.casino-roulette-root .top-stage {
  padding: 10px 16px 2px;
  display: grid;
  justify-items: center;
}

.casino-roulette-root .result-pill {
  min-width: 180px;
  text-align: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #43647f;
  background: #0b2f46;
  font-weight: 700;
  margin-bottom: 10px;
}

.casino-roulette-root .wheel-stage {
  position: relative;
  width: min(44vw, 250px);
  aspect-ratio: 1;
  margin-bottom: 8px;
}

.casino-roulette-root .wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 12px solid #03233a;
  box-shadow: inset 0 0 0 10px #07283d, 0 10px 24px rgba(0, 0, 0, 0.45);
  transition: transform 3400ms cubic-bezier(0.12, 0.8, 0.18, 1);
}

.casino-roulette-root .wheel::after {
  content: "";
  position: absolute;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #001f33;
  box-shadow: inset 0 0 0 7px #03273f;
}

.casino-roulette-root .pocket-label {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}

.casino-roulette-root .pocket-label.red {
  color: #ffdce3;
}

.casino-roulette-root .pocket-label.black {
  color: #d7e9ff;
}

.casino-roulette-root .pocket-label.green {
  color: #d0ffd8;
}

.casino-roulette-root .spokes {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.casino-roulette-root .spokes span {
  position: absolute;
  width: 30%;
  height: 4px;
  background: #f6bf09;
  border-radius: 999px;
  transform-origin: center;
}

.casino-roulette-root .spokes span:nth-child(1) {
  transform: rotate(18deg) translateX(14%);
}

.casino-roulette-root .spokes span:nth-child(2) {
  transform: rotate(138deg) translateX(14%);
}

.casino-roulette-root .spokes span:nth-child(3) {
  transform: rotate(258deg) translateX(14%);
}

.casino-roulette-root .ball-orbit {
  position: absolute;
  inset: 30px;
  transform: rotate(0deg);
  will-change: transform;
}

.casino-roulette-root .ball-orbit.is-spinning .ball {
  animation: casino-roulette-ball-bounce 300ms ease-in-out infinite;
}

.casino-roulette-root .ball {
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #fff, #dfe8f8 60%, #9aaec3);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 2px 6px rgba(0, 0, 0, 0.4);
}

@keyframes casino-roulette-ball-bounce {
  0%,
  100% {
    top: 1px;
  }
  25%,
  75% {
    top: 3px;
  }
  50% {
    top: 2px;
  }
}

.casino-roulette-root .last-result,
.casino-roulette-root .status-line {
  margin: 2px 0;
  color: #bfd0df;
  font-weight: 600;
}

.casino-roulette-root .status-line {
  min-height: 22px;
}

.casino-roulette-root .table-stage {
  padding: 4px 16px 0;
  display: grid;
  justify-content: center;
  gap: 8px;
}

.casino-roulette-root .number-board-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  gap: 4px;
  align-items: stretch;
}

.casino-roulette-root .zero-cell {
  border: 1px solid #4ea552;
  border-radius: 5px;
  background: #449f41;
  font-size: 30px;
  font-weight: 800;
  min-height: 156px;
}

.casino-roulette-root .number-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(36px, 52px));
  grid-template-rows: repeat(3, minmax(46px, 52px));
  gap: 3px;
}

.casino-roulette-root .overlay-layer {
  position: absolute;
  left: 56px;
  right: 56px;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.casino-roulette-root .bet-area {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: #e9f3ff;
  font-weight: 800;
  cursor: pointer;
  transition: filter 120ms ease, box-shadow 120ms ease;
}

.casino-roulette-root .bet-area:hover {
  box-shadow: 0 0 0 1px rgba(0, 231, 1, 0.45), 0 0 9px rgba(0, 231, 1, 0.35);
  filter: brightness(1.07);
}

.casino-roulette-root .number-cell {
  font-size: 14px;
}

.casino-roulette-root .number-cell.red {
  background: var(--red);
}

.casino-roulette-root .number-cell.black {
  background: var(--black-cell);
}

.casino-roulette-root .column-bets {
  display: grid;
  grid-template-rows: repeat(3, minmax(46px, 52px));
  gap: 3px;
}

.casino-roulette-root .side-bet {
  background: #092238;
  font-size: 14px;
}

.casino-roulette-root .dozens-row,
.casino-roulette-root .outside-row {
  display: grid;
  gap: 3px;
}

.casino-roulette-root .dozens-row {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.casino-roulette-root .outside-row {
  grid-template-columns: repeat(6, minmax(76px, 1fr));
}

.casino-roulette-root .outside-bet {
  min-height: 50px;
  background: #0a243a;
  font-size: 13px;
}

.casino-roulette-root .red-bet {
  background: var(--red);
}

.casino-roulette-root .black-bet {
  background: var(--black-cell);
}

.casino-roulette-root .combo-spot {
  position: absolute;
  border: 0;
  border-radius: 3px;
  background: rgba(113, 180, 255, 0.06);
  color: transparent;
  font-size: 0;
  pointer-events: auto;
}

.casino-roulette-root .combo-spot:hover {
  background: rgba(0, 231, 1, 0.18);
}

.casino-roulette-root .placed-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.55), transparent 34%),
    radial-gradient(circle, #1fc96a, #118346);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.casino-roulette-root .table-footer {
  border-top: 1px solid #21445f;
  margin-top: 8px;
  padding: 10px 14px 12px;
  display: flex;
  justify-content: space-between;
}

.casino-roulette-root .footer-btn {
  border: 0;
  background: transparent;
  color: #d8e8f7;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.casino-roulette-root .footer-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.casino-roulette-root .result-pill.red {
  border-color: rgba(255, 31, 78, 0.75);
}

.casino-roulette-root .result-pill.black {
  border-color: rgba(111, 151, 185, 0.9);
}

.casino-roulette-root .result-pill.green {
  border-color: rgba(57, 161, 65, 0.9);
}

.casino-roulette-root .result-win {
  box-shadow: 0 0 0 1px rgba(0, 231, 1, 0.5), 0 0 14px rgba(0, 231, 1, 0.5) !important;
}

.casino-roulette-root .number-hit {
  filter: saturate(1.18) brightness(1.1);
}

.casino-roulette-root .placed-chip.chip-win {
  animation: casino-roulette-chip-pulse 450ms ease-in-out infinite alternate;
}

@keyframes casino-roulette-chip-pulse {
  to {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 0 14px rgba(0, 231, 1, 0.75);
  }
}

@media (max-width: 1200px) {
  .casino-roulette-root .app-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .casino-roulette-root .left-panel {
    border-right: 0;
    border-bottom: 1px solid #20415b;
  }

  .casino-roulette-root .history-panel {
    border-left: 0;
    border-top: 1px solid #20415b;
    align-self: stretch;
    max-height: none;
  }

  .casino-roulette-root .table-stage {
    overflow-x: auto;
    justify-content: start;
  }
}

@media (max-width: 760px) {
  .casino-roulette-root .profit-popup {
    top: 86px;
  }

  .casino-roulette-root .wheel-stage {
    width: min(72vw, 230px);
  }

  .casino-roulette-root .number-grid {
    grid-template-columns: repeat(12, 40px);
    grid-template-rows: repeat(3, 44px);
  }

  .casino-roulette-root .column-bets {
    grid-template-rows: repeat(3, 44px);
  }

  .casino-roulette-root .zero-cell {
    min-height: 138px;
  }
}

body.game-fullscreen #casino-container.casino-roulette-classic-fullbleed > #casino-roulette-screen {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body.game-fullscreen #casino-container.casino-roulette-classic-fullbleed > #casino-roulette-screen .casino-roulette-root {
  width: 100%;
  height: 100%;
}
