/* AceVault Casino App Styles */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

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

:root {
  --gold: #D4AF37;
  --gold-light: #F5E6A3;
  --deep: #0A0A0F;
  --card: #111118;
  --card-border: #1A1A25;
  --text: #E8E8ED;
  --text-dim: #8888A0;
  --accent: #7B61FF;
  --green: #00E676;
  --red: #FF3D57;
  --amber: #C4882F;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--deep);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

/* Ambient background */
.bg-glow {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
.bg-glow::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(123,97,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.bg-glow::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(212,175,55,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

/* Layout */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Nav */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(17, 17, 24, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--gold);
  text-decoration: none;
  cursor: pointer;
}
.logo span { color: var(--text); }

.nav-back {
  display: none;
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.nav-back:hover {
  border-color: var(--gold);
  color: var(--text);
}
.nav-back.visible { display: inline-flex; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.balance-display {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.95rem;
}
.balance-display.visible { display: flex; }
.balance-icon { color: var(--gold); font-size: 1.1rem; }
.balance-amount { color: var(--gold); }
.balance-label { color: var(--text-dim); font-size: 0.75rem; font-weight: 400; }

.btn {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-primary {
  background: var(--gold);
  color: var(--deep);
}
.btn-primary:hover { background: var(--gold-light); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: #6B51EF; }

.btn-green {
  background: var(--green);
  color: var(--deep);
}
.btn-green:hover { background: #00ff88; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.user-menu {
  display: none;
  align-items: center;
  gap: 8px;
}
.user-menu.visible { display: flex; }
.user-name {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}

.auth-buttons { display: flex; gap: 8px; }

/* Main Content */
.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.category-tab {
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 10px 24px;
  border-radius: 100px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.category-tab:hover { border-color: var(--gold); color: var(--text); }
.category-tab.active {
  background: var(--gold);
  color: var(--deep);
  border-color: var(--gold);
  font-weight: 600;
}

/* Section Headers */
.section-header {
  margin-bottom: 24px;
}
.section-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-header p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 6px;
}

/* Game Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.game-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}
.game-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(212, 175, 55, 0.08);
}

.game-card-thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.game-card-thumb .game-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
  z-index: 1;
}
.game-card-thumb::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--card));
}

.game-card-body {
  padding: 16px 20px 20px;
}
.game-card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.game-card-desc {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.game-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge-exclusive {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
}
.badge-rtp {
  background: rgba(0, 230, 118, 0.1);
  color: var(--green);
}
.badge-type {
  background: rgba(123, 97, 255, 0.12);
  color: var(--accent);
}
.badge-coming-soon {
  background: rgba(136, 136, 160, 0.15);
  color: var(--text-dim);
}

/* Game Page */
.game-page {
  max-width: 900px;
  margin: 0 auto;
}

.game-header {
  text-align: center;
  margin-bottom: 24px;
}
.game-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.game-header .game-rtp {
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 4px;
}

/* Slot Machine */
.slot-machine {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.slot-machine::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Reels Grid */
.reels-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 24px;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.03);
}

.reel-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reel-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  font-size: 2rem;
  transition: all 0.3s;
  position: relative;
  min-height: 70px;
}

.reel-cell.spinning {
  animation: cellSpin 0.12s linear infinite;
}

.reel-cell.winning {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  animation: winPulse 0.6s ease-in-out infinite alternate;
}

@keyframes cellSpin {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes winPulse {
  from { box-shadow: 0 0 10px rgba(212, 175, 55, 0.2); }
  to { box-shadow: 0 0 30px rgba(212, 175, 55, 0.5); }
}

/* Win Display */
.win-display {
  text-align: center;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.win-amount {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.win-amount.visible {
  opacity: 1;
  transform: scale(1);
}
.win-amount.big-win {
  font-size: 2.8rem;
  color: var(--gold-light);
  text-shadow: 0 0 40px rgba(212,175,55,0.6);
}

/* Controls */
.slot-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.bet-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bet-label {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.bet-amount-display {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  min-width: 80px;
  text-align: center;
}
.bet-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
}
.bet-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.spin-btn {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 14px 48px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--gold), #E8C252);
  color: var(--deep);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  overflow: hidden;
}
.spin-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4);
}
.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.spin-btn.spinning-active {
  background: linear-gradient(135deg, var(--accent), #9B81FF);
}

/* Paylines info */
.game-info-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.info-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.info-card-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
}
.info-card-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* Paytable */
.paytable {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
}
.paytable h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.paytable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.paytable-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.03);
}
.paytable-icon {
  font-size: 1.6rem;
  min-width: 36px;
  text-align: center;
}
.paytable-info {
  flex: 1;
}
.paytable-name {
  font-weight: 600;
  font-size: 0.85rem;
}
.paytable-pays {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Auth Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.modal-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.modal h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.modal p.modal-subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--gold);
}
.form-group input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

.form-error {
  color: var(--red);
  font-size: 0.82rem;
  margin-top: 8px;
  display: none;
}
.form-error.visible { display: block; }

.modal-footer {
  text-align: center;
  margin-top: 20px;
}
.modal-footer a {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
}
.modal-footer a:hover { text-decoration: underline; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 0.9rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: toastIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }
.toast.info { border-color: var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Daily Bonus Banner */
.daily-bonus-bar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 24px;
  background: linear-gradient(90deg, rgba(123,97,255,0.1), rgba(212,175,55,0.1));
  border-bottom: 1px solid var(--card-border);
}
.daily-bonus-bar.visible { display: flex; }
.daily-bonus-bar p {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.daily-bonus-bar .btn { font-size: 0.75rem; padding: 6px 16px; }

/* Lobby Stats */
.lobby-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
.lobby-stat {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.lobby-stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
}
.lobby-stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 8px;
}

/* Wallet Page */
.wallet-page {
  max-width: 700px;
  margin: 0 auto;
}
.wallet-balance-card {
  background: linear-gradient(135deg, var(--card) 0%, #1a1a28 100%);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.wallet-balance-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
.wallet-balance-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.wallet-balance-value {
  font-family: 'Syne', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 16px;
}
.wallet-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}
.tx-left { display: flex; align-items: center; gap: 12px; }
.tx-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.tx-icon.win { background: rgba(0,230,118,0.1); }
.tx-icon.bet { background: rgba(255,61,87,0.1); }
.tx-icon.bonus { background: rgba(123,97,255,0.1); }
.tx-desc { font-size: 0.9rem; }
.tx-time { font-size: 0.75rem; color: var(--text-dim); }
.tx-amount { font-weight: 600; font-size: 0.95rem; }
.tx-amount.positive { color: var(--green); }
.tx-amount.negative { color: var(--red); }

/* Coming Soon Overlay */
.coming-soon-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 15, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  z-index: 2;
}
.coming-soon-overlay span {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Loading */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--card-border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.app-footer {
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--card-border);
  margin-top: auto;
}
.app-footer p {
  color: var(--text-dim);
  font-size: 0.75rem;
}
.app-footer .footer-warning {
  color: var(--text-dim);
  font-size: 0.7rem;
  margin-top: 8px;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
  .top-nav { padding: 12px 16px; }
  .main-content { padding: 16px; }
  .lobby-stats { grid-template-columns: repeat(2, 1fr); }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .game-info-bar { grid-template-columns: 1fr; }
  .slot-machine { padding: 20px; }
  .reels-container { gap: 4px; padding: 10px; }
  .reel-cell { font-size: 1.5rem; min-height: 55px; }
  .spin-btn { padding: 12px 32px; font-size: 0.95rem; }
  .wallet-balance-value { font-size: 2.5rem; }
  .paytable-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .games-grid { grid-template-columns: 1fr; }
  .category-tabs { gap: 6px; }
  .category-tab { padding: 8px 16px; font-size: 0.82rem; }
  .slot-controls { gap: 12px; }
  .reel-cell { font-size: 1.3rem; min-height: 48px; }
  .lobby-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
}
