/* ═══════════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════════ */
:root {
  --bg:       #080808;
  --surface:  #111111;
  --surface2: #1c1c1c;
  --border:   #2a2a2a;
  --accent:   #c8102e;
  --accent2:  #e84060;
  --white:    #ffffff;
  --muted:    #666666;
  --muted2:   #444444;
  --radius:   14px;
  --radius-sm:8px;
}

*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--white);
  font-family: 'Inter', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  user-select: none;
}

/* ═══════════════════════════════════════════
   SCREENS
═══════════════════════════════════════════ */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  gap: 16px;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--accent);
  color: var(--white);
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 0 24px rgba(200,16,46,0.35);
  min-width: 180px;
}
.btn-main:active {
  transform: scale(0.95);
  box-shadow: 0 0 12px rgba(200,16,46,0.2);
}
.btn-main.hidden { display: none !important; }

.btn-go-games {
  margin-top: 4px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 10px 24px;
  border-radius: 100px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-go-games:active { color: var(--white); border-color: var(--white); }

.hidden { display: none !important; }

/* ═══════════════════════════════════════════
   WELCOME SCREEN
═══════════════════════════════════════════ */
#screen-welcome {
  background: radial-gradient(ellipse at 50% 40%, #1a0208 0%, var(--bg) 70%);
  overflow: hidden;
}

.welcome-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.welcome-particles span {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 50%;
  animation: particle-float linear infinite;
  opacity: 0;
}
@keyframes particle-float {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-20px) scale(1.5); opacity: 0; }
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.deftones-cross {
  font-size: 56px;
  color: var(--accent);
  line-height: 1;
  animation: cross-pulse 3s ease-in-out infinite;
  text-shadow: 0 0 40px rgba(200,16,46,0.6);
}
@keyframes cross-pulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 40px rgba(200,16,46,0.6); }
  50%       { opacity: 0.7; text-shadow: 0 0 80px rgba(200,16,46,0.9); }
}

.welcome-sup {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

.welcome-name {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(64px, 18vw, 96px);
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1;
  text-shadow: 0 0 60px rgba(255,255,255,0.15);
}

.welcome-sub {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════
   FULL PLAYER PANEL (persistent fixed overlay)
═══════════════════════════════════════════ */
#player-full {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: radial-gradient(ellipse at 50% 30%, #180006 0%, var(--bg) 65%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 20px;
  /* slide in from top */
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.35s ease;
}
#player-full.pf-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Drag handle / collapse button */
.pf-handle {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 20px;
  transition: color 0.2s, background 0.2s;
}
.pf-handle:active { color: var(--white); background: var(--surface2); }
.pf-handle svg { transition: transform 0.2s; }
.pf-handle:active svg { transform: translateY(-3px); }

/* ═══════════════════════════════════════════
   MINI PLAYER BAR (persistent fixed top bar)
═══════════════════════════════════════════ */
#player-mini {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 199;
  height: 66px;
  background: rgba(17, 17, 17, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  /* slide in from top */
  transform: translateY(0);
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}
#player-mini.pm-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

.pm-inner {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
  overflow: hidden;
}

/* Mini album art */
.pm-art-wrap {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: box-shadow 0.4s;
}
.pm-art-wrap.playing {
  animation: pm-pulse 2.5s ease-in-out infinite alternate;
}
@keyframes pm-pulse {
  from { box-shadow: 0 0 0 0 rgba(200,16,46,0); }
  to   { box-shadow: 0 0 0 5px rgba(200,16,46,0.25); }
}
.pm-art-ph { font-size: 18px; }
#pm-art-img { width: 100%; height: 100%; object-fit: cover; }

/* Mini track info */
.pm-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pm-track {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.pm-band {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}

/* Mini controls */
.pm-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.pm-btn:active { color: var(--white); background: var(--surface2); }
.pm-play { color: var(--white) !important; }

/* Thin progress at bottom of mini bar */
.pm-progress {
  height: 2px;
  background: transparent;
}
.pm-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.5s linear;
}

/* Screens below mini player — push content down */
.screen.has-mini {
  padding-top: calc(24px + 66px) !important;
  justify-content: flex-start;
  padding-bottom: 24px;
}

/* ── Skip game button ────────────────────────── */
.skip-btn {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.15);
  font-size: 18px;
  cursor: pointer;
  padding: 8px 24px;
  line-height: 1;
}
.skip-btn:hover { color: rgba(255,255,255,0.35); }

/* ── Bday footer label ───────────────────────── */
.bday-label {
  position: fixed;
  bottom: 16px;
  left: 0; right: 0;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--muted2);
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 0.4s;
}
.bday-label.visible { opacity: 1; }

.player-band {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 5px;
  color: var(--accent);
  text-transform: uppercase;
}

.player-art-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-art-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  transition: opacity 0.4s;
}
.player-art-wrap.playing .player-art-ring {
  opacity: 0.5;
  animation: ring-spin 8s linear infinite;
}
@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.player-art {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  overflow: hidden;
  transition: transform 0.4s;
}
.player-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.player-art-placeholder {
  font-size: 48px;
}
.player-art-wrap.playing .player-art {
  animation: art-spin 12s linear infinite;
}
@keyframes art-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.player-track-info {
  text-align: center;
}
.player-track-name {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--white);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-track-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Visualizer */
.visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
  opacity: 0;
  transition: opacity 0.4s;
}
.visualizer.active { opacity: 1; }
.visualizer span {
  display: block;
  width: 3px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  transform-origin: bottom;
}

/* Progress */
.player-progress-wrap {
  width: 100%;
  max-width: 300px;
}
.player-progress-bg {
  width: 100%;
  height: 3px;
  background: var(--surface2);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}
.player-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  width: 0%;
  transition: width 0.5s linear;
}
.player-times {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

/* Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}
.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.ctrl-btn:active { background: var(--surface2); color: var(--white); }
.play-btn {
  width: 64px;
  height: 64px;
  background: var(--accent) !important;
  color: var(--white) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 24px rgba(200,16,46,0.4);
}
.play-btn:active { transform: scale(0.93); }

/* ═══════════════════════════════════════════
   GAME COMMON
═══════════════════════════════════════════ */
.game-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 100px;
}

.game-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.game-title {
  font-family: 'Oswald', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white);
}
.game-desc {
  font-size: 13px;
  color: var(--muted);
}

.game-win {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: win-appear 0.5s ease both;
}
@keyframes win-appear {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to   { opacity: 1; transform: none; }
}
.win-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--accent);
}
.win-text {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--white);
}

/* ═══════════════════════════════════════════
   GAME 1 — MEMORY
═══════════════════════════════════════════ */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 340px;
}

.mem-card {
  aspect-ratio: 1;
  perspective: 600px;
  cursor: pointer;
}
.mem-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
  border-radius: var(--radius-sm);
}
.mem-card.flipped .mem-card-inner { transform: rotateY(180deg); }

.mem-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border-radius: var(--radius-sm);
  font-size: 22px;
}
.mem-back {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 18px;
  flex-direction: column;
  gap: 2px;
}
.mem-back-cross { font-size: 20px; }

.mem-front {
  background: var(--surface);
  border: 1px solid var(--accent);
  transform: rotateY(180deg);
  font-size: 24px;
  overflow: hidden;
  padding: 0;
}
.mem-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mem-front-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 2px;
  padding: 4px;
}
.mem-front-fallback span:first-child { font-size: 18px; }
.mem-front-fallback span:last-child {
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.mem-card.matched .mem-front {
  border-color: var(--accent);
}
.mem-card.matched .mem-card-inner::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--accent);
  background: rgba(0,0,0,0.45);
  border-radius: var(--radius-sm);
  z-index: 5;
  transform: rotateY(180deg);
  backface-visibility: hidden;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   GAME 2 — TAP
═══════════════════════════════════════════ */
#screen-game2 { justify-content: flex-start; padding-top: 20px; }

.tap-score-wrap {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  margin-top: 4px;
}
#tap-score { color: var(--accent); }
.tap-score-max { font-size: 16px; color: var(--muted); }

.tap-arena {
  position: relative;
  width: 100%;
  flex: 1;
  max-height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
}

.tap-circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent2), var(--accent));
  box-shadow: 0 0 20px rgba(200,16,46,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transform-origin: center;
  animation: circle-shrink linear forwards;
  will-change: transform, opacity;
}
@keyframes circle-shrink {
  0%   { transform: scale(1);   opacity: 1; }
  80%  { transform: scale(0.4); opacity: 0.8; }
  100% { transform: scale(0);   opacity: 0; }
}
.tap-circle.tapped {
  animation: circle-tap 0.25s ease forwards !important;
}
@keyframes circle-tap {
  0%   { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0);   opacity: 0; }
}

.tap-start {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

/* ═══════════════════════════════════════════
   GAME 3 — QUIZ
═══════════════════════════════════════════ */
#screen-game3 { justify-content: flex-start; padding-top: 24px; }

.quiz-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
#quiz-correct { color: var(--accent); }

.quiz-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.quiz-question {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--white);
  text-align: center;
}
.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-ans {
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  text-align: left;
}
.quiz-ans:active { background: var(--border); }
.quiz-ans.correct {
  background: rgba(46,160,67,0.15);
  border-color: #2ea043;
  color: #4caf50;
}
.quiz-ans.wrong {
  background: rgba(200,16,46,0.12);
  border-color: var(--accent);
  color: var(--accent2);
}

/* ═══════════════════════════════════════════
   SCRATCH CARD
═══════════════════════════════════════════ */
.scratch-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.scratch-title {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.scratch-hint {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
}

.scratch-wrap {
  position: relative;
  width: min(340px, 90vw);
  height: min(420px, 65vh);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(200,16,46,0.2);
}
.scratch-reveal {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  text-align: center;
}

/* Gift photo — fills top portion */
.reveal-img {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #0a0a0a;
}

/* Caption bar at bottom */
.reveal-caption {
  width: 100%;
  padding: 12px 16px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.reveal-name {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--white);
  line-height: 1.2;
}
.reveal-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  touch-action: none;
  cursor: crosshair;
  display: block;
}

/* ═══════════════════════════════════════════
   RESTAURANT
═══════════════════════════════════════════ */
#screen-restaurant {
  background: radial-gradient(ellipse at 50% 60%, #08100a 0%, var(--bg) 70%);
  gap: 24px;
}

.resto-intro { text-align: center; }
.resto-pre {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.resto-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(48px, 14vw, 72px);
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1;
}
.resto-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
}

.resto-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}
.resto-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.15s;
}
.resto-card:active { transform: scale(0.97); }
.resto-card.selected {
  border-color: var(--accent);
  background: rgba(200,16,46,0.08);
}
.resto-card-icon { font-size: 28px; flex-shrink: 0; }
.resto-card-name {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--white);
}

.resto-chosen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  animation: win-appear 0.5s ease both;
}
.chosen-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid #2ea043;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #4caf50;
}
.chosen-label {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--white);
}
.chosen-name {
  font-family: 'Oswald', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #4caf50;
  letter-spacing: 1px;
}
.chosen-cta {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}
