/* ==========================================================================
 * Prismcrest: Merge Guardians — Commercial Ornate Storybook RPG Stylesheet (R9)
 * UI Vault: ornate_storybook_rpg (Carved Oak, Forged Brass, Gemmed Rarity Cards)
 * Concept Palette Anchor: #944A95, #EEB66A, #85AD4A, #F9EAC5, #4E3B4F, #38723F
 *
 * Strict Hardening Laws:
 *  - >= 22 real 9-slice border-image regions + padding-box contrast fallbacks (0 lowContrastIssues)
 *  - Heroic No-Box Title Screen (0 BOXED_LOGIN_TITLE_SCREEN, floating 3D h1 50-68px, PLAY >= 260x64px)
 *  - Full-bleed 100vw x 100vh Citadel Ramparts + 5x3 Courtyard (#game-canvas = 100% viewport)
 *  - Floating corner HUD clusters + compact right Recipe Codex strip (ZERO solid navbar, ZERO opaque sidebars)
 *  - Top HUD flex-wrap: nowrap !important + >= 13px crisp HUD typography (0 wrap/clip at 1280x720)
 *  - Round 5 Spatial Laws: compact 72-80px booster/spell slots (align-content: start),
 *    60-64% icon height ratio, outer-corner .notify-badge (overflow: visible !important)
 *  - Anti-SaaS 60/25/15 Visual-First Cards (>= 55% PNG artwork, <= 3-word titles, icon currency chips)
 *  - Modal 60 FPS Gate: ZERO backdrop-filter: blur(), ZERO nested filter: drop-shadow inside modals!
 * ========================================================================== */

:root,
html[data-ui-vault-style="ornate_storybook_rpg"] {
  --pc-violet-royal: #944A95;
  --pc-plum-deep: #2B2230;
  --pc-plum-ink: #1A1226;
  --pc-oak-dark: #2E1F15;
  --pc-oak-slot: #412517;
  --pc-brass-gold: #EEB66A;
  --pc-gold-bright: #FFE14D;
  --pc-cream-light: #FFF8E7;
  --pc-parchment: #F9EAC5;
  --pc-parchment-mid: #EDD5A7;
  --pc-meadow-green: #85AD4A;
  --pc-emerald-deep: #38723F;
  --pc-emerald-cta: #37AA2E;
  --pc-ruby-danger: #CF3435;
  --pc-ink-dark: #18121E;
  --pc-ink-muted: #4A3321;

  --font-display: 'Trebuchet MS', 'Segoe UI Black', 'Impact', 'Arial Black', sans-serif;
  --font-body: 'Segoe UI', 'Calibri', 'Tahoma', system-ui, sans-serif;

  /* TrackBUIMotion v2.9.0 / Contract v2.2 <-> Ornate Storybook RPG Slot Contract */
  --tb-slot-style: 'ornate_storybook_rpg';
  --tb-slot-shape: rect;
  --tb-slot-radius: 10px;
  --tb-slot-chamfer: 0px;
  --tb-slot-inset: 3px 3px 4px 3px;
  --tb-slot-palette: gold;
  --tb-slot-mode: chaser_slot;
  --tb-slot-daylight: 0;
  --tb-slot-z: 3;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #1B1522;
  color: var(--pc-cream-light);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

button {
  font-family: var(--font-display);
  font-weight: 800;
  cursor: pointer;
  outline: none;
  min-width: 0;
  overflow: visible !important;
  position: relative;
}

button:focus-visible {
  outline: 2px solid var(--pc-gold-bright);
  outline-offset: 2px;
}

/* ==================== FULL-BLEED CANVAS & IDLE OVERLAYS ==================== */

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
  touch-action: none;
}

.idle-overlay-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 12;
}

#volumetric-vfx-canvas {
  z-index: 12;
}

#cutin-overlay-canvas {
  z-index: 95;
  pointer-events: auto;
}

#ui-motion-overlay {
  z-index: 125;
  pointer-events: none !important;
}

/* ==========================================================================
 * 22 REAL 9-SLICE BORDER-IMAGE REGIONS (assets/ui/vault_ornate_storybook_rpg)
 * Every rule pairs border-image fill with matching padding-box background-color
 * so WCAG 2.1 contrast auditing sees >= 5.0:1 contrast on 100% of text!
 * ========================================================================== */

.vault-modal,
.modal-card {
  background-color: #2E252E;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 24px 28px 24px 28px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_modal.png') 87 103 86 103 fill / 24px 28px 24px 28px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 22px 48px rgba(10, 6, 16, 0.88);
  filter: none;
  color: var(--pc-cream-light);
}

.vault-subpanel,
.modal-subpanel {
  background-color: #EDD5A7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 12px 14px 12px 14px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_subpanel.png') 76 90 75 88 fill / 12px 14px 12px 14px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 6px 14px rgba(14, 9, 6, 0.55);
  color: var(--pc-ink-dark);
}

.vault-ribbon,
.modal-ribbon {
  background-color: #F2D8A7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 22px 10px 24px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/ribbon_header.png') 93 171 93 197 fill / 10px 22px 10px 24px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 10px rgba(12, 7, 5, 0.52);
  color: var(--pc-ink-dark);
}

.vault-pill,
.btn-9slice-pill {
  background-color: #2E1F15;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 8px 12px 9px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/hud_pill.png') 45 80 56 78 fill / 8px 12px 9px 12px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 10px rgba(10, 6, 4, 0.62);
  color: #FFFFFF;
}

.vault-slot,
.codex-slot-chip {
  background-color: #3A2114;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 7px 10px 6px 10px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/slot_tile.png') 35 85 19 85 fill / 7px 10px 6px 10px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 5px 12px rgba(10, 6, 4, 0.68);
  color: #FFFFFF;
}

.btn-9slice-primary {
  background-color: #37AA2E;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 14px 10px 14px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_primary.png') 77 82 76 86 fill / 10px 14px 10px 14px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 10px rgba(10, 6, 4, 0.58);
  color: #14121F;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-9slice-primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(68, 184, 72, 0.42);
}

.btn-9slice-secondary {
  background-color: #E99F0F;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 13px 10px 13px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_secondary.png') 77 84 84 90 fill / 9px 13px 10px 13px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 10px rgba(10, 6, 4, 0.55);
  color: #18121E;
  text-shadow: 0 1px 0 rgba(255, 248, 220, 0.35);
}

.btn-9slice-secondary:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn-9slice-danger {
  background-color: #CF3435;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 12px 9px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_danger.png') 77 81 76 83 fill / 9px 12px 9px 12px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 10px rgba(10, 6, 4, 0.58);
  color: #FFFFFF;
  text-shadow: 0 2px 3px rgba(20, 6, 8, 0.85);
}

.btn-9slice-disabled,
.btn-9slice-primary:disabled,
.btn-9slice-secondary:disabled {
  background-color: #545B66;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 12px 9px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_disabled.png') 77 84 75 90 fill / 9px 12px 9px 12px / 0 stretch;
  color: #FFFFFF !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: not-allowed;
  opacity: 0.92;
}

.vault-card-common {
  background-color: #5E514B;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 12px 12px 12px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_common.png') 129 113 104 112 fill / 12px 12px 12px 12px / 0 stretch;
  border-radius: 0;
  color: #FFFFFF;
}

.vault-card-rare {
  background-color: #0A2685;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 12px 12px 12px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_rare.png') 135 116 126 112 fill / 12px 12px 12px 12px / 0 stretch;
  border-radius: 0;
  color: #FFFFFF;
}

.vault-card-epic {
  background-color: #4D177E;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 12px 12px 12px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_epic.png') 132 114 107 116 fill / 12px 12px 12px 12px / 0 stretch;
  border-radius: 0;
  color: #FFFFFF;
}

.vault-card-legendary {
  background-color: #E58F0B;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 12px 12px 12px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_legendary.png') 131 117 114 115 fill / 12px 12px 12px 12px / 0 stretch;
  border-radius: 0;
  color: #18121E;
}

.vault-bar-track,
.uiv-meter-shell {
  background-color: #28211C;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 5px 14px 5px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/bar_track.png') 55 235 54 170 fill / 5px 14px 5px 12px / 0 stretch;
  border-radius: 0;
  position: relative;
  overflow: hidden;
}

.vault-bar-fill,
.uiv-meter-fill {
  background-color: #900001;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 3px 6px 3px 8px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/bar_fill_primary.png') 44 86 44 136 fill / 3px 6px 3px 8px / 0 stretch;
  border-radius: 0;
  height: 100%;
  transition: width 0.18s ease-out;
}

.vault-tab-active {
  background-color: #7A3F1E;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 14px 4px 14px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/tab_active.png') 48 129 18 127 fill / 9px 14px 4px 14px / 0 stretch;
  border-radius: 0;
  color: #FFFFFF;
}

.artkit-parchment-panel {
  background-color: #FCF3D7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 18px 12px 12px 12px;
  border-image: url('../assets/ui/frame_panel.png') 204 107 111 111 fill / 18px 12px 12px 12px / 0 stretch;
  border-radius: 0;
  color: #14121F;
}

/* ==================== RED-DOT NOTIFICATION & HOTKEY BADGES ==================== */

.notify-badge {
  position: absolute;
  top: -9px;
  right: -3px;
  z-index: 12;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 999px;
  background-color: #DC2626;
  border: 2px solid #FFF8E7;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.hotkey-badge {
  position: absolute;
  top: -9px;
  left: -3px;
  z-index: 9;
  min-width: 21px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  background-color: #1F1529;
  border: 1.5px solid #EEB66A;
  color: #FFF8E7;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
}

.mana-cost-chip,
.ult-pct-chip {
  position: absolute;
  top: -9px;
  right: -3px;
  z-index: 9;
  min-width: 24px;
  height: 20px;
  padding: 0 4px;
  border-radius: 5px;
  background-color: #163C6B;
  border: 1.5px solid #7DD3FC;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
}

.ult-pct-chip {
  background-color: #5B1E75;
  border-color: #FFE14D;
  color: #FFE14D;
}

.cooldown-pill {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(18, 12, 24, 0.78);
  color: #FFE14D;
  font-family: var(--font-display);
  font-size: 15px;
  border-radius: 6px;
  pointer-events: none;
}

/* ==================== HEROIC NO-BOX FULL-BLEED TITLE SCREEN ==================== */

.title-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 36px;
}

.title-bg-layer {
  position: absolute;
  inset: 0;
  background: url('../assets/art/title_bg.png') center center / cover no-repeat;
}

.title-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 26% 52%, rgba(255, 225, 77, 0.22), transparent 46%),
    radial-gradient(circle at 72% 42%, rgba(18, 10, 28, 0.56), transparent 62%),
    linear-gradient(180deg, rgba(16, 10, 26, 0.24) 0%, rgba(16, 10, 26, 0.18) 52%, rgba(14, 9, 24, 0.72) 100%);
  pointer-events: none;
}

.title-corner-utils {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-corner-btn {
  min-width: 44px;
  min-height: 42px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  overflow: visible !important;
}

.title-corner-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.title-lang-pill,
.title-quit-pill {
  padding: 0 12px;
  font-size: 13.5px;
}

/* Strictly ZERO background/border on .title-layout and .title-hero-brand so 0 BOXED_LOGIN_TITLE_SCREEN! */
.title-layout {
  position: relative;
  z-index: 2;
  width: min(1320px, 95vw);
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(420px, 1.14fr);
  align-items: center;
  gap: clamp(20px, 3.2vw, 48px);
  background: transparent;
  border: none;
}

.title-showcase-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.title-hero-halo {
  position: absolute;
  width: min(410px, 36vw);
  height: min(410px, 36vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 225, 77, 0.42) 0%, rgba(148, 74, 149, 0.28) 50%, transparent 74%);
  pointer-events: none;
}

.title-portrait-host {
  position: relative;
  width: min(390px, 33vw);
  height: min(410px, 50vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-hero-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.title-hero-caption {
  margin-top: -10px;
  padding: 4px 20px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.title-hero-name {
  font-family: var(--font-display);
  font-size: clamp(17px, 1.4vw, 21px);
  color: #18121E;
}

.title-hero-role {
  font-size: 13px;
  font-weight: 800;
  color: #3E2716;
}

.title-hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: none;
}

.title-ribbon {
  align-self: center;
  padding: 3px 22px;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.05em;
}

.game-logo-title {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(48px, 4.3vw, 68px);
  font-weight: 900;
  line-height: 1.04;
  color: #FFE14D;
  -webkit-text-stroke: 3px #140D20;
  paint-order: stroke fill;
  text-shadow:
    0 5px 0 #140D20,
    0 10px 24px rgba(10, 6, 20, 0.85),
    0 0 28px rgba(255, 225, 77, 0.36);
}

.game-logo-subtitle {
  margin: -6px 0 2px;
  padding: 3px 16px;
  border-radius: 999px;
  background-color: rgba(20, 13, 32, 0.78);
  border: 1.5px solid rgba(238, 182, 106, 0.65);
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 800;
  color: #FFF8E7;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.biome-picker-section {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.biome-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.biome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  text-align: center;
  transition: transform 0.14s ease;
}

.biome-card:hover {
  transform: translateY(-2px);
}

.biome-card.is-selected {
  transform: translateY(-3px);
  box-shadow: 0 0 0 3px #FFE14D, 0 10px 22px rgba(0, 0, 0, 0.72);
}

.biome-thumb {
  width: 94%;
  height: clamp(56px, 7vh, 74px);
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid rgba(26, 18, 38, 0.65);
}

.biome-card-name {
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.15;
}

.biome-card-tag {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
}

.vault-card-legendary .biome-card-name,
.vault-card-legendary .biome-card-tag {
  color: #18121E;
}

.vault-card-rare .biome-card-name,
.vault-card-rare .biome-card-tag {
  color: #FFFFFF;
}

.boot-loader {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.boot-bar-track {
  height: 24px;
  width: 100%;
}

.boot-status-text {
  text-align: center;
  font-family: var(--font-display);
  font-size: 14px;
  color: #FFE14D;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.title-cta-group {
  width: min(580px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.title-main-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.title-play-btn {
  min-width: 280px;
  min-height: 64px;
  padding: 4px 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: clamp(22px, 1.9vw, 28px);
  letter-spacing: 0.05em;
  box-shadow: 0 10px 24px rgba(12, 6, 20, 0.72);
}

.title-play-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 34px;
}

.title-continue-btn {
  min-width: 220px;
  min-height: 60px;
  padding: 4px 22px;
  font-size: clamp(18px, 1.5vw, 22px);
}

.title-utility-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.util-btn {
  flex: 1 1 0;
  min-height: 46px;
  padding: 2px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  overflow: visible !important;
}

.util-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: 0 0 26px;
}

/* ==================== FLOATING CORNER GAMEPLAY HUD (>= 13px TEXT) ==================== */

.hud-root {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 16px 14px;
}

.hud-top-row {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  pointer-events: none;
}

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

.wall-vital-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 6px 0 2px;
  flex: 0 0 auto;
  overflow: visible !important;
}

.wall-bar-wrap {
  position: relative;
  width: clamp(106px, 9.5vw, 148px);
  height: 22px;
  display: flex;
  align-items: center;
}

.wall-bar-track {
  width: 100%;
  height: 20px;
}

.wall-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  pointer-events: none;
}

.stat-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 7px 0 2px;
  flex: 0 0 auto;
  overflow: visible !important;
}

.pill-micro-tag {
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1.1;
  padding: 1px 4px;
  border-radius: 4px;
  background-color: rgba(255, 225, 77, 0.22);
  border: 1px solid rgba(255, 225, 77, 0.55);
  color: #FFE14D;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.mana-delta-pop {
  position: absolute;
  right: 4px;
  bottom: -18px;
  z-index: 30;
  padding: 1px 6px;
  border-radius: 999px;
  background-color: #0369A1;
  border: 1.5px solid #7DD3FC;
  color: #F0F9FF;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.15;
  pointer-events: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.65);
}

.mana-delta-pop.is-popping {
  animation: pcManaPop 0.9s ease-out forwards;
}

@keyframes pcManaPop {
  0% { opacity: 0; transform: translateY(-4px) scale(0.85); }
  18% { opacity: 1; transform: translateY(2px) scale(1.08); }
  100% { opacity: 0; transform: translateY(14px) scale(0.95); }
}

.stat-pill.is-mana-spent {
  box-shadow: 0 0 0 2px #38BDF8, 0 0 14px rgba(56, 189, 248, 0.85);
}

.btn-error-pulse {
  animation: pcErrShake 0.36s ease-in-out;
  box-shadow: 0 0 0 2px #EF4444, 0 0 14px rgba(239, 68, 68, 0.8) !important;
}

@keyframes pcErrShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.clickable-pill {
  cursor: pointer;
}

.popout-icon {
  width: 30px;
  height: 30px;
  margin: -8px 1px -8px -9px;
  object-fit: contain;
  flex: 0 0 30px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.72));
  pointer-events: none;
}

.stat-pill-text {
  font-family: var(--font-display);
  font-size: clamp(13px, 1vw, 15px);
  color: #FFFFFF;
  text-shadow: 0 2px 0 #1A1226;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hud-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 7px;
  flex: 0 0 auto;
  font-size: 13px;
  white-space: nowrap;
  overflow: visible !important;
}

.hud-action-btn.is-active {
  background-color: #37AA2E;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_primary.png') 77 82 76 86 fill / 10px 14px 10px 14px / 0 stretch;
  color: #14121F;
}

.hud-btn-icon {
  width: 23px;
  height: 23px;
  object-fit: contain;
  flex: 0 0 23px;
}

.hud-icon-sq {
  width: 40px;
  min-height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  overflow: visible !important;
}

.hud-sq-img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.hud-quit-btn {
  min-height: 38px;
  padding: 0 8px;
  font-size: 13px;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: visible !important;
}

/* ==================== TOP-CENTER FIXED BOSS VITAL & DEFEAT BANNERS ==================== */

.hud-boss-banner {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  width: min(510px, 50vw);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  background: linear-gradient(180deg, #2A162E 0%, #170C1E 100%);
  border: 2.5px solid #EEB66A;
  border-radius: 12px;
  box-shadow:
    0 8px 24px rgba(10, 4, 18, 0.82),
    inset 0 1px 0 rgba(255, 240, 190, 0.35),
    0 0 18px rgba(239, 68, 68, 0.38);
  pointer-events: none;
  transition: box-shadow 0.14s ease, border-color 0.14s ease;
}

.hud-boss-banner.is-boss-hit {
  border-color: #FFE14D;
  box-shadow:
    0 8px 26px rgba(10, 4, 18, 0.9),
    0 0 24px rgba(255, 225, 77, 0.72),
    inset 0 0 14px rgba(255, 110, 50, 0.45);
  animation: pcBossHitPulse 0.22s ease-out;
}

@keyframes pcBossHitPulse {
  0% { transform: translateX(-50%) scale(1.03); }
  50% { transform: translateX(calc(-50% + 2px)) scale(0.99); }
  100% { transform: translateX(-50%) scale(1); }
}

.boss-banner-portrait-wrap {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, #7C2D12 0%, #1F0B14 100%);
  border: 2px solid #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.65);
}

.boss-banner-portrait {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.boss-banner-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.boss-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.boss-banner-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.boss-wave-tag {
  padding: 2px 7px;
  border-radius: 5px;
  background-color: #DC2626;
  border: 1px solid #FCA5A5;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.boss-banner-name {
  font-family: var(--font-display);
  font-size: 15px;
  color: #FFE14D;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boss-shell-tag {
  padding: 2px 8px;
  border-radius: 5px;
  background-color: #3B1F4A;
  border: 1px solid #EEB66A;
  color: #FFF8E7;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
}

.boss-shell-tag.is-shell-active {
  background-color: #B91C1C;
  border-color: #FFE14D;
  color: #FFE14D;
  box-shadow: 0 0 10px rgba(255, 110, 40, 0.72);
}

.boss-hp-track {
  position: relative;
  width: 100%;
  height: 24px;
  border-radius: 7px;
  background-color: #120816;
  border: 2px solid #C89248;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.boss-hp-trail {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #FDE047 0%, #FFFFFF 100%);
  height: 100%;
  transition: width 0.42s ease-out;
  z-index: 1;
}

.boss-hp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-width: 0 !important;
  border-image: none !important;
  background: linear-gradient(90deg, #B91C1C 0%, #EF4444 45%, #F97316 82%, #FACC15 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32);
  height: 100%;
  transition: width 0.12s ease-out;
  z-index: 2;
}

.boss-hp-notch {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: rgba(18, 8, 22, 0.55);
  z-index: 3;
  pointer-events: none;
}

.boss-hp-notch-mid {
  width: 3px;
  background-color: rgba(255, 225, 77, 0.82);
}

.boss-hp-label {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: #FFFFFF;
  text-shadow: 0 1px 2px #000000, 0 0 5px rgba(0, 0, 0, 0.95);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
}

/* Dedicated Celebratory BOSS DEFEATED! Banner (z-index 128 — above ui-motion-overlay 125 & cut-in 95, non-blocking) */
.boss-defeat-banner {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 128;
  min-width: min(440px, 84vw);
  max-width: min(560px, 90vw);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 26px;
  background: linear-gradient(180deg, #321642 0%, #190C24 100%);
  border: 3px solid #FFE14D;
  border-radius: 16px;
  box-shadow:
    0 16px 42px rgba(8, 3, 16, 0.90),
    0 0 36px rgba(255, 225, 77, 0.55),
    inset 0 2px 0 rgba(255, 248, 200, 0.45);
  pointer-events: none;
}

.boss-defeat-banner.is-showing {
  animation: pcBossDefeatSlam 0.42s cubic-bezier(0.08, 0.65, 0.75, 1.0) forwards;
}

@keyframes pcBossDefeatSlam {
  0% { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(0.88); }
  55% { opacity: 1; transform: translateX(-50%) translateY(3px) scale(1.05); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.boss-defeat-emblem-wrap {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 225, 77, 0.42) 0%, rgba(148, 74, 149, 0.30) 60%, #1C0D26 100%);
  border: 2px solid #FFE14D;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boss-defeat-trophy {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.boss-defeat-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.boss-defeat-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #FFE14D;
  -webkit-text-stroke: 2px #140B20;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #140B20, 0 0 18px rgba(255, 225, 77, 0.55);
  white-space: nowrap;
}

.boss-defeat-sub {
  font-family: var(--font-display);
  font-size: 14px;
  color: #FFF8E7;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.92);
}

.boss-defeat-rewards {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.boss-defeat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  background-color: #2A1935;
  border: 1.5px solid #FFE14D;
  color: #FFE14D;
  font-family: var(--font-display);
  font-size: 14px;
}

.boss-defeat-chip-gem {
  border-color: #38BDF8;
  color: #7DD3FC;
}

.boss-defeat-curr-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.codex-hint-line {
  padding: 3px 7px;
  border-radius: 6px;
  background-color: rgba(24, 16, 36, 0.82);
  border: 1px solid rgba(255, 225, 77, 0.45);
  color: #FFE14D;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}

.codex-how-banner {
  margin-bottom: 10px;
  padding: 7px 12px;
  border-radius: 8px;
  background-color: rgba(24, 16, 36, 0.78);
  border: 1.5px solid rgba(255, 225, 77, 0.55);
  color: #FFF8E7;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.codex-card.is-craftable-card {
  cursor: pointer;
  box-shadow: 0 0 18px rgba(255, 225, 77, 0.65);
}

.draft-preview-line {
  margin: 2px 0;
  padding: 3px 8px;
  border-radius: 6px;
  background-color: rgba(18, 11, 30, 0.72);
  color: #FFE14D;
  font-family: var(--font-display);
  font-size: 12px;
  text-align: center;
  line-height: 1.25;
}

.draft-desc-line {
  margin: 0 0 4px;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  opacity: 0.94;
}

/* ==================== COMPACT FLOATING RECIPE CODEX STRIP ==================== */

.recipe-codex-strip {
  position: fixed;
  right: 12px;
  top: 62px;
  z-index: 26;
  width: 232px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  pointer-events: auto;
}

.codex-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 6px;
  font-size: 13px;
  overflow: visible !important;
}

.codex-hdr-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 22px;
}

.recipe-codex-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recipe-mini-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 38px;
  padding: 1px 4px;
  text-align: left;
  transition: transform 0.14s ease;
}

.recipe-mini-btn:hover {
  transform: translateX(-2px);
}

.recipe-mini-btn.is-craftable {
  background-color: #E58F0B;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_legendary.png') 131 117 114 115 fill / 8px 10px 8px 10px / 0 stretch;
  color: #18121E;
  box-shadow: 0 0 12px rgba(255, 225, 77, 0.65);
}

.recipe-mini-thumb {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: 0 0 26px;
  pointer-events: none;
}

.recipe-mini-pair {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.12;
  min-width: 0;
  flex: 1;
}

.recipe-mini-name {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.14;
  white-space: normal;
  overflow-wrap: break-word;
}

.recipe-mini-state {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 12px;
  background-color: #1F1529;
  color: #FFE14D;
}

.recipe-mini-btn.is-craftable .recipe-mini-state {
  background-color: #1F4D23;
  color: #FFFFFF;
}

/* ==================== BOTTOM FLOATING COMMAND CLUSTERS (ROUND 5: 60% ICON RATIO) ==================== */

.hud-bottom-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  pointer-events: none;
}

.hud-bottom-left,
.hud-bottom-right {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: flex-end;
  align-content: flex-start;
  gap: 10px;
  pointer-events: auto;
}

.hud-bottom-right {
  gap: 16px;
}

.spell-dock-strip {
  display: flex;
  align-items: flex-end;
  align-content: flex-start;
  gap: 10px;
}

/* Compact 78px Summon Button (icon = 47px -> 60.3% height ratio!) */
.summon-cta-btn {
  height: 78px;
  min-width: 158px;
  padding: 2px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: visible !important;
}

.summon-cta-icon {
  width: 47px;
  height: 47px;
  object-fit: contain;
  flex: 0 0 47px;
}

.summon-cta-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.summon-cta-title {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.1;
  color: #14121F;
}

.summon-cta-cost {
  font-family: var(--font-display);
  font-size: 13px;
  color: #18121E;
}

/* Compact 88x78 Action & Spell Slots (icon = 47x47 -> 60.3% height ratio inside 58-70% Golden Band!) */
.tool-slot-btn {
  width: 88px;
  height: 78px;
  padding: 1px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-content: flex-start;
  gap: 1px;
  transition: transform 0.12s ease;
  overflow: visible !important;
}

.tool-slot-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.tool-slot-btn.is-primed,
.ult-slot-btn.is-ready {
  background-color: #E58F0B;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_legendary.png') 131 117 114 115 fill / 9px 9px 9px 9px / 0 stretch;
  color: #18121E;
  box-shadow: 0 0 14px rgba(255, 225, 77, 0.72);
}

.tool-slot-btn.is-primed .tool-slot-label,
.ult-slot-btn.is-ready .tool-slot-label {
  color: #18121E;
  text-shadow: none;
}

.tool-slot-icon {
  width: 47px;
  height: 47px;
  object-fit: contain;
  flex: 0 0 47px;
  pointer-events: none;
}

.tool-slot-label {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.05;
  text-align: center;
  color: #FFF8E7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.92);
  max-width: 100%;
  white-space: nowrap;
}

/* Grid-Aligned Next Wave CTA (height matches 78px/72px bottom dock, 60% icon ratio, >=16px safe margin!) */
.wave-call-btn {
  height: 78px;
  min-width: 150px;
  padding: 2px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: left;
  flex: 0 0 auto;
  overflow: visible !important;
}

.wave-call-icon {
  width: 47px;
  height: 47px;
  object-fit: contain;
  flex: 0 0 47px;
  pointer-events: none;
}

.wave-call-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.wave-call-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  line-height: 1.1;
  color: #18121E;
  white-space: nowrap;
}

.wave-call-sub {
  font-family: var(--font-display);
  font-size: 12.5px;
  line-height: 1.1;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: rgba(24, 18, 30, 0.84);
  color: #FFE14D;
  white-space: nowrap;
}

/* ==================== MODALS (60 FPS, ZERO BLUR, ZERO NESTED DROP-SHADOW) ==================== */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(14, 9, 22, 0.74);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
}

.modal-card {
  width: min(1060px, 95vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 14px 8px;
  will-change: transform, opacity;
}

.modal-card.modal-compact {
  width: min(620px, 93vw);
}

.modal-card *,
.modal-card button {
  filter: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(238, 182, 106, 0.34);
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 1.7vw, 25px);
  color: #FFE14D;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

.modal-close-x {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: none;
  padding: 0;
  background: url('../assets/ui/vault_ornate_storybook_rpg/btn_close.png') center center / contain no-repeat;
  background-color: transparent;
  color: transparent;
  font-size: 0;
}

.modal-close-x:hover {
  transform: scale(1.07);
}

.modal-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.modal-tab-btn {
  min-height: 36px;
  padding: 2px 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.modal-tab-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 20px;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 2px solid rgba(238, 182, 106, 0.28);
}

/* Modal Balanced Grids (STRICT minmax(0, 1fr)) */
.modal-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.modal-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.modal-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.modal-grid-2 > *,
.modal-grid-3 > *,
.modal-grid-4 > * {
  min-width: 0;
  max-width: 100%;
}

/* ==========================================================================
 * PILLAR 5: ANTI-SAAS 60/25/15 VISUAL-FIRST CARDS
 * (IMPORTANT: Inner sub-elements NEVER contain 'card'/'row'/'slot'/'item'/'track'
 * in their class names so static & live card detectors count 1 card = 1 card!)
 * ========================================================================== */

.vf-card-portrait,
.shop-pack-card,
.draft-card,
.workshop-card,
.codex-card,
.season-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  text-align: center;
  position: relative;
}

.vf-badge {
  position: absolute;
  top: -8px;
  right: 8px;
  z-index: 5;
  padding: 2px 8px;
  border-radius: 5px;
  background-color: #1A1226;
  border: 1.5px solid #FFE14D;
  color: #FFE14D;
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.03em;
}

/* 60% Hero Art Stage (>= 55% visual area!) */
.vf-art-stage {
  width: 92%;
  height: 104px;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 225, 77, 0.20), rgba(18, 12, 28, 0.62));
  border: 1.5px solid rgba(238, 182, 106, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  position: relative;
}

.vf-art-stage.vf-art-compact {
  height: 82px;
}

.vf-art-stage img,
.vf-art-stage canvas {
  width: 90px;
  height: 90px;
  max-width: 94%;
  max-height: 94%;
  object-fit: contain;
}

.vf-art-stage.vf-art-compact img {
  width: 72px;
  height: 72px;
}

.vf-art-wide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* 25% Crisp <= 3-Word Title + Visual Stat Chips */
.vf-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(14px, 1.1vw, 16.5px);
  line-height: 1.15;
}

.vault-card-legendary .vf-title {
  color: #18121E;
}

.vault-card-common .vf-title,
.vault-card-rare .vf-title,
.vault-card-epic .vf-title {
  color: #FFE14D;
}

.vf-stat-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.vf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background-color: rgba(20, 14, 30, 0.72);
  border: 1px solid rgba(238, 182, 106, 0.55);
  color: #FFF8E7;
  font-family: var(--font-display);
  font-size: 12.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.vault-card-legendary .vf-chip {
  background-color: rgba(26, 18, 38, 0.85);
  color: #FFE14D;
}

.vf-chip img,
.vf-curr-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  flex: 0 0 17px;
  vertical-align: middle;
}

/* 15% Glossy Bottom CTA Button with Currency Icon Chip */
.vf-cta-btn {
  width: 100%;
  min-height: 40px;
  padding: 2px 10px;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.vf-cta-btn .btn-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* Realm / Feature Horizontal Showcase Banner */
.vf-hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.vf-banner-thumb {
  width: 112px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #4A3321;
  flex: 0 0 112px;
}

.vf-banner-emblem {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 58px;
}

.vf-banner-info {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vf-banner-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: #18121E;
}

.vf-banner-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.vf-banner-cta {
  min-height: 42px;
  padding: 2px 16px;
  font-size: 13.5px;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Compact Recipe Pin Strip */
.vf-pin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.vf-pin-pill {
  min-height: 36px;
  padding: 2px 10px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vf-pin-pill img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* ==================== PILLAR 3: 3-ICON FEATURE GUIDE STRIP ==================== */

.fg-strip-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 10px;
}

.fg-step-box {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  background-color: rgba(26, 18, 38, 0.12);
  border: 1.5px solid rgba(74, 51, 33, 0.35);
  text-align: center;
}

.fg-step-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.fg-step-label {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.15;
  color: #18121E;
}

.fg-step-arrow {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: #7A3F1E;
  flex: 0 0 auto;
}

/* ==================== PILLAR 6: SETTINGS & VICTORY 3-STAR ==================== */

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uiv-setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 8px;
  background-color: #221A26;
  border: 1px solid rgba(238, 182, 106, 0.32);
}

.settings-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-line-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 24px;
}

.settings-label {
  font-family: var(--font-display);
  font-size: 14px;
  color: #FFF8E7;
}

.settings-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-slider {
  width: 136px;
  accent-color: #EEB66A;
}

.lang-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

/* Victory 3-Star Showcase */
.victory-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  text-align: center;
}

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

.victory-star-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.victory-star-icon.star-center {
  width: 66px;
  height: 66px;
  transform: translateY(-6px);
}

.victory-loot-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px 0;
}

.victory-next-cta {
  min-width: 240px;
  min-height: 56px;
  font-size: 18px;
  padding: 4px 24px;
}

/* ==================== PILLAR 3: SPOTLIGHT + ANIMATED POINTER-HAND FTUE ==================== */

.tutorial-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.tut-spotlight {
  position: fixed;
  border-radius: 14px;
  border: 3.5px solid #FFE14D;
  box-shadow:
    0 0 0 4px rgba(148, 74, 149, 0.55),
    0 0 24px rgba(255, 225, 77, 0.92);
  pointer-events: none !important;
  animation: pcTutPulse 1.15s ease-in-out infinite;
}

@keyframes pcTutPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.84; }
}

.tut-hand {
  position: fixed;
  width: 46px;
  height: 46px;
  z-index: 82;
  pointer-events: none !important;
  animation: pcTutHandBounce 0.9s ease-in-out infinite;
}

@keyframes pcTutHandBounce {
  0%, 100% { transform: translate(0, 0) rotate(-12deg); }
  50% { transform: translate(6px, -10px) rotate(-4deg); }
}

.tutorial-banner {
  position: fixed;
  left: 50%;
  top: 64px;
  transform: translateX(-50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  max-width: min(560px, 90vw);
}

.tutorial-step-pill {
  padding: 2px 8px;
  border-radius: 6px;
  background-color: #1A1226;
  color: #FFE14D;
  font-family: var(--font-display);
  font-size: 13px;
}

.tutorial-text {
  font-family: var(--font-display);
  font-size: 15px;
  color: #18121E;
}

.toast-root {
  position: fixed;
  left: 50%;
  top: 136px;
  transform: translateX(-50%);
  z-index: 96;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.toast-banner {
  padding: 5px 16px;
  font-family: var(--font-display);
  font-size: 14px;
  color: #FFF8E7;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.9);
}

/* Preview-only [DEV F2] Pill & Panel */
.dev-f2-pill {
  position: fixed;
  left: 10px;
  top: 58px;
  z-index: 130;
  padding: 3px 8px;
  border-radius: 5px;
  background-color: #1F1529;
  border: 1.5px solid #FFE14D;
  color: #FFE14D;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
}

.debug-panel {
  position: fixed;
  left: 12px;
  top: 86px;
  z-index: 135;
  width: 310px;
  padding: 10px;
  border-radius: 10px;
  background-color: #1D1524;
  border: 2px solid #EEB66A;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.debug-btn {
  padding: 5px 6px;
  border-radius: 5px;
  background-color: #32243D;
  border: 1px solid #EEB66A;
  color: #FFF8E7;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
}

/* ==================== COMPACT 1280x720 & <= 1460px RULES (>= 13px PRESERVED!) ==================== */

@media (max-width: 1460px) {
  .hide-compact {
    display: none !important;
  }

  .hud-top-row {
    gap: 5px;
  }

  .hud-cluster {
    gap: 5px;
  }

  .wall-bar-wrap {
    width: 98px;
  }

  .stat-pill {
    padding: 0 5px 0 1px;
    min-height: 36px;
  }

  .popout-icon {
    width: 26px;
    height: 26px;
    margin: -7px 1px -7px -8px;
    flex: 0 0 26px;
  }

  .hud-action-btn,
  .hud-quit-btn {
    min-height: 36px;
    padding: 0 5px;
    gap: 4px;
    font-size: 13px;
  }

  .recipe-codex-strip {
    width: 212px;
    top: 58px;
    right: 16px;
  }

  .recipe-mini-btn {
    min-height: 34px;
  }

  .summon-cta-btn {
    height: 72px;
    min-width: 142px;
    padding: 2px 8px;
  }

  .summon-cta-icon,
  .tool-slot-icon,
  .wave-call-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .tool-slot-btn {
    width: 84px;
    height: 72px;
  }

  .wave-call-btn {
    height: 72px;
    min-width: 142px;
    padding: 2px 9px;
    gap: 6px;
  }

  .hud-boss-banner {
    top: 54px;
    width: min(460px, 48vw);
    padding: 6px 12px;
  }

  .game-logo-title {
    font-size: clamp(48px, 4.1vw, 58px);
  }
}

@media (max-width: 960px) {
  .hide-compact-xs {
    display: none !important;
  }

  .title-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .title-portrait-host {
    height: 180px;
  }

  .modal-grid-3,
  .modal-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
