/* ============================================
   Vibe The Game - Stylesheet v3
   Shell refresh with local fonts and improved accessibility
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Core colors */
  --bg: #08121f;
  --bg-light: #0e1d31;
  --bg-deep: #040914;
  --accent: #7be07f;
  --accent-strong: #4ec465;
  --accent2: #4fd5f7;
  --gold: #ffd54f;
  --hot: #ff9560;
  --neon: #29d7ff;
  --text: #f1f4ff;
  --text-soft: #d5dcf4;
  --text-dim: #8e9bbb;
  --danger: #ef5350;
  
  /* Panel styling */
  --panel: rgba(8, 18, 31, 0.9);
  --panel-light: rgba(15, 31, 52, 0.82);
  --border: rgba(87, 125, 194, 0.45);
  --border-light: rgba(102, 187, 106, 0.22);
  
  /* Typography */
  --font-display: 'Trebuchet MS', 'Franklin Gothic Medium', 'Arial Narrow', sans-serif;
  --font-mono: 'Consolas', 'Lucida Console', 'Courier New', monospace;
  --font-ui: 'Segoe UI', 'Trebuchet MS', system-ui, -apple-system, sans-serif;
  --font-pixel: var(--font-mono);
  --font-system: var(--font-ui);
  
  /* Effects */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f23;
    --bg-light: #1a1a2e;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-smooth: always;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background:
    radial-gradient(circle at top, rgba(79, 213, 247, 0.12), transparent 24%),
    radial-gradient(circle at bottom right, rgba(255, 149, 96, 0.14), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.noscript-banner {
  padding: 16px 20px;
  background: #141d32;
  color: var(--text);
  font-family: var(--font-ui);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for accessibility */
*:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selection styles */
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ---- GAME CONTAINER ---- */
#game-container {
  position: relative;
  width: 100vw; height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(79, 213, 247, 0.12), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 149, 96, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(6, 12, 24, 0.9), rgba(4, 9, 20, 1));
}

#game-container::before,
#game-container::after {
  content: '';
  position: absolute;
  inset: 24px;
  pointer-events: none;
  border-radius: 28px;
}

#game-container::before {
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#game-container::after {
  inset: 16px;
  background:
    linear-gradient(120deg, rgba(41, 215, 255, 0.04), transparent 32%),
    linear-gradient(300deg, rgba(255, 149, 96, 0.05), transparent 26%);
  z-index: 0;
}

#gameCanvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--bg);
  cursor: crosshair;
  border-radius: 22px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 1;
}

/* ---- HUD ---- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(12px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) 12px calc(18px + env(safe-area-inset-left));
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

#hud-left, #hud-center, #hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#hud-right {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 360px;
}

#hud-center {
  flex-direction: column;
  gap: 6px;
}

.hud-item {
  background: linear-gradient(180deg, rgba(13, 26, 46, 0.92), rgba(8, 18, 31, 0.88));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(79, 143, 247, 0.18);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 10px;
  font-family: var(--font-pixel);
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

#bug-count {
  color: var(--gold);
  font-size: 12px;
}

#bug-count .bug-icon {
  display: inline-block;
  animation: bugWiggle 1s infinite;
}

.bug-icon-art {
  width: 16px;
  height: 16px;
  display: block;
  image-rendering: pixelated;
}

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

#area-name {
  color: var(--accent2);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 2px;
}

#objective-display {
  max-width: 340px;
  font-size: 8px;
  line-height: 1.5;
  color: #dfefff;
  text-align: center;
  white-space: normal;
  border-radius: 18px;
}

#quest-indicator {
  color: var(--gold);
  font-size: 8px;
  display: none;
}

#golden-bugs {
  color: #ffd700;
  font-size: 8px;
  display: none;
}

#combo-display {
  color: var(--hot);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#combo-display[data-hot="true"] {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(255, 159, 104, 0.2);
}

#dash-display[data-state="ready"] {
  color: var(--neon);
}

#dash-display[data-state="cooldown"] {
  color: #b0bec5;
}

#dash-display[data-state="locked"] {
  color: var(--text-dim);
}

#lure-display[data-state="ready"] {
  color: var(--gold);
}

#lure-display[data-state="active"] {
  color: var(--accent2);
  box-shadow: 0 0 18px rgba(41, 215, 255, 0.22);
}

#lure-display[data-state="cooldown"] {
  color: #b0bec5;
}

#lure-display[data-state="locked"] {
  color: var(--text-dim);
}

#storm-display[data-state="pull"] {
  color: var(--accent2);
  border-color: rgba(41, 215, 255, 0.4);
}

#storm-display[data-state="scatter"] {
  color: var(--gold);
  border-color: rgba(255, 213, 79, 0.45);
}

#storm-display[data-state="calm"] {
  color: var(--text-dim);
}

/* ---- INTERACT PROMPT ---- */
#interact-prompt {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 8px 20px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--accent);
  z-index: 15;
  display: none;
  animation: promptPulse 1.5s infinite;
  white-space: nowrap;
}

@keyframes promptPulse {
  0%, 100% { opacity: 1; border-color: var(--accent); }
  50% { opacity: 0.7; border-color: var(--accent2); }
}

/* ---- DIALOGUE BOX ---- */
#dialogue-box {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, calc(100vw - 40px));
  background: rgba(15, 15, 35, 0.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(79, 195, 247, 0.25);
  border-radius: 14px;
  padding: 0;
  z-index: 20;
  display: none;
  animation: slideUp 0.3s ease-out;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

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

#dialogue-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(79, 195, 247, 0.1);
  border-bottom: 1px solid var(--border);
}

#npc-portrait {
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 2px solid var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

#npc-name {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--accent2);
}

#dialogue-close {
  margin-left: auto;
}

.panel-close {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(79, 213, 247, 0.28);
  background: rgba(79, 213, 247, 0.09);
  color: var(--text-soft);
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.panel-close:hover {
  background: rgba(79, 213, 247, 0.18);
  border-color: rgba(79, 213, 247, 0.5);
  transform: translateY(-1px);
}

#dialogue-messages {
  max-height: 200px;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#dialogue-messages::-webkit-scrollbar {
  width: 4px;
}
#dialogue-messages::-webkit-scrollbar-track {
  background: transparent;
}
#dialogue-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.msg {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 85%;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg-npc {
  background: rgba(79, 195, 247, 0.1);
  border: 1px solid rgba(79, 195, 247, 0.2);
  color: #e0e0e0;
  align-self: flex-start;
}

.msg-player {
  background: rgba(102, 187, 106, 0.15);
  border: 1px solid rgba(102, 187, 106, 0.2);
  color: var(--accent);
  align-self: flex-end;
}

.msg-system {
  background: rgba(255, 213, 79, 0.1);
  border: 1px solid rgba(255, 213, 79, 0.2);
  color: var(--gold);
  align-self: center;
  font-size: 11px;
  text-align: center;
}

#dialogue-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
}

#dialogue-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

#dialogue-input:focus {
  border-color: var(--accent);
}

#dialogue-input::placeholder {
  color: var(--text-dim);
  font-size: 11px;
}

#dialogue-send {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  color: #000;
  font-family: var(--font-pixel);
  font-size: 9px;
  cursor: pointer;
  transition: background 0.2s;
}

#dialogue-send:hover {
  background: #81c784;
}

/* ---- INVENTORY ---- */
#inventory-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(500px, calc(100vw - 40px));
  background: rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 213, 79, 0.25);
  border-radius: 16px;
  padding: 24px;
  z-index: 25;
  display: none;
  animation: fadeIn 0.2s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#inventory-panel h2 {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 16px;
  text-align: center;
}

#inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.inv-item {
  background: rgba(255, 213, 79, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.inv-item-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.inv-item-name {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gold);
}

.inv-item-desc {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
}

#inventory-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 10px;
  padding: 20px;
}

.inv-stats {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 9px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.inv-close {
  display: flex;
  width: max-content;
  margin: 16px auto 0;
}

/* ---- NOTIFICATION ---- */
#notification {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 213, 79, 0.3);
  border-radius: 10px;
  padding: 10px 24px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--gold);
  z-index: 30;
  display: none;
  animation: notifSlide 0.3s ease-out;
  pointer-events: none;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

@keyframes notifSlide {
  from { transform: translateX(-50%) translateY(-10px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ---- ACHIEVEMENT ---- */
#achievement-popup {
  position: absolute;
  top: 120px;
  right: 20px;
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 14px 20px;
  z-index: 30;
  display: none;
  animation: achieveSlide 0.5s ease-out;
  pointer-events: none;
}

@keyframes achieveSlide {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

#achievement-popup .ach-label {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

#achievement-popup .ach-name {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--gold);
}

/* ---- START SCREEN ---- */
#start-screen {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(79, 213, 247, 0.2), transparent 26%),
    radial-gradient(circle at 85% 20%, rgba(255, 149, 96, 0.12), transparent 24%),
    linear-gradient(180deg, #07111f 0%, #091423 45%, #040914 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  overflow-y: auto;
}

#start-screen::before,
#start-screen::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.6;
}

#start-screen::before {
  width: 280px;
  height: 280px;
  top: 8%;
  left: -40px;
  background: radial-gradient(circle, rgba(79, 213, 247, 0.22), transparent 68%);
}

#start-screen::after {
  width: 360px;
  height: 360px;
  right: -80px;
  bottom: -80px;
  background: radial-gradient(circle, rgba(255, 149, 96, 0.18), transparent 70%);
}

.start-shell {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 36px));
  padding: clamp(28px, 5vw, 42px);
  border-radius: 30px;
  border: 1px solid rgba(79, 213, 247, 0.18);
  background:
    linear-gradient(180deg, rgba(10, 20, 36, 0.9), rgba(7, 15, 28, 0.78)),
    rgba(8, 16, 30, 0.75);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.45);
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.start-kicker {
  margin-bottom: 14px;
  color: var(--accent2);
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#start-screen .title {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 72px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f7fbff;
  text-shadow: 0 0 34px rgba(79, 213, 247, 0.2);
  margin-bottom: 10px;
  animation: titleGlow 2s infinite;
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 28px rgba(79, 213, 247, 0.18); }
  50% { text-shadow: 0 0 44px rgba(79, 213, 247, 0.3), 0 0 64px rgba(123, 224, 127, 0.16); }
}

#start-screen .subtitle {
  font-family: var(--font-ui);
  font-size: clamp(13px, 2vw, 18px);
  color: var(--text-soft);
  margin-bottom: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.start-badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(79, 213, 247, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-family: var(--font-ui);
  font-size: 12px;
}

.start-art-frame {
  width: min(560px, calc(100vw - 92px));
  padding: 16px;
  margin: 0 auto 26px;
  border: 1px solid rgba(79, 213, 247, 0.22);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)),
    rgba(8, 16, 30, 0.62);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

.start-art {
  width: 100%;
  display: block;
  border-radius: 16px;
  image-rendering: pixelated;
}

.start-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#start-screen .start-btn {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #06101c;
  background: linear-gradient(135deg, var(--accent) 0%, #c0ff8a 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 14px 34px;
  cursor: pointer;
  transition: all 0.2s;
  animation: startPulse 2s infinite;
}

#start-screen .start-btn:hover {
  transform: translateY(-1px) scale(1.02);
}

@keyframes startPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(102, 187, 106, 0.3); }
  50% { box-shadow: 0 0 40px rgba(102, 187, 106, 0.6); }
}

#start-screen .continue-info {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(123, 224, 127, 0.15);
  background: rgba(123, 224, 127, 0.06);
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-soft);
}

#start-screen .controls-hint {
  margin-top: 30px;
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-dim);
  text-align: center;
  line-height: 2.1;
}

/* ---- SITE FOOTER ---- */
.site-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  padding: 18px 24px 16px;
  border-top: 1px solid var(--border-light);
  background: linear-gradient(transparent, rgba(4, 9, 20, 0.6));
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-dim);
}

.footer-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-name {
  font-weight: 600;
  color: var(--text-soft);
}

.footer-title {
  opacity: 0.6;
}

.footer-links {
  display: flex;
  gap: 14px;
  align-items: center;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--accent);
}

.footer-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.footer-link-label {
  font-size: 11px;
}

.footer-copyright {
  font-size: 10px;
  opacity: 0.7;
}

.footer-privacy-link {
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-privacy-link:hover {
  color: var(--accent);
}

/* ---- BUG PARTICLES ---- */
.bug-particle {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

/* ---- MENU ---- */
#menu-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100vw - 40px));
  background: rgba(15, 15, 35, 0.88);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(79, 195, 247, 0.25);
  border-radius: 16px;
  padding: 30px;
  z-index: 40;
  display: none;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#menu-panel h2 {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--accent2);
  margin-bottom: 24px;
}

.menu-btn {
  display: block;
  width: 100%;
  font-family: var(--font-pixel);
  font-size: 11px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.menu-btn:hover {
  background: rgba(79, 195, 247, 0.1);
  border-color: var(--accent2);
}

.menu-btn.danger {
  color: var(--danger);
  border-color: rgba(239, 83, 80, 0.3);
}

.menu-btn.danger:hover {
  background: rgba(239, 83, 80, 0.1);
  border-color: var(--danger);
}

.menu-close {
  display: flex;
  width: max-content;
  margin: 12px auto 0;
}

/* ---- COOKIE CONSENT ---- */
#cookie-banner {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, calc(100vw - 40px));
  background:
    linear-gradient(180deg, rgba(12, 25, 44, 0.96), rgba(7, 15, 27, 0.94));
  border: 1px solid rgba(123, 224, 127, 0.22);
  border-radius: 22px;
  padding: 18px 22px;
  z-index: 100;
  text-align: center;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.38);
}

#cookie-banner p {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.6;
}

#cookie-banner a {
  color: var(--accent);
}

.cookie-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.cookie-btn {
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.cookie-btn.accept {
  background: var(--accent);
  color: #000;
}

.cookie-btn.accept:hover {
  background: #81c784;
}

.cookie-btn.decline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.cookie-btn.decline:hover {
  border-color: var(--text-dim);
}

/* ---- TRANSITION OVERLAY ---- */
#transition-overlay {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 35;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease-in-out, background 0.2s;
}

/* ---- MOBILE CONTROLS ---- */
#mobile-controls {
  display: none;
  position: absolute;
  bottom: env(safe-area-inset-bottom, 0);
  left: 0; right: 0;
  height: 200px;
  z-index: 8;
  pointer-events: none;
}

.mobile-dpad {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: 140px; height: 140px;
  pointer-events: auto;
}

.mobile-dpad button {
  position: absolute;
  width: 46px; height: 46px;
  background: rgba(102, 187, 106, 0.35);
  border: 2px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mobile-dpad button:active {
  background: rgba(102, 187, 106, 0.55);
  transform: scale(0.92);
}

.mobile-dpad .up    { top: 0; left: 47px; }
.mobile-dpad .down  { bottom: 0; left: 47px; }
.mobile-dpad .left  { top: 47px; left: 0; }
.mobile-dpad .right { top: 47px; right: 0; }

.mobile-action {
  position: absolute;
  right: 16px;
  bottom: 16px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.mobile-action button {
  width: 64px; height: 64px;
  background: rgba(79, 195, 247, 0.35);
  border: 2px solid var(--accent2);
  border-radius: 50%;
  color: var(--accent2);
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mobile-action button:active {
  background: rgba(79, 195, 247, 0.55);
  transform: scale(0.92);
}

.mobile-action .lure,
.mobile-action .scan {
  width: 68px;
  height: 40px;
  border-radius: 14px;
  font-size: 9px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  #hud { padding: 8px 12px; }
  .hud-item { padding: 4px 10px; font-size: 8px; }
  #bug-count { font-size: 10px; }
  #objective-display { max-width: 220px; }
  #hud-right { max-width: 240px; gap: 8px; }
  .start-shell { width: min(100%, calc(100vw - 24px)); padding: 22px 16px 28px; }
  .start-art-frame { width: min(100%, calc(100vw - 56px)); }
  .start-badges { gap: 8px; }
  .start-badge { font-size: 11px; }
  .site-footer { position: static; padding: 14px 16px 12px; width: 100%; flex-shrink: 0; }
  .footer-inner { flex-direction: column; gap: 8px; font-size: 10px; text-align: center; }
  .footer-icon { width: 14px; height: 14px; }
  #cookie-banner { width: min(100%, calc(100vw - 20px)); bottom: 10px; }
  .cookie-btns { flex-direction: column; }
  #mobile-controls { display: block; }
}

@media (hover: none) and (pointer: coarse) {
  #mobile-controls { display: block; }
  #custom-cursor { display: none !important; }
}

/* ---- QUESTS PANEL ---- */
#quests-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(450px, calc(100vw - 40px));
  background: rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(102, 187, 106, 0.25);
  border-radius: 16px;
  padding: 24px;
  z-index: 25;
  display: none;
  animation: fadeIn 0.2s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#quests-panel h2 {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 16px;
  text-align: center;
}

.quest-item {
  background: rgba(102, 187, 106, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.quest-item.completed {
  opacity: 0.5;
  border-color: var(--accent);
}

.quest-name {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--accent);
  margin-bottom: 4px;
}

.quest-desc {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  color: var(--text-dim);
}

.quest-status {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gold);
  margin-top: 4px;
}

.quests-close {
  display: flex;
  width: max-content;
  margin: 14px auto 0;
}

/* ---- BESTIARY ---- */
#bestiary-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(580px, calc(100vw - 40px));
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 159, 104, 0.25);
  border-radius: 16px;
  padding: 24px;
  z-index: 25;
  display: none;
  animation: fadeIn 0.2s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#bestiary-panel h2 {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--hot);
  margin-bottom: 8px;
  text-align: center;
  text-shadow: 0 0 20px rgba(255, 159, 104, 0.3);
}

.bestiary-progress {
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-dim);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.bestiary-entry {
  background: rgba(255, 159, 104, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.bestiary-entry:not(.undiscovered):hover {
  border-color: var(--hot);
  background: rgba(255, 159, 104, 0.08);
  transform: translateY(-1px);
}

.bestiary-entry.undiscovered {
  opacity: 0.3;
}

.bestiary-bug-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.bestiary-info { flex: 1; min-width: 0; }

.bestiary-name {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--gold);
  margin-bottom: 5px;
}

.bestiary-meta {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.bestiary-stat {
  color: var(--text-dim);
  font-size: 10px;
}

.bestiary-count {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--accent2);
  flex-shrink: 0;
  background: rgba(79, 195, 247, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
}

.bestiary-empty {
  text-align: center;
  color: var(--text-dim);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  padding: 30px 20px;
  line-height: 1.8;
  grid-column: 1 / -1;
}

.bestiary-close {
  display: flex;
  width: max-content;
  margin: 14px auto 0;
}

/* Rarity badges */
.rarity-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.rarity-badge.rarity-common {
  color: #aaa;
  background: rgba(170, 170, 170, 0.1);
  border: 1px solid rgba(170, 170, 170, 0.2);
}
.rarity-badge.rarity-uncommon {
  color: #66bb6a;
  background: rgba(102, 187, 106, 0.1);
  border: 1px solid rgba(102, 187, 106, 0.2);
}
.rarity-badge.rarity-rare {
  color: #4fc3f7;
  background: rgba(79, 195, 247, 0.1);
  border: 1px solid rgba(79, 195, 247, 0.2);
}
.rarity-badge.rarity-epic {
  color: #ce93d8;
  background: rgba(206, 147, 216, 0.1);
  border: 1px solid rgba(206, 147, 216, 0.2);
}
.rarity-badge.rarity-legendary {
  color: #ffd54f;
  background: rgba(255, 213, 79, 0.15);
  border: 1px solid rgba(255, 213, 79, 0.25);
  animation: legendaryGlow 2s infinite;
}

@keyframes legendaryGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(255, 213, 79, 0.2); }
  50% { box-shadow: 0 0 10px rgba(255, 213, 79, 0.4); }
}

/* ---- SCANNER ---- */
#scanner-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, calc(100vw - 40px));
  max-height: 80vh;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(41, 215, 255, 0.05), rgba(255, 122, 89, 0.03)),
    rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(79, 195, 247, 0.25);
  border-radius: 16px;
  padding: 24px;
  z-index: 26;
  display: none;
  animation: fadeIn 0.2s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#scanner-panel h2 {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--accent2);
  margin-bottom: 16px;
  text-align: center;
}

.scanner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.scanner-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(79, 195, 247, 0.18);
  border-radius: 12px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.scanner-kicker {
  font-family: var(--font-pixel);
  font-size: 7px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 8px;
}

.scanner-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 8px;
}

.scanner-body,
.scanner-stack,
.scanner-row-meta,
.scanner-empty {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
}

.scanner-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.scanner-pill {
  border: 1px solid rgba(79, 195, 247, 0.18);
  border-radius: 999px;
  padding: 4px 8px;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text);
}

.scanner-list {
  display: grid;
  gap: 8px;
}

.scanner-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scanner-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.scanner-row-name {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text);
}

.scanner-row-meta {
  text-align: right;
}

.scanner-state {
  font-family: var(--font-pixel);
  font-size: 7px;
  text-transform: uppercase;
}

.scanner-state-online {
  color: var(--accent);
}

.scanner-state-locked {
  color: var(--danger);
}

.scanner-state-requirement {
  color: var(--gold);
}

.scanner-stack {
  display: grid;
  gap: 8px;
}

.scanner-close {
  display: flex;
  width: max-content;
  margin: 16px auto 0;
}

.rarity-common { color: #aaa; }
.rarity-uncommon { color: #66bb6a; }
.rarity-rare { color: #4fc3f7; }
.rarity-epic { color: #ce93d8; }
.rarity-legendary { color: #ffd54f; }

/* ---- MINIMAP ---- */
#minimap {
  position: absolute;
  top: 60px;
  right: 16px;
  border: 2px solid var(--border);
  border-radius: 6px;
  z-index: 10;
  pointer-events: none;
  opacity: 0.8;
}
