@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Nunito:wght@600;800;900&display=swap');

:root {
  --bg-grass: #7bc47f;
  --bg-grass-dark: #58a35d;
  --panel-bg: #fffbf0;
  --panel-border: #4a3427;
  --panel-shadow: #2f2118;
  --header-bg: #4a2e2b;
  --accent-gold: #f6c84c;
  --accent-blue: #5bc0de;
  --accent-green: #5cb85c;
  --accent-red: #d9534f;
  --font-title: 'Fredoka', cursive, sans-serif;
  --font-body: 'Nunito', sans-serif;
  --font-btn: 'Fredoka', cursive, sans-serif; /* Global Button Font Token: change this to change all button typography across the game */
}

/* ==========================================================================
   GLOBAL BUTTON FONT TOKEN RULE
   Changing --font-btn in :root instantly changes all buttons in the game
   ========================================================================== */
button,
button *,
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn,
.btn *,
[class*="btn-"],
[class*="-btn"],
[class*="-tab"],
.pause-action-btn,
.pause-action-btn *,
.lore-nav-tab,
.lore-nav-tab *,
.lore-filter-tab,
.lore-filter-tab *,
.lore-counter-badge,
.claim-all-rewards-btn,
.claim-all-rewards-btn *,
.reward-card-btn,
.trait-filter-chip,
.beast-compendium-chip,
.audio-toggle-btn {
  font-family: var(--font-btn) !important;
}

button,
input[type="button"],
input[type="submit"],
.btn,
.pause-action-btn,
.lore-nav-tab,
.lore-filter-tab,
.btn-action,
.btn-header {
  font-weight: 600;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: var(--font-body);
  background-color: #27472b;
  color: #2d3748;
}

#app {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: var(--bg-grass-dark);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* --- HEADER --- */
#main-header {
  --navbar-bg: rgba(22, 16, 13, 0.95);
  --navbar-border: rgba(200, 162, 96, 0.25);
  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 24px;
  border-bottom: 2px solid var(--navbar-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  position: relative;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: background 0.45s ease, border-color 0.45s ease;
}

#main-header[data-act="1"] {
  --navbar-bg: rgba(22, 16, 13, 0.95);
  --navbar-border: rgba(200, 162, 96, 0.25);
}

#main-header[data-act="2"] {
  --navbar-bg: rgba(18, 16, 26, 0.95);
  --navbar-border: rgba(140, 120, 190, 0.25);
}

#main-header[data-act="3"] {
  --navbar-bg: rgba(26, 15, 14, 0.95);
  --navbar-border: rgba(210, 110, 80, 0.25);
}

.header-left-brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 52px;
  overflow: hidden;
}

/* Header Inventory Bag Button (Left of Relics, Framed & Clean) */
.header-inventory-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 4px 12px 4px 8px;
  margin-right: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  box-shadow: none;
  transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  box-sizing: border-box;
}

.header-inventory-btn:hover {
  transform: translateY(-2px) scale(1.04);
}

.header-inventory-btn.has-items .header-inv-icon {
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.85)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
  animation: bagPulseGlow 2.5s infinite alternate ease-in-out;
}

@keyframes bagPulseGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.6)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.95)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.8)); }
}

.header-inv-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
}

.header-inv-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.75));
  transition: transform 0.18s ease, filter 0.18s ease;
  flex-shrink: 0;
}

.gear-bag-img {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  object-fit: contain !important;
  display: block !important;
}

.header-inv-label {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 900;
  color: #fff2cf;
  letter-spacing: 1px;
  text-shadow: 0 2px 2px #422017;
  white-space: nowrap;
}

.header-inv-count {
  background: #ca8a04;
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 11.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  line-height: 1;
}

.header-relics-label {
  flex-shrink: 0;
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 900;
  color: #f6e05e;
  letter-spacing: 1.2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  user-select: none;
  white-space: nowrap;
}

.header-relics-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(168, 85, 247, 0.65));
}

.header-relics-bar {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 14px 3px 2px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 18px), transparent 100%);
}

.header-relics-bar::-webkit-scrollbar {
  display: none;
}

.header-relic-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.header-relic-badge:hover {
  transform: translateY(-3px) scale(1.18);
  z-index: 2000;
}

.header-relic-art {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(246, 224, 94, 0.7);
  background: rgba(0, 0, 0, 0.45);
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55), 0 0 8px rgba(246, 224, 94, 0.4);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.header-relic-badge:hover .header-relic-art {
  border-color: #fef08a;
  box-shadow: 0 6px 20px rgba(246, 224, 94, 0.95), 0 0 14px rgba(246, 224, 94, 0.75);
}

/* --- Relic Hover Tooltip Modal (Navbar / Header) --- */
.header-relic-tooltip {
  position: fixed;
  width: 275px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  background: rgba(8, 14, 26, 0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid rgba(245, 158, 11, 0.65);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 24px rgba(0, 0, 0, 0.8), 0 0 12px rgba(245, 158, 11, 0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  z-index: 999999;
  line-height: 1.4;
  text-align: left;
  transform: translateY(4px);
}

.header-relic-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-relic-tip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.header-relic-tip-art {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.5);
}

.header-relic-tip-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-relic-tip-name {
  font-family: var(--font-title);
  font-size: 13.5px;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.4px;
}

.header-relic-tip-rarity {
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
}

.header-relic-tip-desc {
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.45;
  margin-bottom: 4px;
}

.header-relic-tip-lore {
  font-size: 10.5px;
  font-style: italic;
  color: #94a3b8;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 6px;
  margin-top: 6px;
}

.header-relic-tip-hint {
  font-size: 9.5px;
  color: #64748b;
  margin-top: 6px;
  text-align: right;
  font-weight: 600;
}

.game-title {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 2px 2px 0 var(--panel-shadow), -2px -2px 0 var(--panel-shadow), 2px -2px 0 var(--panel-shadow), -2px 2px 0 var(--panel-shadow);
}

/* Center Act Title Badge */
.header-act-badge {
  font-family: var(--font-btn);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #fef08a;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 5px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-status-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.status-pill {
  min-height: 38px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 4px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #f1f5f9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}

.status-pill:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.6);
}

.status-icon {
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.status-copy {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-label {
  display: none;
}

.status-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-value {
  color: #f8fafc;
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-pill.hp-pill,
.status-pill.gold-pill,
.status-pill.lvl-pill {
  min-width: auto;
  border-color: rgba(255, 255, 255, 0.1);
}

.status-pill.hp-pill:hover,
.status-pill.gold-pill:hover,
.status-pill.lvl-pill:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.hp-bar-container {
  width: 75px;
  height: 10px;
  padding: 1px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a 0%, #4ade80 75%, #bbf7d0 100%);
  border-radius: inherit;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
  transition: width 0.3s ease;
}

.status-pill.gold-pill #gold-count {
  font-size: 16px;
  font-weight: 800;
  color: #fef08a;
}

.status-pill.lvl-pill #player-level {
  font-size: 14px;
  font-weight: 800;
  color: #bae6fd;
}

.lvl-bar-container {
  width: 65px;
  height: 10px;
  padding: 1px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.lvl-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 75%, #bae6fd 100%);
  border-radius: inherit;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
  transition: width 0.3s ease;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.btn-header {
  min-height: 38px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 4px 16px;
  font-family: var(--font-btn);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  color: #f1f5f9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: all 0.18s ease;
}

.btn-header:hover {
  background: rgba(250, 204, 21, 0.2);
  border-color: rgba(250, 204, 21, 0.5);
  color: #fef08a;
  transform: translateY(-1px);
}

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

/* --- AUTO-HIDE & PINNED NAVBAR --- */
#app.header-autohide #main-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transform: translateY(calc(-100% + 5px));
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
}

/* Hover trigger safety zone extending 16px down so pointing near top effortlessly reveals the navbar */
#app.header-autohide #main-header::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
  pointer-events: auto;
}

/* Reveal when hovering over header, peek tab, or trigger zone (unless user just clicked HIDE) */
#app.header-autohide #main-header:hover:not(.is-collapsed),
#app.header-autohide #main-header.is-hovered:not(.is-collapsed) {
  transform: translateY(0);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

/* Force collapse when clicking HIDE until mouse leaves */
#app.header-autohide #main-header.is-collapsed {
  transform: translateY(calc(-100% + 5px)) !important;
  box-shadow: none !important;
}

#app.header-pinned #main-header {
  position: relative;
  transform: translateY(0);
}

/* Middle Pin/Hide Peek Tab: visible when navbar is hidden so user knows where to point */
.header-peek-tab {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24, 17, 14, 0.96);
  border: 1.5px solid rgba(200, 162, 96, 0.35);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 3px 14px 4px;
  cursor: pointer;
  color: #fef08a;
  font-family: var(--font-btn);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  user-select: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.header-peek-tab:hover {
  background: rgba(38, 26, 20, 0.98);
  border-color: rgba(250, 204, 21, 0.7);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 8px rgba(250, 204, 21, 0.3);
}

.header-peek-tab:active {
  transform: translateX(-50%) translateY(1px);
}

.peek-tab-icon {
  font-size: 10px;
  line-height: 1;
  display: inline-block;
}

.peek-tab-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.header-peek-tab.is-pinned-mode {
  border-color: rgba(250, 204, 21, 0.45);
  color: #fef08a;
}

/* --- MINIMALISTIC FULL-SCREEN BATTLEFIELD VIEW --- */
.minimal-battle-view {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 24px;
  background-color: #1a2e22;
  background-image: 
    linear-gradient(rgba(10, 20, 15, 0.4), rgba(10, 20, 15, 0.6)),
    url('../assets/board/background act1.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.arena-stage-box {
  width: 100%;
  max-width: 1380px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arena-container {
  flex: 1;
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

#battle-canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.arena-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 10px;
}

/* --- IN-BOARD SYNERGY TRACKER (LEFT OF THE BOARD) --- */
.board-synergies-tracker {
  position: absolute;
  top: 18px;
  left: 14px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
  overflow: visible;
  padding: 4px 6px 4px 2px;
}

.board-synergy-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: rgba(10, 18, 30, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.board-synergy-chip:hover {
  transform: translateX(4px) scale(1.06);
  z-index: 50;
}

/* Inactive / Progressing (e.g. 1 of 2) */
.board-synergy-chip.inactive {
  opacity: 0.88;
}

/* Active Synergy */
.board-synergy-chip.active {
  opacity: 1;
}

.board-synergy-icon-frame {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.board-synergy-count {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 900;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
}

/* Bronze Number */
.board-synergy-count.count-bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #b8621b 50%, #78350f 100%);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Silver Number */
.board-synergy-count.count-silver {
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 40%, #94a3b8 100%);
  color: #0f172a;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Gold Number */
.board-synergy-count.count-gold {
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #b45309 100%);
  color: #451a03;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  border: 1px solid #fde047;
}

/* Inactive Number */
.board-synergy-count.count-inactive {
  background: rgba(30, 41, 59, 0.85);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Tooltip Popup on Hover */
.board-synergy-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  transform: none;
  width: 275px;
  background: rgba(10, 18, 30, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 99999;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  line-height: 1.4;
}

/* Invisible bridge so moving cursor across the gap to the tooltip never loses hover */
.board-synergy-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: -20px;
  width: 24px;
  background: transparent;
  pointer-events: auto;
}

.board-synergy-chip:hover .board-synergy-tooltip,
.board-synergy-chip.mobile-tooltip-active .board-synergy-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.board-synergy-chip.mobile-tooltip-active {
  z-index: 90002;
}

.arena-main-row.synergy-elevated,
.arena-main-row:has(.board-synergies-tracker:hover),
.arena-main-row:has(.board-synergies-tracker.expanded),
.arena-main-row:has(.board-synergies-tracker.active-open),
.arena-main-row:has(.board-synergy-chip:hover),
.arena-main-row:has(.board-synergy-chip.mobile-tooltip-active) {
  z-index: 90000 !important;
  overflow: visible !important;
}

.board-syn-tip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.board-syn-tip-title {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 800;
  color: #f6e05e;
  display: flex;
  align-items: center;
  gap: 5px;
}

.board-syn-tip-tier-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 6px;
  color: #fff;
}

.board-syn-tip-desc {
  font-size: 11px;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.board-syn-tip-tiers {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10.5px;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.board-syn-tip-tier-line {
  line-height: 1.35;
  color: #64748b;
  opacity: 0.55;
  filter: grayscale(100%);
  transition: all 0.15s ease;
}

.board-syn-tip-tier-line strong {
  color: #64748b;
  font-weight: 700;
  margin-right: 3px;
}

.board-syn-tip-tier-line:not(.active) [class*="stat-hl-"],
.board-syn-tip-tier-line:not(.active) span,
.board-syn-tip-tier-line.inactive [class*="stat-hl-"],
.board-syn-tip-tier-line.inactive span {
  color: #94a3b8 !important;
  text-shadow: none !important;
}

.board-syn-tip-tier-line.active {
  color: #86efac;
  opacity: 1;
  filter: none;
  font-weight: 700;
}

.board-syn-tip-tier-line.active strong {
  color: #4ade80;
  font-weight: 800;
}

/* Trait beast avatar grid */
.board-syn-tip-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.syn-avatar-card {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--cost-border, #64748b);
  background: #0f172a;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.syn-avatar-card.deployed {
  filter: none;
  opacity: 1;
  box-shadow: 0 0 6px var(--cost-border, #38bdf8);
  border-width: 2px;
}

.syn-avatar-card.inactive {
  filter: grayscale(100%) brightness(0.65) opacity(0.35);
  border-color: rgba(255, 255, 255, 0.15);
}

.syn-avatar-card:hover {
  transform: scale(1.15);
  z-index: 5;
  filter: none;
  opacity: 1;
}

.syn-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.syn-avatar-cost {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.90);
  color: var(--cost-border, #fbbf24);
  font-size: 8.5px;
  font-weight: 900;
  padding: 0 2.5px;
  border-top-left-radius: 4px;
  line-height: 1.1;
  pointer-events: none;
}

.board-syn-tip-beasts {
  font-size: 10.5px;
  color: #cbd5e1;
  margin-top: 6px;
  font-style: italic;
}

.btn-action {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--panel-shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn-action:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--panel-shadow);
}

.btn-start {
  background: #e53e3e;
  color: #fff;
}

.btn-reroll {
  background: #ecc94b;
  color: #2d3748;
}

.btn-buy-xp {
  background: #48bb78;
  color: #fff;
}

.battle-timer-pill {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 800;
  background: rgba(23, 30, 42, 0.92);
  color: #f6e05e;
  border: 2.5px solid #ecc94b;
  border-radius: 12px;
  padding: 8px 18px;
  box-shadow: 0 4px 0 var(--panel-shadow), 0 0 12px rgba(236, 201, 75, 0.35);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: timerPulse 1s ease-in-out infinite alternate;
}

.battle-timer-pill.hidden {
  display: none !important;
}

.battle-timer-pill.overtime {
  background: rgba(197, 48, 48, 0.95);
  color: #fff;
  border-color: #feb2b2;
  box-shadow: 0 4px 0 #742a2a, 0 0 20px rgba(245, 101, 101, 0.7);
  animation: overtimeFlash 0.35s ease-in-out infinite alternate;
}

@keyframes timerPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

@keyframes overtimeFlash {
  0% { transform: scale(1); box-shadow: 0 0 10px #f56565; }
  100% { transform: scale(1.08); box-shadow: 0 0 25px #ff4757; }
}

/* --- ON-BOARD LEVEL UP CELEBRATION BANNER --- */
.board-level-up-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 600;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at 50% 30%, rgba(56, 44, 32, 0.92) 0%, rgba(36, 26, 18, 0.95) 100%);
  border: none;
  border-radius: 20px;
  padding: 14px 38px 18px;
  box-shadow: 
    0 0 60px rgba(250, 204, 21, 0.65),
    0 0 100px rgba(250, 204, 21, 0.35),
    0 12px 36px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  animation: levelUpBannerIn 2.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.board-level-up-banner.hidden {
  display: none !important;
}

.level-up-glow {
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.45) 0%, rgba(250, 204, 21, 0.15) 50%, transparent 75%);
  border-radius: 40px;
  pointer-events: none;
  z-index: -1;
  animation: levelUpGlowPulse 1.4s ease-in-out infinite alternate;
}

.level-up-title {
  font-family: var(--font-title);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.95), 0 0 36px rgba(250, 204, 21, 0.9), 0 2px 6px rgba(0, 0, 0, 0.9);
  margin: 0 0 4px 0;
  white-space: nowrap;
}

.level-up-capacity {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 900;
  color: #4ade80;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.95), 0 0 32px rgba(74, 222, 128, 0.5), 0 2px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.8px;
  white-space: nowrap;
}

@keyframes levelUpBannerIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.7);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
  20% {
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.95);
  }
}

@keyframes levelUpGlowPulse {
  0% { opacity: 0.5; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.08); }
}

/* --- AMBIENT PARTICLES CANVAS (Sparks, Embers & Spores) --- */
.ambient-particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* --- CHAMPION SELECT --- */
.champion-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image:
    linear-gradient(180deg, rgba(3, 10, 20, 0.42) 0%, rgba(3, 10, 20, 0.20) 40%, rgba(3, 10, 20, 0.72) 100%),
    url('../assets/images/start-screen-all-champions.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow-y: auto;
}

.champion-screen-overlay.hidden,
.champion-status.hidden { display: none !important; }

.champion-select-card {
  position: relative;
  z-index: 2;
  width: min(1320px, 100%);
  color: #f8fafc;
}

.champion-select-heading { text-align: center; margin-bottom: 18px; }
.champion-select-heading h2 {
  font-family: var(--font-title);
  font-size: clamp(30px, 4vw, 54px);
  letter-spacing: 2px;
  text-shadow: 0 4px 0 #000;
}
.champion-select-heading p { color: #cbd5e1; font-size: 17px; }
.champion-kicker { color: #facc15; font-size: 12px; font-weight: 900; letter-spacing: 3px; }

.champion-carousel-nav { display: none; }
.champion-choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.champion-choice {
  --champion-color: #4ade80;
  --champion-dark: #064e3b;
  min-width: 0;
  padding: 18px;
  border: 3px solid color-mix(in srgb, var(--champion-color) 70%, white);
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(165deg, rgba(20, 83, 45, 0.95) 0%, rgba(6, 78, 59, 0.88) 45%, #052e16 100%);
  box-shadow: 0 8px 0 #0f391e, 0 18px 35px rgba(0,0,0,.55), 0 0 24px rgba(34, 197, 94, 0.25);
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.milo-choice {
  --champion-color: #4ade80;
  --champion-dark: #064e3b;
  background: linear-gradient(165deg, #14532d 0%, #064e3b 50%, #022c22 100%);
  border-color: #22c55e;
  box-shadow: 0 8px 0 #052e16, 0 18px 35px rgba(0,0,0,.55), 0 0 30px rgba(34, 197, 94, 0.3);
}

.rex-choice {
  --champion-color: #fb923c;
  --champion-dark: #7f1d1d;
  background: linear-gradient(165deg, #991b1b 0%, #7f1d1d 50%, #450a0a 100%);
  border-color: #ef4444;
  box-shadow: 0 8px 0 #450a0a, 0 18px 35px rgba(0,0,0,.55), 0 0 30px rgba(239, 68, 68, 0.35);
}

.zipp-choice {
  --champion-color: #38bdf8;
  --champion-dark: #0c4a6e;
  background: linear-gradient(165deg, #075985 0%, #0c4a6e 50%, #082f49 100%);
  border-color: #0ea5e9;
  box-shadow: 0 8px 0 #031c30, 0 18px 35px rgba(0,0,0,.55), 0 0 30px rgba(14, 165, 233, 0.35);
}
.champion-portrait {
  position: relative;
  height: 160px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #081018;
  border: 2px solid color-mix(in srgb, var(--champion-color) 60%, transparent);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}
.champion-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.champion-choice:hover .champion-art-img,
.champion-choice:focus-visible .champion-art-img {
  transform: scale(1.05);
  filter: brightness(1.08);
}
.champion-portrait-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(10, 16, 26, 0.82);
  border: 1px solid color-mix(in srgb, var(--champion-color) 65%, transparent);
  border-radius: 20px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.champion-face { font-size: 20px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.mascot-face { font-size: 18px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.champion-name { color: var(--champion-color); font: 900 32px/1 var(--font-title); text-align: center; margin-top: 12px; }
.champion-style { color: #fff; font: 800 15px var(--font-title); text-align: center; letter-spacing: 1px; margin: 4px 0 6px; }
.champion-choice blockquote { color: color-mix(in srgb, var(--champion-color) 65%, white); font-weight: 900; text-align: center; margin-bottom: 8px; font-size: 13.5px; min-height: 20px; }

.champion-details-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1.5px solid color-mix(in srgb, var(--champion-color) 35%, transparent);
  border-radius: 14px;
  padding: 12px;
  flex: 1;
  justify-content: flex-start;
}

.champ-bio-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: #e2e8f0;
}

.champ-power-section,
.champ-run-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 4px solid var(--champion-color);
  border-radius: 0 10px 10px 0;
  padding: 11px 13px;
}

.champ-power-title,
.champ-run-title {
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 900;
  color: color-mix(in srgb, var(--champion-color) 90%, white);
  letter-spacing: 0.5px;
}

.champ-power-desc,
.champ-run-desc {
  font-size: 13.5px;
  color: #e2e8f0;
  line-height: 1.45;
}

.champ-power-desc strong,
.champ-run-desc strong {
  color: #ffffff;
  font-weight: 800;
}

.choose-label {
  display: block;
  margin-top: auto;
  padding: 12px;
  border-radius: 12px;
  background: var(--champion-color);
  color: #081018;
  text-align: center;
  font: 900 15px var(--font-title);
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
  flex-shrink: 0;
}

.champion-choice:hover .choose-label {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.champion-status { border-color: rgba(255,255,255,.45); display: inline-flex; align-items: center; }
.champion-mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

@media (max-width: 900px) {
  .champion-choice-grid { grid-template-columns: 1fr; }
  .champion-screen-overlay { align-items: flex-start; }
  .champion-choice > p { min-height: 0; }
}

/* --- FULL-SCREEN PAUSE & SETTINGS MODAL (Parchment Paper Theme) --- */
.pause-modal-card {
  background: linear-gradient(180deg, #fffdf5 0%, #fffaf0 55%, #f7f1e6 100%);
  border: 5px solid #5b402f;
  border-radius: 22px;
  box-shadow: 0 11px 0 #2f211b, 0 30px 55px rgba(0, 0, 0, 0.58);
  padding: 0 24px 18px;
  max-width: 920px;
  width: min(920px, calc(100vw - 28px));
  max-height: min(95vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.pause-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  margin: 0 -24px 14px;
  padding: 16px 24px 14px;
  border-bottom: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: 15px 15px 20px 20px;
  background:
    radial-gradient(circle at 12% -30%, rgba(255, 231, 144, 0.66), transparent 48%),
    linear-gradient(180deg, #fff8dc 0%, #fffdf5 100%);
  box-shadow: 0 3px 0 rgba(91, 64, 47, 0.08);
}

.pause-heading-copy {
  min-width: 0;
}

.pause-eyebrow {
  display: block;
  color: #a16207;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.8px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: none;
}

.pause-title {
  font-family: var(--font-title);
  font-size: 27px;
  font-weight: 900;
  color: #4b3024;
  line-height: 1.05;
  margin-top: 3px;
  letter-spacing: -0.4px;
  text-shadow: none;
}

.pause-subtitle {
  margin-top: 3px;
  color: #7b6a5d;
  font-size: 12.5px;
  font-weight: 700;
  text-shadow: none;
}

.pause-close-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffe277 0%, #f59e0b 45%, #d97706 80%, #b45309 100%);
  border: 2px solid #fff3a1;
  color: #451a03;
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    0 0 0 3px #5b402f,
    0 4px 0 #2f211b,
    0 6px 12px rgba(0, 0, 0, 0.35),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -2.5px 0 #92400e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.pause-close-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 3px #5b402f,
    0 6px 0 #2f211b,
    0 8px 14px rgba(0, 0, 0, 0.4);
}

.pause-close-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 0 0 3px #5b402f,
    0 1px 0 #2f211b,
    inset 0 1px 0 rgba(0, 0, 0, 0.2);
}

.pause-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.95fr);
  gap: 18px;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.pause-synergies-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px 0;
  scrollbar-color: #d97706 transparent;
  scrollbar-width: thin;
}

.pause-synergies-column::-webkit-scrollbar { width: 6px; }
.pause-synergies-column::-webkit-scrollbar-track { background: transparent; }
.pause-synergies-column::-webkit-scrollbar-thumb {
  background: #d97706;
  border-radius: 999px;
}

.pause-column-title {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 13.5px;
  font-weight: 900;
  color: #78350f;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: none;
  z-index: 5;
  padding: 4px 0;
  background: linear-gradient(180deg, #fffcf3 0%, rgba(255, 252, 243, 0.92) 80%, transparent 100%);
}

.pause-column-title::after {
  content: '';
  height: 2px;
  flex: 1;
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.35), transparent);
}

.pause-section-count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 900;
  color: #451a03;
  background: linear-gradient(180deg, #ffe277 0%, #f59e0b 50%, #b45309 100%);
  border: 1px solid #fff3a1;
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(91, 64, 47, 0.3);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pause-relics-title {
  margin-top: 6px;
}

.pause-settings-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 12px 18px 12px;
  scrollbar-color: #d97706 transparent;
  scrollbar-width: thin;
}

.pause-settings-column::-webkit-scrollbar { width: 6px; }
.pause-settings-column::-webkit-scrollbar-track { background: transparent; }
.pause-settings-column::-webkit-scrollbar-thumb {
  background: #d97706;
  border-radius: 999px;
}

/* --- GOLDEN AMBER 3D BUTTON (Parchment & Paper Theme) --- */
.pause-action-btn {
  position: relative;
  min-height: 60px;
  background: linear-gradient(180deg, #ffe066 0%, #f59e0b 38%, #d97706 70%, #b45309 100%);
  border: 2.5px solid #fff3a1;
  border-radius: 999px;
  padding: 10px 22px 12px 18px;
  cursor: pointer;
  box-shadow:
    0 0 0 3.5px #7c3418,
    0 0 0 5.5px #5b402f,
    0 6px 0 5.5px #2f211b,
    0 10px 18px rgba(0, 0, 0, 0.35),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45),
    inset 0 -4px 0 #92400e;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-align: left;
  margin: 3px 6px 8px 6px;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease, filter 0.12s ease;
  user-select: none;
  overflow: visible;
}

.pause-action-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow:
    0 0 0 3.5px #8c3a1b,
    0 0 0 5.5px #5b402f,
    0 8px 0 5.5px #2f211b,
    0 14px 22px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 0 #92400e;
}

.pause-action-btn:active {
  transform: translateY(4px);
  filter: brightness(0.96);
  box-shadow:
    0 0 0 3.5px #7c3418,
    0 0 0 5.5px #5b402f,
    0 2px 0 5.5px #2f211b,
    0 4px 6px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 0 #92400e;
}

/* Abandon Danger Button */
.pause-action-btn.btn-abandon {
  background: linear-gradient(180deg, #fca5a5 0%, #ef4444 38%, #b91c1c 70%, #7f1d1d 100%);
  border-color: #fecaca;
  box-shadow:
    0 0 0 3.5px #7f1d1d,
    0 0 0 5.5px #5b402f,
    0 6px 0 5.5px #2f211b,
    0 10px 18px rgba(0, 0, 0, 0.35),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45),
    inset 0 -4px 0 #581111;
}

.pause-action-btn.btn-abandon:hover {
  filter: brightness(1.08);
  box-shadow:
    0 0 0 3.5px #991b1b,
    0 0 0 5.5px #5b402f,
    0 8px 0 5.5px #2f211b,
    0 14px 22px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 0 #581111;
}

.pause-action-btn.btn-abandon:active {
  box-shadow:
    0 0 0 3.5px #7f1d1d,
    0 0 0 5.5px #5b402f,
    0 2px 0 5.5px #2f211b;
}

/* Ensure text and icons render crisply above glossy reflection */
.pause-action-icon,
.pause-action-copy,
.pause-action-arrow {
  position: relative;
  z-index: 3;
}

.pause-action-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffe277 0%, #f59e0b 50%, #d97706 100%);
  border: 1.5px solid #fff3a1;
  box-shadow:
    0 2px 0 rgba(91, 64, 47, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #451a03;
  font-family: var(--font-title);
  font-size: 19px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pause-action-btn.btn-abandon .pause-action-icon {
  background: linear-gradient(180deg, #fee2e2 0%, #f87171 50%, #dc2626 100%);
  border: 1.5px solid #fecaca;
  color: #450a0a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pause-action-copy {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.pause-action-copy strong {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.15;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow:
    0 2px 0 #78350f,
    0 3px 0 #542205,
    0 4px 4px rgba(0, 0, 0, 0.55);
}

.pause-action-copy small {
  color: #fef3c7;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-shadow:
    0 1px 2px rgba(69, 26, 3, 0.9),
    0 2px 3px rgba(0, 0, 0, 0.4);
}

.pause-action-arrow {
  margin-left: auto;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  text-shadow:
    0 2px 0 #78350f,
    0 3px 3px rgba(0, 0, 0, 0.5);
  opacity: 0.95;
}
/* --- CURRENT RUN STATISTICS (Parchment Paper Theme) --- */
.run-stats-modal {
  width: min(840px, calc(100vw - 28px));
  max-width: 840px;
  max-height: min(92vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf5 0%, #fffaf0 55%, #f7f1e6 100%);
  border: 5px solid #5b402f;
  border-radius: 22px;
  box-shadow: 0 11px 0 #2f211b, 0 30px 55px rgba(0, 0, 0, 0.58);
  padding: 0 24px 20px;
  color: #4b3024;
  text-align: left;
}

.run-stats-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  margin: 0 -24px 14px;
  padding: 16px 24px 14px;
  border-bottom: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: 15px 15px 20px 20px;
  background:
    radial-gradient(circle at 12% -30%, rgba(255, 231, 144, 0.66), transparent 48%),
    linear-gradient(180deg, #fff8dc 0%, #fffdf5 100%);
  box-shadow: 0 3px 0 rgba(91, 64, 47, 0.08);
}

.run-stats-eyebrow {
  display: block;
  color: #a16207;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.8px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: none;
}

.run-stats-header h2 {
  margin: 3px 0 0;
  color: #4b3024;
  font-family: var(--font-title);
  font-size: 27px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.4px;
  text-shadow: none;
}

.run-stats-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 2px 6px 12px 2px;
  scrollbar-color: #d97706 transparent;
  scrollbar-width: thin;
}

.run-stats-scroll::-webkit-scrollbar { width: 6px; }
.run-stats-scroll::-webkit-scrollbar-track { background: transparent; }
.run-stats-scroll::-webkit-scrollbar-thumb {
  background: #d97706;
  border-radius: 999px;
}

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

.run-stats-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 13px;
  border: 2px solid #e2d9cc;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 3px 0 rgba(91, 64, 47, 0.12);
}

.run-stats-summary span {
  color: #7b6a5d;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: none;
}

.run-stats-summary strong {
  color: #432818;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 900;
  text-shadow: none;
}

.run-stats-summary.is-win strong { color: #16a34a; }
.run-stats-summary.is-loss strong { color: #dc2626; }

.run-stats-combat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.run-stats-combat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px 12px 18px;
  border: 2px solid #e2d9cc;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 3px 0 rgba(91, 64, 47, 0.12);
}

.run-stats-combat-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #f59e0b;
}

.run-stats-combat-card.block::before { background: #38bdf8; }
.run-stats-combat-card.support::before { background: #4ade80; }
.run-stats-combat-card > span { color: #7b6a5d; font-size: 11px; font-weight: 850; text-transform: uppercase; text-shadow: none; }
.run-stats-combat-card > strong { color: #432818; font-family: var(--font-title); font-size: 24px; font-weight: 900; text-shadow: none; }
.run-stats-combat-card > small { color: #8c7665; font-size: 10.5px; font-weight: 700; }

.run-stats-beasts {
  margin-top: 14px;
  overflow: hidden;
  border: 2px solid #e2d9cc;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 3px 0 rgba(91, 64, 47, 0.12);
}

.run-stats-section-title {
  padding: 10px 14px;
  color: #78350f;
  border-bottom: 2px solid #e2d9cc;
  background: #fdfaf2;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-shadow: none;
}

.run-stats-beast-row {
  display: grid;
  grid-template-columns: 25px 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #ede5d8;
}

.run-stats-beast-row:last-child { border-bottom: 0; }
.run-stats-rank { color: #a16207; font-size: 13px; font-weight: 900; text-align: center; }
.run-stats-beast-row:first-of-type .run-stats-rank { color: #d97706; }
.run-stats-beast-art { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #f7f1e6; border: 1.5px solid #dcd3c5; }
.run-stats-beast-copy, .run-stats-beast-value { display: flex; flex-direction: column; gap: 2px; }
.run-stats-beast-copy strong { color: #432818; font-size: 13.5px; font-weight: 800; text-shadow: none; }
.run-stats-beast-copy span, .run-stats-beast-value span { color: #7b6a5d; font-size: 10.5px; font-weight: 700; }
.run-stats-beast-value { text-align: right; }
.run-stats-beast-value strong { color: #0284c7; font-family: var(--font-title); font-size: 17px; font-weight: 900; text-shadow: none; }
.run-stats-empty { padding: 30px 16px; color: #7b6a5d; font-size: 13px; font-weight: 700; text-align: center; }

.run-stats-menu-btn {
  margin-top: 14px;
  min-height: 52px;
  padding: 10px 20px;
  border: 2.5px solid #fff3a1;
  border-radius: 16px;
  color: #451a03;
  background: linear-gradient(180deg, #ffe277 0%, #f59e0b 45%, #d97706 75%, #b45309 100%);
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow:
    0 0 0 3px #5b402f,
    0 5px 0 #2f211b,
    0 8px 15px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    inset 0 -3px 0 #92400e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.run-stats-menu-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow:
    0 0 0 3px #5b402f,
    0 7px 0 #2f211b,
    0 12px 20px rgba(0, 0, 0, 0.4);
}

.run-stats-menu-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 0 0 3px #5b402f,
    0 1px 0 #2f211b;
}

@media (max-width: 660px) {
  .run-stats-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-stats-combat-grid { grid-template-columns: 1fr; }
}
/* Pause Modal Map Legend */
.pause-legend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 2px solid var(--panel-border);
  border-radius: 12px;
}

.pause-legend-grid .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #2d3748;
}

.pause-legend-grid .legend-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #d97706;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 35% 30%, #fffbeb 0%, #fde047 25%, #d97706 70%, #78350f 100%);
  padding: 2px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  overflow: hidden;
}

.pause-legend-grid .legend-dot .node-svg-icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* Synergy Badges */
.synergy-badge {
  border: 2px solid #cbd5e0;
  border-radius: 12px;
  padding: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}

.pause-modal-card .synergy-badge {
  padding: 10px 12px;
  border: 2px solid #e2d9cc;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 3px 0 rgba(91, 64, 47, 0.12);
}

.pause-modal-card .synergy-badge.active {
  border-color: #f59e0b;
  background: #fffef8;
  box-shadow: 0 3px 0 rgba(217, 119, 6, 0.25), inset 0 0 0 1px #fde047;
}

.pause-modal-card .synergy-header { margin-bottom: 4px; }

.pause-modal-card .synergy-icon {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

.pause-modal-card .synergy-name {
  color: #432818;
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 900;
  text-shadow: none;
}

.pause-modal-card .synergy-tier-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.pause-modal-card .synergy-desc {
  color: #5c4738;
  font-size: 12px;
  line-height: 1.35;
}

.pause-modal-card .board-syn-tip-avatars {
  gap: 5px !important;
  margin-top: 7px !important;
  padding-top: 7px !important;
  border-top: 1px solid #ede5d8;
}

.pause-modal-card .syn-avatar-card {
  border-radius: 7px !important;
  box-shadow: 0 2px 4px rgba(91, 64, 47, 0.2);
}

.synergy-badge.active {
  border-width: 2px;
  box-shadow: 0 4px 12px rgba(51, 65, 85, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.synergy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.synergy-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
}

.synergy-name {
  font-weight: 800;
  font-size: 14px;
  flex: 1;
  margin-left: 8px;
}

.synergy-tier-badge {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
}

.synergy-desc {
  font-size: 12px;
  color: #4a5568;
  line-height: 1.3;
}

/* Relics */
.relic-item-card {
  background: #fff;
  border: 2px solid var(--panel-border);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 0 var(--panel-shadow);
}

.pause-modal-card .relic-item-card {
  border: 2px solid #e2d9cc;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 3px 0 rgba(91, 64, 47, 0.12);
  padding: 9px 12px;
}

.pause-modal-card .relic-name {
  color: #432818;
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 800;
  text-shadow: none;
}

.pause-modal-card .relic-desc {
  color: #5c4738;
  font-size: 12px;
}
.relic-icon-badge {
  font-size: 22px;
}

.relic-item-info {
  display: flex;
  flex-direction: column;
}

.relic-name {
  font-size: 13px;
  font-weight: 800;
}

.relic-desc {
  font-size: 11px;
  color: #718096;
  line-height: 1.2;
}

/* --- START SCREEN OVERLAY (Main Menu) --- */
.start-screen-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: #071728;
  background-image:
    linear-gradient(180deg, rgba(3, 10, 20, 0.22) 0%, rgba(3, 10, 20, 0.08) 40%, rgba(3, 10, 20, 0.65) 100%),
    url('../assets/images/start-screen-all-champions.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.start-menu-card {
  position: relative;
  z-index: 2;
  background: linear-gradient(155deg, rgba(8, 20, 34, 0.9), rgba(14, 31, 48, 0.78));
  border: 3px solid rgba(155, 209, 242, 0.42);
  border-radius: 24px;
  box-shadow: 0 12px 0 rgba(3, 9, 17, 0.7), 0 30px 55px rgba(0, 0, 0, 0.68), inset 0 1px 0 rgba(255,255,255,.14);
  backdrop-filter: blur(9px);
  padding: 40px 50px;
  text-align: center;
  max-width: 620px;
  width: 90%;
  animation: startCardPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.start-beta-emblem {
  position: absolute;
  top: -16px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: linear-gradient(135deg, #c0392b 0%, #8e1b10 52%, #5c0d06 100%);
  border: 2px solid #ffd58a;
  border-radius: 999px;
  box-shadow: 0 4px 0 #2c0603, 0 6px 16px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #ffe8a5;
  font-family: var(--font-title, sans-serif);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  z-index: 10;
  cursor: pointer;
  user-select: none;
  text-shadow: 0 2px 0 #280402;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, filter 0.2s ease;
}

.start-beta-emblem:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 0 #2c0603, 0 10px 22px rgba(230, 80, 50, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  filter: brightness(1.08);
}

.start-beta-emblem:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 2px 0 #2c0603, 0 4px 8px rgba(0, 0, 0, 0.6);
}

.beta-emblem-star {
  font-size: 10px;
  color: #ffd58a;
  animation: betaGlint 2.8s ease-in-out infinite;
}

@keyframes betaGlint {
  0%, 100% { opacity: 0.75; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.25); filter: drop-shadow(0 0 4px #ffc107); }
}

.start-logo-badge {
  font-size: 52px;
  margin-bottom: -10px;
  animation: logoWag 2s ease-in-out infinite;
}

.start-title {
  font-family: var(--font-title);
  font-size: 42px;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #f6e05e;
}

.start-subtitle {
  font-size: 16px;
  font-weight: 800;
  color: #d8e7f2;
  margin-bottom: 24px;
}

.start-beasts-showcase {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.showcase-beast {
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 2px solid var(--panel-border);
  box-shadow: 0 3px 0 var(--panel-shadow);
}

.start-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.btn-start-menu {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 16px;
  border: 3px solid var(--panel-border);
  cursor: pointer;
  box-shadow: 0 5px 0 var(--panel-shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn-start-menu:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--panel-shadow);
}

.btn-play {
  background: #48bb78;
  color: #fff;
}

.btn-guide {
  background: #fff;
  color: #2d3748;
}

.start-footer-tag {
  font-size: 12px;
  font-weight: 800;
  color: #b8cad9;
}

.start-copyright-tag {
  font-size: 11px;
  color: #9cb3c7;
  margin-top: 6px;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.start-legal-links {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-legal-link {
  background: none;
  border: none;
  color: #63b3ed;
  cursor: pointer;
  text-decoration: underline;
  font-size: 11px;
  padding: 2px 4px;
  font-family: inherit;
  transition: color 0.15s;
}

.btn-legal-link:hover {
  color: #fff;
}

.legal-dot {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

.start-bottom-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
  white-space: nowrap;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bottom-legal-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
  pointer-events: auto;
  transition: color 0.15s;
}

.bottom-legal-link:hover {
  color: #fff;
}

@media (max-width: 760px) {
  .start-screen-overlay { background-position: 42% center; }
  .start-menu-card { padding: 28px 24px; }
  .start-title { font-size: 34px; }
  .start-beasts-showcase { flex-wrap: wrap; }
}

@keyframes startCardPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes logoWag {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

/* --- INTRO STORY SCREEN OVERLAY --- */
.intro-screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.intro-card {
  background: var(--panel-bg);
  border: 5px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: 0 14px 0 var(--panel-shadow), 0 30px 45px rgba(0,0,0,0.55);
  padding: 34px 40px;
  max-width: 660px;
  width: 90%;
  text-align: center;
}

.intro-badge {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 800;
  color: #d69e2e;
  letter-spacing: 1.5px;
}

.intro-title {
  font-family: var(--font-title);
  font-size: 28px;
  color: var(--panel-border);
  margin: 8px 0 18px 0;
}

.intro-story-body {
  font-size: 15px;
  line-height: 1.6;
  color: #4a5568;
  margin-bottom: 26px;
  text-align: left;
}

.intro-realms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.intro-realm-item {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.realm-num {
  background: #4a2e2b;
  color: #fff;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
}

.btn-begin-journey {
  width: 100%;
  font-size: 17px;
  padding: 14px 24px;
}

/* --- TOASTS & MODALS --- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  z-index: 9999;
  animation: toastPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-info { background: #3182ce; color: #fff; }
.toast-gold { background: #d69e2e; color: #fff; }
.toast-warning { background: #dd6b20; color: #fff; }
.toast-danger { background: #e53e3e; color: #fff; }

.toast-fadeout {
  opacity: 0;
  transition: opacity 0.4s;
}

@keyframes toastPop {
  0% { transform: translate(-50%, 20px) scale(0.8); opacity: 0; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.hidden,
.modal-overlay.hidden,
.start-screen-overlay.hidden,
.intro-screen-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: var(--panel-bg);
  border: 5px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 12px 0 var(--panel-shadow), 0 25px 35px rgba(0,0,0,0.5);
  padding: 28px;
  max-width: 520px;
  width: 90%;
  text-align: center;
}

.modal-card h2 {
  font-family: var(--font-title);
  font-size: 26px;
  margin-bottom: 14px;
  color: var(--panel-border);
}

.modal-card p {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 18px;
}

/* ==========================================
   🔮 ATMOSPHERIC MYSTERY EVENT MODAL & CARDS
   ========================================== */
.event-modal-card {
  width: min(860px, calc(96vw - 20px)) !important;
  max-width: min(860px, calc(96vw - 20px)) !important;
  max-height: min(94vh, 940px);
  overflow-y: auto;
  padding: 24px 30px !important;
  background: radial-gradient(circle at 50% 0%, #15343f 0%, #0d232c 60%, #07151b 100%) !important;
  border: 3px solid #1f5968 !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 35px rgba(22, 85, 102, 0.35) !important;
  color: #e2f1f8;
}

.event-modal-card h2 {
  font-family: var(--font-title);
  font-size: clamp(24px, 2.3vw, 32px);
  color: #f1f8fc !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 16px rgba(56, 189, 248, 0.35);
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 14px;
}

.event-art-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  max-height: clamp(360px, 52vh, 540px);
  overflow: hidden;
  border: 3.5px solid #236577;
  border-radius: 18px;
  background: #08161d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 20px rgba(18, 64, 76, 0.35);
}

.event-art-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.5);
}

.event-art-frame-outcome {
  max-height: 280px;
  margin-top: 10px;
}

.event-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-story-box {
  background: rgba(7, 21, 27, 0.75);
  border: 1.5px solid #194653;
  border-radius: 14px;
  padding: 16px 22px;
  margin: 16px 0 20px 0;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.event-story-para {
  font-size: 16px;
  line-height: 1.7;
  color: #9cbacf;
  margin: 0 0 12px 0;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.event-story-para:last-child {
  margin-bottom: 0;
}

/* Story Narrative Highlights */
.ev-hl-green {
  color: #4ade80;
  font-weight: 750;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
}

.ev-hl-red {
  color: #f87171;
  font-weight: 750;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

.ev-hl-cyan {
  color: #2dd4bf;
  font-weight: 750;
  text-shadow: 0 0 8px rgba(45, 212, 191, 0.3);
}

.ev-hl-gold {
  color: #fbbf24;
  font-weight: 750;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

/* Stat & Combat Keyword Color Highlights (Synergies, Info Card, Relics, Items) */
.stat-hl-armor {
  color: #cbd5e1;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(203, 213, 225, 0.35);
}

.stat-hl-shield {
  color: #38bdf8;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.35);
}

.stat-hl-heal {
  color: #4ade80;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(74, 222, 128, 0.35);
}

.stat-hl-damage {
  color: #fb923c;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(251, 146, 60, 0.35);
}

.stat-hl-burn {
  color: #ff6b6b;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(255, 107, 107, 0.35);
}

.stat-hl-truedamage {
  color: #e879f9;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(232, 121, 249, 0.35);
}

.stat-hl-speed {
  color: #facc15;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(250, 204, 21, 0.35);
}

.stat-hl-crit {
  color: #c084fc;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(192, 132, 252, 0.35);
}

.stat-hl-lifesteal {
  color: #fb7185;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(251, 113, 133, 0.35);
}

.stat-hl-mana {
  color: #60a5fa;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(96, 165, 250, 0.35);
}

.stat-hl-cc {
  color: #a78bfa;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(167, 139, 250, 0.35);
}

.stat-hl-dodge {
  color: #2dd4bf;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(45, 212, 191, 0.35);
}

.stat-hl-range {
  color: #86efac;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(134, 239, 172, 0.35);
}

.stat-hl-invuln {
  color: #fbbf24;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.35);
}

.stat-hl-chain {
  color: #fde047;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(253, 224, 71, 0.35);
}

.stat-hl-gold {
  color: #fbbf24;
  font-weight: 750;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.35);
}

/* Light Card Overrides for high contrast on light backgrounds */
.synergy-badge .stat-hl-armor,
.relic-item-card .stat-hl-armor {
  color: #475569;
  text-shadow: none;
}
.synergy-badge .stat-hl-shield,
.relic-item-card .stat-hl-shield {
  color: #0284c7;
  text-shadow: none;
}
.synergy-badge .stat-hl-heal,
.relic-item-card .stat-hl-heal {
  color: #16a34a;
  text-shadow: none;
}
.synergy-badge .stat-hl-damage,
.relic-item-card .stat-hl-damage {
  color: #ea580c;
  text-shadow: none;
}
.synergy-badge .stat-hl-burn,
.relic-item-card .stat-hl-burn {
  color: #dc2626;
  text-shadow: none;
}
.synergy-badge .stat-hl-truedamage,
.relic-item-card .stat-hl-truedamage {
  color: #9333ea;
  text-shadow: none;
}
.synergy-badge .stat-hl-speed,
.relic-item-card .stat-hl-speed {
  color: #d97706;
  text-shadow: none;
}
.synergy-badge .stat-hl-crit,
.relic-item-card .stat-hl-crit {
  color: #7c3aed;
  text-shadow: none;
}
.synergy-badge .stat-hl-lifesteal,
.relic-item-card .stat-hl-lifesteal {
  color: #e11d48;
  text-shadow: none;
}
.synergy-badge .stat-hl-mana,
.relic-item-card .stat-hl-mana {
  color: #2563eb;
  text-shadow: none;
}
.synergy-badge .stat-hl-cc,
.relic-item-card .stat-hl-cc {
  color: #6d28d9;
  text-shadow: none;
}
.synergy-badge .stat-hl-dodge,
.relic-item-card .stat-hl-dodge {
  color: #0d9488;
  text-shadow: none;
}
.synergy-badge .stat-hl-gold,
.relic-item-card .stat-hl-gold {
  color: #b45309;
  text-shadow: none;
}

/* Event Options List */
.event-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-option-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  background: rgba(16, 48, 58, 0.82) !important;
  border: 1.5px solid #235e70 !important;
  border-radius: 14px !important;
  padding: 14px 18px !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.event-option-btn:hover:not(:disabled) {
  background: rgba(22, 66, 80, 0.95) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 6px 22px rgba(6, 182, 212, 0.35), inset 0 0 15px rgba(56, 189, 248, 0.15) !important;
  transform: translateY(-2px);
}

.event-option-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.event-option-btn:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.5) !important;
}

.event-option-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.event-option-branch-icon {
  color: #f59e0b;
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.6));
  flex-shrink: 0;
}

.event-option-title {
  color: #fbbf24;
  font-family: var(--font-title);
  font-size: 17.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.event-option-not-allowed {
  color: #f87171;
  font-size: 13px;
  font-weight: 800;
  margin-left: auto;
}

.event-option-desc {
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  margin-top: 5px;
  padding-left: 30px;
  width: 100%;
}

/* Outcome Value Tags */
.ev-tag-red {
  color: #f87171;
  font-weight: 750;
}

.ev-tag-green {
  color: #4ade80;
  font-weight: 750;
}

.ev-tag-gold {
  color: #fbbf24;
  font-weight: 750;
}

.ev-tag-cyan {
  color: #38bdf8;
  font-weight: 750;
}

.ev-tag-item {
  color: #fef08a;
  font-weight: 750;
}

/* Event Outcome Modal */
.event-outcome-modal {
  width: min(660px, calc(96vw - 20px)) !important;
  max-width: min(660px, calc(96vw - 20px)) !important;
  background: radial-gradient(circle at 50% 0%, #15343f 0%, #0d232c 60%, #07151b 100%) !important;
  border: 3px solid #1f5968 !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 35px rgba(22, 85, 102, 0.35) !important;
  color: #e2f1f8;
}

.event-outcome-modal h2 {
  color: #f1f8fc !important;
  font-family: var(--font-title);
}

.event-outcome-modal .event-outcome-content {
  background: rgba(7, 21, 27, 0.75) !important;
  border: 1.5px solid #194653 !important;
  color: #cbd5e1 !important;
}

/* ==========================================
   💎 ANCIENT TREASURE VAULT & ROULETTE REEL
   ========================================== */
.treasure-modal-card {
  width: min(860px, calc(96vw - 20px)) !important;
  max-width: min(860px, calc(96vw - 20px)) !important;
  max-height: 94vh !important;
  overflow-y: auto !important;
  background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 70%, #090d16 100%) !important;
  border: 4px solid #f59e0b !important;
  border-radius: 24px !important;
  box-shadow: 0 12px 0 #92400e, 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(245, 158, 11, 0.25) !important;
  padding: 22px 28px !important;
  position: relative;
}

.treasure-modal-header h2 {
  font-family: var(--font-title);
  font-size: 28px;
  color: #fbbf24;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 15px rgba(251, 191, 36, 0.4);
}

.treasure-subtitle {
  color: #94a3b8;
  font-size: 14px;
  margin-bottom: 16px;
}

.treasure-chest-banner {
  width: 100%;
  height: clamp(240px, 34vh, 340px);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  margin-bottom: 18px;
  border: 3px solid #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 24px rgba(245, 158, 11, 0.25);
  background: #080d16;
}

.treasure-chest-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  filter: brightness(1.1) contrast(1.05);
  display: block;
}

.treasure-chest-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, transparent 50%, rgba(9, 13, 22, 0.5) 100%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
}

.treasure-roulette-viewport {
  width: 100%;
  height: 175px;
  overflow: hidden;
  position: relative;
  border-radius: 16px;
  border: 3px solid #f59e0b;
  background: radial-gradient(circle at 50% 50%, #172033 0%, #0b1120 100%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 0 25px rgba(245, 158, 11, 0.35);
  margin-bottom: 20px;
}

.treasure-needle-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 18px solid #fbbf24;
  z-index: 30;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

.treasure-needle-bottom {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 18px solid #fbbf24;
  z-index: 30;
  filter: drop-shadow(0 -2px 6px rgba(0, 0, 0, 0.8));
}

.treasure-needle-top.tick {
  transform: translateX(-50%) translateY(-2px) scaleY(1.15);
  transition: transform 0.035s ease-out;
}

.treasure-needle-bottom.tick {
  transform: translateX(-50%) translateY(2px) scaleY(1.15);
  transition: transform 0.035s ease-out;
}

.treasure-center-laser {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.95), rgba(245, 158, 11, 0.4), rgba(251, 191, 36, 0.95));
  box-shadow: 0 0 8px #fbbf24, 0 0 16px rgba(245, 158, 11, 0.7);
  pointer-events: none;
  z-index: 25;
}

.treasure-vignette-left {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 80px;
  background: linear-gradient(to right, rgba(11, 17, 32, 0.95) 0%, transparent 100%);
  pointer-events: none;
  z-index: 20;
}

.treasure-vignette-right {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 80px;
  background: linear-gradient(to left, rgba(11, 17, 32, 0.95) 0%, transparent 100%);
  pointer-events: none;
  z-index: 20;
}

.treasure-reel-track {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  will-change: transform;
}

.treasure-reel-card {
  width: 136px;
  height: 152px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #0f172a;
  border: 2px solid var(--rarity-col, #38bdf8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.treasure-reel-card.rarity-legendary {
  background: linear-gradient(150deg, #2a1f0a, #110c03);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.35);
}

.treasure-reel-card.rarity-epic {
  background: linear-gradient(150deg, #251233, #0d0614);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.35);
}

.treasure-reel-card.rarity-rare {
  background: linear-gradient(150deg, #0d2238, #050f1a);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

.treasure-reel-card.rarity-common {
  background: linear-gradient(150deg, #0a2517, #04120a);
}

.treasure-reel-card.is-winner-highlight {
  animation: winnerCardPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, winnerCardGlow 1.8s ease-in-out infinite alternate;
  z-index: 10;
}

@keyframes winnerCardPop {
  0% { transform: scale(1); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1.06); }
}

@keyframes winnerCardGlow {
  0% { box-shadow: 0 0 20px #fbbf24, inset 0 0 12px rgba(251, 191, 36, 0.4); }
  100% { box-shadow: 0 0 40px #fbbf24, 0 0 60px rgba(245, 158, 11, 0.8), inset 0 0 20px rgba(251, 191, 36, 0.8); }
}

.reel-card-rarity-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--rarity-col, #fff);
  border: 1px solid var(--rarity-col, #fff);
}

.reel-card-img-wrap {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.reel-card-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.reel-card-name {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
}

.treasure-actions-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70px;
}

.btn-spin-treasure {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  padding: 14px 42px;
  border: 3px solid #fde68a;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 0 #92400e, 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.4);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.btn-spin-treasure:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.12);
  box-shadow: 0 8px 0 #92400e, 0 14px 28px rgba(0, 0, 0, 0.6), 0 0 30px rgba(245, 158, 11, 0.6);
}

.btn-spin-treasure:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #92400e;
}

.btn-spin-treasure:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.2);
}

.spin-icon.rotating {
  display: inline-block;
  animation: spinIconAnim 0.7s linear infinite;
}

@keyframes spinIconAnim {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.treasure-win-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  animation: winPanelFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes winPanelFadeUp {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

.win-announcement {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 22px;
  color: #fbbf24;
  letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.win-card-preview {
  width: 100%;
  max-width: 580px;
}

.win-card-content {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.85);
  border: 3px solid #fbbf24;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  text-align: left;
}

.win-card-art {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

.win-card-info {
  flex: 1;
}

.win-card-name {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.win-card-rarity-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.win-card-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
}

.btn-claim-treasure {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 800;
  padding: 12px 36px;
  border: 3px solid #a7f3d0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 0 #047857, 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(16, 185, 129, 0.4);
  transition: transform 0.15s ease, filter 0.15s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.btn-claim-treasure:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 8px 0 #047857, 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 30px rgba(16, 185, 129, 0.6);
}

.btn-claim-treasure:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #047857;
}

/* ==========================================
   👑 ELITE VICTORY ROULETTE & MULTI-SPIN REEL
   ========================================== */
.elite-roulette-modal-card {
  width: min(880px, calc(96vw - 20px)) !important;
  max-width: min(880px, calc(96vw - 20px)) !important;
  max-height: 94vh !important;
  overflow-y: auto !important;
  background: radial-gradient(circle at 50% 0%, #2e1065 0%, #170b29 55%, #080312 100%) !important;
  border: 4px solid #c084fc !important;
  border-radius: 24px !important;
  box-shadow: 0 12px 0 #581c87, 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 45px rgba(192, 132, 252, 0.35) !important;
  padding: 20px 26px !important;
  position: relative;
}

.elite-roulette-modal-card::-webkit-scrollbar,
.treasure-modal-card::-webkit-scrollbar {
  width: 6px;
}
.elite-roulette-modal-card::-webkit-scrollbar-thumb {
  background: #a855f7;
  border-radius: 4px;
}
.treasure-modal-card::-webkit-scrollbar-thumb {
  background: #f59e0b;
  border-radius: 4px;
}

.elite-spins-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(88, 28, 135, 0.85);
  border: 2px solid #e9d5ff;
  border-radius: 999px;
  padding: 6px 18px;
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 800;
  color: #faf5ff;
  box-shadow: 0 0 15px rgba(192, 132, 252, 0.4), inset 0 0 10px rgba(192, 132, 252, 0.3);
  margin-bottom: 12px;
}

.elite-spins-num {
  color: #facc15;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.elite-trophy-banner {
  width: 100%;
  height: clamp(240px, 34vh, 340px);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  margin-bottom: 18px;
  border: 3px solid #c084fc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 25px rgba(168, 85, 247, 0.35);
  background: #120722;
}

.elite-trophy-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  display: block;
  filter: brightness(1.1) contrast(1.05);
}

.elite-trophy-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(88, 28, 135, 0.08) 0%, transparent 50%, rgba(9, 3, 22, 0.5) 100%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
}

.elite-won-pills-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 16px;
}

.elite-won-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid var(--pill-col, #c084fc);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 10px var(--pill-col-glow, rgba(192, 132, 252, 0.3));
}

.elite-won-pill-art {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.elite-won-pill-fallback {
  font-size: 20px;
}

.elite-won-pill-name {
  color: #fff;
}

.merchant-modal-card {
  max-width: min(1320px, calc(96vw - 20px)) !important;
  width: min(1320px, calc(96vw - 20px)) !important;
  max-height: min(95vh, 980px);
  overflow-y: auto;
  padding: 16px;
}

.merchant-art-frame {
  width: 100%;
  height: clamp(260px, 45vh, 480px);
  overflow: hidden;
  border: 4px solid #ca8a04;
  border-radius: 18px;
  background: #1a202c;
  box-shadow: 0 8px 0 #744210, 0 12px 28px rgba(0, 0, 0, 0.3);
}

.merchant-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.merchant-art-wandering_gear_peddler {
  object-fit: contain;
  object-position: center top;
  background: radial-gradient(circle at 50% 30%, #6b5b1e, #171509 72%);
}

.merchant-board-scroll,
.act1-merchant-board-scroll {
  width: 100%;
  overflow: hidden;
  border: 4px solid #8b5a1f;
  border-radius: 18px;
  background: #0d3652;
  box-shadow: 0 8px 0 #4a2f10, 0 14px 32px rgba(0, 0, 0, 0.4);
}

.merchant-board,
.act1-merchant-board {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.merchant-board-act-1 { background-image: url('../assets/merchants/act1_merchant_shop.png'); }
.merchant-board-act-2 { background-image: url('../assets/merchants/act2_merchant_shop.png'); }
.merchant-board-act-3 { background-image: url('../assets/merchants/act3_merchant_shop.png'); }

.merchant-board-slot {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 14.8%;
  height: 22.2%;
  padding: 4px 6px;
  cursor: pointer;
  color: #fff7d6;
  text-align: center;
  text-shadow: 0 1px 2px #000, 0 0 5px #000;
  box-sizing: border-box;
  transition: filter 0.15s ease;
}

/* Extended invisible hitbox expansion so hovering anywhere near/on the wooden frame triggers the hover box */
.merchant-board-slot::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 16px;
  pointer-events: auto;
  z-index: -1;
}

.merchant-board-slot:hover {
  filter: drop-shadow(0 0 8px rgba(254, 240, 138, 0.5));
  transform: none; /* No jumping or lifting off the board */
}

/* Act 1 — Monkey Pirate Shop (2 top, 3 bottom) */
.merchant-board-act-1 .merchant-slot-1 { left: 6.8%; top: 43.8%; }
.merchant-board-act-1 .merchant-slot-2 { left: 22.4%; top: 43.8%; }
.merchant-board-act-1 .merchant-slot-3 { left: 2.3%; top: 66.8%; }
.merchant-board-act-1 .merchant-slot-4 { left: 18.3%; top: 66.8%; }
.merchant-board-act-1 .merchant-slot-5 { left: 34.3%; top: 66.8%; }

/* Act 2 — Plague Doctor Blacksmith (3 top, 2 bottom) */
.merchant-board-act-2 .merchant-slot-1 { left: 9.5%; top: 38.6%; }
.merchant-board-act-2 .merchant-slot-2 { left: 25.8%; top: 38.6%; }
.merchant-board-act-2 .merchant-slot-3 { left: 42.1%; top: 38.6%; }
.merchant-board-act-2 .merchant-slot-4 { left: 17.7%; top: 65.6%; }
.merchant-board-act-2 .merchant-slot-5 { left: 33.9%; top: 65.6%; }

/* Act 3 — Volcanic Gorilla Merchant (3 top, 2 bottom) */
.merchant-board-act-3 .merchant-slot-1 { left: 5.1%; top: 33.4%; }
.merchant-board-act-3 .merchant-slot-2 { left: 21.3%; top: 33.4%; }
.merchant-board-act-3 .merchant-slot-3 { left: 37.5%; top: 33.4%; }
.merchant-board-act-3 .merchant-slot-4 { left: 13.3%; top: 60.6%; }
.merchant-board-act-3 .merchant-slot-5 { left: 29.5%; top: 60.6%; }

.merchant-board-art-container {
  width: 100%;
  height: clamp(54px, 6.8vw, 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto 4px;
}

.merchant-board-item-art {
  width: clamp(50px, 6.4vw, 72px);
  height: clamp(50px, 6.4vw, 72px);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.9));
  animation: none; /* Anchored and stationary */
  display: block;
  margin: 0 auto;
}

/* Relic items framed cleanly and centered */
.merchant-board-item-art.merchant-relic-art,
.merchant-board-slot.is-kind-relic .merchant-board-item-art {
  width: clamp(48px, 6.0vw, 68px);
  height: clamp(48px, 6.0vw, 68px);
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.9));
}

.merchant-board-item-name,
.act1-merchant-item-name {
  width: 100%;
  overflow: hidden;
  font-size: clamp(11.5px, 1.2vw, 14.5px);
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

.merchant-board-item-rarity,
.act1-merchant-item-rarity {
  font-size: clamp(9px, 0.95vw, 11.5px);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  margin-top: 1px;
  margin-bottom: 3px;
}

.merchant-board-buy,
.act1-merchant-buy {
  min-width: 72px;
  margin-top: 1px;
  padding: 4px 10px;
  border: 1.5px solid #f6e05e;
  border-radius: 999px;
  background: linear-gradient(#fef08a, #d69e2e);
  box-shadow: 0 2px 0 #744210;
  color: #3d2607;
  font-size: clamp(11px, 1.1vw, 13.5px);
  font-weight: 950;
  line-height: 1.15;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.12s ease;
}

.merchant-board-buy:hover:not(:disabled),
.act1-merchant-buy:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .merchant-board-item-art {
    animation: none;
  }
}

.merchant-stock-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 10px;
  font-size: 14px;
}

.merchant-stock-summary span {
  padding: 6px 12px;
  border: 1.5px solid #d69e2e;
  border-radius: 999px;
  background: #fffbeb;
  color: #744210;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.25px;
}

@media (max-height: 720px), (max-width: 560px) {
  .event-art-frame {
    max-height: 290px;
  }

  .event-art-frame-outcome {
    max-height: 210px;
  }

  .merchant-art-frame {
    height: 145px;
  }
}

.reward-options, .event-options-list, .shop-node-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.btn-reward-choice {
  background: linear-gradient(135deg, rgba(16, 44, 54, 0.88), rgba(9, 26, 33, 0.94));
  border: 1.5px solid #205c6d;
  border-radius: 14px;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  color: #e2f1f8;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-reward-choice:hover:not(:disabled):not(.disabled-choice) {
  background: linear-gradient(135deg, rgba(22, 58, 71, 0.95), rgba(13, 36, 46, 0.98));
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35), inset 0 0 15px rgba(56, 189, 248, 0.15);
}

.btn-reward-choice:active:not(:disabled):not(.disabled-choice) {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.btn-reward-choice strong {
  font-family: var(--font-title);
  font-size: 17.5px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.3px;
}

.btn-reward-choice small {
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  line-height: 1.45;
}

.btn-reward-choice.disabled-choice,
.btn-reward-choice:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.7);
  border-color: #334155 !important;
  background: rgba(15, 23, 42, 0.6) !important;
  pointer-events: none;
}

/* Campfire Choice Cards */
.campfire-choice {
  padding: 15px 20px;
  gap: 6px;
}

.campfire-choice-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.campfire-choice-icon {
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
}

.campfire-choice-icon.rest-icon {
  color: #4ade80;
  filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.6));
}

.campfire-choice-icon.train-icon {
  color: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6));
}

.campfire-choice-icon.transmute-icon {
  color: #c084fc;
  filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.6));
}

.campfire-choice-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.campfire-rest .campfire-choice-title {
  color: #86efac;
}

.campfire-train .campfire-choice-title {
  color: #7dd3fc;
}

.campfire-transmute .campfire-choice-title {
  color: #d8b4fe;
}

.campfire-choice-badge {
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 10px;
  border-radius: 999px;
}

.campfire-choice-badge.badge-heal {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.campfire-choice-badge.badge-train {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.campfire-choice-badge.badge-alchemy {
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.4);
}

.campfire-choice-desc {
  font-size: 14.5px;
  font-weight: 500;
  color: #cbd5e1;
  line-height: 1.45;
  padding-left: 27px;
}

.campfire-rest:hover:not(:disabled):not(.disabled-choice) {
  border-color: #4ade80 !important;
  box-shadow: 0 6px 22px rgba(74, 222, 128, 0.3), inset 0 0 15px rgba(74, 222, 128, 0.15) !important;
}

.campfire-train:hover:not(:disabled):not(.disabled-choice) {
  border-color: #38bdf8 !important;
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.3), inset 0 0 15px rgba(56, 189, 248, 0.15) !important;
}

.campfire-transmute:hover:not(:disabled):not(.disabled-choice) {
  border-color: #c084fc !important;
  box-shadow: 0 6px 22px rgba(192, 132, 252, 0.3), inset 0 0 15px rgba(192, 132, 252, 0.15) !important;
}

.reward-relic-art {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 12px;
  border: none;
  background: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  display: block;
}

.reward-heal-art,
.reward-gold-art {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reward-heal-art {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(20, 83, 45, 0.4));
  border: 2px solid #22c55e;
}

.reward-gold-art {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(113, 63, 18, 0.4));
  border: 2px solid #ca8a04;
}

.btn-primary {
  background: #48bb78;
  color: #fff;
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 700;
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--panel-shadow);
}

.unit-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: auto;
  width: 320px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  scrollbar-width: none;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  border: 2.5px solid #ecc94b;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 15px rgba(236, 201, 75, 0.25);
  padding: 14px 16px;
  color: #fff;
  font-family: var(--font-body);
  transition: opacity 0.12s ease, transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
  animation: ttFadeIn 0.15s ease-out;
}

.unit-tooltip::-webkit-scrollbar {
  display: none;
}

/* Elemental modal background themes matching creature shop cards */
.unit-tooltip.elem-fire {
  background: 
    radial-gradient(circle at 85% 20%, rgba(249, 115, 22, 0.40) 0%, rgba(220, 38, 38, 0.18) 50%, transparent 75%),
    linear-gradient(165deg, #2a0b06 0%, #170503 60%, #0c0201 100%);
  border-color: rgba(248, 113, 113, 0.75);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(239, 68, 68, 0.35);
}

.unit-tooltip.elem-nature {
  background: 
    radial-gradient(circle at 85% 20%, rgba(34, 197, 94, 0.38) 0%, rgba(16, 185, 129, 0.18) 50%, transparent 75%),
    linear-gradient(165deg, #072615 0%, #03140a 60%, #010a05 100%);
  border-color: rgba(74, 222, 128, 0.75);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(34, 197, 94, 0.35);
}

.unit-tooltip.elem-water {
  background: 
    radial-gradient(circle at 85% 20%, rgba(14, 165, 233, 0.40) 0%, rgba(2, 132, 199, 0.18) 50%, transparent 75%),
    linear-gradient(165deg, #052033 0%, #03111c 60%, #01090f 100%);
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(14, 165, 233, 0.35);
}

.unit-tooltip.elem-lightning,
.unit-tooltip.elem-electric {
  background: 
    radial-gradient(circle at 85% 20%, rgba(250, 204, 21, 0.36) 0%, rgba(99, 102, 241, 0.25) 50%, transparent 75%),
    linear-gradient(165deg, #191333 0%, #0d091e 60%, #060410 100%);
  border-color: rgba(250, 204, 21, 0.75);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(234, 179, 8, 0.35);
}

.unit-tooltip.elem-earth {
  background: 
    radial-gradient(circle at 85% 20%, rgba(217, 119, 6, 0.38) 0%, rgba(180, 83, 9, 0.18) 50%, transparent 75%),
    linear-gradient(165deg, #27170c 0%, #150b05 60%, #0a0402 100%);
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(217, 119, 6, 0.35);
}

.unit-tooltip.elem-void {
  background: 
    radial-gradient(circle at 85% 20%, rgba(168, 85, 247, 0.40) 0%, rgba(192, 38, 211, 0.18) 50%, transparent 75%),
    linear-gradient(165deg, #22072f 0%, #11021b 60%, #07010b 100%);
  border-color: rgba(216, 180, 254, 0.75);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(168, 85, 247, 0.35);
}

.unit-tooltip.hidden {
  display: none !important;
}

.tt-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e0;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.tt-close:hover,
.tt-close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  outline: none;
}

.tt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 28px 6px 0;
}

.tt-name-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tt-name {
  font-family: var(--font-title);
  font-size: 19px;
  color: #fff;
  letter-spacing: 0.5px;
}

.tt-stars {
  color: #fbbf24;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.65);
  display: inline-flex;
  align-items: center;
}

.tt-cost {
  background: rgba(246, 224, 94, 0.2);
  color: #f6e05e;
  border: 1px solid #f6e05e;
  font-weight: 800;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 8px;
}

.tt-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.tt-art-frame {
  position: relative;
  height: 160px;
  margin-bottom: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 65%),
    linear-gradient(160deg, rgba(20, 28, 44, 0.90), rgba(7, 12, 22, 0.96));
}

/* Unclipped item artwork for item preview info modals */
.unit-tooltip.is-item-card .tt-art-frame {
  height: 140px;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 70%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.75), rgba(2, 6, 23, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.unit-tooltip.is-item-card .tt-art {
  width: 100%;
  height: 100%;
  max-height: 128px;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}

.tt-art-frame.hidden {
  display: none;
}

.tt-art {
  width: 100%;
  height: 126%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 7px rgba(0, 0, 0, 0.45));
}

.tt-art.is-splash-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
  border-radius: 10px;
}

.tt-art.is-splash-art.is-zippo {
  object-position: center bottom;
}

.tt-resource-bars {
  display: grid;
  gap: 5px;
  margin: -4px 3px 10px;
}

.unit-tooltip.is-item-card .tt-resource-bars,
.unit-tooltip.is-item-card .tt-stats-grid {
  display: none !important;
}

.unit-tooltip.is-equipped-tooltip {
  z-index: 100010;
  pointer-events: none;
  animation: ttFadeIn 0.12s ease-out;
}

.unit-tooltip.is-equipped-tooltip .tt-header {
  margin-right: 0;
}

.tt-resource-track {
  position: relative;
  height: 24px;
  overflow: hidden;
  border: 2px solid #0b131d;
  border-radius: 4px;
  background: #060b11;
  box-shadow: 0 0 0 1px #334155, 0 3px 8px rgba(0, 0, 0, 0.75), inset 0 1px 2px rgba(0, 0, 0, 0.9);
}

.tt-resource-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  transition: width 120ms linear;
}

.tt-health-fill {
  background: linear-gradient(180deg, #4ade80 0%, #22c55e 28%, #16a34a 62%, #14532d 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

.tt-mana-fill {
  background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 28%, #0284c7 62%, #075985 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

.tt-resource-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 10px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
}

.tt-resource-text span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.tt-resource-text strong {
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.tt-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-nature { background: #22543d; color: #9ae6b4; border: 1px solid #48bb78; }
.tag-fire { background: #742a2a; color: #feb2b2; border: 1px solid #f56565; }
.tag-water { background: #234e52; color: #b2f5ea; border: 1px solid #4fd1c5; }
.tag-earth { background: #5f370e; color: #fefcbf; border: 1px solid #ecc94b; }
.tag-lightning { background: #553c9a; color: #faf089; border: 1px solid #d69e2e; }
.tag-void { background: #322659; color: #e9d8fd; border: 1px solid #9f7aea; }
.tag-class { background: #2d3748; color: #edf2f7; border: 1px solid #718096; }
.tag-position { letter-spacing: 0.6px; }
.tag-pos-front { background: rgba(180, 83, 9, 0.40); color: #fef08a; border: 1px solid #f59e0b; }
.tag-pos-back { background: rgba(30, 58, 138, 0.45); color: #bfdbfe; border: 1px solid #60a5fa; }

.tt-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 8px 7px;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
}

.tt-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}

.stat-icon {
  font-size: 12px;
}

#tt-atk { color: #fb923c; font-weight: 800; }
#tt-def { color: #cbd5e1; font-weight: 800; }
#tt-spd { color: #facc15; font-weight: 800; }
#tt-crit { color: #c084fc; font-weight: 800; }
#tt-lifesteal { color: #fb7185; font-weight: 800; }

.tt-ability-box {
  background: rgba(45, 55, 72, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
}

.tt-ability-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.tt-ability-title {
  font-family: var(--font-title);
  font-size: 14px;
  color: #ecc94b;
}

.tt-ability-badge {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: #cbd5e0;
}

.tt-ability-desc {
  font-size: 12px;
  line-height: 1.4;
  color: #e2e8f0;
  margin: 0;
}

.tt-passive-box {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(246, 224, 94, 0.25);
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 6px;
}

.tt-passive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.tt-passive-title {
  font-family: var(--font-title);
  font-size: 13px;
  color: #68d391;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tt-passive-badge {
  font-size: 9.5px;
  font-weight: 800;
  background: rgba(104, 211, 145, 0.15);
  color: #68d391;
  border: 1px solid rgba(104, 211, 145, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tt-passive-desc {
  font-size: 11px;
  line-height: 1.35;
  color: #cbd5e0;
}

.tt-passive-earned-row {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(254, 240, 138, 0.25);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11px;
}

.tt-earned-icon {
  font-size: 12px;
}

.tt-earned-label {
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.3px;
}

.tt-earned-val {
  color: #4ade80;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.tt-earned-cap {
  color: #94a3b8;
  font-size: 10px;
  font-weight: normal;
  margin-left: 2px;
}

.tt-passive-box.hidden,
.tt-passive-earned-row.hidden,
.unit-tooltip.is-item-card #tt-passive-box,
.unit-tooltip.is-item-card .tt-passive-box {
  display: none !important;
}

.tt-items-section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tt-items-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tt-item-slot {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none !important;
  border-radius: 12px;
  background: transparent;
  box-shadow: none !important;
  position: relative;
  overflow: visible;
  cursor: pointer;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.tt-item-slot .item-art-icon-lg,
.tt-item-slot .item-art-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.tt-item-slot:hover {
  transform: translateY(-2px) scale(1.08);
}

.tt-item-slot-empty {
  border: 1.5px dashed rgba(255, 255, 255, 0.35) !important;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border-radius: 10px;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tt-item-slot-empty:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Item Picker Drawer inside Monster Details Modal */
.tt-item-picker-tray {
  background: rgba(10, 18, 30, 0.98);
  border: 1.5px solid #38bdf8;
  border-radius: 12px;
  padding: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 24px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  animation: pickerSlideDown 0.2s ease-out;
}

.tt-item-picker-tray.hidden {
  display: none;
}

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

.tt-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 6px;
}

.tt-picker-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tt-picker-title {
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

.tt-picker-beast-target {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

.tt-picker-beast-target strong {
  color: #fef08a;
}

.tt-picker-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.tt-picker-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.tt-picker-items-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tt-picker-item-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: #f1f5f9;
  text-align: left;
  transition: all 0.15s ease;
}

.tt-picker-item-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: #38bdf8;
  transform: translateX(2px);
}

.tt-picker-item-frame {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.tt-picker-item-frame img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.tt-picker-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.tt-picker-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.tt-picker-item-name {
  font-family: var(--font-title);
  font-size: 11.5px;
  font-weight: 800;
  color: #fef08a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tt-picker-item-rarity-badge {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.tt-picker-item-desc {
  font-size: 9.5px;
  color: #cbd5e1;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tt-picker-equip-cta {
  font-size: 10px;
  font-weight: 800;
  color: #38bdf8;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}

.tt-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.tt-actions.hidden {
  display: none;
}

.tt-sell-btn {
  border: 1px solid #fc8181;
  border-radius: 8px;
  background: linear-gradient(180deg, #c53030, #9b2c2c);
  color: #fff5f5;
  padding: 7px 14px;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #742a2a;
}

.tt-sell-btn:hover,
.tt-sell-btn:focus-visible {
  filter: brightness(1.12);
  transform: translateY(-1px);
  outline: none;
}

.tt-sell-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #742a2a;
}

@keyframes ttFadeIn {
  0% { opacity: 0; transform: scale(0.95) translateY(4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========================================================
   🐾 BEAST & RELIC LORE COMPENDIUM MODAL (Parchment Paper Theme)
   ======================================================== */
.lore-modal-card {
  background: linear-gradient(180deg, #fffdf5 0%, #fffaf0 55%, #f7f1e6 100%);
  border: 5px solid #5b402f;
  border-radius: 22px;
  box-shadow: 0 11px 0 #2f211b, 0 30px 60px rgba(0, 0, 0, 0.58);
  padding: 20px 26px;
  width: 1060px;
  max-width: 96vw;
  height: 750px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.lore-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(180, 83, 9, 0.2);
  padding-bottom: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}

.lore-title {
  font-family: var(--font-title);
  font-size: 26px;
  color: #4b3024;
  text-shadow: none;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lore-main-nav {
  display: flex;
  gap: 8px;
}

/* Parchment Navigation Tabs */
.lore-nav-tab {
  background: #ffffff;
  border: 2px solid #e2d9cc;
  border-radius: 12px;
  padding: 8px 18px;
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 800;
  color: #78350f;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(91, 64, 47, 0.12);
  transition: all 0.15s ease;
  user-select: none;
}

.lore-nav-tab:hover {
  background: #fffdf5;
  border-color: #d97706;
  transform: translateY(-1px);
  color: #92400e;
}

.lore-nav-tab.active {
  background: linear-gradient(180deg, #ffe277 0%, #f59e0b 45%, #d97706 75%, #b45309 100%);
  border: 2px solid #fff3a1;
  color: #451a03;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  box-shadow:
    0 0 0 3px #5b402f,
    0 4px 0 #2f211b,
    0 6px 12px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    inset 0 -2.5px 0 #92400e;
  transform: translateY(-2px);
}

.lore-counter-badge {
  font-size: 14px;
  font-weight: 800;
  background: linear-gradient(180deg, #ffe277 0%, #f59e0b 50%, #b45309 100%);
  color: #451a03;
  border: 1.5px solid #fff3a1;
  box-shadow: 0 2px 0 rgba(91, 64, 47, 0.3);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

#btn-close-lore {
  background: linear-gradient(180deg, #ffe277 0%, #f59e0b 45%, #d97706 75%, #b45309 100%);
  border: 2px solid #fff3a1;
  border-radius: 12px;
  color: #451a03;
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  box-shadow:
    0 0 0 3px #5b402f,
    0 4px 0 #2f211b,
    0 6px 12px rgba(0, 0, 0, 0.35),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 0 #92400e;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

#btn-close-lore:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

#btn-close-lore:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 3px #5b402f, 0 1px 0 #2f211b;
}

.lore-controls-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.lore-search-wrap {
  display: flex;
  gap: 10px;
}

.lore-search-input {
  flex: 1;
  background: #ffffff;
  border: 2px solid #dcd3c5;
  color: #432818;
  border-radius: 12px;
  padding: 9px 16px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.lore-search-input::placeholder {
  color: #a87954;
}

.lore-search-input:focus {
  border-color: #f59e0b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06), 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.lore-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* Paper Filter Tabs */
.lore-filter-tab {
  background: #ffffff;
  border: 1.5px solid #e2d9cc;
  border-radius: 10px;
  padding: 6px 14px;
  font-family: var(--font-btn);
  font-size: 14px;
  font-weight: 700;
  color: #78350f;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(91, 64, 47, 0.1);
  transition: all 0.12s ease;
}

.lore-filter-tab:hover {
  background: #fffdf5;
  color: #92400e;
  border-color: #d97706;
  transform: translateY(-1px);
}

.lore-filter-tab.active {
  background: linear-gradient(180deg, #ffe277 0%, #f59e0b 50%, #b45309 100%);
  color: #451a03;
  border-color: #fff3a1;
  box-shadow: 0 2px 0 rgba(91, 64, 47, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.lore-element-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lore-element-chip {
  background: #ffffff;
  border: 1.5px solid #e2d9cc;
  border-radius: 9px;
  padding: 5px 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #78350f;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(91, 64, 47, 0.1);
  transition: all 0.12s ease;
}

.lore-element-chip:hover {
  background: #fffdf5;
  color: #92400e;
  border-color: #d97706;
}

.lore-element-chip.active {
  background: linear-gradient(180deg, #ffe277 0%, #f59e0b 50%, #b45309 100%);
  color: #451a03;
  border-color: #fff3a1;
  box-shadow: 0 2px 0 rgba(91, 64, 47, 0.25);
  font-weight: 900;
}

.lore-class-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lore-class-chip {
  background: #ffffff;
  border: 1.5px solid #e2d9cc;
  border-radius: 9px;
  padding: 5px 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #78350f;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(91, 64, 47, 0.1);
  transition: all 0.12s ease;
}

.lore-class-chip:hover {
  background: #fffdf5;
  color: #92400e;
  border-color: #d97706;
}

.lore-class-chip.active {
  background: linear-gradient(180deg, #ffe277 0%, #f59e0b 50%, #b45309 100%);
  color: #451a03;
  border-color: #fff3a1;
  box-shadow: 0 2px 0 rgba(91, 64, 47, 0.25);
  font-weight: 900;
}
/* GLOBAL TRAIT PREVIEW TOOLTIP */
#trait-preview-tooltip {
  position: fixed;
  z-index: 999999;
  width: 290px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  color: #fff;
  font-family: inherit;
}

#trait-preview-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.trait-tip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 7px;
  margin-bottom: 7px;
}

.trait-tip-title {
  font-size: 14px;
  font-weight: 800;
  color: #fef08a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trait-tip-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.5px;
}

.trait-tip-desc {
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.4;
  margin-bottom: 8px;
}

.trait-tip-tiers {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.trait-tip-tier-line {
  line-height: 1.35;
  color: #64748b;
  opacity: 0.55;
  filter: grayscale(100%);
  transition: all 0.15s ease;
}

.trait-tip-tier-line strong {
  color: #64748b;
  font-weight: 700;
  margin-right: 3px;
}

.trait-tip-tier-line:not(.active) [class*="stat-hl-"],
.trait-tip-tier-line:not(.active) span,
.trait-tip-tier-line.inactive [class*="stat-hl-"],
.trait-tip-tier-line.inactive span {
  color: #94a3b8 !important;
  text-shadow: none !important;
}

.trait-tip-tier-line.active {
  color: #86efac;
  opacity: 1;
  filter: none;
  font-weight: 700;
}

.trait-tip-tier-line.active strong {
  color: #4ade80;
  font-weight: 800;
}

.interactive-trait {
  cursor: pointer !important;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.interactive-trait:hover {
  transform: scale(1.08);
  filter: brightness(1.25);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

.lore-body-grid {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.lore-list-pane {
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-right: 8px;
  align-content: flex-start;
}

.lore-list-pane::-webkit-scrollbar {
  width: 6px;
}
.lore-list-pane::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}
.lore-list-pane::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}
.lore-list-pane::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.lore-beast-card {
  background: #fff;
  border: 2px solid #cbd5e0;
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
  position: relative;
  text-align: left;
  min-width: 0;
  box-sizing: border-box;
}

.lore-beast-card:hover {
  transform: translateY(-2px);
  border-color: #3182ce;
  box-shadow: 0 6px 14px rgba(49, 130, 206, 0.22);
}

.lore-beast-card.active {
  border-color: #d69e2e;
  background: #fffdf0;
  box-shadow: 0 0 0 2.5px #d69e2e, 0 6px 16px rgba(214, 158, 46, 0.3);
}

/* BIGGER AVATAR CONTAINERS */
.lore-card-sprite-wrap {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #edf2f7;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.14);
}

.lore-card-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  margin: auto;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35));
  transform: scale(1.35);
  transform-origin: center center;
}

.lore-card-sprite.lore-beast-sprite {
  transform: translateY(-5%) scale(1.0);
}

.lore-card-sprite.lore-item-sprite {
  transform: scale(1.0);
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35));
}

.lore-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  flex: 1;
}

.lore-card-name {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 800;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lore-card-tags {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.lore-card-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
}

.lore-dossier-panel {
  background: rgba(26, 32, 44, 0.96);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 20px 22px;
  color: #fff;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.lore-dossier-panel::-webkit-scrollbar {
  width: 6px;
}
.lore-dossier-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.lore-dossier-panel::-webkit-scrollbar-thumb {
  background: #4a5568;
  border-radius: 4px;
}
.lore-dossier-panel::-webkit-scrollbar-thumb:hover {
  background: #718096;
}

.lore-dossier-header {
  display: flex;
  gap: 18px;
  align-items: center;
}

/* MASSIVE GLOWING HERO ARTWORK FRAME (5:4 Aspect Ratio) */
.lore-dossier-art-frame {
  width: 250px;
  height: 200px;
  aspect-ratio: 5 / 4;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.lore-dossier-art-frame:hover {
  transform: scale(1.025);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.85), 0 0 24px rgba(255, 255, 255, 0.25);
}

/* BEAST ARTWORK LIGHTBOX POPUP */
.beast-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(5, 10, 20, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  cursor: zoom-out;
  padding: 20px;
}

.beast-lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.beast-lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
  animation: lightboxPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}

@keyframes lightboxPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.beast-lightbox-img {
  max-width: 80vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 24px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.95), 0 0 40px rgba(255, 255, 255, 0.18);
  cursor: zoom-out;
}

.beast-lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e53e3e;
  color: #fff;
  border: 2.5px solid #fff;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
  transition: transform 0.15s ease, background-color 0.15s ease;
  z-index: 10;
}

.beast-lightbox-close:hover {
  transform: scale(1.15);
  background: #c53030;
}

.beast-lightbox-caption {
  font-family: var(--font-title, sans-serif);
  font-size: 22px;
  font-weight: 800;
  color: #fef08a;
  margin-top: 14px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.5px;
}

.lore-dossier-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  margin: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.75));
  transform: scale(1.35);
  transform-origin: center center;
}

.lore-dossier-art.lore-beast-dossier-art {
  transform: translateY(-5%) scale(1.0);
}

.lore-dossier-art.lore-beast-dossier-art.is-splash-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: none;
  border-radius: 18px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.65));
}

.lore-dossier-art.lore-item-dossier-art {
  transform: scale(1.0);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
}

.lore-map-sprite-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 10px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.lore-map-sprite-wrap .node-svg-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
}

.lore-map-dossier-svg {
  width: 105px;
  height: 105px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.75));
}

.lore-dossier-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.lore-dossier-name {
  font-family: var(--font-title);
  font-size: 22px;
  color: #f6e05e;
  letter-spacing: 0.5px;
}

.lore-dossier-title {
  font-size: 13px;
  color: #cbd5e0;
  font-weight: 700;
  font-style: italic;
}

.lore-dossier-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.lore-dossier-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
}

.lore-dossier-stat-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lore-dossier-ability-box {
  background: rgba(45, 55, 72, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lore-ability-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lore-ability-name {
  font-family: var(--font-title);
  font-size: 15px;
  color: #f6e05e;
}

.lore-ability-cost-badge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(66, 153, 225, 0.25);
  color: #90cdf4;
  border: 1px solid rgba(66, 153, 225, 0.5);
  padding: 2px 8px;
  border-radius: 6px;
}

.lore-ability-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: #edf2f7;
}

.lore-dossier-passive-box {
  background: rgba(49, 46, 129, 0.45);
  border: 1px solid rgba(129, 140, 248, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.lore-passive-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lore-passive-name {
  font-family: var(--font-title);
  font-size: 15px;
  color: #c7d2fe;
}

.lore-passive-badge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.6);
  padding: 2px 8px;
  border-radius: 6px;
}

.lore-passive-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: #e0e7ff;
}

.lore-quote-box {
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid #d69e2e;
  border-radius: 0 8px 8px 0;
  padding: 9px 14px;
  font-size: 12px;
  line-height: 1.45;
  color: #e2e8f0;
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN SYSTEM OVERHAUL
   ========================================================================== */

@media (max-width: 900px) {
  .champion-screen-overlay {
    padding: 12px;
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  .champion-choice-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .champion-choice {
    padding: 16px;
    border-radius: 18px;
  }
  .champion-portrait {
    height: 130px;
  }
}

@media (max-width: 768px) {
  /* Header & HUD */
  #main-header {
    padding: 6px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .header-left-brand {
    gap: 6px;
    min-height: auto;
  }
  .header-relics-label {
    font-size: 12px;
    letter-spacing: 0.5px;
  }
  .header-inv-icon,
  .header-relics-icon {
    width: 22px;
    height: 22px;
  }
  .header-relic-art {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  .header-status-bar {
    gap: 8px;
  }
  .status-pill {
    min-height: 44px;
    padding: 4px 12px;
    font-size: 13px;
    gap: 6px;
    border-radius: 11px;
  }
  .status-pill.hp-pill {
    min-width: 155px;
  }
  .status-pill.gold-pill {
    min-width: 80px;
    padding: 4px 14px;
  }
  .status-pill.lvl-pill {
    min-width: 140px;
  }
  .status-label {
    font-size: 9.5px;
    letter-spacing: 1px;
  }
  .hp-bar-container {
    width: 75px;
    height: 10px;
  }
  .lvl-bar-container {
    width: 60px;
    height: 10px;
  }
  .header-actions {
    display: flex;
    gap: 6px;
  }
  .btn-header {
    padding: 5px 10px;
    font-size: 12px;
  }

  /* Start Screen */
  .start-screen-overlay {
    padding: 16px;
    background-position: center center;
  }
  .start-menu-card {
    padding: 24px 18px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .start-title {
    font-size: clamp(26px, 8vw, 36px);
  }
  .start-subtitle {
    font-size: 13px;
    margin-bottom: 18px;
  }
  .btn-start-menu {
    font-size: 16px;
    padding: 12px 18px;
    min-height: 48px;
  }

  /* Intro / Story */
  .intro-card {
    padding: 20px 16px;
    max-height: 88vh;
    overflow-y: auto;
    width: 95%;
    -webkit-overflow-scrolling: touch;
  }

  /* Modals */
  .modal-overlay {
    padding: 10px;
  }
  .modal-body {
    max-width: 96vw;
    max-height: 92vh;
  }
  .lore-modal-card {
    padding: 18px 14px;
    max-height: 90vh;
  }
  .pause-modal-card {
    padding: 0 14px 16px;
    max-height: 92vh;
  }
  .pause-header {
    margin: 0 -14px 14px;
    padding: 15px 14px 13px;
  }
  .pause-content-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    padding-right: 3px;
  }
  .pause-synergies-column {
    flex: none;
    min-height: auto;
    overflow: visible;
    padding-right: 0;
  }
  .pause-settings-column {
    flex: none;
  }
  .pause-action-btn.btn-abandon {
    margin-top: 4px;
  }

  /* Unit Tooltip */
  .unit-tooltip {
    width: min(340px, 94vw);
    max-height: 85vh;
    overflow-y: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  #main-header {
    padding: 4px 8px;
  }
  .header-relics-label {
    display: none;
  }
  .header-actions {
    display: flex;
    gap: 4px;
  }
  .btn-header {
    padding: 4px 8px;
    font-size: 11px;
  }
  .status-pill {
    padding: 3px 6px;
    font-size: 11px;
  }
  .status-label {
    display: none;
  }
  .status-pill.hp-pill {
    min-width: 116px;
  }
  .status-pill.gold-pill {
    min-width: 70px;
  }
  .status-pill.lvl-pill {
    min-width: 100px;
  }
  .status-emblem,
  .status-level-emblem,
  .status-pill.gold-pill .gold-icon {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }
  .hp-bar-container {
    width: 38px;
  }
  .lvl-bar-container {
    width: 30px;
  }
  .status-pill.hp-pill #hp-count {
    font-size: 10px;
  }
}

/* Mobile Landscape Optimization */
@media (max-height: 500px) and (orientation: landscape) {
  #main-header {
    padding: 4px 10px;
  }
  .header-left-brand {
    min-height: 32px;
  }
  .header-relic-art {
    width: 30px;
    height: 30px;
  }
  .champion-screen-overlay {
    padding: 8px;
  }
  .champion-select-heading h2 {
    font-size: 24px;
  }
  .champion-select-heading p {
    display: none;
  }
  .champion-choice-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .champion-portrait {
    height: 90px;
  }
}

/* ====================================================
   🏺 RELIC DETAIL POPUP MODAL (When clicking a relic)
   ==================================================== */

.relic-popup-modal {
  max-width: 480px;
  width: 92vw;
  background: radial-gradient(circle at top, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 2.5px solid var(--relic-glow-color, #eab308);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.9), 0 0 35px var(--relic-glow-color, rgba(234, 179, 8, 0.4));
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  animation: relicPopIn 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes relicPopIn {
  from { opacity: 0; transform: scale(0.88) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.relic-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.relic-popup-tag {
  font-family: var(--font-title);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid;
  text-transform: uppercase;
}

.relic-popup-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 800;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.relic-popup-close-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
  border-color: #ef4444;
  transform: scale(1.15);
}

.relic-popup-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.relic-popup-img-wrap {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  border: 3px solid #eab308;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.8) 0%, rgba(2, 6, 23, 1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.relic-popup-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.relic-popup-name {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 900;
  margin: 4px 0 0 0;
  letter-spacing: 0.8px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.relic-popup-type {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1.5px;
}

.relic-popup-effect-card {
  background: rgba(2, 6, 23, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.relic-popup-effect-label {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  color: #7dd3fc;
  letter-spacing: 1.2px;
}

.relic-popup-effect-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #f1f5f9;
  margin: 0;
}

.relic-popup-footer {
  display: flex;
  justify-content: center;
}

.relic-popup-done-btn {
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 900;
  border-radius: 10px;
}

/* ====================================================
   🎒 INVENTORY & EQUIPMENT BAG MODAL (Items Only)
   ==================================================== */

.inventory-modal-card {
  max-width: 840px;
  width: 95vw;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid #eab308;
  border-radius: 18px;
  padding: 20px 24px;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.85), 0 0 24px rgba(234, 179, 8, 0.35);
  color: #f1f5f9;
  box-sizing: border-box;
}

.inv-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.inv-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inv-modal-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 900;
  color: #fef08a;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.inv-modal-badge {
  background: rgba(234, 179, 8, 0.2);
  color: #fef08a;
  border: 1px solid rgba(234, 179, 8, 0.45);
  font-family: var(--font-title);
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
}

.inv-hold-hint {
  font-size: 10.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.inv-items-layout {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 18px;
}

@media (max-width: 768px) {
  .inv-items-layout {
    grid-template-columns: 1fr;
  }
}

.inv-items-list-pane {
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inv-pane-subtitle {
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #7dd3fc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.inv-items-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.inv-item-row-card {
  background: rgba(30, 41, 59, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}

.inv-item-row-card:hover {
  background: rgba(45, 58, 80, 0.95);
  border-color: var(--row-color, #cbd5e1);
  transform: translateX(3px);
}

.inv-item-row-card.active {
  background: rgba(234, 179, 8, 0.15);
  border-color: #fef08a !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.4);
}

.inv-item-row-card.holding-drag-item,
.inv-inspector-art-wrap.holding-drag-item {
  animation: bagItemHoldPulse 0.28s ease-in-out forwards !important;
  outline: 2.5px solid #38bdf8 !important;
  cursor: grabbing !important;
}

@keyframes bagItemHoldPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
  50% {
    transform: scale(0.96);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.7);
  }
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 24px rgba(56, 189, 248, 1);
  }
}

.modal-overlay.bag-drag-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 0.15s ease !important;
}

.modal-overlay.bag-drag-hidden * {
  pointer-events: none !important;
}

.bench-slot.item-hover-target {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.9), inset 0 0 10px rgba(56, 189, 248, 0.5) !important;
  transform: scale(1.08) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  z-index: 25 !important;
}

.inv-item-row-frame {
  width: 50px;
  height: 50px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
}

.inv-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.inv-item-icon-fallback {
  font-size: 20px;
}

.inv-item-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.inv-item-row-name {
  font-family: var(--font-title);
  font-size: 13.5px;
  font-weight: 900;
}

.inv-item-row-rarity {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.inv-item-row-arrow {
  color: #fef08a;
  font-size: 12px;
  font-weight: 900;
}

/* Right Pane: Inspector */
.inv-item-inspector-pane {
  background: rgba(2, 6, 23, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

.inv-inspector-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inv-inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inv-inspector-rarity-badge {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 10px;
  border: 1px solid;
}

.inv-inspector-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.inv-inspector-art-wrap {
  width: 115px;
  height: 115px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.65));
}

.inv-inspector-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.inv-inspector-icon-lg {
  font-size: 40px;
}

.inv-inspector-name {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 900;
  margin: 4px 0 0 0;
}

.inv-inspector-type {
  font-family: var(--font-title);
  font-size: 10.5px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1.5px;
}

.inv-inspector-section-label {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  color: #7dd3fc;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.inv-inspector-stats-box, .inv-inspector-effect-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
}

.inv-inspector-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inv-stat-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-family: var(--font-title);
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 8px;
}

.inv-inspector-desc {
  font-size: 13px;
  line-height: 1.45;
  color: #e2e8f0;
  margin: 0;
}

/* Empty State */
.inv-empty-state-full {
  text-align: center;
  padding: 45px 20px;
  color: #94a3b8;
}

.inv-modal-title-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  display: block;
}

.inv-pane-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
}

.inv-empty-img-lg {
  width: 90px;
  height: 90px;
  object-fit: contain;
  display: block;
  margin: 0 auto 16px auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.7));
  animation: floatBag 3s ease-in-out infinite alternate;
}

@keyframes floatBag {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-8px) scale(1.05); }
}

.inv-empty-state-full h3 {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 900;
  color: #f1f5f9;
  margin: 0 0 6px 0;
}

/* ==========================================================================
   🎛️ AUDIO & SOUND SETTINGS MODAL
   ========================================================================== */
.audio-settings-modal-card {
  width: min(610px, calc(100vw - 28px));
  max-width: 610px;
  max-height: min(92vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf5 0%, #fffaf0 55%, #f7f1e6 100%);
  border: 5px solid #5b402f;
  box-shadow: 0 11px 0 #2f211b, 0 30px 55px rgba(0, 0, 0, 0.58);
  border-radius: 22px;
  padding: 0 24px 24px;
  color: #4b3024;
  text-align: left;
}

.audio-settings-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  margin: 0 -24px 16px;
  padding: 18px 24px 16px;
  border-bottom: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: 15px 15px 20px 20px;
  background:
    radial-gradient(circle at 12% -30%, rgba(255, 231, 144, 0.66), transparent 48%),
    linear-gradient(180deg, #fff8dc 0%, #fffdf5 100%);
}

.audio-settings-title-wrap {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.audio-settings-eyebrow {
  color: #a16207;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.7px;
  line-height: 1;
  text-transform: uppercase;
}

.audio-settings-title {
  font-family: var(--font-title);
  font-size: 27px;
  font-weight: 900;
  line-height: 1.05;
  margin: 4px 0 0;
  color: #4b3024;
  letter-spacing: -0.4px;
  text-shadow: none;
}

.audio-settings-subtitle {
  margin-top: 4px;
  color: #7b6a5d;
  font-size: 12px;
  font-weight: 700;
}

.audio-settings-content {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-height: 0;
  overflow-y: auto;
  padding: 1px 7px 7px 1px;
  scrollbar-color: #c6ad8c transparent;
  scrollbar-width: thin;
}

.audio-settings-content::-webkit-scrollbar { width: 6px; }
.audio-settings-content::-webkit-scrollbar-track { background: transparent; }
.audio-settings-content::-webkit-scrollbar-thumb {
  background: #c6ad8c;
  border-radius: 999px;
}

.audio-control-row {
  background: linear-gradient(135deg, #ffffff 0%, #fffaf0 100%);
  border: 1.5px solid #d8c5aa;
  border-radius: 16px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: 0 3px 0 #bca487, 0 6px 12px rgba(69, 45, 30, 0.08);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.audio-control-row:hover {
  border-color: #d5a83f;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #b88b2d, 0 8px 15px rgba(180, 131, 31, 0.12);
}

.audio-control-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audio-control-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 16px;
  color: #3f322b;
}

.audio-row-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 9px;
  background: #fff3d0;
  color: #a16207;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px #ead6ad;
}

.audio-control-desc {
  margin-left: 38px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.35;
  color: #7b6a5d;
}

.audio-control-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #d6c4ab 0%, #eadfcd 100%);
  box-shadow: inset 0 1px 2px rgba(74, 49, 32, 0.2);
  outline: none;
  cursor: pointer;
  transition: background 0.15s;
}

.audio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #58cc87, #2f9b62);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 0 #1c6741, 0 3px 7px rgba(37, 122, 77, 0.3);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.audio-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 0 #1c6741, 0 0 10px rgba(47, 155, 98, 0.48);
}

.audio-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #58cc87, #2f9b62);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 0 #1c6741, 0 3px 7px rgba(37, 122, 77, 0.3);
  cursor: pointer;
}

.audio-pct-badge {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 800;
  color: #8a5a20;
  min-width: 42px;
  text-align: right;
}

.btn-audio-mute-toggle {
  background: linear-gradient(135deg, #48bd79 0%, #2f9b62 100%);
  border: 1.5px solid #21734a;
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 80px;
  text-align: center;
  box-shadow: 0 3px 0 #1c6741, 0 5px 10px rgba(37, 122, 77, 0.18);
}

.btn-audio-mute-toggle:hover {
  background: linear-gradient(135deg, #52c985 0%, #36a96d 100%);
  transform: translateY(-1px);
}

.btn-audio-mute-toggle.muted {
  background: linear-gradient(135deg, #ef7777 0%, #c94b4b 100%);
  border-color: #9f3030;
  color: #ffffff;
  box-shadow: 0 3px 0 #8c2929, 0 5px 10px rgba(190, 62, 62, 0.16);
}

.btn-audio-mute-toggle.muted:hover {
  background: linear-gradient(135deg, #f18484 0%, #d55656 100%);
}

.audio-settings-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #ded0bd;
  background: linear-gradient(180deg, rgba(247, 241, 230, 0) 0%, #f7f1e6 32%);
}

.audio-test-btn,
.audio-done-btn {
  min-height: 42px;
  padding: 8px 18px;
  border-radius: 12px;
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.audio-test-btn {
  background: linear-gradient(135deg, #ffffff 0%, #fff6d8 100%);
  border: 1.5px solid #d8b45a;
  color: #59402d;
  box-shadow: 0 3px 0 #b88b2d, 0 6px 12px rgba(180, 131, 31, 0.1);
}

.audio-done-btn {
  background: linear-gradient(135deg, #48bd79 0%, #2f9b62 100%);
  border: 1.5px solid #21734a;
  color: #ffffff;
  box-shadow: 0 4px 0 #1c6741, 0 8px 15px rgba(37, 122, 77, 0.22);
}

.audio-test-btn:hover,
.audio-done-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

@media (max-width: 560px) {
  .audio-settings-modal-card {
    padding: 0 14px 16px;
  }

  .audio-settings-header {
    margin: 0 -14px 13px;
    padding: 15px 14px 13px;
  }

  .audio-settings-title { font-size: 22px; }
  .audio-settings-subtitle { display: none; }
  .audio-control-row { padding: 11px 12px; }
  .audio-control-actions { gap: 8px; }
  .audio-pct-badge { min-width: 38px; }
  .btn-audio-mute-toggle { min-width: 66px; padding-inline: 9px; }
}

@media (max-height: 650px) {
  .audio-settings-modal-card { max-height: 94vh; }
  .audio-settings-header { margin-bottom: 11px; padding-top: 13px; padding-bottom: 12px; }
  .audio-settings-content { gap: 8px; }
  .audio-control-row { padding-top: 10px; padding-bottom: 10px; gap: 7px; }
}

.inv-empty-state-full p {
  font-size: 13.5px;
  color: #cbd5e1;
  margin: 0 0 10px 0;
}

.inv-empty-hint {
  font-size: 11.5px;
  color: #eab308;
  font-weight: 700;
}

/* ==========================================================================
   ⚠️ CONFIRM ABANDON RUN MODAL (Matching Menu & Settings parchment design)
   ========================================================================== */
.confirm-modal-card {
  width: min(520px, calc(100vw - 28px));
  max-width: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf5 0%, #fffaf0 55%, #f7f1e6 100%);
  border: 5px solid #5b402f;
  border-radius: 22px;
  box-shadow: 0 11px 0 #2f211b, 0 30px 55px rgba(0, 0, 0, 0.58);
  padding: 0 24px 22px;
  color: #4b3024;
  text-align: left;
}

.confirm-modal-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  margin: 0 -24px 16px;
  padding: 18px 24px 15px;
  border-bottom: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: 15px 15px 20px 20px;
  background:
    radial-gradient(circle at 12% -30%, rgba(254, 202, 202, 0.6), transparent 48%),
    linear-gradient(180deg, #fff8dc 0%, #fffdf5 100%);
}

.confirm-modal-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.confirm-modal-eyebrow {
  display: block;
  color: #b91c1c;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1.7px;
  line-height: 1;
  text-transform: uppercase;
}

.confirm-modal-title {
  font-family: var(--font-title);
  font-size: 25px;
  font-weight: 900;
  line-height: 1.05;
  margin: 4px 0 0;
  color: #4b3024;
  letter-spacing: -0.4px;
}

.confirm-modal-subtitle {
  margin-top: 4px;
  color: #7b6a5d;
  font-size: 12px;
  font-weight: 700;
}

.confirm-modal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.confirm-modal-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid #fca5a5;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff8f8 0%, #fef2f2 100%);
  box-shadow: 0 2px 0 #f87171, inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.confirm-warning-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.confirm-warning-copy strong {
  display: block;
  color: #991b1b;
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 800;
  margin-bottom: 3px;
}

.confirm-warning-copy p {
  margin: 0;
  color: #78350f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.confirm-warning-copy p span {
  font-weight: 800;
  color: #451a03;
}

.confirm-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.confirm-btn-keep {
  min-height: 48px;
  padding: 10px 16px;
  border: 2px solid #21734a;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, #48bd79 0%, #2f9b62 100%);
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 0 #1c6741, 0 8px 15px rgba(37, 122, 77, 0.22);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-btn-keep:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #52c985 0%, #36a96d 100%);
  box-shadow: 0 6px 0 #1c6741, 0 11px 18px rgba(37, 122, 77, 0.28);
}

.confirm-btn-keep:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1c6741;
}

.confirm-btn-abandon {
  min-height: 48px;
  padding: 10px 16px;
  border: 2px solid #b91c1c;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 0 #991b1b, 0 8px 15px rgba(220, 38, 38, 0.22);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-btn-abandon:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 6px 0 #991b1b, 0 11px 18px rgba(220, 38, 38, 0.28);
}

.confirm-btn-abandon:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #991b1b;
}

@media (max-width: 480px) {
  .confirm-modal-actions {
    grid-template-columns: 1fr;
  }
}

/* Legendary Event Outcome & Card Pop Halo */
.event-outcome-modal.is-legendary {
  border: 3px solid #f59e0b;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.8), 0 0 45px rgba(245, 158, 11, 0.6), 0 25px 60px rgba(0, 0, 0, 0.7);
  animation: legendaryHaloPulse 2.2s infinite ease-in-out;
}

.event-outcome-badge.is-legendary {
  background: linear-gradient(90deg, #d97706, #f59e0b, #fbbf24) !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.75);
}

.event-outcome-content.is-legendary {
  background: linear-gradient(135deg, rgba(38, 24, 6, 0.95) 0%, rgba(20, 12, 3, 0.98) 100%) !important;
  border: 2px solid #f59e0b !important;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.45), inset 0 0 15px rgba(245, 158, 11, 0.2) !important;
  transform: scale(1.02);
  color: #fef3c7 !important;
  font-weight: 700 !important;
}

.event-outcome-content.is-legendary .ev-tag-item {
  color: #fde047 !important;
  font-weight: 800 !important;
  text-shadow: 0 0 8px rgba(253, 224, 71, 0.45) !important;
}

.event-outcome-content.is-legendary .ev-tag-gold {
  color: #fbbf24 !important;
  font-weight: 800 !important;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.35) !important;
}

.event-outcome-content.is-legendary .ev-tag-green {
  color: #4ade80 !important;
  font-weight: 800 !important;
}

.event-outcome-content.is-legendary .ev-tag-red {
  color: #f87171 !important;
  font-weight: 800 !important;
}

.event-outcome-content.is-legendary .ev-tag-cyan {
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

/* ==========================================
   🔮 MYSTERY EVENT ROULETTE & REVEAL SYSTEM
   ========================================== */

.event-roulette-modal {
  width: min(540px, calc(96vw - 20px)) !important;
  max-width: min(540px, calc(96vw - 20px)) !important;
  background: radial-gradient(circle at 50% 10%, #152936 0%, #0c1a22 60%, #060e13 100%) !important;
  border: 3px solid #0284c7 !important;
  border-radius: 22px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(2, 132, 199, 0.4) !important;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 24px 20px !important;
}

.event-roulette-header {
  margin-bottom: 16px;
}

.event-roulette-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.25), rgba(168, 85, 247, 0.25));
  border: 1.5px solid #38bdf8;
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.event-roulette-title {
  font-family: var(--font-title);
  font-size: clamp(20px, 3.2vw, 26px);
  color: #f1f8fc !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.4);
  margin: 0 0 4px 0;
}

.event-roulette-subtitle {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.event-roulette-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
  margin: 16px 0;
}

.event-tarot-card {
  width: min(380px, 86vw);
  background: #091a24;
  border: 3px solid #38bdf8;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 24px rgba(56, 189, 248, 0.35);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.event-tarot-card:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: #67e8f9;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 32px rgba(103, 232, 249, 0.5);
}

.event-tarot-card.roulette-tick {
  animation: rouletteTickPulse 0.15s ease-out;
}

@keyframes rouletteTickPulse {
  0% { transform: scale(0.98); filter: brightness(1.25); }
  50% { transform: scale(1.02); filter: brightness(1.15); }
  100% { transform: scale(1); filter: brightness(1); }
}

.event-tarot-card.is-revealed-burst {
  animation: revealCardShockwave 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes revealCardShockwave {
  0% { transform: scale(0.92); border-color: #facc15; box-shadow: 0 0 10px #facc15; }
  40% { transform: scale(1.05); border-color: #fef08a; box-shadow: 0 0 50px rgba(250, 204, 21, 0.85); filter: brightness(1.3); }
  100% { transform: scale(1); border-color: #38bdf8; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 24px rgba(56, 189, 248, 0.4); filter: brightness(1); }
}

.event-tarot-art-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 220px;
  overflow: hidden;
  background: #040d12;
}

.event-tarot-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.15s ease;
}

.event-tarot-art-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(9, 26, 36, 0.85) 100%);
  pointer-events: none;
}

.event-tarot-rune-center {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.25);
  border: 1.5px solid #38bdf8;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
  animation: runeSpinAmbient 8s linear infinite;
}

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

.event-tarot-info {
  padding: 14px 18px 16px;
  background: #091a24;
}

.event-tarot-fate-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #38bdf8;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.event-tarot-fate-tag.revealed {
  color: #facc15;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

.event-tarot-name {
  font-family: var(--font-title);
  font-size: 18px;
  color: #f8fafc;
  margin: 0;
  line-height: 1.3;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-roulette-footer {
  margin-top: 14px;
}

.event-skip-btn {
  width: 100%;
  max-width: 320px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  border: 1.5px solid #38bdf8 !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4) !important;
  transition: all 0.2s ease;
}

.event-skip-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.6) !important;
}

/* Choice Selection Excitement */
.event-option-btn.event-option-selected {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.95), rgba(8, 51, 68, 0.95)) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.6), inset 0 0 20px rgba(56, 189, 248, 0.3) !important;
  transform: scale(1.02) !important;
  animation: optionGlowPulse 1.2s ease-in-out infinite alternate;
}

@keyframes optionGlowPulse {
  0% { border-color: #38bdf8; box-shadow: 0 0 16px rgba(56, 189, 248, 0.5); }
  100% { border-color: #facc15; box-shadow: 0 0 28px rgba(250, 204, 21, 0.75); }
}

.event-option-btn.event-option-dimmed {
  opacity: 0.22 !important;
  pointer-events: none !important;
  transform: scale(0.97);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.event-choice-resolving {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  padding: 14px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(8, 28, 44, 0.95), rgba(15, 23, 42, 0.95));
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  color: #7dd3fc;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 24px rgba(2, 132, 199, 0.4), inset 0 0 16px rgba(56, 189, 248, 0.15);
  animation: resolvingFadeIn 0.35s ease-out;
}

.resolving-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

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

.resolving-spinner {
  display: inline-block;
  font-size: 20px;
  color: #facc15;
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.8));
  animation: resolvingSpin 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

.resolving-dots::after {
  display: inline-block;
  content: '';
  width: 24px;
  text-align: left;
  animation: resolvingDots 1.5s steps(4, jump-none) infinite;
}

@keyframes resolvingDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

.resolving-progress-bar {
  width: 100%;
  max-width: 240px;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.resolving-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #facc15, #ec4899);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
  animation: resolvingProgress 1.6s ease-in-out forwards;
}

@keyframes resolvingProgress {
  0% { width: 0%; }
  35% { width: 45%; }
  70% { width: 80%; }
  100% { width: 100%; }
}

/* Outcome Modal Entrance & Reward Chips */
.event-outcome-reveal-animated {
  animation: outcomeSpringIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes outcomeSpringIn {
  0% { opacity: 0; transform: scale(0.86) translateY(24px); }
  70% { transform: scale(1.03) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.event-outcome-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 14px 0;
}

.outcome-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
  animation: chipBounceIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

.outcome-chip.chip-gold {
  background: linear-gradient(135deg, rgba(161, 98, 7, 0.35), rgba(202, 138, 4, 0.35));
  border: 1.5px solid #fbbf24;
  color: #fef08a;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.outcome-chip.chip-cost {
  background: rgba(185, 28, 28, 0.3);
  border: 1.5px solid #f87171;
  color: #fca5a5;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

.outcome-chip.chip-heal {
  background: rgba(21, 128, 61, 0.35);
  border: 1.5px solid #4ade80;
  color: #bbf7d0;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.35);
}

.outcome-chip.chip-damage {
  background: rgba(153, 27, 27, 0.35);
  border: 1.5px solid #ef4444;
  color: #fecaca;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.outcome-chip.chip-buff {
  background: rgba(14, 116, 144, 0.35);
  border: 1.5px solid #38bdf8;
  color: #bae6fd;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.outcome-chip.chip-debuff {
  background: rgba(136, 19, 55, 0.35);
  border: 1.5px solid #fb7185;
  color: #fecdd3;
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.35);
}

.outcome-chip.chip-item {
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.35), rgba(168, 85, 247, 0.35));
  border: 1.5px solid #c084fc;
  color: #f3e8ff;
  box-shadow: 0 0 14px rgba(192, 132, 252, 0.4);
}

/* ==========================================================================
   🎰 CASINO (DEN OF FORTUNE) & BLACK MARKET - NAUTICAL THEME
   ========================================================================== */
.map-node-pin.node-casino .node-medallion-rim {
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.map-node-pin.node-black_market .node-medallion-rim {
  border-color: #a855f7;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.6);
}

.casino-modal-card {
  width: min(680px, calc(96vw - 20px)) !important;
  max-width: min(680px, calc(96vw - 20px)) !important;
  background: radial-gradient(circle at 50% 0%, #15343f 0%, #0d232c 60%, #07151b 100%) !important;
  border: 3px solid #236577 !important;
  border-radius: 20px !important;
  padding: 24px 28px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 32px rgba(22, 85, 102, 0.4) !important;
  color: #e2f1f8;
}

.casino-header {
  text-align: center;
  margin-bottom: 16px;
}

.casino-badge {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, #ca8a04, #92400e);
  border: 1.5px solid #facc15;
  color: #fef08a;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  border-radius: 999px;
  margin-bottom: 8px;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.45);
}

.casino-header h2 {
  font-family: var(--font-title);
  font-size: clamp(22px, 2.2vw, 28px);
  color: #f1f8fc !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 16px rgba(56, 189, 248, 0.35);
  margin: 0 0 6px 0;
}

.casino-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 12px 0;
}

.casino-stats-pill {
  display: inline-flex;
  gap: 18px;
  background: #08161d;
  border: 1.5px solid #236577;
  padding: 6px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #e2f1f8;
}

.casino-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
  border-bottom: 1.5px solid rgba(35, 101, 119, 0.4);
  padding-bottom: 12px;
}

.casino-tab {
  background: #08161d;
  border: 2px solid #236577;
  color: #94a3b8;
  font-family: var(--font-title);
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.casino-tab:hover {
  border-color: #38bdf8;
  color: #e2f1f8;
}

.casino-tab.active {
  background: linear-gradient(135deg, #164e63, #0e7490);
  border-color: #facc15;
  color: #fef08a;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.35);
}

.casino-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.casino-panel.active {
  display: flex;
}

/* 🎡 WHEEL OF FORTUNE */
.wheel-stage {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 6px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: 50% 15%;
  font-size: 26px;
  color: #facc15;
  z-index: 10;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
  transition: transform 0.06s ease-out;
}

.wheel-pointer.tick {
  transform: translateX(-50%) rotate(-20deg) scale(1.15);
}

#wheel-canvas {
  border-radius: 50%;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.75), 0 0 20px rgba(14, 116, 144, 0.35);
}

.casino-wager-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wager-label {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 700;
}

.btn-wager {
  background: #08161d;
  border: 1.5px solid #236577;
  color: #e2f1f8;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-wager.selected {
  background: linear-gradient(135deg, #ca8a04, #92400e);
  border-color: #facc15;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.45);
}

.btn-casino-action {
  width: 100%;
  max-width: 320px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #ca8a04 0%, #eab308 50%, #d97706 100%);
  border: 2px solid #fef08a;
  border-radius: 14px;
  color: #1e1b4b;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 0 #78350f, 0 6px 20px rgba(234, 179, 8, 0.4);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-casino-action:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-casino-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.casino-feed-msg {
  padding: 8px 18px;
  border-radius: 12px;
  background: #08161d;
  border: 1px solid #236577;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.casino-feed-msg.win {
  color: #86efac;
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
}

.casino-feed-msg.jackpot {
  color: #fef08a;
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.2);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.4);
}

.casino-feed-msg.bust {
  color: #fca5a5;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* 🃏 BEAST HI-LO */
.hilo-board {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hilo-card-box {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hilo-card-container {
  perspective: 800px;
}

.hilo-card {
  width: 130px;
  height: 170px;
  background: #08161d;
  border: 2.5px solid #236577;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  transition: transform 0.35s ease, border-color 0.2s ease;
}

.hilo-card.flipping {
  transform: rotateY(90deg);
}

.hilo-mystery-card {
  border-style: dashed;
  border-color: #475569;
  opacity: 0.8;
}

.hilo-card-tier {
  font-size: 12px;
  font-weight: 800;
  color: #facc15;
}

.hilo-card-icon {
  font-size: 42px;
}

.hilo-card-name {
  font-size: 12px;
  text-align: center;
  color: #f1f8fc;
}

.hilo-card-cost {
  font-size: 11px;
  color: #38bdf8;
  font-weight: 800;
}

.hilo-vs {
  font-size: 18px;
  font-weight: 900;
  color: #f43f5e;
}

.hilo-streak-bar {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 320px;
  font-size: 13px;
  color: #cbd5e1;
  background: #08161d;
  border: 1px solid #236577;
  padding: 6px 14px;
  border-radius: 8px;
}

.hilo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-hilo-guess.high {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1.5px solid #38bdf8;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn-hilo-guess.low {
  background: linear-gradient(135deg, #0f766e, #115e59);
  border: 1.5px solid #2dd4bf;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn-hilo-guess:hover {
  transform: translateY(-2px);
}

.btn-hilo-cashout {
  background: linear-gradient(135deg, #15803d, #166534);
  border: 1.5px solid #4ade80;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

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

/* 🎰 SLOTS MACHINE */
.slots-machine {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: #08161d;
  border: 3px solid #236577;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

.slots-display {
  display: flex;
  gap: 12px;
  background: #040d12;
  padding: 16px 24px;
  border-radius: 16px;
  border: 2.5px solid #d97706;
  box-shadow: 0 0 20px rgba(217, 119, 6, 0.35), inset 0 0 16px rgba(0, 0, 0, 0.9);
}

.slot-reel {
  width: 72px;
  height: 88px;
  background: #0a1f28;
  border: 2px solid #164e63;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.85);
  transition: transform 0.2s ease;
}

.slot-reel.spinning {
  animation: reelBlur 0.12s linear infinite alternate;
}

.slot-reel.reel-lock {
  animation: reelLockBounce 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: #facc15;
}

@keyframes reelBlur {
  0% { transform: translateY(-6px); filter: blur(2.5px); }
  100% { transform: translateY(6px); filter: blur(2.5px); }
}

@keyframes reelLockBounce {
  0% { transform: translateY(-8px) scale(1.06); }
  70% { transform: translateY(3px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}

.slots-paytable {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  font-size: 12px;
  color: #94a3b8;
  background: #040d12;
  border: 1px solid rgba(35, 101, 119, 0.5);
  padding: 8px 16px;
  border-radius: 10px;
}

/* ⛵ LEAVE BUTTON */
.btn-leave-nautical {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #08161d;
  border: 2px solid #236577;
  color: #94a3b8;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-leave-nautical:hover {
  border-color: #38bdf8;
  color: #f1f8fc;
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

/* ==========================================================================
   🏴‍☠️ BLACK MARKET - SMUGGLER'S COVE THEME
   ========================================================================== */
.black-market-modal-card {
  width: min(700px, calc(96vw - 20px)) !important;
  max-width: min(700px, calc(96vw - 20px)) !important;
  background: radial-gradient(circle at 50% 0%, #1e1338 0%, #100a22 60%, #05030b 100%) !important;
  border: 3px solid #6b21a8 !important;
  border-radius: 20px !important;
  padding: 24px 28px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 32px rgba(107, 33, 168, 0.4) !important;
  color: #f8fafc;
}

.market-header {
  text-align: center;
  margin-bottom: 16px;
}

.market-badge {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  border: 1.5px solid #c084fc;
  color: #f3e8ff;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  border-radius: 999px;
  margin-bottom: 8px;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.6);
}

.market-header h2 {
  font-family: var(--font-title);
  font-size: clamp(22px, 2.2vw, 28px);
  color: #f3e8ff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 16px rgba(168, 85, 247, 0.35);
  margin: 0 0 6px 0;
}

.market-subtitle {
  font-size: 13px;
  color: #a78bfa;
  font-style: italic;
  margin: 0 0 10px 0;
}

.market-stats-pill {
  display: inline-flex;
  gap: 18px;
  background: #090612;
  border: 1.5px solid #6b21a8;
  padding: 6px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.market-section {
  margin-bottom: 18px;
}

.market-section h3 {
  font-family: var(--font-title);
  font-size: 15px;
  color: #c084fc;
  margin: 0 0 10px 0;
  font-weight: 800;
  border-bottom: 1px solid rgba(124, 58, 237, 0.3);
  padding-bottom: 4px;
}

.market-wares-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.market-ware-card {
  background: #0d071a;
  border: 2px solid #581c87;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.market-ware-card.is-cursed {
  border-color: #e11d48;
  box-shadow: 0 0 16px rgba(225, 29, 72, 0.35);
}

.ware-icon {
  font-size: 32px;
  margin-bottom: 6px;
}

.ware-name {
  font-size: 13px;
  color: #f8fafc;
  display: block;
  margin-bottom: 2px;
  font-weight: 800;
}

.ware-rarity {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
}

.ware-rarity.cursed {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.25);
  border: 1px solid #f43f5e;
}

.ware-desc {
  font-size: 11px;
  color: #cbd5e1;
  margin: 6px 0;
  line-height: 1.4;
  min-height: 44px;
}

.ware-buy-options {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: auto;
}

.btn-ware-buy {
  flex: 1;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease;
}

.btn-ware-buy:hover {
  transform: translateY(-1px);
}

.btn-ware-buy.gold {
  background: #eab308;
  color: #451a03;
}

.btn-ware-buy.hp {
  background: #e11d48;
  color: #ffffff;
}

.market-ware-card.purchased {
  opacity: 0.35;
  filter: grayscale(0.8);
}

.ware-sold-stamp {
  font-size: 12px;
  font-weight: 900;
  color: #4ade80;
  margin: 0 auto;
}

.market-bounty-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}

.market-bounty-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090612;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.bounty-btn-group {
  display: flex;
  gap: 8px;
}

.btn-bounty-sell {
  background: #f59e0b;
  color: #451a03;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn-bounty-sacrifice {
  background: #be123c;
  color: #ffffff;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.casino-footer, .market-footer {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}


/* Illustrated pirate dens */
.casino-modal-card, .black-market-modal-card {
  width: min(860px, calc(100vw - 24px)) !important;
  max-width: 860px !important;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 0 24px 20px !important;
  border: 2px solid #947047 !important;
  border-radius: 18px !important;
  background: linear-gradient(145deg, #172b2c, #10191c 60%, #201914) !important;
  box-shadow: 0 24px 80px #000b !important;
}
.black-market-modal-card { background: linear-gradient(145deg, #282032, #15131d 65%, #241c20) !important; }
.den-scene { width: calc(100% + 48px); max-width: none; height: clamp(160px, 25vh, 250px); object-fit: cover; object-position: center 48%; display: block; margin: 0 -24px 18px; border-bottom: 2px solid #947047; }
.casino-header h2, .market-header h2 { color: #ffe4ac !important; text-shadow: 0 2px 5px #000 !important; }
.casino-badge, .market-badge { background: #30271b; color: #e9c892; border: 1px solid #99784e; box-shadow: none; letter-spacing: 2px; }
.casino-subtitle, .market-subtitle { color: #c8c4b7; line-height: 1.6; }
.den-rules { color: #c6c9c0; font-size: 12px; line-height: 1.65; text-align: center; padding: 10px 14px; background: #0003; border-radius: 8px; margin: 0 0 12px; }
.casino-tabs { gap: 8px; }
.casino-tab { flex: 1; padding: 10px 8px; border-color: #65553e; background: #192627; color: #d1c7ae; }
.casino-tab.active { background: #51402a; border-color: #d9b66d; color: #ffedbd; box-shadow: none; }
.market-ware-card { background: linear-gradient(160deg, #292330, #17141d); border-color: #756047; }
.market-ware-card.is-cursed { border-color: #a65d72; box-shadow: inset 0 0 24px #75334722; }
.ware-desc { font-size: 12px; line-height: 1.6; }
.market-section h3 { color: #e2c48e; }
.ware-icon { font-size: 40px; }
.hilo-card-icon img { width: 100%; height: 95px; object-fit: contain; border-radius: 8px; }
.casino-footer, .market-footer { margin-top: 16px; }
.casino-modal-card button:disabled, .black-market-modal-card button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.casino-modal-card button:focus-visible, .black-market-modal-card button:focus-visible { outline: 3px solid #ffe4ac; outline-offset: 3px; }
@media (max-width: 560px) {
  .casino-modal-card, .black-market-modal-card { padding: 0 12px 16px !important; }
  .den-scene { width: calc(100% + 24px); margin-left: -12px; margin-right: -12px; }
  .casino-tabs { flex-wrap: wrap; }
  .casino-tab { font-size: 11px; min-width: 85px; }
  .market-wares-grid { grid-template-columns: 1fr; }
  .market-bounty-item { align-items: stretch; flex-direction: column; gap: 8px; }
  .bounty-btn-group > button { flex: 1; }
  .casino-wager-controls, .hilo-actions { flex-wrap: wrap; }
  .hilo-card-box { gap: 8px; }
  .hilo-card-container { min-width: 0; }
}
.market-ware-card.purchased { opacity: .65; }
.casino-modal-card .slots-machine { background: linear-gradient(145deg, #3a3025, #172626); border-color: #ab874e; box-shadow: inset 0 0 24px #0007; }
.casino-modal-card .slot-reel { border-color: #a08454; background: #e4d3ae; }
.casino-modal-card .hilo-card { border-color: #a08454; }

/* Art-directed game tables. Scoped to the illustrated casino. */
.casino-premium.casino-modal-card { width:min(1080px,calc(100vw - 24px))!important; max-width:1080px!important; background:radial-gradient(ellipse at 40% 40%,#183b37,#0c191c 75%)!important; border:1px solid #8d7955!important; padding:0 30px 18px!important; }
.casino-premium .den-scene {display:none}
.casino-premium .casino-header {position:relative;text-align:left;padding:24px 190px 22px 6px;margin:0; background:linear-gradient(90deg,#101e20 20%,#10202033),url('../assets/locations/den-of-fortune.png') center 45%/cover;}
.casino-premium .casino-header h2 {font:500 clamp(28px,4vw,44px) Georgia,serif;letter-spacing:-1px}
.casino-premium .casino-badge {background:none;border:0;padding:0;font:600 10px Arial,sans-serif;letter-spacing:4px;color:#cbb78b}
.casino-premium .casino-subtitle {margin:0;font:13px/1.5 Arial,sans-serif;color:#bbc5bc}
.casino-premium .casino-stats-pill {position:absolute;right:12px;top:40px;padding:12px 18px;background:#0a191ddb; border:1px solid #b69a5c55;border-radius:8px}
.casino-premium .casino-tabs {margin:0;padding:0;border-bottom:1px solid #b69a5c44;gap:0}
.casino-premium .casino-tab {border:0;border-bottom:2px solid transparent;border-radius:0;background:none!important;padding:17px 12px;font:600 13px Arial,sans-serif;box-shadow:none}
.casino-premium .casino-tab.active {border-bottom-color:#ddc38a;color:#ffeac1}
.casino-premium .casino-panel {position:relative;padding:22px 0 0;gap:14px;animation:table-arrive .4s ease both}
.casino-premium .den-rules {order:10;align-self:stretch;background:none;border-top:1px solid #b69a5c22;border-radius:0;padding:12px;margin:0;text-align:left;font:12px/1.6 Arial,sans-serif}
.casino-premium .den-rules summary {cursor:pointer;color:#acbdb7}
.casino-premium .wheel-stage {width:min(410px,75vw);height:auto;aspect-ratio:1;margin:0 auto 8px}
.casino-premium #wheel-canvas {width:100%;height:100%;box-shadow:none;filter:drop-shadow(0 20px 20px #0009)}
.casino-premium .wheel-pointer {top:-8px;color:#f5de9d;font-size:35px;text-shadow:0 3px 4px #000;transform-origin:50% 15%}
.casino-premium .wheel-pointer.tick {transform:translateX(-50%) rotate(-20deg) scale(1.15)}
.casino-premium .btn-casino-action {max-width:360px;background:linear-gradient(120deg,#ecdbad,#bca06b);color:#24251e;border:1px solid #f1dfb5;border-radius:7px;box-shadow:0 5px 20px #0004;font:600 15px Arial,sans-serif;padding:15px 24px;letter-spacing:.3px}
.casino-premium .btn-wager {border:1px solid #7b80644f;border-radius:5px;padding:10px 17px;background:#102a2c;font:13px Arial,sans-serif}
.casino-premium .btn-wager.selected {background:#d1ba8533;color:#f3dfb5;border-color:#d1ba85;box-shadow:none}
.casino-premium .casino-feed-msg {background:transparent;border:0;border-radius:0;color:#b6c9c1;font:13px/1.5 Arial,sans-serif;min-height:24px;padding:5px 12px;box-shadow:none}
.casino-premium .casino-feed-msg.win,.casino-premium .casino-feed-msg.jackpot {color:#f5dba0;animation:reward-bloom .7s ease both}
.casino-premium .casino-feed-msg.bust {color:#e7a69b;animation:curse-shake .4s ease both}
.casino-premium .slots-machine {width:100%;border:0;background:none!important;padding:0;box-shadow:none!important;display:flex;flex-direction:column;align-items:center;gap:12px}
.casino-premium .reel-cabinet {position:relative;width:min(680px,100%);aspect-ratio:1.5;isolation:isolate}
.casino-premium .cabinet-art {position:absolute;width:100%;height:100%;inset:0;object-fit:contain;border-radius:12px}
.casino-premium .slots-display {position:absolute;left:21.5%;top:34%;width:56.5%;height:36%;display:grid;grid-template-columns:repeat(3,1fr);gap:7%;padding:0;background:none;border:0;box-shadow:none;border-radius:0;}
.casino-premium .slot-reel {position:relative;width:100%;height:100%;border:0!important;border-radius:12%;background:linear-gradient(#0b191c,#183a35 50%,#0a181c)!important;overflow:hidden;display:block;box-shadow:inset 0 10px 18px #0009;}
.casino-premium .reel-symbol {display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:8%;box-sizing:border-box;}
.casino-premium .reel-symbol img,.casino-premium .reel-symbol svg {width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 4px 5px #0008)}
.casino-premium .reel-strip {height:100%;animation:reel-travel .5s linear infinite}
.casino-premium .slot-reel.spinning {animation:none;filter:none}
.casino-premium .slot-reel.spinning .reel-symbol {filter:blur(1px)}
.casino-premium .slot-reel.reel-lock {animation:reel-settle .25s ease-out}
.casino-premium .slots-paytable {display:grid;grid-template-columns:repeat(3,1fr);gap:8px 20px;background:none;border:0;padding:0 10px;color:#bac5b8;font:11px/1.5 Arial,sans-serif}
.casino-premium .hilo-board {padding:18px 0 0;gap:22px;background:radial-gradient(ellipse,#306d5740,transparent 70%)}
.casino-premium .hilo-card-box {gap:30px}
.casino-premium .hilo-card {position:relative;width:210px;height:294px;padding:0;overflow:hidden;background:#0b2022;border:1px solid #d0b778!important;border-radius:12px;box-shadow:0 20px 25px #0006,0 0 0 4px #7a64462a;transition:transform .35s cubic-bezier(.2,.7,.2,1);}
.casino-premium .hilo-card-icon {position:absolute;inset:0;display:block;font-size:0}
.casino-premium .hilo-card-icon img {width:100%;height:100%;object-fit:cover;border-radius:0}
.casino-premium .hilo-card:not(.hilo-mystery-card)::after {content:'';position:absolute;inset:35% 0 0;background:linear-gradient(transparent,#071a1cf5);pointer-events:none}
.casino-premium .hilo-card-tier {position:absolute;top:12px;left:12px;z-index:2;background:#122c2dde;border:1px solid #cbb176;padding:7px 10px;border-radius:50%;font:600 14px Georgia,serif;color:#ffe5a6}
.casino-premium .hilo-card-name {position:absolute;bottom:38px;z-index:2;font:22px Georgia,serif;color:#fff0cf}
.casino-premium .hilo-card-cost {position:absolute;bottom:18px;z-index:2;color:#b2c9bd;font:11px Arial,sans-serif;text-transform:uppercase;letter-spacing:2px}
.casino-premium .hilo-mystery-card {opacity:1;background:radial-gradient(ellipse,#1b5653,#0a222c);border-style:solid;}
.casino-premium .hilo-mystery-card::before {content:'';position:absolute;inset:40px 20px;background:url('../assets/locations/fortune-wheel-v2.png') center/contain no-repeat;filter:drop-shadow(0 0 16px #e5c57633);}
.casino-premium .hilo-mystery-card::after {content:'';position:absolute;inset:9px;border:1px solid #b8a37466;border-radius:7px;}
.casino-premium .hilo-mystery-card strong {position:absolute;bottom:18px;font:10px Arial,sans-serif;text-transform:uppercase;letter-spacing:3px;color:#d8c392}
.casino-premium .hilo-vs {font:italic 17px Georgia,serif;color:#9baa99}
.casino-premium .hilo-streak-bar {width:min(480px,100%);background:none;border:0;border-top:1px solid #b6a07044;border-bottom:1px solid #b6a07044;border-radius:0;padding:12px 0;font:12px Arial,sans-serif}
.casino-premium .hilo-actions {gap:10px}
.casino-premium .btn-hilo-guess,.casino-premium .btn-hilo-cashout {border:1px solid #a38e6155;border-radius:6px;padding:13px 18px;background:#173735;color:#e9d8ad;font:600 13px Arial,sans-serif}
.casino-premium .btn-hilo-cashout {background:#d2ba83;color:#182c2b}
.casino-premium .casino-footer {border-top:1px solid #b69a5c22;padding-top:12px;margin-top:4px}
.casino-premium .btn-leave-nautical {background:none;border:0;color:#a3b4ad;font:12px Arial,sans-serif}
@keyframes reel-travel {to{transform:translateY(-500%)}}
@keyframes reel-settle {0%{transform:translateY(-6px)}55%{transform:translateY(3px)}100%{transform:translateY(0)}}
@keyframes reward-bloom {0%{transform:translateY(8px);opacity:0;filter:brightness(2)}100%{transform:none;opacity:1;filter:none}}
@keyframes curse-shake {25%,75%{transform:translateX(-4px)}50%{transform:translateX(4px)}}
@keyframes table-arrive {from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@media(max-width:600px){
.casino-premium.casino-modal-card{padding:0 14px 12px!important}
.casino-premium .casino-header{padding:18px 0 12px}.casino-premium .casino-stats-pill{position:static;margin-top:12px;padding:7px 12px}
.casino-premium .casino-tab{font-size:11px;padding:14px 4px}
.casino-premium .hilo-card{width:clamp(120px,35vw,180px);height:clamp(180px,49vw,252px)}
.casino-premium .hilo-card-box{gap:10px}.casino-premium .hilo-card-name{font-size:18px}.casino-premium .hilo-actions{justify-content:center;flex-wrap:wrap}
.casino-premium .slots-paytable{grid-template-columns:repeat(2,1fr);font-size:10px;gap:5px 12px}
.casino-premium .casino-wager-controls{gap:6px;justify-content:center;flex-wrap:wrap}.casino-premium .wager-label{width:100%;text-align:center}
}
@media(prefers-reduced-motion:reduce){.casino-premium *{animation:none!important;transition:none!important}}

/* Smuggler display cases share the tactile materials of the gaming tables. */
.black-market-modal-card .market-header h2{font:500 clamp(26px,4vw,38px) Georgia,serif;letter-spacing:-.7px}
.black-market-modal-card .market-ware-card{overflow:hidden;background:radial-gradient(ellipse at top,#46364e,#171c25 75%);border:1px solid #aa956466;border-radius:10px;transition:transform .25s ease,box-shadow .25s ease}
.black-market-modal-card .market-ware-card:hover{transform:translateY(-4px);box-shadow:0 16px 24px #0005}
.black-market-modal-card .ware-name{font:18px Georgia,serif;color:#f0dfbb}
.black-market-modal-card .ware-icon{display:grid;place-items:center;width:90px;height:90px;margin:4px 0 15px;border-radius:50%;background:radial-gradient(#9e75b044,transparent 70%);filter:drop-shadow(0 8px 8px #0008);animation:relic-float 5s ease-in-out infinite}
.black-market-modal-card .btn-ware-buy.gold,.black-market-modal-card .btn-bounty-sell{background:linear-gradient(120deg,#e4d5ad,#b59a67);color:#242720;border:1px solid #dfcba0;border-radius:5px}
.black-market-modal-card .btn-ware-buy.hp,.black-market-modal-card .btn-bounty-sacrifice{background:#5a3446;color:#f3d3dc;border:1px solid #987381;border-radius:5px}
.black-market-modal-card .market-ware-card.purchased{animation:reward-bloom .65s ease both}
@keyframes relic-float{50%{transform:translateY(-5px)}}
@media(prefers-reduced-motion:reduce){.black-market-modal-card *{animation:none!important;transition:none!important}}
.casino-premium .reel-symbol img {border-radius:18%;mask-image:radial-gradient(ellipse,#000 55%,transparent 75%)}
.casino-premium .round-active .cabinet-art {filter:brightness(1.06)}
