/**
 * 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: 5px;
  padding: 0 4px;
}

.survivor-stats-row.is-run .ssr-label {
  font-size: 8px;
}

.survivor-stats-row.is-run .ssr-value {
  font-size: 12px;
}

.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 .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
   ============================================================================ */

.survivor-levelup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

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

.survivor-levelup-content {
  background: linear-gradient(135deg, #1a1612, #2a2318);
  border: 3px solid #ffd700;
  border-radius: 12px;
  padding: 30px;
  max-width: 700px;
  width: 90%;
  box-shadow: 
    0 0 50px rgba(255, 215, 0, 0.3),
    inset 0 0 30px rgba(255, 215, 0, 0.05);
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { 
    transform: scale(0.9);
    opacity: 0;
  }
  to { 
    transform: scale(1);
    opacity: 1;
  }
}

.survivor-levelup-header {
  text-align: center;
  margin-bottom: 25px;
}

.survivor-levelup-header h2 {
  color: #ffd700;
  font-size: 28px;
  margin: 0 0 10px 0;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
  50% { text-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
}

.survivor-levelup-header p {
  color: #a08060;
  font-size: 16px;
  margin: 0;
}

/* Upgrade Options Grid */
.survivor-levelup-options {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.levelup-option {
  background: linear-gradient(135deg, #252015, #1a1510);
  border: 2px solid #554433;
  border-radius: 10px;
  padding: 20px;
  min-width: 180px;
  max-width: 200px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.levelup-option:hover {
  transform: translateY(-5px);
  border-color: #ffd700;
  box-shadow: 0 5px 25px rgba(255, 215, 0, 0.3);
}

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

/* Rarity colors */
.levelup-option.rarity-common {
  border-color: #888888;
}
.levelup-option.rarity-common:hover {
  border-color: #aaaaaa;
  box-shadow: 0 5px 25px rgba(170, 170, 170, 0.3);
}

.levelup-option.rarity-rare {
  border-color: #4a9eff;
}
.levelup-option.rarity-rare:hover {
  border-color: #6ab4ff;
  box-shadow: 0 5px 25px rgba(74, 158, 255, 0.4);
}

.levelup-option.rarity-epic {
  border-color: #9945ff;
}
.levelup-option.rarity-epic:hover {
  border-color: #b366ff;
  box-shadow: 0 5px 25px rgba(153, 69, 255, 0.4);
}

.levelup-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.levelup-name {
  color: #ffd700;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
}

.levelup-desc {
  color: #a08060;
  font-size: 12px;
  line-height: 1.4;
}

/* ============================================================================
   GAME OVER MODAL
   ============================================================================ */

.survivor-gameover-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.5s ease;
}

.survivor-gameover-content {
  background: linear-gradient(135deg, #1a0a0a, #2a1515);
  border: 3px solid #cc3333;
  border-radius: 12px;
  padding: 32px 28px;
  max-width: 540px;
  width: 92%;
  text-align: center;
  box-shadow: 
    0 0 50px rgba(204, 51, 51, 0.3),
    inset 0 0 30px rgba(204, 51, 51, 0.05);
}

.survivor-gameover-content h2 {
  color: #ff4444;
  font-size: 36px;
  margin: 0 0 30px 0;
  text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.survivor-gameover-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.gameover-stat {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #553333;
  border-radius: 8px;
  padding: 14px 12px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.gameover-stat.gameover-score {
  background: rgba(255, 215, 0, 0.1);
  border-color: #ffd700;
}

.gameover-essence-stat {
  border-color: #8a7020;
  background: rgba(201, 162, 39, 0.08);
}

.gameover-label {
  display: block;
  font-size: 11px;
  color: #a08060;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.gameover-value {
  display: block;
  font-size: 22px;
  font-weight: bold;
  color: #ffffff;
  line-height: 1.1;
}

.gameover-score .gameover-value {
  color: #ffd700;
  font-size: 22px;
}

/* Game Over Buttons */
.survivor-gameover-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.survivor-btn {
  padding: 12px 30px;
  font-size: 16px;
  font-weight: bold;
  border: 2px solid #554433;
  border-radius: 6px;
  background: linear-gradient(135deg, #252015, #1a1510);
  color: #a08060;
  cursor: pointer;
  transition: all 0.2s ease;
}

.survivor-btn:hover {
  transform: translateY(-2px);
  border-color: #886644;
  color: #ffd700;
}

.survivor-btn-primary {
  background: linear-gradient(135deg, #4a3520, #332510);
  border-color: #ffd700;
  color: #ffd700;
}

.survivor-btn-primary:hover {
  box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

/* ============================================================================
   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;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.survivor-pause-content {
  background: linear-gradient(135deg, #1a1612, #252015);
  border: 3px solid #ffd700;
  border-radius: 12px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 
    0 0 50px rgba(255, 215, 0, 0.2),
    inset 0 0 30px rgba(255, 215, 0, 0.03);
}

.survivor-pause-content h2 {
  color: #ffd700;
  font-size: 32px;
  margin: 0 0 25px 0;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.survivor-pause-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.pause-stat {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #554433;
  border-radius: 8px;
  padding: 12px 20px;
  min-width: 80px;
}

.pause-label {
  display: block;
  font-size: 11px;
  color: #a08060;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pause-value {
  display: block;
  font-size: 20px;
  font-weight: bold;
  color: #ffffff;
}

.survivor-pause-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.survivor-pause-actions .survivor-btn {
  width: 100%;
  padding: 14px 20px;
}

.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 {
  color: #666;
  font-size: 12px;
  margin: 0;
  font-style: italic;
}

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

.gameover-essence-stat .gameover-value {
  color: #c9a227;
}

.gameover-xp-stat .gameover-value {
  color: #5bc0de;
}

.gameover-xp-stat {
  border-color: #3a6a7a;
  background: rgba(91, 192, 222, 0.08);
}

.gameover-city-level {
  color: #d4c4a8;
  font-size: 13px;
  margin: 0 0 8px;
}

/* Logros — Game Over */
.gameover-achievements-panel {
  margin: 10px 0 14px;
  text-align: left;
  border: 1px solid #553333;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(204, 51, 51, 0.08) 0%, transparent 18%),
    rgba(0, 0, 0, 0.4);
  box-shadow:
    inset 0 0 24px rgba(204, 51, 51, 0.06),
    inset 0 1px 0 rgba(201, 162, 39, 0.08);
  padding: 12px 8px 12px 12px;
}

.gameover-achievements-panel .ach-panel-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9a227;
  margin: 0 0 10px;
  text-align: center;
  text-shadow: 0 0 10px rgba(201, 162, 39, 0.25);
}

.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: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #6b5a48;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.12), rgba(0, 0, 0, 0.35));
  color: #e8dcc8;
}

.ach-card.rarity-common { border-color: #6a6a6a; }
.ach-card.rarity-uncommon { border-color: #5cb85c; background: linear-gradient(135deg, rgba(92, 184, 92, 0.12), rgba(0, 0, 0, 0.35)); }
.ach-card.rarity-rare { border-color: #5bc0de; background: linear-gradient(135deg, rgba(91, 192, 222, 0.12), rgba(0, 0, 0, 0.35)); }
.ach-card.rarity-epic { border-color: #aa66dd; background: linear-gradient(135deg, rgba(170, 102, 221, 0.14), rgba(0, 0, 0, 0.35)); box-shadow: 0 0 12px rgba(170, 102, 221, 0.18); }
.ach-card.rarity-legendary { border-color: #ffcc33; background: linear-gradient(135deg, rgba(255, 204, 51, 0.16), rgba(0, 0, 0, 0.35)); box-shadow: 0 0 16px rgba(255, 204, 51, 0.2); }

.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: 6px 16px;
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #6b5a48;
  border-radius: 6px;
  font-size: 12px;
  color: #d4c4a8;
  text-align: left;
}

.gameover-achievements {
  color: #ffd700;
  font-size: 13px;
  margin: 8px 0;
}

.gameover-hint {
  color: #a08060;
  font-size: 12px;
  margin: 8px 0 16px;
  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;
  }
}



