/* =========================================================================
 * Lanternpack: Crypt Delver — Native 16:9 PC Widescreen 3-Zone Command CSS
 * Locked Concept Art HEX Palette:
 *   #060707 (Obsidian Ink)   | #3A271D (Stitched Leather) | #344D43 (Crypt Moss)
 *   #726F4E (Tarnished Sage) | #9E9165 (Antique Brass)    | #BAB180 (Lantern Parchment)
 * Strict 9-Slice Law:
 *   btn_primary.png: slice `108 98 89 95`
 *   frame_panel.png: slice `189 404 184 408`
 *   ZERO `background-size: 100% 100%` on UI chrome!
 * ========================================================================= */

:root {
  --bg-obsidian: #060707;
  --leather-dark: #231813;
  --leather-mid: #3A271D;
  --crypt-moss: #344D43;
  --sage-olive: #726F4E;
  --brass-gold: #9E9165;
  --parchment-light: #BAB180;
  --text-bright: #F8FAFC;
  --text-amber: #FDE68A;
  --text-muted: #D6D3C4;
  --order-gold: #F59E0B;
  --chaos-crimson: #EF4444;
  --neutral-emerald: #34D399;
  --rare-cyan: #38BDF8;
  --epic-violet: #C084FC;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-obsidian);
  color: var(--text-bright);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.lp-hidden {
  display: none !important;
}

/* RC15 #2731: Hide & exclude underlying HUD/shell/modal controls behind full-viewport overlays from hit-testing */
#top-hud-bar.lp-overlay-occluded,
#top-hud-bar.lp-overlay-occluded *,
#command-zones.lp-overlay-occluded,
#command-zones.lp-overlay-occluded *,
#title-screen.lp-overlay-occluded .title-stage-layout,
#title-screen.lp-overlay-occluded .title-top-controls,
#title-screen.lp-overlay-occluded .title-stage-layout *,
#title-screen.lp-overlay-occluded .title-top-controls *,
#lp-meta-modal-overlay.lp-overlay-occluded,
#lp-meta-modal-overlay.lp-overlay-occluded *,
.tactical-overlay.lp-overlay-occluded,
.tactical-overlay.lp-overlay-occluded * {
  visibility: hidden !important;
  pointer-events: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
  color: var(--text-bright);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* CRITICAL RED-DOT CLIPPING PREVENTION LAW */
button,
.hud-nav-btn,
.hud-util-btn,
.hud-icon-btn,
.stage-cta-btn,
.bag-tool-btn,
.shop-util-btn,
.btn-9slice-primary,
.summary-sec-btn {
  position: relative;
  overflow: visible !important;
}

.btn-label,
.i18n-text {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

.notify-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 35;
  box-sizing: border-box;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #EF4444 0%, #B91C1C 100%);
  border: 1.5px solid #FEF2F2;
  color: #FFFFFF;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  transform: none;
  animation: none;
}

/* =========================================================================
 * STRICT 9-SLICE CHROME (`art_manifest.json` exact pixel coordinates)
 * ========================================================================= */
.btn-9slice-primary {
  background: transparent !important;
  border-style: solid;
  border-color: transparent;
  border-width: 18px 22px 16px 22px;
  border-image: url('../assets/ui/btn_primary.png') 108 98 89 95 fill / 18px 22px 16px 22px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.68));
  padding: 2px 18px;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 800;
  font-size: clamp(14px, 1.25vw, 19px);
  letter-spacing: 0.05em;
  color: #FFFDF7;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.96), 0 0 3px #000000;
  transition: transform 120ms ease, filter 120ms ease;
}

.btn-9slice-primary:hover:not(:disabled) {
  filter: brightness(1.08) drop-shadow(0 6px 14px rgba(245, 158, 11, 0.42));
  transform: translateY(-1px);
}

.btn-9slice-primary:active:not(:disabled) {
  transform: translateY(2px);
}

.frame-9slice-panel {
  background: transparent !important;
  border-style: solid;
  border-color: transparent;
  border-width: 34px 64px 34px 64px;
  border-image: url('../assets/ui/frame_panel.png') 189 404 184 408 fill / 34px 64px 34px 64px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.85));
}

/* =========================================================================
 * SCREEN LAYERS & TITLE SCREEN
 * ========================================================================= */
.screen-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: none;
}

.screen-layer.active {
  display: flex;
}

#title-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

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

.title-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(6, 7, 7, 0.28) 0%, rgba(6, 7, 7, 0.86) 100%);
  pointer-events: none;
}

.title-top-controls {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-util-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  background: rgba(18, 16, 15, 0.90);
  border: 1.5px solid var(--brass-gold);
  color: var(--text-bright);
  font-size: 12.5px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: transform 120ms ease, border-color 120ms ease;
}

.hud-util-btn:hover {
  border-color: var(--text-amber);
  transform: translateY(-1px);
}

.util-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.title-center-card {
  position: relative;
  z-index: 4;
  width: min(650px, 90vw);
  text-align: center;
  padding: 12px 18px 16px;
}

.title-crest-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.title-crest-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.title-eyebrow {
  font-family: 'Marcellus', Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--parchment-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.title-heading {
  margin: 0 0 8px;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 800;
  font-size: clamp(24px, 2.8vw, 40px);
  letter-spacing: 0.05em;
  color: var(--text-amber);
  text-shadow: 0 3px 0 #1A1025, 0 0 18px rgba(245, 166, 35, 0.45);
}

.title-subtitle {
  margin: 0 0 18px;
  font-size: clamp(13px, 1.1vw, 16px);
  color: #E2E8F0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.title-load-wrap {
  width: min(420px, 100%);
  margin: 0 auto 8px;
}

.title-load-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(6, 7, 7, 0.85);
  border: 1px solid var(--brass-gold);
  overflow: hidden;
  padding: 1px;
}

.title-load-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #92400E 0%, #F59E0B 60%, #FDE68A 100%);
  transition: width 120ms ease-out;
}

.title-load-text {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--parchment-light);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.title-cta-group {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.title-play-btn {
  min-width: 230px;
}

/* =========================================================================
 * 16:9 3-ZONE COMMAND SHELL (#game-shell — >= 96% Viewport Utilization!)
 * ========================================================================= */
#game-shell {
  flex-direction: column;
  padding: 6px 10px 8px;
  gap: 6px;
  background:
    radial-gradient(circle at 50% 15%, rgba(58, 39, 29, 0.45) 0%, rgba(6, 7, 7, 0.98) 78%);
}

.top-hud-bar {
  position: relative;
  z-index: 230;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 5px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(35, 24, 19, 0.96) 0%, rgba(14, 16, 17, 0.96) 100%);
  border: 1.5px solid rgba(158, 145, 101, 0.68);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.hud-brand-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
}

.pippa-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--text-amber);
  background: radial-gradient(circle, #3A271D 0%, #060707 100%);
  overflow: hidden;
  flex-shrink: 0;
}

.pippa-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-floor-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hud-floor-title {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 800;
  font-size: clamp(12px, 1.0vw, 15px);
  color: var(--text-amber);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  line-height: 1.1;
}

.hud-mode-pill {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(52, 77, 67, 0.88);
  border: 1px solid var(--brass-gold);
  color: #FFFBEB;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.hud-mode-pill.combat {
  background: rgba(153, 27, 27, 0.90);
  border-color: #FCA5A5;
}

.hud-currency-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(8, 10, 11, 0.92);
  border: 1px solid rgba(158, 145, 101, 0.62);
  color: #F8FAFC;
  font-weight: 800;
  font-size: clamp(11.5px, 0.9vw, 13.5px);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

.currency-pill-btn {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  /* RC8 #2143: Keep hit box stationary on pointerdown so bindJuicyButtons shrink never drops clicks */
  transform: none !important;
  translate: none !important;
  scale: none !important;
}

.currency-pill-btn > * {
  pointer-events: none;
}

.currency-pill-btn:hover {
  border-color: var(--text-amber);
  background: rgba(34, 25, 18, 0.96);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.45), 0 0 10px rgba(245, 158, 11, 0.25);
}

.currency-pill-btn:active {
  filter: brightness(1.16);
}

.currency-pill-btn.active {
  border-color: #FDE68A;
  background: linear-gradient(180deg, rgba(146, 64, 14, 0.85) 0%, rgba(45, 22, 10, 0.96) 100%);
  box-shadow: 0 0 0 1px rgba(253, 230, 138, 0.65), 0 0 12px rgba(245, 158, 11, 0.38);
}

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

.currency-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #D97706;
  color: #FFFBEB;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

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

.hud-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(58, 39, 29, 0.92) 0%, rgba(24, 18, 15, 0.95) 100%);
  border: 1px solid rgba(158, 145, 101, 0.65);
  color: #F8FAFC;
  font-size: clamp(10px, 0.76vw, 12.5px);
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: transform 110ms ease, border-color 110ms ease;
}

.hud-nav-btn:hover {
  border-color: var(--text-amber);
  transform: translateY(-1px);
}

.hud-nav-btn.locked-feature {
  opacity: 0.62;
  background: rgba(18, 20, 22, 0.88);
  border-style: dashed;
}

.hud-nav-vault {
  background: linear-gradient(180deg, rgba(146, 64, 14, 0.92) 0%, rgba(69, 26, 3, 0.96) 100%);
  border-color: #F59E0B;
}

.hud-quit-accent:hover {
  border-color: #EF4444;
}

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

.hud-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: rgba(22, 24, 26, 0.92);
  border: 1px solid rgba(158, 145, 101, 0.6);
  color: #F8FAFC;
}

.hud-icon-btn:hover {
  border-color: var(--text-amber);
}

/* =========================================================================
 * 3-ZONE GRID (20% LEFT | 50% CENTER | 30% RIGHT)
 * ========================================================================= */
.command-zones {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(195px, 19.5%) minmax(0, 50.5%) minmax(295px, 30%);
  gap: 8px;
}

.left-rail,
.center-stage,
.right-sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.left-rail,
.right-sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}

.rail-card,
.sidebar-card {
  background: linear-gradient(180deg, rgba(31, 23, 19, 0.95) 0%, rgba(12, 14, 15, 0.96) 100%);
  border: 1.5px solid rgba(158, 145, 101, 0.58);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: inset 0 1px 0 rgba(186, 177, 128, 0.16);
}

.rail-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.rail-heading {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 800;
  font-size: clamp(12px, 0.95vw, 14px);
  color: var(--text-amber);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.rail-sub-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--parchment-light);
  background: rgba(52, 77, 67, 0.55);
  border: 1px solid rgba(158, 145, 101, 0.45);
  border-radius: 999px;
  padding: 1px 7px;
}

.gauge-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(6, 7, 7, 0.9);
  border: 1px solid rgba(158, 145, 101, 0.45);
  overflow: hidden;
  margin-top: 5px;
}

.gauge-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 180ms ease-out;
}

.fill-gold {
  background: linear-gradient(90deg, #9E9165 0%, #FDE68A 100%);
}

.fill-amber {
  background: linear-gradient(90deg, #B45309 0%, #F59E0B 100%);
}

.rail-food-block {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(158, 145, 101, 0.25);
}

.food-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #F8FAFC;
}

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

.tabular-val {
  font-weight: 800;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-amber);
}

.pity-shield-pill {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(52, 77, 67, 0.65);
  border: 1px solid rgba(186, 177, 128, 0.55);
  color: #F8FAFC;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.pity-shield-pill.used {
  background: rgba(30, 32, 34, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
  color: #CBD5E1;
}

.rail-section-title {
  margin: 0 0 6px;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 800;
  font-size: clamp(11.5px, 0.9vw, 13.5px);
  color: var(--text-amber);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.faction-triangle-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.faction-chain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

.faction-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(10, 12, 14, 0.9);
  border: 1px solid rgba(158, 145, 101, 0.5);
  color: #F8FAFC;
}

.faction-chip.order { border-color: var(--order-gold); }
.faction-chip.chaos { border-color: var(--chaos-crimson); }
.faction-chip.neutral { border-color: var(--neutral-emerald); }

.chain-arrow {
  font-weight: 800;
  font-size: 11px;
  color: var(--text-amber);
}

.faction-rule-note {
  font-size: 10.5px;
  font-weight: 700;
  color: #E2E8F0;
  background: rgba(6, 7, 7, 0.72);
  padding: 4px 6px;
  border-radius: 5px;
  text-align: center;
}

.rail-blessings-card {
  flex: 1 1 auto;
  min-height: 110px;
  display: flex;
  flex-direction: column;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(6, 7, 7, 0.9);
  border: 1px solid var(--brass-gold);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-amber);
  font-variant-numeric: tabular-nums;
}

.blessings-scroll-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.blessing-mini-card {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(58, 39, 29, 0.68);
  border: 1px solid rgba(158, 145, 101, 0.5);
}

.blessing-mini-card img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.blessing-mini-info {
  min-width: 0;
  flex: 1;
}

.blessing-mini-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-amber);
}

.blessing-mini-desc {
  font-size: 10px;
  color: #E2E8F0;
  line-height: 1.25;
}

.empty-note {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 8px 4px;
  line-height: 1.35;
}

/* =========================================================================
 * ZONE 2: CENTER STAGE (DUNGEON <-> ARENA CANVAS + 4-HERO PARTY BAR)
 * ========================================================================= */
.stage-action-bar {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 4px 9px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(28, 22, 18, 0.95) 0%, rgba(12, 14, 15, 0.95) 100%);
  border: 1.5px solid rgba(158, 145, 101, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-status-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.stage-context-text {
  font-size: clamp(11px, 0.85vw, 13px);
  font-weight: 700;
  color: #F8FAFC;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.passive-badges-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.combat-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: rgba(153, 27, 27, 0.92);
  border: 1px solid #FCA5A5;
  color: #FFFBEB;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.combat-badge.shield {
  background: rgba(30, 64, 175, 0.92);
  border-color: #93C5FD;
}

.combat-badge.counter {
  background: rgba(146, 64, 14, 0.95);
  border-color: #FDE68A;
}

.stage-controls-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.speed-group {
  display: inline-flex;
  background: rgba(6, 7, 7, 0.9);
  border: 1px solid rgba(158, 145, 101, 0.55);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}

.speed-btn {
  padding: 3px 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #CBD5E1;
  font-size: 11.5px;
  font-weight: 800;
}

.speed-btn.active {
  background: linear-gradient(180deg, #D97706 0%, #92400E 100%);
  color: #FFFBEB;
}

.stage-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(36, 28, 22, 0.95);
  border: 1px solid var(--brass-gold);
  color: #F8FAFC;
  font-size: 11.5px;
  font-weight: 700;
}

.stage-cta-btn.campfire-btn {
  background: linear-gradient(180deg, #B45309 0%, #78350F 100%);
  border-color: #FDE68A;
  color: #FFFBEB;
}

.playfield-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  border-radius: 11px;
  border: 1.5px solid rgba(158, 145, 101, 0.65);
  background: #090B0C;
  overflow: hidden;
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.85);
}

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

.idle-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
}

#webgl-fx-canvas {
  z-index: 12;
}

#cutin-overlay-canvas {
  z-index: 18;
}

.combat-ticker {
  position: absolute;
  bottom: 8px;
  left: 10px;
  z-index: 10;
  max-width: 72%;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(6, 7, 7, 0.78);
  border: 1px solid rgba(158, 145, 101, 0.42);
  color: #F8FAFC;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  text-shadow: 0 1px 2px #000000;
}

.combat-ticker:empty {
  display: none;
}

/* Non-Blocking FTUE Coach Banner */
.tutorial-card {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 11px;
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(35, 24, 19, 0.96) 0%, rgba(52, 77, 67, 0.95) 100%);
  border: 1.5px solid var(--text-amber);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.78);
}

.tutorial-card-body {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.tutorial-step-pill {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #D97706;
  color: #FFFBEB;
  font-size: 10.5px;
  font-weight: 800;
}

.tutorial-text {
  font-size: clamp(11px, 0.88vw, 13px);
  font-weight: 700;
  color: #FFFBEB;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.tutorial-skip-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(6, 7, 7, 0.88);
  border: 1px solid var(--parchment-light);
  color: #F8FAFC;
  font-size: 11px;
  font-weight: 800;
}

/* Bottom 4-Hero Party Formation Bar */
.party-formation-bar {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(31, 23, 19, 0.95) 0%, rgba(11, 13, 14, 0.97) 100%);
  border: 1.5px solid rgba(158, 145, 101, 0.58);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.hero-hud-card {
  min-width: 0;
  padding: 5px 6px;
  border-radius: 8px;
  background: rgba(14, 16, 18, 0.92);
  border: 1px solid rgba(158, 145, 101, 0.48);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-hud-card.ko {
  opacity: 0.48;
}

.hero-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hero-portrait-ring {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1.5px solid var(--brass-gold);
  background: #1B1512;
  overflow: hidden;
  flex-shrink: 0;
}

.hero-portrait-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-meta-col {
  min-width: 0;
  flex: 1;
}

.hero-name-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}

.hero-card-name {
  font-size: 11px;
  font-weight: 800;
  color: #F8FAFC;
  line-height: 1.1;
}

.hero-faction-dot {
  width: 13px;
  height: 13px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero-row-tag {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--parchment-light);
}

.hero-bars-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.hero-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #16A34A 0%, #4ADE80 100%);
  transition: width 120ms linear;
}

.hero-ult-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284C7 0%, #38BDF8 100%);
  transition: width 120ms linear;
}

.dps-share-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dps-share-title {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--parchment-light);
  flex-shrink: 0;
}

.dps-share-meter {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(6, 7, 7, 0.9);
  border: 1px solid rgba(158, 145, 101, 0.4);
  overflow: hidden;
}

.dps-share-fill {
  height: 100%;
  background: linear-gradient(90deg, #D97706 0%, #FDE68A 100%);
  transition: width 180ms ease-out;
}

.dps-share-val {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-amber);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
 * ZONE 3: RIGHT SIDEBAR (6x5 TETRIS BACKPACK + 4-SLOT FLOOR SHOP)
 * ========================================================================= */
.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.sidebar-title-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sidebar-title {
  margin: 0;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 800;
  font-size: clamp(11.5px, 0.92vw, 14px);
  color: var(--text-amber);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.bag-meta-pills {
  display: flex;
  align-items: center;
  gap: 4px;
}

.res-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(52, 77, 67, 0.8);
  border: 1px solid #FDE68A;
  font-size: 10.5px;
  font-weight: 800;
  color: #FFFBEB;
}

.backpack-panel {
  flex: 0 0 auto;
}

.backpack-board-outer {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  max-height: clamp(195px, 31vh, 290px);
  margin: 0 auto;
  border-radius: 9px;
  padding: 6px;
  background: linear-gradient(180deg, #2A1C15 0%, #17110E 100%);
  border: 2px solid var(--brass-gold);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.85);
}

.backpack-grid {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 3px;
}

.bag-slot-cell {
  position: relative;
  border-radius: 5px;
  background: url('../assets/ui/slot_tile.png') center center / cover no-repeat;
  border: 1px solid rgba(158, 145, 101, 0.35);
}

.bag-slot-cell.locked {
  filter: grayscale(0.85) brightness(0.42);
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.3);
}

.bag-slot-cell.locked::after {
  content: "";
  position: absolute;
  inset: 32%;
  border: 1.5px solid rgba(226, 232, 240, 0.45);
  border-radius: 3px;
}

.backpack-items-layer,
.backpack-ghost-layer {
  position: absolute;
  inset: 6px;
  pointer-events: none;
}

.packed-item-node {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  border-radius: 7px;
  border: 2px solid #9CA3AF;
  background: radial-gradient(circle at 50% 40%, rgba(58, 39, 29, 0.90) 0%, rgba(12, 14, 16, 0.92) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 110ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 140ms ease;
}

.packed-item-node:hover,
.packed-item-node.selected {
  z-index: 8;
  box-shadow: 0 0 0 2px #FDE68A, 0 6px 14px rgba(0, 0, 0, 0.8);
}

.packed-item-node.tier-Common { border-color: #9CA3AF; }
.packed-item-node.tier-Rare {
  border-color: #38BDF8;
  background: radial-gradient(circle at 50% 40%, rgba(14, 65, 98, 0.88) 0%, rgba(10, 18, 28, 0.94) 100%);
}
.packed-item-node.tier-Epic {
  border-color: #C084FC;
  background: radial-gradient(circle at 50% 40%, rgba(76, 29, 115, 0.88) 0%, rgba(16, 10, 28, 0.94) 100%);
}
.packed-item-node.tier-Legendary {
  border-color: #F59E0B;
  background: radial-gradient(circle at 50% 40%, rgba(120, 53, 15, 0.92) 0%, rgba(24, 13, 6, 0.95) 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

.packed-item-node.resonating {
  box-shadow: 0 0 10px rgba(253, 230, 138, 0.65), inset 0 0 8px rgba(253, 230, 138, 0.3);
}

.packed-item-node.firing {
  transform: scale(1.07);
}

.packed-item-icon {
  width: 78%;
  height: 78%;
  max-width: 58px;
  max-height: 58px;
  object-fit: contain;
  pointer-events: none;
  transition: transform 110ms ease;
}

.packed-cd-wipe {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(253, 230, 138, 0.35) 0%, rgba(217, 119, 6, 0.28) 100%);
  border-top: 1px solid rgba(253, 230, 138, 0.75);
  pointer-events: none;
}

.packed-tier-pip {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 9px;
  font-weight: 800;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(6, 7, 7, 0.85);
  color: #FFFBEB;
  pointer-events: none;
}

.packed-res-star {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 10px;
  font-weight: 800;
  color: #FDE68A;
  text-shadow: 0 1px 3px #000000;
  pointer-events: none;
}

.ghost-cell {
  position: absolute;
  border-radius: 5px;
  border: 2px solid #22C55E;
  background: rgba(34, 197, 94, 0.28);
}

.ghost-cell.merge {
  border-color: #F59E0B;
  background: rgba(245, 158, 11, 0.36);
}

.ghost-cell.invalid {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.30);
}

.backpack-actions-row {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.bag-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(22, 24, 26, 0.92);
  border: 1px solid rgba(158, 145, 101, 0.55);
  color: #F8FAFC;
  font-size: clamp(10px, 0.78vw, 12px);
  font-weight: 700;
}

.bag-tool-btn:hover {
  border-color: var(--text-amber);
}

.sell-zone-btn.drag-hot {
  background: rgba(146, 64, 14, 0.92);
  border-color: #FDE68A;
}

/* 4-Slot Lockable Floor Shop */
.floor-shop-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.shop-mini-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.shop-util-btn {
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(52, 77, 67, 0.75);
  border: 1px solid var(--brass-gold);
  color: #FFFBEB;
  font-size: clamp(9.5px, 0.74vw, 11.5px);
  font-weight: 800;
}

.shop-util-btn.expand-btn {
  background: rgba(92, 52, 22, 0.88);
}

.floor-shop-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.floor-offer-card {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 8px;
  background: rgba(14, 17, 19, 0.94);
  border: 1px solid rgba(158, 145, 101, 0.52);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.floor-offer-card.sold {
  opacity: 0.45;
}

.offer-top-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.offer-gear-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.offer-title-col {
  min-width: 0;
  flex: 1;
}

.offer-name {
  font-size: 11px;
  font-weight: 800;
  color: #F8FAFC;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.offer-sub {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--parchment-light);
}

.offer-bottom-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.offer-buy-btn {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, #B45309 0%, #78350F 100%);
  border: 1px solid #FDE68A;
  color: #FFFBEB;
  font-size: 11px;
  font-weight: 800;
}

.offer-lock-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  background: rgba(24, 28, 32, 0.95);
  border: 1px solid rgba(158, 145, 101, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #CBD5E1;
  flex-shrink: 0;
}

.offer-lock-btn.locked {
  background: rgba(146, 64, 14, 0.9);
  border-color: #FDE68A;
  color: #FDE68A;
}

/* =========================================================================
 * TACTICAL CELEBRATION & SHRINE OVERLAYS (`minmax(0, 1fr)` containment)
 * ========================================================================= */
.tactical-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(6, 7, 7, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.celebration-dialog {
  position: relative;
  width: min(640px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(35, 24, 19, 0.98) 0%, rgba(12, 14, 16, 0.99) 100%);
  border: 2px solid var(--brass-gold);
  border-radius: 14px;
  padding: 20px 22px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9);
  animation: modalSpringIn 240ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes modalSpringIn {
  0% { opacity: 0; transform: scale(0.85) translateY(10px); }
  70% { opacity: 1; transform: scale(1.03) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.sunburst-spin {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 240px;
  height: 240px;
  margin-left: -120px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(253, 230, 138, 0.16) 0deg 15deg, transparent 15deg 30deg);
  pointer-events: none;
  animation: spinRays 14s linear infinite;
}

@keyframes spinRays {
  to { transform: rotate(360deg); }
}

.celebration-title {
  position: relative;
  margin: 0 0 6px;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 800;
  font-size: clamp(19px, 2.0vw, 26px);
  color: var(--text-amber);
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.95);
}

.celebration-sub {
  position: relative;
  margin: 0 0 14px;
  font-size: 13.5px;
  color: #E2E8F0;
}

.chest-stage-box {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 8px auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chest-vfx-canvas {
  position: absolute;
  inset: -20px;
  width: 190px;
  height: 190px;
  pointer-events: none;
}

.chest-hero-img {
  position: relative;
  width: 112px;
  height: 112px;
  object-fit: contain;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chest-loot-cards {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.loot-reveal-card {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(16, 20, 23, 0.95);
  border: 1.5px solid var(--text-amber);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.loot-reveal-card img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.shrine-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.shrine-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

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

.shrine-choice-card {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding: 12px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(24, 34, 34, 0.96) 0%, rgba(12, 15, 19, 0.98) 100%);
  border: 1.5px solid var(--brass-gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: #F8FAFC;
  transition: transform 130ms ease, border-color 130ms ease;
}

.shrine-choice-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-amber);
}

.shrine-choice-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.summary-stats-box {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
  text-align: left;
}

.summary-stat-pill {
  min-width: 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(14, 18, 20, 0.94);
  border: 1px solid rgba(158, 145, 101, 0.5);
}

.summary-stat-label {
  font-size: 11px;
  color: var(--parchment-light);
}

.summary-stat-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-amber);
  font-variant-numeric: tabular-nums;
}

.summary-actions-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.summary-actions-grid > * {
  min-width: 0;
  max-width: 100%;
}

.summary-sec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(24, 28, 32, 0.95);
  border: 1.5px solid var(--brass-gold);
  color: #F8FAFC;
  font-size: clamp(11px, 0.95vw, 13.5px);
  font-weight: 800;
}

.summary-sec-btn:hover {
  border-color: var(--text-amber);
}

/* =========================================================================
 * TOOLTIP, FLYING BEZIER LOOT & TOASTS
 * ========================================================================= */
.item-tooltip {
  position: fixed;
  z-index: 220;
  width: min(260px, 80vw);
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(10, 12, 14, 0.97);
  border: 1.5px solid var(--text-amber);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.88);
  pointer-events: none;
  font-size: 11.5px;
  color: #F8FAFC;
}

.flying-loot-layer {
  position: fixed;
  inset: 0;
  z-index: 240;
  pointer-events: none;
}

.flying-loot-icon {
  position: fixed;
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
}

.toast-container {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.lp-toast {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(16, 20, 22, 0.96);
  border: 1.5px solid var(--text-amber);
  color: #FFFBEB;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.8);
}

/* =========================================================================
 * RESPONSIVE < 900PX FALLBACK STACK
 * ========================================================================= */
@media (max-width: 900px) {
  html, body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  #game-shell {
    position: relative;
    height: auto;
    min-height: 100vh;
  }

  .top-hud-bar {
    flex-wrap: wrap;
  }

  .command-zones {
    grid-template-columns: minmax(0, 1fr);
  }

  .playfield-viewport {
    min-height: 300px;
  }

  .party-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shrine-cards-grid,
  .summary-actions-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* =========================================================================
 * SPINE-DNA v2.4 + 3D VOLUMETRIC VFX HOT-PATCH STYLES
 * ========================================================================= */
.title-stage-layout {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 40px);
  max-width: min(1040px, 94vw);
  padding: 12px;
  pointer-events: none;
}

.title-stage-layout .title-center-card,
.title-stage-layout button {
  pointer-events: auto;
}

.title-hero-showcase {
  position: relative;
  flex: 0 0 auto;
  width: clamp(190px, 22vw, 270px);
  height: clamp(240px, 34vh, 320px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 45%, rgba(245, 158, 11, 0.24) 0%, rgba(16, 18, 26, 0.72) 68%, rgba(6, 7, 7, 0) 100%);
  pointer-events: none;
  overflow: visible;
}

.title-hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.78)) drop-shadow(0 0 22px rgba(245, 158, 11, 0.32));
  will-change: transform;
}

@media (max-width: 820px) {
  .title-stage-layout {
    flex-direction: column;
    gap: 10px;
  }
  .title-hero-showcase {
    width: 150px;
    height: 150px;
  }
}

#vfx-3d-volumetric-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 6;
}

#ui-vfx-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 260;
}

.tb-slot-vfx-host {
  overflow: visible !important;
}

/* =========================================================================
 * SEASON 2–4 (v2.1 -> v5.0) LIVE-OPS UI, THEMES, MINIMAP & MYTHIC TIER
 * ========================================================================= */
.fill-teal {
  background: linear-gradient(90deg, #0D9488 0%, #2DD4BF 65%, #FEF08A 100%);
}

.rail-minimap-wrap {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(158, 145, 101, 0.25);
}

.minimap-caption {
  font-size: 11px;
  font-weight: 800;
  color: var(--parchment-light);
}

.rail-esc-pill {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.28);
  border: 1px solid #A855F7;
  color: #F3E8FF;
  font-size: 10px;
  font-weight: 800;
}

.rail-minimap-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  width: 100%;
  max-width: 145px;
  margin: 0 auto;
}

.mm-cell {
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: rgba(11, 13, 15, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.mm-cell.mm-mem {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(148, 163, 184, 0.45);
}

.mm-cell.mm-rev {
  background: rgba(58, 39, 29, 0.85);
  border-color: rgba(158, 145, 101, 0.55);
}

.mm-cell.mm-clr {
  background: rgba(52, 77, 67, 0.65);
}

.mm-cell.mm-poi {
  border-color: #FBBF24;
  background: rgba(146, 64, 14, 0.65);
}

.mm-cell.mm-boss {
  border-color: #EF4444;
  background: rgba(153, 27, 27, 0.78);
}

.mm-cell.mm-rift {
  border-color: #C084FC;
  background: rgba(107, 33, 168, 0.78);
}

.mm-cell.mm-player {
  background: #FDE047 !important;
  border-color: #FFFFFF !important;
  box-shadow: 0 0 6px rgba(253, 224, 71, 0.85);
}

.stage-cta-btn.relight-btn {
  background: linear-gradient(180deg, #F59E0B 0%, #B45309 100%);
  border-color: #FEF08A;
  color: #FFFBEB;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
}

.stage-cta-btn.synth-btn {
  background: linear-gradient(180deg, #0D9488 0%, #115E59 100%);
  border-color: #99F6E4;
  color: #F0FDFA;
}

.preset-mini-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.preset-mini-btn,
.dps-log-mini-btn {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(18, 22, 26, 0.92);
  border: 1px solid rgba(158, 145, 101, 0.52);
  color: #CBD5E1;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
}

.preset-mini-btn.active {
  background: linear-gradient(180deg, #D97706 0%, #92400E 100%);
  border-color: #FDE68A;
  color: #FFFBEB;
}

.dps-log-mini-btn:hover,
.preset-mini-btn:hover {
  border-color: #FDE68A;
  color: #FFFBEB;
}

.backpack-actions-3col {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.autofit-btn {
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.55) 0%, rgba(15, 23, 42, 0.94) 100%);
  border-color: rgba(45, 212, 191, 0.72);
  color: #CCFBF1;
}

.bag-slot-cell.oiled-cell {
  box-shadow: inset 0 0 10px rgba(251, 191, 36, 0.42);
  border-color: rgba(251, 191, 36, 0.75);
}

.bag-slot-cell.col-locked {
  background-color: rgba(127, 29, 29, 0.48);
  border-color: #F87171;
  box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.45);
}

.packed-item-node.tier-Mythic {
  border-color: #F43F5E;
  background: radial-gradient(circle at 50% 40%, rgba(159, 18, 57, 0.92) 0%, rgba(30, 10, 24, 0.96) 100%);
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.58), inset 0 0 8px rgba(254, 240, 138, 0.35);
}

.packed-awaken-pip {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 9px;
  font-weight: 800;
  color: #FDA4AF;
  text-shadow: 0 1px 2px #000000;
  pointer-events: none;
}

/* Wardrobe Lantern-Frame Borders (v3.7 / v4.0 / v4.7) */
#game-shell[data-frame="frame_crimson_reliquary"] .backpack-board-outer,
#game-shell[data-frame="frame_crimson_reliquary"] .party-formation-bar {
  border-color: #EF4444;
  box-shadow: inset 0 0 18px rgba(239, 68, 68, 0.25);
}

#game-shell[data-frame="frame_clockwork_cog"] .backpack-board-outer,
#game-shell[data-frame="frame_clockwork_cog"] .party-formation-bar {
  border-color: #F59E0B;
  box-shadow: inset 0 0 18px rgba(245, 158, 11, 0.28);
}

#game-shell[data-frame="frame_sovereign_gear"] .backpack-board-outer,
#game-shell[data-frame="frame_sovereign_gear"] .party-formation-bar {
  border-color: #FDE047;
  box-shadow: 0 0 14px rgba(253, 224, 71, 0.28), inset 0 0 20px rgba(245, 158, 11, 0.32);
}

#game-shell[data-frame="frame_starlight_cathedral"] .backpack-board-outer,
#game-shell[data-frame="frame_starlight_cathedral"] .party-formation-bar {
  border-color: #818CF8;
  box-shadow: 0 0 14px rgba(129, 140, 248, 0.30), inset 0 0 22px rgba(168, 85, 247, 0.28);
}

/* Wardrobe Crypt Visual Themes (v2.7 / v4.7) */
#game-shell[data-theme="theme_ossuary_amber"] {
  background: radial-gradient(circle at 50% 15%, rgba(13, 148, 136, 0.28) 0%, rgba(6, 7, 7, 0.98) 78%);
}

#game-shell[data-theme="theme_foundry_brass"] {
  background: radial-gradient(circle at 50% 15%, rgba(180, 83, 9, 0.32) 0%, rgba(6, 7, 7, 0.98) 78%);
}

#game-shell[data-theme="theme_starlight_prestige"] {
  background: radial-gradient(circle at 50% 15%, rgba(109, 40, 217, 0.32) 0%, rgba(6, 7, 7, 0.98) 78%);
}

/* Clean HUD Toggle (v4.4) */
#game-shell.clean-hud #combat-ticker,
#game-shell.clean-hud #rail-minimap-wrap {
  display: none !important;
}

/* RC5 Starvation / 0% Torch Danger Indicators (#1992 / #1994) */
@keyframes lpDangerPulse {
  0%, 100% { color: #FCA5A5; text-shadow: 0 0 6px rgba(239, 68, 68, 0.65); }
  50%      { color: #EF4444; text-shadow: 0 0 12px rgba(239, 68, 68, 0.95); }
}
.stat-danger-pulse {
  animation: lpDangerPulse 1.1s ease-in-out infinite;
  font-weight: 800;
}
#stage-context-text.stage-danger-warn {
  color: #FCA5A5;
  font-weight: 800;
}

/* Backpack Slot A <-> Slot B swap preview */
.ghost-cell.swap { background: rgba(56, 189, 248, 0.32); outline: 2px dashed #38BDF8; }

