/* ========================================
   MALINARIUM CYBERPUNK — Modern Design v2
   ======================================== */

:root {
  --bg-primary: #0a0408;
  --bg-secondary: #14080f;
  --bg-tertiary: #1a0d15;
  
  --neon-cyan: #00f6ff;
  --neon-cyan-light: #33ffff;
  --neon-pink: #ff00d0;
  --neon-pink-light: #ff33e6;
  --neon-purple: #b800ff;
  --neon-purple-light: #d433ff;
  --neon-yellow: #ffd400;
  --neon-green: #00ff99;
  --neon-orange: #ff6b35;
  
  --text-primary: #f0f5ff;
  --text-secondary: #a8b0ff;
  --text-tertiary: #7a8299;
  
  --accent-gradient: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
  --accent-gradient-v: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
  --glow-cyan: 0 0 30px rgba(0, 246, 255, 0.4), 0 0 60px rgba(0, 246, 255, 0.2);
  --glow-pink: 0 0 30px rgba(255, 0, 208, 0.4), 0 0 60px rgba(255, 0, 208, 0.2);
  
  --smooth: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth-ease: cubic-bezier(0.4, 0, 0.2, 1);
  
  --safe-area-bottom: env(safe-area-inset-bottom);
  --safe-area-top: env(safe-area-inset-top);
}

/* ===== BASE RESET ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'Space Grotesk', 'Orbitron', 'JetBrains Mono', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ===== BACKGROUND LAYERS ===== */
.bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  overflow: hidden;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(0deg, rgba(0, 246, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 246, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
  0% { transform: translateY(0); }
  100% { transform: translateY(50px); }
}

.bg-nebula {
  position: absolute;
  inset: -20% -20% auto auto;
  width: 180%;
  height: 180%;
  background: radial-gradient(800px 600px at 15% 20%, rgba(0, 246, 255, 0.15), transparent 15%),
              radial-gradient(700px 500px at 85% 80%, rgba(255, 0, 208, 0.12), transparent 15%),
              radial-gradient(600px 400px at 50% 50%, rgba(184, 0, 255, 0.08), transparent 20%);
  filter: blur(50px) saturate(150%);
  mix-blend-mode: screen;
  animation: nebulaFlow 30s ease-in-out infinite;
}

@keyframes nebulaFlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10px, -10px) scale(1.05); }
}

.bg-glow-1 {
  position: absolute;
  width: 600px;
  height: 600px;
  top: -20%;
  left: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 246, 255, 0.2), transparent 70%);
  filter: blur(60px);
  animation: pulse1 8s ease-in-out infinite;
}

@keyframes pulse1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 50px) scale(1.2); }
}

.bg-glow-2 {
  position: absolute;
  width: 500px;
  height: 500px;
  bottom: -15%;
  right: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 0, 208, 0.15), transparent 70%);
  filter: blur(60px);
  animation: pulse2 9s ease-in-out infinite;
}

@keyframes pulse2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -50px) scale(1.15); }
}

.bg-scanlines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px
  );
  background-size: 100% 4px;
  opacity: 0.1;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ===== APP CONTAINER ===== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ===== HEADER ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-area-top)) 16px 12px;
  background: linear-gradient(180deg, rgba(10, 4, 8, 0.8), rgba(20, 8, 15, 0.6));
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 246, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 246, 255, 0.05) inset;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 1 auto;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  background: var(--accent-gradient);
  box-shadow: var(--glow-cyan);
  border: 2px solid rgba(0, 246, 255, 0.3);
  flex-shrink: 0;
  transition: all 0.3s var(--smooth-ease);
}

.avatar:hover {
  transform: scale(1.08);
  box-shadow: var(--glow-cyan), 0 0 40px rgba(0, 246, 255, 0.6);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--neon-cyan);
  font-weight: 700;
}

.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 2px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(0, 246, 255, 0.2);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: 0 0 15px var(--neon-pink);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
}

.balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 246, 255, 0.1), rgba(255, 0, 208, 0.05));
  border: 1px solid rgba(0, 246, 255, 0.2);
  backdrop-filter: blur(10px);
}

.balance-rate {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.balance-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 900;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.balance-unit {
  font-size: 11px;
  opacity: 0.8;
}

.header-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(0, 246, 255, 0.2);
  background: linear-gradient(180deg, rgba(0, 246, 255, 0.1), rgba(0, 246, 255, 0.05));
  color: var(--neon-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s var(--smooth-ease);
  text-decoration: none;
}

.btn-icon:hover {
  background: linear-gradient(180deg, rgba(0, 246, 255, 0.2), rgba(0, 246, 255, 0.1));
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.btn-icon.exit {
  color: var(--neon-yellow);
  border-color: rgba(255, 212, 0, 0.2);
}

/* ===== TICKER ===== */
.ticker-strip {
  background: linear-gradient(90deg, rgba(0, 246, 255, 0.05), transparent, rgba(255, 0, 208, 0.05));
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  border-radius: 0;
}

.ticker-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 0;
}

.ticker-scroll::-webkit-scrollbar {
  display: none;
}

.ticker-item {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.12), rgba(255, 0, 208, 0.08));
  border: 1px solid rgba(0, 246, 255, 0.15);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  animation: tickerGlow 2s ease-in-out infinite;
}

@keyframes tickerGlow {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 15px rgba(0, 246, 255, 0.3); }
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  padding-bottom: calc(90px + var(--safe-area-bottom));
  scroll-behavior: smooth;
}

.main-content::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
  background: rgba(0, 246, 255, 0.2);
  border-radius: 3px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 246, 255, 0.4);
}

/* ===== PAGE SECTIONS ===== */
.view-section {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s var(--smooth-ease), transform 0.3s var(--smooth-ease);
  animation: none;
}

.view-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: sectionIn 0.4s var(--smooth);
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 20px;
  position: relative;
}

.page-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 900;
  letter-spacing: -1px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.title-accent {
  width: 60px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 2px;
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.5);
  animation: slideIn 0.5s var(--smooth-ease);
}

@keyframes slideIn {
  from {
    width: 0;
  }
  to {
    width: 60px;
  }
}

/* ===== CARDS ===== */
.card {
  background: linear-gradient(135deg, rgba(20, 8, 15, 0.4), rgba(10, 4, 8, 0.6));
  border: 1px solid rgba(0, 246, 255, 0.15);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s var(--smooth-ease);
  overflow: hidden;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.05), transparent, rgba(255, 0, 208, 0.05));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--smooth-ease);
}

.card:hover {
  border-color: rgba(0, 246, 255, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 30px rgba(0, 246, 255, 0.15);
  transform: translateY(-2px);
}

.card:hover::before {
  opacity: 1;
}

/* ===== CARDS GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== BONUS CARD ===== */
.bonus-card {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 18px 16px;
  background: linear-gradient(135deg, rgba(255, 212, 0, 0.15), rgba(255, 0, 208, 0.1));
  border: 1.5px solid rgba(255, 212, 0, 0.25);
}

.bonus-card:hover {
  border-color: rgba(255, 212, 0, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 212, 0, 0.2);
}

.card-icon {
  font-size: 32px;
  line-height: 1;
}

.bonus-text {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bonus-amount {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(90deg, var(--neon-yellow), var(--neon-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bonus-terms {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ===== STATS CARD ===== */
.stats-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px 12px;
}

.stat-icon {
  font-size: 28px;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-big {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  font-weight: 900;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-desc {
  font-size: 11px;
  color: var(--text-tertiary);
}

.progress-mini {
  width: 100%;
  height: 6px;
  background: rgba(0, 246, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent-gradient);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.6);
  transition: width 1s var(--smooth-ease);
  border-radius: 3px;
}

/* ===== INFO CARD ===== */
.info-card {
  grid-column: 1 / -1;
}

.info-header {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: rgba(0, 246, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(0, 246, 255, 0.1);
}

.info-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 700;
}

.info-value {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 900;
  color: var(--neon-cyan);
}

/* ===== GAME TERMINAL CARD ===== */
.game-card {
  position: relative;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.08), rgba(255, 0, 208, 0.05));
  border: 2px solid rgba(0, 246, 255, 0.25);
}

.crash-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.terminal-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.display-multiplier {
  font-family: 'Orbitron', monospace;
  font-size: clamp(40px, 10vw, 72px);
  font-weight: 900;
  background: conic-gradient(from 180deg, var(--neon-cyan), var(--neon-pink), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(0, 246, 255, 0.3);
  animation: pulseMultiplier 0.6s ease-out;
}

@keyframes pulseMultiplier {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.win-indicator {
  position: absolute;
  bottom: 16px;
  right: 16px;
  padding: 8px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(0, 255, 153, 0.15), rgba(0, 255, 153, 0.08));
  color: var(--neon-green);
  font-weight: 900;
  border: 1px solid rgba(0, 255, 153, 0.2);
  font-family: 'Orbitron', monospace;
  display: none;
}

.game-text {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ===== PLAY BUTTON ===== */
.btn-play {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: var(--accent-gradient);
  color: #000;
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s var(--smooth);
  box-shadow: 0 10px 40px rgba(0, 246, 255, 0.3), 0 0 60px rgba(0, 246, 255, 0.2) inset;
  text-transform: uppercase;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.btn-play::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 50px rgba(0, 246, 255, 0.4), 0 0 80px rgba(0, 246, 255, 0.3) inset;
}

.btn-play:hover::before {
  transform: translateX(100%);
}

.btn-play:active {
  transform: translateY(0);
}

.btn-play:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== PRIMARY BUTTON ===== */
.btn-primary {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: var(--accent-gradient);
  color: #000;
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--smooth-ease);
  box-shadow: 0 8px 30px rgba(0, 246, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0, 246, 255, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* ===== BET SECTION ===== */
.bet-section {
  padding: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 246, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s var(--smooth-ease);
  margin-bottom: 10px;
}

.input-field:focus {
  outline: none;
  border-color: rgba(0, 246, 255, 0.4);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.15);
}

.btn-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-quick {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 246, 255, 0.15);
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.08), rgba(255, 0, 208, 0.05));
  color: var(--neon-cyan);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--smooth-ease);
  text-transform: uppercase;
}

.btn-quick:hover {
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.15), rgba(255, 0, 208, 0.1));
  border-color: rgba(0, 246, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 246, 255, 0.2);
}

.btn-quick:active {
  transform: scale(0.95);
}

/* ===== TARGET SECTION ===== */
.target-section {
  padding: 14px;
}

.target-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.btn-target {
  flex: 1;
  min-width: 60px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 246, 255, 0.15);
  background: rgba(0, 246, 255, 0.05);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s var(--smooth-ease);
  text-transform: uppercase;
}

.btn-target:hover {
  border-color: rgba(0, 246, 255, 0.3);
  background: rgba(0, 246, 255, 0.1);
}

.btn-target.active {
  background: var(--accent-gradient);
  color: #000;
  border-color: rgba(0, 246, 255, 0.5);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.3);
}

.chance-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(0, 246, 255, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(0, 246, 255, 0.1);
}

.chance-display span:first-child {
  font-size: 12px;
  color: var(--text-tertiary);
}

.chance-value {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  color: var(--neon-cyan);
}

/* ===== HISTORY SECTION ===== */
.history-section {
  padding: 14px;
}

.history-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-badge {
  padding: 6px 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.1), rgba(255, 0, 208, 0.05));
  border: 1px solid rgba(0, 246, 255, 0.15);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 11px;
  color: var(--neon-yellow);
  transition: all 0.2s var(--smooth-ease);
}

.history-badge:hover {
  border-color: rgba(0, 246, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 246, 255, 0.2);
}

/* ===== STAKE CARD ===== */
.stake-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 20px;
}

.stake-icon {
  font-size: 40px;
  line-height: 1;
}

.stake-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.stake-yield {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.period-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.btn-period {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 246, 255, 0.15);
  background: rgba(0, 246, 255, 0.05);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s var(--smooth-ease);
  text-transform: uppercase;
}

.btn-period:hover {
  border-color: rgba(0, 246, 255, 0.3);
  background: rgba(0, 246, 255, 0.1);
}

.btn-period.active {
  background: var(--accent-gradient);
  color: #000;
  border-color: rgba(0, 246, 255, 0.5);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.3);
}

/* ===== WAGER CARD ===== */
.wager-card {
  border-color: rgba(255, 0, 208, 0.2);
}

.wager-header {
  font-size: 13px;
  font-weight: 800;
  color: var(--neon-pink);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.wager-text {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  color: var(--neon-pink);
  margin-bottom: 8px;
}

.wager-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 0, 208, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.wager-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-orange));
  box-shadow: 0 0 15px rgba(255, 0, 208, 0.5);
  transition: width 0.5s var(--smooth-ease);
}

/* ===== BANK CARD ===== */
.bank-card {
  padding: 14px;
}

.bank-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
}

.btn-preset {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 246, 255, 0.15);
  background: rgba(0, 246, 255, 0.05);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s var(--smooth-ease);
}

.btn-preset:hover {
  border-color: rgba(0, 246, 255, 0.3);
  background: rgba(0, 246, 255, 0.1);
}

.bank-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
}

.btn-bank {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 246, 255, 0.15);
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.08), rgba(255, 0, 208, 0.05));
  color: var(--neon-cyan);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--smooth-ease);
  text-transform: uppercase;
}

.btn-bank:hover {
  border-color: rgba(0, 246, 255, 0.3);
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.15), rgba(255, 0, 208, 0.1));
  box-shadow: 0 0 15px rgba(0, 246, 255, 0.2);
}

.btn-bank.secondary {
  color: var(--text-secondary);
  background: rgba(0, 246, 255, 0.05);
}

/* ===== RULES CARD ===== */
.rules-card, .support-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 20px;
}

.rules-icon, .support-icon {
  font-size: 36px;
  line-height: 1;
}

.rules-title, .support-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.rules-text, .support-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== NAVIGATION ===== */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  padding: 0 12px calc(var(--safe-area-bottom) + 12px);
  background: linear-gradient(180deg, rgba(10, 4, 8, 0), rgba(10, 4, 8, 0.95));
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 246, 255, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 8px 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s var(--smooth-ease);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.nav-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: all 0.3s var(--smooth-ease);
}

.nav-item:hover {
  color: var(--neon-cyan);
  border-color: rgba(0, 246, 255, 0.2);
  background: rgba(0, 246, 255, 0.05);
}

.nav-item.active {
  color: #000;
  background: var(--accent-gradient);
  border-color: rgba(0, 246, 255, 0.5);
  box-shadow: 0 -8px 30px rgba(0, 246, 255, 0.3);
}

.nav-item.active .nav-icon {
  fill: currentColor;
  stroke: none;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: none;
  background: transparent;
}

.modal[open], .modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.modal-card {
  position: relative;
  z-index: 10;
  background: linear-gradient(135deg, rgba(20, 8, 15, 0.95), rgba(10, 4, 8, 0.98));
  border: 1px solid rgba(0, 246, 255, 0.2);
  border-radius: 20px;
  padding: 20px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 60px rgba(0, 246, 255, 0.2);
  backdrop-filter: blur(20px);
  animation: modalSlideIn 0.4s var(--smooth);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 246, 255, 0.1);
}

.modal-header h2 {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 900;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 246, 255, 0.1);
  color: var(--neon-cyan);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s var(--smooth-ease);
}

.close-btn:hover {
  background: rgba(0, 246, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 246, 255, 0.2);
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(0, 246, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(0, 246, 255, 0.1);
}

.setting-label {
  font-weight: 800;
  color: var(--text-primary);
}

.btn-toggle {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 246, 255, 0.2);
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.08), rgba(255, 0, 208, 0.05));
  color: var(--neon-cyan);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s var(--smooth-ease);
  text-transform: uppercase;
}

.btn-toggle:hover {
  border-color: rgba(0, 246, 255, 0.3);
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.15), rgba(255, 0, 208, 0.1));
  box-shadow: 0 0 15px rgba(0, 246, 255, 0.2);
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-modal-close {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(0, 246, 255, 0.2);
  background: rgba(0, 246, 255, 0.08);
  color: var(--neon-cyan);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--smooth-ease);
  text-transform: uppercase;
}

.btn-modal-close:hover {
  background: rgba(0, 246, 255, 0.15);
  box-shadow: 0 0 15px rgba(0, 246, 255, 0.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .topbar {
    flex-wrap: nowrap;
  }

  .header-center {
    display: none;
  }

  .brand-logo {
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: calc(10px + var(--safe-area-top)) 12px 10px;
    gap: 8px;
  }

  .avatar {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .user-name {
    font-size: 14px;
  }

  .balance {
    padding: 6px 10px;
  }

  .balance-rate {
    font-size: 10px;
  }

  .balance-value {
    font-size: 16px;
  }

  .page-title {
    font-size: 24px;
  }

  .display-multiplier {
    font-size: clamp(32px, 8vw, 56px);
  }

  .game-card {
    min-height: 220px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: calc(10px + var(--safe-area-top)) 10px 8px;
  }

  .avatar {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .user-id {
    font-size: 11px;
  }

  .header-btn {
    width: 40px;
    height: 40px;
  }

  .ticker-item {
    font-size: 11px;
    padding: 5px 10px;
  }

  .main-content {
    padding: 12px;
    padding-bottom: calc(80px + var(--safe-area-bottom));
  }

  .page-title {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .title-accent {
    width: 40px;
  }

  .card {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 12px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .btn-play {
    padding: 14px;
    font-size: 14px;
    margin-bottom: 10px;
  }

  .game-card {
    min-height: 200px;
    border-radius: 12px;
  }

  .display-multiplier {
    font-size: clamp(28px, 7vw, 48px);
  }

  .bottom-nav {
    padding: 0 8px calc(var(--safe-area-bottom) + 8px);
  }

  .nav-container {
    gap: 4px;
  }

  .nav-item {
    padding: 6px;
    gap: 2px;
    font-size: 10px;
  }

  .nav-icon {
    width: 22px;
    height: 22px;
  }

  .modal-card {
    padding: 16px;
    border-radius: 16px;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .bg-grid {
    animation: none;
  }

  .bg-nebula {
    animation: none;
  }

  .brand-logo {
    animation: none;
  }
}
