/* ============================================================
   AVIATOR CASINO — style.css
   Responsive: Mobile-first + Desktop
   ============================================================ */

/* ---- RESET & BASE ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red:        #e8003a;
  --red2:       #ff1a54;
  --red3:       #ff4d78;
  --gold:       #ffd700;
  --gold2:      #ffb300;
  --gold3:      #ffa500;
  --green:      #00e676;
  --teal:       #30fcbe;
  --blue:       #34b4ff;
  --purple:     #913ef8;
  --pink:       #c017b4;
  --dark:       #080810;
  --dark2:      #0f0f1a;
  --dark3:      #161626;
  --dark4:      #1e1e30;
  --dark5:      #252540;
  --border:     rgba(255,255,255,0.07);
  --text:       #e8e8ff;
  --text-dim:   rgba(255,255,255,0.4);
  --shadow-red: rgba(232,0,58,0.4);
  --shadow-gold:rgba(255,215,0,0.4);
  --radius:     16px;
  --radius-sm:  10px;
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--dark);
  font-family: 'Exo 2', 'Rajdhani', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--dark3); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 4px; }

/* Spinner number inputs */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ---- PARTICLES ---- */
#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFall 1.4s ease-out forwards;
}

@keyframes particleFall {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, -140px)) scale(0.2); opacity: 0; }
}

/* ---- STARS BACKGROUND ---- */
#stars-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: starTwinkle linear infinite;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.08; }
  50%       { opacity: 0.9; }
}

/* Ambient glow */
#stars-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 15% 60%, rgba(232,0,58,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 20%, rgba(48,252,190,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 90%, rgba(145,62,248,0.05) 0%, transparent 70%);
}

/* ---- MAIN WRAPPER ---- */
#wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- NAVBAR ---- */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(8,8,16,0.98) 0%, rgba(8,8,16,0.85) 100%);
  border-bottom: 1px solid rgba(232,0,58,0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 8px var(--red2));
  animation: planeBob 3s ease-in-out infinite;
}

@keyframes planeBob {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%       { transform: translateY(-4px) rotate(2deg); }
}

.logo-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.logo-accent {
  color: var(--red2);
  text-shadow: 0 0 16px var(--red2), 0 0 32px var(--red);
}

#nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#nav-balance-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

#balance-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-family: 'Rajdhani', sans-serif;
}

#balance-amount {
  display: flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,180,0,0.06));
  border: 1px solid rgba(255,215,0,0.35);
  border-radius: 20px;
  padding: 4px 12px 4px 10px;
  box-shadow: 0 0 12px rgba(255,180,0,0.12), inset 0 1px 0 rgba(255,255,255,0.06);
}

#currency-sign {
  font-size: 13px;
  color: var(--gold2);
  font-weight: 700;
}

#balance-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255,215,0,0.5);
  transition: color var(--transition);
}

#balance-value.updated {
  animation: balanceFlash 0.5s ease;
}

@keyframes balanceFlash {
  0%, 100% { color: var(--gold); }
  50%       { color: #fff; text-shadow: 0 0 20px var(--gold); }
}

#nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--dark4);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

/* ---- MID WRAPPER ---- */
#mid-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* ---- HISTORY BAR ---- */
#header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#history-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  white-space: nowrap;
  font-family: 'Rajdhani', sans-serif;
  text-transform: uppercase;
}

#last-counters {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}

#last-counters::-webkit-scrollbar { display: none; }

#last-counters p {
  padding: 3px 11px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'Exo 2', sans-serif;
  transition: transform 0.15s;
  cursor: default;
}

#last-counters p:hover { transform: scale(1.08); }

/* Chip styles */
.blueBorder {
  color: var(--blue);
  border-color: var(--blue);
  background: rgba(52,180,255,0.07);
  text-shadow: 0 0 8px rgba(52,180,255,0.4);
}

.purpleBorder {
  color: var(--purple);
  border-color: var(--purple);
  background: rgba(145,62,248,0.07);
  text-shadow: 0 0 8px rgba(145,62,248,0.4);
}

.burgundyBorder {
  color: var(--gold);
  border-color: var(--gold2);
  background: rgba(255,215,0,0.07);
  text-shadow: 0 0 8px rgba(255,215,0,0.5);
  box-shadow: 0 0 8px rgba(255,180,0,0.15);
}

/* Chip enter animation */
@keyframes chipSlide {
  from { transform: translateX(-20px) scale(0.7); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}

.chip-new { animation: chipSlide 0.35s cubic-bezier(0.34,1.56,0.64,1); }

/* ---- CANVAS / GAME AREA ---- */
#counterWrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, #0c0c1a 0%, #080810 100%);
  border: 1px solid rgba(232,0,58,0.18);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 4px 40px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.04);
  /* height via aspect-ratio + min/max */
  aspect-ratio: 2.2 / 1;
  min-height: 200px;
  max-height: 420px;
}

/* Rotating bg image */
#bg-image {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 0;
}

#bg-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('./aviator-re-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: rotation 10s infinite linear;
  transform-origin: 50% 50%;
  opacity: 0.12;
}

@keyframes rotation {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Grid overlay */
#grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(232,0,58,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,0,58,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* Canvas */
#canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 5;
  display: block;
}

/* Multiplier counter */
#counter-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  pointer-events: none;
}

#counter {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(32px, 7vw, 62px);
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 0 20px rgba(255,255,255,0.7),
    0 0 50px rgba(232,0,58,0.3);
  line-height: 1;
  transition: color 0.3s, text-shadow 0.3s;
  letter-spacing: -1px;
}

#counter.multiplying {
  color: #fff;
  text-shadow: 0 0 30px rgba(255,255,255,0.8), 0 0 60px rgba(255,80,80,0.5);
}

#counter.high {
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255,215,0,0.9), 0 0 60px rgba(255,180,0,0.5);
  animation: counterPulse 0.4s ease infinite alternate;
}

@keyframes counterPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.04); }
}

#counter.crashed {
  color: var(--red2);
  text-shadow: 0 0 30px var(--red2), 0 0 60px var(--red);
}

#counter-sub {
  font-size: clamp(8px, 1.5vw, 11px);
  letter-spacing: 4px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  font-family: 'Rajdhani', sans-serif;
  margin-top: 4px;
}

/* ---- CRASH SCREEN ---- */
#crash-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(232,0,58,0.08);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#crash-screen.show { display: flex; }

.crash-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 900;
  color: var(--red2);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 20px var(--red2), 0 0 40px var(--red);
  animation: crashPulse 0.6s ease infinite alternate;
}

@keyframes crashPulse {
  from { opacity: 0.7; transform: scale(0.97); }
  to   { opacity: 1;   transform: scale(1.02); }
}

#crash-value {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(28px, 6vw, 52px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px rgba(255,255,255,0.5);
}

/* ---- WAITING SCREEN ---- */
#waiting-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#waiting-screen.show { display: flex; }

.wait-label {
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  font-family: 'Rajdhani', sans-serif;
}

.wait-sublabel {
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.25);
  font-family: 'Rajdhani', sans-serif;
}

#countdown-circle {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#countdown-svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

#countdown-ring {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.95s linear;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.6));
}

#countdown-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255,215,0,0.7);
  position: relative;
  z-index: 1;
}

/* ---- LIVE BET INDICATOR ---- */
#live-bet-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(0,230,118,0.08), rgba(0,230,118,0.04));
  border: 1px solid rgba(0,230,118,0.25);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  animation: liveGlow 2s ease infinite alternate;
}

#live-bet-indicator.hidden { display: none; }

@keyframes liveGlow {
  from { box-shadow: none; }
  to   { box-shadow: 0 0 12px rgba(0,230,118,0.15); }
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: dotPulse 1s ease infinite;
  flex-shrink: 0;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.5; }
}

#live-bet-text { flex: 1; }

#live-multiplier-mini {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.4);
}

/* ---- BOTTOM WRAPPER ---- */
#bottom-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- QUICK AMOUNTS ---- */
#quick-amounts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
#quick-amounts::-webkit-scrollbar { display: none; }

.quick-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  white-space: nowrap;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  flex-shrink: 0;
}

.quick-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'Exo 2', sans-serif;
  transition: all var(--transition);
}

.quick-btn:hover,
.quick-btn:active {
  border-color: var(--gold2);
  color: var(--gold);
  background: rgba(255,180,0,0.08);
  box-shadow: 0 0 8px rgba(255,180,0,0.15);
}

.quick-max {
  border-color: rgba(232,0,58,0.35);
  color: var(--red3);
  background: rgba(232,0,58,0.06);
}

.quick-max:hover,
.quick-max:active {
  border-color: var(--red2);
  color: #fff;
  background: rgba(232,0,58,0.15);
  box-shadow: 0 0 10px rgba(232,0,58,0.25);
}

/* ---- BET ROW ---- */
#bet-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

/* ---- INPUT ---- */
#input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

#input-currency {
  position: absolute;
  left: 13px;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold2);
  pointer-events: none;
  z-index: 2;
}

#bet-input {
  width: 100%;
  padding: 13px 52px 13px 30px;
  background: var(--dark4);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  font-family: 'Orbitron', sans-serif;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

#bet-input:focus {
  border-color: var(--red2);
  box-shadow: 0 0 0 3px rgba(232,0,58,0.12), inset 0 0 8px rgba(232,0,58,0.05);
}

#bet-input::placeholder { color: rgba(255,255,255,0.2); }

#input-controls {
  position: absolute;
  right: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.input-ctrl {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
  padding: 0;
}

.input-ctrl:hover {
  background: rgba(232,0,58,0.2);
  border-color: var(--red2);
  color: #fff;
}

/* ---- BET BUTTON ---- */
#bet-button {
  min-width: 110px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Shine sweep */
#bet-button::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.4s ease;
  pointer-events: none;
}

#bet-button:hover::after { left: 150%; }

#bet-button:active { transform: scale(0.97); }

#btn-icon {
  font-size: 18px;
  line-height: 1;
}

#btn-text {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  line-height: 1;
}

#btn-sub {
  font-size: 9px;
  letter-spacing: 2px;
  opacity: 0.7;
  font-family: 'Rajdhani', sans-serif;
}

/* State: waiting (disabled) */
#bet-button.btn-state-wait {
  background: var(--dark5);
  color: rgba(255,255,255,0.25);
  cursor: not-allowed;
  box-shadow: none;
}

/* State: place bet */
#bet-button.btn-state-bet {
  background: linear-gradient(145deg, #ff1a54 0%, #c8002e 100%);
  color: #fff;
  box-shadow:
    0 4px 20px rgba(232,0,58,0.5),
    0 0 0 1px rgba(255,80,100,0.2),
    inset 0 1px 0 rgba(255,255,255,0.2);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

#bet-button.btn-state-bet:hover {
  box-shadow: 0 6px 30px rgba(232,0,58,0.7), 0 0 0 1px rgba(255,80,100,0.3);
  transform: translateY(-1px);
}

/* State: cash out */
#bet-button.btn-state-cashout {
  background: linear-gradient(145deg, #ffd700 0%, #ff8c00 100%);
  color: #000;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  box-shadow: 0 4px 24px rgba(255,180,0,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
  animation: cashoutPulse 0.7s ease infinite alternate;
}

@keyframes cashoutPulse {
  from { box-shadow: 0 4px 20px rgba(255,180,0,0.4); }
  to   { box-shadow: 0 6px 36px rgba(255,180,0,0.85), 0 0 0 4px rgba(255,215,0,0.15); }
}

/* State: cancel bet (during waiting phase, bet placed) */
#bet-button.btn-state-cancel {
  background: linear-gradient(145deg, #555570, #3a3a50);
  color: rgba(255,255,255,0.7);
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.1);
}

/* ---- MESSAGE ---- */
#message-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 26px;
}

#message-icon { font-size: 14px; }

#message {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
  transition: color 0.3s;
}

#message.msg-info     { color: rgba(255,255,255,0.38); }
#message.msg-wait     { color: var(--teal); }
#message.msg-placed   { color: var(--blue); }
#message.msg-win      {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
  animation: msgPop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
#message.msg-lose     { color: var(--red3); }
#message.msg-flying   { color: rgba(255,255,255,0.5); }

@keyframes msgPop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---- STATS ROW ---- */
#stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.stat-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
}

.stat-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.stat-val.gold {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
}

.stat-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---- WIN OVERLAY ---- */
#win-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlayIn 0.3s ease;
}

#win-overlay.hidden { display: none; }

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#win-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: winBounce 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes winBounce {
  from { transform: scale(0.3) rotate(-10deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.win-crown { font-size: 52px; }

.win-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255,215,0,0.8);
  letter-spacing: 4px;
}

#win-amount {
  font-family: 'Orbitron', sans-serif;
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 40px rgba(255,255,255,0.5);
}

#win-mult {
  font-size: 18px;
  color: rgba(255,255,255,0.5);
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 2px;
}

/* ---- UTILITY ---- */
.hidden { display: none !important; }

/* ============================================================
   DESKTOP LAYOUT (≥ 768px)
   ============================================================ */
@media (min-width: 768px) {
  #navbar {
    padding: 12px 32px;
  }

  .logo-text { font-size: 24px; letter-spacing: 5px; }
  .logo-icon { font-size: 26px; }

  #balance-value { font-size: 16px; }

  #mid-wrapper {
    padding: 16px 32px 28px;
    gap: 14px;
  }

  #history-label { font-size: 11px; }
  #last-counters p { font-size: 14px; padding: 4px 14px; }

  #counterWrapper {
    aspect-ratio: 2.8 / 1;
    max-height: 460px;
    min-height: 260px;
  }

  #counter {
    font-size: clamp(40px, 5vw, 72px);
  }

  #bottom-wrapper {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
  }

  #quick-amounts {
    flex-direction: column;
    gap: 6px;
    overflow: visible;
    flex-shrink: 0;
    width: 70px;
  }

  .quick-label { margin-bottom: 2px; }

  .quick-btn {
    width: 100%;
    text-align: center;
    padding: 6px 4px;
    font-size: 11px;
  }

  #bet-row {
    flex: 1;
    gap: 12px;
  }

  #bet-button {
    min-width: 130px;
    padding: 0 24px;
  }

  #btn-text { font-size: 14px; }

  #stats-row {
    padding: 12px 24px;
  }

  .stat-label { font-size: 10px; }
  .stat-val { font-size: 16px; }
}

@media (min-width: 1200px) {
  #mid-wrapper {
    padding: 20px 48px 36px;
  }

  #counterWrapper {
    aspect-ratio: 3.2 / 1;
  }
}

/* ============================================================
   SMALL PHONES (< 360px)
   ============================================================ */
@media (max-width: 360px) {
  .logo-text { font-size: 17px; letter-spacing: 2px; }
  #bet-button { min-width: 90px; padding: 0 12px; }
  #btn-text { font-size: 11px; }
  #stats-row { padding: 8px 10px; }
  .stat-val { font-size: 12px; }
}
