/* ============================================================
   CineAHO Premium 3D Neuro Reflex Game Stylesheet
   Follows Galaga/SandBox design system
   ============================================================ */

:root {
  --hue-purple: 270;
  --hue-blue: 210;
  --hue-green: 145;
  --hue-gold: 45;
  --hue-red: 350;
  --hue-cyan: 190;

  --bg-color: #040712;
  --bg-grid: rgba(255, 255, 255, 0.015);
  --panel-bg: rgba(10, 16, 32, 0.6);
  --panel-border: rgba(255, 255, 255, 0.05);
  --panel-hover-border: rgba(59, 130, 246, 0.25);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #475569;

  --grad-purple: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  --grad-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --grad-gold: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --grad-red: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);

  --neon-glow: 0 0 30px rgba(59, 130, 246, 0.2);
  --font-main: 'Noto Sans KR', 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
  --highlight-color: #3b82f6;
  --accent-purple: #a855f7;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at center, rgba(10, 16, 32, 0.45) 0%, rgba(4, 7, 18, 0.9) 100%);
  background-size: cover;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

body::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2; pointer-events: none;
}

.bg-glow { position: absolute; border-radius: 50%; filter: blur(150px); z-index: -3; pointer-events: none; opacity: 0.18; }
.bg-glow-purple { width: 500px; height: 500px; background: radial-gradient(circle, #7e22ce 0%, transparent 70%); top: -100px; left: 5%; }
.bg-glow-blue { width: 600px; height: 600px; background: radial-gradient(circle, #1d4ed8 0%, transparent 70%); top: 35%; right: 5%; }

/* ==========  HEADER  ========== */
.main-header { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 2rem; position: sticky; top: 0; z-index: 100; margin: 1rem 1.5rem 0 1.5rem; border-radius: 50px; transition: var(--transition-smooth); }
.glass-header { background: rgba(10, 16, 32, 0.75); border: 1px solid rgba(255, 255, 255, 0.05); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.logo-circle { width: 38px; height: 38px; background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 0.85rem; letter-spacing: 0.5px; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); }
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.logo-text { font-family: var(--font-main); font-weight: 700; font-size: 0.95rem; }
.logo-text span { color: var(--text-muted); font-weight: 400; }
.header-nav { flex-grow: 1; margin: 0 2rem; overflow-x: auto; scrollbar-width: none; }
.header-nav::-webkit-scrollbar { display: none; }
.nav-list { display: flex; list-style: none; gap: 1.25rem; white-space: nowrap; }
.nav-list a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: var(--transition-smooth); padding: 0.5rem 0.25rem; position: relative; }
.nav-list a:hover, .nav-list a.active { color: var(--text-main); }
.nav-list a.active::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: #3b82f6; border-radius: 2px; }
.btn-back-dashboard { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 30px; padding: 0.5rem 1.2rem; color: var(--text-main); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: var(--transition-smooth); }
.btn-back-dashboard:hover { background: rgba(255, 255, 255, 0.12); border-color: #3b82f6; transform: translateX(-2px); }

/* ==========  GLASS PANELS  ========== */
.glass-panel { background: var(--panel-bg); border: 1px solid var(--panel-border); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 20px; box-shadow: var(--shadow-card); transition: var(--transition-smooth); }
.glass-panel:hover { border-color: var(--panel-hover-border); }

/* ==========  LAYOUT  ========== */
.neuro-container { max-width: 1024px; margin: 0 auto; padding: 2rem 1.5rem 5rem 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }

/* Title Section */
.neuro-header-section { text-align: center; }
.main-title { font-size: 2.3rem; font-weight: 900; margin-bottom: 0.6rem; letter-spacing: -0.5px; background: linear-gradient(135deg, #fb7185 0%, #fbbf24 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-flex; align-items: center; gap: 0.5rem; }
.subtitle-desc { font-size: 0.95rem; color: var(--text-muted); max-width: 800px; margin: 0 auto 1.25rem auto; line-height: 1.6; }
.subtitle-desc .highlight-rose { color: #fb7185; font-weight: 600; }
.subtitle-desc .highlight-blue { color: #60a5fa; font-weight: 600; }
.tag-badges { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.badge { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); padding: 0.25rem 0.75rem; border-radius: 30px; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.badge-tag { background: rgba(251, 113, 133, 0.05); border-color: rgba(251, 113, 133, 0.12); color: #fb7185; }

/* ==========  STAT DASHBOARD  ========== */
.stat-dashboard-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat-card { padding: 1rem 1.25rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; text-align: center; }
.stat-icon { font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; gap: 0.35rem; }
.stat-icon.yellow { color: #fbbf24; }
.stat-icon.purple { color: #c084fc; }
.stat-icon.blue   { color: #60a5fa; }
.stat-icon.gold   { color: #fbbf24; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: #fff; letter-spacing: 0.5px; }

/* ==========  GAME WORKSPACE  ========== */
.game-workspace { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; }

/* Arena Panel */
.arena-panel { position: relative; padding: 0; width: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; background: rgba(2, 6, 23, 0.65); border: 1px solid rgba(244, 63, 94, 0.1); box-shadow: 0 0 35px rgba(244, 63, 94, 0.08); }

.arena { position: relative; width: 100%; height: 420px; overflow: hidden; cursor: crosshair; }

/* Target Spawn */
.target {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  animation: targetSpawn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.15s;
  z-index: 5;
}
.target:hover { transform: scale(1.15); }

.target-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.25) 0%, transparent 60%);
}

.target-ring {
  position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  animation: ringPulse 1s ease-in-out infinite;
}

@keyframes targetSpawn {
  0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.2); opacity: 0; }
}

/* Hit effect */
.hit-effect {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: hitBurst 0.5s ease-out forwards;
}
@keyframes hitBurst {
  0%   { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Miss effect */
.miss-flash {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(239, 68, 68, 0.15);
  pointer-events: none;
  animation: missFlash 0.3s ease-out forwards;
  border-radius: 20px;
}
@keyframes missFlash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Overlay */
.arena-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(4, 7, 20, 0.88); display: flex; align-items: center; justify-content: center; z-index: 15; text-align: center; backdrop-filter: blur(8px); border-radius: 20px; transition: opacity 0.4s ease; }
.arena-overlay.hidden { opacity: 0; pointer-events: none; }
.overlay-inner { display: flex; flex-direction: column; gap: 1.2rem; align-items: center; }
.overlay-title { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; background: linear-gradient(135deg, #fb7185 0%, #fbbf24 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -1px; }
.overlay-subtitle { font-size: 0.95rem; color: var(--text-muted); }

/* ==========  BUTTONS  ========== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.55rem 1.25rem; font-size: 0.85rem; font-weight: 700; border-radius: 8px; border: none; cursor: pointer; transition: var(--transition-smooth); }
.btn-primary { background: linear-gradient(135deg, #fb7185 0%, #f59e0b 100%); color: #fff; box-shadow: 0 4px 12px rgba(251, 113, 133, 0.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(251, 113, 133, 0.45); }
.btn-large { padding: 0.75rem 2rem; font-size: 1rem; border-radius: 10px; }

.difficulty-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.4rem; }
.btn-diff { padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 0.75rem; font-weight: 600; border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.03); color: var(--text-muted); cursor: pointer; transition: var(--transition-smooth); }
.btn-diff:hover { background: rgba(255,255,255,0.06); border-color: rgba(251, 113, 133, 0.3); color: var(--text-main); }
.btn-diff.active { background: rgba(251, 113, 133, 0.15); border-color: #fb7185; color: #fb7185; box-shadow: 0 0 10px rgba(251, 113, 133, 0.2); }

/* ==========  CONTROLS PANEL  ========== */
.controls-panel { width: 100%; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.controls-header-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 0.75rem; }
.controls-header-row h3 { font-size: 1.1rem; font-weight: 700; }
.controls-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.controls-details-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.control-col { display: flex; flex-direction: column; gap: 0.5rem; }
.control-col h4 { font-size: 0.88rem; font-weight: 700; color: #fb7185; display: flex; align-items: center; gap: 0.35rem; }
.control-col p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.control-col ul { list-style: none; }
.control-col li { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.control-col li strong { color: #fff; }

/* ==========  EXPLANATION BOARD  ========== */
.explanation-board-section { display: flex; flex-direction: column; gap: 1.25rem; width: 100%; }
.explanation-board-section .board-header { border-bottom: 2px solid #3b82f6; padding-bottom: 0.5rem; display: flex; align-items: center; gap: 0.75rem; }
.explanation-board-section .board-header i { font-size: 1.25rem; color: #3b82f6; }
.explanation-board-section .board-header h2 { font-size: 1.1rem; font-weight: 700; }
.explanation-board-section .board-header span { font-size: 0.8rem; color: var(--text-muted); }
.explanation-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start; }
.explanation-index-list { background: rgba(0, 0, 0, 0.15); border: 1px solid rgba(255,255,255,0.04); border-radius: 16px; overflow: hidden; }
.explanation-index-list ul { list-style: none; display: flex; flex-direction: column; }
.explanation-index-list li { padding: 0.7rem 1rem; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.03); display: flex; align-items: center; gap: 0.75rem; transition: var(--transition-smooth); }
.explanation-index-list li:last-child { border-bottom: none; }
.explanation-index-list li:hover { background: rgba(255, 255, 255, 0.02); color: var(--text-main); padding-left: 1.25rem; }
.explanation-index-list li.active { background: rgba(59, 130, 246, 0.1); color: #fff; border-left: 4px solid #3b82f6; padding-left: 1.25rem; }
.index-num { font-family: var(--font-display); font-size: 0.72rem; color: rgba(255,255,255,0.08); font-weight: 700; }
.explanation-index-list li.active .index-num { color: #3b82f6; }
.explanation-display-box { min-height: 320px; padding: 2.2rem; display: flex; flex-direction: column; border-left: 4px solid #93c5fd; background: linear-gradient(135deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.6) 100%); }
.display-content-inner { display: flex; flex-direction: column; gap: 1.25rem; opacity: 1; transition: opacity 0.3s ease-in-out; }
.display-top-badge { display: flex; align-items: center; gap: 0.5rem; background: rgba(59, 130, 246, 0.12); padding: 0.25rem 0.8rem; border-radius: 30px; width: fit-content; }
.display-top-badge i { font-size: 0.8rem; color: #60a5fa; }
.display-top-badge span { font-size: 0.72rem; font-weight: 700; color: #93c5fd; }
.explanation-display-box h3 { font-size: 1.45rem; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.display-text-body { font-size: 0.92rem; color: #e2e8f0; line-height: 1.7; }
.text-blue { color: #60a5fa; }

/* ==========  FLOATING NAV  ========== */
.floating-navigator { position: fixed; bottom: 2rem; right: 2rem; z-index: 1000; }
.floating-buttons-col { display: flex; flex-direction: column; gap: 0.5rem; }
.btn-float { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.08); background: rgba(10, 16, 32, 0.8); backdrop-filter: blur(10px); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition-smooth); }
.btn-float:hover { background: rgba(59, 130, 246, 0.15); border-color: #3b82f6; color: #fff; }

/* ==========  GAME COMPLETE OVERLAY  ========== */
.complete-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(4, 7, 20, 0.92); display: flex; align-items: center; justify-content: center; z-index: 20; text-align: center; backdrop-filter: blur(12px); border-radius: 20px; animation: fadeInOverlay 0.4s ease; }
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.complete-inner { display: flex; flex-direction: column; gap: 0.8rem; align-items: center; }
.complete-inner .trophy-icon { font-size: 3rem; background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: bounce 0.6s ease; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.complete-inner h2 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; background: linear-gradient(135deg, #fb7185, #fbbf24); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.complete-inner .result-line { font-size: 0.9rem; color: var(--text-muted); }
.complete-inner .result-line strong { color: #fff; }

/* ==========  RESPONSIVE  ========== */
@media (max-width: 768px) {
  .main-header { margin: 0.5rem; border-radius: 16px; padding: 0.75rem 1rem; }
  .logo-text { display: none; }
  .header-nav { margin: 0 0.5rem; }
  .stat-dashboard-cards { grid-template-columns: repeat(2, 1fr); }
  .controls-details-grid { grid-template-columns: 1fr; }
  .explanation-layout { grid-template-columns: 1fr; }
  .arena { height: 300px; }
}
@media (max-width: 480px) {
  .neuro-container { padding: 1rem 0.75rem 3rem; }
  .main-title { font-size: 1.6rem; }
  .arena { height: 250px; }
}
