/* ========================================
   Flappy Savon - Styles
   Brand Colors: Cream, White, Black
   Mobile-First Fullscreen Design
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Spinnaker&display=swap&text=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%20!?.,:;-+%C3%A0%C3%A8%C3%A9%C3%AA%C3%BB%C3%AE%C3%B4%C3%B9%C3%A7');

:root {
  --bg1: #f8f5f1;
  --bg2: #ede6da;
  --ink: #2c2420;
  --accent: #2c2420;
  --cream: #fffaf4;
  --cream-dark: #e6e0d6;
  --panel: rgba(255, 255, 255, 0.92);
  --shadow-sm: 0 2px 8px rgba(44, 36, 32, 0.04);
  --shadow-md: 0 8px 24px rgba(44, 36, 32, 0.08);
  --shadow-lg: 0 16px 40px rgba(44, 36, 32, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  width: 100%;
  touch-action: none;
  /* Prevent all touch gestures */
}

body {
  margin: 0;
  background: var(--bg1);
  color: var(--ink);
  font-family: 'Spinnaker', sans-serif;
  font-size: clamp(14px, 4vw, 16px);
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
  /* Changed from touch to auto to prevent bounce */
  overflow: hidden;
  /* Extra protection */
}

/* ===== Layout ===== */

.wrap {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  padding: 0;
  /* Removed safe-area padding to allow true fullscreen */
  /* Safari: promote to own compositing layer */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100dvh;
  object-fit: cover;
  /* Changed from contain to cover for fullscreen */
  touch-action: none;
  background: transparent;
  /* GPU Compositing Hints - Safari optimized */
  will-change: transform;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  contain: strict;
  /* Safari: prevent canvas from being re-rasterized on compositing */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* Crisp pixel rendering on all browsers */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* ===== Top Bar ===== */

.top-bar {
  position: fixed;
  top: calc(8px + var(--safe-top));
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 99px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.current-score {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
}

.best-score {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.best-score span {
  font-weight: 700;
  color: #1a1a1a;
}

.countdown {
  font-size: 11px;
  color: #fff;
  font-weight: 600;
}

.countdown-bar {
  position: fixed;
  top: calc(60px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  z-index: 5;
  pointer-events: none;
}

.menu-btn {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.menu-btn:active {
  transform: scale(0.94);
  background: #fff;
}

.menu-btn svg {
  color: var(--ink);
  opacity: 0.8;
}

/* Version tag - very discrete in drawer */
.version-tag {
  display: block;
  text-align: center;
  font-size: 9px;
  color: rgba(44, 36, 32, 0.25);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-top: 8px;
  padding-bottom: 20px;
}

/* Replay button removed */

/* ===== Contest Banner ===== */



/* ===== Menu Drawer ===== */

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
  z-index: 90;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.menu-drawer {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 100;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

.menu-drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.drawer-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

.drawer-content {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.brand-logo {
  text-align: center;
  font-size: 14px;
  opacity: 0.4;
  margin-top: auto;
  padding-bottom: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none !important;
  color: var(--ink) !important;
  transition: opacity 0.2s;
  display: block;
  -webkit-tap-highlight-color: transparent;
}

.brand-logo:hover,
.brand-logo:active,
.brand-logo:visited {
  color: var(--ink) !important;
  opacity: 0.8;
  text-decoration: none !important;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  border: 0;
  background: transparent;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.drawer-item:hover,
.drawer-item:active {
  background: var(--cream);
  transform: translateX(4px);
}

.drawer-item .item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #1a1a1a;
  opacity: 0.8;
}

.drawer-item:hover .item-icon {
  opacity: 1;
}

/* ===== Buttons ===== */

/* ===== Rank Bubbles ===== */

.rank {
  position: fixed;
  top: 68px;
  right: auto;
  left: 14px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  display: none;
  z-index: 15;
  color: var(--ink);
  backdrop-filter: blur(12px);
}

.rank.good {
  outline: 2px solid #1a1a1a;
  animation: pulse 1s ease-in-out infinite;
}

#rankLive {
  top: 68px;
  left: 14px;
  right: auto;
}

#rankLive.guest {
  opacity: 0.75;
}

@keyframes pulse {

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

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

/* ===== Toast ===== */

.toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.95);
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 9999;
  color: #fff;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* ===== Modal ===== */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.card {
  position: relative;
  background: #fff;
  border: 0;
  border-radius: var(--radius-lg);
  padding: clamp(20px, 5vw, 32px);
  width: min(90vw, 380px);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  /* No animation - appears instantly */
  text-align: center;
  color: var(--ink);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--ink);
  opacity: 0.6;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: grid;
  place-items: center;
  z-index: 10;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  opacity: 1;
  transform: scale(1.1);
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
  transform: scale(1.1);
}

.card h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  color: #1a1a1a;
}

.card .subtitle {
  margin: 0 0 16px;
  font-size: 14px;
  opacity: 0.7;
}

/* ===== Tabs ===== */

.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  opacity: 0.6;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  opacity: 1;
}

.tab-btn.active {
  background: var(--cream);
  border-color: var(--cream-dark);
  opacity: 1;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Tab Contents ===== */

.prize-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.prize-list li {
  padding: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prize-list .medal {
  font-size: 16px;
}

.promo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.promo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg2);
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
}

.promo-item .threshold {
  font-weight: 500;
  opacity: 0.7;
}

.promo-item .code-display {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
  color: #666;
}

.promo-item.unlocked .code-display {
  background: var(--accent);
  color: #fff;
  font-weight: bold;
}

.promo-item .discount {
  font-weight: 800;
  color: var(--accent);
}

.modal-leaderboard {
  max-height: 250px;
  overflow-y: auto;
  text-align: left;
  padding: 0 4px;
}

.row {
  margin: 10px 0;
}

.email-hint {
  margin: 4px 0 0;
  font-size: 10px;
  opacity: 0.55;
  text-align: center;
}

.row.inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.row.inline label {
  font-size: 12px;
  opacity: 0.65;
  margin: 0;
}

/* Shake animation for validation feedback */
.row.shake {
  animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.row.shake label {
  color: #c0392b;
  font-weight: 600;
  opacity: 1;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-6px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(6px);
  }
}

.row input[type="text"],
.row input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--cream-dark);
  background: var(--cream);
  color: #1a1a1a;
  font-size: 15px;
  text-align: center;
  transition: all 0.2s;
}

.row input[type="text"]::placeholder,
.row input[type="email"]::placeholder {
  color: rgba(26, 26, 26, 0.4);
}

.row input[type="text"]:focus,
.row input[type="email"]:focus {
  outline: none;
  border-color: #1a1a1a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1a1a1a;
  cursor: pointer;
}

.btn.full {
  width: 100%;
  padding: 14px 20px;
  margin-top: 8px;
  font-size: 15px;
  border-radius: 12px;
  background: #1a1a1a;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.btn.full:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.skip-link {
  display: block;
  margin-top: 12px;
  padding: 8px;
  background: none;
  border: none;
  color: rgba(26, 26, 26, 0.5);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s;
}

.skip-link:hover {
  color: rgba(26, 26, 26, 0.8);
}

.legal {
  margin-top: 16px;
  font-size: 10px;
  opacity: 0.4;
}

.legal a {
  color: inherit;
}

.note a {
  color: #1a1a1a;
}

.muted {
  opacity: 0.65;
  font-size: 12px;
}

/* ===== Leaderboard ===== */

.leader {
  position: fixed;
  top: 110px;
  right: 16px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 16px;
  min-width: 280px;
  max-height: 70vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 25;
  color: var(--ink);
}

.leader h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
  align-items: center;
}

.lb-row:last-child {
  border-bottom: 0;
}

.lb-row.top1 {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.03));
  outline: 1px solid #1a1a1a;
  border-radius: 8px;
  margin: 2px 0;
}

.lb-row.me {
  background: var(--cream);
}

.medal {
  font-size: 16px;
}

.you-badge {
  font-size: 10px;
  background: #1a1a1a;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* ===== Skins ===== */

.skins {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 400px) {
  .skins {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 340px) {
  .skins {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 16px 12px;
  }
}

.swatch {
  border-radius: var(--radius-sm);
  border: 0;
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: #fff;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.swatch:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.swatch.active {
  box-shadow: 0 0 0 2px var(--ink);
  background: var(--cream);
}

.swatch .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== Prize Popup ===== */

.prize {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 10px 12px;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.15);
  z-index: 40;
  animation: popIn 0.3s ease-out;
  color: #1a1a1a;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.prize img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.prize .txt {
  font-size: 14px;
}

/* ===== Reminder ===== */

.reminder {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 12px;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  padding: 12px 20px;
  padding-right: 40px;
  /* Space for close button */
  box-shadow: var(--shadow-md);
  z-index: 41;
  animation: slideDown 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: var(--ink);
  width: min(92%, 460px);
  flex-wrap: wrap;
  text-align: center;
}

.reminder-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.reminder-close:hover {
  opacity: 1;
}

@media (max-width: 480px) {
  .reminder {
    padding: 10px 16px;
    padding-right: 36px;
    border-radius: 20px;
    flex-direction: column;
    gap: 8px;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.reminder span {
  font-size: 13px;
  line-height: 1.4;
}

/* ===== Incentive Banner ===== */

.incentive {
  background: linear-gradient(90deg, rgba(66, 184, 131, 0.1), transparent);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
}

.incentive strong {
  color: var(--accent);
}

/* ===== Responsive ===== */

@media (max-width: 480px) {
  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .leader {
    right: 12px;
    left: 12px;
    min-width: auto;
    top: 100px;
  }
}

/* Small Phones (iPhone SE, etc.) */
@media (max-width: 370px) {
  :root {
    --radius-lg: 20px;
  }

  .card {
    padding: 20px 16px;
    width: 94vw;
  }

  .card h2 {
    font-size: 20px;
  }

  .drawer-item {
    padding: 12px 16px;
    font-size: 14px;
  }

  .menu-btn {
    width: 42px;
    height: 42px;
  }

  .score-display {
    padding: 6px 14px;
  }

  .current-score {
    font-size: 20px;
  }
}

/* Short Screens */
@media (max-height: 660px) {
  .card {
    padding: 16px;
  }

  .benefits {
    margin-bottom: 12px;
  }

  .row {
    margin: 8px 0;
  }

  .legal {
    margin-top: 10px;
  }

}

/* Unlocking Animation */
.modal.unlocking .card {
  animation: popInBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  position: relative;
}

/* Glow effect behind the soap */
.modal.unlocking .card::before {
  content: '';
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 100px;
  background: radial-gradient(ellipse at center, rgba(212, 160, 55, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 1.5s ease-in-out infinite;
  z-index: 0;
}

@keyframes pulse-glow {

  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.6;
  }

  50% {
    transform: translateX(-50%) scale(1.15);
    opacity: 1;
  }
}

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

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

/* Confetti container */
.unlock-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.unlock-confetti span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 3s ease-in forwards;
  opacity: 0;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(400px) rotate(720deg);
    opacity: 0;
  }
}

/* Generate confetti pieces with different delays and positions */
.unlock-confetti span:nth-child(1) {
  left: 10%;
  background: #ff6b6b;
  animation-delay: 0s;
}

.unlock-confetti span:nth-child(2) {
  left: 20%;
  background: #4ecdc4;
  animation-delay: 0.1s;
}

.unlock-confetti span:nth-child(3) {
  left: 30%;
  background: #ffe66d;
  animation-delay: 0.05s;
}

.unlock-confetti span:nth-child(4) {
  left: 40%;
  background: #95e1d3;
  animation-delay: 0.15s;
}

.unlock-confetti span:nth-child(5) {
  left: 50%;
  background: #f38181;
  animation-delay: 0.08s;
}

.unlock-confetti span:nth-child(6) {
  left: 60%;
  background: #aa96da;
  animation-delay: 0.12s;
}

.unlock-confetti span:nth-child(7) {
  left: 70%;
  background: #fcbad3;
  animation-delay: 0.03s;
}

.unlock-confetti span:nth-child(8) {
  left: 80%;
  background: #a8d8ea;
  animation-delay: 0.18s;
}

.unlock-confetti span:nth-child(9) {
  left: 90%;
  background: #ffaaa5;
  animation-delay: 0.07s;
}

.unlock-confetti span:nth-child(10) {
  left: 15%;
  background: #dcedc1;
  animation-delay: 0.2s;
}

.unlock-confetti span:nth-child(11) {
  left: 25%;
  background: #ffd93d;
  animation-delay: 0.25s;
}

.unlock-confetti span:nth-child(12) {
  left: 35%;
  background: #6bcb77;
  animation-delay: 0.22s;
}

.unlock-confetti span:nth-child(13) {
  left: 45%;
  background: #ff6b6b;
  animation-delay: 0.28s;
}

.unlock-confetti span:nth-child(14) {
  left: 55%;
  background: #4ecdc4;
  animation-delay: 0.3s;
}

.unlock-confetti span:nth-child(15) {
  left: 65%;
  background: #ffe66d;
  animation-delay: 0.35s;
}

.unlock-confetti span:nth-child(16) {
  left: 75%;
  background: #aa96da;
  animation-delay: 0.32s;
}

.unlock-confetti span:nth-child(17) {
  left: 85%;
  background: #fcbad3;
  animation-delay: 0.38s;
}

.unlock-confetti span:nth-child(18) {
  left: 5%;
  background: #a8d8ea;
  animation-delay: 0.4s;
}

.unlock-confetti span:nth-child(19) {
  left: 95%;
  background: #95e1d3;
  animation-delay: 0.42s;
}

.unlock-confetti span:nth-child(20) {
  left: 50%;
  background: #f38181;
  animation-delay: 0.45s;
}

/* ===== Stats Modal ===== */

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-item {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.stat-label {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-display {
  cursor: pointer;
  pointer-events: auto;
}

.badge-chip {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700, #ffb347);
  color: #2c2420;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin: 4px;
}

/* ===== Status Pill ===== */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #e0f2f1;
  /* Soft teal/green */
  color: #00897b;
  /* Deep teal/green */
  padding: 6px 16px;
  border-radius: 99px;
  /* Pill shape */
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 137, 123, 0.15);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  /* Subtle lift */
}

.status-pill.large {
  padding: 10px 24px;
  font-size: 16px;
  gap: 10px;
}

.status-pill.large .icon {
  font-size: 18px;
}

.status-pill.large #connectedName {
  font-weight: 700;
  color: #00695c;
}

/* Prizes */
.prizes-container {
  background: #fdf6e9;
  border: 1px solid #fde68a;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.prizes-container h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #92400e;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.prize-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.6);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 15px;
  color: #451a03;
}

.prize-rank {
  font-size: 18px;
}

.prize-name {
  font-weight: 600;
}

/* ===== Splash Screen ===== */

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #b0e8ff url('../assets/splash.png') no-repeat center center;
  background-size: cover;
  /* Cover the whole screen */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  /* Loader at the bottom */
  padding-bottom: 80px;
  /* Space for loader */
  transition: opacity 0.5s ease-out, visibility 0.5s;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Image tag removed from HTML logic, handled by background */
.splash-screen img {
  display: none;
}

.splash-loader {
  font-family: 'Spinnaker', sans-serif;
  font-size: 16px;
  color: #fff;
  /* White text on busy background */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: pulse 1.5s infinite;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}