/* Riftblade Survivors — UI Vault: inked_parchment_roguelite (Offline MSIX Safe, 0 backdrop-filter) */

:root {
  --font-display: 'Cinzel', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ink-bg: #12100F;
  --ink-obsidian: #1C1917;
  --ink-parchment: #EFE5CE;
  --ink-dark: #1C1714;
  --ink-gold: #E2B362;
  --ink-amber: #C98A32;
  --ink-crimson: #B83232;
  --ink-teal: #2E857D;
  --ink-muted: #574B3E;
  --pal-bg: #2C2736;
  --pal-deep: #050509;
  --pal-olive: #6F7261;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--pal-deep);
  color: var(--ink-parchment);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

.num-tabular {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

/* ── Full-Bleed Playfield & Idle-Hidden Overlays ── */
#stage-wrap {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

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

.fx-overlay-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  display: none;
}

#vfx3d-canvas { z-index: 4; }
#cutin-canvas { z-index: 95; }
#ui-motion-canvas { z-index: 130; }

/* ── Calibrated 9-Slice Border Scaling for Crisp Proportions ── */
.uiv-inked_parchment_roguelite-hud-pill {
  border-width: 7px 14px 7px 14px !important;
  border-image-width: 7px 14px 7px 14px !important;
  padding: 3px 6px;
}

.uiv-inked_parchment_roguelite-slot-tile {
  border-width: 5px 8px 5px 8px !important;
  border-image-width: 5px 8px 5px 8px !important;
  padding: 3px;
}

.uiv-inked_parchment_roguelite-ribbon-header {
  border-width: 9px 26px 9px 20px !important;
  border-image-width: 9px 26px 9px 20px !important;
  padding: 2px 10px;
}

.uiv-inked_parchment_roguelite-btn-primary {
  border-width: 12px 14px 12px 14px !important;
  border-image-width: 12px 14px 12px 14px !important;
  color: #FFFDF7;
  text-shadow: 0 2px 3px rgba(18, 12, 8, 0.9);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.uiv-inked_parchment_roguelite-btn-primary:hover {
  filter: brightness(1.12) drop-shadow(0 4px 8px rgba(201, 138, 50, 0.35));
}
.uiv-inked_parchment_roguelite-btn-primary:active {
  transform: scale(0.97);
}

.uiv-inked_parchment_roguelite-btn-secondary {
  border-width: 10px 14px 10px 14px !important;
  border-image-width: 10px 14px 10px 14px !important;
  color: #F6F0E4;
  text-shadow: 0 2px 3px rgba(8, 14, 14, 0.9);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.uiv-inked_parchment_roguelite-btn-secondary:hover {
  filter: brightness(1.14);
}

.uiv-inked_parchment_roguelite-btn-danger {
  border-width: 10px 18px 10px 18px !important;
  border-image-width: 10px 18px 10px 18px !important;
  color: #FFF5F5;
  text-shadow: 0 2px 3px rgba(28, 6, 6, 0.9);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.uiv-inked_parchment_roguelite-btn-danger:hover {
  filter: brightness(1.14);
}

.uiv-inked_parchment_roguelite-tab-active {
  border-width: 9px 12px 6px 12px !important;
  border-image-width: 9px 12px 6px 12px !important;
  color: #FDE68A;
}

.uiv-inked_parchment_roguelite-card-common,
.uiv-inked_parchment_roguelite-card-rare,
.uiv-inked_parchment_roguelite-card-epic,
.uiv-inked_parchment_roguelite-card-legendary {
  border-width: 14px 16px 14px 16px !important;
  border-image-width: 14px 16px 14px 16px !important;
  color: var(--ink-dark);
}

.uiv-inked_parchment_roguelite-frame-modal {
  border-width: 18px 18px 22px 18px !important;
  border-image-width: 18px 18px 22px 18px !important;
  cursor: default;
}

.uiv-inked_parchment_roguelite-frame-subpanel {
  border-width: 12px 16px 10px 16px !important;
  border-image-width: 12px 16px 10px 16px !important;
  cursor: default;
}

.uiv-inked_parchment_roguelite-bar-track {
  border-width: 5px 10px 5px 10px !important;
  border-image-width: 5px 10px 5px 10px !important;
  cursor: default;
}

.uiv-inked_parchment_roguelite-bar-fill-primary {
  border-width: 3px 5px 3px 5px !important;
  border-image-width: 3px 5px 3px 5px !important;
  cursor: default;
}

/* Always keep buttons overflow: visible so .notify-badge never clips */
button {
  overflow: visible !important;
  position: relative;
  font-family: var(--font-display);
  outline: none;
}
button:focus-visible {
  outline: 2px solid var(--ink-gold);
  outline-offset: 2px;
}

/* ── HEROIC NO-BOX TITLE SCREEN ── */
.title-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: clamp(44px, 7vh, 88px);
  overflow: hidden;
}

.title-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.title-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 42%, rgba(12, 9, 18, 0.14) 0%, rgba(8, 6, 12, 0.72) 85%);
  pointer-events: none;
}

.title-corner-dock {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-chip {
  height: 40px;
  min-width: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-parchment);
  white-space: nowrap;
}

.title-hero-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 clamp(32px, 6vw, 110px) clamp(24px, 4vh, 52px);
}

.title-hero-portrait-host {
  position: relative;
  width: clamp(230px, 22vw, 340px);
  height: clamp(320px, 50vh, 490px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.title-hero-portrait {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.75));
}

.title-rig-canvas {
  width: clamp(220px, 21vw, 310px);
  height: clamp(220px, 21vw, 310px);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7));
}

/* Unboxed Floating Emblem (zero border, zero solid background) */
.title-hero-copy {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: none;
  text-align: center;
  max-width: 90vw;
}

.title-kicker {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.25vw, 18px);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #E8C784;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

.game-main-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(44px, 5.2vw, 76px);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: #FDE68A;
  text-shadow:
    0 4px 0 #1A1025,
    0 8px 24px rgba(0, 0, 0, 0.95),
    0 0 28px rgba(201, 138, 50, 0.48);
}

.title-mode-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
  max-width: 92vw;
}

.mode-pill {
  min-height: 46px;
  height: auto;
  min-width: 142px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 18px;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink-parchment);
  white-space: nowrap;
  box-sizing: border-box;
}
.mode-pill.uiv-inked_parchment_roguelite-tab-active,
.mode-pill.uiv-inked_parchment_roguelite-hud-pill {
  border-width: 8px 16px 7px 16px !important;
  border-image-width: 8px 16px 7px 16px !important;
  padding: 5px 18px;
}
.mode-pill img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}
.mode-pill span {
  display: inline-block;
  line-height: 1.15;
}
.mode-pill.active {
  color: #FDE68A;
  filter: drop-shadow(0 0 8px rgba(226, 179, 98, 0.45));
}

.boot-loader {
  width: clamp(280px, 34vw, 440px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.boot-bar-track {
  width: 100%;
  height: 22px;
  position: relative;
  display: flex;
  align-items: center;
}

.boot-bar-fill {
  height: 12px;
  transition: width 0.14s ease-out;
}

.boot-status {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-parchment);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.title-cta-wrap {
  margin-top: 4px;
}

.btn-title-play {
  min-width: 248px;
  height: 64px;
  padding: 0 36px;
  font-size: 22px;
  letter-spacing: 0.14em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── FLOATING IN-GAME HUD ── */
.hud-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-top-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.xp-strip {
  width: 100%;
  padding: 0 4px;
  pointer-events: none;
}

.xp-track {
  width: 100%;
  height: 14px;
  display: flex;
  align-items: center;
}

.xp-fill {
  height: 6px;
  transition: width 0.15s ease-out;
}

.hud-top-bar {
  width: 100%;
  padding: 3px 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 6px;
  pointer-events: none;
}

.hud-cluster {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  pointer-events: auto;
  flex-shrink: 0;
}

.hud-pill {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-parchment);
  white-space: nowrap;
  cursor: default;
}

.pill-tag {
  color: var(--ink-gold);
  font-family: var(--font-display);
  font-size: 13px;
}

.cur-pill img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.hp-meter {
  position: relative;
  width: clamp(128px, 12vw, 178px);
  height: 32px;
  display: flex;
  align-items: center;
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #8F1D24 0%, #D9413B 100%);
  border-radius: 2px;
  transition: width 0.14s ease-out;
}

.hp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #FFFDF7;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
}

.clock-pill {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 800;
  color: #FDE68A;
  white-space: nowrap;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.clock-val {
  font-size: 16px;
  color: #FFFFFF;
}

.clock-sep {
  color: rgba(239, 229, 206, 0.45);
}

.hud-action-btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 18px 0 6px;
  border-width: 5px 10px 5px 10px !important;
  border-image-width: 5px 10px 5px 10px !important;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-parchment);
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.1s ease, filter 0.1s ease;
}

.hud-action-btn img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  flex-shrink: 0;
}

.hud-action-btn:hover,
.hud-icon-btn:hover {
  filter: brightness(1.16);
}

.hud-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.hud-icon-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Red-Dot Notification Badge (tucked cleanly inside button frame — zero scrollWidth overflow, never clipped) */
.notify-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: #D63031;
  border: 1.5px solid #FDE68A;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  line-height: 13px;
  text-align: center;
  z-index: 8;
  pointer-events: none;
}

/* Boss Banner */
.boss-banner {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  pointer-events: none;
}

.boss-plate {
  display: flex;
  align-items: center;
  gap: 10px;
  width: clamp(300px, 30vw, 430px);
  padding: 2px 8px;
}

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

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

.boss-head-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 800;
  color: #FCA5A5;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
}

.boss-hp-track {
  width: 100%;
  height: 16px;
  display: flex;
  align-items: center;
}

.boss-hp-fill {
  height: 8px;
  transition: width 0.12s ease-out;
}

/* Objective & Combo Pills */
.hud-objective-pill {
  position: fixed;
  top: 58px;
  left: 10px;
  z-index: 18;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-parchment);
  pointer-events: none;
}

.hud-objective-pill img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.hud-combo-pill {
  position: fixed;
  top: 94px;
  left: 12px;
  z-index: 18;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #FDE68A;
  text-shadow: 0 3px 0 #450D0D, 0 0 14px rgba(226, 179, 98, 0.65);
  pointer-events: none;
}

/* Bottom Floating Clusters (compact corner-hugging dock — maximizes unobstructed combat playfield) */
.hud-bottom-bar {
  width: 100%;
  padding: 0 10px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
  pointer-events: none;
}

.loadout-dock {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 4px;
}

.tray-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.loadout-cell {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.loadout-cell img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.loadout-cell.empty {
  opacity: 0.36;
}

.loadout-lv {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #1C1714;
  border: 1px solid #C98A32;
  border-radius: 4px;
  padding: 0 3px;
  font-size: 12px;
  font-weight: 800;
  color: #FDE68A;
  line-height: 13px;
  pointer-events: none;
}

.loadout-cell.awakened {
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.85));
}

.loadout-cell.awakened .loadout-lv {
  background: #9E2E2E;
  border-color: #FDE68A;
  color: #FFFFFF;
}

/* Compact 68px/64px Skill / Booster Tiles (Round 5 Ratio: 40/68 = 58.8% icon fill, zero badge overhang) */
.skill-dock {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.skill-btn {
  width: 68px;
  height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 10px 0;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.skill-btn img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  pointer-events: none;
}

.skill-btn:hover {
  filter: brightness(1.16);
}

.skill-btn.active-lock {
  filter: drop-shadow(0 0 10px rgba(226, 179, 98, 0.9));
}

.cd-veil {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  background: rgba(12, 10, 14, 0.72);
  pointer-events: none;
  z-index: 3;
  transition: height 0.08s linear;
}

.hotkey-badge {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  background: #1C1714;
  border: 1.5px solid #C98A32;
  border-radius: 4px;
  padding: 0 5px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  color: #FDE68A;
  line-height: 14px;
  white-space: nowrap;
  z-index: 8;
  pointer-events: none;
}

/* ── EDGE-DOCKED TOP SKILL CALLOUT BAR (<= 52px tall, 0 boss/arena occlusion, pointer-events: none) ── */
.skill-callout-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 52px;
  max-height: 56px;
  z-index: 96;
  pointer-events: none;
  display: block;
}

.skill-callout-pill {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  height: 36px;
  max-height: 40px;
  max-width: min(420px, 38vw);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 1px 12px;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  border-width: 7px 16px 7px 14px !important;
  border-image-width: 7px 16px 7px 14px !important;
  animation: skillCalloutIn 0.16s ease-out;
}

.skill-callout-pill.boss {
  filter: drop-shadow(0 0 8px rgba(217, 65, 59, 0.78));
}

.skill-callout-portrait {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #E2B362;
  flex-shrink: 0;
  pointer-events: none;
}

.skill-callout-title {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  color: #FDE68A;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  flex-shrink: 0;
}

.skill-callout-sep {
  color: rgba(239, 229, 206, 0.55);
  font-size: 11px;
  flex-shrink: 0;
}

.skill-callout-sub {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 800;
  color: #EFE5CE;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  text-overflow: ellipsis;
}

body.skill-callout-active .clock-pill {
  opacity: 0;
  transition: opacity 0.12s ease;
}

@keyframes skillCalloutIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── TOAST BANNER ── */
.toast-host {
  position: fixed;
  top: 106px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.toast-pill {
  padding: 6px 18px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #FDE68A;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
  animation: toastIn 0.22s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── FTUE VISUAL SPOTLIGHT & POINTER-HAND ── */
.ftue-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

.tut-spotlight {
  position: fixed;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid #FDE68A;
  box-shadow: 0 0 0 6px rgba(201, 138, 50, 0.28);
  animation: tutPulse 1.1s ease-in-out infinite;
  pointer-events: none;
}

@keyframes tutPulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.1); opacity: 0.65; }
}

.tut-pill {
  position: fixed;
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
  color: #FDE68A;
  pointer-events: none;
}

.tut-hand {
  position: fixed;
  width: 44px;
  height: 44px;
  pointer-events: none;
  animation: handBob 0.85s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
}

@keyframes handBob {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-6px, -8px); }
}

.tut-skip {
  position: fixed;
  top: 66px;
  right: 22px;
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  pointer-events: auto;
}

/* ── MODALS (FLEX SCROLL LAW — NEVER CUT OFF AT 1280x720, ZERO HUD OCCLUSION) ── */
.modal-root {
  position: fixed;
  top: 54px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px 80px;
  pointer-events: none;
}

.modal-root.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.modal-backdrop {
  position: fixed;
  top: 54px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 5, 9, 0.68);
  z-index: 1;
  pointer-events: none;
}

.modal-root.hidden .modal-backdrop {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.modal-card {
  position: relative;
  z-index: 2;
  width: min(940px, 94vw);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 148px);
  overflow: hidden;
  color: var(--ink-parchment);
  pointer-events: auto;
}

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

.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 10px 10px;
  border-bottom: 1px solid rgba(163, 139, 103, 0.35);
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 800;
  color: #FDE68A;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.modal-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 3px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.modal-tab-btn {
  height: 36px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-parchment);
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 4px;
  border-top: 1px solid rgba(163, 139, 103, 0.32);
}

.modal-close-x {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.modal-close-x img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* ── ANTI-SAAS 60/25/15 PARCHMENT GRIDS ── */
.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.cards-grid-3 > * {
  min-width: 0;
  max-width: 100%;
}

.cards-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.cards-grid-4 > * {
  min-width: 0;
  max-width: 100%;
}

.cards-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.cards-grid-5 > * {
  min-width: 0;
  max-width: 100%;
}

/* Visual-First Parchment Cards (Dark Ink Text on Warm Parchment -> WCAG > 12:1) */
.vf-card-portrait,
.shop-card,
.forge-card,
.upgrade-card,
.season-card,
.draft-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 6px 6px;
  text-align: center;
  color: var(--ink-dark);
  min-height: 158px;
}

.vf-art-wrap {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.vf-art-wrap img {
  max-width: 72px;
  max-height: 62px;
  width: auto;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(28, 23, 20, 0.38));
}

.vf-card-title,
.vf-ttl {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: #1C1714;
  line-height: 1.15;
}

.vf-stat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(28, 23, 20, 0.12);
  color: #2B2118;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.vf-stat-chip img,
.cur-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.cur-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  color: #2B2118;
}

.cur-chip.light {
  color: #FDE68A;
}

.vf-badge-ribbon {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 4px;
  background: #9E2E2E;
  color: #FFFDF7;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  z-index: 4;
}

.vf-badge-ribbon.gold {
  background: #A6651A;
}

.vf-badge-ribbon.teal {
  background: #236B64;
}

.card-cta-btn,
.vf-cta-btn {
  width: 100%;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
  padding: 0 6px;
  white-space: nowrap;
  border-width: 8px 12px 8px 12px !important;
  border-image-width: 8px 12px 8px 12px !important;
  line-height: 1;
}

.card-cta-btn img,
.vf-cta-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Season Hero Banner + Connected Milestone Track */
.season-hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 14px;
}

.season-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.season-hero-left img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.season-progress-wrap {
  flex: 1;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contract-prog-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(28, 23, 20, 0.24);
  border: 1px solid rgba(28, 23, 20, 0.35);
  overflow: hidden;
}

.contract-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #C98A32 0%, #E2B362 100%);
  transition: width 0.2s ease-out;
}

/* Settings Layout (Zero raw prose rows) */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.setting-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(28, 25, 23, 0.72);
  border: 1px solid rgba(163, 139, 103, 0.4);
  border-radius: 6px;
}

.setting-lbl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-parchment);
}

.setting-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.setting-slider {
  width: 110px;
  accent-color: #C98A32;
}

.lang-select {
  background: #1C1917;
  color: #EFE5CE;
  border: 1.5px solid #A38B67;
  border-radius: 4px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
}

.toggle-btn {
  min-width: 68px;
  height: 36px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-width: 7px 12px 7px 12px !important;
  border-image-width: 7px 12px 7px 12px !important;
  padding: 0 6px;
  line-height: 1;
}

/* Visual 3-Icon Feature Guide Strip */
.guide-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* Celebration Banner & Loot Chips */
.celebration-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.loot-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loot-chip-big {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 18px;
  font-weight: 800;
  color: #FDE68A;
}

.loot-chip-big img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

/* Preview-Only [DEV F2] Pill & Drawer */
.dev-pill-btn {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 88;
  height: 30px;
  padding: 0 10px;
  background: rgba(28, 25, 23, 0.88);
  border: 1px solid #C98A32;
  border-radius: 6px;
  color: #FDE68A;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dev-drawer {
  position: fixed;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  width: min(640px, 92vw);
  background: #1C1917;
  border: 2px solid #C98A32;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.dev-drawer button {
  padding: 6px 8px;
  background: #2C2736;
  border: 1px solid #A38B67;
  border-radius: 5px;
  color: #EFE5CE;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Responsive 1280x720 Multi-Locale HUD Fit & < 1100px fallback */
@media (max-width: 1380px) {
  .mode-pill { min-width: 130px; padding: 4px 15px; font-size: 12.5px; }
  .mode-pill.uiv-inked_parchment_roguelite-tab-active,
  .mode-pill.uiv-inked_parchment_roguelite-hud-pill { padding: 4px 15px; }
  .hud-top-bar { padding: 2px 8px 0; gap: 4px; }
  .hud-cluster { gap: 3px; }
  .hud-pill {
    height: 32px;
    font-size: 12.5px;
    gap: 4px;
    border-width: 5px 10px 5px 10px !important;
    border-image-width: 5px 10px 5px 10px !important;
  }
  .cur-pill img { width: 18px; height: 18px; }
  .hud-action-btn {
    padding: 0 17px 0 5px;
    font-size: 12px;
    gap: 3px;
    height: 32px;
    border-width: 5px 9px 5px 9px !important;
    border-image-width: 5px 9px 5px 9px !important;
  }
  .hud-action-btn img { width: 17px; height: 17px; }
  .hud-icon-btn { width: 32px; height: 32px; }
  .hud-icon-btn img { width: 18px; height: 18px; }
  .hp-meter { width: clamp(104px, 9.8vw, 138px); height: 28px; }
  .clock-pill {
    height: 34px;
    font-size: 12.5px;
    gap: 4px;
    padding: 1px 6px;
    border-width: 7px 18px 7px 14px !important;
    border-image-width: 7px 18px 7px 14px !important;
  }
  .clock-val { font-size: 14px; }
  .loadout-cell { width: 34px; height: 34px; }
  .loadout-cell img { width: 20px; height: 20px; }
  .hud-objective-pill { top: 52px; }
  .hud-combo-pill { top: 88px; }
  .boss-banner { top: 52px; }
  .skill-callout-bar { height: 48px; }
  .skill-callout-pill { top: 10px; height: 34px; padding: 1px 10px; }
  .skill-callout-title { font-size: 12px; }
  .skill-callout-sub { font-size: 11px; }
  .skill-btn { width: 64px; height: 64px; padding: 0 0 10px 0; }
  .skill-btn img { width: 38px; height: 38px; }
}
@media (max-width: 1100px) {
  .cards-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .cards-grid-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .title-hero-stage { opacity: 0.45; }
}
