/* ════════════════════════════════════════════════════════════
   NEON CROSS — style.css
   Luxury cyberpunk casino theme
   ════════════════════════════════════════════════════════════ */

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

:root {
  --bg:          #03060f;
  --bg2:         #070b18;
  --neon-cyan:   #00f5ff;
  --neon-pink:   #ff1493;
  --neon-purple: #b026ff;
  --neon-gold:   #ffd700;
  --neon-green:  #00ff9d;
  --neon-red:    #ff2244;
  --panel:       rgba(7, 11, 24, 0.94);
  --border:      rgba(0, 245, 255, 0.20);
  --font-main:   'Vazirmatn', 'Orbitron', sans-serif;
  --font-mono:   'Share Tech Mono', 'Vazirmatn', monospace;
  --font-display:'Orbitron', sans-serif;
  --radius:      12px;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #0a0f24 0%, var(--bg) 70%);
  color: #dce8ff;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#ui-root {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  z-index: 2;
}

/* ── Scanlines + Vignette ─────────────────────────────────────── */
#scanlines {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0, transparent 3px,
    rgba(0,0,0,0.07) 3px, rgba(0,0,0,0.07) 4px);
  animation: flicker 9s infinite;
}
#vignette {
  position: fixed; inset: 0; z-index: 99; pointer-events: none;
  box-shadow: inset 0 0 180px 40px rgba(0,0,0,0.7);
}
@keyframes flicker {
  0%,95%,100% { opacity: 1; } 96% { opacity: .82; } 97% { opacity: 1; } 98% { opacity: .9; }
}

/* ── Top HUD ──────────────────────────────────────────────────── */
#hud-top {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 9px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: 0 4px 30px rgba(0,245,255,0.06);
}
.hud-logo { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.logo-icon {
  font-size: 24px; filter: drop-shadow(0 0 10px var(--neon-cyan));
  animation: bob 1.4s ease-in-out infinite;
}
@keyframes bob { 0%,100%{transform:translateY(0) rotate(-5deg)} 50%{transform:translateY(-4px) rotate(5deg)} }
.logo-text {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 900; letter-spacing: 3px; color: var(--neon-cyan);
  text-shadow: 0 0 14px var(--neon-cyan), 0 0 30px rgba(0,245,255,.4);
}
.logo-text em {
  font-style: normal; color: var(--neon-pink);
  text-shadow: 0 0 14px var(--neon-pink), 0 0 30px rgba(255,20,147,.4);
}
.hud-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stat-chip {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 5px 12px; min-width: 86px;
  background: rgba(0,245,255,.04);
  border: 1px solid var(--border); border-radius: 8px;
}
.stat-label { font-size: 7px; letter-spacing: 2px; color: rgba(0,245,255,.5); font-family: var(--font-mono); }
.stat-value {
  font-size: 14px; font-weight: 700; color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan); font-family: var(--font-mono);
  transition: color .3s, text-shadow .3s;
}
.hud-stats .stat-chip:nth-child(2) .stat-value { color: var(--neon-gold); text-shadow: 0 0 10px var(--neon-gold); }
.hud-stats .stat-chip:nth-child(3) .stat-value { color: var(--neon-green); text-shadow: 0 0 10px var(--neon-green); }

/* multiplier pop animation */
.stat-value.bump { animation: bump .35s ease; }
@keyframes bump { 0%{transform:scale(1)} 50%{transform:scale(1.25)} 100%{transform:scale(1)} }

/* ── Canvas ───────────────────────────────────────────────────── */
#canvas-wrap {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
#canvas-wrap canvas { display: block; }

/* ── Controls ─────────────────────────────────────────────────── */
#controls {
  flex-shrink: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 9px 14px 12px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: 0 -4px 30px rgba(0,245,255,0.06);
}

/* Bet row */
#bet-row { display: flex; align-items: center; gap: 7px; }
.bet-input-wrap {
  flex: 1; display: flex; align-items: center;
  background: rgba(0,245,255,.04);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.bet-input-wrap:focus-within {
  border-color: var(--neon-cyan); box-shadow: 0 0 16px rgba(0,245,255,.25);
}
.bet-prefix { padding: 0 12px; font-family: var(--font-mono); font-size: 15px; color: var(--neon-cyan); opacity: .65; }
#bet-input {
  flex: 1; background: transparent; border: none; outline: none; color: #fff;
  font-family: var(--font-mono); font-size: 19px; font-weight: 700;
  padding: 9px 12px 9px 0; text-align: center; -moz-appearance: textfield; min-width: 0;
}
#bet-input::-webkit-outer-spin-button, #bet-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Difficulty */
#diff-row { display: flex; gap: 4px; background: rgba(0,0,0,.3); border-radius: var(--radius); padding: 3px; }
.diff-btn {
  flex: 1; padding: 7px 4px; border: none; border-radius: 9px;
  background: transparent; color: rgba(255,255,255,.32);
  font-family: var(--font-main); font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s;
}
.diff-btn:hover { color: rgba(255,255,255,.7); background: rgba(255,255,255,.04); }
.diff-btn.active {
  color: var(--neon-cyan); background: rgba(0,245,255,.08);
  border-bottom-color: var(--neon-cyan); text-shadow: 0 0 8px var(--neon-cyan);
}

/* Action row */
#action-row { display: flex; gap: 8px; }
.ctrl-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 16px; border: none; border-radius: var(--radius);
  font-family: var(--font-main); font-size: 13px; font-weight: 900; letter-spacing: 2px;
  cursor: pointer; transition: all .15s; position: relative; overflow: hidden;
}
.ctrl-btn::after {
  content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.12);
  opacity: 0; transition: opacity .15s;
}
.ctrl-btn:hover::after { opacity: 1; }
.ctrl-btn:active { transform: scale(.97); }
.ctrl-btn:disabled { opacity: .45; cursor: not-allowed; }
.ctrl-btn:disabled::after { opacity: 0; }

.ctrl-btn.ghost {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  color: #9fb0cc; padding: 13px 14px; font-size: 11px; letter-spacing: 1px;
}
.ctrl-btn.primary {
  flex: 1; background: linear-gradient(135deg,#00c8ff,#0044ff); color: #fff;
  box-shadow: 0 0 22px rgba(0,200,255,.45), inset 0 1px 0 rgba(255,255,255,.25);
}
.ctrl-btn.primary:hover { box-shadow: 0 0 34px rgba(0,200,255,.7), inset 0 1px 0 rgba(255,255,255,.25); }
.ctrl-btn.gold {
  flex: 1; background: linear-gradient(135deg,#ffd700,#ff8c00); color: #07080f;
  box-shadow: 0 0 22px rgba(255,215,0,.45);
}
.ctrl-btn.gold:hover { box-shadow: 0 0 38px rgba(255,215,0,.75); }
.ctrl-btn.neon {
  flex: 1; background: linear-gradient(135deg,#00ff9d,#00c860); color: #07080f;
  box-shadow: 0 0 22px rgba(0,255,157,.45);
}
.ctrl-btn.neon:hover { box-shadow: 0 0 38px rgba(0,255,157,.75); }
.ctrl-btn.neon.spinning::before {
  content: ''; position: absolute; inset: -3px; border-radius: 14px; z-index: -1;
  background: conic-gradient(from 0deg,#00ff9d,#00f5ff,#ff1493,#ffd700,#00ff9d);
  animation: spin-ring 1.3s linear infinite;
}
@keyframes spin-ring { from{transform:rotate(0)} to{transform:rotate(360deg)} }
.btn-icon { font-size: 16px; }

/* History */
#history-strip { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.hist-label { font-size: 8px; letter-spacing: 2px; color: rgba(255,255,255,.25); font-family: var(--font-mono); white-space: nowrap; }
#history-pills { display: flex; gap: 4px; overflow: hidden; }
.hist-pill {
  font-size: 9px; font-weight: 700; padding: 3px 9px; border-radius: 6px;
  font-family: var(--font-mono); animation: pill-in .25s ease; white-space: nowrap;
}
@keyframes pill-in { from{transform:scale(.6) translateX(-10px);opacity:0} to{transform:scale(1) translateX(0);opacity:1} }
.hist-pill.win  { background: rgba(0,255,157,.12); color: var(--neon-green); border: 1px solid rgba(0,255,157,.28); }
.hist-pill.lose { background: rgba(255,34,68,.12); color: var(--neon-red); border: 1px solid rgba(255,34,68,.28); }

/* ── Result Overlay ───────────────────────────────────────────── */
#result-overlay {
  position: fixed; inset: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center;
  background: rgba(3,6,15,.78); backdrop-filter: blur(7px); animation: fade .2s ease;
}
#result-overlay.hidden { display: none; }
@keyframes fade { from{opacity:0} to{opacity:1} }
#result-card {
  text-align: center; padding: 38px 52px;
  background: rgba(7,11,24,.97); border-radius: 22px; border: 1px solid var(--border);
  box-shadow: 0 0 70px rgba(0,245,255,.22); animation: pop .45s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop { from{transform:scale(.5) translateY(30px);opacity:0} to{transform:scale(1) translateY(0);opacity:1} }
#result-icon { font-size: 60px; margin-bottom: 14px; line-height: 1; filter: drop-shadow(0 0 18px currentColor); }
#result-title { font-size: 30px; font-weight: 900; letter-spacing: 4px; margin-bottom: 10px; }
#result-sub { font-size: 14px; font-family: var(--font-mono); color: rgba(255,255,255,.55); }

.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .logo-text { font-size: 13px; letter-spacing: 2px; }
  .hud-stats { gap: 5px; }
  .stat-chip { min-width: 66px; padding: 4px 8px; }
  .stat-value { font-size: 12px; }
  .ctrl-btn.ghost { padding: 13px 9px; font-size: 10px; }
  #result-card { padding: 26px 30px; }
  #result-title { font-size: 23px; }
}
