/* ============================================================
   HORLICK & MILO: Cat Chaos at 3AM
   style.css — Complete Game Styles
   ============================================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

:root {
  --night-bg: #0d0120;
  --night-mid: #1a0533;
  --night-glow: #2d0a4e;
  --purple-deep: #3b0764;
  --accent-pink: #f472b6;
  --accent-yellow: #fbbf24;
  --accent-cyan: #22d3ee;
  --accent-green: #4ade80;
  --accent-orange: #fb923c;
  --accent-red: #f87171;
  --text-main: #f8e8ff;
  --text-dim: #c084fc;
  --wake-green: #4ade80;
  --wake-yellow: #fbbf24;
  --wake-red: #f87171;
  --font-display: 'Segoe UI', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Segoe UI', system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --hud-height: 56px;
  --controls-height: 130px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--night-bg);
  font-family: var(--font-body);
  color: var(--text-main);
  touch-action: none;
}

/* ---------- SCREEN SYSTEM ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--night-bg);
}
.screen.active {
  display: flex;
}

/* ---------- STAR BACKGROUND ---------- */
.stars-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle var(--dur, 2s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle {
  from { opacity: 0.1; transform: scale(0.8); }
  to   { opacity: 0.9; transform: scale(1.2); }
}

/* ---------- MOON ---------- */
.moon {
  position: absolute;
  top: 40px;
  right: 50px;
  font-size: 3.5rem;
  animation: moonGlow 4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 20px rgba(251,191,36,0.6));
  pointer-events: none;
}
@keyframes moonGlow {
  from { transform: translateY(0) rotate(-5deg); filter: drop-shadow(0 0 15px rgba(251,191,36,0.5)); }
  to   { transform: translateY(-8px) rotate(5deg); filter: drop-shadow(0 0 35px rgba(251,191,36,0.9)); }
}

/* ---------- MENU CAT ANIMATION ---------- */
.menu-cat-anim {
  position: absolute;
  font-size: 2.5rem;
  bottom: 200px;
  left: -60px;
  animation: catZoom 8s ease-in-out infinite;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(244,114,182,0.6));
}
@keyframes catZoom {
  0%   { left: -60px; transform: scaleX(1); }
  45%  { left: calc(100% + 20px); transform: scaleX(1); }
  46%  { left: calc(100% + 20px); transform: scaleX(-1); }
  90%  { left: -60px; transform: scaleX(-1); }
  91%  { left: -60px; transform: scaleX(1); }
  100% { left: -60px; transform: scaleX(1); }
}

/* ---------- MENU CONTENT ---------- */
.menu-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 20px;
  width: 100%;
  max-width: 480px;
}

/* GAME TITLE */
.game-title {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.title-line1 {
  font-size: clamp(1.8rem, 7vw, 3rem);
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #f472b6, #fbbf24, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(244,114,182,0.7));
  animation: titlePulse 3s ease-in-out infinite alternate;
}
@keyframes titlePulse {
  from { filter: drop-shadow(0 0 15px rgba(244,114,182,0.5)); }
  to   { filter: drop-shadow(0 0 30px rgba(244,114,182,1)); }
}
.title-line2 {
  font-size: clamp(0.95rem, 3.5vw, 1.3rem);
  color: var(--text-dim);
  letter-spacing: 6px;
  text-transform: uppercase;
  font-weight: 300;
}
.title-clock {
  font-size: 2.5rem;
  animation: clockBob 2s ease-in-out infinite alternate;
}
@keyframes clockBob {
  from { transform: rotate(-15deg) scale(0.9); }
  to   { transform: rotate(15deg) scale(1.1); }
}

/* CAT SELECT */
.cat-select {
  display: flex;
  gap: 16px;
}
.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 22px;
  border-radius: 16px;
  border: 2px solid rgba(192,132,252,0.3);
  background: rgba(45,10,78,0.6);
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.cat-btn:hover, .cat-btn.active {
  border-color: var(--accent-pink);
  background: rgba(244,114,182,0.15);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(244,114,182,0.3);
}
.cat-emoji { font-size: 2.2rem; }
.cat-name {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-yellow);
}
.cat-desc { font-size: 0.7rem; color: var(--text-dim); }

/* BUTTONS */
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 260px;
}
.btn-primary {
  padding: 14px 28px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, #f472b6, #c026d3);
  color: #fff;
  box-shadow: 0 4px 20px rgba(244,114,182,0.5);
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover, .btn-primary:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(244,114,182,0.7);
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  padding: 12px 24px;
  border: 2px solid rgba(192,132,252,0.5);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  background: rgba(45,10,78,0.4);
  color: var(--text-dim);
  backdrop-filter: blur(8px);
  transition: all 0.15s;
}
.btn-secondary:hover, .btn-secondary:active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(34,211,238,0.08);
  transform: translateY(-1px);
}

.menu-tagline {
  font-size: 0.75rem;
  color: rgba(192,132,252,0.5);
  letter-spacing: 1px;
  text-align: center;
  font-style: italic;
}

/* ---------- MUTE BUTTON ---------- */
.mute-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
  padding: 8px;
  border-radius: 50%;
  background: rgba(45,10,78,0.6);
  border: 1px solid rgba(192,132,252,0.3);
  transition: all 0.2s;
  backdrop-filter: blur(4px);
  line-height: 1;
}
.mute-btn:hover { transform: scale(1.1); }

/* ---------- HOW TO PLAY ---------- */
.howto-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 520px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  max-height: 100vh;
}
.howto-content h2, .howto-content h3 {
  text-align: center;
  color: var(--accent-pink);
  letter-spacing: 2px;
}
.howto-content h3 { font-size: 0.85rem; color: var(--accent-yellow); margin-bottom: -10px; }
.howto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.howto-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 12px;
  background: rgba(45,10,78,0.5);
  border: 1px solid rgba(192,132,252,0.2);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.howto-item span { font-size: 1.8rem; }
.howto-points, .controls-section {
  background: rgba(45,10,78,0.4);
  border-radius: 12px;
  border: 1px solid rgba(192,132,252,0.2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.point-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(192,132,252,0.1);
}
.point-row:last-child { border: none; }
.pts { color: var(--accent-yellow); font-weight: 700; }
.controls-section p { font-size: 0.8rem; color: var(--text-dim); line-height: 1.6; }

/* ---------- LEADERBOARD ---------- */
.leaderboard-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 100vh;
  align-items: center;
}
.leaderboard-content h2 {
  color: var(--accent-yellow);
  letter-spacing: 2px;
  text-align: center;
}
#leaderboard-list { width: 100%; }
.lb-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(45,10,78,0.5);
  border: 1px solid rgba(192,132,252,0.2);
  gap: 12px;
}
.lb-row.gold   { border-color: var(--accent-yellow); background: rgba(251,191,36,0.08); }
.lb-row.silver { border-color: #9ca3af; }
.lb-row.bronze { border-color: #b45309; }
.lb-rank { font-size: 1.3rem; width: 32px; text-align: center; }
.lb-name { flex: 1; font-size: 0.85rem; color: var(--text-dim); }
.lb-score { font-size: 1rem; font-weight: 800; color: var(--accent-yellow); }
.lb-level { font-size: 0.75rem; color: var(--accent-cyan); }
.lb-empty { text-align: center; color: var(--text-dim); padding: 40px; font-size: 0.9rem; }

/* ---------- GAME HUD ---------- */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hud-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(13,1,32,0.9), transparent);
  pointer-events: none;
}
#hud-left, #hud-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
}
#hud-right { align-items: flex-end; }
#hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#score-display {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
#score-label { font-size: 0.55rem; letter-spacing: 2px; color: var(--text-dim); font-weight: 600; }
#score-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent-yellow);
  text-shadow: 0 0 15px rgba(251,191,36,0.6);
}

#combo-display {
  background: linear-gradient(135deg, #f472b6, #c026d3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  animation: comboPulse 0.5s ease-in-out infinite alternate;
  display: inline-block;
}
@keyframes comboPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

#level-display {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  font-weight: 700;
}
#clock-display {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'Courier New', monospace;
}

#wake-meter-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
#wake-label { font-size: 0.9rem; }
#wake-bar-bg {
  width: 80px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}
#wake-bar {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--wake-green);
  transition: width 0.2s, background 0.3s;
}
#wake-icon { font-size: 0.9rem; min-width: 18px; text-align: center; }
#timer-display {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: 'Courier New', monospace;
}
#timer-display.urgent { color: var(--accent-red); animation: timerFlash 0.5s ease-in-out infinite alternate; }
@keyframes timerFlash {
  from { opacity: 1; }
  to   { opacity: 0.4; }
}

/* ---------- LEVEL BANNER ---------- */
#level-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 200;
  background: linear-gradient(135deg, rgba(13,1,32,0.95), rgba(59,7,100,0.95));
  border: 2px solid var(--accent-pink);
  border-radius: 20px;
  padding: 20px 40px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent-yellow);
  box-shadow: 0 0 40px rgba(244,114,182,0.5);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
#level-banner.show { transform: translate(-50%, -50%) scale(1); }

/* ---------- GAME CANVAS ---------- */
#gameCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* ---------- TOAST MESSAGES ---------- */
#toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  width: 90%;
  max-width: 340px;
}
.toast {
  background: rgba(45,10,78,0.9);
  border: 1px solid var(--accent-pink);
  border-radius: 24px;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-pink);
  backdrop-filter: blur(8px);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  text-align: center;
  box-shadow: 0 4px 20px rgba(244,114,182,0.3);
  letter-spacing: 0.5px;
}
.toast.score-toast {
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  font-size: 1rem;
}
.toast.combo-toast {
  color: #fff;
  background: linear-gradient(135deg, rgba(244,114,182,0.8), rgba(192,38,211,0.8));
  border-color: #fff;
  font-size: 1.1rem;
}
.toast.warning-toast {
  color: var(--accent-red);
  border-color: var(--accent-red);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.8); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- POWER-UP STATUS ---------- */
#powerup-status {
  position: fixed;
  bottom: calc(var(--controls-height) + 12px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(45,10,78,0.85);
  border: 1px solid var(--accent-cyan);
  border-radius: 30px;
  padding: 8px 16px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}
#powerup-icon { font-size: 1.2rem; }
#powerup-name { font-size: 0.75rem; font-weight: 700; color: var(--accent-cyan); }
#powerup-bar-bg {
  width: 60px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}
#powerup-bar {
  height: 100%;
  background: var(--accent-cyan);
  border-radius: 3px;
  transition: width 0.1s linear;
}

/* ---------- MOBILE CONTROLS ---------- */
#mobile-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--controls-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  z-index: 110;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  pointer-events: none;
  background: linear-gradient(to top, rgba(13,1,32,0.7), transparent);
}

#joystick-zone {
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
}
#joystick-base {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(45,10,78,0.7);
  border: 2px solid rgba(192,132,252,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  backdrop-filter: blur(8px);
}
#joystick-thumb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-pink), #c026d3);
  box-shadow: 0 0 12px rgba(244,114,182,0.6);
  position: absolute;
  transition: box-shadow 0.1s;
}

#action-zone {
  pointer-events: all;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.action-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent-yellow);
  background: linear-gradient(135deg, rgba(251,191,36,0.3), rgba(245,158,11,0.2));
  color: var(--accent-yellow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 20px rgba(251,191,36,0.3);
  transition: all 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.action-button:active {
  transform: scale(0.9);
  box-shadow: 0 0 30px rgba(251,191,36,0.7);
  background: rgba(251,191,36,0.4);
}
#action-icon { font-size: 1.6rem; line-height: 1; }
#action-label { font-size: 0.55rem; font-weight: 800; letter-spacing: 1px; }

#pause-btn {
  font-size: 1rem;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(45,10,78,0.6);
  border: 1px solid rgba(192,132,252,0.3);
  cursor: pointer;
  color: var(--text-dim);
  backdrop-filter: blur(4px);
}

/* ---------- PAUSE OVERLAY ---------- */
#pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(13,1,32,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.pause-box {
  background: rgba(45,10,78,0.9);
  border: 2px solid var(--accent-pink);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 240px;
  box-shadow: 0 0 40px rgba(244,114,182,0.4);
}
.pause-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--accent-pink);
}
.mute-btn-inline {
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}
.mute-btn-inline:hover { color: var(--accent-cyan); }

/* ---------- GAME OVER ---------- */
#screen-gameover .gameover-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px 20px;
  width: 100%;
  max-width: 480px;
  overflow-y: auto;
  max-height: 100vh;
}

#gameover-cat {
  font-size: 4rem;
  animation: catBounce 0.8s ease-in-out infinite alternate;
}
@keyframes catBounce {
  from { transform: translateY(0) rotate(-5deg); }
  to   { transform: translateY(-10px) rotate(5deg); }
}

#gameover-title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #f87171, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#gameover-subtitle {
  font-size: 0.9rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.final-stats {
  display: flex;
  gap: 16px;
}
.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(45,10,78,0.6);
  border: 1px solid rgba(192,132,252,0.3);
  min-width: 80px;
}
.stat-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent-yellow);
}
.stat-lbl {
  font-size: 0.6rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}

#new-record-badge {
  background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
  color: var(--night-bg);
  font-weight: 900;
  font-size: 1rem;
  padding: 8px 24px;
  border-radius: 30px;
  letter-spacing: 2px;
  animation: recordPulse 0.6s ease-in-out infinite alternate;
}
@keyframes recordPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

.achievements-earned {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 380px;
}
.achievement-chip {
  background: rgba(74,222,128,0.15);
  border: 1px solid var(--accent-green);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.75rem;
  color: var(--accent-green);
  font-weight: 700;
}

.gameover-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 240px;
}

.sponsor-banner {
  text-align: center;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px dashed rgba(192,132,252,0.3);
  background: rgba(45,10,78,0.3);
  font-size: 0.8rem;
  color: var(--text-dim);
  width: 100%;
  max-width: 300px;
}
.sponsor-banner strong { color: var(--accent-cyan); }
.sponsor-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-cyan), #0e7490);
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ---------- ACHIEVEMENT POPUP ---------- */
#achievement-popup {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 500;
  background: rgba(45,10,78,0.95);
  border: 2px solid var(--accent-green);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 30px rgba(74,222,128,0.4);
  backdrop-filter: blur(10px);
  max-width: 250px;
  transform: translateX(300px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#achievement-popup.show { transform: translateX(0); }
#achievement-icon { font-size: 1.8rem; }
#achievement-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#achievement-title-text {
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--accent-green);
  text-transform: uppercase;
  font-weight: 700;
}
#achievement-desc-text {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
}

/* ---------- FLOATING SCORE POPUP ---------- */
.score-popup {
  position: fixed;
  font-size: 1rem;
  font-weight: 900;
  color: var(--accent-yellow);
  text-shadow: 0 0 10px rgba(251,191,36,0.8);
  pointer-events: none;
  z-index: 200;
  animation: floatUp 1.2s ease-out forwards;
  letter-spacing: 1px;
}
.score-popup.big { font-size: 1.4rem; color: var(--accent-pink); }
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(1.2); }
}

/* ---------- SCREEN SHAKE ---------- */
@keyframes screenShake {
  0%  { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-4px, 2px) rotate(-0.5deg); }
  40% { transform: translate(4px, -2px) rotate(0.5deg); }
  60% { transform: translate(-3px, 3px) rotate(0deg); }
  80% { transform: translate(3px, -1px) rotate(0.3deg); }
  100%{ transform: translate(0, 0) rotate(0deg); }
}
.shake {
  animation: screenShake 0.35s ease-in-out;
}

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

/* Scrollbar styling */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(192,132,252,0.4); border-radius: 2px; }

/* Focus outline removal for game elements */
button:focus, canvas:focus { outline: none; }

/* ---------- RESPONSIVE ADJUSTMENTS ---------- */
@media (max-width: 360px) {
  .menu-content { gap: 20px; }
  .title-line1 { font-size: 1.6rem; }
  .cat-btn { padding: 10px 16px; }
  .final-stats { gap: 10px; }
  .stat-box { padding: 10px 12px; min-width: 70px; }
}

@media (min-height: 800px) {
  #mobile-controls {
    height: calc(140px + var(--safe-bottom));
    padding-bottom: calc(24px + var(--safe-bottom));
  }
  #joystick-base { width: 100px; height: 100px; }
  .action-button { width: 90px; height: 90px; }
}

@media (hover: hover) and (pointer: fine) {
  /* Desktop: slightly smaller controls */
  #mobile-controls {
    height: 80px;
    background: none;
  }
  #joystick-zone { display: none; }
  #action-zone { flex-direction: row; gap: 12px; }
  .action-button { width: 60px; height: 60px; }
  #action-icon { font-size: 1.2rem; }
  #action-label { font-size: 0.5rem; }
  #pause-btn { align-self: center; }
}
