/* ==========================================================
   ESCAPE ROOM: EL DESPACHO DEL ADMINISTRADOR
   Estética: editorial noir · Cartagena modernista · papel y tinta
   ========================================================== */

:root {
  --bg-deep: #0a0a0f;
  --bg-paper: #f4efe4;
  --ink: #1a1814;
  --ink-muted: #6b6458;
  --accent-red: #b1321c;
  --accent-gold: #c4a062;
  --accent-blue: #2d4a5c;
  --stamp: #8a2820;
  --success: #4a7c3b;
  --warn: #c47933;
  --danger: #a42820;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  user-select: none;
  -webkit-user-select: none;
}

.hidden { display: none !important; }

kbd {
  display: inline-block;
  padding: 2px 8px;
  background: var(--ink);
  color: var(--bg-paper);
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
  vertical-align: middle;
}

/* =============== PANTALLA DE TÍTULO =============== */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  overflow: hidden;
}

#title-screen {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(196, 160, 98, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(177, 50, 28, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0f0d0a 0%, #06050a 100%);
}

.title-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}

.title-noise {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.title-content {
  position: relative;
  z-index: 2;
  max-width: 780px;
  padding: 40px;
  text-align: center;
  color: var(--bg-paper);
}

.title-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeIn 0.8s 0.2s forwards;
}

.title-main {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(42px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.title-word {
  display: inline-block;
  margin: 0 0.15em;
  opacity: 0;
  transform: translateY(30px);
  animation: wordRise 0.9s forwards;
}
.title-word:nth-child(1) { animation-delay: 0.3s; }
.title-word:nth-child(2) { animation-delay: 0.45s; }
.title-word:nth-child(3) { animation-delay: 0.6s; }
.title-word:nth-child(4) { animation-delay: 0.75s; }

.title-accent {
  font-style: italic;
  color: var(--accent-gold);
  font-weight: 400;
}

@keyframes wordRise {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.title-sub {
  font-family: 'Major Mono Display', monospace;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--accent-gold);
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeIn 0.8s 1s forwards;
}

.title-story {
  text-align: left;
  max-width: 580px;
  margin: 0 auto 40px;
  font-size: 17px;
  line-height: 1.65;
  color: rgba(244, 239, 228, 0.82);
  opacity: 0;
  animation: fadeIn 1s 1.2s forwards;
}

.title-story p {
  margin-bottom: 14px;
}

.title-story em {
  color: var(--accent-gold);
  font-style: italic;
}

.title-story strong {
  color: var(--bg-paper);
  font-weight: 600;
}

.title-warn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-red);
  padding-top: 10px;
  border-top: 1px solid rgba(196, 160, 98, 0.2);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 36px;
  background: var(--accent-gold);
  color: var(--bg-deep);
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.6s 1.5s forwards;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-paper);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 0;
}

.btn-primary:hover::before { transform: translateX(0); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(196, 160, 98, 0.3); }

.btn-label, .btn-arrow { position: relative; z-index: 1; }
.btn-arrow { font-size: 16px; transition: transform 0.25s; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.title-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  margin-top: 36px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(244, 239, 228, 0.5);
  opacity: 0;
  animation: fadeIn 0.8s 1.7s forwards;
}

/* =============== HUD =============== */

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  font-family: 'JetBrains Mono', monospace;
  color: var(--bg-paper);
}

.hud-top {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.hud-timer, .hud-progress, .hud-inventory {
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(196, 160, 98, 0.25);
  padding: 12px 18px;
  border-radius: 2px;
}

.timer-label, .progress-label, .inv-label {
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.timer-display {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--bg-paper);
  font-variant-numeric: tabular-nums;
}

.timer-display.warning { color: var(--warn); animation: pulse 1s infinite; }
.timer-display.danger { color: var(--accent-red); animation: pulse 0.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.progress-dots {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(196, 160, 98, 0.5);
  background: transparent;
  transition: all 0.4s;
}

.dot.solved {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(196, 160, 98, 0.6);
}

.inv-items {
  display: flex;
  gap: 6px;
  min-height: 24px;
  padding-top: 2px;
}

.inv-item {
  padding: 4px 10px;
  background: rgba(196, 160, 98, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
  animation: invAppear 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes invAppear {
  from { transform: scale(0) rotate(-10deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.hud-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.crosshair-dot {
  width: 4px;
  height: 4px;
  background: var(--bg-paper);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5);
  transition: all 0.2s;
}

.hud.focused .crosshair-dot {
  width: 12px;
  height: 12px;
  background: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.3), 0 0 10px rgba(196, 160, 98, 0.6);
}

.hud-prompt {
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent-gold);
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-gold);
  border-radius: 2px;
  animation: promptIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes promptIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hud-subtitle {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-style: italic;
  color: var(--bg-paper);
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  padding: 12px 24px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.hud-subtitle.show { opacity: 1; }

/* =============== CANVAS =============== */

#game-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}

#game-container canvas { display: block; }

/* =============== MODAL (PUZZLES) =============== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 10, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFade 0.3s;
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-paper);
  color: var(--ink);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  font-family: 'Cormorant Garamond', serif;
  border: 1px solid rgba(26, 24, 20, 0.15);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 60px rgba(196, 160, 98, 0.05);
  animation: modalRise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  background-image:
    radial-gradient(ellipse at top left, rgba(196, 160, 98, 0.06), transparent 60%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}

@keyframes modalRise {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--ink-muted);
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: all 0.2s;
  z-index: 51;
}

.modal-close:hover {
  background: var(--ink);
  color: var(--bg-paper);
  transform: rotate(90deg);
}

.puzzle-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 10px;
}

.puzzle-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 500;
  line-height: 1.05;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.puzzle-subtitle {
  font-size: 17px;
  font-style: italic;
  color: var(--ink-muted);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(26, 24, 20, 0.15);
}

.puzzle-question {
  font-size: 18px;
  line-height: 1.55;
  margin-bottom: 20px;
}

.puzzle-hint {
  background: rgba(196, 160, 98, 0.12);
  border-left: 3px solid var(--accent-gold);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 15px;
  font-style: italic;
}

.puzzle-hint strong {
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-red);
  display: block;
  margin-bottom: 4px;
}

.puzzle-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.puzzle-option {
  padding: 14px 18px;
  background: transparent;
  border: 1px solid rgba(26, 24, 20, 0.25);
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.puzzle-option:hover {
  border-color: var(--ink);
  background: rgba(26, 24, 20, 0.04);
  transform: translateX(4px);
}

.puzzle-option.correct {
  background: rgba(74, 124, 59, 0.15);
  border-color: var(--success);
  color: var(--success);
}

.puzzle-option.wrong {
  background: rgba(164, 40, 32, 0.1);
  border-color: var(--danger);
  color: var(--danger);
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.puzzle-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(26, 24, 20, 0.3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  letter-spacing: 0.1em;
  color: var(--ink);
  outline: none;
  transition: all 0.2s;
}

.puzzle-input:focus {
  border-color: var(--accent-gold);
  background: rgba(255,255,255,0.8);
  box-shadow: 0 0 0 3px rgba(196, 160, 98, 0.2);
}

.puzzle-submit {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  background: var(--ink);
  color: var(--bg-paper);
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.puzzle-submit:hover {
  background: var(--accent-red);
  letter-spacing: 0.3em;
}

.puzzle-feedback {
  margin-top: 16px;
  padding: 14px;
  text-align: center;
  font-size: 16px;
  font-style: italic;
  opacity: 0;
  transition: opacity 0.3s;
}

.puzzle-feedback.show { opacity: 1; }
.puzzle-feedback.success { color: var(--success); }
.puzzle-feedback.error { color: var(--danger); }

.puzzle-stamp {
  position: absolute;
  bottom: 30px;
  right: 30px;
  font-family: 'Major Mono Display', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--stamp);
  opacity: 0.3;
  border: 2px solid var(--stamp);
  padding: 6px 12px;
  transform: rotate(-8deg);
  pointer-events: none;
}

/* Estilos específicos para puzzle de caja fuerte */
.safe-display {
  background: var(--ink);
  color: var(--accent-gold);
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 42px;
  letter-spacing: 0.2em;
  text-align: center;
  margin: 20px 0;
  border-radius: 2px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
  font-variant-numeric: tabular-nums;
}

.safe-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 280px;
  margin: 0 auto;
}

.safe-key {
  padding: 18px;
  background: rgba(26, 24, 20, 0.08);
  border: 1px solid rgba(26, 24, 20, 0.2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  color: var(--ink);
}

.safe-key:hover { background: var(--ink); color: var(--bg-paper); }
.safe-key:active { transform: scale(0.95); }
.safe-key.fn { background: rgba(164, 40, 32, 0.15); color: var(--danger); }
.safe-key.fn:hover { background: var(--danger); color: var(--bg-paper); }

/* Terminal de ordenador */
.terminal {
  background: #0a0f0a;
  color: #8aff8a;
  padding: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  min-height: 280px;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.terminal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(138, 255, 138, 0.03) 2px,
    rgba(138, 255, 138, 0.03) 4px
  );
  pointer-events: none;
}

.terminal-line { margin-bottom: 4px; }
.terminal-line.prompt::before { content: '> '; color: #4a8a4a; }
.terminal-line.system { color: #c0c0c0; }
.terminal-line.error { color: #ff6a6a; }
.terminal-line.success { color: #8aff8a; font-weight: 700; }

.terminal-input-line {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.terminal-input-line::before { content: '>'; color: #4a8a4a; }

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #8aff8a;
  font-family: inherit;
  font-size: inherit;
  outline: none;
  caret-color: #8aff8a;
}

/* Puzzle de archivador - drag & drop */
.filing-intro { margin-bottom: 20px; line-height: 1.5; }

.filing-folders {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.filing-folder {
  padding: 14px 8px;
  background: rgba(196, 160, 98, 0.12);
  border: 1.5px solid var(--accent-gold);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s;
}

.filing-folder.drag-over {
  background: rgba(196, 160, 98, 0.3);
  transform: scale(1.02);
}

.folder-label { font-weight: 700; color: var(--accent-red); }
.folder-slot { min-height: 24px; font-size: 10px; color: var(--ink-muted); }
.folder-slot.filled { color: var(--success); font-weight: 700; }

.filing-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background: rgba(26, 24, 20, 0.05);
  border: 1px dashed rgba(26, 24, 20, 0.2);
  min-height: 80px;
}

.filing-doc {
  padding: 10px 14px;
  background: var(--bg-paper);
  border: 1px solid var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  cursor: grab;
  user-select: none;
  transition: all 0.15s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.filing-doc:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 rgba(0,0,0,0.15); }
.filing-doc.dragging { opacity: 0.4; cursor: grabbing; }
.filing-doc.placed { display: none; }

/* Puzzle cuadro - cálculo de derrama */
.math-problem {
  background: rgba(26, 24, 20, 0.04);
  padding: 20px;
  border-left: 3px solid var(--accent-blue);
  margin-bottom: 20px;
  font-size: 17px;
  line-height: 1.6;
}

.math-problem ul { list-style: none; margin-top: 10px; }
.math-problem li { padding: 4px 0; font-family: 'JetBrains Mono', monospace; font-size: 14px; }
.math-problem li::before { content: '— '; color: var(--accent-gold); }

/* =============== VICTORIA / DERROTA =============== */

#win-screen {
  background:
    radial-gradient(ellipse at center, rgba(196, 160, 98, 0.15), transparent 60%),
    linear-gradient(180deg, #0f0d0a 0%, #06050a 100%);
}

.win-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.06;
  pointer-events: none;
}

.win-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 40px;
  text-align: center;
  color: var(--bg-paper);
}

.win-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--success);
  margin-bottom: 24px;
}

.win-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(50px, 9vw, 110px);
  font-weight: 500;
  font-style: italic;
  line-height: 0.95;
  margin-bottom: 36px;
  color: var(--accent-gold);
}

.win-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 36px;
  padding: 24px;
  background: rgba(196, 160, 98, 0.08);
  border: 1px solid rgba(196, 160, 98, 0.3);
}

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--bg-paper);
  font-variant-numeric: tabular-nums;
}

.win-story {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 36px;
  color: rgba(244, 239, 228, 0.8);
  font-style: italic;
}

#lose-screen {
  background: linear-gradient(180deg, #1a0808 0%, #06050a 100%);
}

.lose-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
  padding: 40px;
  text-align: center;
  color: var(--bg-paper);
}

.lose-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--danger);
  margin-bottom: 20px;
}

.lose-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(48px, 8vw, 84px);
  font-weight: 500;
  font-style: italic;
  color: var(--danger);
  margin-bottom: 28px;
}

.lose-story {
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 36px;
  color: rgba(244, 239, 228, 0.8);
}

/* =============== RESPONSIVE =============== */

@media (max-width: 720px) {
  .title-main { font-size: clamp(36px, 12vw, 64px); }
  .title-story { font-size: 15px; }
  .hud-top { flex-direction: column; gap: 10px; }
  .modal-content { padding: 28px 22px; }
  .puzzle-title { font-size: 28px; }
  .filing-folders { grid-template-columns: repeat(2, 1fr); }
  .win-stats { grid-template-columns: 1fr; gap: 14px; }
}

/* Scrollbar sobrio */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(26, 24, 20, 0.1); }
::-webkit-scrollbar-thumb { background: rgba(26, 24, 20, 0.4); }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }
