@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&family=Orbitron:wght@400;700;900&family=Noto+Sans+KR:wght@300;400;700&display=swap');

:root {
  --bg-color: #080c14;
  --panel-bg: rgba(17, 25, 40, 0.75);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  
  /* Neon Colors */
  --neon-cyan: #00f3ff;
  --neon-purple: #bd00ff;
  --neon-green: #39ff14;
  --neon-orange: #ff5f00;
  --neon-red: #ff3333;
  --neon-yellow: #ffd700;
  
  /* Glow effects */
  --glow-cyan: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(0, 243, 255, 0.2);
  --glow-purple: 0 0 10px rgba(189, 0, 255, 0.5), 0 0 20px rgba(189, 0, 255, 0.2);
  --glow-green: 0 0 10px rgba(57, 255, 20, 0.5), 0 0 20px rgba(57, 255, 20, 0.2);
  --glow-orange: 0 0 10px rgba(255, 95, 0, 0.5), 0 0 20px rgba(255, 95, 0, 0.2);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  background-image: 
    radial-gradient(at 10% 20%, rgba(189, 0, 255, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(0, 243, 255, 0.08) 0px, transparent 50%);
}

/* Screen Shells */
.screen {
  display: none;
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* Intro Screen */
#intro-screen {
  background: radial-gradient(circle at center, #111827 0%, #030712 100%);
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.title-container {
  margin-bottom: 2.5rem;
  animation: fadeIn 1.5s ease-out;
}

.title-container h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: var(--glow-cyan);
  margin-bottom: 0.5rem;
}

.title-container .subtitle {
  font-size: 1.3rem;
  color: var(--neon-purple);
  text-shadow: var(--glow-purple);
  font-weight: 700;
  letter-spacing: 2px;
}

.intro-content {
  max-width: 600px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  margin-bottom: 2rem;
  animation: slideUp 1s ease-out;
}

.intro-content p {
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.btn-primary {
  font-family: 'Orbitron', 'Noto Sans KR', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #000;
  background: var(--neon-cyan);
  border: none;
  border-radius: 8px;
  padding: 0.8rem 2.2rem;
  cursor: pointer;
  box-shadow: var(--glow-cyan);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

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

/* Game Screen Layout */
header {
  height: 70px;
  background: rgba(10, 15, 30, 0.8);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 10;
}

.header-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  text-shadow: var(--glow-cyan);
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-indicators {
  display: flex;
  gap: 10px;
}

.stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #27272a;
  border: 1px solid var(--panel-border);
  transition: all 0.5s ease;
}

.stage-dot.active {
  background: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.stage-dot.completed {
  background: var(--neon-green);
  box-shadow: var(--glow-green);
}

.utility-controls {
  display: flex;
  gap: 15px;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.btn-icon:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  color: var(--neon-cyan);
}

/* Main Workspace Grid - 280px sidebar, optimized for tablet landscape to give more canvas space */
.game-main {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 120px);
}

/* Left Panel: Dialogue & Story & Clues */
.left-panel {
  background: rgba(8, 12, 22, 0.9);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  padding: 0.8rem;
  gap: 0.8rem;
  overflow-y: auto;
}

.panel-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.75rem;
  backdrop-filter: blur(10px);
}

.panel-card h2 {
  font-size: 1rem;
  font-family: 'Orbitron', 'Noto Sans KR', sans-serif;
  color: var(--neon-cyan);
  margin-bottom: 0.6rem;
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
  padding-bottom: 0.3rem;
  text-transform: uppercase;
}

/* Dialogue Box & ADA Avatar */
.dialogue-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

#ada-avatar-container {
  background: rgba(0, 243, 255, 0.05);
  border-radius: 50%;
  padding: 2px;
  border: 1px solid rgba(0, 243, 255, 0.3);
  box-shadow: 0 0 8px rgba(0, 243, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
}

#avatar-ring {
  animation: rotateRing 10s linear infinite;
  transform-origin: center;
}

#avatar-scanline {
  animation: scanLine 2s ease-in-out infinite alternate;
  transform-origin: center;
}

.dialogue-speaker {
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  font-size: 0.95rem;
}

.dialogue-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  flex: 1;
}

.dialogue-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.8rem;
}

.btn-next {
  background: rgba(189, 0, 255, 0.2);
  border: 1px solid var(--neon-purple);
  color: #fff;
  border-radius: 4px;
  padding: 0.3rem 1rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s;
}

.btn-next:hover {
  background: var(--neon-purple);
  box-shadow: var(--glow-purple);
}

/* Clue & Info Panel */
.clue-item {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--neon-yellow);
  padding: 0.7rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
  border-radius: 0 4px 4px 0;
}

/* Right Panel: Interactive Game Canvas Area */
.right-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  position: relative;
  background-color: #030712;
  background-size: cover;
  background-position: center;
  transition: background-image 0.6s ease-in-out;
}

.right-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.65);
  z-index: 1;
  pointer-events: none;
  backdrop-filter: brightness(0.6) contrast(1.1);
  transition: opacity 0.5s ease-in-out, backdrop-filter 0.5s ease-in-out;
  opacity: 1;
}

/* 수색 모드(Locked)일 때는 우측 패널의 딤(Dimming) 효과 및 필터를 제거하여 배경을 쨍하게 노출 */
.right-panel:has(.puzzle-stage.active > .puzzle-lock-overlay:not(.unlocked))::before {
  opacity: 0;
  backdrop-filter: brightness(1) contrast(1);
}

.puzzle-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
}

.puzzle-stage {
  display: none;
  width: 95%;
  height: 92%;
  max-width: 1200px;
  max-height: 780px;
  background-color: rgba(10, 15, 30, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.02);
  position: relative;
  overflow-y: auto;
  padding: 1.8rem;
  transition: background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

/* 수색 모드(Locked)일 때는 중앙 퍼즐 판의 어두운 배경색, 테두리선, 그림자를 감추어 투명하게 만듦 */
.puzzle-stage:has(.puzzle-lock-overlay:not(.unlocked)) {
  background-color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.puzzle-stage::-webkit-scrollbar {
  width: 6px;
}
.puzzle-stage::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}
.puzzle-stage::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 255, 0.2);
  border-radius: 3px;
}
.puzzle-stage::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 243, 255, 0.4);
}

.puzzle-stage.active {
  display: flex;
  flex-direction: column;
}

.stage-header {
  font-family: 'Orbitron', 'Noto Sans KR', sans-serif;
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
  border-left: 3px solid var(--neon-cyan);
  padding-left: 8px;
}

.stage-desc {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

/* 🔍 Point & Click 수색 오버레이 기획 */
.puzzle-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  border-radius: 16px;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: all;
  text-align: center;
  padding: 2rem;
}

.puzzle-lock-overlay h3 {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0, 0, 0, 0.5);
}

.puzzle-lock-overlay p {
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.9);
}

.puzzle-lock-overlay.unlocked {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

/* 🔒 수색 잠금 상태일 때 뒤배경 플레이 요소 은폐 및 해제 시 페이드인 */
.puzzle-lock-overlay ~ * {
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.puzzle-lock-overlay:not(.unlocked) ~ * {
  opacity: 0 !important;
  pointer-events: none !important;
}

.btn-hotspot {
  background: rgba(189, 0, 255, 0.08);
  border: 2px dashed var(--neon-purple);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--glow-purple);
  transition: all 0.3s ease;
  animation: pulseBorder 1.5s infinite alternate;
}

.btn-hotspot:hover {
  background: rgba(189, 0, 255, 0.2);
  border-style: solid;
  transform: scale(1.03);
}

.btn-hotspot.scanned {
  border: 2px solid var(--neon-green);
  background: rgba(57, 255, 20, 0.15);
  color: var(--neon-green);
  box-shadow: var(--glow-green);
  animation: none;
  pointer-events: none;
}

/* Stage 1: Ancient Room */
.philosopher-drag-zone {
  display: flex;
  gap: 15px;
  justify-content: space-around;
  margin-top: 0.8rem;
}

.scroll-draggable {
  background: rgba(255, 215, 0, 0.08);
  border: 1px dashed var(--neon-yellow);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: grab;
  font-size: 0.85rem;
  text-align: center;
  transition: all 0.3s;
  user-select: none;
}

.scroll-draggable:hover {
  background: rgba(255, 215, 0, 0.15);
}

.scroll-draggable:active {
  cursor: grabbing;
}

.statue-dropzone {
  width: 170px;
  height: 140px;
  border-left: 2px solid rgba(189, 0, 255, 0.4);
  border-right: 2px solid rgba(189, 0, 255, 0.4);
  border-top: none;
  border-bottom: none;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 0.85rem;
  padding: 15px 10px;
  /* Cylindrical 3D gradient with vertical flutes */
  background: 
    repeating-linear-gradient(90deg, transparent, transparent 15px, rgba(189, 0, 255, 0.08) 15px, rgba(189, 0, 255, 0.08) 18px),
    linear-gradient(90deg, 
      rgba(8, 12, 22, 0.95) 0%, 
      rgba(24, 16, 41, 0.85) 25%, 
      rgba(42, 24, 69, 0.75) 50%, 
      rgba(24, 16, 41, 0.85) 75%, 
      rgba(8, 12, 22, 0.95) 100%
    );
  position: relative;
  overflow: visible;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.65), 
    inset 0 0 15px rgba(189, 0, 255, 0.15);
}

/* Greek Column Top (Capital) */
.statue-dropzone::before {
  content: "";
  position: absolute;
  top: -12px;
  left: -8px;
  right: -8px;
  height: 12px;
  background: linear-gradient(90deg, rgba(8, 12, 22, 0.95), rgba(189, 0, 255, 0.6), rgba(8, 12, 22, 0.95));
  border: 1px solid rgba(189, 0, 255, 0.4);
  border-radius: 4px 4px 2px 2px;
  box-shadow: 0 -2px 10px rgba(189, 0, 255, 0.3);
  transition: all 0.3s;
  z-index: 3;
}

/* Greek Column Base (Plinth) */
.statue-dropzone::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: -12px;
  right: -12px;
  height: 16px;
  background: linear-gradient(90deg, rgba(8, 12, 22, 0.95), rgba(189, 0, 255, 0.6), rgba(8, 12, 22, 0.95));
  border: 1px solid rgba(189, 0, 255, 0.4);
  border-radius: 2px 2px 4px 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(189, 0, 255, 0.3);
  transition: all 0.3s;
  z-index: 3;
}

.statue-dropzone strong {
  font-family: 'Orbitron', 'Noto Sans KR', sans-serif;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  z-index: 2;
  margin-bottom: 5px;
}

.statue-dropzone.hovered {
  border-left-color: var(--neon-cyan);
  border-right-color: var(--neon-cyan);
  box-shadow: 
    0 0 25px rgba(0, 243, 255, 0.5), 
    inset 0 0 20px rgba(0, 243, 255, 0.25);
}

.statue-dropzone.hovered::before,
.statue-dropzone.hovered::after {
  background: linear-gradient(90deg, rgba(8, 12, 22, 0.95), var(--neon-cyan), rgba(8, 12, 22, 0.95));
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.5);
}

.statue-dropzone.correct {
  border-left-color: var(--neon-green);
  border-right-color: var(--neon-green);
  background: 
    repeating-linear-gradient(90deg, transparent, transparent 15px, rgba(57, 255, 20, 0.08) 15px, rgba(57, 255, 20, 0.08) 18px),
    linear-gradient(90deg, 
      rgba(8, 12, 22, 0.95) 0%, 
      rgba(16, 41, 20, 0.85) 25%, 
      rgba(24, 69, 30, 0.75) 50%, 
      rgba(16, 41, 20, 0.85) 75%, 
      rgba(8, 12, 22, 0.95) 100%
    );
  box-shadow: 
    0 0 30px rgba(57, 255, 20, 0.4), 
    inset 0 0 20px rgba(57, 255, 20, 0.2);
}

.statue-dropzone.correct::before,
.statue-dropzone.correct::after {
  background: linear-gradient(90deg, rgba(8, 12, 22, 0.95), var(--neon-green), rgba(8, 12, 22, 0.95));
  border-color: var(--neon-green);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.5);
}

/* 🟢 Holographic Moving Laser Scan line style */
.column-scan-line {
  position: absolute;
  left: -2px;
  right: -2px;
  height: 4px;
  background: var(--neon-green);
  box-shadow: 0 0 12px var(--neon-green), 0 0 20px rgba(57, 255, 20, 0.8);
  opacity: 0.8;
  pointer-events: none;
  animation: columnScan 2.5s infinite ease-in-out;
  z-index: 5;
}

@keyframes columnScan {
  0% { top: 6px; }
  50% { top: calc(100% - 10px); }
  100% { top: 6px; }
}

.mirror-align-game {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}

.mirror-canvas {
  background: #090e18;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.mirror-controls {
  display: flex;
  gap: 15px;
  margin-top: 8px;
}

.btn-control {
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: #fff;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.8rem;
}

.btn-control:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.05);
}

.btn-control.active {
  background: rgba(0, 243, 255, 0.2);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: var(--glow-cyan);
}

/* Stage 2: Galileo Hill Game */
.galileo-canvas-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.timing-bar-container {
  width: 100%;
  height: 20px;
  background: #18181b;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-top: 10px;
  border: 1px solid var(--panel-border);
}

.timing-target-zone {
  position: absolute;
  height: 100%;
  background: rgba(57, 255, 20, 0.2);
  border-left: 2px solid var(--neon-green);
  border-right: 2px solid var(--neon-green);
}

.timing-indicator {
  position: absolute;
  height: 100%;
  width: 4px;
  background: #fff;
  box-shadow: 0 0 8px #fff;
  left: 0;
}

.shutter-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--neon-orange) 0%, #9a3412 100%);
  border: 4px solid #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  box-shadow: var(--glow-orange);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.shutter-btn:active {
  transform: scale(0.95);
  box-shadow: 0 0 10px rgba(255, 95, 0, 0.3);
}

/* Stage 3: Romer Solar System */
.romer-interface {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 15px;
  flex: 1;
}

.slider-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neon-cyan);
  cursor: pointer;
  box-shadow: var(--glow-cyan);
}

.obs-data-panel {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.data-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.data-row span:last-child {
  font-family: 'Orbitron', sans-serif;
  color: var(--neon-cyan);
}

/* Stage 4: Equation Box Choice */
.btn-eq-choice {
  font-size: 0.9rem;
  padding: 8px 16px;
  border: 1px solid var(--neon-purple);
  box-shadow: var(--glow-purple);
}
.btn-eq-choice:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}
.btn-eq-choice.correct {
  background: rgba(57, 255, 20, 0.2);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: var(--glow-green);
}

/* Stage 8: Interferometer Interface */
.interferometer-interface {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 15px;
  flex: 1;
}

/* Quiz Box styling */
.quiz-container {
  margin-top: 0.8rem;
  width: 100%;
}

.quiz-option {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.82rem;
  line-height: 1.4;
}

.quiz-option:hover {
  background: rgba(0, 243, 255, 0.08);
  border-color: var(--neon-cyan);
}

.quiz-option.correct {
  background: rgba(57, 255, 20, 0.1);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.quiz-option.incorrect {
  background: rgba(255, 51, 51, 0.1);
  border-color: var(--neon-red);
  color: var(--neon-red);
}

/* Input Code Area */
.escape-code-input {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 1rem;
}

.code-digit {
  border: 2px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(0,0,0,0.5);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  text-align: center;
  color: #fff;
}

.code-digit:focus {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  outline: none;
}

/* Footer Status Bar */
footer {
  height: 50px;
  background: #070a12;
  border-top: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-info span {
  font-family: 'Orbitron', sans-serif;
  color: var(--neon-cyan);
}

/* Victory Screen */
#victory-screen {
  background: radial-gradient(circle at center, #1e1b4b 0%, #030712 100%);
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.victory-banner {
  font-family: 'Orbitron', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--neon-green);
  text-shadow: var(--glow-green);
  margin-bottom: 1.2rem;
  animation: pulseGreen 2s infinite alternate;
}

.victory-card {
  max-width: 650px;
  background: var(--panel-bg);
  border: 1px solid var(--neon-green);
  box-shadow: var(--glow-green);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(12px);
  margin-bottom: 2rem;
}

.victory-card h2 {
  font-family: 'Orbitron', 'Noto Sans KR', sans-serif;
  color: #fff;
  margin-bottom: 0.8rem;
}

.victory-card p {
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

/* Toast Notification */
.toast-msg {
  position: absolute;
  bottom: 20px;
  right: 20px;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--panel-bg);
  border-left: 4px solid var(--neon-cyan);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  pointer-events: none;
  z-index: 100;
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-msg.error {
  border-left-color: var(--neon-red);
}

.toast-msg.success {
  border-left-color: var(--neon-green);
}

/* 🔄 Portrait 모드 경고 오버레이 (태블릿/모바일 반응형 대응) */
#orientation-warning {
  display: none; /* 기본 비활성, media query로 제어 */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #080c14;
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
}

.warning-box {
  background: var(--panel-bg);
  border: 2px solid var(--neon-orange);
  box-shadow: var(--glow-orange);
  border-radius: 16px;
  padding: 3rem 2rem;
  max-width: 450px;
}

.warning-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  animation: spin 3s linear infinite;
  display: inline-block;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGreen {
  from { text-shadow: 0 0 10px rgba(57, 255, 20, 0.4), 0 0 20px rgba(57, 255, 20, 0.1); }
  to { text-shadow: 0 0 20px rgba(57, 255, 20, 0.8), 0 0 35px rgba(57, 255, 20, 0.4); }
}

@keyframes pulseBorder {
  from { box-shadow: 0 0 5px rgba(189, 0, 255, 0.3); }
  to { box-shadow: 0 0 15px rgba(189, 0, 255, 0.7); }
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scanLine {
  0% { transform: translateY(-12px); }
  100% { transform: translateY(12px); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* 세로 모드(DPI 기준 세로가 더 길 때) 강제 차단 레이어 표출 */
@media (orientation: portrait) {
  #orientation-warning {
    display: flex;
  }
}

/* Canvas responsive scaling */
canvas {
  max-width: 100%;
  height: auto !important;
}

/* Custom layout utility classes */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

.highlight-cyan {
  color: var(--neon-cyan);
  font-weight: bold;
}

.highlight-purple {
  color: var(--neon-purple);
  font-weight: bold;
}

.highlight-yellow {
  color: var(--neon-yellow);
  font-weight: bold;
}

/* 🌌 시대별 시공간 전체화면 리얼 일러스트 배경 (AI 생성 이미지 적용) */
.right-panel.bg-stage-1 {
  background-image: url("assets/stage1.png"),
                    radial-gradient(circle at center, rgba(12, 18, 33, 0.2) 0%, #030712 100%) !important;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.right-panel.bg-stage-2 {
  background-image: url("assets/stage2.png"),
                    radial-gradient(circle at center, rgba(12, 18, 33, 0.2) 0%, #030712 100%) !important;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.right-panel.bg-stage-3 {
  background-image: url("assets/stage3.png"),
                    radial-gradient(circle at center, rgba(12, 18, 33, 0.2) 0%, #030712 100%) !important;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.right-panel.bg-stage-4 {
  background-image: url("assets/stage4.png"),
                    radial-gradient(circle at center, rgba(12, 18, 33, 0.2) 0%, #030712 100%) !important;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.right-panel.bg-stage-5 {
  background-image: url("assets/stage5.png"),
                    radial-gradient(circle at center, rgba(12, 18, 33, 0.2) 0%, #030712 100%) !important;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.right-panel.bg-stage-6 {
  background-image: url("assets/stage6.png"),
                    radial-gradient(circle at center, rgba(12, 18, 33, 0.2) 0%, #030712 100%) !important;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.right-panel.bg-stage-7 {
  background-image: url("assets/stage7.png"),
                    radial-gradient(circle at center, rgba(12, 18, 33, 0.2) 0%, #030712 100%) !important;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.right-panel.bg-stage-8 {
  background-image: url("assets/stage8.png"),
                    radial-gradient(circle at center, rgba(12, 18, 33, 0.2) 0%, #030712 100%) !important;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

/* 🔍 스캔 HUD 오버레이 효과 (수색 상태에서는 오리지널 요소를 제거하고, 퍼즐 스테이지의 의사클래스로 구동) */
.hud-scanner-overlay {
  display: none !important;
}

/* 🔍 공학 격자판 및 레이저 스캔 효과 - 플레이 모드(Unlocked)일 때만 작동 */
.puzzle-stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  border-radius: 16px;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
  z-index: 1;
}

.puzzle-stage::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  box-shadow: 0 0 10px var(--neon-cyan);
  animation: scanSweep 4s linear infinite;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
  z-index: 1;
}

/* 수색 모드(Locked)일 때는 격자판 및 레이저 스캔을 보이지 않게 처리 */
.puzzle-stage:has(.puzzle-lock-overlay:not(.unlocked))::before,
.puzzle-stage:has(.puzzle-lock-overlay:not(.unlocked))::after {
  opacity: 0 !important;
}

@keyframes scanSweep {
  0% { top: 0%; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* 📍 스캔 핫스팟 노드 스타일 */
.hotspot-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate(-50%, -50%);
}

.hotspot-pulse {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--neon-purple);
  box-shadow: var(--glow-purple);
  animation: pulseRadar 2s infinite ease-out;
  pointer-events: none;
}

.hotspot-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(10, 15, 30, 0.85);
  border: 2px solid var(--neon-purple);
  box-shadow: var(--glow-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 2;
  transition: all 0.3s;
}

.hotspot-label {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: bold;
  color: #fff;
  background: rgba(4, 6, 12, 0.85);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  letter-spacing: 0.5px;
}

.hotspot-node:hover .hotspot-icon {
  transform: scale(1.15);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.hotspot-node.scanned {
  pointer-events: none;
}

.hotspot-node.scanned .hotspot-pulse {
  border-color: var(--neon-green);
  box-shadow: var(--glow-green);
  animation: none;
  opacity: 0.5;
  transform: scale(1.1);
}

.hotspot-node.scanned .hotspot-icon {
  border-color: var(--neon-green);
  background: rgba(57, 255, 20, 0.15);
  color: var(--neon-green);
  box-shadow: var(--glow-green);
}

@keyframes pulseRadar {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* 🔍 정밀 조사 모달 (Inspect Modal) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
}

.inspect-card {
  width: 90%;
  max-width: 650px;
  background: rgba(13, 20, 35, 0.9);
  border: 1px solid var(--neon-cyan);
  box-shadow: var(--glow-cyan), inset 0 0 20px rgba(0, 243, 255, 0.15);
  border-radius: 16px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.inspect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
}

.inspect-header h3 {
  font-family: 'Orbitron', 'Noto Sans KR', sans-serif;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  font-size: 1.15rem;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  line-height: 0.8;
  transition: color 0.2s;
}

.btn-close:hover {
  color: var(--neon-red);
}

.inspect-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 600px) {
  .inspect-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.inspect-graphic-container {
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.9);
  overflow: hidden;
}

.inspect-graphic-container svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.3));
}

.inspect-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.inspect-desc-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  min-height: 120px;
}

.scan-progress-wrapper {
  margin-top: auto;
  background: rgba(0,0,0,0.2);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.03);
}

.scan-progress-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  font-family: 'Orbitron', 'Noto Sans KR', sans-serif;
}

.scan-progress-bar {
  width: 100%;
  height: 6px;
  background: #18181b;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
}

.scan-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  transition: width 0.15s linear;
}

/* 🖥️ 게임 캔버스 반응형 스케일 확대 및 좌우 레이아웃 최적 정렬 */
#romer-canvas, #fizeau-canvas, #foucault-canvas, #interferometer-canvas, .mirror-canvas, #galileo-canvas {
  width: 100% !important;
  height: auto !important;
}

.mirror-align-game {
  max-width: 600px;
  width: 100%;
}

#stage-2 {
  align-items: center;
}

.galileo-canvas-wrapper {
  max-width: 750px;
  width: 100%;
}

#stage-2 > div:last-child {
  max-width: 750px;
  width: 100%;
}

.romer-interface > div:first-child {
  max-width: 580px;
  width: 100%;
}

.fizeau-interface > div:first-child {
  max-width: 580px;
  width: 100%;
}

.foucault-interface > div:first-child {
  max-width: 580px;
  width: 100%;
}

.interferometer-interface > div:first-child {
  max-width: 550px;
  width: 100%;
}


