/* ==========================================================================
   Moonborn Codex — Commercial 16:9 PC Widescreen Dark-Celestial Stylesheet
   Archetype: dark_arcane_rpg (daylightMode: false)
   Strict Hygiene: ZERO backdrop-filter: blur(), Clean 9-Slice border-image,
   WCAG AA+ Typography (#14121F on gold btn_primary & parchment cards, #F8FAFC on obsidian)
   ========================================================================== */

:root {
  /* Extracted Concept Art HEX Palette (art_manifest.json) */
  --pal-obsidian: #07080C;
  --pal-ink: #000003;
  --pal-sanctum: #171B28;
  --pal-slate: #343A4C;
  --pal-astral-teal: #3D5E6F;
  --pal-parchment: #C2CBA3;
  --pal-parchment-light: #D4DCC6;
  --pal-sage: #879389;
  --pal-ash: #6C6369;

  /* Luminous Functional Accents */
  --gold-bright: #FDE68A;
  --gold-lunar: #F2C97D;
  --gold-amber: #F59E0B;
  --ether-cyan: #4BC7E8;
  --fire-crimson: #F97316;
  --water-azure: #38BDF8;
  --earth-ochre: #84CC16;
  --pierce-danger: #EF4444;
  --pierce-bg: #3D1B28;
  --violet-arcane: #A855F7;

  /* Fonts */
  --font-display: 'Cinzel', 'Marcellus', Georgia, serif;
  --font-accent: 'Marcellus', 'Cinzel', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-drag: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--pal-obsidian);
  color: #F8FAFC;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

#app-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.ui-motion-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9400;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

.full-w {
  width: 100%;
}

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

/* ==========================================================================
   9-SLICE ANTI-DISTORTION CHROME (EXACT art_manifest.json specs)
   ========================================================================== */

.frame-panel-9s {
  box-sizing: border-box;
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 24px 24px 26px 24px;
  border-image: url('../assets/ui/frame_panel.png') 173 169 185 170 fill / 24px 24px 26px 24px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.72));
}

.btn-primary-9s {
  box-sizing: border-box;
  background-color: #D8AD58;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 6.000px 5.750px 5.500px 5.750px;
  border-image: url('../assets/ui/btn_primary.png') 24 23 22 23 fill / 6.000px 5.750px 5.500px 5.750px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  color: #14121F !important;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255, 250, 225, 0.55);
  padding: 8px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  overflow: visible !important;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.65));
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-primary-9s span,
.btn-primary-9s kbd {
  color: #14121F;
}

.btn-primary-9s:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.07) drop-shadow(0 6px 8px rgba(245, 166, 35, 0.32));
}

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

.btn-primary-9s:disabled {
  opacity: 0.48;
  filter: grayscale(0.45);
  cursor: not-allowed;
}

/* Sculpted Dark Obsidian Action Buttons (Zero raster corner leak!) */
.btn-obsidian-action,
.btn-obsidian-pill,
.btn-hud-compact,
.btn-hud-icon {
  background: linear-gradient(180deg, #252B3D 0%, #171B28 100%);
  border: 2px solid #4A5568;
  border-radius: 8px;
  color: #F8FAFC;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: visible !important;
  transition: transform 0.12s ease, border-color 0.14s ease, background 0.14s ease;
}

.btn-obsidian-action {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.86rem;
}

.btn-obsidian-pill {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 0.8rem;
}

.btn-obsidian-action:hover:not(:disabled),
.btn-obsidian-pill:hover:not(:disabled),
.btn-hud-compact:hover:not(:disabled),
.btn-hud-icon:hover:not(:disabled) {
  border-color: var(--gold-lunar);
  background: linear-gradient(180deg, #313952 0%, #1E2436 100%);
  transform: translateY(-1px);
}

.btn-obsidian-action:active:not(:disabled),
.btn-obsidian-pill:active:not(:disabled),
.btn-hud-compact:active:not(:disabled),
.btn-hud-icon:active:not(:disabled) {
  transform: translateY(2px);
}

.btn-danger-outline {
  border-color: #7F1D1D !important;
  color: #FCA5A5 !important;
}

.btn-danger-outline:hover:not(:disabled) {
  border-color: #EF4444 !important;
  background: linear-gradient(180deg, #451A23 0%, #260E14 100%) !important;
}

.btn-hud-gold {
  border-color: #F59E0B;
  background: linear-gradient(180deg, #3D2B14 0%, #24180B 100%);
  color: #FDE68A;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.22);
}

.btn-hud-gold:hover:not(:disabled) {
  border-color: #FDE047;
  background: linear-gradient(180deg, #523919 0%, #2F1F0E 100%);
}

/* Text-clipping ONLY on inner span so .notify-badge NEVER gets sliced! */
.notify-host {
  overflow: visible !important;
  position: relative !important;
}

.btn-clip-label {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notify-badge {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 15px;
  max-width: calc(100% - 4px);
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: linear-gradient(180deg, #FB7185 0%, #E11D48 100%);
  border: 1.5px solid #07080C;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  line-height: 12px;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 30;
  pointer-events: none;
  animation: notifyPulse 1.6s infinite ease-in-out;
}

@keyframes notifyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.58); }
  50% { box-shadow: 0 0 0 3px rgba(251, 113, 133, 0); }
}

/* Painted Icons */
.hud-icon-xs { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.hud-icon-sm { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.hud-icon-md { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.btn-inline-icon { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.choice-lg-icon { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }

/* ==========================================================================
   SCREENS & TITLE SCREEN
   ========================================================================== */

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

#title-screen {
  justify-content: space-between;
  align-items: center;
  background-color: #07080C;
}

.title-bg-layer {
  position: absolute;
  inset: -2%;
  background: url('../assets/art/title_bg.jpg') center center / cover no-repeat;
  filter: brightness(0.76) contrast(1.06);
  animation: slowBgDrift 26s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes slowBgDrift {
  0% { transform: scale(1.02) translate3d(-0.6%, -0.4%, 0); }
  100% { transform: scale(1.06) translate3d(0.6%, 0.4%, 0); }
}

.title-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(7, 8, 12, 0.22) 0%, rgba(7, 8, 12, 0.84) 100%);
  z-index: 1;
  pointer-events: none;
}

.title-ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.title-top-bar {
  position: relative;
  z-index: 5;
  width: 100%;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.title-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(23, 27, 40, 0.88);
  border: 1px solid rgba(242, 201, 125, 0.35);
  color: var(--gold-lunar);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.title-util-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-center-stage {
  position: relative;
  z-index: 4;
  width: min(1240px, 94vw);
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 47fr) minmax(0, 53fr);
  align-items: center;
  gap: 28px;
  padding-bottom: 20px;
}

.title-hero-showcase {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: min(540px, 72vh);
  overflow: visible;
}

.title-hero-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(440px, 42vw);
  height: min(440px, 42vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(75, 199, 232, 0.34) 0%, rgba(242, 201, 125, 0.16) 44%, rgba(7, 8, 12, 0) 72%);
  pointer-events: none;
  animation: titleHaloBreath 5.2s ease-in-out infinite alternate;
}

@keyframes titleHaloBreath {
  0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.82; }
  100% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}

.title-lunar-ring {
  position: absolute;
  top: 48%;
  left: 50%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.title-lunar-ring-outer {
  width: min(420px, 40vw);
  height: min(420px, 40vw);
  border: 1.5px dashed rgba(242, 201, 125, 0.34);
  box-shadow: 0 0 26px rgba(75, 199, 232, 0.16), inset 0 0 22px rgba(242, 201, 125, 0.12);
  animation: titleRingSpinCW 38s linear infinite;
}

.title-lunar-ring-inner {
  width: min(320px, 31vw);
  height: min(320px, 31vw);
  border: 1.5px solid rgba(75, 199, 232, 0.32);
  border-top-color: rgba(253, 230, 138, 0.72);
  border-bottom-color: rgba(75, 199, 232, 0.08);
  animation: titleRingSpinCCW 22s linear infinite;
}

@keyframes titleRingSpinCW {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes titleRingSpinCCW {
  0% { transform: translate(-50%, -50%) rotate(360deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg); }
}

.title-flank-portrait {
  position: absolute;
  bottom: 24%;
  height: min(270px, 39vh);
  max-width: 48%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  opacity: 0.56;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 70%, rgba(0, 0, 0, 0) 100%);
}

.title-flank-left {
  left: -8%;
  filter: brightness(0.76) saturate(0.88) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 18px rgba(75, 199, 232, 0.28));
  animation: titleFlankFloatL 6.4s ease-in-out infinite alternate;
}

.title-flank-right {
  right: -5%;
  bottom: 22%;
  filter: brightness(0.78) saturate(0.94) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 20px rgba(242, 201, 125, 0.30));
  animation: titleFlankFloatR 5.8s ease-in-out infinite alternate;
}

@keyframes titleFlankFloatL {
  0% { transform: translate3d(0, 4px, 0) scale(0.98); }
  100% { transform: translate3d(-4px, -7px, 0) scale(1.01); }
}

@keyframes titleFlankFloatR {
  0% { transform: translate3d(0, -5px, 0) scale(0.99); }
  100% { transform: translate3d(4px, 6px, 0) scale(1.02); }
}

#title-hero-portrait {
  max-width: 92%;
  max-height: 94%;
  object-fit: contain;
  position: relative;
  z-index: 4;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 22px rgba(75, 199, 232, 0.24));
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 84%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 84%, rgba(0, 0, 0, 0) 100%);
  animation: titleScribeFloat 4.6s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes titleScribeFloat {
  0% { transform: translate3d(0, 4px, 0) scale(0.995); }
  100% { transform: translate3d(0, -8px, 0) scale(1.018); }
}

.title-menu-column {
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.title-kicker {
  font-family: var(--font-accent);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--ether-cyan);
  text-transform: uppercase;
}

.title-logo-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  letter-spacing: 0.06em;
  color: #FDE68A;
  text-shadow: 0 3px 0 #1A1025, 0 0 22px rgba(245, 166, 35, 0.52), 0 0 42px rgba(75, 199, 232, 0.22);
  line-height: 1.08;
  position: relative;
}

.title-logo-heading::after {
  content: '';
  display: block;
  margin-top: 8px;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, rgba(242, 201, 125, 0.85) 0%, rgba(75, 199, 232, 0.72) 55%, rgba(75, 199, 232, 0) 100%);
  opacity: 0.78;
}

.title-tagline {
  margin: 0;
  color: var(--pal-parchment-light);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Boot Progress Bar */
.boot-loader {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(12, 15, 24, 0.86);
  border: 1px solid rgba(75, 199, 232, 0.35);
  border-radius: 10px;
}

.boot-loader-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  color: var(--ether-cyan);
}

.boot-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #0B0E17;
  border: 1px solid #2D3748;
  overflow: hidden;
}

.boot-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38BDF8 0%, #FDE68A 100%);
  transition: width 0.16s ease-out;
}

.title-cta-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-cta-hero {
  width: 100%;
  max-width: 340px;
  margin-inline: auto;
  min-height: 54px;
  font-size: 1.08rem;
}

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

.title-secondary-grid .btn-obsidian-action {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}

.title-secondary-grid > * {
  min-width: 0;
  max-width: 100%;
}

.title-currencies-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.currency-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  color: var(--gold-lunar);
}

.currency-chip-sub {
  color: var(--pal-sage);
  font-weight: 600;
  font-size: 0.78rem;
}

/* ==========================================================================
   TOP COMPACT HUD BAR (44px) & 16:9 3-COLUMN COMMAND DESK
   ========================================================================== */

.top-hud-bar {
  height: 46px;
  min-height: 46px;
  width: 100%;
  padding: 0 12px;
  background: linear-gradient(180deg, #171B28 0%, #0D1019 100%);
  border-bottom: 2px solid #2B3348;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 20;
}

.hud-left-cluster,
.hud-right-cluster {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.btn-hud-compact {
  height: 30px;
  padding: 0 8px;
  font-size: 0.73rem;
  white-space: nowrap;
}

.btn-hud-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  font-weight: 800;
}

.hud-act-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: 7px;
  background: rgba(61, 94, 111, 0.32);
  border: 1px solid rgba(75, 199, 232, 0.45);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--gold-bright);
  white-space: nowrap;
}

.hud-hp-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hud-hp-track {
  position: relative;
  width: 146px;
  height: 26px;
  border-radius: 6px;
  background: #140C14;
  border: 2px solid #4A2533;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-hp-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #BE123C 0%, #FB7185 100%);
  transition: width 0.2s ease-out;
}

.hud-hp-text {
  position: relative;
  z-index: 2;
  font-size: 0.78rem;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

.hud-stat-pill,
.hud-currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  background: rgba(13, 17, 28, 0.9);
  border: 1px solid #343A4C;
  font-size: 0.82rem;
  color: #F8FAFC;
  white-space: nowrap;
}

.shield-pill {
  border-color: rgba(75, 199, 232, 0.55);
  color: var(--ether-cyan);
}

.shards-pill {
  border-color: rgba(168, 85, 247, 0.5);
  color: #E9D5FF;
}

/* Main 3-Column Command Grid (Left 22% | Center 54% | Right 24%) */
.command-desk-grid {
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 8px 10px 10px;
  display: grid;
  grid-template-columns: minmax(0, 22fr) minmax(0, 54fr) minmax(0, 24fr);
  gap: 10px;
  background: radial-gradient(circle at 50% 35%, #171B28 0%, #07080C 100%);
}

.desk-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.col-left,
.col-right {
  border-width: 18px 18px 20px 18px;
  border-image-width: 18px 18px 20px 18px;
  gap: 8px;
  overflow: hidden;
}

.col-center {
  gap: 8px;
}

/* ==========================================================================
   LEFT COLUMN: 5-ACT HEX MAP & DIMENSIONAL GATE TRACKER
   ========================================================================== */

.panel-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.panel-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}

.panel-sub {
  font-size: 0.72rem;
  color: var(--pal-sage);
}

.mini-tab-switch {
  display: inline-flex;
  background: #0C0F18;
  border: 1px solid #2D3548;
  border-radius: 6px;
  padding: 2px;
  flex-shrink: 0;
}

.mini-tab {
  background: transparent;
  border: none;
  color: var(--pal-sage);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.mini-tab.active {
  background: #2B354C;
  color: var(--gold-bright);
}

.act-pips-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.act-pip {
  height: 20px;
  border-radius: 4px;
  background: #121622;
  border: 1px solid #2D3548;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--pal-sage);
}

.act-pip.current {
  background: rgba(75, 199, 232, 0.22);
  border-color: var(--ether-cyan);
  color: #FFFFFF;
}

.act-pip.cleared {
  background: rgba(242, 201, 125, 0.2);
  border-color: var(--gold-lunar);
  color: var(--gold-bright);
}

.hex-map-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hex-map-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 50%, rgba(28, 35, 52, 0.85) 0%, rgba(9, 11, 18, 0.96) 100%);
  border: 1px solid #2A3246;
  overflow: hidden;
}

.hex-map-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hex-map-nodes {
  position: absolute;
  inset: 0;
}

.hex-node-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 64px;
  max-width: 76px;
  height: 44px;
  padding: 3px 6px;
  background: linear-gradient(180deg, #252C3F 0%, #151925 100%);
  border: 2px solid #434E68;
  border-radius: 10px;
  color: #CBD5E1;
  font-family: var(--font-body);
  font-size: 0.71rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  overflow: visible !important;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.hex-node-btn.fogged {
  opacity: 0.42;
  filter: saturate(0.35);
  cursor: default;
}

.hex-node-btn.cleared {
  border-color: #64748B;
  background: #111520;
  color: #94A3B8;
  opacity: 0.72;
  cursor: default;
}

.hex-node-btn.current {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, #3B3022 0%, #1F1A14 100%);
  color: var(--gold-bright);
}

.hex-node-btn.reachable {
  border-color: var(--ether-cyan);
  background: linear-gradient(180deg, #1E3A4C 0%, #112230 100%);
  color: #FFFFFF;
  animation: hexPulse 1.5s infinite ease-in-out;
}

.hex-node-btn.reachable:hover {
  transform: translate(-50%, -54%) scale(1.06);
  border-color: var(--gold-bright);
}

@keyframes hexPulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(75, 199, 232, 0.45)); }
  50% { filter: drop-shadow(0 0 11px rgba(75, 199, 232, 0.95)); }
}

.hex-pierce-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: #7F1D1D;
  border: 1px solid #FCA5A5;
  color: #FEE2E2;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 12px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  z-index: 5;
  pointer-events: none;
}

.map-legend-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.69rem;
  color: var(--pal-sage);
}

.pierce-warn-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #FCA5A5;
  font-weight: 700;
}

.seed-mono {
  color: #94A3B8;
  font-size: 0.68rem;
}

/* Side Gate Tracker */
.gate-tracker-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gate-badge-card {
  padding: 10px;
  border-radius: 8px;
  background: rgba(16, 20, 32, 0.92);
  border: 1px solid rgba(242, 201, 125, 0.35);
}

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

.gate-lv-kicker {
  font-size: 0.7rem;
  color: var(--ether-cyan);
  text-transform: uppercase;
}

.gate-lv-big {
  font-size: 1.05rem;
  color: var(--gold-bright);
}

.gate-mults-row {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--pal-parchment-light);
}

.side-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--pal-sage);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.side-hazards-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hazard-mini-pill {
  padding: 6px 8px;
  border-radius: 6px;
  background: #121622;
  border: 1px solid #2D3548;
  font-size: 0.72rem;
  color: #CBD5E1;
}

.hazard-mini-pill.active {
  border-color: #EF4444;
  background: rgba(61, 27, 40, 0.65);
  color: #FECACA;
}

/* ==========================================================================
   CENTER COLUMN: TOP 58% BATTLE STAGE + BOTTOM 42% CAST TRAY
   ========================================================================== */

.battle-stage-wrap {
  position: relative;
  flex: 58 1 0%;
  min-height: 0;
  border-radius: 12px;
  border: 2px solid #2D3548;
  background: #07080C;
  overflow: hidden;
}

.battle-canvas,
.vfx-3d-canvas,
.battle-hud-canvas,
.cutin-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vfx-3d-canvas {
  pointer-events: none;
  z-index: 4;
}

.battle-hud-canvas {
  pointer-events: none;
  z-index: 6;
}

.cutin-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 52;
  cursor: pointer;
}

.stage-banner-toast {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(7, 8, 12, 0.9);
  border: 1.5px solid var(--ether-cyan);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  pointer-events: none;
  white-space: nowrap;
}

.stage-status-tooltip {
  position: absolute;
  z-index: 10;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(10, 13, 22, 0.96);
  border: 1px solid var(--gold-lunar);
  color: #F8FAFC;
  font-size: 0.75rem;
  pointer-events: none;
}

.explore-stage-cta {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: rgba(7, 8, 12, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.explore-cta-card {
  max-width: 460px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.explore-cta-desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--pal-parchment-light);
}

.explore-quick-nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

/* Bottom 42%: Drawn Cost Pool + Illuminated Spell Circle Cast Bar */
.cast-tray-wrap {
  flex: 42 1 0%;
  min-height: 0;
  border-width: 16px 18px 18px 18px;
  border-image-width: 16px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cost-pool-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(12, 15, 24, 0.88);
  border: 1px solid #2A3348;
  flex-shrink: 0;
}

.cost-pool-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 36px;
  flex-wrap: nowrap;
}

.turn-pill-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  background: #171B28;
  border: 1px solid #343A4C;
  flex-shrink: 0;
}

.turn-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--pal-sage);
  letter-spacing: 0.06em;
}

.turn-num {
  font-size: 0.88rem;
  color: var(--gold-bright);
  white-space: nowrap;
}

.drawn-cost-pips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
  min-width: 0;
  flex: 1 1 auto;
}

.cost-element-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 9px;
  border-radius: 999px;
  background: #121724;
  border: 1.5px solid #334155;
  font-size: 0.86rem;
  transition: transform 0.16s ease, border-color 0.16s ease;
  flex-shrink: 0;
}

.cost-element-pill.has-tokens {
  transform: scale(1.03);
}

.cost-fire.has-tokens { border-color: #F97316; background: rgba(124, 45, 18, 0.42); color: #FED7AA; }
.cost-water.has-tokens { border-color: #38BDF8; background: rgba(12, 74, 110, 0.45); color: #BAE6FD; }
.cost-earth.has-tokens { border-color: #84CC16; background: rgba(54, 83, 20, 0.45); color: #D9F99D; }
.cost-ether.has-tokens { border-color: #4BC7E8; background: rgba(88, 28, 135, 0.48); color: #F5D0FE; }

.cost-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.cost-el-sym {
  font-size: 0.75rem;
  opacity: 0.85;
}

.cost-cnt {
  font-size: 1rem;
}

.ether-chain-pill {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  padding: 4px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.94) 0%, rgba(109, 40, 217, 0.94) 100%);
  border: 1.5px solid #67E8F9;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(8, 12, 24, 0.65);
}

.btn-end-turn {
  min-height: 36px;
  padding: 5px 12px;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.hotkey-kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(20, 18, 31, 0.18);
  border: 1px solid rgba(20, 18, 31, 0.4);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 800;
}

/* Illuminated Active Spell Circle Bar (1-10) — adaptive fit, zero edge clipping */
.spell-circle-bar {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: safe center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 10px 4px;
}

.spell-circle-bar.hand-dense {
  gap: 5px;
  padding: 12px 6px 4px;
}

.spell-circle-bar.hand-crowded {
  gap: 4px;
  padding: 12px 4px 4px;
}

.spell-card {
  position: relative;
  box-sizing: border-box;
  width: clamp(120px, 10.6vw, 178px);
  min-width: 108px;
  flex: 0 1 168px;
  aspect-ratio: 0.72;
  height: auto;
  max-height: calc(100% - 4px);
  background-color: #DCD3BB;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 20px 15px 22px 15px;
  border-image: url('../assets/ui/card_frame_parchment.png') 185 135 195 135 fill / 20px 15px 22px 15px / 0 stretch;
  padding: 3px 5px 3px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  text-align: center;
  color: #18141E;
  cursor: pointer;
  overflow: visible !important;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), filter 0.15s ease;
}

.spell-card > * {
  pointer-events: none;
}

.spell-circle-bar.hand-dense .spell-card {
  flex: 1 1 0%;
  width: auto;
  min-width: 86px;
  max-width: 148px;
  aspect-ratio: auto;
  height: calc(100% - 6px);
  border-width: 16px 11px 18px 11px;
  border-image-width: 16px 11px 18px 11px;
  padding: 2px 3px;
}

.spell-circle-bar.hand-crowded .spell-card {
  flex: 1 1 0%;
  width: auto;
  min-width: 74px;
  max-width: 124px;
  aspect-ratio: auto;
  height: calc(100% - 6px);
  border-width: 14px 9px 15px 9px;
  border-image-width: 14px 9px 15px 9px;
  padding: 2px 2px;
}

.spell-circle-bar.hand-crowded .spell-card-title {
  font-size: 0.68rem;
}

.spell-circle-bar.hand-crowded .spell-card-desc {
  font-size: 0.62rem;
  line-height: 1.18;
}

.spell-circle-bar.hand-crowded .spell-card-footer {
  font-size: 0.58rem;
}

@keyframes spellCardDeniedShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
}

.spell-card.card-denied-shake {
  animation: spellCardDeniedShake 0.28s ease-out;
}

.spell-card.affordable {
  filter: drop-shadow(0 0 10px rgba(75, 199, 232, 0.72));
}

.spell-card.affordable:hover {
  transform: translateY(-5px) scale(1.02);
  filter: drop-shadow(0 6px 14px rgba(253, 230, 138, 0.85));
}

.spell-card.unaffordable {
  opacity: 0.86;
  filter: brightness(0.88) saturate(0.78);
}

.spell-card.on-cooldown,
.spell-card.expired-spell {
  opacity: 0.94;
  filter: saturate(0.42) brightness(0.80);
  cursor: not-allowed;
}

.spell-hotkey-crest {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 8px;
  border-radius: 999px;
  background: #14121F;
  border: 1.5px solid var(--gold-lunar);
  color: var(--gold-bright);
  font-size: 0.68rem;
  font-weight: 800;
  z-index: 4;
}

.spell-reinforced-star {
  position: absolute;
  top: -16px;
  right: 2px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #78350F;
  border: 1px solid #FDE68A;
  color: #FDE68A;
  font-size: 0.64rem;
  font-weight: 800;
  z-index: 4;
}

.spell-cost-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.spell-cost-pip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #14121F;
  color: #F8FAFC;
  font-size: 0.68rem;
  font-weight: 800;
}

.spell-cost-pip img {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.spell-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  color: #14121F;
  line-height: 1.16;
  margin: 2px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spell-card-desc {
  font-size: 0.68rem;
  font-weight: 700;
  color: #261E29;
  line-height: 1.18;
  display: block;
  overflow: visible;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.spell-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 800;
  color: #2D2330;
  border-top: 1px solid rgba(20, 18, 31, 0.22);
  padding-top: 3px;
}

.spell-cd-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7C2D12 0%, #991B1B 100%);
  border: 1.5px solid #FDE68A;
  color: #FEF3C7;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.spell-footer-cd-active {
  color: #991B1B;
  font-weight: 800;
}

/* ==========================================================================
   RIGHT COLUMN: COST-BAG SCRY + LUNAR PITY + RELICS/RUNES + COMBAT LOG
   ========================================================================== */

.section-head-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.section-title-sm {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--gold-lunar);
}

.scry-counts-pill {
  font-size: 0.7rem;
  color: var(--ether-cyan);
}

.scry-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.scry-bars-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.scry-row {
  display: grid;
  grid-template-columns: 18px 46px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
}

.scry-el-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #CBD5E1;
  font-weight: 700;
}

.scry-bar-bg {
  height: 8px;
  border-radius: 999px;
  background: #0D111C;
  border: 1px solid #283146;
  overflow: hidden;
}

.scry-bar-fill {
  height: 100%;
  transition: width 0.22s ease-out;
}

.fill-fire { background: linear-gradient(90deg, #EA580C, #FB923C); }
.fill-water { background: linear-gradient(90deg, #0284C7, #38BDF8); }
.fill-earth { background: linear-gradient(90deg, #65A30D, #A3E635); }
.fill-ether { background: linear-gradient(90deg, #06B6D4, #C084FC); }

.scry-pct {
  text-align: right;
  font-size: 0.71rem;
  color: #F1F5F9;
}

.next-scry-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(13, 17, 28, 0.9);
  border: 1px solid #2A344A;
  font-size: 0.73rem;
}

.next-scry-label {
  color: var(--pal-sage);
  font-weight: 700;
}

.next-scry-pips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Anti-Drought Lunar Pity Meter */
.pity-meter-box {
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(15, 20, 34, 0.92);
  border: 1px solid rgba(75, 199, 232, 0.32);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pity-meter-box.primed {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.35) 0%, rgba(59, 7, 100, 0.45) 100%);
}

.pity-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 800;
}

.pity-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ether-cyan);
}

.pity-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: #0B0F1A;
  border: 1px solid #334155;
  font-size: 0.7rem;
  color: var(--gold-bright);
}

.pity-track {
  height: 7px;
  border-radius: 999px;
  background: #090C14;
  border: 1px solid #2A344A;
  overflow: hidden;
}

.pity-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38BDF8 0%, #FDE68A 100%);
  transition: width 0.22s ease;
}

.pity-hint {
  font-size: 0.67rem;
  color: var(--pal-sage);
}

/* Equipped Relics & Runes */
.relics-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.link-mini-btn {
  background: #1E2538;
  border: 1px solid #3D4A66;
  border-radius: 5px;
  color: var(--gold-lunar);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  cursor: pointer;
}

.equipped-artifacts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.artifact-chip {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: url('../assets/ui/slot_tile.png') center center / cover no-repeat;
  border: 1.5px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.18s ease;
}

.artifact-chip img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.artifact-chip.is-rune {
  border-color: rgba(75, 199, 232, 0.65);
}

.artifact-chip.wing-punch {
  transform: scale(1.35);
  border-color: var(--gold-bright);
  z-index: 6;
}

/* Compact Combat Log */
.combat-log-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.combat-log-list {
  margin: 0;
  padding: 6px 8px;
  list-style: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-radius: 7px;
  background: rgba(8, 10, 16, 0.88);
  border: 1px solid #232B3E;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  color: #CBD5E1;
}

.combat-log-list li {
  padding-bottom: 3px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  word-break: break-word;
}

/* ==========================================================================
   MODALS & OVERLAYS (STRICTLY ZERO backdrop-filter: blur!)
   ========================================================================== */

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(7, 8, 12, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #F8FAFC;
}

.modal-md { width: min(540px, 94vw); }
.modal-lg { width: min(780px, 94vw); }
.modal-xl { width: min(1020px, 95vw); }

.modal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.32rem;
  letter-spacing: 0.05em;
  color: #FDE68A;
  text-shadow: 0 2px 0 #1A1025;
}

.modal-sub {
  font-size: 0.8rem;
  color: var(--pal-sage);
}

.modal-sub-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #171B28;
  border: 1px solid var(--gold-lunar);
  color: var(--gold-lunar);
  font-size: 0.75rem;
  font-weight: 700;
}

.modal-lead {
  margin: 0;
  color: var(--pal-parchment-light);
  font-size: 0.9rem;
  line-height: 1.45;
}

.btn-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #1B2132;
  border: 1.5px solid #475569;
  color: #F8FAFC;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.modal-close-svg {
  display: block;
  pointer-events: none;
}

#modal-guide {
  z-index: 72;
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 6px;
}

/* Victory Draft Modal */
.victory-banner-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.victory-kicker {
  font-family: var(--font-display);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  color: var(--ether-cyan);
}

.victory-loot-strip {
  display: inline-flex;
  gap: 12px;
}

.loot-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #141927;
  border: 1px solid var(--gold-lunar);
  color: var(--gold-bright);
  font-size: 0.9rem;
}

.draft-delta-preview {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(13, 18, 30, 0.94);
  border: 1px solid rgba(75, 199, 232, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.delta-label {
  font-size: 0.8rem;
  color: var(--pal-parchment-light);
}

.draft-delta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.delta-chip {
  padding: 3px 8px;
  border-radius: 6px;
  background: #0E1320;
  border: 1px solid #2D3748;
  font-size: 0.76rem;
  font-weight: 800;
}

.delta-chip.up { border-color: #34D399; color: #6EE7B7; }
.delta-chip.down { border-color: #F87171; color: #FCA5A5; }

/* STRICT minmax(0, 1fr) Multi-Column Grids */
.draft-cards-grid,
.campfire-options-grid,
.guide-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.draft-cards-grid > *,
.campfire-options-grid > *,
.guide-cards-grid > *,
.merchant-wares-grid > *,
.runes-codex-grid > *,
.atelier-items-grid > *,
.supporter-skus-grid > * {
  min-width: 0;
  max-width: 100%;
}

.draft-spell-card {
  position: relative;
  box-sizing: border-box;
  background-color: #DCD3BB;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 26px 20px 28px 20px;
  border-image: url('../assets/ui/card_frame_parchment.png') 185 135 195 135 fill / 26px 20px 28px 20px / 0 stretch;
  padding: 6px 8px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #18141E;
  cursor: pointer;
  overflow: visible !important;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.draft-spell-card:hover {
  transform: translateY(-6px) scale(1.02);
  filter: drop-shadow(0 8px 18px rgba(75, 199, 232, 0.65));
}

.draft-rarity-ribbon {
  align-self: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: #14121F;
  color: var(--gold-bright);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.draft-spell-name {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: #14121F;
  text-align: center;
}

.draft-spell-desc {
  font-size: 0.8rem;
  font-weight: 700;
  color: #29212C;
  text-align: center;
  line-height: 1.35;
}

.draft-bag-inject-box {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(20, 18, 31, 0.88);
  color: #F8FAFC;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* Campfire & Event Cards */
.campfire-choice-card,
.guide-item-card {
  padding: 16px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #1E2436 0%, #121622 100%);
  border: 2px solid #38435E;
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.campfire-choice-card {
  cursor: pointer;
}

.campfire-choice-card:hover:not(:disabled) {
  border-color: var(--gold-bright);
  transform: translateY(-3px);
}

.campfire-choice-card h3,
.guide-item-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold-bright);
}

.campfire-choice-card p,
.guide-item-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--pal-parchment-light);
}

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

.event-header-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.event-pierce-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #58131E;
  border: 1px solid #F87171;
  color: #FEE2E2;
  font-size: 0.73rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.event-choices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-choice-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 9px;
  background: linear-gradient(180deg, #22293C 0%, #151926 100%);
  border: 2px solid #3B4662;
  color: #F8FAFC;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.event-choice-btn.is-ambush {
  border-color: #DC2626;
  background: linear-gradient(180deg, #3D1B28 0%, #220E16 100%);
}

.event-choice-btn:hover {
  border-color: var(--gold-bright);
}

/* Merchant, Runes, Gate, Atelier & Supporter Shop Grids */
.merchant-wares-grid,
.atelier-items-grid,
.supporter-skus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.rune-card,
.ware-card,
.atelier-card,
.sku-card {
  position: relative;
  padding: 14px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #1B2133 0%, #101420 100%);
  border: 2px solid #333E58;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  overflow: visible !important;
}

.rune-card.equipped,
.atelier-card.equipped {
  border-color: var(--ether-cyan);
  background: linear-gradient(180deg, #162E3F 0%, #0E1B28 100%);
}

.rune-card.locked {
  opacity: 0.6;
}

.sku-art-wrap,
.atelier-preview-wrap {
  height: 112px;
  border-radius: 8px;
  background: radial-gradient(circle, rgba(61, 94, 111, 0.35) 0%, rgba(7, 8, 12, 0.85) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
}

.sku-art-wrap img,
.atelier-preview-wrap img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.atelier-cardback-wrap {
  background: radial-gradient(circle, rgba(242, 201, 125, 0.22) 0%, rgba(16, 22, 38, 0.92) 78%);
}

.atelier-cardback-img {
  height: 100px;
  width: auto;
  border-radius: 6px;
  border: 1px solid rgba(242, 201, 125, 0.55);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.sku-badge {
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #D97706 0%, #F59E0B 100%);
  border: 1.5px solid #FEF3C7;
  color: #14121F;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  z-index: 6;
}

.shop-tabs-bar,
.atelier-subtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shop-tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  background: #141927;
  border: 1.5px solid #334155;
  color: #CBD5E1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.shop-tab-btn.active {
  background: #27324B;
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.shop-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Gate Modal */
.gate-launcher-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-selector-row,
.gate-seed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gate-selector-row input[type="range"] {
  flex: 1;
  accent-color: var(--ether-cyan);
}

.gate-lv-pill {
  padding: 4px 12px;
  border-radius: 7px;
  background: #172538;
  border: 1px solid var(--ether-cyan);
  color: var(--gold-bright);
  font-size: 1rem;
}

.obsidian-input,
.obsidian-select {
  padding: 7px 10px;
  border-radius: 7px;
  background: #0E121E;
  border: 1.5px solid #3B4762;
  color: #F8FAFC;
  font-family: var(--font-body);
  font-size: 0.86rem;
}

.gate-stats-preview {
  padding: 10px 14px;
  border-radius: 8px;
  background: #111624;
  border: 1px solid #2D3748;
  color: var(--ether-cyan);
  font-size: 0.88rem;
}

.gate-hazards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gate-ledger-box {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(242, 201, 125, 0.08);
  border: 1px solid rgba(242, 201, 125, 0.3);
  font-size: 0.8rem;
  color: var(--gold-lunar);
}

/* Chest & Defeat Modals */
.chest-modal-card {
  text-align: center;
  align-items: center;
}

.chest-stage-box {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chest-hero-img {
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.chest-rewards-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.defeat-kicker {
  color: #F87171;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
}

.defeat-stats-box {
  padding: 10px 12px;
  border-radius: 8px;
  background: #111522;
  border: 1px solid #2D364B;
  font-size: 0.85rem;
}

.defeat-powerup-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Settings Rows */
.settings-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(14, 18, 29, 0.86);
  border: 1px solid #263044;
}

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

.settings-pct {
  width: 42px;
  text-align: right;
  font-size: 0.8rem;
}

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

/* ==========================================================================
   ANIMATED MOON-BIRTH STORY BEAT OVERLAY & FTUE TUTORIAL
   ========================================================================== */

.story-beat-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #07080C;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.story-beat-bg {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center;
  filter: brightness(0.45) contrast(1.1);
  transform: scale(1.06);
  transition: transform 4.5s ease-out;
}

.story-beat-card {
  position: relative;
  z-index: 2;
  width: min(880px, 92vw);
  display: grid;
  grid-template-columns: minmax(0, 38fr) minmax(0, 62fr);
  align-items: center;
  gap: 24px;
}

.story-portrait-img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(75, 199, 232, 0.45));
}

.story-parchment-folio {
  padding: 22px 26px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(23, 27, 40, 0.95) 0%, rgba(11, 14, 23, 0.97) 100%);
  border: 2px solid var(--gold-lunar);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.story-kicker {
  color: var(--ether-cyan);
  font-family: var(--font-accent);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.story-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold-bright);
}

.story-body {
  margin: 0;
  font-family: var(--font-accent);
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--pal-parchment-light);
}

.story-skip-hint {
  align-self: flex-end;
  font-size: 0.78rem;
  color: var(--gold-lunar);
}

/* FTUE Spotlight Tutorial */
.ftue-overlay {
  position: fixed;
  inset: 0;
  z-index: 55; /* below .modal-scrim (60): tutorial never covers modals */
  pointer-events: none;
}

.ftue-ring {
  position: fixed;
  border: 3px solid var(--gold-bright);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(5, 7, 12, 0.56);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.ftue-card {
  position: fixed;
  width: min(360px, 90vw);
  pointer-events: auto;
  z-index: 56;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ftue-step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ftue-step-badge {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ether-cyan);
}

.ftue-step-text {
  margin: 0;
  font-size: 0.88rem;
  color: #F8FAFC;
  line-height: 1.45;
}

.ftue-step-actions {
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   RESPONSIVE <900px FALLBACK (Split-Screen / Portrait Resize Safe)
   ========================================================================== */

@media (max-width: 1360px) {
  .top-hud-bar { padding: 0 8px; gap: 4px; }
  .hud-left-cluster, .hud-right-cluster { gap: 3px; flex-shrink: 1; }
  .hud-hp-track { width: 112px; }
  .hud-act-badge { padding: 0 8px; font-size: 0.73rem; }
  .hud-stat-pill, .hud-currency-pill { padding: 0 6px; font-size: 0.76rem; }
  .btn-hud-compact { padding: 0 6px; gap: 3px; font-size: 0.7rem; flex-shrink: 1; min-width: 0; }
  .btn-hud-compact .btn-clip-label { max-width: 74px; }
  .btn-hud-icon { width: 28px; height: 28px; flex-shrink: 0; }
}

@media (max-width: 1120px) {
  .hud-hp-track { width: 112px; }
  .btn-hud-compact .btn-clip-label { max-width: 58px; }
}

@media (max-width: 900px) {
  html, body, #app-root {
    overflow-y: auto;
  }
  .title-center-stage {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .title-hero-showcase {
    height: 220px;
  }
  .command-desk-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
    height: auto;
  }
  .battle-stage-wrap {
    min-height: 300px;
  }
  .draft-cards-grid,
  .campfire-options-grid,
  .merchant-wares-grid,
  .atelier-items-grid,
  .supporter-skus-grid,
  .runes-codex-grid,
  .guide-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .story-beat-card {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SEASONS 2–4 (v5.0) — ILLUMINATED GRIMOIRE, PRESTIGE FRAMES, MODES & CODEX
   ========================================================================== */

.version-kicker-pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #B45309 0%, #D97706 100%);
  border: 1px solid #FEF08A;
  color: #14121F;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.68rem;
}

.title-hero-showcase::after {
  content: '';
  position: absolute;
  width: min(370px, 52vh);
  height: min(370px, 52vh);
  border-radius: 50%;
  border: 2px dashed rgba(253, 230, 138, 0.42);
  animation: prestigeOrbitSpin 32s linear infinite;
  pointer-events: none;
}

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

.drawn-cost-pips {
  gap: 5px;
}

.cost-element-pill {
  height: 32px;
  padding: 0 8px;
  font-size: 0.82rem;
}

.cost-moon {
  border-color: rgba(253, 230, 138, 0.55);
  background: rgba(66, 48, 16, 0.45);
  color: #FEF08A;
}

.cost-moon.has-tokens {
  border-color: #FDE68A;
  background: rgba(120, 53, 15, 0.65);
  color: #FEF9C3;
}

.cost-hazard {
  border-color: #EF4444;
  background: rgba(127, 29, 29, 0.68);
  color: #FEE2E2;
  font-size: 0.74rem;
  font-weight: 800;
}

.tactical-actions-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 3px;
  border-top: 1px solid rgba(71, 85, 105, 0.35);
}

.btn-tactical-mini {
  min-height: 26px;
  padding: 2px 9px;
  font-size: 0.7rem;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.btn-tactical-mini:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-tactical-mini.flask-ready {
  border-color: #10B981;
  background: linear-gradient(180deg, #064E3B 0%, #062C22 100%);
  color: #A7F3D0;
}

.tactical-cnt-badge {
  display: inline-block;
  padding: 0 5px;
  border-radius: 999px;
  background: #0B0F1A;
  border: 1px solid #475569;
  color: #FDE68A;
  font-size: 0.67rem;
}

.spell-card.dual-spell-card {
  box-shadow: inset 0 0 0 1.5px rgba(245, 158, 11, 0.55);
}

.spell-card.prestige-gilded {
  box-shadow: inset 0 0 0 2px rgba(253, 230, 138, 0.85);
}

.spell-enchant-tag {
  position: absolute;
  top: -16px;
  left: 2px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #3B0764;
  border: 1px solid #E9D5FF;
  color: #F3E8FF;
  font-size: 0.6rem;
  font-weight: 800;
  z-index: 4;
}

.spell-live-est {
  margin-top: 1px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(20, 18, 31, 0.88);
  color: #FDE68A;
  font-size: 0.64rem;
  font-weight: 800;
  align-self: center;
  white-space: nowrap;
}

.scry-odds-strip {
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid #263248;
  font-size: 0.68rem;
  color: #BAE6FD;
  text-align: center;
  white-space: nowrap;
}

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

.campfire-four-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.modes-body-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 360px;
}

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

.mage-roster-grid > *,
.puzzles-grid > *,
.codex-cards-grid > * {
  min-width: 0;
  max-width: 100%;
}

.mage-select-card {
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #1B2133 0%, #0F131F 100%);
  border: 2px solid #334155;
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.mage-select-card.selected {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, #2A241A 0%, #151826 100%);
}

.mage-select-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid rgba(253, 230, 138, 0.5);
  background: #0B0E17;
}

.puzzles-grid,
.codex-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.mode-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(13, 18, 30, 0.92);
  border: 1px solid #2D3748;
}

.research-bar-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #090C14;
  border: 1px solid #2A344A;
  overflow: hidden;
  margin-top: 4px;
}

.research-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981 0%, #FDE68A 100%);
}

@media (max-width: 900px) {
  .campfire-four-grid,
  .mage-roster-grid,
  .puzzles-grid,
  .codex-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* v1.0.2.0-rc5: Element-coded spell cost pips, spend delta flash, Next-Turn Odds label & Transmute Picker Popover */
#cost-pool-bar {
  position: relative;
}

.cost-element-pill {
  position: relative;
}

.cost-wild-tag {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.35);
  border: 1px solid rgba(216, 180, 254, 0.55);
  color: #F5D0FE;
}

.pip-spend-delta {
  position: absolute;
  top: -14px;
  right: 2px;
  font-size: 0.68rem;
  font-weight: 900;
  color: #FDE047;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  animation: pipDeltaFloat 0.85s ease-out forwards;
}

@keyframes pipDeltaFloat {
  0% { opacity: 1; transform: translateY(2px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-14px) scale(0.95); }
}

.spell-cost-pip {
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.spell-cost-pip.cost-pip-Fire {
  background: rgba(124, 45, 18, 0.92);
  border-color: #F97316;
  color: #FED7AA;
}

.spell-cost-pip.cost-pip-Water {
  background: rgba(12, 74, 110, 0.92);
  border-color: #38BDF8;
  color: #BAE6FD;
}

.spell-cost-pip.cost-pip-Earth {
  background: rgba(54, 83, 20, 0.92);
  border-color: #84CC16;
  color: #D9F99D;
}

.spell-cost-pip.cost-pip-Ether {
  background: rgba(88, 28, 135, 0.92);
  border-color: #C084FC;
  color: #F5D0FE;
}

.spell-cost-pip .pip-el-sym {
  font-size: 0.66rem;
  line-height: 1;
}

.scry-odds-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scry-odds-label {
  font-size: 0.60rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #94A3B8;
  text-align: center;
}

.loot-pill-heal {
  border-color: #4ADE80;
  color: #86EFAC;
}

.transmute-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 45;
  width: min(410px, 94vw);
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(11, 15, 28, 0.97);
  border: 1.5px solid #F2C97D;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.transmute-popover.hidden {
  display: none;
}

.transmute-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.transmute-pop-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #FDE68A;
}

.transmute-pop-close {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid #475569;
  color: #E2E8F0;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
}

.transmute-pop-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transmute-pop-lbl {
  width: 36px;
  font-size: 0.66rem;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.transmute-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

.transmute-opt-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #141B2D;
  border: 1.5px solid #334155;
  color: #E2E8F0;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.transmute-opt-btn.selected {
  border-color: #FDE047;
  box-shadow: 0 0 0 1px rgba(253, 224, 71, 0.55);
  background: rgba(30, 41, 59, 0.98);
}

.transmute-opt-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.transmute-opt-btn.opt-Fire { border-color: #F97316; color: #FED7AA; }
.transmute-opt-btn.opt-Water { border-color: #38BDF8; color: #BAE6FD; }
.transmute-opt-btn.opt-Earth { border-color: #84CC16; color: #D9F99D; }
.transmute-opt-btn.opt-Ether { border-color: #C084FC; color: #F5D0FE; }
.transmute-opt-btn.opt-Corrupt { border-color: #FB7185; color: #FECDD3; }

.transmute-pop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(71, 85, 105, 0.45);
}

.transmute-preview-line {
  font-size: 0.74rem;
  font-weight: 700;
  color: #BAE6FD;
}

.btn-transmute-confirm {
  padding: 4px 12px;
  min-height: 28px;
  font-size: 0.72rem;
  flex-shrink: 0;
}


/* Tutorial spotlight is suspended while any modal is open (restored on close) */
body:has(.modal-scrim:not(.hidden)) #ftue-overlay { visibility: hidden; }
