:root {
  --bg-night: #091217;
  --bg-deep: #061013;
  --felt: #0d3b2f;
  --felt-glow: #1f6a53;
  --gold: #f5d385;
  --gold-strong: #ffbe44;
  --ruby: #b6414f;
  --cream: #f4efe4;
  --mist: rgba(244, 239, 228, 0.72);
  --panel: rgba(7, 19, 22, 0.86);
  --panel-border: rgba(255, 219, 140, 0.16);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --cell-size: min(10vw, 64px);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #0b0d11;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--cream);
  background:
    radial-gradient(circle at top, rgba(255, 190, 68, 0.16), transparent 26%),
    radial-gradient(circle at 18% 18%, rgba(182, 65, 79, 0.16), transparent 24%),
    linear-gradient(180deg, #102229 0%, var(--bg-night) 44%, #04080b 100%);
}

body::before {
  content: none;
}

.page-shell {
  position: relative;
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.ambient {
  position: absolute;
  inset: auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.5;
  pointer-events: none;
  animation: ambient-drift 12s ease-in-out infinite;
}

.ambient-left {
  top: 80px;
  left: -80px;
  background: radial-gradient(circle, rgba(255, 190, 68, 0.24), transparent 68%);
}

.ambient-right {
  top: 220px;
  right: -90px;
  background: radial-gradient(circle, rgba(77, 195, 255, 0.2), transparent 68%);
  animation-delay: -6s;
}

@keyframes ambient-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -18px, 0) scale(1.06); }
}

.hero,
.table-card,
.stat-card,
.piece-card,
.payout-row {
  backdrop-filter: blur(18px);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.eyebrow,
.section-kicker,
.bank-label {
  margin: 0 0 8px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.73rem;
  font-weight: 800;
}

.hero h1,
.table-header h2,
.rack-header h3,
.payout-head h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.92;
}

.tagline {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--mist);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-actions,
.hero-auth-actions,
.hero-userbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 220px;
}

.small-auth-button {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.9rem;
  box-shadow: none;
}

.hero-user-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 223, 156, 0.12);
}

.hero-user-chip span {
  display: block;
  margin-bottom: 4px;
  color: var(--mist);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.hero-user-chip strong {
  color: var(--gold);
  font-size: 1rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 24px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-modal[hidden] {
  display: none !important;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 9, 12, 0.72);
  backdrop-filter: none;
}

.auth-modal-card {
  width: min(100%, 520px);
  position: relative;
  z-index: 1;
}

.auth-modal-copy {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}

.auth-modal-card h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: 0.03em;
}

.auth-gate-text {
  margin: 12px 0 0;
  color: var(--mist);
  line-height: 1.7;
  font-size: 1rem;
}

.crypto-pay-panel {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(79, 150, 255, 0.14);
}

.crypto-pay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.crypto-pay-head .section-kicker {
  margin-bottom: 0;
}

.crypto-pay-head strong {
  color: #dfe8ff;
  font-size: 0.9rem;
}

.crypto-pay-hint {
  margin: 10px 0 0;
  color: var(--mist);
  line-height: 1.55;
  font-size: 0.92rem;
}

.crypto-pay-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crypto-pay-link {
  text-decoration: none;
  justify-content: center;
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--mist);
  box-shadow: none;
  pointer-events: auto;
}

.auth-tab-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.auth-tab {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--mist);
  box-shadow: none;
}

.auth-tab.active {
  color: #1f1807;
  background: linear-gradient(180deg, #ffd881, #ffbe44);
  box-shadow: 0 10px 24px rgba(255, 190, 68, 0.22);
}

.auth-inline-form {
  display: none;
  gap: 14px;
}

.auth-inline-form.active {
  display: grid;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field span {
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border-radius: 14px;
  border: 1px solid rgba(255, 223, 156, 0.14);
  background: rgba(6, 18, 21, 0.9);
  color: var(--cream);
  font: inherit;
}

.auth-input:focus {
  outline: 1px solid rgba(255, 216, 122, 0.4);
  border-color: rgba(255, 216, 122, 0.38);
}

.auth-submit {
  margin-top: 4px;
}

.auth-status {
  min-height: 1.6em;
  margin: 14px 0 0;
  color: var(--mist);
  line-height: 1.5;
}

.auth-status.error {
  color: #ff9cab;
}

.auth-status.success {
  color: #7df2be;
}

.table-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top, rgba(57, 122, 94, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(14, 47, 38, 0.92), rgba(6, 15, 18, 0.92));
  border: 1px solid var(--panel-border);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease, border-color 160ms ease, opacity 160ms ease;
  contain: layout paint;
}

.table-card::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: calc(var(--radius-xl) - 10px);
  border: 1px solid rgba(255, 223, 156, 0.08);
  pointer-events: none;
}

.table-card.is-live {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

.table-card.win-flash {
  animation: table-win 760ms ease;
}

.table-card.lose-flash {
  animation: table-lose 720ms ease;
}

.table-card.combo-flash {
  animation: table-combo 920ms ease;
}

@keyframes table-win {
  0% { transform: scale(1); }
  30% { transform: scale(1.006); }
  100% { transform: scale(1); }
}

@keyframes table-lose {
  0% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

@keyframes table-combo {
  0% { transform: scale(1); }
  30% { transform: scale(1.008); }
  100% { transform: scale(1); }
}

.table-header,
.controls,
.account-strip,
.board-and-stats,
.rack-header,
.payout-head {
  position: relative;
  z-index: 1;
}

.table-header,
.rack-header,
.payout-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.round-state,
.disclosure {
  max-width: 240px;
  color: var(--mist);
  text-align: right;
  line-height: 1.5;
}

.account-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.account-signed-in,
.account-signed-out {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.account-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-chip {
  min-height: 72px;
  min-width: 180px;
  padding: 14px 18px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 223, 156, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.account-chip span {
  display: block;
  margin-bottom: 6px;
  color: var(--mist);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.account-chip strong {
  display: block;
  font-size: 1.4rem;
  color: var(--cream);
}

.auth-actions-row {
  display: flex;
  gap: 10px;
}

.account-balance {
  flex: 1 1 240px;
  background:
    radial-gradient(circle at top, rgba(255, 216, 122, 0.14), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04));
}

.account-balance strong {
  color: var(--gold);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.account-button {
  margin-left: auto;
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin: 24px 0 22px;
  flex-wrap: wrap;
}

.control-stack {
  display: grid;
  gap: 14px;
  min-width: min(100%, 420px);
}

.bet-control {
  display: grid;
  gap: 10px;
  min-width: 220px;
}

.bet-control span {
  font-weight: 700;
}

.quick-bet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-bet-chip {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 223, 156, 0.12);
  color: var(--mist);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: none;
}

.quick-bet-chip.active {
  color: #1f1807;
  background: linear-gradient(180deg, #ffd881, #ffbe44);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(255, 190, 68, 0.2);
}

.difficulty-control {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 223, 156, 0.12);
}

.difficulty-control > span {
  font-weight: 700;
}

.difficulty-head {
  display: grid;
  gap: 4px;
}

.difficulty-head strong {
  color: var(--gold);
  font-size: 1.02rem;
}

.difficulty-head small {
  color: var(--mist);
  line-height: 1.45;
}

.difficulty-slider {
  width: 100%;
  accent-color: var(--gold-strong);
}

.difficulty-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  color: var(--mist);
  font-size: 0.75rem;
}

.difficulty-scale span:nth-child(1) {
  text-align: left;
}

.difficulty-scale span:nth-child(2),
.difficulty-scale span:nth-child(3),
.difficulty-scale span:nth-child(4) {
  text-align: center;
}

.difficulty-scale span:nth-child(5) {
  text-align: right;
}


.bet-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 58px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 223, 156, 0.16);
}

.bet-input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cream);
  font-size: 1.15rem;
  font-weight: 700;
  font-family: inherit;
}

.control-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.controls-helper {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: -4px 0 18px;
  color: var(--mist);
  font-size: 0.88rem;
}

.controls-helper span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 223, 156, 0.1);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 223, 156, 0.18);
  background: rgba(8, 22, 26, 0.82);
  color: var(--gold);
  font: inherit;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease, background 180ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.primary-button {
  color: #1f1807;
  background: linear-gradient(180deg, #ffd881, #ffbe44);
  box-shadow: 0 10px 26px rgba(255, 190, 68, 0.28);
}

.secondary-button {
  color: var(--cream);
  background: linear-gradient(180deg, #2a6a56, #18473a);
  box-shadow: 0 10px 26px rgba(27, 85, 67, 0.28);
}

.ghost-button {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.08);
}

.primary-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  border-radius: 999px;
  padding: 0 18px;
  text-decoration: none;
  color: #1f1807;
  background: linear-gradient(180deg, #ffd881, #ffbe44);
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(255, 190, 68, 0.28);
}

.board-and-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: start;
}

.board-wrap {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 216, 122, 0.09), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 223, 156, 0.08);
}

.board-wrap::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 24px;
  border: 1px solid rgba(255, 223, 156, 0.08);
  pointer-events: none;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, var(--cell-size));
  grid-template-rows: repeat(5, var(--cell-size));
  gap: 8px;
  justify-content: center;
  position: relative;
  padding: 18px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top, rgba(255, 214, 122, 0.16), transparent 22%),
    linear-gradient(180deg, rgba(4, 17, 20, 0.82), rgba(7, 20, 24, 0.92));
  border: 1px solid rgba(255, 223, 156, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 40px rgba(0, 0, 0, 0.28);
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  contain: layout paint;
}

.board::before {
  content: none;
}

.board.is-live {
  border-color: rgba(255, 223, 156, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 22px 48px rgba(0, 0, 0, 0.3),
    0 0 36px rgba(31, 106, 83, 0.16);
  touch-action: none;
}

.board.bust-flash {
  animation: board-bust 860ms ease;
}

.board.is-busted {
  border-color: rgba(255, 116, 140, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 22px 48px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(182, 65, 79, 0.08);
}

.board.is-won {
  border-color: rgba(108, 234, 174, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 22px 48px rgba(0, 0, 0, 0.3),
    0 0 4px rgba(53, 189, 121, 0.03);
}

.board.is-busted .cell:not(.filled) {
  background:
    linear-gradient(180deg, rgba(255, 112, 138, 0.04), rgba(86, 14, 31, 0.07)),
    rgba(28, 10, 17, 0.9);
  border-color: rgba(255, 129, 154, 0.05);
}

.cell {
  position: relative;
  padding: 0;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(8, 25, 27, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 120ms ease, background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  touch-action: pan-y;
}

.board.is-live .cell {
  touch-action: none;
}

.cell::after {
  content: "";
  position: absolute;
  inset: 10% 18% auto;
  height: 28%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  opacity: 0.45;
  pointer-events: none;
}

.cell.filled {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.18),
    0 0 18px rgba(255, 255, 255, 0.08);
}

.cell.filled-busted {
  background-image: linear-gradient(180deg, rgba(255, 180, 194, 0.18), rgba(121, 20, 43, 0.34));
  border-color: rgba(255, 172, 188, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 242, 245, 0.18),
    inset 0 0 0 1px rgba(148, 24, 50, 0.28),
    0 4px 12px rgba(0, 0, 0, 0.16);
}

.cell.filled-won {
  background-image: linear-gradient(180deg, rgba(174, 255, 210, 0.1), rgba(16, 111, 65, 0.18));
  border-color: rgba(162, 248, 202, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(242, 255, 246, 0.14),
    inset 0 0 0 1px rgba(22, 117, 69, 0.22),
    0 4px 12px rgba(0, 0, 0, 0.14);
}

.cell.preview-valid {
  background-color: rgba(255, 216, 122, 0.18);
  border-color: rgba(255, 216, 122, 0.34);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(255, 216, 122, 0.16);
}

.cell.preview-invalid {
  background-color: rgba(182, 65, 79, 0.22);
  border-color: rgba(182, 65, 79, 0.42);
}

.cell.preview-overlap {
  background:
    linear-gradient(180deg, rgba(255, 120, 136, 0.22), rgba(121, 30, 46, 0.3)),
    rgba(182, 65, 79, 0.22);
  border-color: rgba(255, 146, 164, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 214, 220, 0.18),
    inset 0 0 0 3px rgba(120, 34, 51, 0.68),
    0 0 16px rgba(182, 65, 79, 0.18);
}

.cell.preview-overlap::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 12px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 228, 232, 0.34) 0,
      rgba(255, 228, 232, 0.34) 4px,
      rgba(116, 29, 45, 0) 4px,
      rgba(116, 29, 45, 0) 10px
    );
  border: 1px solid rgba(255, 214, 220, 0.34);
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
}

.cell.clearing {
  animation: pulse-out 420ms ease;
}

@keyframes pulse-out {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.86); opacity: 0.3; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes board-bust {
  0% { transform: scale(1); }
  24% { transform: scale(0.988); }
  54% { transform: scale(1.004); }
  100% { transform: scale(1); }
}

.cell.drop-hit {
  animation: tile-hit 260ms ease;
}

@keyframes tile-hit {
  0% { transform: scale(0.86); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}

.spark-batch {
  position: absolute;
  inset: 0;
}

.score-pop {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  min-width: 148px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 223, 156, 0.28);
  background:
    linear-gradient(180deg, rgba(19, 29, 36, 0.94), rgba(10, 18, 23, 0.9));
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 24px rgba(0, 0, 0, 0.24);
  animation: score-pop-rise 900ms ease forwards;
  will-change: transform, opacity;
}

.score-pop.bad {
  color: #ff97a7;
  border-color: rgba(255, 151, 167, 0.28);
  background:
    linear-gradient(180deg, rgba(42, 12, 18, 0.96), rgba(26, 10, 14, 0.92));
}

.score-pop.combo {
  color: #88f8d0;
  border-color: rgba(136, 248, 208, 0.34);
  background:
    linear-gradient(180deg, rgba(8, 29, 31, 0.96), rgba(7, 22, 25, 0.92));
}

.spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(255,216,122,0.75) 42%, rgba(255,216,122,0) 72%);
  transform: translate(-50%, -50%);
  animation: spark-burst 760ms ease forwards;
  will-change: transform, opacity;
}

.spark.bad {
  background: radial-gradient(circle, rgba(255,255,255,0.85), rgba(255,110,142,0.75) 42%, rgba(255,110,142,0) 72%);
}

.spark.combo {
  background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(113,244,220,0.78) 36%, rgba(88,176,255,0.58) 58%, rgba(88,176,255,0) 76%);
}

.combo-burst {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 10px;
  justify-items: center;
  min-width: 230px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(125, 242, 190, 0.3);
  background:
    radial-gradient(circle at top, rgba(125, 242, 190, 0.12), transparent 65%),
    linear-gradient(180deg, rgba(6, 24, 28, 0.96), rgba(5, 18, 22, 0.9));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  animation: combo-burst-rise 860ms ease forwards;
}

.combo-burst strong {
  font-family: "Cinzel", serif;
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  color: #8ff4d4;
}

.combo-burst span {
  color: var(--cream);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.fx-detail-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.fx-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cream);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.bust-burst {
  position: absolute;
  inset: 14% 10% auto;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 20px 22px;
  border-radius: 26px;
  border: 1px solid rgba(255, 151, 167, 0.34);
  background:
    radial-gradient(circle at top, rgba(255, 151, 167, 0.15), transparent 62%),
    linear-gradient(180deg, rgba(33, 10, 15, 0.97), rgba(20, 8, 11, 0.93));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
  animation: bust-burst-rise 960ms ease forwards;
}

.bust-burst strong {
  font-family: "Cinzel", serif;
  font-size: 1.7rem;
  letter-spacing: 0.08em;
  color: #ff9cab;
}

.bust-burst span {
  color: #ffd8df;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-align: center;
}

.fx-piece-preview {
  display: grid;
  grid-auto-rows: 12px;
  gap: 4px;
  justify-content: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 151, 167, 0.16);
}

.fx-piece-cell {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.fx-piece-cell.on {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

@keyframes score-pop-rise {
  0% { opacity: 0; transform: translate(-50%, -32%) scale(0.72); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -78%) scale(1.02); }
}

@keyframes spark-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  15% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(1);
  }
}

@keyframes combo-burst-rise {
  0% { opacity: 0; transform: translate(-50%, -34%) scale(0.72); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -72%) scale(1.02); }
}

@keyframes bust-burst-rise {
  0% { opacity: 0; transform: translateY(-18px) scale(0.86); }
  16% { opacity: 1; transform: translateY(0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-18px) scale(1.01); }
}

.board-legend {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--mist);
  font-size: 0.92rem;
}

.board-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 223, 156, 0.08);
}

.stats-panel {
  display: grid;
  gap: 12px;
}

.stat-card {
  padding: 16px 16px 15px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 223, 156, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-card span {
  display: block;
  color: var(--mist);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 1.6rem;
  color: var(--gold);
}

.stat-card small {
  display: block;
  margin-top: 7px;
  color: var(--mist);
  font-size: 0.8rem;
  line-height: 1.45;
}

.stat-card strong.bump {
  animation: stat-bump 360ms ease;
}

.status-card.locked strong {
  color: #ff9cab;
}

.status-card.unlocked {
  border-color: rgba(89, 210, 158, 0.22);
  background:
    linear-gradient(180deg, rgba(75, 167, 127, 0.16), rgba(255, 255, 255, 0.04));
}

.status-card.unlocked strong {
  color: #7df2be;
}

@keyframes stat-bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.rack-panel {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 223, 156, 0.12);
}

.rack-hint {
  color: var(--mist);
  margin: 10px 0 0;
}

.piece-rack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.side-card .rack-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.side-card .piece-rack {
  grid-template-columns: 1fr;
}

.piece-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 188px;
  padding: 18px;
  text-align: left;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(255, 216, 122, 0.1), transparent 54%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 223, 156, 0.12);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.piece-card-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.015));
}

.piece-card.live-piece {
  touch-action: none;
}

.piece-card-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

.piece-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(255,255,255,0.09), transparent 46%, transparent);
  pointer-events: none;
}

.piece-card.active,
.piece-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 223, 156, 0.45);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.piece-card.dragging {
  opacity: 0.35;
  transform: scale(0.98);
}

.piece-card.bust-preview {
  border-color: rgba(255, 151, 167, 0.34);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24), 0 0 34px rgba(182, 65, 79, 0.18);
}

.piece-card.bust-preview::after {
  content: "No Fit";
  position: absolute;
  top: 16px;
  right: 16px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(120, 24, 42, 0.72);
  border: 1px solid rgba(255, 151, 167, 0.28);
  color: #ffd8df;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}

.piece-card.spent {
  opacity: 0.28;
}

.piece-drag-ghost {
  position: fixed;
  z-index: 25;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(17, 20, 24, 0.88);
  border: 1px solid rgba(111, 175, 255, 0.32);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transform: translate3d(0, 0, 0) translate(-50%, -50%) scale(0.96);
  will-change: transform;
}

.piece-drag-cell {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.piece-drag-cell.on {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

body.drag-active .board,
body.drag-active .cell,
body.drag-active .piece-card,
body.drag-active .piece-drag-ghost {
  transition: none !important;
}

body.drag-active .board {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 8px 18px rgba(0, 0, 0, 0.18);
}

body.drag-active .cell.preview-valid,
body.drag-active .cell.preview-invalid {
  transform: none;
  box-shadow: none;
}

body.drag-active .piece-drag-ghost {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

.piece-card-name {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 1.5rem;
  color: var(--gold);
  text-align: center;
}

.piece-card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.piece-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 223, 156, 0.1);
  color: var(--mist);
  font-size: 0.78rem;
  font-weight: 700;
}

.mini-grid {
  display: grid;
  grid-auto-rows: 20px;
  gap: 7px;
  justify-content: center;
  padding: 18px;
  border-radius: 18px;
  background: rgba(4, 15, 18, 0.42);
  border: 1px solid rgba(255, 223, 156, 0.08);
}

.mini-cell {
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
}

.mini-cell-empty {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.mini-cell.on {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 18px rgba(255, 255, 255, 0.08);
}

.side-card {
  display: grid;
  gap: 20px;
  align-content: start;
}

@media (min-width: 1081px) {
  .side-card {
    position: sticky;
    top: 22px;
    align-self: start;
  }
}

.payout-list {
  display: grid;
  gap: 12px;
}

.payout-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 223, 156, 0.1);
}

.payout-row.active {
  border-color: rgba(255, 223, 156, 0.48);
  background: linear-gradient(180deg, rgba(255, 216, 122, 0.18), rgba(255, 255, 255, 0.06));
  animation: payout-glow 1.8s ease-in-out infinite;
}

.payout-row.unlocked {
  box-shadow: inset 0 0 0 1px rgba(255, 216, 122, 0.22);
}

.payout-row strong {
  color: var(--gold);
  font-size: 1.25rem;
}

.score-tag {
  color: var(--mist);
}

.rules {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 223, 156, 0.1);
}

.tuning-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 223, 156, 0.12);
}

.tuning-stack {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.rules ul {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 0;
  color: var(--mist);
  line-height: 1.65;
  list-style: none;
}

.rules li {
  position: relative;
  padding-left: 18px;
}

.rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(255, 216, 122, 0.2);
}

.prediction-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 223, 156, 0.12);
}

.prediction-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.prediction-stat {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 223, 156, 0.08);
}

.prediction-stat span {
  display: block;
  color: var(--mist);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.prediction-stat strong {
  color: var(--gold);
  font-size: 1.35rem;
}

.prediction-stat.danger strong {
  color: #ff9cab;
}

.prediction-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.prediction-column {
  display: grid;
  gap: 10px;
}

.prediction-label {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
}

.prediction-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
  min-height: 44px;
}

.prediction-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 223, 156, 0.12);
  color: var(--mist);
  font-size: 0.84rem;
}

.prediction-pill.safe {
  border-color: rgba(89, 210, 158, 0.18);
  background: rgba(48, 112, 88, 0.18);
}

.prediction-pill.bust {
  border-color: rgba(255, 156, 171, 0.18);
  background: rgba(120, 38, 54, 0.2);
}

.prediction-empty {
  color: var(--mist);
  font-size: 0.9rem;
  line-height: 1.5;
}

.admin-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 223, 156, 0.12);
}

.admin-panel h3 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
}

.admin-copy,
.admin-status {
  color: var(--mist);
  line-height: 1.55;
}

.admin-copy {
  margin: 10px 0 16px;
}

.admin-grid {
  display: grid;
  gap: 14px;
}

.admin-field {
  display: grid;
  gap: 8px;
}

.admin-field > span {
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.admin-inline input,
.admin-inline select {
  width: 100%;
  min-width: 0;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 223, 156, 0.14);
  background: rgba(6, 18, 21, 0.9);
  color: var(--cream);
  padding: 0 14px;
  font: inherit;
}

.admin-inline input:focus,
.admin-inline select:focus {
  outline: 1px solid rgba(255, 216, 122, 0.4);
  border-color: rgba(255, 216, 122, 0.38);
}

.admin-button {
  min-width: 88px;
  padding: 12px 16px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.admin-link {
  min-width: 100%;
}

.admin-status {
  margin: 14px 0 0;
  min-height: 1.6em;
}

.admin-tab-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-tab-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 223, 156, 0.12);
  color: var(--mist);
  box-shadow: none;
}

.admin-tab-button.active {
  color: #1f1807;
  background: linear-gradient(180deg, #ffd881, #ffbe44);
}

.admin-tab-panel {
  display: grid;
  gap: 14px;
}

.admin-users-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-users-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 223, 156, 0.08);
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.admin-users-table th,
.admin-users-table td {
  padding: 11px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 223, 156, 0.08);
}

.admin-users-table th {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-users-table td {
  color: var(--mist);
  font-size: 0.88rem;
}

.admin-users-empty {
  text-align: center !important;
}

.admin-chance-control {
  margin: 0;
}

.admin-toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(31, 34, 40, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-toggle-copy {
  display: grid;
  gap: 4px;
}

.admin-toggle-copy span {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
}

.admin-toggle-copy small {
  color: rgba(205, 214, 225, 0.72);
  line-height: 1.45;
}

.admin-toggle-input {
  width: 22px;
  height: 22px;
  accent-color: #1b7eff;
  flex: 0 0 auto;
}

@keyframes payout-glow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 216, 122, 0.18); }
  50% { box-shadow: inset 0 0 0 1px rgba(255, 216, 122, 0.36), 0 0 30px rgba(255, 216, 122, 0.08); }
}

@media (max-width: 1080px) {
  .layout,
  .board-and-stats {
    grid-template-columns: 1fr;
  }

  .prediction-stats,
  .prediction-columns {
    grid-template-columns: 1fr;
  }

  .stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-wrap {
    padding: 14px;
  }
}

@media (max-width: 760px) {
  :root {
    --cell-size: min(12vw, 54px);
  }

  .page-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 18px;
  }

  .ambient {
    width: 220px;
    height: 220px;
  }

  .hero,
  .table-header,
  .rack-header,
  .payout-head,
  .controls {
    grid-template-columns: 1fr;
    display: grid;
  }

  .round-state,
  .disclosure {
    text-align: left;
    max-width: none;
  }

  .account-button {
    margin-left: 0;
  }

  .account-signed-in,
  .account-signed-out,
  .account-auth-actions {
    width: 100%;
  }

  .piece-rack,
  .control-stack,
  .stats-panel {
    grid-template-columns: 1fr;
  }

  .controls-helper,
  .board-legend {
    flex-direction: column;
  }
}

/* Sportsbook-style overhaul */

:root {
  --bg-night: #111317;
  --bg-deep: #0b0d11;
  --felt: #10213a;
  --felt-glow: #1d7fff;
  --gold: #8ec0ff;
  --gold-strong: #1b7eff;
  --ruby: #ff5a82;
  --cream: #ffffff;
  --mist: rgba(208, 216, 228, 0.72);
  --panel: rgba(23, 25, 29, 0.96);
  --panel-border: rgba(255, 255, 255, 0.07);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

body {
  background:
    radial-gradient(circle at top, rgba(29, 127, 255, 0.12), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(71, 200, 255, 0.09), transparent 22%),
    linear-gradient(180deg, #17181c 0%, #121317 52%, #0b0d11 100%);
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 28%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.01) 0,
      rgba(255, 255, 255, 0.01) 2px,
      transparent 2px,
      transparent 18px
    );
  opacity: 0.38;
}

.page-shell {
  width: min(1480px, calc(100% - 36px));
  padding-top: 18px;
}

.ambient {
  opacity: 0.28;
  filter: blur(36px);
}

.ambient-left {
  top: 40px;
  left: -110px;
  background: radial-gradient(circle, rgba(24, 132, 255, 0.26), transparent 68%);
}

.ambient-right {
  top: 220px;
  right: -100px;
  background: radial-gradient(circle, rgba(87, 195, 255, 0.18), transparent 68%);
}

.site-topbar {
  position: -webkit-sticky;
  position: sticky;
  top: max(0px, env(safe-area-inset-top));
  z-index: 80;
  position: sticky;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(17, 19, 23, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-domain-bar {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 10px 20px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 18%, rgba(122, 167, 255, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(31, 38, 53, 0.96), rgba(15, 18, 25, 0.98));
  border: 1px solid rgba(111, 149, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(71, 111, 230, 0.08),
    0 12px 22px rgba(0, 0, 0, 0.22),
    0 0 18px rgba(47, 102, 255, 0.1);
  pointer-events: none;
}

.site-domain-bar strong {
  color: #f4f7ff;
  font-size: 1.26rem;
  font-weight: 900;
  letter-spacing: 0.085em;
  line-height: 1;
  text-transform: lowercase;
  text-shadow: 0 1px 12px rgba(92, 141, 255, 0.16);
}

.header-domain-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(22, 25, 31, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(0, 0, 0, 0.16);
  pointer-events: none;
  z-index: 0;
}

.header-domain-pill strong {
  color: #f7f9fd;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: lowercase;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.game-brand-mark {
  order: -2;
}

.hero-mobile-nav-wrap {
  order: -1;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 42px;
  border-radius: 14px;
  background: #ffffff;
  color: #111317;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.game-brand-mark {
  width: 52px;
  height: 46px;
  border-radius: 15px;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.26), transparent 32%),
    linear-gradient(180deg, #5e89ff, #3d6df2 58%, #2953cf);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 12px 26px rgba(54, 104, 245, 0.24);
}

.game-brand-icon {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  gap: 4px;
}

.game-brand-icon span {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 10px rgba(255, 255, 255, 0.12);
}

.game-brand-icon span:nth-child(4) {
  background: rgba(255, 216, 129, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 12px rgba(255, 190, 68, 0.18);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 24px;
  background: rgba(28, 30, 35, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.top-nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: rgba(226, 232, 241, 0.86);
  font-size: 0.96rem;
  font-family: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.top-nav-item:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.top-nav-item.active {
  color: #ffffff;
  background: linear-gradient(180deg, #2390ff, #146ce7);
  box-shadow: 0 14px 28px rgba(27, 126, 255, 0.26);
}

.hero-actions {
  gap: 12px;
  min-width: auto;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-auth-actions,
.hero-userbar {
  gap: 10px;
  align-items: center;
}

.small-auth-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
}

.hero-utility-chip,
.hero-utility-button,
.hero-profile-button,
.hero-plus-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 14px;
  background: rgba(36, 39, 45, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border: 0;
}

.hero-utility-chip {
  gap: 8px;
  padding: 0 12px;
}

.hero-utility-button {
  width: 46px;
  font-size: 1.05rem;
}

#heroSoundButton {
  position: relative;
  font-size: 0;
  color: #ffffff;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14h4l5 4V6L8 10H4z'/%3E%3Cpath d='M16 9a5 5 0 0 1 0 6'/%3E%3Cpath d='M18.5 6.5a8.5 8.5 0 0 1 0 11'/%3E%3C/svg%3E");
}

#heroSoundButton::before {
  content: none;
}

#heroSoundButton[aria-pressed="true"]::before {
  content: none;
}

#heroSoundButton[aria-pressed="true"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b4bcc9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14h4l5 4V6L8 10H4z'/%3E%3Cpath d='M17 9l4 4'/%3E%3Cpath d='M21 9l-4 4'/%3E%3C/svg%3E");
}

.hero-sound-icon {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}

.hero-utility-button[aria-pressed="true"] {
  color: rgba(180, 188, 201, 0.82);
}

.hero-flag {
  font-size: 1.55rem;
  line-height: 1;
}

.locale-chip .hero-flag {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.hero-chevron {
  font-size: 0.9rem;
  color: rgba(207, 216, 229, 0.76);
}

.hero-balance-stack {
  display: inline-flex;
  align-items: center;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.hero-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  background: rgba(36, 39, 45, 0.95);
  color: #ffffff;
}

.hero-balance-mark {
  color: rgba(198, 208, 221, 0.68);
  font-size: 1rem;
  font-weight: 800;
}

.hero-balance-pill strong {
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.hero-plus-button {
  width: 46px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, #6484ff, #5672f2);
  font-size: 1.6rem;
  line-height: 1;
}

.hero-profile-wrap {
  position: relative;
}

.hero-profile-button {
  gap: 10px;
  padding: 0 12px 0 10px;
}

.hero-avatar-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(124, 90, 255, 0.34), rgba(43, 22, 92, 0.24));
  font-size: 1.5rem;
}

.hero-avatar-icon {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}

.hero-profile-button strong {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.hero-profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 6px;
  min-width: 148px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(24, 27, 33, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
  z-index: 120;
}

.hero-profile-action {
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(36, 39, 45, 0.95);
  color: #ffffff;
}

#heroLoginButton,
#heroWithdrawButton,
#heroLogoutButton {
  background: rgba(36, 39, 45, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#heroRegisterButton {
  background: linear-gradient(180deg, #2390ff, #146ce7);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(27, 126, 255, 0.24);
}

#heroDepositButton {
  background: linear-gradient(180deg, #6484ff, #5672f2);
  color: #ffffff;
  box-shadow: none;
}

.hero-user-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(28, 30, 35, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-user-chip span {
  display: none;
}

.hero-user-chip strong {
  color: #ffffff;
  font-size: 0.92rem;
}

.eyebrow,
.section-kicker,
.bank-label {
  color: #7fb4ff;
  letter-spacing: 0.16em;
}

.hero-copy h1,
.table-header h2,
.rack-header h3,
.auth-modal-card h2,
.piece-card-name,
.admin-panel h3 {
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  line-height: 0.98;
  font-weight: 900;
}

.tagline {
  max-width: 900px;
  margin-top: 6px;
  color: rgba(220, 227, 237, 0.78);
  font-size: 0.92rem;
  line-height: 1.45;
}

.subnav-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.subnav-back {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 14px;
  background: rgba(36, 39, 45, 0.95);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.layout {
  grid-template-columns: 1fr;
  gap: 18px;
}

.control-center-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-center-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.table-card {
  padding: 22px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(29, 127, 255, 0.07), transparent 28%),
    linear-gradient(180deg, rgba(29, 31, 36, 0.96), rgba(20, 22, 26, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.34);
}

.table-card::after {
  inset: 10px;
  border-radius: 24px;
  border: 0;
}

.main-card.is-live {
  box-shadow:
    0 26px 64px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(48, 132, 255, 0.08);
}

.game-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  position: relative;
  z-index: 1;
  align-items: start;
}

.control-dock,
.play-dock {
  display: grid;
  gap: 16px;
  align-content: start;
}

.play-dock {
  gap: 14px;
}

.control-card,
.history-strip,
.rack-panel,
.rules,
.tuning-panel,
.prediction-panel,
.admin-panel {
  padding: 18px;
  border-radius: 24px;
  background: rgba(18, 20, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.control-card {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.control-card-panels {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-surface {
  padding: 16px;
  border-radius: 22px;
  background: rgba(18, 20, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.game-title-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, #2390ff, #146ce7);
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 24px rgba(27, 126, 255, 0.22);
}

.game-title-copy {
  min-width: 0;
}

.game-title-label {
  margin: 0 0 4px;
  color: rgba(133, 149, 171, 0.92);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game-title-copy h2 {
  margin: 0;
}

.game-card-copy {
  text-align: center;
  margin-bottom: 12px;
}

.game-card-copy h2 {
  margin: 0;
}

.how-to-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  min-height: 58px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 800;
  box-shadow: none;
}

.how-to-trigger-mark {
  color: rgba(199, 210, 223, 0.78);
  font-size: 1.08rem;
  line-height: 1;
}

.account-signed-in,
.account-signed-out {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.account-chip {
  min-width: 0;
  min-height: 58px;
  padding: 10px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  flex: 1 1 180px;
}

.account-chip span {
  color: rgba(135, 149, 170, 0.86);
  margin-bottom: 4px;
  font-size: 0.7rem;
}

.account-chip strong {
  color: #ffffff;
  font-size: 1.05rem;
}

.account-balance {
  background:
    radial-gradient(circle at top right, rgba(27, 126, 255, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
}

.account-balance strong {
  color: #ffffff;
}

.table-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.table-header h2 {
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  font-weight: 900;
}

.control-card .table-header {
  grid-template-columns: 1fr;
  gap: 8px;
}

.round-state {
  max-width: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(217, 224, 234, 0.82);
  font-size: 0.86rem;
  line-height: 1.35;
}

.control-card .round-state {
  padding: 8px 10px;
  font-size: 0.8rem;
}

.controls {
  display: grid;
  gap: 12px;
  margin: 0;
  align-items: stretch;
}

.control-card .controls {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 0;
}

.control-stack {
  min-width: 0;
}

.bet-control > span,
.difficulty-control > span,
.admin-field > span {
  color: rgba(133, 149, 171, 0.92);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.bet-input-wrap {
  height: 62px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(46, 49, 56, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.bet-input-wrap span {
  color: rgba(152, 168, 192, 0.88);
  font-size: 1.18rem;
  font-weight: 800;
}

.bet-input-wrap input {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
}

.quick-bet-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.quick-bet-chip {
  min-height: 38px;
  border-radius: 14px;
  background: rgba(36, 39, 45, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(218, 224, 234, 0.88);
  font-size: 0.82rem;
}

.quick-bet-chip.active {
  color: #ffffff;
  background: linear-gradient(180deg, #2390ff, #146ce7);
  box-shadow: 0 12px 24px rgba(27, 126, 255, 0.22);
}

.control-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.control-card .control-buttons {
  grid-template-columns: 1fr;
}

.control-bet-panel .control-buttons {
  margin-top: 12px;
}

#startButton {
  grid-column: 1 / -1;
  min-height: 74px;
  border-radius: 20px;
  font-size: 1.12rem;
}

.control-card #startButton {
  grid-column: auto;
  min-height: 56px;
}

button {
  border-radius: 16px;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(180deg, #2390ff, #146ce7);
  box-shadow: 0 16px 30px rgba(27, 126, 255, 0.24);
}

.primary-button.locked-action {
  background: rgba(66, 71, 79, 0.96);
  color: rgba(210, 217, 227, 0.84);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  opacity: 0.82;
}

.secondary-button {
  color: #ffffff;
  background: rgba(34, 37, 43, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 12px 24px rgba(0, 0, 0, 0.18);
}

.ghost-button {
  color: rgba(232, 237, 245, 0.94);
  background: rgba(36, 39, 45, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.primary-link {
  color: #ffffff;
  background: linear-gradient(180deg, #2390ff, #146ce7);
  box-shadow: 0 16px 30px rgba(27, 126, 255, 0.24);
}

.controls-helper {
  gap: 8px;
  margin: 0;
}

.control-card .controls-helper {
  display: none;
}

.top-stats-panel {
  display: none;
}

.mobile-next-line-panel {
  display: none;
}

.top-stats-panel .stat-card {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
}

.top-stats-panel .stat-card span {
  font-size: 0.64rem;
  margin-bottom: 6px;
}

.top-stats-panel .stat-card strong {
  font-size: 1.02rem;
}

.top-stats-panel .stat-card small {
  font-size: 0.68rem;
  margin-top: 4px;
}

.top-stats-panel .status-card {
  grid-column: auto;
}

.controls-helper span {
  background: rgba(25, 27, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(205, 214, 225, 0.76);
}

kbd {
  border-color: rgba(120, 179, 255, 0.18);
  background: rgba(14, 24, 39, 0.9);
  color: #8ec0ff;
}

.history-strip {
  display: grid;
  gap: 10px;
}

.history-label {
  color: rgba(127, 144, 166, 0.88);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.history-track {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  color: rgba(199, 209, 222, 0.88);
  font-size: 1rem;
  font-weight: 800;
}

.history-hot {
  color: #f2ce66;
}

.board-and-piece {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: start;
}

.board-wrap {
  min-height: 100%;
  padding: 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(27, 126, 255, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(17, 20, 24, 0.98), rgba(20, 24, 29, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.board-wrap::before {
  inset: 10px;
  border-radius: 22px;
  border-color: rgba(255, 255, 255, 0.05);
}

.board-stage {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(40, 141, 255, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(13, 20, 31, 0.98), rgba(16, 37, 64, 0.98) 52%, rgba(13, 20, 31, 0.98) 100%);
  border: 1px solid rgba(79, 150, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 40px rgba(0, 0, 0, 0.32);
}

.board-multiplier-strip {
  overflow: hidden;
  padding-top: 2px;
}

.multiplier-lane-track {
  --lane-gap: 8px;
  display: flex;
  gap: var(--lane-gap);
  transition: transform 220ms ease;
  will-change: transform;
}

.multiplier-card {
  flex: 0 0 calc((100% - (var(--lane-gap) * 2)) / 3);
  min-width: 0;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(14, 19, 28, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.multiplier-card strong {
  display: block;
  font-size: 0.84rem;
  line-height: 1.1;
  text-align: center;
}

.multiplier-card.is-current {
  background:
    radial-gradient(circle at top right, rgba(41, 201, 107, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(18, 71, 42, 0.96), rgba(13, 55, 33, 0.96));
  border-color: rgba(83, 226, 137, 0.34);
  box-shadow: 0 10px 22px rgba(13, 55, 33, 0.28);
}

.multiplier-card.is-current strong {
  color: #dfffe9;
}

.board {
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.board.is-live {
  border-color: rgba(79, 150, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 40px rgba(0, 0, 0, 0.32),
    0 0 46px rgba(29, 127, 255, 0.12);
}

.cell {
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    rgba(16, 18, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cell.preview-valid {
  background-color: rgba(29, 127, 255, 0.24);
  border-color: rgba(128, 184, 255, 0.48);
  box-shadow: 0 0 18px rgba(27, 126, 255, 0.24);
}

.cell.preview-invalid {
  background-color: rgba(255, 90, 130, 0.22);
  border-color: rgba(255, 120, 156, 0.42);
}

.stats-panel {
  gap: 10px;
}

.board-rack-panel {
  margin-top: 0;
  padding: 14px;
  border-top: 0;
  min-height: 100%;
  align-content: start;
}

.board-rack-panel .rack-header {
  display: grid;
  gap: 8px;
}

.board-rack-panel .rack-hint {
  margin: 0;
  font-size: 0.82rem;
}

.board-rack-panel .piece-rack {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.board-rack-panel .piece-card {
  padding: 14px;
}

.board-rack-panel .piece-card-name {
  font-size: 1.2rem;
}

.board-rack-panel .mini-grid {
  margin-top: 14px;
  padding: 14px;
}

.stat-card {
  border-radius: 20px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat-card span {
  color: rgba(136, 151, 172, 0.9);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-card strong {
  color: #ffffff;
  font-size: 1.55rem;
  font-weight: 900;
}

.stat-card small {
  color: rgba(202, 211, 223, 0.7);
}

.status-card.locked strong {
  color: #ff97b2;
}

.status-card.unlocked {
  border-color: rgba(70, 214, 137, 0.18);
  background:
    radial-gradient(circle at top right, rgba(70, 214, 137, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
}

.status-card.unlocked strong {
  color: #83f2bc;
}

.side-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
  position: static;
}

.side-card .prediction-panel {
  grid-column: span 2;
}

.side-card .admin-panel {
  grid-column: span 1;
}

.rack-header h3,
.admin-panel h3 {
  font-size: 1.16rem;
  font-weight: 800;
}

.rack-hint,
.admin-copy,
.admin-status,
.prediction-empty,
.difficulty-head small,
.rules ul,
.auth-gate-text,
.auth-status {
  color: rgba(205, 214, 225, 0.72);
}

.piece-card {
  min-height: 0;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(27, 126, 255, 0.08), transparent 34%),
    rgba(26, 29, 35, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.piece-card.active,
.piece-card:hover {
  border-color: rgba(111, 175, 255, 0.42);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.piece-card-title {
  color: rgba(132, 148, 171, 0.88);
}

.piece-card-name {
  color: #ffffff;
  font-size: 1.44rem;
  font-weight: 900;
}

.piece-meta-pill,
.prediction-pill,
.difficulty-control,
.prediction-stat {
  background: rgba(31, 34, 40, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(209, 217, 228, 0.82);
}

.mini-grid {
  background: rgba(13, 15, 19, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-cell {
  background: rgba(255, 255, 255, 0.06);
}

.prediction-label {
  color: #7fb4ff;
}

.prediction-stat strong,
.difficulty-head strong {
  color: #ffffff;
}

.prediction-stat.danger strong,
.prediction-pill.bust {
  color: #ff9cb4;
}

.prediction-pill.safe {
  background: rgba(25, 58, 101, 0.34);
  border-color: rgba(100, 161, 255, 0.22);
}

.prediction-pill.bust {
  background: rgba(110, 29, 51, 0.22);
  border-color: rgba(255, 128, 159, 0.2);
}

.difficulty-slider {
  accent-color: #1b7eff;
}

.difficulty-scale {
  color: rgba(173, 184, 199, 0.66);
}

.rules li::before {
  background: #1b7eff;
  box-shadow: 0 0 16px rgba(27, 126, 255, 0.24);
}

.admin-inline input,
.admin-inline select,
.auth-input {
  background: rgba(31, 34, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.auth-input:focus,
.admin-inline input:focus,
.admin-inline select:focus {
  outline: 1px solid rgba(73, 150, 255, 0.38);
  border-color: rgba(73, 150, 255, 0.42);
}

.auth-modal-card {
  background:
    radial-gradient(circle at top right, rgba(27, 126, 255, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(28, 30, 35, 0.98), rgba(22, 24, 28, 0.98));
}

.auth-close {
  background: rgba(36, 39, 45, 0.96);
}

.auth-tab {
  background: rgba(35, 38, 44, 0.96);
}

.auth-tab.active {
  color: #ffffff;
  background: linear-gradient(180deg, #2390ff, #146ce7);
  box-shadow: 0 14px 28px rgba(27, 126, 255, 0.24);
}

@media (max-width: 1260px) {
  .game-shell {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .control-center-layout {
    grid-template-columns: 1fr;
  }

  .side-card {
    position: static;
  }

  .top-stats-panel {
    grid-template-columns: minmax(0, 220px);
  }

  .side-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-card .prediction-panel,
  .side-card .admin-panel {
    grid-column: span 2;
  }
}

@media (max-width: 980px) {
  .site-topbar,
  .subnav-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .top-nav {
    overflow-x: auto;
    max-width: 100%;
  }

  .board-and-piece {
    grid-template-columns: 1fr;
  }

  .board-rack-panel {
    order: -1;
  }

  .stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-stats-panel {
    grid-template-columns: minmax(0, 220px);
  }

  .control-card .controls-helper {
    display: flex;
    margin-top: 10px;
  }

  .control-card .controls,
  .control-card .control-buttons {
    grid-template-columns: 1fr;
  }

.control-card #startButton {
  grid-column: auto;
}

@media (min-width: 761px) {
  .control-card {
    min-height: 100%;
  }

  .control-card-panels {
    min-height: 620px;
  }

  .control-bet-panel {
    min-height: 194px;
  }

  .control-bet-panel .control-buttons {
    margin-top: 34px;
  }

  .control-card #startButton {
    min-height: 84px;
  }
}

  .side-card {
    grid-template-columns: 1fr;
  }

  .side-card .prediction-panel,
  .side-card .admin-panel {
    grid-column: auto;
  }

  .table-header {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --cell-size: min(13vw, 52px);
  }

  html,
  body {
    min-height: 100dvh;
    overflow-x: hidden;
    background: #0b0d11;
  }

  .page-shell {
    width: 100%;
    padding: 6px 6px 12px;
  }

  .site-topbar {
    top: 0;
    gap: 8px;
    margin-bottom: 6px;
    align-items: start;
    padding: 8px 10px;
    border-radius: 14px;
  }

  .brand-mark {
    width: 36px;
    height: 32px;
    border-radius: 10px;
    font-size: 0.92rem;
  }

  .hero-actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .hero-auth-actions,
  .hero-userbar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .hero-balance-stack {
    flex: 1 1 auto;
    min-width: 0;
  }

  .small-auth-button,
  .hero-utility-chip,
  .hero-utility-button,
  .hero-profile-button,
  .hero-plus-button {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 0.82rem;
  }

  .hero-balance-pill {
    min-height: 36px;
    padding: 0 12px;
  }

  .hero-balance-pill strong {
    font-size: 0.9rem;
  }

  .hero-avatar-face {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 1.2rem;
  }

  .hero-profile-button strong {
    display: none;
  }

  .account-signed-in,
  .account-signed-out,
  .stats-panel,
  .prediction-stats,
  .prediction-columns,
  .control-buttons {
    grid-template-columns: 1fr;
  }

  .main-card,
  .side-card,
  .control-card,
  .board-wrap,
  .board-rack-panel,
  .rules,
  .tuning-panel,
  .prediction-panel,
  .admin-panel {
    border-radius: 18px;
  }

  .table-card {
    padding: 6px;
  }

  .game-shell,
  .play-dock,
  .side-card {
    gap: 6px;
  }

  .play-dock {
    display: flex;
    flex-direction: column;
  }

  .account-strip {
    margin-bottom: 6px;
  }

  .account-chip {
    min-height: 0;
    padding: 7px 9px;
    border-radius: 10px;
  }

  .account-chip strong {
    font-size: 0.96rem;
  }

  .table-header {
    margin-bottom: 4px;
  }

  .control-card .table-header > div:first-child {
    display: none;
  }

  .round-state {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.76rem;
    line-height: 1.28;
  }

  .controls {
    gap: 6px;
  }

  .bet-control > span {
    display: none;
  }

  .bet-input-wrap {
    height: 44px;
    padding: 0 10px;
    border-radius: 12px;
  }

  .bet-input-wrap input {
    font-size: 0.98rem;
  }

  .quick-bet-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .quick-bet-chip {
    min-height: 32px;
    padding: 0 6px;
    border-radius: 9px;
    font-size: 0.68rem;
  }

  #startButton {
    grid-column: auto;
    min-height: 42px;
    border-radius: 12px;
    font-size: 0.82rem;
  }

  .control-card .controls-helper {
    display: none;
  }

  .top-stats-panel {
    display: none;
  }

  .board-and-piece {
    order: 1;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .board-wrap {
    order: 1;
    padding: 8px;
  }

  .board-stage {
    gap: 6px;
    padding: 8px;
  }

  .board-rack-panel {
    order: 3;
    padding: 8px;
    min-height: 0;
  }

  .board-rack-panel .rack-header {
    gap: 2px;
  }

  .board-rack-panel .section-kicker,
  .board-rack-panel .rack-header h3,
  .board-rack-panel .rack-hint,
  .board-rack-panel .piece-card-title {
    display: none;
  }

  .piece-rack {
    margin-top: 0;
  }

  .board-rack-panel .piece-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 8px;
  }

  .board-rack-panel .mini-grid {
    order: 1;
    margin-top: 0;
    margin-bottom: 8px;
    padding: 8px;
    gap: 4px;
  }

  .board-rack-panel .piece-card-footer {
    order: 2;
    margin-top: 0;
    padding-top: 0;
  }

  .board-rack-panel .piece-card-name {
    order: 2;
    font-size: 0.92rem;
  }

  .board-rack-panel .piece-card-meta {
    order: 3;
    margin-top: 6px;
    gap: 6px;
  }

  .board {
    gap: 5px;
    padding: 8px;
    border-radius: 16px;
  }

  .cell {
    border-radius: 9px;
  }

  .board-legend {
    gap: 3px;
  }

  .board-legend span {
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 0.64rem;
    padding: 5px 6px;
  }

  .board-legend span:last-child {
    display: none;
  }

  .rack-hint,
  .prediction-empty,
  .admin-copy,
  .admin-status,
  .rules ul,
  .difficulty-head small {
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .prediction-stats,
  .prediction-columns,
  .admin-grid,
  .admin-actions,
  .auth-actions-row {
    gap: 10px;
  }

  .side-card {
    display: block;
    padding: 6px;
  }

  .side-card > :not(.tuning-panel) {
    display: none;
  }

  .tuning-panel {
    margin-top: 0;
    padding: 8px;
  }

  .difficulty-control {
    padding: 8px;
  }

  .difficulty-head strong {
    font-size: 0.88rem;
  }

  .difficulty-scale {
    font-size: 0.68rem;
  }

  .admin-inline {
    grid-template-columns: 1fr;
  }

  .admin-button,
  .admin-link,
  .auth-submit {
    min-height: 40px;
  }

  .auth-modal {
    padding: 8px;
  }

  .auth-modal-card {
    width: min(100%, 100%);
    padding: 14px 12px;
  }

  .auth-modal-card h2 {
    font-size: 1.2rem;
  }

  .auth-close {
    top: 10px;
    right: 10px;
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.76rem;
  }
}

@media (max-width: 420px) {
  :root {
    --cell-size: min(12.2vw, 44px);
  }

  .page-shell {
    width: 100%;
    padding: 6px 5px 12px;
  }

  .table-card {
    padding: 6px;
  }

  .control-card,
  .board-wrap,
  .board-rack-panel,
  .rules,
  .tuning-panel,
  .prediction-panel,
  .admin-panel {
    padding: 10px;
    border-radius: 14px;
  }

  .hero-auth-actions,
  .hero-userbar {
    gap: 6px;
  }

  .small-auth-button,
  .hero-utility-chip,
  .hero-utility-button,
  .hero-profile-button,
  .hero-plus-button {
    min-height: 34px;
    font-size: 0.76rem;
  }

  .hero-balance-pill {
    min-height: 34px;
    padding: 0 10px;
  }

  .hero-balance-pill strong {
    font-size: 0.88rem;
  }

  .hero-avatar-face {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 1.2rem;
  }

  .bet-input-wrap {
    height: 40px;
    padding: 0 8px;
  }

  .quick-bet-chip,
  #startButton,
  .small-auth-button {
    min-height: 32px;
  }

  .quick-bet-row {
    gap: 5px;
  }

  .quick-bet-chip {
    font-size: 0.68rem;
    padding: 0 5px;
  }

  .board {
    padding: 4px;
    gap: 3px;
  }

  .multiplier-lane-track {
    --lane-gap: 6px;
  }

  .multiplier-card {
    padding: 5px 6px;
  }

  .multiplier-card strong {
    font-size: 0.72rem;
  }

  .board-rack-panel .piece-card-name {
    font-size: 0.92rem;
  }

  .board-rack-panel .rack-hint,
  .difficulty-head small {
    font-size: 0.68rem;
  }
}

/* Performance-oriented overrides */

.ambient {
  display: none;
}

body::before {
  opacity: 0.14;
}

.table-card,
.stat-card,
.piece-card,
.prediction-stat,
.difficulty-control,
.account-chip,
.auth-modal-card {
  backdrop-filter: none !important;
}

.auth-backdrop {
  backdrop-filter: none;
}

.table-card,
.board,
.board-wrap,
.piece-card,
.stat-card {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.piece-card.active,
.piece-card:hover {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.table-card,
.board,
.piece-card,
.cell,
button,
.top-nav-item {
  transition:
    transform 120ms ease,
    opacity 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease !important;
}

.hero-mobile-nav-wrap,
.hero-mobile-account {
  display: none;
}

.hero-mobile-nav-wrap,
.hero-mobile-profile-wrap {
  position: relative;
}

.hero-mobile-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(36, 39, 45, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 1.1rem;
}

.hero-mobile-nav-toggle span {
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  pointer-events: none;
}

.hero-mobile-nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  gap: 6px;
  min-width: 168px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(24, 27, 33, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
  z-index: 24;
}

.hero-mobile-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  color: rgba(226, 232, 241, 0.86);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 800;
  background: rgba(36, 39, 45, 0.95);
}

.hero-mobile-nav-link.active {
  color: #ffffff;
  background: linear-gradient(180deg, #2390ff, #146ce7);
}

@media (max-width: 760px) {
  .page-shell {
    padding: calc(env(safe-area-inset-top, 0px) + 112px) 6px 12px;
  }

  .site-domain-bar {
    position: static;
    order: -1;
    width: 100%;
    transform: none;
    left: auto;
    top: auto;
    right: auto;
    margin: 0;
    min-height: 38px;
    padding: 4px 0 6px;
    background:
      radial-gradient(circle at 50% 0%, rgba(100, 145, 255, 0.12), transparent 72%);
    border: 0;
    box-shadow: none;
  }

  .site-domain-bar strong {
    font-size: 1.12rem;
    letter-spacing: 0.11em;
  }

  .site-topbar {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: 6px;
    right: 6px;
    width: auto;
    z-index: 90;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 10px;
    margin-top: 0;
  }

  .brand-cluster {
    gap: 0;
    flex: 0 0 auto;
  }

  .top-nav,
  .hero-utility-chip,
  .hero-utility-button,
  .hero-auth-actions,
  .hero-userbar {
    display: none !important;
  }

  .brand-mark {
    width: 38px;
    height: 36px;
    border-radius: 12px;
  }

  .game-brand-icon span {
    height: 3px;
  }

  .hero-mobile-nav-wrap,
  .hero-mobile-account {
    display: flex;
  }

  .hero-mobile-nav-wrap {
    align-items: center;
  }

  .hero-actions {
    width: auto;
    min-width: 0;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .hero-mobile-account {
    align-items: center;
    gap: 8px;
  }

  .hero-mobile-balance-stack {
    flex: 0 0 auto;
  }

  .hero-mobile-balance-pill {
    min-height: 34px;
    padding: 0 10px;
    gap: 8px;
    border-radius: 11px;
  }

  .hero-mobile-balance-pill strong {
    font-size: 0.84rem;
  }

  .hero-mobile-account .hero-plus-button {
    width: 34px;
    min-height: 34px;
    border-radius: 11px;
    font-size: 1.35rem;
  }

  .hero-mobile-profile-button {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 11px;
  }

  .hero-mobile-profile-button .hero-avatar-face {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 1.05rem;
  }

  .hero-mobile-profile-menu {
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
  }

  .hero-mobile-profile-menu .hero-profile-action {
    justify-content: flex-start;
    width: 100%;
    min-height: 38px;
    font-size: 0.84rem;
  }
}
