/* ==========================================================================
 * Moonborn Codex — Round 5 Commercial UI Vault Upgrade (`inked_parchment_roguelite`)
 * Reference: Lost Pages (ReaAPK) + Gold Reference AshfangDungeonDeck
 *
 * Guarantees:
 *   1. Full-bleed 100vw x 100vh Battle Stage (battle-canvas = 100% viewport >= 64%),
 *      ZERO opaque SaaS header bar or opaque SaaS sidebar walls.
 *   2. 22+ 9-slice border-image regions from assets/ui/vault_inked_parchment_roguelite/.
 *   3. Torn antique parchment fanned Spell Cards (`card_common/rare/epic/legendary.png`)
 *      with slim 9-12px 9-slice borders, 44% art window, corner-floating cost/hotkey
 *      seals (z-index >= 8, overflow: visible), and >= 4.5:1 dark ink contrast on #EBD5AC.
 *   4. STRICTLY ZERO neon cyan (#4BC7E8 / #38BDF8 / #67E8F9): matte charcoal obsidian
 *      #1A1715, aged parchment #EBD5AC, antique bronze #C99738, wax crimson #9E2E2E,
 *      and muted runic slate-teal #2E857D only.
 *   5. Crisp 1-row floating Top HUD + clean layout at both 1920x1080 and 1280x720.
 * ========================================================================== */

:root,
[data-ui-vault-style='inked_parchment_roguelite'] {
  /* Core Inked Parchment Palette — ZERO cyan neon */
  --pal-obsidian: #0E0C0B;
  --pal-ink: #090807;
  --pal-sanctum: #1A1715;
  --pal-slate: #2B2622;
  --pal-astral-teal: #2E857D;
  --pal-parchment: #EBD5AC;
  --pal-parchment-light: #EFE5CE;
  --pal-sage: #B6A489;
  --pal-ash: #7D6A52;

  /* Functional Warm Accents (Bronze Gold, Wax Crimson, Runic Teal) */
  --gold-bright: #F4E0B0;
  --gold-lunar: #D4B47C;
  --gold-amber: #C98A32;
  --ether-cyan: #C99738;
  --fire-crimson: #C94F2A;
  --water-azure: #3D8B84;
  --earth-ochre: #8C8E32;
  --pierce-danger: #B93535;
  --pierce-bg: #3A1515;
  --violet-arcane: #8B5799;

  /* Inked Parchment Tokens */
  --uiv-stone: #1A1715;
  --uiv-stone-hi: #27221E;
  --uiv-bronze: #A38B67;
  --uiv-bronze-hi: #D4B47C;
  --uiv-bronze-dim: rgba(163, 139, 103, 0.38);
  --uiv-wax-red: #9E2E2E;
  --uiv-ink-dark: #1C1510;
  --uiv-ink-muted: #3E2A1C;
  --uiv-ink-emerald: #1F5E48;

  /* TrackBUIMotion v2.7.0 / UI Vault Contract v2.1 */
  --tb-slot-style: 'inked_parchment_roguelite';
  --tb-slot-shape: rect;
  --tb-slot-radius: 2px;
  --tb-slot-chamfer: 0px;
  --tb-slot-inset: 3px 3px 3px 3px;
  --tb-slot-palette: bronze_gold;
  --tb-slot-mode: chaser_slot;
  --tb-slot-daylight: 1;
  --tb-slot-z: 3;
}

html,
body,
#app-root {
  background-color: #0E0C0B !important;
  color: #EFE5CE;
}

/* ==========================================================================
 * 1. SHARED 9-SLICE VAULT CHROME (BUTTONS, FRAMES, TABS, BARS, BADGES)
 * ========================================================================== */

/* Tier-1 Hero Primary CTA — Forged Hexagonal Antique Bronze Plaque */
.btn-primary-9s {
  box-sizing: border-box !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 12px 18px 12px 18px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_primary.png') 82 70 73 83 fill / 12px 18px 12px 18px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #FFF9EC !important;
  font-family: var(--font-display) !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase;
  text-shadow: 0 2px 3px rgba(15, 10, 6, 0.96), 0 0 8px rgba(0, 0, 0, 0.65) !important;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.78)) !important;
  padding: 2px 12px !important;
  min-height: 44px;
  overflow: visible !important;
}

.btn-primary-9s span,
.btn-primary-9s kbd {
  color: #FFF9EC !important;
}

.btn-primary-9s .hotkey-kbd {
  background: rgba(16, 12, 9, 0.52) !important;
  border: 1px solid rgba(244, 224, 176, 0.55) !important;
  color: #F4E0B0 !important;
  border-radius: 3px !important;
}

.btn-primary-9s:hover:not(:disabled) {
  filter: brightness(1.13) drop-shadow(0 6px 14px rgba(201, 138, 50, 0.48)) !important;
  transform: translateY(-1px);
}

.btn-primary-9s:disabled {
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_disabled.png') 63 209 62 188 fill / 12px 18px 12px 18px / 0 stretch !important;
  color: #C7BCA9 !important;
  opacity: 0.78 !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55)) !important;
}

/* Tier-2 Secondary Plaque — Forged Runic Slate-Teal */
.btn-obsidian-action {
  box-sizing: border-box !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 10px 15px 10px 15px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_secondary.png') 61 71 61 75 fill / 10px 15px 10px 15px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #EFE5CE !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92) !important;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.65));
  padding: 2px 10px !important;
  min-height: 40px;
  overflow: visible !important;
}

.btn-obsidian-action:hover:not(:disabled) {
  filter: brightness(1.14) drop-shadow(0 5px 12px rgba(46, 133, 125, 0.42));
  transform: translateY(-1px);
}

.btn-obsidian-action:disabled {
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_disabled.png') 63 209 62 188 fill / 10px 15px 10px 15px / 0 stretch !important;
  color: #B4A894 !important;
  opacity: 0.72;
}

/* Danger / Exit State — Forged Wax Crimson Plaque */
.btn-danger-outline,
#btn-quit-game,
#btn-title-quit,
#btn-settings-quit {
  box-sizing: border-box !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 8px 13px 8px 13px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_danger.png') 62 222 61 176 fill / 8px 13px 8px 13px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #FDE8E8 !important;
  font-family: var(--font-display) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92) !important;
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.68));
}

.btn-danger-outline:hover:not(:disabled),
#btn-quit-game:hover:not(:disabled),
#btn-title-quit:hover:not(:disabled) {
  filter: brightness(1.16) drop-shadow(0 4px 10px rgba(158, 46, 46, 0.55)) !important;
}

/* Carved Obsidian Stone Utility Pills */
.btn-obsidian-pill,
.btn-hud-compact,
.btn-hud-icon {
  background: linear-gradient(180deg, #2A2520 0%, #161311 100%) !important;
  border: 1.5px solid #6E5C45 !important;
  border-radius: 3px !important;
  box-shadow: inset 0 0 0 1px rgba(239, 229, 206, 0.08), 0 3px 8px rgba(0, 0, 0, 0.72) !important;
  color: #EFE5CE !important;
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  overflow: visible !important;
}

.btn-obsidian-pill:hover:not(:disabled),
.btn-hud-compact:hover:not(:disabled),
.btn-hud-icon:hover:not(:disabled) {
  border-color: #D4B47C !important;
  background: linear-gradient(180deg, #362F28 0%, #1F1B17 100%) !important;
  color: #FFF8E6 !important;
}

.btn-obsidian-pill:disabled {
  border-color: #463D33 !important;
  background: linear-gradient(180deg, #221E1B 0%, #151210 100%) !important;
  color: #8A7F70 !important;
}

/* Notify Badges — Wax Crimson Seal + Bone Rim */
.notify-badge {
  z-index: 12 !important;
  background: linear-gradient(180deg, #C83A3A 0%, #871D1D 100%) !important;
  border: 1.5px solid #EFE5CE !important;
  color: #FFF8EC !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.72);
}

/* ==========================================================================
 * 2. TITLE SCREEN (CANDLELIT OBSIDIAN STONE + ANTIQUE BRONZE — ZERO CYAN)
 * ========================================================================== */

#title-screen {
  background-color: #0C0A09 !important;
}

.title-vignette {
  background:
    radial-gradient(circle at 28% 52%, rgba(201, 138, 50, 0.14), transparent 46%),
    radial-gradient(ellipse at 50% 45%, rgba(14, 12, 11, 0.16) 0%, rgba(10, 8, 7, 0.88) 100%) !important;
}

.title-brand-badge {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 10px 18px 10px 18px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/hud_pill.png') 41 80 42 79 fill / 10px 18px 10px 18px / 0 stretch !important;
  border-radius: 0 !important;
  padding: 0 8px !important;
  color: #EFE5CE !important;
  overflow: visible !important;
}

.title-brand-badge .hud-icon-sm {
  width: 26px !important;
  height: 26px !important;
  margin: -6px 2px -6px -10px !important;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.85));
}

.version-kicker-pill {
  background: linear-gradient(90deg, #9E2E2E 0%, #781D1D 100%) !important;
  border: 1px solid #D4B47C !important;
  color: #FFF4DC !important;
  border-radius: 2px !important;
}

.title-hero-halo {
  background: radial-gradient(circle, rgba(201, 138, 50, 0.30) 0%, rgba(163, 139, 103, 0.14) 48%, transparent 74%) !important;
}

.title-lunar-ring-outer {
  border: 1.5px dashed rgba(212, 180, 124, 0.36) !important;
  box-shadow: 0 0 24px rgba(201, 138, 50, 0.16), inset 0 0 20px rgba(212, 180, 124, 0.10) !important;
}

.title-lunar-ring-inner {
  border: 1.5px solid rgba(163, 139, 103, 0.34) !important;
  border-top-color: rgba(244, 224, 176, 0.72) !important;
  border-bottom-color: rgba(158, 46, 46, 0.22) !important;
}

.title-flank-left {
  filter: brightness(0.76) saturate(0.84) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.92)) drop-shadow(0 0 16px rgba(201, 138, 50, 0.24)) !important;
}

.title-flank-right {
  filter: brightness(0.78) saturate(0.88) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.92)) drop-shadow(0 0 18px rgba(158, 46, 46, 0.26)) !important;
}

#title-hero-portrait {
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.94)) drop-shadow(0 0 22px rgba(201, 138, 50, 0.24)) !important;
}

.title-menu-column.frame-panel-9s {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 24px 24px 32px 24px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_modal.png') 62 63 88 63 fill / 24px 24px 32px 24px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 26px 52px rgba(0, 0, 0, 0.92)) !important;
  padding: 8px 16px !important;
}

.title-kicker {
  color: #D4B47C !important;
  letter-spacing: 0.18em;
}

.title-logo-heading {
  color: #EFE5CE !important;
  text-shadow: 0 3px 0 #140E0B, 0 0 24px rgba(201, 138, 50, 0.42) !important;
}

.title-logo-heading::after {
  background: linear-gradient(90deg, rgba(201, 151, 56, 0.88) 0%, rgba(158, 46, 46, 0.62) 55%, rgba(158, 46, 46, 0) 100%) !important;
}

.title-tagline {
  color: #D8C7A8 !important;
}

.boot-loader {
  background: rgba(20, 17, 15, 0.92) !important;
  border: 1px solid #7D6A52 !important;
  border-radius: 3px !important;
}

.boot-loader-row {
  color: #E2B362 !important;
}

.boot-bar-track {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 5px 10px 5px 10px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/bar_track.png') 39 70 42 69 fill / 5px 10px 5px 10px / 0 stretch !important;
  border-radius: 0 !important;
  height: 18px !important;
}

.boot-bar-fill {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 3px 5px 3px 5px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/bar_fill_primary.png') 25 30 28 28 fill / 3px 5px 3px 5px / 0 stretch !important;
}

.title-secondary-grid .btn-obsidian-action .notify-badge {
  top: -6px !important;
  right: 2px !important;
  left: auto !important;
  transform: none !important;
}

.title-currencies-strip {
  border-top: 1px solid rgba(163, 139, 103, 0.34) !important;
  padding-top: 10px !important;
}

.title-currencies-strip .currency-chip {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 8px 14px 8px 14px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/hud_pill.png') 41 80 42 79 fill / 8px 14px 8px 14px / 0 stretch !important;
  color: #EFE5CE !important;
  padding: 0 4px !important;
  overflow: visible !important;
}

.title-currencies-strip .currency-chip .hud-icon-sm {
  width: 24px !important;
  height: 24px !important;
  margin: -6px 2px -6px -8px !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
}

.currency-chip-sub {
  color: #B6A489 !important;
}

/* ==========================================================================
 * 3. FULL-BLEED 100% BATTLE ARENA + FLOATING TOP HUD (ZERO SAAS WALLS!)
 * ========================================================================== */

#game-screen {
  position: relative !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #0E0C0B !important;
  overflow: hidden !important;
}

/* Floating Non-SaaS Top HUD Bar — Transparent Center Over Moonlit Cathedral */
#top-hud-bar.top-hud-bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 6px 12px 2px !important;
  background: linear-gradient(180deg, rgba(12, 10, 9, 0.90) 0%, rgba(12, 10, 9, 0.48) 70%, rgba(12, 10, 9, 0) 100%) !important;
  border-bottom: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  z-index: 32 !important;
  pointer-events: none !important;
}

.hud-left-cluster,
.hud-right-cluster {
  pointer-events: auto !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 5px !important;
  min-width: 0 !important;
}

/* Top HUD 9-Slice Act Badge & Currency Pills with Pop-Out Icons */
.hud-act-badge {
  box-sizing: border-box !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 8px 14px 8px 14px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/hud_pill.png') 41 80 42 79 fill / 8px 14px 8px 14px / 0 stretch !important;
  border-radius: 0 !important;
  height: 34px !important;
  padding: 0 4px !important;
  color: #EFE5CE !important;
  font-size: 0.74rem !important;
  letter-spacing: 0.05em;
  overflow: visible !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.75));
}

.hud-act-badge .hud-icon-xs {
  width: 24px !important;
  height: 24px !important;
  margin: -6px 1px -6px -10px !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
}

/* 9-Slice Carved Iron HP Bar + Wax-Crimson Ember Fill */
.hud-hp-track {
  box-sizing: border-box !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 6px 12px 6px 12px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/bar_track.png') 39 70 42 69 fill / 6px 12px 6px 12px / 0 stretch !important;
  border-radius: 0 !important;
  width: 144px !important;
  height: 28px !important;
  overflow: hidden !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.78));
}

.hud-hp-fill {
  top: 0 !important;
  bottom: 0 !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 4px 6px 4px 6px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/bar_fill_primary.png') 25 30 28 28 fill / 4px 6px 4px 6px / 0 stretch !important;
}

.hud-hp-text {
  color: #FFF8EC !important;
  font-size: 0.74rem !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.98) !important;
}

.hud-stat-pill,
.hud-currency-pill {
  box-sizing: border-box !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 8px 14px 8px 14px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/hud_pill.png') 41 80 42 79 fill / 8px 14px 8px 14px / 0 stretch !important;
  border-radius: 0 !important;
  height: 34px !important;
  padding: 0 4px 0 2px !important;
  color: #F4E0B0 !important;
  font-size: 0.78rem !important;
  overflow: visible !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.75));
}

.hud-stat-pill img,
.hud-currency-pill img {
  width: 26px !important;
  height: 26px !important;
  margin: -7px 1px -7px -10px !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.88));
}

.shield-pill {
  color: #BBE2DD !important;
}

.shards-pill {
  color: #E8D2E8 !important;
}

/* Top HUD Right Controls — Tiered Hierarchy */
.btn-hud-compact {
  height: 31px !important;
  padding: 0 8px !important;
  font-size: 0.72rem !important;
  gap: 4px !important;
}

.btn-hud-compact .hud-icon-xs {
  width: 18px !important;
  height: 18px !important;
  margin: -2px 0 -2px -2px !important;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85));
}

/* Inline notify badges inside Top HUD buttons so zero overlap / zero clipping at 1280x720 */
.btn-hud-compact .notify-badge {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  margin-left: 2px !important;
  min-width: 15px !important;
  height: 15px !important;
  padding: 0 3px !important;
  font-size: 9px !important;
  line-height: 12px !important;
  flex: 0 0 auto !important;
  animation: none !important;
}

/* Shop CTA in Top HUD -> Forged Antique Bronze Primary 9-Slice */
#btn-hud-shop.btn-hud-gold {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 8px 13px 8px 13px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_primary.png') 82 70 73 83 fill / 8px 13px 8px 13px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: 34px !important;
  padding: 0 6px !important;
  color: #FFF9EC !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95) !important;
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.78)) !important;
}

#btn-hud-shop.btn-hud-gold:hover {
  filter: brightness(1.14) drop-shadow(0 4px 10px rgba(201, 138, 50, 0.45)) !important;
}

#btn-quit-game.btn-hud-compact {
  height: 34px !important;
  padding: 0 6px !important;
}

.btn-hud-icon {
  width: 30px !important;
  height: 30px !important;
  flex-shrink: 0 !important;
}

/* Full-Bleed Playfield Container — battle-canvas fills 100% of 16:9 Viewport! */
#command-desk-grid.command-desk-grid {
  position: relative !important;
  display: block !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #0E0C0B !important;
  overflow: hidden !important;
}

#col-center-stage.col-center {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: block !important;
  padding: 0 !important;
  pointer-events: none !important;
}

#battle-stage-wrap.battle-stage-wrap {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border: none !important;
  border-radius: 0 !important;
  background: #0E0C0B !important;
  z-index: 1 !important;
  pointer-events: auto !important;
}

/* Subtle top/bottom vignette scrim so floating HUD & fanned parchment cards read sharply */
#battle-stage-wrap.battle-stage-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(
    180deg,
    rgba(12, 10, 9, 0.56) 0%,
    rgba(12, 10, 9, 0.04) 10%,
    rgba(12, 10, 9, 0) 60%,
    rgba(12, 10, 9, 0.68) 78%,
    rgba(10, 8, 7, 0.92) 100%
  );
}

#stage-banner-toast.stage-banner-toast {
  top: 58px !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 10px 26px 10px 24px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/ribbon_header.png') 58 237 60 106 fill / 10px 26px 10px 24px / 0 stretch !important;
  border-radius: 0 !important;
  color: #FFF4D6 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
  z-index: 25 !important;
}

#ether-chain-pill.ether-chain-pill {
  bottom: calc(clamp(234px, 34vh, 356px) + 12px) !important;
  background: linear-gradient(90deg, #5C2816 0%, #8A4A1F 50%, #5C2816 100%) !important;
  border: 1.5px solid #E2B362 !important;
  color: #FFF6DC !important;
  z-index: 24 !important;
}

.stage-status-tooltip {
  background: rgba(20, 17, 15, 0.96) !important;
  border: 1.5px solid #A38B67 !important;
  border-radius: 3px !important;
  color: #EFE5CE !important;
  z-index: 26 !important;
}

.explore-stage-cta {
  padding-bottom: 30vh !important;
  background: rgba(10, 8, 7, 0.45) !important;
}

.explore-cta-card.frame-panel-9s {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 22px 24px 26px 24px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_modal.png') 62 63 88 63 fill / 22px 24px 26px 24px / 0 stretch !important;
  border-radius: 0 !important;
}

/* ==========================================================================
 * 4. SLIM FLOATING DIEGETIC SIDE PLAQUES (LEFT STAR ATLAS & RIGHT SCRY)
 * ========================================================================== */

#col-left-map.col-left,
#col-right-scry.col-right {
  position: fixed !important;
  top: 52px !important;
  bottom: 10px !important;
  z-index: 16 !important;
  pointer-events: auto !important;
  background: rgba(18, 15, 13, 0.80) !important;
  background-clip: padding-box !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 14px 15px 12px 15px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_subpanel.png') 78 92 55 92 fill / 14px 15px 12px 15px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.85)) !important;
  padding: 2px 4px !important;
  gap: 6px !important;
  overflow: hidden !important;
}

#col-left-map.col-left {
  left: 10px !important;
  bottom: 36px !important;
  width: clamp(204px, 16.2vw, 282px) !important;
}

#col-right-scry.col-right {
  right: 10px !important;
  width: clamp(212px, 17vw, 298px) !important;
}

.panel-header-row {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 5px !important;
}

.panel-title-stack {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 9px 22px 9px 18px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/ribbon_header.png') 58 237 60 106 fill / 9px 22px 9px 18px / 0 stretch !important;
  text-align: center;
  padding: 0 2px !important;
}

.panel-heading {
  color: #EFE5CE !important;
  font-size: 0.84rem !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

.panel-sub {
  color: #C7B89E !important;
  font-size: 0.66rem !important;
  line-height: 1.25;
}

.mini-tab-switch {
  display: grid !important;
  grid-template-columns: 1.38fr 1fr;
  background: rgba(14, 12, 10, 0.88) !important;
  border: 1px solid #5C4D3A !important;
  border-radius: 2px !important;
  padding: 2px !important;
  gap: 2px;
}

.mini-tab {
  color: #B6A489 !important;
  font-size: 0.66rem !important;
  padding: 4px 4px !important;
  border-radius: 2px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-tab.active {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 6px 8px 3px 8px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/tab_active.png') 50 48 23 49 fill / 6px 8px 3px 8px / 0 stretch !important;
  color: #FFF4D6 !important;
  padding: 0 2px !important;
}

.act-pip {
  background: #171411 !important;
  border: 1px solid #4E4133 !important;
  border-radius: 2px !important;
  color: #A3947E !important;
  font-size: 0.64rem !important;
}

.act-pip.current {
  background: rgba(158, 46, 46, 0.68) !important;
  border-color: #D4B47C !important;
  color: #FFF6E0 !important;
}

.act-pip.cleared {
  background: rgba(163, 139, 103, 0.25) !important;
  border-color: #A38B67 !important;
  color: #EFE5CE !important;
}

.hex-map-viewport {
  background:
    radial-gradient(circle at 50% 18%, rgba(163, 112, 48, 0.14), transparent 55%),
    rgba(16, 13, 11, 0.88) !important;
  border: 1.5px solid #5C4D3A !important;
  border-radius: 2px !important;
  box-shadow: inset 0 0 0 1px rgba(239, 229, 206, 0.06), inset 0 10px 24px rgba(0, 0, 0, 0.72);
}

/* Carved Crypt Stone Map Nodes (9-Slice slot_tile) */
.hex-node-btn {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 5px 7px 5px 8px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/slot_tile.png') 15 42 14 70 fill / 5px 7px 5px 8px / 0 stretch !important;
  border-radius: 0 !important;
  min-width: 56px !important;
  max-width: 74px !important;
  height: 40px !important;
  padding: 1px 3px !important;
  font-size: 0.66rem !important;
  color: #DDD0B8 !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
}

.hex-node-btn.current {
  color: #FFF4D2 !important;
  filter: drop-shadow(0 0 10px rgba(226, 179, 98, 0.72)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.9)) !important;
}

.hex-node-btn.reachable {
  color: #FFE4A3 !important;
  animation: hexPulseBronze 1.7s infinite ease-in-out !important;
}

.hex-node-btn.reachable:hover {
  transform: translate(-50%, -54%) scale(1.06) !important;
  filter: brightness(1.18) drop-shadow(0 0 12px rgba(201, 138, 50, 0.82)) !important;
}

@keyframes hexPulseBronze {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(201, 138, 50, 0.50)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85)); }
  50% { filter: drop-shadow(0 0 12px rgba(242, 208, 139, 0.88)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85)); }
}

.hex-pierce-tag {
  background: #7A1E1E !important;
  border: 1px solid #E8B8A8 !important;
  color: #FFF0EE !important;
}

.map-legend-strip {
  color: #B6A489 !important;
  font-size: 0.65rem !important;
}

.pierce-warn-legend {
  color: #E8A6A6 !important;
}

.seed-mono {
  color: #9A8A74 !important;
}

.gate-badge-card {
  background: rgba(20, 17, 15, 0.92) !important;
  border: 1px solid #7D6A52 !important;
  border-radius: 2px !important;
}

.gate-lv-kicker {
  color: #D4B47C !important;
}

.gate-lv-big {
  color: #FFF4D2 !important;
}

.hazard-mini-pill {
  background: #171411 !important;
  border: 1px solid #4E4133 !important;
  border-radius: 2px !important;
  color: #D8C7A8 !important;
}

.hazard-mini-pill.active {
  border-color: #B93535 !important;
  background: rgba(74, 22, 22, 0.72) !important;
  color: #FDE8E8 !important;
}

/* Right Plaque: Scry, Lunar Pity, Relics & Chronicle Log */
.section-head-compact {
  border-bottom: 1px solid rgba(163, 139, 103, 0.28);
  padding-bottom: 3px;
}

.section-title-sm {
  color: #EFE5CE !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.06em;
}

.scry-counts-pill {
  color: #E2B362 !important;
  font-size: 0.66rem !important;
}

.scry-section,
.relics-section {
  border-bottom: 1px solid rgba(163, 139, 103, 0.22) !important;
}

.scry-row {
  grid-template-columns: 16px 40px minmax(0, 1fr) 54px !important;
  font-size: 0.69rem !important;
  gap: 4px !important;
}

.scry-el-name {
  color: #D8C7A8 !important;
}

.scry-pct {
  color: #EFE5CE !important;
  font-size: 0.67rem !important;
}

.scry-bar-bg {
  background: #120F0D !important;
  border: 1px solid #4E4133 !important;
  border-radius: 2px !important;
  height: 7px !important;
}

.fill-fire { background: linear-gradient(90deg, #9E2E2E, #D96B27) !important; }
.fill-water { background: linear-gradient(90deg, #215E58, #4CA39A) !important; }
.fill-earth { background: linear-gradient(90deg, #5A6B20, #A4A838) !important; }
.fill-ether { background: linear-gradient(90deg, #7A4B8A, #D4A44C) !important; }

.next-scry-box {
  background: rgba(16, 13, 11, 0.90) !important;
  border: 1px solid #5C4D3A !important;
  border-radius: 2px !important;
  padding: 4px 6px !important;
  font-size: 0.68rem !important;
}

.next-scry-label {
  color: #C7B89E !important;
}

.scry-odds-label {
  color: #A3947E !important;
  font-size: 0.58rem !important;
}

.scry-odds-strip {
  background: rgba(16, 13, 11, 0.88) !important;
  border: 1px solid #4E4133 !important;
  border-radius: 2px !important;
  color: #E8D7B7 !important;
  font-size: 0.64rem !important;
}

.pity-meter-box {
  background: rgba(20, 17, 14, 0.92) !important;
  border: 1px solid #6E5C45 !important;
  border-radius: 2px !important;
  padding: 6px 8px !important;
}

.pity-meter-box.primed {
  border-color: #E2B362 !important;
  background: linear-gradient(180deg, rgba(138, 86, 26, 0.42) 0%, rgba(44, 24, 16, 0.86) 100%) !important;
}

.pity-label-wrap {
  color: #E2B362 !important;
  font-size: 0.7rem !important;
}

.pity-badge {
  background: #14110F !important;
  border: 1px solid #7D6A52 !important;
  border-radius: 2px !important;
  color: #F4E0B0 !important;
  font-size: 0.66rem !important;
}

.pity-track {
  box-sizing: border-box !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 4px 8px 4px 8px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/bar_track.png') 39 70 42 69 fill / 4px 8px 4px 8px / 0 stretch !important;
  border-radius: 0 !important;
  height: 14px !important;
}

.pity-bar-fill {
  background: linear-gradient(90deg, #9E2E2E 0%, #C98A32 60%, #F2D08B 100%) !important;
}

.pity-hint {
  color: #B6A489 !important;
  font-size: 0.64rem !important;
}

.link-mini-btn {
  background: linear-gradient(180deg, #2A241E 0%, #171411 100%) !important;
  border: 1px solid #7D6A52 !important;
  border-radius: 2px !important;
  color: #EFE5CE !important;
  font-family: var(--font-display);
  font-size: 0.64rem !important;
}

.link-mini-btn:hover {
  border-color: #E2B362 !important;
  color: #FFF8E6 !important;
}

/* Relics & Runes -> Vault Carved Slot Tiles */
.artifact-chip {
  width: 34px !important;
  height: 34px !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 4px 5px 4px 6px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/slot_tile.png') 15 42 14 70 fill / 4px 5px 4px 6px / 0 stretch !important;
  border-radius: 0 !important;
}

.artifact-chip.is-rune {
  filter: drop-shadow(0 0 5px rgba(201, 151, 56, 0.55));
}

.combat-log-list {
  background: rgba(14, 11, 9, 0.90) !important;
  border: 1px solid #4E4133 !important;
  border-radius: 2px !important;
  color: #DDD0B8 !important;
  font-size: 0.67rem !important;
  scrollbar-color: #7D6A52 #14110F;
}

.combat-log-list li {
  border-left: 2px solid #A38B67;
  padding-left: 6px;
  border-bottom: 1px dashed rgba(163, 139, 103, 0.18) !important;
}

/* ==========================================================================
 * 5. FLOATING COST POOL + FANNED ILLUSTRATED TORN-PARCHMENT SPELL CARDS!
 * ========================================================================== */

.next-scry-pips .cost-element-pill,
.next-scry-pips .spell-cost-pip {
  height: 22px !important;
  min-width: 24px !important;
  padding: 0 6px !important;
  font-size: 0.68rem !important;
  border-width: 1.5px !important;
  box-shadow: none !important;
}

.next-scry-pips .cost-icon {
  width: 14px !important;
  height: 14px !important;
  margin: 0 2px 0 0 !important;
}

#dev-f2-pill {
  background: rgba(20, 17, 14, 0.92) !important;
  border: 1px solid #8A7354 !important;
  color: #D4B47C !important;
  border-radius: 3px !important;
  padding: 3px 8px !important;
  bottom: 6px !important;
  left: 10px !important;
}

#cast-tray-wrap.cast-tray-wrap {
  position: fixed !important;
  left: calc(clamp(204px, 16.2vw, 282px) + 18px) !important;
  right: calc(clamp(212px, 17vw, 298px) + 18px) !important;
  bottom: 6px !important;
  height: clamp(264px, 35.8vh, 372px) !important;
  z-index: 18 !important;
  pointer-events: none !important;
  background: transparent !important;
  border: none !important;
  border-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  overflow: visible !important;
}

/* Compact Forged-Stone Cost Pool Command Plaque */
#cost-pool-bar.cost-pool-bar {
  pointer-events: auto !important;
  background: rgba(20, 17, 14, 0.92) !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 10px 14px 8px 14px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_subpanel.png') 78 92 55 92 fill / 10px 14px 8px 14px / 0 stretch !important;
  border-radius: 0 !important;
  padding: 2px 8px 4px !important;
  gap: 4px !important;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.85));
}

.cost-pool-main-row {
  min-height: 36px !important;
  gap: 8px !important;
}

.turn-pill-box {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 7px 12px 7px 12px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/hud_pill.png') 41 80 42 79 fill / 7px 12px 7px 12px / 0 stretch !important;
  border-radius: 0 !important;
  padding: 0 4px !important;
}

.turn-num {
  color: #F4E0B0 !important;
  font-family: var(--font-display) !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.05em;
}

/* Elemental Cost Pool Pips — Matte Stone + Warm Metal Accents (NO neon cyan) */
.cost-element-pill {
  height: 30px !important;
  padding: 0 8px 0 4px !important;
  border-radius: 3px !important;
  background: #171411 !important;
  border: 1.5px solid #5C4D3A !important;
  color: #DDD0B8 !important;
  overflow: visible !important;
}

.cost-element-pill .cost-icon {
  width: 24px !important;
  height: 24px !important;
  margin: -4px 1px -4px -6px !important;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85));
}

.cost-fire.has-tokens {
  border-color: #C95B2B !important;
  background: rgba(110, 38, 16, 0.68) !important;
  color: #FDE2C8 !important;
}

.cost-water.has-tokens {
  border-color: #469991 !important;
  background: rgba(26, 66, 62, 0.72) !important;
  color: #DDF5F2 !important;
}

.cost-earth.has-tokens {
  border-color: #9A9E36 !important;
  background: rgba(64, 68, 20, 0.68) !important;
  color: #EFF4C2 !important;
}

.cost-ether.has-tokens {
  border-color: #C99738 !important;
  background: rgba(74, 34, 84, 0.72) !important;
  color: #F5E2FF !important;
}

.cost-wild-tag {
  background: rgba(158, 46, 46, 0.72) !important;
  border: 1px solid #D4B47C !important;
  color: #FFF4DC !important;
  border-radius: 2px !important;
}

.cost-moon,
.cost-moon.has-tokens {
  border-color: #C99738 !important;
  background: rgba(72, 50, 18, 0.72) !important;
  color: #FFF4CC !important;
}

.cost-hazard {
  border-color: #C84B4B !important;
  background: rgba(112, 24, 24, 0.82) !important;
  color: #FDE8E8 !important;
}

/* END TURN Hero CTA */
#btn-end-turn.btn-end-turn {
  min-height: 40px !important;
  border-width: 11px 16px 11px 16px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_primary.png') 82 70 73 83 fill / 11px 16px 11px 16px / 0 stretch !important;
  padding: 0 10px !important;
  font-size: 0.82rem !important;
}

.tactical-actions-strip {
  border-top: 1px solid rgba(163, 139, 103, 0.24) !important;
  padding-top: 3px !important;
  gap: 6px !important;
}

.btn-tactical-mini {
  min-height: 25px !important;
  padding: 2px 9px !important;
  font-size: 0.68rem !important;
}

.btn-tactical-mini.flask-ready {
  border-color: #5FA59E !important;
  background: linear-gradient(180deg, #255751 0%, #163632 100%) !important;
  color: #E2F7F4 !important;
}

.tactical-cnt-badge {
  background: #14110F !important;
  border: 1px solid #8A7354 !important;
  color: #F4E0B0 !important;
  border-radius: 2px !important;
}

/* Transmute Popover -> Vault Frame Subpanel */
.transmute-popover {
  background: rgba(20, 17, 14, 0.97) !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 14px 16px 12px 16px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_subpanel.png') 78 92 55 92 fill / 14px 16px 12px 16px / 0 stretch !important;
  border-radius: 0 !important;
}

.transmute-pop-title {
  color: #EFE5CE !important;
}

.transmute-pop-close {
  width: 26px !important;
  height: 26px !important;
  border: none !important;
  background: url('../assets/ui/vault_inked_parchment_roguelite/btn_close.png') center / contain no-repeat !important;
  font-size: 0 !important;
  color: transparent !important;
}

/* ==========================================================================
 * 6. THE STAR OF THE SHOW: FANNED AGED-PARCHMENT ILLUSTRATED SPELL CARDS!
 * ========================================================================== */

#spell-circle-bar.spell-circle-bar {
  pointer-events: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: safe center !important;
  gap: 11px !important;
  padding: 18px 16px 10px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

/* Slim 9-12px 9-slice parchment frames protect interior width at 1280x720 & 1920x1080! */
.spell-card {
  position: relative !important;
  box-sizing: border-box !important;
  width: clamp(136px, 9.8vw, 174px) !important;
  min-width: 112px !important;
  flex: 0 1 166px !important;
  aspect-ratio: auto !important;
  height: clamp(178px, 25vh, 254px) !important;
  max-height: calc(100% - 6px) !important;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 9px 10px 10px 10px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_common.png') 48 56 46 63 fill / 9px 10px 10px 10px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 5px 5px 3px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  gap: 3px !important;
  color: var(--uiv-ink-dark) !important;
  overflow-x: clip !important;
  overflow-y: visible !important;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.88));
  transform-origin: center bottom;
  transition: translate 0.16s cubic-bezier(0.22, 1, 0.36, 1),
              rotate 0.16s cubic-bezier(0.22, 1, 0.36, 1),
              scale 0.16s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.16s ease !important;
}

/* Organic Hand-Held Fan Arc using independent CSS rotate & translate (preserves TrackBUIMotion scale!) */
#spell-circle-bar:not(.hand-dense):not(.hand-crowded) .spell-card:nth-child(1) {
  rotate: -2.8deg;
  translate: 0 2px;
}
#spell-circle-bar:not(.hand-dense):not(.hand-crowded) .spell-card:nth-child(2) {
  rotate: -1.0deg;
  translate: 0 -1px;
}
#spell-circle-bar:not(.hand-dense):not(.hand-crowded) .spell-card:nth-child(3) {
  rotate: 1.0deg;
  translate: 0 -1px;
}
#spell-circle-bar:not(.hand-dense):not(.hand-crowded) .spell-card:nth-child(4) {
  rotate: 2.8deg;
  translate: 0 2px;
}
#spell-circle-bar:not(.hand-dense):not(.hand-crowded) .spell-card:nth-child(5) {
  rotate: 4.0deg;
  translate: 0 5px;
}

/* Rarity 9-Slice Torn Parchment Tiers (slim 10-12px borders!) */
.spell-card.rarity-rare {
  border-width: 11px 11px 11px 11px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_rare.png') 75 85 75 85 fill / 11px 11px 11px 11px / 0 stretch !important;
}

.spell-card.rarity-epic,
.spell-card.dual-spell-card {
  border-width: 11px 11px 11px 11px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_epic.png') 80 94 79 94 fill / 11px 11px 11px 11px / 0 stretch !important;
}

.spell-card.rarity-legendary,
.spell-card.prestige-gilded {
  border-width: 12px 11px 12px 11px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_legendary.png') 107 96 105 95 fill / 12px 11px 12px 11px / 0 stretch !important;
}

/* Warm Antique Bronze Aura on Affordable Cards — ZERO CYAN! */
.spell-card.affordable {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.90)) drop-shadow(0 0 8px rgba(201, 138, 50, 0.44)) !important;
}

.spell-card.affordable:hover {
  rotate: 0deg !important;
  translate: 0 -18px !important;
  scale: 1.07 !important;
  transform: none !important;
  z-index: 20 !important;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.94)) drop-shadow(0 0 14px rgba(226, 179, 98, 0.68)) !important;
}

.spell-card.unaffordable {
  opacity: 0.84 !important;
  filter: brightness(0.84) saturate(0.76) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.82)) !important;
}

.spell-card.on-cooldown,
.spell-card.expired-spell {
  opacity: 0.88 !important;
  filter: saturate(0.38) brightness(0.78) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.82)) !important;
}

/* Corner-Floating Cost Seals & Hotkey Crest (strictly within horizontal bounds so scrollWidth === clientWidth!) */
.spell-cost-row {
  position: absolute !important;
  top: -12px !important;
  left: 2px !important;
  max-width: calc(100% - 26px) !important;
  z-index: 9 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  flex-wrap: nowrap !important;
}

.spell-cost-pip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  min-width: 26px !important;
  height: 23px !important;
  padding: 0 6px !important;
  border-radius: 999px !important;
  border: 2px solid #C99738 !important;
  background: radial-gradient(circle at 35% 30%, #3A322C 0%, #191512 80%) !important;
  color: #FFF5DC !important;
  font-family: var(--font-display) !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.85) !important;
}

.spell-cost-pip.cost-pip-Fire {
  background: radial-gradient(circle at 35% 30%, #A8341E 0%, #57180E 85%) !important;
  border-color: #E8B168 !important;
  color: #FFF4E4 !important;
}

.spell-cost-pip.cost-pip-Water {
  background: radial-gradient(circle at 35% 30%, #2B726B 0%, #143B37 85%) !important;
  border-color: #B4DDD8 !important;
  color: #EEFAF8 !important;
}

.spell-cost-pip.cost-pip-Earth {
  background: radial-gradient(circle at 35% 30%, #646A22 0%, #343810 85%) !important;
  border-color: #D4CE78 !important;
  color: #FBF9DD !important;
}

.spell-cost-pip.cost-pip-Ether {
  background: radial-gradient(circle at 35% 30%, #6B3C7A 0%, #341A3D 85%) !important;
  border-color: #E2B362 !important;
  color: #FAF0FF !important;
}

.spell-hotkey-crest {
  position: absolute !important;
  top: -10px !important;
  right: 2px !important;
  left: auto !important;
  transform: none !important;
  z-index: 9 !important;
  min-width: 19px !important;
  height: 19px !important;
  padding: 0 3px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 3px !important;
  background: #1C1714 !important;
  border: 1.5px solid #B89B6E !important;
  color: #EFE5CE !important;
  font-size: 0.64rem !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.82);
}

.spell-reinforced-star {
  top: 10px !important;
  right: 2px !important;
  z-index: 9 !important;
  background: #8B4A14 !important;
  border: 1.5px solid #F4E0B0 !important;
  color: #FFF7DF !important;
}

.spell-enchant-tag {
  top: 10px !important;
  left: 2px !important;
  z-index: 9 !important;
  background: #5C214A !important;
  border: 1px solid #E8C7A8 !important;
  color: #FFF2E8 !important;
}

.spell-cd-overlay {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  max-width: calc(100% - 6px) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 0.58rem !important;
  line-height: 1.1 !important;
  padding: 2px 6px !important;
  transform: translate(-50%, -50%) !important;
  z-index: 6 !important;
  background: linear-gradient(90deg, #6E1D1D 0%, #9E2E2E 100%) !important;
  border: 1.5px solid #EFE5CE !important;
  color: #FFF6E8 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.82) !important;
}

.spell-card.on-cooldown .spell-card-art-img {
  opacity: 0.45 !important;
}

/* Dark Ink Title on Bright Parchment (#1C1510 on #EBD5AC -> WCAG ~12.8:1!) */
.spell-card-title {
  font-family: var(--font-display) !important;
  font-weight: 800 !important;
  font-size: clamp(0.68rem, 0.78vw, 0.82rem) !important;
  color: #1C1510 !important;
  text-shadow: 0 1px 0 rgba(255, 250, 238, 0.55) !important;
  line-height: 1.12 !important;
  margin: 6px 2px 0 !important;
  max-width: 100% !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  -webkit-line-clamp: 1 !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

/* 41% Card Illustration Window (meets >= 0.35 heightRatio Spatial Balance while keeping full mechanics copy visible with zero ellipsis!) */
.spell-card-art-box {
  position: relative;
  flex: 0 0 41% !important;
  height: 41% !important;
  min-height: 66px !important;
  max-height: 98px !important;
  width: 92% !important;
  margin: 1px auto !important;
  border-radius: 3px !important;
  border: 1.5px solid #7D603D !important;
  background:
    radial-gradient(circle at 50% 44%, rgba(84, 62, 42, 0.58) 0%, rgba(28, 21, 16, 0.94) 84%) !important;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.78), 0 1px 0 rgba(255, 248, 232, 0.42);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1px !important;
  overflow: hidden !important;
}

.spell-card-art-box.el-fire {
  background: radial-gradient(circle at 50% 45%, rgba(168, 62, 26, 0.52) 0%, rgba(32, 17, 13, 0.95) 84%) !important;
  border-color: #8E4728 !important;
}

.spell-card-art-box.el-water {
  background: radial-gradient(circle at 50% 45%, rgba(46, 133, 125, 0.48) 0%, rgba(18, 30, 29, 0.95) 84%) !important;
  border-color: #366D67 !important;
}

.spell-card-art-box.el-earth {
  background: radial-gradient(circle at 50% 45%, rgba(128, 124, 44, 0.48) 0%, rgba(28, 25, 15, 0.95) 84%) !important;
  border-color: #7D7636 !important;
}

.spell-card-art-box.el-ether {
  background: radial-gradient(circle at 50% 45%, rgba(126, 74, 140, 0.48) 0%, rgba(28, 18, 32, 0.95) 84%) !important;
  border-color: #7D5A82 !important;
}

.spell-card-art-img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
}

/* Dark Ink Body Copy & Estimate Pill on Parchment — full mechanics visible, ZERO ellipsis clamping! */
.spell-card-desc {
  display: block !important;
  font-size: clamp(0.60rem, 0.65vw, 0.70rem) !important;
  font-weight: 700 !important;
  color: #2A1C12 !important;
  text-shadow: none !important;
  line-height: 1.15 !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
  flex: 1 1 auto !important;
  padding: 0 2px;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

.spell-live-est {
  margin: 0 auto !important;
  padding: 1px 5px !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  border-radius: 2px !important;
  background: #231912 !important;
  border: 1px solid #8A6F4E !important;
  color: #F4E0B0 !important;
  font-size: 0.62rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
}

.spell-card-footer {
  font-size: 0.61rem !important;
  font-weight: 800 !important;
  color: #3E2A1C !important;
  border-top: 1px solid rgba(62, 42, 28, 0.30) !important;
  padding-top: 2px !important;
  letter-spacing: 0.03em;
  max-width: 100% !important;
  min-width: 0 !important;
  gap: 2px !important;
  overflow: hidden !important;
}

.spell-card-footer > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spell-footer-cd-active {
  color: #9E2E2E !important;
  font-weight: 900 !important;
}

/* Dense / Crowded Hands (6-10 cards) */
.spell-circle-bar.hand-dense .spell-card {
  border-width: 9px 9px 9px 9px !important;
  height: clamp(182px, 24vh, 248px) !important;
}

.spell-circle-bar.hand-dense .spell-card-art-box {
  flex: 0 0 27% !important;
  height: 27% !important;
  min-height: 40px !important;
  max-height: 58px !important;
}

.spell-circle-bar.hand-crowded .spell-card {
  border-width: 8px 8px 8px 8px !important;
  height: clamp(174px, 23vh, 236px) !important;
}

.spell-circle-bar.hand-crowded .spell-card-art-box {
  flex: 0 0 24% !important;
  height: 24% !important;
  min-height: 34px !important;
  max-height: 48px !important;
}

.spell-circle-bar.hand-crowded .spell-card-desc {
  font-size: 0.56rem !important;
  line-height: 1.12 !important;
}

/* ==========================================================================
 * 7. ALL MODALS — OBSIDIAN BRONZE FRAME + DIAMOND CLOSE X + PARCHMENT DRAFT
 * ========================================================================== */

.modal-scrim {
  background: rgba(8, 6, 5, 0.86) !important;
  z-index: 65 !important;
}

.modal-card.frame-panel-9s {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 24px 24px 32px 24px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_modal.png') 62 63 88 63 fill / 24px 24px 32px 24px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 28px 56px rgba(0, 0, 0, 0.94)) !important;
  padding: 6px 14px !important;
  color: #EFE5CE !important;
}

.modal-header-bar {
  border-bottom: 1px solid rgba(163, 139, 103, 0.34);
  padding-bottom: 10px;
}

.modal-heading {
  color: #EFE5CE !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.92) !important;
}

.modal-sub {
  color: #C7B89E !important;
}

.modal-sub-pill {
  background: #171411 !important;
  border: 1px solid #A38B67 !important;
  border-radius: 2px !important;
  color: #F4E0B0 !important;
}

.modal-lead {
  color: #DDD0B8 !important;
}

/* Replace generic modal close button with Vault Diamond Stone Close X (preserves listeners!) */
.btn-modal-close {
  width: 38px !important;
  height: 38px !important;
  border-radius: 0 !important;
  border: none !important;
  background: url('../assets/ui/vault_inked_parchment_roguelite/btn_close.png') center / contain no-repeat !important;
  box-shadow: none !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
}

.btn-modal-close .modal-close-svg {
  display: none !important;
}

.btn-modal-close:hover {
  transform: scale(1.09) !important;
  filter: brightness(1.16) drop-shadow(0 4px 10px rgba(201, 138, 50, 0.48)) !important;
}

/* Modal Tabs -> Carved Stone + Vault Active Tab */
.shop-tab-btn {
  background: linear-gradient(180deg, #25201C 0%, #151210 100%) !important;
  border: 1.5px solid #5C4D3A !important;
  border-radius: 2px !important;
  color: #C7B89E !important;
  overflow: visible !important;
}

.shop-tab-btn.active {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 10px 12px 5px 12px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/tab_active.png') 50 48 23 49 fill / 10px 12px 5px 12px / 0 stretch !important;
  border-radius: 0 !important;
  color: #FFF4D6 !important;
  padding: 2px 10px !important;
}

/* Draft Spell Cards inside Victory Modal -> Illustrated Aged Parchment Rarity Cards */
.victory-kicker {
  color: #E2B362 !important;
}

.loot-pill {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 8px 14px 8px 14px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/hud_pill.png') 41 80 42 79 fill / 8px 14px 8px 14px / 0 stretch !important;
  border-radius: 0 !important;
  color: #F4E0B0 !important;
}

.draft-delta-preview {
  background: rgba(18, 15, 13, 0.94) !important;
  border: 1px solid #7D6A52 !important;
  border-radius: 2px !important;
}

.delta-chip {
  background: #14110F !important;
  border: 1px solid #5C4D3A !important;
  border-radius: 2px !important;
}

.delta-chip.up { border-color: #3D8B84 !important; color: #9DE2DB !important; }
.delta-chip.down { border-color: #B93535 !important; color: #F5B2B2 !important; }

.draft-spell-card {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 12px 13px 12px 13px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_common.png') 48 56 46 63 fill / 12px 13px 12px 13px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 6px 8px !important;
  min-height: 270px !important;
  gap: 6px !important;
  color: #1C1510 !important;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.85));
}

.draft-spell-card.rarity-rare {
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_rare.png') 75 85 75 85 fill / 12px 13px 12px 13px / 0 stretch !important;
}

.draft-spell-card.rarity-epic,
.draft-spell-card.dual-spell-card {
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_epic.png') 80 94 79 94 fill / 12px 13px 12px 13px / 0 stretch !important;
}

.draft-spell-card.rarity-legendary {
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_legendary.png') 107 96 105 95 fill / 13px 13px 13px 13px / 0 stretch !important;
}

.draft-spell-card:hover {
  transform: translateY(-6px) scale(1.02) !important;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.92)) drop-shadow(0 0 14px rgba(201, 138, 50, 0.58)) !important;
}

.draft-card-art-box {
  height: 112px !important;
  flex: 0 0 112px !important;
}

.draft-rarity-ribbon {
  background: #231912 !important;
  border: 1px solid #A38B67 !important;
  border-radius: 2px !important;
  color: #F4E0B0 !important;
}

.draft-spell-name {
  color: #1C1510 !important;
  text-shadow: 0 1px 0 rgba(255, 250, 238, 0.55) !important;
}

.draft-spell-desc {
  color: #3E2A1C !important;
  font-weight: 700 !important;
}

.draft-bag-inject-box {
  background: rgba(28, 21, 16, 0.92) !important;
  border: 1px solid #8A6F4E !important;
  border-radius: 2px !important;
  color: #EFE5CE !important;
}

/* Modal Sub-Cards (Shop, Atelier, Runes, Campfire, Modes, Codex, Guide) */
.rune-card,
.ware-card,
.atelier-card,
.sku-card,
.campfire-choice-card,
.guide-item-card,
.mage-select-card {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 13px 14px 11px 14px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_subpanel.png') 78 92 55 92 fill / 13px 14px 11px 14px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.72));
  padding: 6px 8px !important;
}

.rune-card.equipped,
.atelier-card.equipped,
.mage-select-card.selected {
  filter: drop-shadow(0 0 12px rgba(201, 151, 56, 0.52)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.85)) !important;
}

.sku-art-wrap,
.atelier-preview-wrap {
  background: radial-gradient(circle, rgba(163, 139, 103, 0.22) 0%, rgba(14, 11, 9, 0.92) 100%) !important;
  border: 1px solid #5C4D3A !important;
  border-radius: 3px !important;
}

.sku-badge {
  background: linear-gradient(90deg, #9E2E2E 0%, #C98A32 100%) !important;
  border: 1.5px solid #EFE5CE !important;
  border-radius: 2px !important;
  color: #FFF9EC !important;
}

.event-choice-btn {
  background: linear-gradient(180deg, #27221D 0%, #161311 100%) !important;
  border: 1.5px solid #6E5C45 !important;
  border-radius: 2px !important;
  color: #EFE5CE !important;
}

.event-choice-btn.is-ambush {
  border-color: #B93535 !important;
  background: linear-gradient(180deg, #471A1A 0%, #260E0E 100%) !important;
}

.gate-selector-row input[type='range'] {
  accent-color: #C98A32 !important;
}

.gate-lv-pill,
.gate-stats-preview,
.obsidian-input,
.obsidian-select,
.settings-row,
.mode-controls-bar,
.defeat-stats-box {
  background: rgba(18, 15, 13, 0.94) !important;
  border: 1px solid #6E5C45 !important;
  border-radius: 2px !important;
  color: #EFE5CE !important;
}

.gate-stats-preview {
  color: #E2B362 !important;
}

/* Story Beat & FTUE Tutorial */
.story-portrait-img {
  filter: drop-shadow(0 0 24px rgba(201, 138, 50, 0.42)) !important;
}

.story-parchment-folio,
.ftue-card.frame-panel-9s {
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 18px 20px 22px 20px !important;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_modal.png') 62 63 88 63 fill / 18px 20px 22px 20px / 0 stretch !important;
  border-radius: 0 !important;
}

.story-kicker,
.ftue-step-badge {
  color: #E2B362 !important;
}

.ftue-ring {
  border: 3px solid #E2B362 !important;
  border-radius: 4px !important;
}

/* ==========================================================================
 * 8. RESPONSIVE 1280x720 LAPTOP TUNING (1-ROW HUD, ZERO WRAP, ZERO CLIP)
 * ========================================================================== */

@media (max-width: 1460px) {
  #top-hud-bar.top-hud-bar {
    height: 44px !important;
    min-height: 44px !important;
    padding: 4px 8px 0 !important;
    gap: 4px !important;
  }
  .hud-left-cluster,
  .hud-right-cluster {
    gap: 3px !important;
  }
  .hud-act-badge {
    border-width: 6px 10px 6px 10px !important;
    height: 30px !important;
    font-size: 0.68rem !important;
  }
  .hud-act-badge .hud-icon-xs {
    width: 19px !important;
    height: 19px !important;
    margin: -4px 0 -4px -7px !important;
  }
  .hud-hp-track {
    width: 108px !important;
    height: 24px !important;
    border-width: 5px 9px 5px 9px !important;
  }
  .hud-hp-text {
    font-size: 0.68rem !important;
  }
  .hud-stat-pill,
  .hud-currency-pill {
    border-width: 6px 10px 6px 10px !important;
    height: 30px !important;
    font-size: 0.72rem !important;
  }
  .hud-stat-pill img,
  .hud-currency-pill img {
    width: 21px !important;
    height: 21px !important;
    margin: -5px 0 -5px -7px !important;
  }
  .btn-hud-compact {
    height: 28px !important;
    padding: 0 5px !important;
    font-size: 0.66rem !important;
    gap: 3px !important;
  }
  .btn-hud-compact .hud-icon-xs {
    width: 15px !important;
    height: 15px !important;
  }
  .btn-hud-compact .btn-clip-label {
    max-width: 66px !important;
  }
  #btn-hud-shop.btn-hud-gold {
    border-width: 7px 10px 7px 10px !important;
    height: 30px !important;
    padding: 0 4px !important;
  }
  #btn-quit-game.btn-hud-compact {
    border-width: 7px 10px 7px 10px !important;
    height: 30px !important;
    padding: 0 4px !important;
  }
  .btn-hud-icon {
    width: 27px !important;
    height: 27px !important;
  }

  /* Slimmer side plaques at 720p so center stage & cards stay spacious */
  #col-left-map.col-left {
    top: 46px !important;
    bottom: 34px !important;
    left: 8px !important;
    width: 206px !important;
    border-width: 12px 12px 10px 12px !important;
  }
  .mini-tab {
    font-size: 0.60rem !important;
    padding: 3px 2px !important;
  }
  #col-right-scry.col-right {
    top: 46px !important;
    bottom: 8px !important;
    right: 8px !important;
    width: 216px !important;
    border-width: 12px 12px 10px 12px !important;
  }
  #cast-tray-wrap.cast-tray-wrap {
    left: 222px !important;
    right: 232px !important;
    bottom: 2px !important;
    height: 274px !important;
    gap: 3px !important;
  }
  #cost-pool-bar.cost-pool-bar {
    border-width: 8px 10px 6px 10px !important;
    padding: 1px 6px 2px !important;
    gap: 2px !important;
  }
  .cost-pool-main-row {
    min-height: 28px !important;
  }
  .cost-element-pill {
    height: 24px !important;
    padding: 0 6px 0 3px !important;
    font-size: 0.74rem !important;
  }
  .cost-element-pill .cost-icon {
    width: 19px !important;
    height: 19px !important;
    margin: -3px 1px -3px -5px !important;
  }
  #btn-end-turn.btn-end-turn {
    min-height: 32px !important;
    border-width: 8px 14px 8px 14px !important;
    font-size: 0.74rem !important;
    padding: 0 6px !important;
  }
  .btn-tactical-mini {
    min-height: 20px !important;
    font-size: 0.62rem !important;
    padding: 1px 7px !important;
  }
  #spell-circle-bar.spell-circle-bar {
    padding: 18px 10px 7px !important;
    gap: 8px !important;
  }
  .spell-card {
    width: 146px !important;
    flex: 0 1 148px !important;
    height: 196px !important;
    border-width: 9px 9px 9px 9px !important;
    padding: 3px 4px 2px !important;
    gap: 2px !important;
  }
  .spell-card.rarity-rare,
  .spell-card.rarity-epic,
  .spell-card.dual-spell-card,
  .spell-card.rarity-legendary {
    border-width: 10px 10px 10px 10px !important;
  }
  .spell-cost-row {
    top: -11px !important;
    left: 1px !important;
    max-width: calc(100% - 22px) !important;
  }
  .spell-cost-pip {
    height: 19px !important;
    min-width: 21px !important;
    font-size: 0.63rem !important;
    padding: 0 4px !important;
  }
  .spell-card-title {
    margin: 5px 2px 0 !important;
    font-size: 0.67rem !important;
  }
  .spell-card-art-box {
    flex: 0 0 60px !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 62px !important;
  }
  .spell-card-desc {
    display: block !important;
    font-size: 0.56rem !important;
    line-height: 1.12 !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
    flex: 1 1 auto !important;
    flex-shrink: 1 !important;
  }
  .spell-live-est {
    font-size: 0.56rem !important;
    padding: 0 5px !important;
    line-height: 1.15 !important;
  }
  .spell-card-footer {
    font-size: 0.56rem !important;
  }
}

/* Mobile / Narrow Split-Window Safety Fallback */
@media (max-width: 900px) {
  #col-left-map.col-left,
  #col-right-scry.col-right,
  #cast-tray-wrap.cast-tray-wrap {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
  }
  #battle-stage-wrap.battle-stage-wrap {
    position: relative !important;
    height: 360px !important;
  }
}

/* v1.0.2.0-rc13: Draft entrance click-guard, Full-Circle Banner, Max HP Breakdown & Currency Gain Float */
#hud-hp-cluster {
  cursor: pointer;
}

.draft-entering .draft-spell-card,
.draft-entering .modal-footer-actions {
  pointer-events: none !important;
}

.draft-full-circle-banner {
  margin: 0 0 8px;
  padding: 7px 12px;
  border-radius: 4px;
  background: rgba(48, 34, 14, 0.92);
  border: 1.5px solid #E2B362;
  color: #FDE68A;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.runes-hp-preview {
  margin-top: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #FDE68A;
}

.loot-pill-capstone {
  border-color: #E2B362 !important;
  background: rgba(54, 36, 12, 0.92) !important;
  color: #FDE68A !important;
}

@keyframes currencyGainRise {
  0% { opacity: 0; transform: translateY(4px) scale(0.92); }
  14% { opacity: 1; transform: translateY(0) scale(1.03); }
  80% { opacity: 1; transform: translateY(-6px) scale(1); }
  100% { opacity: 0; transform: translateY(-14px) scale(0.98); }
}

.currency-gain-float {
  position: fixed;
  z-index: 9400;
  pointer-events: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.96);
  border: 1.5px solid #E2B362;
  color: #FDE68A;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85);
  animation: currencyGainRise 2.15s ease-out forwards;
}

/* v1.0.2.0-rc16: Rune Codex card separation, zero-overlap stagger entrance, crisp divider & zero-overflow 720p/1080p fit (#2604, #2730) */
@keyframes runeCardFadeIn {
  0%   { opacity: 0; translate: 0 8px; scale: 0.96 0.96; }
  100% { opacity: 1; translate: 0 0;   scale: 1 1; }
}

#modal-runes .modal-card.modal-xl {
  width: min(1080px, 95vw);
}

#modal-runes .modal-card.frame-panel-9s {
  gap: 10px;
  border-width: 18px 22px 22px 22px !important;
  border-image-width: 18px 22px 22px 22px !important;
  padding: 4px 14px !important;
}

#modal-runes .modal-header-bar {
  padding-bottom: 6px;
}

#modal-runes .runes-codex-grid {
  gap: 14px 16px;
  padding: 4px 2px;
  align-items: stretch;
}

#modal-runes .rune-card {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border-width: 10px 12px 10px 12px !important;
  border-image-width: 10px 12px 10px 12px !important;
  padding: 7px 9px !important;
  gap: 0;
  justify-content: flex-start;
  overflow: hidden !important;
  isolation: isolate;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.62));
}

#modal-runes .rune-card.tb-stagger-in {
  animation: runeCardFadeIn 260ms cubic-bezier(0.22, 1, 0.36, 1) both !important;
}

#modal-runes .rune-card.equipped {
  outline: 1.5px solid rgba(235, 192, 98, 0.85);
  outline-offset: -2px;
  box-shadow: inset 0 0 16px rgba(212, 165, 68, 0.20) !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.72)) !important;
}

#modal-runes .rune-card.locked {
  opacity: 0.78;
}

#modal-runes .rune-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 9px;
}

#modal-runes .rune-card-header {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

#modal-runes .rune-card-header img {
  flex-shrink: 0;
}

#modal-runes .rune-card-header .panel-heading {
  font-size: 0.8rem !important;
  line-height: 1.18;
  min-width: 0;
  overflow-wrap: break-word;
}

#modal-runes .rune-card-desc.panel-sub {
  font-size: 0.7rem !important;
  line-height: 1.3;
  color: #DDD1BC !important;
  margin-top: 1px;
  min-width: 0;
  overflow-wrap: break-word;
}

#modal-runes .rune-card-milestone {
  font-size: 0.67rem;
  line-height: 1.2;
  color: #D9B982;
  margin-top: 2px;
  min-width: 0;
  overflow-wrap: break-word;
}

#modal-runes .rune-card-footer {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid rgba(212, 180, 124, 0.48);
  flex-shrink: 0;
  min-width: 0;
}

#modal-runes .rune-card-btn.btn-primary-9s {
  min-height: 34px !important;
  border-width: 8px 14px 8px 14px !important;
  border-image-width: 8px 14px 8px 14px !important;
  padding: 1px 10px !important;
  font-size: 0.78rem !important;
  line-height: 1.15;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.65)) !important;
}

#modal-runes .rune-card-btn.btn-obsidian-action {
  min-height: 34px !important;
  border-width: 7px 12px 7px 12px !important;
  border-image-width: 7px 12px 7px 12px !important;
  padding: 1px 10px !important;
  font-size: 0.78rem !important;
  line-height: 1.15;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55));
}

#modal-runes .rune-card-btn.btn-obsidian-pill {
  min-height: 34px !important;
  padding: 4px 10px !important;
  font-size: 0.76rem !important;
  line-height: 1.15;
}

/* v1.0.2.0-rc15: Cut-in layering (#2714), Merchant card text wrap/padding (#2716),
 * Victory draft ribbon clarity (#2717) & Chronicle Log right-edge wrap (#2718) */
#cutin-canvas.cutin-canvas {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 52 !important;
  cursor: pointer;
}

#col-right-scry.col-right {
  padding: 4px 8px !important;
}

#col-right-scry.col-right > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

#col-right-scry .section-head-compact {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 4px;
}

#col-right-scry .scry-odds-strip {
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100%;
}

.combat-log-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.combat-log-list {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 6px 10px 6px 8px !important;
  scrollbar-width: thin;
}

.combat-log-list::-webkit-scrollbar {
  width: 5px;
}

.combat-log-list::-webkit-scrollbar-track {
  background: #14110F;
}

.combat-log-list::-webkit-scrollbar-thumb {
  background: #7D6A52;
  border-radius: 3px;
}

.combat-log-list li {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 1px 4px 4px 6px !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  line-height: 1.34;
}

#modal-merchant .merchant-wares-grid {
  gap: 12px;
  align-items: stretch;
}

.merchant-feedback-bar {
  margin: 0 0 10px;
  padding: 7px 12px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  border: 1.5px solid rgba(212, 180, 124, 0.55);
  background: rgba(34, 24, 16, 0.92);
  color: #FDE68A;
}

.merchant-feedback-bar.tone-error {
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(69, 14, 18, 0.94);
  color: #FECACA;
}

.merchant-feedback-bar.tone-ok {
  border-color: rgba(74, 222, 128, 0.65);
  background: rgba(14, 46, 28, 0.94);
  color: #BBF7D0;
}

.merchant-replace-header {
  grid-column: 1 / -1;
  text-align: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(24, 18, 14, 0.85);
  border: 1px solid rgba(212, 180, 124, 0.45);
}

.merchant-replace-title {
  color: #FDE68A;
  font-weight: 800;
  font-size: 0.84rem;
}

.merchant-replace-sub {
  margin-top: 4px;
  color: #EFE5CE;
  font-size: 0.74rem;
  font-weight: 600;
}

.merchant-replace-btn {
  min-height: 40px;
  white-space: normal;
  line-height: 1.2;
}

.merchant-replace-back {
  grid-column: 1 / -1;
}

#modal-merchant .ware-card {
  border-width: 11px 13px 10px 13px !important;
  border-image-width: 11px 13px 10px 13px !important;
  padding: 10px 14px !important;
  gap: 0;
  justify-content: flex-start;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.ware-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.ware-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.ware-card .panel-heading {
  min-width: 0;
  max-width: 100%;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: break-word !important;
  line-height: 1.22;
}

.ware-card .panel-sub,
.ware-card-desc {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  font-size: 0.72rem !important;
  line-height: 1.36 !important;
  color: #DFD3BC !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
}

.ware-card-footer {
  margin-top: auto;
  padding-top: 10px;
  flex-shrink: 0;
}

#modal-merchant .ware-card .btn-primary-9s {
  min-height: 36px !important;
  border-width: 9px 14px 9px 14px !important;
  border-image-width: 9px 14px 9px 14px !important;
  padding: 2px 10px !important;
  font-size: 0.8rem !important;
}

.draft-spell-card {
  padding: 8px 10px !important;
}

.draft-rarity-ribbon {
  position: relative;
  z-index: 2;
  margin-top: 2px;
  max-width: 100%;
  white-space: nowrap;
}
