/* ==========================================================================
   HIDDEN TREASURES: OBJECT FINDING ADVENTURE - STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --font-display: 'Cinzel', serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --gold-100: #fef3c7;
  --gold-300: #fde047;
  --gold-400: #facc15;
  --gold-500: #eab308;
  --gold-600: #ca8a04;
  --gold-glow: rgba(234, 179, 8, 0.4);
  
  --bg-dark: #060911;
  --bg-card: rgba(13, 20, 36, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.75);
  
  --border-gold: rgba(234, 179, 8, 0.35);
  --border-gold-bright: rgba(250, 204, 21, 0.8);
  
  --hud-height: 96px;
  --header-height: 60px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Hide scrollbars everywhere while keeping scrollability (whole gameplay) */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

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

/* Base App Wrapper */
#app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 40%, #152238 0%, #080c14 100%);
}

/* Three.js Canvas Layer */
#three-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* Screen Base */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

/* ==========================================================================
   MAIN MENU SCREEN
   ========================================================================== */
#screen-menu {
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.4) 0%, rgba(6, 9, 17, 0.95) 100%),
              url('https://images.unsplash.com/photo-1518709268805-4e9042af9f23?q=80&w=1920&auto=format&fit=crop') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.menu-content {
  position: relative;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: floatUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.game-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 9999px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--gold-300);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
}

.game-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, #fef08a 40%, #eab308 80%, #a16207 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
  text-transform: uppercase;
  letter-spacing: 1px;
}

.game-subtitle {
  color: #94a3b8;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 6px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.btn-menu {
  position: relative;
  width: 100%;
  padding: 15px 24px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
}

.btn-menu:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--gold-400);
  background: linear-gradient(135deg, rgba(45, 60, 85, 0.9) 0%, rgba(20, 30, 50, 0.98) 100%);
  box-shadow: 0 8px 25px rgba(234, 179, 8, 0.25), 0 0 15px rgba(234, 179, 8, 0.2);
}

.btn-menu:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-menu.btn-primary {
  background: linear-gradient(135deg, #ca8a04 0%, #eab308 50%, #ca8a04 100%);
  color: #0f172a;
  border-color: #fef08a;
  box-shadow: 0 6px 25px rgba(234, 179, 8, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.btn-menu.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706 0%, #facc15 50%, #eab308 100%);
  box-shadow: 0 8px 32px rgba(234, 179, 8, 0.55), 0 0 20px rgba(250, 204, 21, 0.4);
}

.btn-menu:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

.menu-footer {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #64748b;
  font-size: 0.85rem;
}

.btn-icon-square {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-gold);
  color: var(--gold-300);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.2rem;
}

.btn-icon-square:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--gold-400);
  color: #ffffff;
  transform: scale(1.06);
}

/* ==========================================================================
   GAMEPLAY SCREEN
   ========================================================================== */
#screen-game {
  background-color: #030712;
  display: flex;
  flex-direction: column;
}

/* Top Navigation Bar */
.game-top-bar {
  height: var(--header-height);
  background: rgba(6, 9, 17, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px;
  z-index: 30;
  flex-shrink: 0;
}

.bar-section {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.level-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bar-section .hud-counter-pill,
.bar-section .timer-badge,
.bar-section .btn-icon-square {
  flex-shrink: 0;
  white-space: nowrap;
}

.level-number-badge {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--gold-400);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.level-name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.hud-counter-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-gold);
}

.counter-icon {
  color: var(--gold-400);
  font-size: 1.1rem;
}

.counter-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
}

.counter-total {
  color: #94a3b8;
  font-size: 0.9rem;
}

.timer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #cbd5e1;
  font-weight: 600;
  padding: 6px 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}

.life-hearts {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 1rem;
  letter-spacing: 1px;
}

.life-heart {
  color: #f43f5e;
  filter: drop-shadow(0 0 4px rgba(244, 63, 94, 0.6));
  transition: transform 0.2s ease;
}

.life-heart.lost {
  color: #475569;
  filter: none;
  transform: scale(0.75);
}

/* Scene Viewport & Canvas Area */
.scene-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
  background-color: #020408;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 0 0;
  will-change: transform;
}

.scene-image-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  user-select: none;
  overflow: visible;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.scene-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* Layer for Fallback Canvas Scene when local image is loading */
.scene-canvas-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
}

/* Interactive Hitboxes Layer (Purely responsive coordinates) */
.scene-interactive-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: crosshair;
}

/* Highlight Indicator for Found Object */
.object-highlight {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  border: 3px solid var(--gold-400);
  box-shadow: 0 0 20px var(--gold-400), inset 0 0 15px rgba(250, 204, 21, 0.5);
  animation: foundPulseRing 2s infinite ease-out;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
}

.object-highlight::after {
  content: '✓';
  font-size: 1.1rem;
  font-weight: 900;
  color: #ffffff;
  background: #16a34a;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Round Reveal Highlight for Memorization Phase */
.object-reveal {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  border: 3px solid #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.9), inset 0 0 15px rgba(56, 189, 248, 0.4);
  animation: revealFade 2s ease-out forwards;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 14;
}

.object-reveal-icon {
  font-size: 1.6rem;
  opacity: 0.95;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.9));
}

@keyframes revealFade {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  70%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* Sparkle Flash on Hit */
.burst-sparkle {
  position: absolute;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(250,204,21,0.8) 40%, transparent 70%);
  animation: burstFlash 0.6s ease-out forwards;
  z-index: 25;
}

/* Wrong Click Indicator */
.wrong-click-indicator {
  position: absolute;
  width: 36px;
  height: 36px;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  font-size: 26px;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
  animation: wrongClickAnim 0.5s ease-out forwards;
  z-index: 25;
}

/* Screen Shake Effect */
.shake-scene {
  animation: sceneShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Zoom Controls Widget Floating in Scene */
.zoom-controls-floating {
  position: absolute;
  right: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 35;
  background: rgba(15, 23, 42, 0.85);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(8px);
}

.btn-zoom {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-zoom:hover {
  background: rgba(234, 179, 8, 0.25);
  border-color: var(--gold-400);
  color: var(--gold-300);
}

/* Hint Button Floating in Scene */
.hint-button-floating {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--border-gold);
  color: var(--gold-300);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.hint-button-floating:hover:not(:disabled) {
  border-color: var(--gold-400);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(15, 23, 42, 0.95) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--gold-glow);
}

.hint-button-floating:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

/* ==========================================================================
   BOTTOM OBJECT FINDING HUD BAR
   ========================================================================== */
.object-finding-bar {
  height: var(--hud-height);
  background: linear-gradient(180deg, rgba(13, 20, 36, 0.96) 0%, rgba(6, 9, 17, 0.98) 100%);
  border-top: 1px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  padding: 6px 16px 10px;
  z-index: 30;
  flex-shrink: 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
}

.object-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.object-bar-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-400);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.object-bar-hint-text {
  font-size: 0.75rem;
  color: #94a3b8;
}

.object-items-scroll {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.object-items-scroll::-webkit-scrollbar {
  display: none;
}

/* Object Card Item in Bottom Bar */
.object-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 130px;
  max-width: 180px;
  position: relative;
  overflow: hidden;
}

.object-card:hover {
  background: rgba(45, 60, 85, 0.8);
  border-color: var(--border-gold);
  transform: translateY(-2px);
}

.object-card-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.object-card-icon-wrap img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.object-card-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.object-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.object-card-status {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* Found Object Card State */
.object-card.found {
  background: rgba(22, 101, 52, 0.35);
  border-color: rgba(34, 197, 94, 0.5);
  opacity: 0.85;
}

.object-card.found .object-card-icon-wrap {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.6);
  color: #4ade80;
}

.object-card.found .object-card-name {
  text-decoration: line-through;
  color: #86efac;
}

.object-card.found .object-card-status {
  color: #4ade80;
  font-weight: 700;
}

.object-card.just-found {
  animation: cardFoundGlow 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: relative;
  background: linear-gradient(145deg, rgba(26, 38, 62, 0.95) 0%, rgba(13, 20, 36, 0.98) 100%);
  border: 1px solid var(--border-gold-bright);
  border-radius: 20px;
  padding: 32px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px var(--gold-glow);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(180deg, #ffffff 0%, #fef08a 60%, #eab308 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.modal-subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-top: 4px;
}

.btn-close-modal {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: #ef4444;
}

/* Setting Controls */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.setting-label-wrap {
  display: flex;
  flex-direction: column;
}

.setting-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
}

.setting-desc {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Custom Toggle Switch */
.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  border-radius: 34px;
  transition: 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .toggle-slider {
  background-color: #eab308;
}

input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

/* Volume Slider */
.range-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 140px;
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #334155;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-400);
  cursor: pointer;
  box-shadow: 0 0 8px var(--gold-glow);
}

/* ==========================================================================
   LEVEL COMPLETE SCREEN / MODAL
   ========================================================================== */
.victory-card {
  text-align: center;
  max-width: 480px;
}

.victory-icon-wrap {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.3) 0%, rgba(234, 179, 8, 0) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  animation: victoryBounce 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite alternate;
}

.victory-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(180deg, #ffffff 0%, #fde047 50%, #ca8a04 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.victory-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 1.8rem;
  color: var(--gold-400);
  margin-bottom: 16px;
}

.victory-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.victory-stat-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
}

.stat-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
}

/* ==========================================================================
   LEVEL SELECT SCREEN
   ========================================================================== */
#screen-level-select {
  background: linear-gradient(180deg, #0f172a 0%, #060911 100%);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.level-select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto 20px;
  width: 100%;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
  padding: 4px;
}

.level-card {
  position: relative;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.level-card:hover:not(.locked) {
  transform: translateY(-4px);
  border-color: var(--gold-400);
  box-shadow: 0 8px 25px rgba(234, 179, 8, 0.2);
}

.level-card-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #0b1324;
  position: relative;
  overflow: hidden;
}

.level-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.level-card:hover:not(.locked) .level-card-thumbnail img {
  transform: scale(1.08);
}

.level-card-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.level-card-num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--gold-400);
  font-weight: 700;
  text-transform: uppercase;
}

.level-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.level-card-badge.completed {
  background: rgba(22, 101, 52, 0.85);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.5);
}

.level-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.85);
}

.level-card.locked .level-card-badge {
  background: rgba(15, 23, 42, 0.85);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   HOW TO PLAY / TUTORIAL SCREEN
   ========================================================================== */
#screen-tutorial {
  background: linear-gradient(180deg, #0d1627 0%, #060911 100%);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.tutorial-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
  padding-right: 6px;
}

.tutorial-step-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-num-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--gold-500);
  color: #0f172a;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.5;
}

.tutorial-demo-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
}

.demo-flow-items {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.demo-chip {
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gold-300);
}

.demo-arrow {
  color: #64748b;
  font-weight: 900;
}

/* ==========================================================================
   PROCEED TO REVIEW BUTTON (in selection phase footer)
   ========================================================================== */
.btn-proceed-review {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 20px;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #0f172a;
  background: linear-gradient(135deg, #ca8a04 0%, #eab308 50%, #ca8a04 100%);
  border: 1px solid #fef08a;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(234, 179, 8, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: floatUp 0.4s ease-out;
}

.btn-proceed-review:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(234, 179, 8, 0.6), 0 0 20px rgba(250, 204, 21, 0.4);
}

.btn-proceed-review:active {
  transform: translateY(1px);
}

/* ==========================================================================
   REVIEW SCREEN
   ========================================================================== */
#screen-review {
  background: linear-gradient(180deg, #0d1627 0%, #060911 100%);
  display: flex;
  flex-direction: column;
}

.review-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  overflow-y: auto;
}

.review-intro {
  text-align: center;
  margin-bottom: 24px;
}

.review-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(180deg, #ffffff 0%, #fef08a 50%, #eab308 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.review-subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
}

.review-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  max-width: 800px;
  width: 100%;
  margin-bottom: 24px;
}

.review-object-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.review-object-card:hover {
  background: rgba(45, 60, 85, 0.8);
  border-color: var(--border-gold);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.review-object-card.selected {
  background: rgba(22, 101, 52, 0.35);
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3), inset 0 0 15px rgba(34, 197, 94, 0.1);
}

.review-object-card.selected .review-card-check {
  opacity: 1;
  transform: scale(1);
}

.review-card-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.review-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.review-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #16a34a;
  color: white;
  font-size: 0.8rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.review-footer {
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.review-status-text {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 14px;
  font-weight: 500;
}

.review-status-text.passing {
  color: #4ade80;
  font-weight: 700;
}

.review-status-text.failing {
  color: #f87171;
  font-weight: 700;
}

.btn-submit-review {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #0f172a;
  background: linear-gradient(135deg, #ca8a04 0%, #eab308 50%, #ca8a04 100%);
  border: 1px solid #fef08a;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 25px rgba(234, 179, 8, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-submit-review:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706 0%, #facc15 50%, #eab308 100%);
  box-shadow: 0 8px 32px rgba(234, 179, 8, 0.55), 0 0 20px rgba(250, 204, 21, 0.4);
  transform: translateY(-2px);
}

.btn-submit-review:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

/* ==========================================================================
   LEVEL FAILED MODAL
   ========================================================================== */
.failed-card {
  text-align: center;
  max-width: 440px;
}

.failed-icon-wrap {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.3) 0%, rgba(239, 68, 68, 0) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  animation: failedBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.failed-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(180deg, #ffffff 0%, #fca5a5 50%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.failed-subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

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

.failed-hint-text {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes foundPulseRing {
  0% { transform: translate(-50%, -50%) scale(0.85); box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.7); }
  70% { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 0 0 15px rgba(250, 204, 21, 0); }
  100% { transform: translate(-50%, -50%) scale(0.85); box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}

@keyframes burstFlash {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.6); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

@keyframes wrongClickAnim {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

@keyframes sceneShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes cardFoundGlow {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
  50% { transform: scale(1.08); box-shadow: 0 0 25px rgba(34, 197, 94, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes victoryBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

@keyframes failedBounce {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
  .bar-section {
    gap: 8px;
  }

  .game-top-bar {
    padding: 0 12px;
    gap: 8px;
  }

  .hud-counter-pill {
    padding: 5px 10px;
    gap: 6px;
  }

  .timer-badge {
    padding: 5px 10px;
    gap: 4px;
  }

  .btn-icon-square {
    width: 38px;
    height: 38px;
  }

  .level-name {
    max-width: 170px;
  }
}

@media (max-width: 768px) {
  :root {
    --hud-height: 84px;
    --header-height: 52px;
  }
  
  .game-top-bar {
    padding: 0 10px;
    gap: 6px;
  }
  
  .bar-section {
    gap: 6px;
  }
  
  .level-name {
    max-width: 110px;
    font-size: 0.85rem;
  }

  .level-number-badge {
    font-size: 0.62rem;
    letter-spacing: 1px;
  }
  
  .hud-counter-pill {
    padding: 4px 8px;
    gap: 4px;
  }

  .counter-icon {
    display: none;
  }

  .timer-badge {
    padding: 4px 7px;
    font-size: 0.8rem;
  }

  .life-hearts {
    font-size: 0.85rem;
    gap: 1px;
  }

  .btn-icon-square {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .object-card {
    min-width: 110px;
    padding: 4px 8px;
    gap: 6px;
  }
  
  .object-card-icon-wrap {
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
  }
  
  .object-card-name {
    font-size: 0.75rem;
  }
  
  .object-card-status {
    font-size: 0.65rem;
  }
  
  .zoom-controls-floating {
    right: 8px;
    top: 8px;
  }
  
  .hint-button-floating {
    left: 8px;
    top: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .review-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .review-card-icon {
    font-size: 2rem;
  }

  .review-card-name {
    font-size: 0.75rem;
  }

  .review-title {
    font-size: 1.4rem;
  }
}

@media (max-width: 420px) {
  .level-name {
    display: none;
  }

  .bar-section {
    gap: 4px;
  }

  .game-top-bar {
    padding: 0 8px;
  }

  .hud-counter-pill {
    padding: 3px 6px;
    font-size: 0.75rem;
  }

  .timer-badge {
    padding: 3px 5px;
    font-size: 0.75rem;
  }

  .btn-icon-square {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
}
