/* Quest UI — acabado de producción */
body .survivor-quest-panel {
  width: min(760px, 94vw);
  max-height: min(860px, 92vh);
  border-color: #806536;
  background:
    radial-gradient(circle at 50% 0, rgba(130, 91, 29, 0.16), transparent 42%),
    linear-gradient(145deg, #211a12, #100d09 64%, #19130d);
  box-shadow: 0 28px 90px #000, inset 0 0 0 1px rgba(255, 218, 135, 0.08);
}

body .survivor-quest-npc-speech {
  max-width: 590px;
  margin: 10px auto 14px;
  padding: 10px 14px;
  color: #d8c9ab;
  background: rgba(8, 7, 5, 0.42);
  border-left: 2px solid #a77b37;
  font: italic 14px/1.45 Georgia, serif;
}

body .survivor-quest-body {
  max-height: min(590px, 65vh);
  overflow: auto;
  padding-right: 5px;
}

body .survivor-quest-card {
  position: relative;
  padding: 16px;
  border: 1px solid #55442d;
  background: linear-gradient(135deg, rgba(52, 40, 25, 0.95), rgba(20, 16, 12, 0.97));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

body .survivor-quest-card.is-active {
  border-color: #356c82;
}

body .survivor-quest-card.is-ready {
  border-color: #c9a227;
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.18), 0 8px 22px rgba(0, 0, 0, 0.34);
}

body .survivor-quest-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body .survivor-quest-state {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: #e3c984;
  background: #21180d;
  border: 1px solid #6d5228;
  font: 700 9px/1.2 sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body .survivor-quest-card.is-active .survivor-quest-state {
  color: #8edfff;
  border-color: #347891;
}

body .survivor-quest-card.is-ready .survivor-quest-state {
  color: #fff0a8;
  border-color: #c9a227;
}

body .survivor-quest-card.is-done .survivor-quest-state {
  color: #9ee0a5;
  border-color: #4d7b52;
}

body .survivor-quest-rewards {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(157, 121, 55, 0.25);
}

body .survivor-btn-ghost {
  align-self: flex-end;
  margin-top: 8px;
  padding: 6px 10px;
  color: #a99c87;
  background: transparent;
  border: 1px solid #4c4032;
}

body .survivor-btn-ghost:hover {
  color: #e0b2a2;
  border-color: #875044;
  background: rgba(106, 48, 38, 0.22);
}

@media (max-width: 600px) {
  .survivor-quest-panel { width: 96vw; max-height: 94vh; }
  .survivor-quest-card-top { display: block; }
  .survivor-quest-state { display: inline-block; margin-top: 7px; }
}
/**
 * Survivor Mode - CSS Styles
 * Styles for HUD, level-up modal, and game over screen
 */

/* ============================================================================
   SIDEBAR STATS ROW (ciudad / run)
   ============================================================================ */

.survivor-stats-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 4px 4% 0;
  width: 92%;
  box-sizing: border-box;
  padding: 4px 8px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  position: relative;
  z-index: 20;
  min-height: 22px;
}

.survivor-stats-row.is-run .ssr-cell {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  gap: 4px;
  padding: 0 2px;
}

.survivor-stats-row.is-run .ssr-label {
  font-size: 8px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.survivor-stats-row.is-run .ssr-value {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.survivor-stats-row .ssr-cell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 2px;
  border-right: 1px solid #2a2a2a;
}

.survivor-stats-row .ssr-cell:last-child,
.survivor-stats-row .ssr-essence:last-child {
  border-right: none;
}

.survivor-stats-row.is-city .ssr-cell {
  flex: 0 1 auto;
  justify-content: flex-start;
  border-right: none;
}

.survivor-stats-row .ssr-label {
  font-size: 9px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.survivor-stats-row .ssr-value {
  font-size: 12px;
  font-weight: 700;
  font-family: "Segoe UI", sans-serif;
  white-space: nowrap;
  line-height: 1;
}

.survivor-stats-row .ssr-cyan { color: #00ffff; }
.survivor-stats-row .ssr-red { color: #ff5555; }
.survivor-stats-row .ssr-yellow { color: #ffcc00; }
.survivor-stats-row .ssr-gold { color: #c9a227; }

.survivor-stats-row.is-run .ssr-wave .ssr-value {
  color: #e0c56a;
  font-variant-numeric: tabular-nums;
}

.survivor-stats-row .ssr-tree-btn {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid #5a4a28;
  border-radius: 3px;
  background: linear-gradient(180deg, #2a2214, #1a150c);
  color: #e0c56a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}

.survivor-stats-row .ssr-tree-btn:hover {
  border-color: #c9a227;
  color: #ffe9a0;
}

/* ============================================================================
   SURVIVOR HUD (Top overlay during gameplay)
   ============================================================================ */

.survivor-hud {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.survivor-stats {
  display: flex;
  gap: 20px;
  background: linear-gradient(135deg, rgba(20, 15, 10, 0.95), rgba(30, 25, 18, 0.9));
  border: 2px solid #8b7355;
  border-radius: 8px;
  padding: 10px 20px;
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 215, 0, 0.1);
}

.survivor-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.survivor-label {
  font-size: 11px;
  color: #a08060;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.survivor-value {
  font-size: 20px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* XP Bar */
.survivor-xp-bar {
  width: 300px;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #554433;
  border-radius: 4px;
  overflow: hidden;
}

.survivor-xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4a9eff, #00d4ff);
  box-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
  transition: width 0.3s ease;
}

/* ============================================================================
   LEVEL UP MODAL — elección de mejora (compacto, click, sin teclas)
   ============================================================================ */

.survivor-levelup-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 12px;
  background:
    radial-gradient(ellipse 68% 52% at 50% 36%, rgba(86, 48, 16, 0.48) 0%, transparent 64%),
    rgba(3, 2, 2, 0.92);
  backdrop-filter: blur(3px);
  animation: levelupOverlayIn 0.26s ease;
}

.survivor-levelup-overlay[hidden],
.survivor-levelup-overlay.is-closing {
  pointer-events: none;
}

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

.survivor-levelup-content {
  position: relative;
  width: min(720px, 100%);
  max-height: min(90dvh, 860px);
  overflow: auto;
  padding: 22px 18px 18px;
  color: #d8cfc0;
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.08) 0%, transparent 26%),
    linear-gradient(165deg, #1b1511 0%, #100e0c 52%, #181310 100%);
  border: 1px solid #4a3c2c;
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.7),
    0 28px 56px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(232, 210, 160, 0.09);
  animation: levelupPanelIn 0.3s ease;
}

.survivor-levelup-content::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 7px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(140, 48, 36, 0.5) 20%,
    rgba(201, 162, 39, 0.55) 50%,
    rgba(140, 48, 36, 0.5) 80%,
    transparent 100%
  );
}

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

.survivor-levelup-header {
  text-align: center;
  margin: 0 0 16px;
}

.levelup-eyebrow {
  margin: 0 0 4px;
  font-family: "Cinzel", Georgia, serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a6858;
}

#survivor-levelup-title,
.survivor-levelup-header h2 {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(20px, 3.6vw, 26px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #f0e4cc;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.levelup-rule {
  width: 52px;
  height: 2px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, #8c3024 18%, #c9a227 50%, #8c3024 82%, transparent);
}

.levelup-subtitle,
#survivor-levelup-text {
  margin: 9px 0 0;
  color: #bba888;
  font-family: Georgia, "Palatino Linotype", Palatino, serif;
  font-size: 14px;
  line-height: 1.3;
}

.survivor-levelup-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.levelup-option {
  --lu-accent: #6a6258;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-height: 0;
  padding: 0 0 12px;
  overflow: hidden;
  text-align: center;
  color: inherit;
  font: inherit;
  cursor: pointer;
  background: linear-gradient(180deg, #221c16 0%, #14100c 100%);
  border: 1px solid #3f3428;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 230, 180, 0.04);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  animation: levelupCardIn 0.3s ease both;
}

.levelup-option::before {
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  background: var(--lu-accent);
  opacity: 0.9;
}

.levelup-option:nth-child(1) { animation-delay: 0.03s; }
.levelup-option:nth-child(2) { animation-delay: 0.08s; }
.levelup-option:nth-child(3) { animation-delay: 0.13s; }

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

.levelup-option:hover,
.levelup-option:focus-visible {
  outline: none;
  z-index: 1;
  transform: translateY(-2px);
  border-color: #c9a227;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 230, 180, 0.08);
}

.levelup-option:active {
  transform: translateY(0);
}

.levelup-option.is-selected {
  border-color: #e8d28a;
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.45),
    0 12px 28px rgba(0, 0, 0, 0.45);
}

.levelup-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 9px 10px 0;
}

.levelup-rarity,
.levelup-kind {
  padding: 2px 7px;
  border: 1px solid rgba(90, 74, 50, 0.55);
  border-radius: 999px;
  font-family: "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
}

.levelup-rarity {
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.1em;
  color: #9a8668;
  background: rgba(0, 0, 0, 0.28);
}

.levelup-kind {
  color: #7a6a54;
  background: rgba(0, 0, 0, 0.18);
}

.levelup-option.rarity-common {
  --lu-accent: #8a8278;
  border-color: #5a5248;
}
.levelup-option.rarity-common .levelup-rarity {
  color: #b0a898;
  border-color: rgba(138, 130, 120, 0.45);
}

.levelup-option.rarity-uncommon {
  --lu-accent: #6a9a62;
  border-color: #3f5a3c;
  background: linear-gradient(180deg, #1c2218 0%, #12150f 100%);
}
.levelup-option.rarity-uncommon .levelup-rarity {
  color: #9ccc92;
  border-color: rgba(106, 154, 98, 0.45);
}

.levelup-option.rarity-rare {
  --lu-accent: #5a8eb0;
  border-color: #355068;
  background: linear-gradient(180deg, #182028 0%, #101418 100%);
}
.levelup-option.rarity-rare .levelup-rarity {
  color: #8ec4e4;
  border-color: rgba(90, 142, 176, 0.45);
}

.levelup-option.rarity-epic {
  --lu-accent: #a06070;
  border-color: #5a343e;
  background: linear-gradient(180deg, #22181c 0%, #141012 100%);
}
.levelup-option.rarity-epic .levelup-rarity {
  color: #d4a0ac;
  border-color: rgba(160, 96, 112, 0.45);
}

.levelup-option.rarity-legendary {
  --lu-accent: #c9a227;
  border-color: #8a6a28;
  background: linear-gradient(180deg, #2a2214 0%, #16120c 100%);
}
.levelup-option.rarity-legendary .levelup-rarity {
  color: #f0d070;
  border-color: rgba(201, 162, 39, 0.5);
}

.levelup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 10px 0 8px;
  color: #c8c0b0;
  background:
    radial-gradient(circle at 50% 40%, rgba(201, 162, 39, 0.1), transparent 65%),
    rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(90, 74, 50, 0.65);
  border-radius: 4px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
}

.levelup-icon .sv-icon,
.levelup-icon canvas {
  width: 38px;
  height: 38px;
}

.levelup-name {
  margin: 0;
  padding: 0 12px;
  color: #f2e6cc;
  font-family: "Cinzel", Georgia, serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.levelup-desc {
  margin: 6px 0 0;
  padding: 0 12px;
  color: #a89478;
  font-family: Georgia, "Palatino Linotype", Palatino, serif;
  font-size: 11.5px;
  line-height: 1.4;
}

.levelup-stacks {
  margin-top: 10px;
  padding: 3px 9px;
  border: 1px solid rgba(90, 74, 50, 0.5);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: #9a8668;
  font-family: "Segoe UI", sans-serif;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

@media (max-width: 700px) {
  .survivor-levelup-content {
    padding: 18px 12px 14px;
  }

  .survivor-levelup-options {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .levelup-option {
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    padding: 10px 12px;
    text-align: left;
  }

  .levelup-option::before {
    grid-column: 1 / -1;
    width: auto;
    margin: -10px -12px 6px;
  }

  .levelup-meta {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-start;
    padding: 0;
  }

  .levelup-icon {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 52px;
    height: 52px;
    margin: 0;
  }

  .levelup-name {
    grid-column: 2;
    grid-row: 2;
    padding: 0;
    font-size: 13px;
  }

  .levelup-desc {
    grid-column: 2;
    grid-row: 3;
    margin: 0;
    padding: 0;
    font-size: 11px;
  }

  .levelup-stacks {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .survivor-levelup-overlay,
  .survivor-levelup-content,
  .levelup-option {
    animation: none !important;
  }

  .levelup-option:hover,
  .levelup-option:focus-visible {
    transform: none;
  }
}

/* ============================================================================
   GAME OVER MODAL — estilo AO clásico (ventana / cobre / oro)
   ============================================================================ */

.survivor-gameover-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 12px;
  background: rgba(0, 0, 0, 0.78);
  animation: gameoverOverlayIn 0.28s ease;
}

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

.survivor-gameover-content {
  width: min(480px, 100%);
  max-height: min(92dvh, 880px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--text-primary, #e8dcc8);
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.06) 2px,
      rgba(0, 0, 0, 0.06) 3px
    ),
    linear-gradient(180deg, #1a1510 0%, #14100b 55%, #0f0c08 100%);
  border: 3px solid var(--border-copper, #8b5a2b);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px #3d2a14,
    0 0 0 2px rgba(197, 160, 89, 0.35),
    0 18px 40px rgba(0, 0, 0, 0.75),
    inset 0 0 40px rgba(0, 0, 0, 0.35);
  animation: gameoverPanelIn 0.3s ease;
}

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

.gameover-titlebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 9px 12px;
  background: linear-gradient(180deg, #3a2e22 0%, #2a221a 45%, #1a1510 100%);
  border-bottom: 2px solid var(--border-copper, #8b5a2b);
  box-shadow: inset 0 1px 0 rgba(255, 220, 140, 0.12);
}

.gameover-titlebar-ornament {
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-gold, #c5a059), transparent);
  opacity: 0.85;
}

#survivor-gameover-title,
.gameover-titlebar h2 {
  margin: 0;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-gold, #ffcc00);
  text-shadow:
    1px 1px 0 #000,
    0 0 8px rgba(255, 80, 40, 0.35);
}

.gameover-body {
  padding: 12px 14px 14px;
  overflow: auto;
  text-align: center;
}

.gameover-banner {
  margin: 0 0 12px;
  padding: 8px 10px;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 12px;
  line-height: 1.35;
  color: #e8dcc8;
  background: #0d0a08;
  border: 1px solid var(--border-copper, #8b5a2b);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.55);
}

.survivor-gameover-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px;
  background: #0d0a08;
  border: 1px solid #3d2e1e;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.5);
}

.gameover-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 56px;
  padding: 7px 4px;
  text-align: center;
  background: linear-gradient(180deg, #1a1510, #120e0a);
  border: 1px solid var(--border-gold, #c5a059);
  border-radius: 3px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.55);
}

.gameover-stat.gameover-score {
  border-color: var(--border-gold-bright, #ffd700);
  background: linear-gradient(180deg, #2a2210, #161208);
}

.gameover-essence-stat {
  border-color: #b8922e;
}

.gameover-xp-stat {
  border-color: #4a7a8a;
}

.gameover-label {
  display: block;
  margin-bottom: 3px;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--border-gold, #c5a059);
  text-shadow: 1px 1px 0 #000;
}

.gameover-value {
  display: block;
  color: #fff;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-shadow: 1px 1px 0 #000;
}

.gameover-score .gameover-value,
.gameover-essence-stat .gameover-value {
  color: var(--text-gold, #ffcc00);
}

.gameover-xp-stat .gameover-value {
  color: #7ec8e0;
}

.survivor-gameover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-copper, #8b5a2b);
}

.survivor-btn {
  min-width: 148px;
  padding: 9px 14px;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 2px solid var(--border-copper, #8b5a2b);
  border-radius: 3px;
  background: linear-gradient(180deg, #3a2e22, #1a1510);
  color: #ccc;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
  box-shadow: inset 0 1px 0 rgba(255, 220, 140, 0.08);
  transition: filter 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.survivor-btn:hover,
.survivor-btn:focus-visible {
  outline: none;
  filter: brightness(1.12);
  border-color: var(--border-gold, #c5a059);
  color: #fff;
}

.survivor-btn:active {
  filter: brightness(0.95);
}

.survivor-btn-primary {
  background: linear-gradient(180deg, #c5a059, #8b5a2b);
  border-color: var(--border-gold-bright, #ffd700);
  color: #1a1008;
  text-shadow: 0 1px 0 rgba(255, 240, 180, 0.35);
}

.survivor-btn-primary:hover,
.survivor-btn-primary:focus-visible {
  filter: brightness(1.08);
  color: #000;
}

@media (max-width: 520px) {
  .survivor-gameover-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .survivor-gameover-actions {
    flex-direction: column;
  }

  .survivor-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .survivor-gameover-overlay,
  .survivor-gameover-content {
    animation: none !important;
  }
}

/* ============================================================================
   GAME MODE SELECTOR (Character Creation)
   ============================================================================ */

.gamemode-hint {
  font-size: 11px;
  color: #888;
  margin: 5px 0 0 0;
  font-style: italic;
}

#char-gamemode {
  background: linear-gradient(135deg, #1a1612, #252015);
}

#char-gamemode option[value="survivor"] {
  background: linear-gradient(135deg, #2a1515, #351a1a);
  color: #ff6b6b;
}

/* ============================================================================
   PAUSE MENU
   ============================================================================ */

.survivor-pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(48, 18, 14, 0.55) 0%, transparent 62%),
    rgba(4, 3, 2, 0.88);
  backdrop-filter: blur(2px);
  animation: pauseOverlayIn 0.28s ease;
}

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

.survivor-pause-content {
  position: relative;
  width: min(360px, 100%);
  padding: 28px 26px 22px;
  text-align: center;
  color: #d8cfc0;
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.06) 0%, transparent 28%),
    linear-gradient(165deg, #1c1612 0%, #12100e 48%, #1a1210 100%);
  border: 1px solid #3d3228;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.65),
    0 24px 48px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(232, 210, 160, 0.08);
  animation: pausePanelIn 0.32s ease;
}

.survivor-pause-content::before,
.survivor-pause-content::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(140, 48, 36, 0.55) 18%,
    rgba(201, 162, 39, 0.45) 50%,
    rgba(140, 48, 36, 0.55) 82%,
    transparent 100%
  );
}

.survivor-pause-content::before { top: 8px; }
.survivor-pause-content::after { bottom: 8px; }

@keyframes pausePanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.survivor-pause-header {
  margin: 0 0 22px;
}

.pause-eyebrow {
  margin: 0 0 6px;
  font-family: "Cinzel", Georgia, serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #8a7060;
}

.survivor-pause-content h2,
#survivor-pause-title {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(28px, 5vw, 34px);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e8dcc8;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.pause-rule {
  width: 64px;
  height: 2px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, #8c3024 20%, #c9a227 50%, #8c3024 80%, transparent);
  opacity: 0.9;
}

.survivor-pause-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 0 24px;
  border-top: 1px solid #2e2822;
  border-bottom: 1px solid #2e2822;
  background: rgba(0, 0, 0, 0.28);
}

.pause-stat {
  padding: 12px 8px 14px;
  min-width: 0;
  border-right: 1px solid #2e2822;
}

.pause-stat:last-child {
  border-right: none;
}

.pause-label {
  display: block;
  margin-bottom: 6px;
  font-family: "Cinzel", Georgia, serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7a6a58;
}

.pause-value {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: #f0e6d4;
  font-variant-numeric: tabular-nums;
}

.survivor-pause-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
}

.pause-btn {
  width: 100%;
  padding: 12px 16px;
  margin: 0;
  border: 1px solid #3a322a;
  border-radius: 1px;
  background: linear-gradient(180deg, #221c18 0%, #161210 100%);
  color: #c4b49a;
  font-family: "Cinzel", Georgia, serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.pause-btn:hover:not(:disabled) {
  border-color: #6a5840;
  color: #f0e6d4;
  background: linear-gradient(180deg, #2a221c 0%, #1a1510 100%);
}

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

.pause-btn:focus-visible {
  outline: 1px solid #c9a227;
  outline-offset: 2px;
}

.pause-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pause-btn-primary {
  border-color: #6a5428;
  background: linear-gradient(180deg, #3a2e1c 0%, #241c12 100%);
  color: #e8d090;
  letter-spacing: 0.16em;
}

.pause-btn-primary:hover:not(:disabled) {
  border-color: #c9a227;
  color: #ffe9a0;
  background: linear-gradient(180deg, #463620 0%, #2a2014 100%);
}

.pause-btn-danger {
  margin-top: 4px;
  border-color: #4a2420;
  background: linear-gradient(180deg, #2a1614 0%, #180e0c 100%);
  color: #c07060;
}

.pause-btn-danger:hover:not(:disabled) {
  border-color: #8c3024;
  color: #e09080;
  background: linear-gradient(180deg, #351a16 0%, #1c100e 100%);
}

/* Compat: botones danger/skills fuera del menú de pausa */
.survivor-btn-danger {
  background: linear-gradient(135deg, #3a1515, #2a1010);
  border-color: #cc3333;
  color: #ff6666;
}

.survivor-btn-danger:hover {
  border-color: #ff4444;
  color: #ff4444;
  box-shadow: 0 5px 20px rgba(255, 68, 68, 0.2);
}

.pause-hint {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: #6a5e52;
}

.pause-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 2px;
  border: 1px solid #3a322a;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
  font-family: "Cinzel", Georgia, serif;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.08em;
  color: #a09078;
}

@media (max-width: 420px) {
  .survivor-pause-content {
    padding: 24px 18px 18px;
  }

  .pause-value {
    font-size: 18px;
  }

  .pause-btn {
    padding: 11px 12px;
    font-size: 11px;
  }
}

/* ============================================================================
   META: Esencia / Vendors / Quests / Game Over
   ============================================================================ */

.gameover-city-level {
  margin: 0 0 8px;
  padding: 6px 8px;
  color: var(--text-gold, #ffcc00);
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 1px 1px 0 #000;
  background: #0d0a08;
  border: 1px solid var(--border-copper, #8b5a2b);
}

/* Logros — Game Over (marco AO) */
.gameover-achievements-panel {
  margin: 8px 0 10px;
  padding: 10px 8px 10px 10px;
  text-align: left;
  border: 2px solid var(--border-copper, #8b5a2b);
  border-radius: 3px;
  background: #0d0a08;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55);
}

.gameover-achievements-panel .ach-panel-title {
  margin: 0 0 8px;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-gold, #ffcc00);
  text-align: center;
  text-shadow: 1px 1px 0 #000;
}

.gameover-achievements-panel .ach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 10px 4px 2px;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: #a87820 #140808;
}

/* Scrollbar WebKit — misma paleta del modal (sangre + oro) */
.gameover-achievements-panel .ach-list::-webkit-scrollbar {
  width: 11px;
}

.gameover-achievements-panel .ach-list::-webkit-scrollbar-track {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(26, 10, 10, 0.9));
  border: 1px solid #3a1a1a;
  border-radius: 6px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.65);
  margin: 2px 0;
}

.gameover-achievements-panel .ach-list::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    #c9a227 0%,
    #8a5a14 35%,
    #5c3010 70%,
    #8a5a14 100%
  );
  border: 1px solid #3a2010;
  border-radius: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 120, 0.35),
    0 0 6px rgba(201, 162, 39, 0.2);
  min-height: 28px;
}

.gameover-achievements-panel .ach-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    #ffd700 0%,
    #c9a227 40%,
    #8a5a14 100%
  );
  border-color: #6b4518;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 180, 0.45),
    0 0 10px rgba(255, 215, 0, 0.35);
}

.gameover-achievements-panel .ach-list::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #e8b84a, #6b3a10);
}

.gameover-achievements-panel .ach-list::-webkit-scrollbar-corner {
  background: transparent;
}

.ach-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 3px;
  border: 1px solid var(--border-gold, #c5a059);
  background: linear-gradient(180deg, #1a1510, #120e0a);
  color: #e8dcc8;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.ach-card.rarity-common { border-color: #6a6258; }
.ach-card.rarity-uncommon {
  border-color: #4a6a48;
  background: linear-gradient(135deg, rgba(74, 106, 72, 0.14), rgba(0, 0, 0, 0.35));
}
.ach-card.rarity-rare {
  border-color: #3d5f7a;
  background: linear-gradient(135deg, rgba(61, 95, 122, 0.14), rgba(0, 0, 0, 0.35));
}
.ach-card.rarity-epic {
  border-color: #6a3d4a;
  background: linear-gradient(135deg, rgba(106, 61, 74, 0.16), rgba(0, 0, 0, 0.35));
}
.ach-card.rarity-legendary {
  border-color: #c9a227;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.16), rgba(0, 0, 0, 0.35));
  box-shadow: inset 0 0 16px rgba(201, 162, 39, 0.08);
}

.ach-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ach-color, #c9a227);
  border: 1px solid #6b5a48;
  background: rgba(0, 0, 0, 0.35);
}

.ach-card-body {
  flex: 1;
  min-width: 0;
}

.ach-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.ach-card-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff4d8;
}

.ach-card-rarity {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ach-color, #c9a227);
  white-space: nowrap;
}

.ach-card-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: #b0a090;
  line-height: 1.35;
}

.ach-card-reward {
  margin-top: 6px;
  font-size: 12px;
  color: #e8c84a;
}

.ach-card.ach-pop {
  animation: achPopIn 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes achPopIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.gameover-essence-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin: 8px 0 10px;
  padding: 8px 10px;
  background: #0d0a08;
  border: 1px solid #3d2e1e;
  border-radius: 2px;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 11px;
  color: #d4c4a8;
  text-align: left;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45);
}

.gameover-achievements {
  margin: 8px 0;
  color: var(--text-gold, #ffcc00);
  font-size: 12px;
}

.gameover-hint {
  margin: 8px 0 12px;
  color: #a08060;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 11px;
  line-height: 1.4;
}

.survivor-meta-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  pointer-events: auto;
}

.survivor-meta-panel {
  position: relative;
  width: min(520px, 92vw);
  max-height: 80vh;
  overflow: auto;
  background: linear-gradient(160deg, #2a1f14 0%, #1a140e 100%);
  border: 2px solid #8b7355;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 215, 0, 0.12);
  padding: 20px 22px 24px;
  color: #e8dcc8;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.survivor-meta-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: #c9a227;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.survivor-meta-title {
  margin: 0 0 8px;
  color: #ffd700;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 #000;
}

.survivor-meta-essence {
  text-align: center;
  margin: 0 0 14px;
  color: #c9a227;
}

.survivor-vendor-list,
.survivor-quest-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.survivor-vendor-row,
.survivor-quest-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #5c4033;
  border-radius: 6px;
}

.survivor-quest-card {
  flex-direction: column;
  align-items: stretch;
}

.survivor-vendor-row.is-locked,
.survivor-quest-card.is-done {
  opacity: 0.65;
}

.survivor-quest-card.is-ready {
  border-color: #c9a227;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
}

.survivor-vendor-name,
.survivor-quest-card-title {
  font-weight: bold;
  color: #ffe9a8;
  margin-bottom: 4px;
}

.survivor-vendor-desc,
.survivor-quest-card-desc,
.survivor-quest-hint {
  font-size: 12px;
  color: #b8a990;
  line-height: 1.35;
}

.survivor-vendor-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 110px;
}

.survivor-vendor-cost {
  color: #c9a227;
  font-size: 12px;
  font-weight: bold;
}

.survivor-vendor-status {
  color: #aa8866;
  font-size: 11px;
}

.survivor-quest-section {
  margin: 8px 0 4px;
  color: #cd853f;
  font-size: 14px;
  border-bottom: 1px solid #555;
  padding-bottom: 4px;
}

.survivor-quest-progress,
.survivor-quest-rewards {
  font-size: 12px;
  color: #dcd0b8;
  margin: 4px 0;
}

.survivor-meta-header {
  text-align: center;
  margin-bottom: 12px;
}

.survivor-meta-sub {
  margin: 0 0 6px;
  font-size: 12px;
  color: #a89070;
}

.survivor-vendor-req {
  margin-top: 4px;
  font-size: 11px;
  color: #c9a227;
}

.survivor-btn.is-locked-btn,
.survivor-vendor-buy.is-locked-btn,
.survivor-vendor-buy.is-owned,
button.survivor-btn:disabled,
button.survivor-vendor-buy:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: #555 !important;
  color: #999 !important;
  background: #1a1510 !important;
  box-shadow: none !important;
}

.survivor-quest-bar {
  height: 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #5c4033;
  overflow: hidden;
  margin: 6px 0 2px;
}

.survivor-quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b6914, #c9a227);
  transition: width 0.2s ease;
}

.survivor-vendor-row {
  align-items: center;
}

.survivor-vendor-buy {
  min-width: 120px;
  white-space: nowrap;
}

/* ============================================================================
   CHEST ROULETTE MODAL
   ============================================================================ */

.chest-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  flex-direction: column;
}

.chest-modal-frame {
  background: linear-gradient(135deg, #1a1510 0%, #2a2018 50%, #1a1510 100%);
  border: 3px solid #4a3828;
  border-radius: 4px;
  padding: 20px;
  box-shadow:
    0 0 40px rgba(0, 0, 0, 0.8),
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    0 0 2px #6b5a48;
  max-width: 95vw;
}

.chest-modal-title {
  color: #c9a227;
  font-size: 26px;
  font-weight: bold;
  text-shadow: 2px 2px 4px #000, 0 0 10px #8b7a3d;
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
  letter-spacing: 3px;
  border-bottom: 2px solid #4a3828;
  padding-bottom: 10px;
}

.chest-roulette-frame {
  position: relative;
  width: min(580px, 90vw);
  height: 120px;
  overflow: hidden;
  border: 4px solid #4a3828;
  background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.8),
    0 0 10px rgba(74, 56, 40, 0.5);
}

.chest-indicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  z-index: 10;
}

.chest-indicator-top {
  top: -2px;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid #c9a227;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
}

.chest-indicator-bottom {
  bottom: -2px;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 20px solid #c9a227;
  filter: drop-shadow(0 -2px 3px rgba(0, 0, 0, 0.8));
}

.chest-selection-line {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #c9a227 0%, #8b7a3d 50%, #c9a227 100%);
  z-index: 5;
  opacity: 0.6;
}

.chest-roulette-track {
  display: flex;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: none;
}

.roulette-item {
  margin: 0 4px;
  background: linear-gradient(180deg, var(--rarity-bg, #333) 0%, #0a0a0a 100%);
  border: 2px solid var(--rarity-border, #666);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease;
}

.roulette-item:hover {
  transform: scale(1.02);
}

.roulette-item-icon {
  font-size: 28px;
  margin-bottom: 4px;
  color: var(--rarity-text, #fff);
  text-shadow: 0 0 8px var(--rarity-glow, transparent);
}

.roulette-item-name {
  font-size: 10px;
  color: var(--rarity-text, #fff);
  text-align: center;
  font-weight: bold;
  padding: 0 4px;
  font-family: Georgia, serif;
  text-shadow: 1px 1px 2px #000;
  line-height: 1.2;
}

.roulette-item-rarity-bar {
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--rarity-border, #666) 50%, transparent 100%);
  margin-top: 4px;
}

.chest-result {
  margin-top: 25px;
  padding: 20px 40px;
  background: linear-gradient(180deg, #2a2018 0%, #1a1510 100%);
  border: 3px solid #4a3828;
  display: none;
  flex-direction: column;
  align-items: center;
  animation: resultPop 0.4s ease-out;
}

.chest-result-icon {
  font-size: 48px;
  color: var(--rarity-text, #c9a227);
  text-shadow: 0 0 15px var(--rarity-glow, transparent), 0 0 25px var(--rarity-glow, transparent);
  animation: medievalGlow 2s infinite;
}

.chest-result-sep {
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--rarity-border, #c9a227) 50%, transparent 100%);
  margin: 10px 0;
}

.chest-result-rarity {
  font-size: 12px;
  color: var(--rarity-text, #c9a227);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: Georgia, serif;
  text-shadow: 0 0 8px var(--rarity-glow, transparent);
}

.chest-result-name {
  font-size: 20px;
  color: #e8e0d0;
  font-weight: bold;
  margin-top: 8px;
  font-family: Georgia, serif;
  text-shadow: 2px 2px 4px #000;
}

.chest-result-value {
  font-size: 18px;
  color: var(--rarity-text, #c9a227);
  margin-top: 5px;
  font-family: Georgia, serif;
  text-shadow: 0 0 8px var(--rarity-glow, transparent);
}

.chest-buttons {
  display: none;
  flex-direction: row;
  gap: 15px;
  margin-top: 20px;
  justify-content: center;
}

.chest-btn {
  padding: 12px 30px;
  font-size: 14px;
  font-weight: bold;
  font-family: Georgia, serif;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.chest-btn-discard {
  background: linear-gradient(180deg, #4a2020 0%, #3a1818 100%);
  border: 2px solid #8b4444;
  color: #cc6666;
}

.chest-btn-discard:hover:not(:disabled) {
  background: linear-gradient(180deg, #5a2828 0%, #4a2020 100%);
  border-color: #cc6666;
}

.chest-btn-discard.is-disabled,
.chest-btn-discard:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chest-btn-continue {
  padding: 12px 40px;
  font-size: 16px;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #3a3020 0%, #2a2018 100%);
  border: 2px solid #6b5a48;
  color: #c9a227;
}

.chest-btn-continue:hover {
  background: linear-gradient(180deg, #4a4030 0%, #3a3028 100%);
  border-color: #c9a227;
}

@keyframes resultPop {
  0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
  60% { transform: scale(1.05) rotate(1deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes medievalGlow {
  0%, 100% { text-shadow: 0 0 5px currentColor, 0 0 10px currentColor; }
  50% { text-shadow: 0 0 15px currentColor, 0 0 30px currentColor, 0 0 45px currentColor; }
}

/* ============================================================================
   SKILL TREE — Árbol de Habilidades Survivor
   ============================================================================ */

.sst-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(80, 50, 20, 0.35), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(40, 60, 90, 0.3), transparent 45%),
    rgba(4, 3, 2, 0.88);
  animation: sstFadeIn 0.28s ease;
}

.sst-overlay.sst-open .sst-frame {
  animation: sstSlideIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

@keyframes sstSlideIn {
  from { transform: translateY(18px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.sst-frame {
  width: min(1100px, 96vw);
  height: min(720px, 92vh);
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #1c1610 0%, #0e0b08 55%, #121820 100%);
  border: 2px solid #6b5a48;
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.15),
    0 24px 60px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 220, 150, 0.08);
  overflow: hidden;
  font-family: "Cinzel", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.sst-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #3a3028;
  background: linear-gradient(180deg, rgba(60, 45, 28, 0.55), rgba(20, 16, 12, 0.2));
}

.sst-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #c9a227;
}

.sst-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #8a7020;
  background: rgba(201, 162, 39, 0.08);
}

.sst-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: #f0e2c0;
  text-transform: uppercase;
}

.sst-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9a8a70;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.sst-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sst-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #554433;
  background: rgba(0, 0, 0, 0.35);
  color: #d4c4a8;
  font-size: 12px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.sst-chip-points {
  border-color: #5cb85c;
  color: #8fdf8f;
}

.sst-chip-essence {
  border-color: #c9a227;
  color: #e8c84a;
}

.sst-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #554433;
  background: #1a1510;
  color: #c9a227;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.sst-close:hover {
  border-color: #c9a227;
  background: #2a2010;
}

.sst-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 320px);
  min-height: 0;
}

.sst-canvas-wrap {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(80, 60, 30, 0.12), transparent 55%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 31px,
      rgba(107, 90, 72, 0.08) 32px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 31px,
      rgba(107, 90, 72, 0.08) 32px
    );
}

.sst-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.sst-link {
  fill: none;
  stroke: #3a342c;
  stroke-width: 0.35;
  stroke-dasharray: 1.2 0.8;
  opacity: 0.55;
}

.sst-link.is-ready {
  stroke: #6b5a48;
  opacity: 0.85;
  stroke-dasharray: none;
}

.sst-link.is-on {
  stroke: var(--branch, #c9a227);
  stroke-width: 0.45;
  opacity: 1;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 0.4px rgba(201, 162, 39, 0.5));
}

.sst-nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.sst-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid #3a342c;
  background: radial-gradient(circle at 35% 30%, #2a241c, #12100c);
  color: #6a6055;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sst-node-icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.sst-node-rank {
  font-size: 9px;
  font-family: "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.04em;
}

.sst-node.is-locked {
  opacity: 0.45;
  filter: grayscale(0.7);
}

.sst-node.is-available {
  color: var(--branch, #c9a227);
  border-color: var(--branch, #c9a227);
  box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.4);
  animation: sstAvailablePulse 1.8s ease-in-out infinite;
}

.sst-node.is-owned {
  color: #f0e2c0;
  border-color: var(--branch, #c9a227);
  background: radial-gradient(circle at 35% 30%, #3a2e1c, #1a140c);
}

.sst-node.is-max {
  color: #fff4d0;
  border-color: #e8c84a;
  box-shadow: 0 0 14px rgba(232, 200, 74, 0.35);
}

.sst-node.is-premium {
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.35), inset 0 0 10px rgba(201, 162, 39, 0.08);
}

.sst-node.is-selected {
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 5;
  outline: 2px solid rgba(240, 226, 192, 0.55);
  outline-offset: 3px;
}

.sst-node:hover {
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 4;
}

.sst-node.sst-pulse {
  animation: sstUnlockPop 0.55s ease;
}

@keyframes sstAvailablePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.0); }
  50% { box-shadow: 0 0 0 6px rgba(201, 162, 39, 0.18); }
}

@keyframes sstUnlockPop {
  0% { transform: translate(-50%, -50%) scale(0.85); }
  50% { transform: translate(-50%, -50%) scale(1.25); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.sst-branch-legend {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 70%;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  color: #a09080;
}

.sst-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #3a342c;
}

.sst-legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--branch);
  display: inline-block;
}

.sst-detail {
  border-left: 1px solid #3a3028;
  background: linear-gradient(180deg, #18140f, #0c0a08);
  padding: 18px;
  overflow: auto;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.sst-detail-empty {
  color: #7a6a58;
  text-align: center;
  margin-top: 40%;
  font-size: 14px;
}

.sst-detail-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  color: #d4c4a8;
}

.sst-detail-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--branch, #c9a227);
  color: var(--branch, #c9a227);
  background: radial-gradient(circle at 30% 25%, #2a2418, #100e0a);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.sst-detail-branch {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--branch, #c9a227);
}

.sst-detail-name {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  font-size: 22px;
  color: #f0e2c0;
}

.sst-pips {
  display: flex;
  gap: 5px;
}

.sst-pips i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #554433;
  background: transparent;
}

.sst-pips i.on {
  background: var(--branch, #c9a227);
  border-color: var(--branch, #c9a227);
  box-shadow: 0 0 6px var(--branch, #c9a227);
}

.sst-detail-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #b0a090;
}

.sst-reqs {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  width: 100%;
  text-align: left;
  font-size: 12px;
}

.sst-reqs li {
  padding: 4px 0;
  border-bottom: 1px solid #2a241c;
}

.sst-reqs li.ok { color: #5cb85c; }
.sst-reqs li.no { color: #a06050; }

.sst-cost {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  color: #8fdf8f;
}

.sst-cost .ess {
  color: #e8c84a;
}

.sst-action {
  margin-top: 12px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid #8a7020;
  background: linear-gradient(180deg, #3a2e18, #1e180e);
  color: #f0e2c0;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-family: "Cinzel", Georgia, serif;
}

.sst-action:hover:not(:disabled) {
  border-color: #e8c84a;
  box-shadow: 0 0 16px rgba(232, 200, 74, 0.25);
}

.sst-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sst-reason {
  margin: 6px 0 0;
  font-size: 12px;
  color: #c07060;
}

.survivor-btn-skills {
  border-color: #8a7020;
  color: #e8c84a;
}

@media (max-width: 820px) {
  .sst-body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .sst-detail {
    border-left: none;
    border-top: 1px solid #3a3028;
    max-height: 42%;
  }
  .sst-frame {
    height: min(900px, 96vh);
  }
  .sst-node {
    width: 46px;
    height: 46px;
  }
}

/* ============================================================================
   HUD DE RUN — desktop y móvil
   ============================================================================ */

.survivor-run-hud[hidden],
.survivor-run-notice[hidden],
.survivor-duel-invite[hidden],
.run-hud-boss[hidden] {
  display: none !important;
}

.survivor-run-hud {
  position: absolute;
  top: 10px;
  left: 50%;
  width: min(560px, calc(100% - 24px));
  transform: translateX(-50%);
  z-index: 45;
  pointer-events: none;
  color: #efe5d2;
  font-family: "Cinzel", Georgia, serif;
}

.run-hud-core {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(58px, 1fr)) auto;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(154, 116, 68, 0.82);
  border-radius: 7px;
  background: rgba(12, 9, 7, 0.88);
  backdrop-filter: blur(3px);
}

.run-hud-metric {
  min-width: 0;
  padding: 6px 10px 5px;
  border-right: 1px solid rgba(118, 88, 54, 0.42);
  text-align: center;
}

.run-hud-label {
  display: block;
  overflow: hidden;
  color: #9e8d75;
  font-family: "Segoe UI", sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.run-hud-metric strong {
  display: block;
  margin-top: 3px;
  color: #f4ead7;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.run-hud-wave strong {
  color: #e0ba66;
}

.run-hud-stats-btn {
  min-width: 66px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid rgba(154, 116, 68, 0.6);
  background: rgba(68, 48, 28, 0.8);
  color: #d9bf8a;
  font-family: "Cinzel", Georgia, serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  pointer-events: auto;
  text-transform: uppercase;
}

.run-hud-stats-btn:hover,
.run-hud-stats-btn:focus-visible {
  background: rgba(104, 72, 37, 0.94);
  color: #fff1ca;
  outline: none;
}

.run-hud-boss {
  width: min(470px, calc(100% - 42px));
  margin: 5px auto 0;
  padding: 5px 9px 7px;
  border: 1px solid rgba(132, 54, 42, 0.8);
  border-radius: 5px;
  background: rgba(20, 8, 7, 0.9);
}

.run-hud-boss-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  color: #dca08d;
  font-family: "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.run-hud-boss-track {
  height: 5px;
  overflow: hidden;
  border: 1px solid rgba(115, 51, 43, 0.7);
  border-radius: 2px;
  background: #180807;
}

.run-hud-boss-fill {
  width: 100%;
  height: 100%;
  background: #a83d30;
  transition: width 0.16s linear;
}

.survivor-run-notice {
  position: absolute;
  top: 72px;
  left: 50%;
  z-index: 44;
  display: flex;
  max-width: min(420px, calc(100% - 36px));
  transform: translate(-50%, -7px);
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(145, 111, 68, 0.55);
  border-radius: 4px;
  background: rgba(12, 9, 7, 0.84);
  color: #bcae98;
  font-family: "Segoe UI", sans-serif;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.survivor-run-notice.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.survivor-run-notice strong {
  color: #e7ca8c;
  font-family: "Cinzel", Georgia, serif;
  font-size: 11px;
  white-space: nowrap;
}

.survivor-run-notice.is-boss {
  border-color: rgba(166, 64, 50, 0.75);
}

.survivor-run-notice.is-boss strong {
  color: #e7a18e;
}

.survivor-run-notice.is-success strong {
  color: #9ac18e;
}

/* Invitación de duelo Survivor — toast HUD (estilo aviso boss + acciones) */
.survivor-duel-invite {
  position: absolute;
  top: 72px;
  left: 50%;
  z-index: 46;
  display: flex;
  max-width: min(460px, calc(100% - 28px));
  transform: translate(-50%, -7px);
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 12px;
  border: 1px solid rgba(166, 64, 50, 0.72);
  border-radius: 4px;
  background: rgba(18, 10, 8, 0.92);
  color: #cbb9a4;
  font-family: "Segoe UI", sans-serif;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.survivor-duel-invite.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.survivor-duel-invite-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  min-width: 0;
}

.survivor-duel-invite-copy strong {
  color: #e7a18e;
  font-family: "Cinzel", Georgia, serif;
  font-size: 11px;
  white-space: nowrap;
}

.survivor-duel-invite-timer {
  color: #9e8d75;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.survivor-duel-invite-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
  margin-left: auto;
}

.survivor-duel-invite-btn {
  min-width: 68px;
  padding: 4px 8px;
  border: 1px solid rgba(154, 116, 68, 0.55);
  border-radius: 3px;
  background: rgba(48, 36, 24, 0.95);
  color: #efe5d2;
  font-family: "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-transform: uppercase;
}

.survivor-duel-invite-btn.accept {
  border-color: rgba(90, 140, 90, 0.75);
  background: rgba(36, 64, 36, 0.95);
}

.survivor-duel-invite-btn.decline {
  border-color: rgba(140, 80, 80, 0.75);
  background: rgba(64, 32, 32, 0.95);
}

.survivor-duel-invite-btn:hover,
.survivor-duel-invite-btn:focus-visible {
  filter: brightness(1.14);
  outline: none;
}

/* ============================================================================
   ESTADÍSTICAS AVANZADAS DE RUN
   ============================================================================ */

.survivor-run-stats-overlay {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 3, 2, 0.84);
  box-sizing: border-box;
}

.survivor-run-stats-window {
  display: flex;
  width: min(920px, 96vw);
  max-height: min(780px, 94dvh);
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #765a38;
  border-radius: 9px;
  background: #110e0b;
  color: #e6dac5;
}

.survivor-run-stats-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px 14px;
  border-bottom: 1px solid #493821;
  background: #1a1510;
}

.survivor-run-stats-eyebrow {
  margin: 0 0 3px;
  color: #9d8156;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.survivor-run-stats-header h2 {
  margin: 0;
  color: #e6c77f;
  font-family: "Cinzel", Georgia, serif;
  font-size: 22px;
}

.survivor-run-stats-header p:last-child {
  margin: 4px 0 0;
  color: #938574;
  font-size: 11px;
}

.survivor-run-stats-close {
  width: 34px;
  height: 34px;
  border: 1px solid #5b4630;
  border-radius: 5px;
  background: #211811;
  color: #b9a58a;
  font-size: 20px;
  cursor: pointer;
}

.survivor-run-stats-content {
  overflow: auto;
  padding: 16px 18px 20px;
}

.run-stats-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.run-stat-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #352b22;
  border-radius: 6px;
  background: #17130f;
}

.run-stat-card > span,
.run-stat-card > small {
  display: block;
  color: #8e8170;
  font-size: 9px;
}

.run-stat-card > span {
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.run-stat-card > strong {
  display: block;
  margin: 5px 0 3px;
  color: #eee1cb;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.run-stats-columns {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 0.9fr;
  gap: 12px;
  margin-top: 12px;
}

.run-stats-section {
  padding: 13px;
  border: 1px solid #352b22;
  border-radius: 6px;
  background: #15110e;
}

.run-stats-section h3 {
  margin: 0 0 11px;
  color: #cdb17b;
  font-family: "Cinzel", Georgia, serif;
  font-size: 13px;
}

.run-stats-section h3.run-stats-subheading {
  margin-top: 16px;
  font-size: 11px;
}

.run-source-row + .run-source-row,
.run-stats-kv + .run-stats-kv {
  margin-top: 8px;
}

.run-source-copy,
.run-stats-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #a99b88;
  font-size: 10px;
}

.run-source-copy strong,
.run-stats-kv strong {
  color: #e2d6c2;
  font-variant-numeric: tabular-nums;
}

.run-source-track {
  height: 3px;
  margin-top: 4px;
  overflow: hidden;
  background: #282018;
}

.run-source-fill {
  height: 100%;
  background: #a77a3d;
}

.run-stats-empty {
  color: #776c5e;
  font-size: 10px;
}

@media (max-width: 760px) {
  .run-stats-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .run-stats-columns {
    grid-template-columns: 1fr;
  }

  .survivor-run-stats-overlay {
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  }

  .survivor-run-stats-window {
    width: 100%;
    max-height: 100%;
  }
}

@media (max-width: 480px) {
  .survivor-run-hud {
    top: 6px;
    width: calc(100% - 12px);
  }

  .run-hud-core {
    grid-template-columns: 1.25fr repeat(3, minmax(44px, 1fr)) 48px;
  }

  .run-hud-metric {
    padding: 5px 5px 4px;
  }

  .run-hud-label {
    font-size: 7px;
  }

  .run-hud-metric strong {
    font-size: 12px;
  }

  .run-hud-stats-btn {
    min-width: 48px;
    padding: 0 4px;
    font-size: 7px;
  }

  .run-hud-boss {
    width: calc(100% - 18px);
  }

  .survivor-run-notice {
    top: 62px;
    max-width: calc(100% - 22px);
    font-size: 9px;
  }

  .survivor-run-notice span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .survivor-duel-invite {
    top: 62px;
    max-width: calc(100% - 16px);
    flex-wrap: wrap;
    gap: 8px;
    font-size: 9px;
  }

  .survivor-duel-invite-btn {
    min-width: 62px;
    padding: 5px 8px;
    font-size: 9px;
  }

  .survivor-run-stats-header {
    padding: 12px;
  }

  .survivor-run-stats-header h2 {
    font-size: 17px;
  }

  .survivor-run-stats-content {
    padding: 10px;
  }

  .run-stat-card {
    padding: 9px;
  }

  .run-stat-card > strong {
    font-size: 16px;
  }
}

/* ============================================================================
   Inventario Survivor — marco de rareza (tier) en slots
   Colores: 1 gris · 2 verde · 3 azul · 4 violeta · 5 dorado
   ============================================================================ */

.inventory-slot.tier-border-1,
.inventory-grid-slot.tier-border-1,
.mobile-inv-slot.tier-border-1 {
  border-color: #8a8278 !important;
  box-shadow: inset 0 0 0 1px rgba(158, 158, 158, 0.35);
}

.inventory-slot.tier-border-2,
.inventory-grid-slot.tier-border-2,
.mobile-inv-slot.tier-border-2 {
  border-color: #4a8a4a !important;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.4), inset 0 0 0 1px rgba(76, 175, 80, 0.25);
}

.inventory-slot.tier-border-3,
.inventory-grid-slot.tier-border-3,
.mobile-inv-slot.tier-border-3 {
  border-color: #3a6a9a !important;
  box-shadow: 0 0 6px rgba(33, 150, 243, 0.45), inset 0 0 0 1px rgba(33, 150, 243, 0.28);
}

.inventory-slot.tier-border-4,
.inventory-grid-slot.tier-border-4,
.mobile-inv-slot.tier-border-4 {
  border-color: #7a4a8a !important;
  box-shadow: 0 0 8px rgba(171, 71, 188, 0.45), inset 0 0 0 1px rgba(171, 71, 188, 0.3);
}

.inventory-slot.tier-border-5,
.inventory-grid-slot.tier-border-5,
.mobile-inv-slot.tier-border-5 {
  border-color: #c9a227 !important;
  box-shadow: 0 0 10px rgba(255, 179, 0, 0.5), inset 0 0 0 1px rgba(255, 179, 0, 0.35);
}

/* Selección gana sobre el color de tier; el glow de rareza se mantiene sutil */
.inventory-grid-slot.tier-border-1.inventory-grid-slot-selected,
.inventory-grid-slot.tier-border-2.inventory-grid-slot-selected,
.inventory-grid-slot.tier-border-3.inventory-grid-slot-selected,
.inventory-grid-slot.tier-border-4.inventory-grid-slot-selected,
.inventory-grid-slot.tier-border-5.inventory-grid-slot-selected {
  border-color: var(--text-orange, #ff8c00) !important;
}

.mobile-inv-slot.tier-border-1.mobile-inv-slot-selected,
.mobile-inv-slot.tier-border-2.mobile-inv-slot-selected,
.mobile-inv-slot.tier-border-3.mobile-inv-slot-selected,
.mobile-inv-slot.tier-border-4.mobile-inv-slot-selected,
.mobile-inv-slot.tier-border-5.mobile-inv-slot-selected {
  border-color: var(--mobile-gold, #d4ac37) !important;
}


