/* General Styles */
html, body {
  height: 100%;
  width: 100%;
  background-color: #dedede;
  color: black;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  transition: background-color 0.5s ease, color 0.5s ease;
}

header {
  width: 100%;
  height: 100px;
  padding: 10px 0;
  background-color: #c8c8c8;
  position: fixed;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.5s ease, color 0.5s ease;
}
.header-divider { width: 100%; height: 2px; background-color: #7d7d7d; position: fixed; top: 100px; z-index: 9; }
.link { position: fixed; left: 50%; transform: translateX(-50%); }

.container { display: flex; justify-content: space-between; align-items: center; transition: background-color 0.5s ease, color 0.5s ease; }
#darkModeToggle { position: absolute; top: 10px; right: 10px; cursor: pointer; }

main { padding-top: 80px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
main .content {
  width: 100%; max-width: 900px; padding: 20px; background-color: #fff; border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.10); transition: background-color 0.5s ease, color 0.5s ease, box-shadow .3s ease;
}

/* Dark Mode */
html.dark-mode, body.dark-mode { background: radial-gradient(1200px 800px at 50% -10%, #2a2a2a, #1e1e1e); color: #e9e9e9; }
header.dark-mode { background-color: #282828; color: white; }
main .content.dark-mode { background-color: #2f2f2f; color: white; box-shadow: 0 12px 48px rgba(0,0,0,0.35); }
.header-divider.dark-mode, .divider.dark-mode { background-color: #afafaf; }

.darkLightText { color: #646464; }

/* Utilities */
.orbitron { font-family: 'Orbitron', sans-serif; }
.press-start { font-family: 'Press Start 2P', cursive; }
.hidden { display:none; }
.center { align-self:center; text-align:center; align-items:center; vertical-align:middle; }
.rounded { border-radius: 20px; }
.scrollable { overflow-y: auto; }
.divider { width: 100%; height: 2px; background-color: #7d7d7d; margin: 30px 0; }
.mt-16 { margin-top: 16px; }
.subtle-note { opacity: .85; font-size: .95rem; }

/* Balance + Back */
.balance-bar {
  display:flex; align-items:baseline; gap:10px; padding:12px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(245,245,245,0.9));
  border-radius: 14px; border: 1px solid rgba(0,0,0,0.08); margin-bottom: 18px;
  backdrop-filter: blur(6px);
}
html.dark-mode .balance-bar { background: linear-gradient(180deg, rgba(60,60,60,0.95), rgba(44,44,44,0.95)); border-color: rgba(255,255,255,0.08); }
.balance-label { font-weight: 700; letter-spacing: .6px; }
.balance-amount { font-weight: 800; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.1)); }

.backbar { display:flex; align-items:center; gap:8px; margin-bottom:18px; }
.backbar .backbar-title { font-weight: 700; opacity: .9; letter-spacing:.4px; }

/* Button override (requested) */
.btn, .btn-large, .btn-small, .btn-flat {
  background-color: gold !important;
  color: black !important;
  border: none !important;
  padding: 0px 20px !important;
  border-radius: 2px !important;
}
/* extra flair */
.fancy-btn { position: relative; overflow: hidden; }
.fancy-btn::after {
  content:""; position:absolute; left:-20%; top:-200%; width:60%; height:500%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,.35), rgba(255,255,255,0) 60%);
  transform: rotate(25deg); transition: transform .5s ease, opacity .5s ease; opacity:.0;
}
.fancy-btn:hover::after { transform: rotate(25deg) translateX(120%); opacity:.9; }

/* Menu layout */
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
@media (max-width: 760px) { .menu-grid { grid-template-columns: 1fr; } }
.menu-btn { width:100%; }

/* Cards elevation + motion */
.elevate { box-shadow: 0 16px 50px rgba(0,0,0,.12); }
.tilt { transform-style: preserve-3d; will-change: transform; }
.tilt:hover { transform: perspective(900px) rotateX(1deg) rotateY(-1deg) translateY(-2px); transition: transform .2s ease; }
.pop-in { animation: popIn .38s ease-out; }
@keyframes popIn { from{ transform: scale(.98); opacity:.0; } to{ transform: scale(1); opacity:1; } }

/* ===== Slots ===== */
.slot-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(245,245,245,0.9));
  border: 1px solid rgba(0,0,0,0.08);
  padding: 16px;
}
html.dark-mode .slot-card { background: linear-gradient(180deg, rgba(56,56,56,0.95), rgba(44,44,44,0.95)); border-color: rgba(255,255,255,0.08); }
.slot-header { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:12px; }
.slot-title { font-size:1.2rem; font-weight:800; letter-spacing:.6px; text-transform: uppercase; }
.slot-meta { display:flex; gap:10px; font-size:.95rem; opacity:.9; }
.slot-meta .bullet { opacity:.5; }

.slot-machine {
  --reel-size: 88px;
  display:grid; grid-template-columns: repeat(var(--reels,3), minmax(0,1fr));
  gap:12px; padding:16px; border-radius:18px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,0.7), rgba(230,230,230,0.95));
  border: 1px solid rgba(0,0,0,0.08); position: relative; overflow: hidden;
}
html.dark-mode .slot-machine {
  background: radial-gradient(120% 120% at 50% 0%, rgba(60,60,60,0.95), rgba(36,36,36,0.98));
  border-color: rgba(255,255,255,0.08);
}
.slot-machine::before {
  content:""; position:absolute; inset:0; pointer-events:none; background:
    radial-gradient(80% 50% at 50% 0%, rgba(255,255,255,.25), transparent 60%),
    linear-gradient(180deg, transparent, rgba(0,0,0,.05));
}
.slot-machine.win-flash { animation: winbg 650ms ease-in-out; }
@keyframes winbg {
  0%{box-shadow: 0 0 0 rgba(0,0,0,0);}
  35%{box-shadow: 0 0 36px rgba(76,175,80,.65), 0 0 120px rgba(76,175,80,.25) inset;}
  100%{box-shadow: 0 0 0 rgba(0,0,0,0);}
}
.reel-wrap {
  position:relative; height: var(--reel-size); display:grid; place-items:center; border-radius:16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(235,235,235,0.9));
  box-shadow: inset 0 3px 12px rgba(0,0,0,0.08), 0 10px 24px rgba(0,0,0,0.06);
  overflow:hidden;
}
html.dark-mode .reel-wrap {
  background: linear-gradient(180deg, rgba(80,80,80,0.96), rgba(50,50,50,0.9));
  box-shadow: inset 0 3px 14px rgba(0,0,0,0.35), 0 10px 24px rgba(0,0,0,0.18);
}
.reel { font-family:'Orbitron',sans-serif; font-size:48px; line-height:1; user-select:none;
  transition: filter 160ms ease, transform 160ms ease; text-shadow: 0 1px 0 rgba(255,255,255,0.6), 0 4px 16px rgba(0,0,0,0.15);
}
.reel.spinning { filter: blur(1px) saturate(1.2); animation: glow 480ms ease-in-out infinite alternate; }
@keyframes glow { from{ text-shadow:0 1px 0 rgba(255,255,255,.5), 0 0 8px rgba(0,0,0,.15);} to{ text-shadow:0 1px 0 rgba(255,255,255,.85), 0 0 18px rgba(0,0,0,.25);} }
.reel.settled { filter:none; }
.slot-actions { display:flex; justify-content:center; margin:16px 0 6px; }
.slot-actions .btn { min-width: 180px; }
.result-area { margin-top:8px; padding:10px 12px; border-radius:12px; background: rgba(0,0,0,0.03); border:1px solid rgba(0,0,0,0.06); font-size:.95rem; }
html.dark-mode .result-area { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.08); }
.result-line { display:flex; gap:10px; align-items:baseline; margin:4px 0; }
.result-line .muted { opacity:.7; min-width:90px; }
.result-line .nums { font-family:'Orbitron',sans-serif; letter-spacing:2px; }
.text-win { color:#2e7d32; }
.text-lose{ color:#c62828; }

/* ===== Cash O'Row ===== */
.cor-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(245,245,245,0.9));
  border:1px solid rgba(0,0,0,0.06); padding:14px;
}
html.dark-mode .cor-card { background: linear-gradient(180deg, rgba(56,56,56,0.95), rgba(44,44,44,0.95)); border-color: rgba(255,255,255,0.08); }
.cor-toolbar { display:flex; gap:10px; margin-bottom:12px; flex-wrap:wrap; justify-content:center; }
.cor-toolbar .btn, .cor-toolbar .btn-flat { min-width:160px; }
.cor-toolbar .disabled { pointer-events:none; opacity:.6; }

.cor-playarea { position:relative; min-height: 280px; display:grid; place-items:center; }
.cor-stage { width:100%; display:flex; justify-content:center; }
.cor-main {
  display:grid;
  grid-template-columns: auto max-content;
  grid-template-rows: auto 1fr;
  grid-template-areas: "spacer cols" "rows wrapper";
  column-gap:10px; row-gap:8px; align-items:start; justify-items:center;
  width:fit-content; margin:0 auto;
}
.cor-cols { grid-area:cols; display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.cor-rows { grid-area:rows; display:grid; grid-template-rows:repeat(3,1fr); gap:8px; width:72px; }
.cor-cells-wrapper { grid-area:wrapper; position:relative; width:min(100%, 380px); background:linear-gradient(180deg, rgba(255,255,255,.9), rgba(240,240,240,.9)); border:1px solid rgba(0,0,0,.06); border-radius:16px; padding:6px; }
html.dark-mode .cor-cells-wrapper { background: linear-gradient(180deg, rgba(70,70,70,.95), rgba(58,58,58,.95)); border-color: rgba(255,255,255,.08); }

.cor-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; width:100%; aspect-ratio:1/1; }
.cor-cell { aspect-ratio:1/1; display:grid; place-items:center; border-radius:12px; background:#111; color:#e6f2ff; box-shadow: inset 0 3px 9px rgba(0,0,0,.25); overflow:hidden; }
html.dark-mode .cor-cell { background:#0f0f0f; box-shadow: inset 0 3px 12px rgba(0,0,0,.45); }
.cor-num { font-family:'Orbitron',sans-serif; font-size:34px; user-select:none; }
.cor-cash-svg { width:40px; height:40px; }
.cor-cash-svg .bill { fill:#78c67a; stroke:#2e7d32; stroke-width:2; }
.cor-cash-svg .bill1{ opacity:.6; } .cor-cash-svg .bill2{ opacity:.8; } .cor-cash-svg .bill3{ opacity:1; }
.cor-cash-svg .seal{ fill:rgba(0,0,0,.25); }
html.dark-mode .cor-cash-svg .bill { fill:#66b267; stroke:#1b5e20; }
html.dark-mode .cor-cash-svg .seal{ fill:rgba(255,255,255,.25); }

.cor-overlay { position:absolute; left:0; top:0; pointer-events:auto; border-radius:12px; touch-action:none; }

.cor-row-reward, .cor-col-reward {
  background:#26292d; color:#e6f2ff; border:1px solid rgba(255,255,255,.1); border-radius:10px; padding:6px 10px; font-weight:700; text-align:center; display:grid; place-items:center;
}
html.dark-mode .cor-row-reward, html.dark-mode .cor-col-reward { background:#26292d; border-color:rgba(255,255,255,.15); }

.claim-ready { animation: claimPulse 1.2s ease-in-out infinite; }
@keyframes claimPulse { 0%{ box-shadow: 0 0 0 rgba(255,215,0,.0);} 50%{ box-shadow: 0 0 24px rgba(255,215,0,.45);} 100%{ box-shadow: 0 0 0 rgba(255,215,0,.0);} }

.cor-result { margin-top:10px; padding:8px 10px; border-radius:12px; background:rgba(0,0,0,.03); border:1px solid rgba(0,0,0,.06); }
html.dark-mode .cor-result { background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.08); }
.cor-rules { margin-top:12px; font-size:.92rem; opacity:.85; }

/* ===== Symbols ===== */
.sym-card { background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(245,245,245,0.9)); border:1px solid rgba(0,0,0,.06); padding:14px; }
html.dark-mode .sym-card { background: linear-gradient(180deg, rgba(56,56,56,0.95), rgba(44,44,44,0.95)); border-color: rgba(255,255,255,.08); }

.sym-main { display:grid; row-gap:8px; align-items:start; justify-items:center; width:fit-content; margin:0 auto; }
.sym-cells-wrapper { position:relative; width:min(100%, 380px); background:linear-gradient(180deg, rgba(255,255,255,.9), rgba(240,240,240,.9)); border:1px solid rgba(0,0,0,.06); border-radius:16px; padding:6px; }
html.dark-mode .sym-cells-wrapper { background: linear-gradient(180deg, rgba(70,70,70,.95), rgba(58,58,58,.95)); border-color: rgba(255,255,255,.08); }
.sym-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; width:100%; aspect-ratio:1/1; }
.sym-cell { aspect-ratio:1/1; display:grid; place-items:center; border-radius:12px; background:#111; color:#e6f2ff; box-shadow: inset 0 3px 9px rgba(0,0,0,.25); overflow:hidden; }
html.dark-mode .sym-cell { background:#0f0f0f; box-shadow: inset 0 3px 12px rgba(0,0,0,.45); }
.sym-overlay { position:absolute; left:0; top:0; pointer-events:auto; border-radius:12px; touch-action:none; }
.sym-svg { width:40px; height:40px; fill:currentColor; stroke:currentColor; stroke-width:2; }

/* Legend */
.sym-legend { display:grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap:10px; margin-top:12px; }
.sym-legend-item { display:grid; grid-template-columns:40px 1fr; align-items:center; gap:8px; padding:6px 8px; border:1px solid rgba(0,0,0,.08); border-radius:10px; background: rgba(0,0,0,.03); }
html.dark-mode .sym-legend-item { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.06); }
.sym-legend-val { font-weight:700; }

/* ===== All Around ===== */
.aa-card { background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(245,245,245,0.9)); border:1px solid rgba(0,0,0,.06); padding:14px; }
html.dark-mode .aa-card { background: linear-gradient(180deg, rgba(56,56,56,0.95), rgba(44,44,44,0.95)); border-color: rgba(255,255,255,.08); }
.aa-main { display:grid; row-gap:8px; align-items:start; justify-items:center; width:fit-content; margin:0 auto; }
.aa-cells-wrapper { position:relative; width:min(100%, 380px); background:linear-gradient(180deg, rgba(255,255,255,.9), rgba(240,240,240,.9)); border:1px solid rgba(0,0,0,.06); border-radius:16px; padding:6px; }
html.dark-mode .aa-cells-wrapper { background: linear-gradient(180deg, rgba(70,70,70,.95), rgba(58,58,58,.95)); border-color: rgba(255,255,255,.08); }
.aa-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; width:100%; aspect-ratio:1/1; }
.aa-cell { aspect-ratio:1/1; display:grid; place-items:center; border-radius:12px; background:#111; color:#e6f2ff; box-shadow: inset 0 3px 9px rgba(0,0,0,.25); overflow:hidden; }
html.dark-mode .aa-cell { background:#0f0f0f; box-shadow: inset 0 3px 12px rgba(0,0,0,.45); }
.aa-overlay { position:absolute; left:0; top:0; pointer-events:auto; border-radius:12px; touch-action:none; }

/* ===== Celebration Effects ===== */
.confetti-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.confetti-piece {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 2px;
  transform: translate3d(0, var(--startY, -16vh), 0) scale(var(--sx, 1)) rotate(var(--rot, 0deg));
  will-change: transform, opacity;
  animation-name: confettiFall;
  animation-timing-function: cubic-bezier(.2,.65,.2,1);
  animation-fill-mode: forwards;
}

@keyframes confettiFall {
  0% { transform: translate3d(0, var(--startY, -16vh), 0) scale(var(--sx, 1)) rotate(var(--rot, 0deg)); opacity: 0.85; }
  100% { transform: translate3d(var(--dx, 0vw), 110vh, 0) scale(var(--sx, 1)) rotate(calc(var(--rot, 0deg) + 720deg)); opacity: 0.95; }
}

.celebrate-shimmer {
  position: fixed; inset: 0; pointer-events:none; z-index: 9998;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(255,255,255,.35), rgba(255,255,255,0) 60%),
              radial-gradient(1200px 600px at 50% 110%, rgba(255,215,0,.25), rgba(255,215,0,0) 70%);
  animation: shimmerFade .9s ease-out forwards;
}
@keyframes shimmerFade { from{ opacity:0; } 20%{ opacity:1; } to{ opacity:0; } }

.result-icons .sym-svg { width: 24px; height: 24px; vertical-align: middle; }
.sym-mini .sym-svg { width: 24px; height: 24px; }

/* ===== Game Over Screen ===== */
.gameover-wrap {
  position: relative;
  min-height: 360px;
  padding: 32px 24px;
  display: grid;
  gap: 14px;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(120% 120% at 50% -20%, rgba(255, 0, 64, .10), rgba(0,0,0,.05) 60%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(245,245,245,.92));
  border: 1px solid rgba(0,0,0,.08);
}
html.dark-mode .gameover-wrap {
  background:
    radial-gradient(120% 120% at 50% -20%, rgba(255, 64, 96, .16), rgba(0,0,0,.12) 60%),
    linear-gradient(180deg, rgba(56,56,56,.95), rgba(38,38,38,.95));
  border-color: rgba(255,255,255,.08);
}
.go-title {
  font-size: clamp(28px, 7vw, 56px);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow:
    0 0 8px rgba(255,0,64,.35),
    0 0 22px rgba(255,64,128,.25);
  animation: goFlicker 2.2s infinite steps(2, end);
}
@keyframes goFlicker {
  0%, 19%, 21%, 100% { opacity: 1; filter: drop-shadow(0 0 6px rgba(255,0,64,.35)); }
  20% { opacity: .6; filter: none; }
}
.go-subtitle {
  opacity: .9;
  font-weight: 700;
}
.go-divider {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,0,64,.35), transparent);
  margin: 8px 0 2px;
}
.go-info .go-line { margin-bottom: 4px; }
.go-when {
  font-weight: 800;
  letter-spacing: .4px;
}
.go-countdown {
  font-size: clamp(26px, 6vw, 48px);
  letter-spacing: 2px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px dashed rgba(0,0,0,.25);
  background: rgba(0,0,0,.03);
}
html.dark-mode .go-countdown {
  border-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.05);
}
.go-note { max-width: 680px; }
