/* ==========================================================================
   Sixztar — design system
   Tailwind (CDN) handles layout utilities; this file owns the look & effects.
   ========================================================================== */

:root {
  --bg: #030102;
  --accent: #dc2626;
  --accent-soft: rgba(220, 38, 38, 0.18);
  --accent-strong: rgba(220, 38, 38, 0.5);
  --live: #ff2d2d;
  --ink: #ffffff;
  --muted: #a1a1aa;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Starfield background ---------- */
#star-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Glass surfaces ---------- */
.glass-card {
  background: rgba(14, 8, 10, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--accent-soft);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
  background: rgba(24, 10, 14, 0.88);
  border-color: rgba(220, 38, 38, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(220, 38, 38, 0.22);
}

.glass-static {
  background: rgba(14, 8, 10, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--accent-soft);
}

/* ---------- Avatar ring ---------- */
@keyframes subtleRedPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(220, 38, 38, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.08); }
  50% { box-shadow: 0 0 25px rgba(220, 38, 38, 0.4), inset 0 0 15px rgba(220, 38, 38, 0.15); }
}

.avatar-glow {
  animation: subtleRedPulse 5s infinite ease-in-out;
}

/* ---------- Live YouTube card ---------- */
.live-card {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

.live-card.is-live {
  border-color: rgba(255, 45, 45, 0.75);
  background: rgba(40, 2, 4, 0.9);
  animation: livePulse 1.6s infinite ease-in-out;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 45, 45, 0.25), 0 0 22px rgba(255, 45, 45, 0.35); }
  50% { box-shadow: 0 0 0 1px rgba(255, 45, 45, 0.55), 0 0 44px rgba(255, 45, 45, 0.7); }
}

.live-card.is-live .live-ring {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 45, 45, 0.28) 85%, transparent 100%);
  animation: liveSweep 3s linear infinite;
  pointer-events: none;
}

@keyframes liveSweep {
  to { transform: rotate(360deg); }
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
}

.live-card.is-live .live-dot {
  animation: liveBlink 1s steps(2, start) infinite;
}

@keyframes liveBlink {
  50% { opacity: 0.25; }
}

.live-badge {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.7);
}

/* ---------- Dropdown ---------- */
.dropdown-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s ease-in-out, opacity 0.3s ease-in-out;
}

.dropdown-content.open {
  max-height: 1600px;
  opacity: 1;
}

/* ---------- Scroll sections (single page, no tabs) ---------- */
main section[id^="view-"] {
  scroll-margin-top: 1.25rem;
}

/* ---------- Admin overlay (toggled via .hidden) ---------- */
.admin-overlay.hidden {
  display: none;
}

/* ---------- Account FAB ---------- */
.fab-item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  color: #e4e4e7;
  transition: background 0.15s ease, color 0.15s ease;
}

.fab-item:hover {
  background: rgba(220, 38, 38, 0.15);
  color: #fff;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Winner celebration ---------- */
@keyframes wheelGlow {
  0%, 100% { box-shadow: 0 0 40px 6px rgba(220, 38, 38, 0.35); }
  50%      { box-shadow: 0 0 70px 14px rgba(220, 38, 38, 0.55); }
}
.wheel-glow {
  animation: wheelGlow 3s ease-in-out infinite;
}

@keyframes winnerPop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.winner-pop {
  animation: winnerPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---------- Modals & toast ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  animation: viewIn 0.2s ease both;
}

.modal-backdrop.hidden {
  display: none;
}

.toast-hidden {
  transform: translate(-50%, -20px);
  opacity: 0;
}

.toast-shown {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ---------- Wheel ---------- */
#admin-spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(90deg, #dc2626, #be123c);
  color: #fff;
  font-weight: 700;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* ---------- Misc ---------- */
.scroll-thin::-webkit-scrollbar {
  width: 6px;
}

.scroll-thin::-webkit-scrollbar-thumb {
  background: rgba(220, 38, 38, 0.4);
  border-radius: 999px;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
