/* ---------------------------------------------
   Big Six Wheel — Luxury Casino Noir
   --------------------------------------------- */

:root {
  --gold:      #c9a84c;
  --gold-lt:   #ffe08a;
  --gold-dk:   #8a6b1e;
  --bg:        #090910;
  --surface:   #111120;
  --surface2:  #181828;
  --border:    rgba(201,168,76,0.18);
  --text:      #e8e0d0;
  --muted:     #6a6575;
  --red:       #cc2200;
  --win-green: #1faa5a;
  --lose-red:  #cc2a1a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  min-height: 100vh;
  /* subtle noise texture */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(201,168,76,0.06) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* -- Page shell -- */
.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* -- Header -- */
.site-header {
  text-align: center;
  margin-bottom: 36px;
}

.site-title {
  font-family: Georgia, 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold-dk) 0%, var(--gold-lt) 45%, var(--gold) 70%, var(--gold-dk) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.site-sub {
  margin-top: 8px;
  font-size: 0.8rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
}

/* -- Main layout -- */
.layout {
  display: flex;
  align-items: flex-start;
  gap: 36px;
}

/* ---------------------
   WHEEL SECTION
--------------------- */
.wheel-section {
  flex: 0 0 auto;
}

.wheel-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Pointer — downward-pointing triangle (?) above wheel */
.pointer {
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 40px solid var(--red);
  filter: drop-shadow(0 4px 10px rgba(220, 50, 0, 0.85));
  z-index: 10;
  margin-bottom: -6px; /* overlap slightly onto wheel border */
  position: relative;
}

/* Add a subtle inner highlight to pointer */
.pointer::after {
  content: '';
  position: absolute;
  top: -40px;
  left: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 20px solid rgba(255,120,80,0.4);
}

/* Canvas ring wrapper */
.canvas-ring {
  position: relative;
  border-radius: 50%;
  padding: 6px;
  background: conic-gradient(
    var(--gold-dk) 0deg, var(--gold-lt) 45deg, var(--gold-dk) 90deg,
    var(--gold-lt) 135deg, var(--gold-dk) 180deg, var(--gold-lt) 225deg,
    var(--gold-dk) 270deg, var(--gold-lt) 315deg, var(--gold-dk) 360deg
  );
  box-shadow:
    0 0 40px rgba(201,168,76,0.3),
    0 0 80px rgba(201,168,76,0.1),
    inset 0 0 20px rgba(0,0,0,0.6);
}

#wheel {
  display: block;
  border-radius: 50%;
}

/* Spin button — centred on canvas */
#spinBtn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: radial-gradient(circle at 38% 35%, #28283e 0%, #0a0a18 100%);
  color: var(--gold);
  cursor: pointer;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: background 0.2s, box-shadow 0.2s, transform 0.12s;
  box-shadow: 0 0 20px rgba(201,168,76,0.2), 0 6px 20px rgba(0,0,0,0.7);
}

.spin-label {
  font-family: Georgia, 'Palatino Linotype', Palatino, serif;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1;
}

.spin-sub {
  font-size: 0.55rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-dk);
  opacity: 0.85;
}

#spinBtn:hover:not(:disabled) {
  background: radial-gradient(circle at 38% 35%, var(--gold) 0%, var(--gold-dk) 100%);
  color: #000;
  box-shadow: 0 0 35px rgba(201,168,76,0.65), 0 6px 20px rgba(0,0,0,0.7);
  transform: translate(-50%, -50%) scale(1.06);
}
#spinBtn:hover:not(:disabled) .spin-sub { color: #333; }

#spinBtn:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.96);
}

#spinBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------------------
   SIDEBAR
--------------------- */
.sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 46px; /* align with canvas (below pointer) */
  min-width: 260px;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}

.stat-lbl {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.stat-val {
  display: block;
  font-family: Georgia, 'Palatino Linotype', Palatino, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
}

/* Panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.panel-title {
  font-family: Georgia, 'Palatino Linotype', Palatino, serif;
  font-size: 0.62rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Bet buttons */
.bet-row {
  display: flex;
  gap: 8px;
}

.bet {
  flex: 1;
  padding: 11px 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--surface2);
  color: var(--muted);
  border: 1.5px solid rgba(255,255,255,0.07);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s;
}

.bet:hover:not(.active) {
  border-color: var(--gold-dk);
  color: var(--gold);
}

.bet.active {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(201,168,76,0.4);
  font-weight: 900;
}

/* Result box */
.result-box {
  min-height: 64px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, border-color 0.3s;
}

.result-msg {
  font-size: 0.92rem;
  font-weight: 500;
  text-align: center;
  color: var(--muted);
  line-height: 1.4;
  transition: color 0.3s;
}

.result-box.idle    .result-msg { color: var(--muted); }
.result-box.spinning .result-msg { color: #888; animation: blink 0.7s infinite; }

.result-box.win {
  background: rgba(31,170,90,0.08);
  border-color: rgba(31,170,90,0.4);
}
.result-box.win .result-msg { color: #3dca7a; }

.result-box.jackpot {
  background: rgba(201,168,76,0.1);
  border-color: rgba(201,168,76,0.6);
  animation: jackpot-pulse 0.6s infinite alternate;
}
.result-box.jackpot .result-msg { color: var(--gold-lt); }

.result-box.push {
  background: rgba(80,120,200,0.07);
  border-color: rgba(80,120,200,0.3);
}
.result-box.push .result-msg { color: #7aa0e0; }

.result-box.lose {
  background: rgba(204,42,26,0.07);
  border-color: rgba(204,42,26,0.3);
}
.result-box.lose .result-msg { color: #e06055; }

/* Payout table */
.payout-panel { padding: 18px 18px 14px; }

.payout-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.payout-table th {
  font-size: 0.6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.payout-table th:last-child,
.payout-table td:last-child { text-align: right; }

.payout-table td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #b0a898;
  vertical-align: middle;
}

.payout-table tr:last-child td { border-bottom: none; }
.payout-table td:last-child { font-weight: 700; color: var(--gold); }

.special-row td { color: #d4aa60; }
.special-row td:last-child { color: var(--gold-lt); }

/* -- Mini playing-card chips (payout table) -- */
.card-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 34px;
  padding: 0 5px;
  background: #f8f8f0;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-family: Georgia, 'Palatino Linotype', Palatino, serif;
  font-size: 0.82rem;
  font-weight: 900;
  color: #1a1a1a;       /* black suit by default */
  margin-right: 10px;
  vertical-align: middle;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.8);
  flex-shrink: 0;
}

/* Red-suit faces (J, K) */
.card-chip.red { color: #bb1111; }

/* Joker base */
.card-chip.joker {
  font-size: 0.75rem;
  border-width: 1.5px;
}

/* Red joker */
.card-chip.red-joker {
  background: linear-gradient(145deg, #2a0a0a, #5a1010);
  border-color: #c94c4c;
  color: #f87070;
}

/* Black joker */
.card-chip.black-joker {
  background: linear-gradient(145deg, #0a0a18, #1a1a38);
  border-color: var(--gold);
  color: var(--gold);
}

/* -- Animations -- */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

@keyframes jackpot-pulse {
  from { box-shadow: 0 0 12px rgba(201,168,76,0.35); }
  to   { box-shadow: 0 0 30px rgba(201,168,76,0.75), 0 0 60px rgba(201,168,76,0.2); }
}

/* -- Responsive -- */
@media (max-width: 960px) {
  .layout {
    flex-direction: column;
    align-items: center;
  }
  .sidebar {
    padding-top: 0;
    width: 100%;
    max-width: 600px;
  }
}

@media (max-width: 640px) {
  .wheel-section { transform: scale(0.75); transform-origin: top center; margin-bottom: -80px; }
  .page { padding: 20px 12px 40px; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .stat-val { font-size: 0.95rem; }
}

/* -- Prediction (Bet On) buttons -- */
.predict-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.predict-cards {
  display: flex;
  gap: 6px;
}

.predict-jokers {
  display: flex;
  gap: 6px;
}

/* Base predict button — looks like a face-down card */
.predict {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 9px 4px 8px;
  background: var(--surface2);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.predict:hover:not(.active) {
  border-color: var(--gold-dk);
  background: rgba(201,168,76,0.06);
}

.predict.active {
  background: rgba(201,168,76,0.13);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201,168,76,0.3);
}

/* Card face character */
.pc-face {
  font-family: Georgia, 'Palatino Linotype', Palatino, serif;
  font-size: 1.15rem;
  font-weight: 900;
  color: #e8e0d0;
  line-height: 1;
}
.pc-face.red  { color: #d94040; }
.pc-face.gold { color: var(--gold); font-size: 0.95rem; }

/* Small payout label beneath the face */
.pc-meta {
  font-size: 0.52rem;
  letter-spacing: 0.4px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

/* Joker buttons are slightly wider with subtle special styling */
.predict.joker-btn {
  border-color: rgba(201,168,76,0.2);
}
.predict.joker-btn:hover:not(.active) {
  border-color: var(--gold-dk);
}

/* -- Multi-bet additions -- */

/* Small hint text beside panel titles */
.panel-hint {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 0.52rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: none;
  color: var(--muted);
  margin-left: 6px;
  opacity: 0.75;
}

/* Gold dot badge that appears on active predict buttons */
.bet-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 4px rgba(201,168,76,0.8);
  pointer-events: none;
}

/* predict button needs relative positioning for the badge */
.predict {
  position: relative;
}

/* Dimmer secondary line inside result messages */
.result-note {
  opacity: 0.65;
  font-size: 0.82em;
}

/* result-msg line-breaks */
.result-msg br {
  display: block;
  margin-top: 4px;
  content: '';
}