/* =====================================================================
   MISIÓN LAPAROSCOPÍA - SURGICAL ESCAPE ROOM STYLESHEET
   Design System: Modern High-Fidelity Medical / Surgical Cyber-OS
   ===================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #070d14;
  --bg-surface: #0e1724;
  --bg-card: rgba(16, 26, 40, 0.82);
  --bg-card-hover: rgba(22, 36, 56, 0.92);
  --border-color: rgba(0, 229, 255, 0.18);
  --border-glow: rgba(0, 229, 255, 0.45);

  --accent-cyan: #00e5ff;
  --accent-teal: #00b4d8;
  --accent-blue: #0077b6;
  --accent-green: #00f59b;
  --accent-warning: #ffb703;
  --accent-danger: #ff3366;
  --accent-purple: #9d4edd;

  --text-main: #f0f6fc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #38bdf8;

  /* Fonts */
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Chakra Petch', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows & Glows */
  --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.35);
  --glow-green: 0 0 20px rgba(0, 245, 155, 0.35);
  --glow-danger: 0 0 25px rgba(255, 51, 102, 0.45);
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.6);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Ambient scanline texture for surgical monitor look */
.monitor-scanlines {
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.5;
}

.vignette-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 60%, rgba(5, 10, 18, 0.85) 100%);
  pointer-events: none;
  z-index: 998;
}

/* Base Wrapper */
.game-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* =====================================================================
   HUD HEADER
   ===================================================================== */
.hud-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: rgba(10, 18, 28, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  gap: 16px;
}

.hud-left {
  display: flex;
  align-items: center;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.game-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.sub-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent-teal);
}

/* Stepper */
.stage-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 25, 38, 0.7);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.step-pip {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  transition: var(--transition);
}

.step-pip.active {
  background: var(--accent-cyan);
  color: #071018;
  border-color: #fff;
  box-shadow: 0 0 12px var(--accent-cyan);
  transform: scale(1.12);
}

.step-pip.completed {
  background: var(--accent-green);
  color: #071018;
  border-color: var(--accent-green);
  box-shadow: 0 0 8px rgba(0, 245, 155, 0.5);
}

.step-connector {
  width: 14px;
  height: 2px;
  background: rgba(148, 163, 184, 0.25);
}

/* HUD Right Vitals & Stats */
.hud-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hud-vital {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(12, 22, 34, 0.8);
  padding: 4px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 245, 155, 0.3);
}

.ecg-canvas-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

#ecg-canvas {
  width: 55px;
  height: 24px;
}

.hr-bpm {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-green);
  text-shadow: 0 0 8px rgba(0, 245, 155, 0.6);
}

.hr-unit {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.lives-container {
  display: flex;
  gap: 4px;
}

.heart-icon {
  font-size: 1.1rem;
  filter: grayscale(0.9) opacity(0.35);
  transition: var(--transition);
}

.heart-icon.active {
  filter: none;
  transform: scale(1.05);
  animation: pulse-heart 1.4s infinite ease-in-out;
}

@keyframes pulse-heart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat-label {
  font-size: 0.62rem;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.hud-btn {
  background: rgba(15, 28, 44, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.hud-btn:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
  transform: translateY(-1px);
}

/* =====================================================================
   VIEWPORT SCREENS
   ===================================================================== */
.viewport-stage {
  position: relative;
  flex: 1;
  display: flex;
  width: 100%;
  min-height: calc(100vh - 65px);
}

.screen-view {
  display: none;
  width: 100%;
  min-height: 100%;
  padding: 24px;
  animation: fadeIn 0.4s ease-out;
}

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

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

/* =====================================================================
   GLASS CARDS & COMPONENTS
   ===================================================================== */
.card-glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-danger {
  border-color: rgba(255, 51, 102, 0.5);
  box-shadow: 0 12px 40px rgba(255, 51, 102, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: #05101a;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 229, 255, 0.55);
}

.btn-glow {
  animation: glow-pulse 2.2s infinite ease-in-out;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 229, 255, 0.4); }
  50% { box-shadow: 0 0 30px rgba(0, 229, 255, 0.7); }
}

.btn-secondary {
  background: rgba(30, 45, 65, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(45, 65, 95, 0.9);
  border-color: var(--accent-cyan);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--text-main);
  color: #fff;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Tags & Badges */
.badge-tag {
  display: inline-block;
  padding: 4px 12px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.badge-tag.success {
  color: var(--accent-green);
  background: rgba(0, 245, 155, 0.12);
  border-color: rgba(0, 245, 155, 0.3);
}

.danger-pill {
  display: inline-block;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #fff;
  background: var(--accent-danger);
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.6);
}

/* =====================================================================
   SCREEN 1: WELCOME & BRIEFING
   ===================================================================== */
#screen-welcome {
  position: relative;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 65px);
  padding: 30px;
}

.fpv-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.1) brightness(0.7);
  z-index: 1;
  transition: transform 12s ease-in-out;
}

#screen-welcome:hover .fpv-background {
  transform: scale(1.02);
}

.fpv-overlay-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(10, 18, 28, 0.6) 20%, rgba(5, 10, 16, 0.94) 85%);
}

.welcome-card {
  position: relative;
  z-index: 10;
  max-width: 820px;
  width: 100%;
  padding: 36px 40px;
  border: 1px solid var(--border-glow);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), var(--glow-cyan);
}

.welcome-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
  padding-bottom: 20px;
}

.welcome-logo-badge {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
  object-fit: cover;
}

.welcome-titles h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
}

.welcome-titles .subtitle {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin-top: 4px;
}

.briefing-box {
  display: flex;
  gap: 20px;
  background: rgba(13, 24, 38, 0.85);
  border-left: 4px solid var(--accent-teal);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.docente-avatar-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 90px;
}

.docente-avatar-mini img {
  width: 65px;
  height: 65px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent-teal);
  object-fit: cover;
}

.avatar-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-teal);
  margin-top: 6px;
  line-height: 1.2;
}

.briefing-speech {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.briefing-speech p + p {
  margin-top: 8px;
}

.player-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 1.1rem;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: rgba(8, 15, 25, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-main);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.input-wrapper input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.35);
  background: rgba(12, 22, 36, 0.95);
}

.welcome-actions {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}

.welcome-actions .btn {
  flex: 1;
}

.welcome-footer {
  margin-top: 24px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.tech-spec {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* =====================================================================
   SCREEN 2: GAMEPLAY LAYOUT (SPLIT SCREEN SIMULATOR)
   ===================================================================== */
.gameplay-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 20px;
  width: 100%;
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* Left: Interactive Scenario Panel */
.scenario-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  position: relative;
}

.scene-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(14, 25, 40, 0.95);
  border-bottom: 1px solid var(--border-color);
}

.stage-tag {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
}

.scene-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  flex: 1;
  margin: 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phase-indicator {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(0, 245, 155, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 245, 155, 0.3);
  font-weight: 600;
}

/* Interactive Stage Canvas Container */
.interactive-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060b11;
  padding: 20px;
  overflow: hidden;
  min-height: 480px;
}

/* Clinical Feedback Toast Panel */
.clinical-feedback-panel {
  padding: 16px 20px;
  background: rgba(10, 20, 32, 0.96);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideUp 0.3s ease-out;
}

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

.feedback-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.feedback-badge.correct {
  background: var(--accent-green);
  color: #071018;
}

.feedback-badge.incorrect {
  background: var(--accent-danger);
  color: #fff;
}

.feedback-content {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #e2e8f0;
}

/* Right: Docente Sidebar */
.docente-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  overflow-y: auto;
}

.docente-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(14, 25, 40, 0.8);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.docente-avatar-frame {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
}

.docente-photo {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent-cyan);
  object-fit: cover;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

.voice-wave {
  position: absolute;
  bottom: -2px;
  right: -2px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  background: rgba(5, 10, 16, 0.85);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-cyan);
}

.voice-wave span {
  width: 3px;
  height: 4px;
  background: var(--accent-cyan);
  border-radius: 2px;
  transition: height 0.15s ease;
}

.voice-wave.speaking span:nth-child(1) { animation: wave 0.8s infinite 0.1s; }
.voice-wave.speaking span:nth-child(2) { animation: wave 0.8s infinite 0.3s; }
.voice-wave.speaking span:nth-child(3) { animation: wave 0.8s infinite 0.2s; }
.voice-wave.speaking span:nth-child(4) { animation: wave 0.8s infinite 0.4s; }

@keyframes wave {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

.docente-meta {
  display: flex;
  flex-direction: column;
}

.docente-role {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 1px;
  color: var(--accent-teal);
  font-weight: 700;
}

.docente-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 1px 0 2px 0;
}

.docente-status {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* Dialogue bubble */
.docente-dialogue-bubble {
  position: relative;
  background: rgba(18, 30, 48, 0.95);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.bubble-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #f1f5f9;
}

.bubble-text strong {
  color: var(--accent-cyan);
}

/* Choices & Interactive Area */
.interaction-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.choice-card {
  background: rgba(15, 27, 43, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: var(--transition);
  text-align: left;
  color: var(--text-main);
  outline: none;
}

.choice-card:hover {
  background: rgba(22, 38, 60, 0.95);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.2);
  transform: translateX(4px);
}

.choice-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.4);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.choice-text {
  font-size: 0.88rem;
  line-height: 1.45;
  color: #e2e8f0;
}

.choice-card.selected-correct {
  border-color: var(--accent-green);
  background: rgba(0, 245, 155, 0.12);
  box-shadow: 0 0 15px rgba(0, 245, 155, 0.3);
}

.choice-card.selected-correct .choice-letter {
  background: var(--accent-green);
  color: #071018;
}

.choice-card.selected-wrong {
  border-color: var(--accent-danger);
  background: rgba(255, 51, 102, 0.12);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.3);
}

.choice-card.selected-wrong .choice-letter {
  background: var(--accent-danger);
  color: #fff;
}

/* Emergency Banner */
.emergency-callout {
  display: flex;
  gap: 12px;
  background: rgba(255, 51, 102, 0.12);
  border: 1px solid var(--accent-danger);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.8rem;
  color: #ffd1dc;
  line-height: 1.4;
  animation: pulse-danger 2s infinite ease-in-out;
}

@keyframes pulse-danger {
  0%, 100% { border-color: rgba(255, 51, 102, 0.6); }
  50% { border-color: rgba(255, 51, 102, 1); box-shadow: 0 0 12px rgba(255, 51, 102, 0.4); }
}

/* =====================================================================
   SPECIFIC STAGE SIMULATOR MODULES
   ===================================================================== */
/* Stage 1: Manometer Dial Simulator */
.manometer-simulator {
  position: relative;
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

.manometer-simulator img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.manometer-overlay-readout {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(8, 16, 26, 0.92);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-mono);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.manometer-overlay-readout .readout-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  display: block;
}

.manometer-overlay-readout .readout-val {
  font-size: 1.25rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Stage 2 & 6: Laparoscopic Tower Interactive Hotspots */
.tower-interactive-wrap {
  position: relative;
  display: inline-block;
  max-height: 520px;
}

.tower-img {
  max-height: 520px;
  width: auto;
  border-radius: var(--radius-md);
  display: block;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.8));
}

.hotspot-pin {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(0, 229, 255, 0.3);
  border: 2px solid var(--accent-cyan);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.7);
  transform: translate(-50%, -50%);
  transition: var(--transition);
  animation: pulse-hotspot 1.8s infinite ease-in-out;
}

.hotspot-pin:hover {
  transform: translate(-50%, -50%) scale(1.25);
  background: var(--accent-cyan);
  color: #071018;
}

.hotspot-pin.identified {
  background: var(--accent-green);
  border-color: #fff;
  box-shadow: 0 0 12px rgba(0, 245, 155, 0.8);
  animation: none;
}

@keyframes pulse-hotspot {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 8px rgba(0, 229, 255, 0.4); }
  50% { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 0 20px rgba(0, 229, 255, 0.8); }
}

.hotspot-tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 18, 28, 0.95);
  border: 1px solid var(--accent-cyan);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.hotspot-pin:hover .hotspot-tooltip {
  opacity: 1;
}

/* Stage 3: Camera Socket Connector Drag/Plug Simulation */
.plug-simulation-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 600px;
  width: 100%;
}

.plug-simulation-canvas {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.plug-simulation-canvas img {
  width: 100%;
  height: auto;
  display: block;
}

.socket-target-zone {
  position: absolute;
  top: 52%;
  left: 49%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 60px;
  border: 2px dashed var(--accent-cyan);
  border-radius: var(--radius-md);
  background: rgba(0, 229, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-socket 1.5s infinite alternate;
}

.socket-target-zone.connected {
  border-style: solid;
  border-color: var(--accent-green);
  background: rgba(0, 245, 155, 0.25);
  animation: none;
}

@keyframes pulse-socket {
  from { border-color: var(--accent-cyan); box-shadow: 0 0 10px rgba(0, 229, 255, 0.3); }
  to { border-color: #fff; box-shadow: 0 0 25px rgba(0, 229, 255, 0.7); }
}

.socket-label {
  font-size: 0.68rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  text-align: center;
}

/* Stage 4: Draping Sleeve Simulation */
.draping-simulation-wrap {
  position: relative;
  max-width: 620px;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.7);
}

.draping-simulation-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* Stage 5: White Balance Gauze Simulator */
.white-balance-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 540px;
}

.monitor-preview-frame {
  position: relative;
  width: 100%;
  height: 280px;
  background: #000;
  border: 4px solid #1e293b;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.monitor-screen-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: filter 0.5s ease, background 0.5s ease;
}

.monitor-screen-content.tint-red {
  background: radial-gradient(circle, #fca5a5 0%, #dc2626 80%);
}

.monitor-screen-content.balanced {
  background: radial-gradient(circle, #f8fafc 0%, #cbd5e1 90%);
}

.wb-osd-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}

.wb-osd-badge.ok {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.gauze-disc {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-full);
  background: #f8fafc;
  border: 2px dashed #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.1), 0 4px 15px rgba(0,0,0,0.2);
}

/* Stage 7: Laparotomy Back Table Contingency */
.laparotomy-simulation-wrap {
  position: relative;
  max-width: 640px;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}

.laparotomy-simulation-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* =====================================================================
   SCREEN 3: GAME OVER
   ===================================================================== */
#screen-gameover {
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.gameover-card {
  max-width: 680px;
  width: 100%;
  padding: 36px;
  text-align: center;
  border-color: var(--accent-danger);
}

.gameover-header h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--accent-danger);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.gameover-body {
  margin-top: 24px;
}

.debrief-box {
  background: rgba(25, 12, 18, 0.85);
  border: 1px solid rgba(255, 51, 102, 0.35);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: left;
  margin-bottom: 24px;
}

.debrief-box h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 1.2px;
  color: var(--accent-danger);
  margin-bottom: 8px;
}

.debrief-box p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #ffd1dc;
}

.safety-reminder {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 51, 102, 0.3);
  font-size: 0.88rem;
  color: #fff;
}

.gameover-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
}

.stat-box {
  background: rgba(10, 18, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  min-width: 140px;
}

.stat-box .lbl {
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--text-secondary);
  display: block;
}

.stat-box .val {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.gameover-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* =====================================================================
   SCREEN 4: VICTORY & CERTIFICATE
   ===================================================================== */
#screen-victory {
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.victory-card {
  max-width: 820px;
  width: 100%;
  padding: 40px;
  text-align: center;
  border-color: rgba(0, 245, 155, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), var(--glow-green);
}

.trophy-badge {
  font-size: 3rem;
  margin-bottom: 6px;
  animation: bounce-trophy 2s infinite ease-in-out;
}

@keyframes bounce-trophy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.victory-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 1.5px;
  color: #fff;
  margin: 6px 0;
}

.certificate-box {
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(12, 28, 38, 0.85);
  border: 1px solid var(--accent-green);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0;
  text-align: left;
}

.cert-seal img {
  width: 75px;
  height: 75px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent-green);
}

.cert-info .cert-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--accent-green);
  font-weight: 700;
}

.cert-info .rank-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #fff;
  letter-spacing: 1px;
  margin: 2px 0 6px 0;
}

.cert-info .rank-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

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

.stat-pill {
  background: rgba(15, 27, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: var(--radius-md);
}

.stat-pill .pill-lbl {
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  display: block;
  margin-bottom: 4px;
}

.stat-pill .pill-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-green);
}

.docente-comment-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(14, 25, 40, 0.85);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 14px 18px;
  margin-bottom: 28px;
  text-align: left;
}

.docente-avatar-tiny img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent-cyan);
  object-fit: cover;
}

.comment-text {
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.45;
}

.victory-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* =====================================================================
   MODALS (LEADERBOARD & IMAGE REFERENCE)
   ===================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 15, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-color: var(--accent-cyan);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), var(--glow-cyan);
}

.modal-image-card {
  max-width: 900px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.modal-title-group h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 1px;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  overflow-y: auto;
  flex: 1;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.leaderboard-table th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--accent-teal);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
}

.leaderboard-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.leaderboard-table tr:hover td {
  background: rgba(0, 229, 255, 0.05);
}

.leaderboard-table tr.top-1 td {
  color: #ffd700;
  font-weight: 700;
}

.leaderboard-table tr.top-2 td {
  color: #c0c0c0;
}

.leaderboard-table tr.top-3 td {
  color: #cd7f32;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-img-preview {
  max-width: 100%;
  max-height: 60vh;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  object-fit: contain;
}

.modal-caption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* =====================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ===================================================================== */
@media (max-width: 1100px) {
  .gameplay-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    overflow-y: auto;
  }

  .interactive-stage {
    min-height: 400px;
  }
}

/* Screen Flash Danger Effect */
.screen-flash-danger {
  animation: flashDanger 0.4s ease-out;
}

@keyframes flashDanger {
  0% { filter: drop-shadow(0 0 40px rgba(255, 51, 102, 0.8)) hue-rotate(-20deg); }
  50% { background-color: rgba(255, 51, 102, 0.25); }
  100% { filter: none; background-color: transparent; }
}

@media (max-width: 768px) {
  .hud-header {
    flex-wrap: wrap;
    padding: 8px 12px;
  }

  .stage-stepper {
    display: none;
  }

  .welcome-card {
    padding: 24px 18px;
  }

  .welcome-header {
    flex-direction: column;
    text-align: center;
  }

  .briefing-box {
    flex-direction: column;
    text-align: center;
  }

  .victory-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gameover-actions, .welcome-actions, .victory-actions {
    flex-direction: column;
  }
}
