/* ==========================================================================
   LuckyWheel — Design tokens & component styles
   Palette: deep indigo-night base, molten-amber accent (the "win" color),
   electric-cyan secondary (the "you" highlight on the wheel).
   ========================================================================== */

:root {
  --bg: #0b0e1a;
  --bg-elevated: #12162a;
  --bg-card: #161b31;
  --border: #232945;
  --text: #e7e9f5;
  --text-dim: #8b90ad;
  --accent: #f5a524;       /* amber — prize / CTA */
  --accent-2: #22d3ee;     /* cyan — "you" highlight */
  --accent-3: #a78bfa;     /* violet — secondary */
  --success: #34d399;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
}

[data-theme="light"] {
  --bg: #f6f5f2;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: #e6e3da;
  --text: #1c1a15;
  --text-dim: #6b6656;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: background .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: 'Sora', 'Inter', sans-serif;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e8891a);
  color: #1a1200;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 6px 20px -6px rgba(245,165,36,.55);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px -6px rgba(245,165,36,.65); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }

.input-field {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}
.input-field:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(34,211,238,.15);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-pending  { background: rgba(245,165,36,.15); color: var(--accent); }
.badge-approved { background: rgba(52,211,153,.15); color: var(--success); }
.badge-rejected { background: rgba(248,113,113,.15); color: var(--danger); }

/* ---------- Mobile bottom nav (app-style) ---------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0 8px;
  font-size: .68rem;
  color: var(--text-dim);
}
.bottom-nav a.active { color: var(--accent-2); }
.bottom-nav svg { width: 22px; height: 22px; }

/* ---------- Desktop sidebar ---------- */
.sidebar {
  width: 240px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 500;
  font-size: .92rem;
}
.sidebar a.active, .sidebar a:hover {
  background: rgba(245,165,36,.08);
  color: var(--accent);
}

/* ---------- Wheel ---------- */
.wheel-wrap {
  position: relative;
  width: min(88vw, 380px);
  aspect-ratio: 1/1;
  margin: 0 auto;
}
.wheel-pointer {
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 26px solid var(--accent);
  z-index: 10;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
}
.wheel-hub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 18%; height: 18%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd98a, var(--accent) 70%);
  border: 3px solid var(--bg);
  z-index: 5;
  box-shadow: 0 0 0 3px var(--border);
}

/* ---------- Confetti modal ---------- */
.win-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,6,14,.78);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.win-modal {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 0 60px -10px rgba(245,165,36,.5);
  animation: winPop .4s cubic-bezier(.2,1.4,.4,1);
}
@keyframes winPop {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.confetti-piece {
  position: fixed;
  top: -12px;
  width: 8px; height: 14px;
  z-index: 99;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .9; }
}

/* ---------- Misc ---------- */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll-x::-webkit-scrollbar { height: 6px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.pulse-live {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(52,211,153,.6);
  animation: pulseLive 1.6s infinite;
}
@keyframes pulseLive {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); }
  70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

@media (max-width: 767px) {
  .desktop-only { display: none !important; }
  main { padding-bottom: 84px; }
}
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}
