/* ========================================
   SPIN THE WHEEL — TV-Optimized Styles
   ======================================== */

@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&display=swap");

/* ---------- CSS Variables ---------- */
:root {
  --primary: #f68b1f;
  --primary-dark: #d6812c;
  --orange-dark: #c44b00;
  --orange-mid: #e86500;
  --orange-light: #ff8c00;
  --orange-glow: #ffb347;
  --gold: #f68b1f;
  --gold-dark: #d6812c;
  --white: #ffffff;
  --black: #111111;
  --app-bg: #1a1510;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(246, 139, 31, 0.25);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Outfit", sans-serif;
  background: var(--app-bg);
  color: var(--white);
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* ---------- Background Pattern ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 50% at 50% -20%,
      rgba(246, 139, 31, 0.12) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(214, 129, 44, 0.08) 0%,
      transparent 45%
    );
  pointer-events: none;
  z-index: 0;
}

/* ---------- App Container ---------- */
#app {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---------- Header ---------- */
.header {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 900px;
  padding: 0 24px;
  text-align: center;
  z-index: 10;
  box-sizing: border-box;
}

.header h1 {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #fff 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }
}

.header-actions {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: none; /* hide user name + logout on TV view */
}

.header-user {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.logout-btn {
  font-family: "Outfit", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all var(--transition);
}

.logout-btn:hover {
  background: rgba(246, 139, 31, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.logout-inline {
  position: absolute;
  top: 20px;
  right: 24px;
  padding: 6px 14px;
  font-size: 0.8rem;
}

/* ---------- Admin toggle ---------- */
.admin-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  z-index: 60;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition);
}

.admin-toggle:hover {
  background: rgba(0, 0, 0, 0.85);
  color: var(--gold);
  border-color: rgba(255, 215, 0, 0.4);
}

/* ---------- Auth overlay ---------- */
.auth-card {
  min-width: 360px;
}

.auth-check {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 200px;
}

.auth-check.hidden {
  display: none !important;
}

.auth-view.hidden {
  display: none !important;
}

.auth-view {
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 8px;
}

.auth-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.45);
  text-align: left;
}

.auth-input {
  width: 100%;
  padding: 14px 18px;
  font-family: "Outfit", sans-serif;
  font-size: 1.05rem;
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.auth-input:focus {
  border-color: var(--gold);
}

.auth-input-otp {
  text-align: center;
  letter-spacing: 0.4em;
  font-weight: 700;
}

.auth-error {
  font-size: 0.9rem;
  color: #e86500;
  margin: 0;
  text-align: left;
}

.auth-error.hidden {
  display: none !important;
}

.auth-back {
  position: static;
  display: block;
  margin-top: 20px;
}

/* ---------- Wheel Container ---------- */
.wheel-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wheel-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.wheel-start-btn {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 52px;
  font-family: "Outfit", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 60px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.1));
  color: var(--gold);
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(255, 215, 0, 0.08);
  transition: all var(--transition);
}

.wheel-start-btn:hover {
  background: var(--gold);
  color: var(--black);
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(255, 215, 0, 0.3);
}

.wheel-start-btn.hidden {
  display: none !important;
}

/* Pointer / Arrow */
.wheel-pointer {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 0;
  height: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-top: 50px solid var(--gold);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  transition: transform 0.1s;
}

.wheel-pointer.bounce {
  animation: pointerBounce 0.15s ease;
}

@keyframes pointerBounce {
  0%,
  100% {
    transform: translateX(-50%) rotate(0deg);
  }

  50% {
    transform: translateX(-50%) rotate(8deg);
  }
}

#wheelCanvas {
  border-radius: 50%;
  box-shadow:
    0 0 0 10px var(--gold-dark),
    0 0 0 14px var(--orange-dark),
    0 0 60px rgba(255, 215, 0, 0.3),
    var(--shadow-heavy);
  transition: filter var(--transition);
}

/* Center hub */
.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #fff 0%,
    var(--gold) 60%,
    var(--gold-dark) 100%
  );
  box-shadow:
    0 0 20px rgba(255, 215, 0, 0.6),
    inset 0 -3px 6px rgba(0, 0, 0, 0.2);
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--orange-dark);
}

/* ---------- Overlays (Glass) ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

.overlay-card {
  background: linear-gradient(
    145deg,
    rgba(255, 140, 0, 0.85),
    rgba(200, 80, 0, 0.9)
  );
  border: 2px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 50px 60px;
  text-align: center;
  box-shadow: var(--shadow-heavy), var(--shadow-glow);
  max-width: 600px;
  width: 90%;
  animation: cardPopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardPopIn {
  0% {
    transform: scale(0.5) translateY(40px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ---------- 1Shot Setup Card ---------- */
.setup-card {
  position: relative;
  background: linear-gradient(
    155deg,
    rgba(0, 0, 0, 0.75),
    rgba(30, 15, 0, 0.85)
  );
  border: 1px solid rgba(255, 215, 0, 0.2);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(255, 140, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  max-width: 480px;
  padding: 48px 52px;
}

.brand-logo {
  font-size: 3.6rem;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(
    135deg,
    var(--gold) 0%,
    #fff 40%,
    var(--gold) 80%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 10px rgba(255, 215, 0, 0.3));
  margin-bottom: 2px;
  line-height: 1;
}

.setup-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
  background: none;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.6);
}

.setup-card .subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0;
}

.setup-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 24px auto;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
}

.stat-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px 12px 16px;
  text-align: center;
  transition: border-color var(--transition);
}

.stat-box:hover {
  border-color: rgba(255, 215, 0, 0.2);
}

.stat-value {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35);
}

.stat-separator {
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.15);
  font-weight: 300;
  flex-shrink: 0;
}

.stat-box .pick-input {
  width: 80px;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255, 215, 0, 0.4);
  color: var(--gold);
  font-family: "Outfit", sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  text-align: center;
  outline: none;
  line-height: 1;
  margin-bottom: 8px;
  padding-bottom: 4px;
  transition: border-color var(--transition);
}

.stat-box .pick-input:focus {
  border-color: var(--gold);
}

/* Hide number spin arrows */
.pick-input::-webkit-outer-spin-button,
.pick-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.pick-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
  padding: 16px 52px;
  font-family: "Outfit", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 60px;
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.15),
    rgba(255, 140, 0, 0.1)
  );
  color: var(--gold);
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(255, 215, 0, 0.08);
  transition: all var(--transition);
}

.start-btn:hover {
  background: var(--gold);
  color: var(--black);
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(255, 215, 0, 0.3);
}

.start-btn-arrow {
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.start-btn:hover .start-btn-arrow {
  transform: translateX(4px);
}

.back-link {
  position: absolute;
  top: 20px;
  left: 24px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition);
}
.back-link:hover {
  color: var(--gold);
}

/* ---------- Pending draws loading ---------- */
.resolutions-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 200px;
  margin-bottom: 24px;
}

.resolutions-loading.hidden {
  display: none !important;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: resolutions-spin 0.9s linear infinite;
}

.loading-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
}

@keyframes resolutions-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Pending draws error state ---------- */
.error-state {
  text-align: center;
  padding: 28px 24px 32px;
  background: rgba(200, 80, 0, 0.08);
  border: 1px solid rgba(246, 139, 31, 0.25);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.error-state.hidden {
  display: none !important;
}

.error-state .error-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(246, 139, 31, 0.2);
  color: var(--gold);
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.error-state .error-message {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  margin: 0 0 20px;
  line-height: 1.45;
}

.error-state .retry-btn {
  margin: 0 auto;
}

.resolutions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 24px;
  padding: 4px;
}

.resolutions-list.hidden {
  display: none !important;
}

.resolution-item {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  cursor: pointer;
  transition: all var(--transition);
}
.resolution-item:hover {
  border-color: rgba(246, 139, 31, 0.35);
  background: rgba(246, 139, 31, 0.06);
}
.resolution-item .res-session {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}
.resolution-item .res-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}
.empty-state {
  margin: 12px 0 20px;
  padding: 22px 20px 20px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  text-align: center;
}

.empty-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: rgba(0, 200, 120, 0.12);
  color: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
}

.empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
}

.empty-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

.empty-refresh-btn {
  margin-top: 14px;
}

.pick-input[readonly] {
  border-bottom-color: rgba(255, 255, 255, 0.2);
  cursor: default;
}

.resolve-btn {
  margin-top: 0;
}
.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  /* border-color: rgba(255, 255, 255, 0.2); */
}
.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  /* border-color: rgba(255, 255, 255, 0.3); */
  color: var(--white);
}
.final-actions.resolved .resolve-btn {
  display: none;
}
.final-actions.resolved .secondary-btn {
  margin-top: 0;
}

/* ---------- Pre-Spin Side Countdown ---------- */
.pre-spin-side {
  position: absolute;
  right: calc(50% + 280px); /* 260px wheel radius + 20px gap */
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius);
  padding: 32px 36px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
  animation: sideCountSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  min-width: 170px;
  z-index: 30;
}

.pre-spin-side.hidden {
  display: none !important;
}

@keyframes sideCountSlideIn {
  0% {
    transform: translate(-30px, -50%) scale(0.9);
    opacity: 0;
  }
  100% {
    transform: translate(0, -50%) scale(1);
    opacity: 1;
  }
}

.pre-spin-side .pre-spin-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}

.pre-spin-side .pre-spin-number {
  font-size: 7rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(180deg, #fff 20%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 16px rgba(255, 215, 0, 0.35));
  animation: countPulse 1s ease-in-out infinite;
}

@keyframes countPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.pre-spin-side .spin-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: rgba(255, 215, 0, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  display: inline-block;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

/* ---------- Winner Celebration Overlay ---------- */
.winner-overlay-card {
  background: linear-gradient(
    155deg,
    rgba(0, 0, 0, 0.75),
    rgba(30, 15, 0, 0.85)
  );
  border: 1px solid rgba(255, 215, 0, 0.2);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(255, 140, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 50px 60px;
  text-align: center;
  max-width: 650px;
  width: 90%;
  animation: winnerBounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
}

@keyframes winnerBounceIn {
  0% {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
  }

  60% {
    transform: scale(1.1) rotate(2deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.winner-overlay-card .trophy {
  font-size: 5rem;
  margin-bottom: 10px;
  animation: trophyBounce 1s ease-in-out infinite;
}

@keyframes trophyBounce {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-10px) rotate(-5deg);
  }

  75% {
    transform: translateY(-10px) rotate(5deg);
  }
}

.winner-overlay-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--orange-glow);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.winner-overlay-card .winner-name {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(180deg, #fff 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.winner-overlay-card .winner-phone {
  font-size: 1.6rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 2px;
  margin-bottom: 28px;
}

.winner-overlay-card .countdown-bar {
  position: relative;
  margin: 0 auto;
  width: 80%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.winner-overlay-card .countdown-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #fff);
  border-radius: 10px;
  transition: width 1s linear;
}

.winner-overlay-card .countdown-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}

/* ---------- Bottom Winners Bar ---------- */
.winners-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 30px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.winners-bar.visible {
  transform: translateY(0);
}

.winners-bar .bar-label {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}

#winnersChips {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.winner-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 50px;
  padding: 8px 18px;
  white-space: nowrap;
  flex-shrink: 0;
  animation: chipSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes chipSlideIn {
  0% {
    transform: translateY(30px) scale(0.8);
    opacity: 0;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.winner-chip .chip-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  font-size: 0.85rem;
  font-weight: 900;
  flex-shrink: 0;
}

.winner-chip .chip-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.winner-chip .chip-phone {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Final Results Screen ---------- */
.final-screen-card {
  position: relative;
  background: linear-gradient(
    155deg,
    rgba(0, 0, 0, 0.75),
    rgba(30, 15, 0, 0.85)
  );
  border: 1px solid rgba(255, 215, 0, 0.2);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(255, 140, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 50px;
  text-align: center;
  max-width: 900px;
  width: 94%;
  animation: finalCardPopIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
}

.final-close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
}

.final-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--gold);
}

@keyframes finalCardPopIn {
  0% {
    transform: scale(0.6) translateY(40px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.final-screen-card h1 {
  font-size: 2.2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #fff 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.final-screen-card .final-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0;
}

.final-grid-wrapper {
  max-height: 45vh;
  overflow-y: auto;
  padding: 10px;
  margin: 0 -10px;
}

/* Custom Scrollbar for Grid */
.final-grid-wrapper::-webkit-scrollbar {
  width: 8px;
}
.final-grid-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.final-grid-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 4px;
}
.final-grid-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.5);
}

.final-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.final-card {
  flex: 1 1 200px;
  max-width: 250px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  transition: all var(--transition);
  animation: finalItemIn 0.5s ease forwards;
  opacity: 0;
}

.final-card:hover {
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.05);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

@keyframes finalItemIn {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.final-card .card-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.final-card .card-name {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--gold);
}

.final-card .card-phone {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
}

/* ---------- Confetti Canvas ---------- */
#confettiCanvas {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
}

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}
