/* screens.css — Layout for each major screen (NO game-specific styles) */

/* ═══════════════════════════════════
   SCREEN BASE
   ═══════════════════════════════════ */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  height: 100%;
  max-height: 100%;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
}

.screen-enter {
  animation: screenFadeIn 0.35s ease;
}

/* ═══════════════════════════════════
   LOADER
   ═══════════════════════════════════ */
#loader-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  z-index: 9999;
  transition: opacity 0.5s ease;
  gap: var(--space-lg);
}

#loader-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-brand {
  text-align: center;
}

.loader-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  animation: iconGlow 2s ease-in-out infinite;
}

.loader-title {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--cyan), var(--pink), var(--gold));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientText 3s ease infinite;
  letter-spacing: 4px;
}

.loader-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 8px;
}

.loader-bar-track {
  width: 180px;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  border-radius: 2px;
  animation: loadBarFill 1.8s ease forwards;
}

.loader-dots {
  display: flex;
  gap: var(--space-sm);
}

.loader-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--cyan);
  animation: dotPulse 1.2s ease infinite;
}
.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }

/* ═══════════════════════════════════
   MAIN MENU
   ═══════════════════════════════════ */
#menu-screen {
  justify-content: flex-start;
  align-items: stretch;
  gap: clamp(8px, 2vh, 16px);
  overflow-y: auto;
  padding: 0;
}

/* ── Top bar ── */
.menu-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  flex-shrink: 0;
  width: 100%;
}

.menu-lives-row {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
}
.menu-lives-icon { font-size: 0.9rem; }
.menu-lives-label {
  font-size: 0.73rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* Keep sound-btn in normal flow */
#menu-screen .sound-btn {
  position: static;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

/* ── Hero ── */
.menu-hero {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0 6px;
  animation: heroFloat 3s ease-in-out infinite;
}

.menu-logo-wrap {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: rgba(var(--cyan-rgb),0.07);
  border: 1px solid rgba(var(--cyan-rgb),0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  animation: iconGlow 2.5s ease-in-out infinite;
  box-shadow: 0 0 24px rgba(var(--cyan-rgb),0.12);
}

.menu-logo-icon {
  font-size: 2rem;
  line-height: 1;
}

.menu-logo-text {
  font-size: clamp(1.8rem, 8vw, 2.5rem);
  background: linear-gradient(135deg, var(--cyan) 0%, var(--pink) 50%, var(--gold) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientText 4s ease infinite;
  letter-spacing: 4px;
  filter: drop-shadow(0 0 20px rgba(var(--cyan-rgb), 0.3));
  line-height: 1;
}

.menu-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-top: 5px;
}

/* ── Stats row ── */
.menu-stats-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  margin: 0 20px;
  padding: 8px 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.menu-stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.menu-stat-value {
  font-size: 1.25rem;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(var(--gold-rgb), 0.5);
  line-height: 1;
}
.menu-stat-value.streak-val {
  color: var(--pink);
  text-shadow: 0 0 10px rgba(var(--pink-rgb), 0.5);
}

.menu-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.menu-stat-divider {
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
  margin: 0 14px;
}

/* ── CTA buttons ── */
.menu-cta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 0 20px;
}

/* Play button — neon glass, theme-matched, animated scanline */
.menu-play-btn {
  width: 100%;
  max-width: 280px;
  padding: 14px 24px;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(0.95rem, 4.5vw, 1.1rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  border: 2px solid var(--cyan);
  color: var(--cyan);
  background: rgba(var(--cyan-rgb), 0.07);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s var(--ease-out), box-shadow 0.25s ease, background 0.25s ease;
  /* Pulsing border glow */
  animation: playBtnPulse 2.4s ease-in-out infinite;
}
/* Sweeping scanline highlight */
.menu-play-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(var(--cyan-rgb),0.18) 50%, transparent 100%);
  animation: playScan 2.4s ease-in-out infinite;
  pointer-events: none;
}
.menu-play-btn:hover {
  background: rgba(var(--cyan-rgb), 0.14);
  box-shadow: 0 0 36px rgba(var(--cyan-rgb), 0.55), 0 0 60px rgba(var(--cyan-rgb), 0.15);
  transform: translateY(-1px);
}
.menu-play-btn:active { transform: scale(0.97); animation: none; }

.menu-play-icon { font-size: 1rem; line-height: 1; flex-shrink: 0; }

.menu-bonus-btn {
  width: 100%;
  max-width: 280px;
  padding: 11px 20px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 1px;
  border-radius: var(--radius-md);
  border: 2px solid var(--gold);
  color: var(--gold);
  background: rgba(var(--gold-rgb), 0.07);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s, box-shadow 0.25s;
  animation: dailyGlow 2s ease-in-out infinite;
}
.menu-bonus-btn:hover { box-shadow: 0 0 22px rgba(var(--gold-rgb), 0.45); }
.menu-bonus-btn:active { transform: scale(0.97); }

/* ── Feature pills ── */
.menu-pills {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 20px;
}

.menu-pill {
  font-size: 0.64rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* ── Ad wrap — pinned at very bottom ── */
.menu-ad-wrap {
  flex-shrink: 0;
  width: 100%;
  overflow: hidden;
  max-height: 100px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ═══════════════════════════════════
   LEVEL SELECT — Mobile-first rebuild
   ═══════════════════════════════════ */
#level-screen {
  gap: 0;
  padding: 0;
  touch-action: pan-y;
  justify-content: flex-start;
  align-items: stretch;
}

/* Sticky frosted-glass header */
.ls-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  min-height: 54px;
}

.ls-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0 14px;
  height: 38px;
  min-width: 70px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.ls-back-btn:hover {
  color: var(--cyan);
  border-color: rgba(var(--cyan-rgb), 0.4);
  background: rgba(var(--cyan-rgb), 0.06);
}
.ls-back-btn:active { transform: scale(0.95); }

.ls-title {
  flex: 1;
  font-size: clamp(1rem, 4.5vw, 1.3rem);
  text-align: center;
  letter-spacing: 2px;
  line-height: 1;
}

.ls-pts-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(var(--gold-rgb), 0.08);
  border: 1px solid rgba(var(--gold-rgb), 0.28);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 38px;
  flex-shrink: 0;
}
.ls-pts-chip span:first-child { font-size: 0.85rem; line-height: 1; }
#ls-pts-val {
  font-size: 0.82rem;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(var(--gold-rgb), 0.4);
}

/* ── Summary strip ── */
.ls-summary {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 16px 10px;
  flex-shrink: 0;
  gap: 0;
}

.ls-summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.ls-summary-num {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(var(--cyan-rgb), 0.45);
}

.ls-summary-lbl {
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.ls-summary-sep {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.09);
  flex-shrink: 0;
}

/* ── Slim progress bar ── */
.ls-progress-track {
  width: calc(100% - 32px);
  margin: 0 16px 14px;
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.ls-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  border-radius: 2px;
  transition: width 0.6s var(--ease-out);
  min-width: 3px;
}

/* ── Scrollable body ── */
.ls-body {
  width: 100%;
  padding: 0 12px 100px;
  flex: 1 1 auto;
}

/* 2-column grid — mobile first */
.ls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Level card base ── */
.level-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  padding: 14px 12px 12px;
  cursor: pointer;
  touch-action: pan-y; /* immediately delegate vertical movement to the scroll container */
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 90px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s var(--ease-out), box-shadow 0.25s ease, border-color 0.25s ease;
  animation: levelCardIn 0.4s var(--ease-out) backwards;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.level-card:active { transform: scale(0.93); }

/* Card top row */
.lc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 2px;
}

.level-num {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(var(--cyan-rgb), 0.38);
}

.level-stars { font-size: 0.88rem; line-height: 1.2; letter-spacing: 1px; }

.level-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
}

.level-best {
  font-size: 0.63rem;
  color: var(--text-muted);
}

.level-req {
  font-size: 0.65rem;
  color: var(--pink);
}

.level-unlock-ready {
  font-size: 0.63rem;
  color: var(--green);
  text-shadow: 0 0 6px rgba(var(--green-rgb), 0.5);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Unlocked state ── */
.level-card.unlocked {
  border-color: rgba(var(--cyan-rgb), 0.2);
}
.level-card.unlocked:hover {
  border-color: rgba(var(--cyan-rgb), 0.48);
  box-shadow: 0 4px 20px rgba(var(--cyan-rgb), 0.16);
  transform: translateY(-2px);
}

/* ── Locked state ── */
.level-card.locked {
  opacity: 0.38;
  cursor: default;
}
.level-card.locked .level-num {
  color: var(--text-muted);
  text-shadow: none;
  font-size: 1.4rem;
}
.level-card.locked:active { transform: none; }

/* ── Can-unlock state ── */
.level-card.can-unlock {
  border-color: rgba(var(--green-rgb), 0.38);
  animation: levelCardIn 0.4s var(--ease-out) backwards,
             canUnlockPulse 2.2s ease-in-out infinite;
}
.level-card.can-unlock:hover {
  border-color: rgba(var(--green-rgb), 0.65);
  box-shadow: 0 4px 20px rgba(var(--green-rgb), 0.16);
  transform: translateY(-2px);
}
.level-card.can-unlock .level-num {
  color: var(--green);
  text-shadow: 0 0 10px rgba(var(--green-rgb), 0.38);
}

/* 3-star corner accent */
.lc-done-marker {
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 20px 20px 0;
  border-color: transparent rgba(var(--cyan-rgb), 0.28) transparent transparent;
  pointer-events: none;
}



/* ═══════════════════════════════════
   GAME OVER & LEVEL COMPLETE
   ═══════════════════════════════════ */
#gameover-screen,
#complete-screen {
  justify-content: flex-start;
  gap: 0;
  padding: 0;
}

.screen-content {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-lg);
}

/* ═══════════════════════════════════
   MENU FOOTER NAV
   ═══════════════════════════════════ */
.menu-footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 14px var(--space-lg) 10px;
  width: 100%;
  flex-shrink: 0;
}

.footer-nav-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}
.footer-nav-link:hover,
.footer-nav-link:focus-visible {
  color: var(--cyan);
  background: rgba(var(--cyan-rgb), 0.08);
  outline: none;
}
.footer-nav-link:active { transform: scale(0.95); }

/* ═══════════════════════════════════
   INFO SCREENS (Policy / About / HTP)
   ═══════════════════════════════════ */

/* Shared topbar used by info screens */
.screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-md) 0;
  flex-shrink: 0;
  gap: var(--space-sm);
}

.screen-title {
  font-size: 1.5rem;
  text-align: center;
  flex: 1;
}

.topbar-spacer {
  width: 80px;
  flex-shrink: 0;
}

.info-screen {
  align-items: stretch;
  gap: 0;
  padding: 0 var(--space-lg);
}

.info-content {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-bottom: var(--space-xl);
}

.info-content--centered {
  align-items: center;
  text-align: center;
}

/* Hero banner inside info pages */
.info-hero-banner {
  text-align: center;
  padding: var(--space-md) 0;
}
.info-hero-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: iconGlow 2.5s ease-in-out infinite;
}
.info-hero-title {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--cyan), var(--pink), var(--gold));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientText 4s ease infinite;
  letter-spacing: 3px;
}
.info-hero-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Section */
.info-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(var(--cyan-rgb), 0.2);
}

.info-section p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.info-list li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  padding-left: 16px;
  position: relative;
}
.info-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-weight: 700;
}

.info-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.info-effective-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -8px;
}

.info-version {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.info-link {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.info-link:hover { color: var(--pink); }

code {
  font-family: monospace;
  font-size: 0.85em;
  background: rgba(255,255,255,0.07);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--gold);
}

/* Timer colour blocks */
.info-rule-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.info-rule-emoji { font-size: 1.1rem; }

/* Combo table */
.combo-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.combo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
}
.combo-streak { font-size: 0.85rem; color: var(--text-secondary); }
.combo-mult {
  font-size: 1rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}
.mult-1  { color: var(--text-muted); background: rgba(255,255,255,0.05); }
.mult-2  { color: var(--cyan); background: rgba(var(--cyan-rgb),0.12); }
.mult-3  { color: var(--gold); background: rgba(var(--gold-rgb),0.12); }
.mult-5  { color: var(--pink); background: rgba(var(--pink-rgb),0.12); }
.mult-10 { color: var(--green); background: rgba(var(--green-rgb),0.15); text-shadow: 0 0 8px rgba(var(--green-rgb),0.5); }

/* Challenge type cards */
.challenge-badge-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.challenge-badge-icon { font-size: 1.6rem; flex-shrink: 0; line-height: 1; }
.challenge-badge-body { display: flex; flex-direction: column; gap: 4px; }
.challenge-badge-name { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }
.challenge-badge-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }

/* Contact email card */
.contact-email-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 24px;
  background: var(--bg-surface);
  border: 1px solid rgba(var(--cyan-rgb), 0.3);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.12s;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.contact-email-card:hover {
  border-color: rgba(var(--cyan-rgb), 0.6);
  box-shadow: 0 0 24px rgba(var(--cyan-rgb), 0.2);
}
.contact-email-card:active { transform: scale(0.97); }

.contact-email-icon { font-size: 1.6rem; }
.contact-email-address {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
  word-break: break-all;
}
