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

/* ── MOBILE: prevent double-tap zoom on all interactive elements ── */
a, button, label, select,
input[type="button"], input[type="submit"], input[type="reset"] {
  touch-action: manipulation;
}

/* ── MOBILE: prevent iOS auto-zoom on input focus (needs font-size >= 16px) ── */
input, textarea, select {
  font-size: 16px;
}

/* ── MOBILE: smooth tap highlight removal ── */
a, button { -webkit-tap-highlight-color: transparent; }

:root {
  --bg:     #0d1223;
  --card:   #162032;
  --card2:  #1a2540;
  --gold:   #c9a227;
  --gold2:  #f0c040;
  --green:  #22c55e;
  --white:  #ffffff;
  --gray:   #94a3b8;
  --border: #1e2d4a;
  --teal:   #0d2535;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  padding-bottom: 80px;
}

/* ── NAVBAR ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0a0f1e;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.nav-logo {
  width: 48px; height: 48px;
  background: radial-gradient(circle, #1a1a2e, #0a0820);
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.crown { font-size: 11px; color: var(--gold); line-height: 1; }
.fp    { font-size: 13px; font-weight: 900; color: var(--gold); font-family: 'Cinzel', serif; line-height: 1; }

.brand-name { display: block; font-size: 14px; font-weight: 700; letter-spacing: 1.5px; color: var(--white); }
.brand-sub  { display: block; font-size: 9px; color: var(--gray); letter-spacing: 0.5px; margin-top: 2px; }

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

.notif-btn {
  position: relative;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
}
.notif-btn.has-notif { animation: bellShake 0.5s ease; }
@keyframes bellShake {
  0%,100% { transform: rotate(0); }
  20% { transform: rotate(-18deg); }
  40% { transform: rotate(16deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(8deg); }
}

.badge {
  position: absolute;
  top: 2px; right: 2px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
}

/* ── NOTIFICATION PANEL ── */
.notif-panel {
  position: absolute;
  top: 52px; right: 0;
  width: 310px;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  z-index: 300;
  overflow: hidden;
  animation: panelDrop 0.2s cubic-bezier(.25,.46,.45,.94);
}
@keyframes panelDrop {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-panel.hidden { display: none; }

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.notif-panel-head h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.notif-mark-read {
  font-size: 11px;
  color: #6366f1;
  cursor: pointer;
  font-weight: 600;
  touch-action: manipulation;
}

.notif-list {
  max-height: 300px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.12s;
  touch-action: manipulation;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-decoration: none;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover, .notif-item:active { background: rgba(255,255,255,0.04); }
.notif-item.unread { background: rgba(99,102,241,0.07); }

.notif-av {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.notif-av.fp-av   { background: radial-gradient(circle, #1e1a3a, #080616); border: 1.5px solid #c9a227; font-size: 9px; color: #c9a227; font-weight: 900; }
.notif-av.nicky-av { background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.notif-av.brody-av { background: linear-gradient(135deg, #0d4040, #065f46); }

.notif-av-fp-inner { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.notif-av-fp-inner .crown { font-size: 7px; }
.notif-av-fp-inner .fp-lbl { font-size: 8px; font-weight: 900; }

.notif-body { flex: 1; min-width: 0; }
.notif-name { font-size: 13px; font-weight: 700; color: #f3f4f6; margin-bottom: 2px; }
.notif-preview {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item.unread .notif-preview { color: #9ca3af; }
.notif-time { font-size: 10px; color: #4b5563; margin-top: 3px; }

.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #6366f1;
  flex-shrink: 0;
  margin-top: 5px;
}

.notif-empty {
  text-align: center;
  padding: 28px 16px;
  font-size: 13px;
  color: #4b5563;
}
.notif-empty-icon { font-size: 32px; margin-bottom: 8px; }

.notif-panel-foot {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  text-align: center;
}
.notif-panel-foot a {
  font-size: 13px;
  color: #6366f1;
  font-weight: 600;
  text-decoration: none;
}
.notif-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 299;
}
.notif-panel-overlay.hidden { display: none; }

.avatar-btn { position: relative; cursor: pointer; }

.avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 16px;
  border: 2px solid rgba(255,255,255,0.15);
}

.dropdown {
  display: none;
  position: absolute;
  top: 48px; right: 0;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 160px;
  overflow: hidden;
  z-index: 200;
}
.dropdown.open { display: block; }
.dropdown a { display: block; padding: 11px 16px; color: var(--gray); font-size: 13px; text-decoration: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.dropdown a:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.logout-link { color: #ef4444 !important; border-top: 1px solid var(--border); }

/* ── LIVE WINS ── */
.live-wins {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  margin: 10px 12px;
  border-radius: 10px;
  padding: 10px 14px;
  overflow: hidden;
}

.live-badge {
  background: var(--gold2);
  color: #1a0800;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.ticker-wrap { overflow: hidden; flex: 1; }

.ticker {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker 20s linear infinite;
  color: var(--gray);
  font-size: 13px;
}
.ticker strong { color: var(--gold2); }

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── WALLET CARD ── */
.wallet-card {
  position: relative;
  margin: 0 12px 10px;
  border-radius: 16px;
  overflow: hidden;
  height: 180px;
  border: 1px solid var(--border);
}

.wallet-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(13,18,35,0.95) 50%, rgba(13,18,35,0.4) 100%),
    url('images/milkyway.jpg') right center / cover;
}

.wallet-content {
  position: relative;
  z-index: 1;
  padding: 24px 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.wallet-greeting {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.wallet-label {
  font-size: 10px;
  color: var(--gold2);
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 6px;
}

.wallet-amount-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.wallet-amount {
  font-size: 42px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -1px;
}

.eye-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--gray);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

.wallet-fp {
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 1px;
}
.wallet-fp strong { color: var(--gold2); }

/* ── ACTION CARDS ── */
.action-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 12px 10px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.action-icon {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ac-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.green-badge { background: var(--green) !important; }

.mini-logo {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: radial-gradient(circle, #1a1a2e, #0a0820);
  border: 1px solid var(--gold);
  border-radius: 8px;
  width: 32px; height: 32px;
}
.mini-logo span:first-child { font-size: 8px; color: var(--gold); }
.mini-logo span:last-child  { font-size: 10px; font-weight: 900; color: var(--gold); font-family: 'Cinzel', serif; }

.action-text { flex: 1; }
.action-text strong { font-size: 12px; color: var(--white); letter-spacing: 0.5px; }
.action-text p { font-size: 13px; color: var(--white); font-weight: 600; margin: 2px 0; }
.action-text span { font-size: 11px; color: var(--gray); }

.ac-btn {
  border: none;
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-height: 40px;
  min-width: 72px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.ac-btn.green    { background: var(--green); color: white; }
.ac-btn.gold-btn { background: var(--gold2); color: #1a0800; }
.ac-btn:active   { opacity: 0.8; transform: scale(0.95); }

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.view-all {
  font-size: 13px;
  color: var(--gold2);
  text-decoration: none;
  font-weight: 600;
  padding: 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
  touch-action: manipulation;
}

/* ── HOT GAMES ── */
.hot-games-scroll {
  overflow: hidden;
  padding: 0 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hot-games-scroll::-webkit-scrollbar { display: none; }

.hot-games {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: hotScroll 28s linear infinite;
}

@keyframes hotScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.hot-game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  width: 100px;
}
.hot-game-card:hover { transform: translateY(-3px); }

.hot-game-img {
  width: 100px; height: 100px;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(255,255,255,0.08);
  transition: border-color 0.2s;
}
.hot-game-card:hover .hot-game-img { border-color: var(--gold); }

.hot-game-card p {
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  text-align: center;
}

/* ── LEADERBOARD ── */
.leaderboard {
  margin: 0 12px 16px;
  background: var(--teal);
  border: 1px solid #1a3a4a;
  border-radius: 16px;
  overflow: hidden;
  max-height: 252px; /* show ~3 rows, rest scrolls */
}

.lb-inner {
  display: flex;
  flex-direction: column;
  animation: lbScroll 12s linear infinite;
}
.lb-inner:hover { animation-play-state: paused; }

@keyframes lbScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255,255,255,0.03); }

.lb-rank {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(201,162,39,0.15);
  border: 1px solid var(--gold);
  color: var(--gold2);
  font-size: 12px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lb-rank.top3 { background: rgba(201,162,39,0.3); }

.lb-info { flex: 1; }
.lb-user  { font-size: 14px; font-weight: 600; color: var(--white); }
.lb-game  { font-size: 11px; color: var(--gray); margin-top: 2px; }

.lb-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold2);
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, #0c1128 0%, #080c1a 100%);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  height: calc(68px + env(safe-area-inset-bottom, 0px));
  backdrop-filter: blur(20px);
  /* Gold gradient top border */
  box-shadow:
    0 -1px 0 rgba(201,162,39,0.15),
    0 -4px 30px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Shimmering gold top line */
.bottom-nav::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(201,162,39,0.4) 20%,
    #f0c040 50%,
    rgba(201,162,39,0.4) 80%,
    transparent 100%
  );
  animation: navShimmer 3s ease infinite;
}
@keyframes navShimmer {
  0%,100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* NAV ITEMS */
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #4b5563;
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  position: relative;
  flex: 1;
  padding-top: 6px;
  transition: color 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Active gold indicator dot */
.bnav-item.active::before {
  content: '';
  position: absolute;
  top: -1px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 3px;
  background: linear-gradient(90deg, #c9a227, #f0c040);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 0 8px rgba(240,192,64,0.8);
}

/* Tap bounce */
.bnav-item:active {
  transform: scale(0.88);
  transition: transform 0.1s;
}

.bnav-item.active {
  color: #f0c040;
}

/* Icon wrapper for glow */
.bnav-icon {
  font-size: 22px;
  transition: transform 0.2s, filter 0.2s;
  display: block;
}
.bnav-item.active .bnav-icon {
  transform: translateY(-2px) scale(1.15);
  filter: drop-shadow(0 0 6px rgba(240,192,64,0.7));
}

.bnav-badge {
  position: absolute;
  top: 2px; right: calc(50% - 24px);
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 800;
  min-width: 15px; height: 15px;
  border-radius: 8px;
  padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #080c1a;
  animation: badgePop 0.3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── CENTER CASINO CHIP ── */
.bnav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-decoration: none;
  margin-top: -28px;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.bnav-center:active .bnav-logo { transform: scale(0.9); }

/* Outer spinning dashed ring */
.bnav-center::before {
  content: '';
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 2px dashed rgba(201,162,39,0.35);
  animation: chipSpin 10s linear infinite;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* Pulsing halo */
.bnav-center::after {
  content: '';
  position: absolute;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid rgba(240,192,64,0.2);
  animation: chipPulse 2s ease-out infinite;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes chipSpin {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}
@keyframes chipPulse {
  0%   { transform: translate(-50%,-50%) scale(1);   opacity: 0.8; }
  70%  { transform: translate(-50%,-50%) scale(1.25); opacity: 0; }
  100% { transform: translate(-50%,-50%) scale(1.25); opacity: 0; }
}

.bnav-logo {
  position: relative;
  width: 62px; height: 62px;
  background: radial-gradient(circle at 35% 30%, #2a2050, #0a0820);
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: transform 0.15s;
  z-index: 1;
  /* Multi-ring border via box-shadow */
  box-shadow:
    0 0 0 3px #c9a227,
    0 0 0 5px rgba(201,162,39,0.2),
    0 0 20px rgba(201,162,39,0.5),
    0 0 40px rgba(201,162,39,0.2),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Shimmer sweep across chip */
.bnav-logo::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
}

.bnav-logo .crown {
  font-size: 11px;
  color: #f0c040;
  line-height: 1;
  text-shadow: 0 0 8px rgba(240,192,64,0.6);
}
.bnav-logo .fp {
  font-size: 15px;
  font-weight: 900;
  color: #f0c040;
  font-family: 'Cinzel', serif;
  line-height: 1;
  text-shadow: 0 0 10px rgba(240,192,64,0.8);
  letter-spacing: 1px;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .topbar { padding: 10px 12px; }
  .topbar-title { font-size: 15px; }
  .balance-card { padding: 18px 16px; }
  .balance-amount { font-size: 28px; }
  .hot-games-scroll { gap: 10px; padding: 0 12px 14px; }
  .hot-game-card { width: 120px; }
  .action-cards { grid-template-columns: 1fr; gap: 10px; padding: 0 14px; }
  .wins-ticker { font-size: 11px; }
  .leaderboard-row { padding: 10px 12px; gap: 10px; }
}

/* ── PHONE MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 200; animation: fadeIn 0.2s ease;
  /* allow scrolling inside sheet without closing on iOS */
  overscroll-behavior: contain;
}
.modal-backdrop.hidden { display: none; }
.modal-sheet {
  background: #111827; border-radius: 24px 24px 0 0;
  padding: 20px 24px calc(20px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp 0.28s cubic-bezier(.25,.46,.45,.94);
}
.modal-handle {
  width: 40px; height: 4px; background: #374151;
  border-radius: 2px; margin: 0 auto 20px;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }

/* action card done state */
.action-card.done { opacity: 0.4; pointer-events: none; }
.action-card.done .ac-btn::after { content: ' ✓'; }

/* profile modal rows */
.prof-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid #1e2d4a;
  font-size: 14px;
  color: #94a3b8;
}
.prof-row strong { color: #fff; font-size: 14px; }
