/**
 * css/style.css — Ashfang: Dungeon Deck (`dark_arcane_rpg` Visual Archetype)
 * Strict Invariants:
 *   - Palette locked to art_manifest.json: #020202, #1C3F44, #458484, #61413D, #4ABABA, #FDE68A, #F5A623, #C8CDB8, #5B2A25
 *   - 9-Slice Anti-Distortion on `.btn-9slice` (`btn_primary.png` 92 86 92 86) & `.panel-9slice`
 *   - Red-Dot Anti-Clipping: `overflow: visible !important; position: relative;` on all buttons
 *   - 9-Lang Overflow Safety: zero horizontal/vertical truncation at 1920x1080 and 1280x720
 */

:root {
  --ink-black: #020202;
  --crypt-deep: #091217;
  --crypt-teal: #1C3F44;
  --arcane-slate: #458484;
  --bronze-earth: #61413D;
  --astral-cyan: #4ABABA;
  --gold-light: #FDE68A;
  --amber-cta: #F5A623;
  --parchment: #C8CDB8;
  --crimson-surface: #5B2A25;
  --text-bright: #F8FAFC;
  --font-display: 'Cinzel', 'Marcellus', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--ink-black);
  color: var(--text-bright);
  font-family: var(--font-body);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

button {
  font-family: var(--font-body);
  overflow: visible !important;
  position: relative;
  transition: transform 0.12s ease, filter 0.14s ease;
}

button:not(:disabled):active {
  transform: translateY(2px);
}

button.dag-node.is-reachable:hover {
  transform: translate(-50%, -50%) scale(1.08) !important;
  z-index: 6;
}

button.dag-node.is-reachable:active {
  transform: translate(-50%, calc(-50% + 1px)) scale(0.97) !important;
}

.dag-node img,
.dag-node .dag-node-lbl {
  pointer-events: none;
}

.dag-node.is-reachable {
  z-index: 5;
}

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

/* ==================== 9-SLICE GAME CHROME (ZERO STRETCH DISTORTION) ==================== */

.btn-9slice {
  box-sizing: border-box;
  background: transparent !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 16px 18px 16px 18px !important;
  border-image: url('../assets/ui/btn_primary.png') 92 86 92 86 fill / 16px 18px 16px 18px / 0 stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #FFFFFF !important;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.7);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.58));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  overflow: visible !important;
  position: relative;
}

.btn-9slice:not(:disabled):hover {
  filter: brightness(1.09) drop-shadow(0 5px 10px rgba(245, 166, 35, 0.38));
  transform: translateY(-1px);
}

.panel-9slice {
  box-sizing: border-box;
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 44px 68px 42px 58px;
  border-image: url('../assets/ui/frame_panel.png') 246 421 236 346 fill / 44px 68px 42px 58px / 0 stretch;
  filter: drop-shadow(0 16px 36px rgba(0, 0, 0, 0.8));
}

/* ==================== RED-DOT NOTIFICATION BADGE ==================== */

.notify-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 35;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #EF4444 0%, #B91C1C 100%);
  border: 2px solid var(--gold-light);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.65);
  pointer-events: none;
  animation: pulseBadge 1.8s infinite ease-in-out;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.13); }
}

/* ==================== TITLE SCREEN ==================== */

.screen-title {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 4vw;
}

.title-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: brightness(0.68) contrast(1.06);
}

.title-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 26% 52%, rgba(74, 186, 186, 0.16), transparent 48%),
    linear-gradient(90deg, rgba(2, 2, 2, 0.45) 0%, rgba(9, 18, 23, 0.88) 52%, rgba(2, 2, 2, 0.94) 100%);
}

.title-topbar {
  position: absolute;
  top: 16px;
  right: 24px;
  z-index: 5;
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--astral-cyan);
  background: rgba(9, 18, 23, 0.85);
  color: var(--gold-light);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.pill-btn.pill-quit {
  border-color: var(--bronze-earth);
  background: rgba(91, 42, 37, 0.8);
  color: #FCA5A5;
}

.title-main-grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 40% 60%;
  align-items: center;
  width: min(1440px, 94vw);
  margin: 0 auto;
  gap: 24px;
}

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

.title-hero-halo {
  position: absolute;
  width: min(360px, 30vw);
  height: min(360px, 30vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 186, 186, 0.34) 0%, rgba(245, 166, 35, 0.14) 48%, transparent 72%);
  pointer-events: none;
}

.title-hero-art {
  position: relative;
  max-height: min(560px, 74vh);
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.85));
}

.title-command-card {
  background: linear-gradient(180deg, rgba(28, 63, 68, 0.78) 0%, rgba(8, 14, 19, 0.94) 100%);
  border: 2px solid rgba(74, 186, 186, 0.55);
  border-radius: 18px;
  padding: clamp(18px, 2.2vh, 28px) clamp(20px, 2.4vw, 34px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.82), inset 0 1px 0 rgba(253, 230, 138, 0.25);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vh, 16px);
}

.title-crest-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(91, 42, 37, 0.85);
  border: 1px solid var(--amber-cta);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.game-logo-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 2.9vw, 44px);
  letter-spacing: 0.05em;
  color: var(--gold-light);
  text-shadow: 0 3px 0 #1A1025, 0 0 18px rgba(245, 166, 35, 0.45);
  line-height: 1.12;
}

.game-logo-subtitle {
  margin: 0;
  color: var(--parchment);
  font-size: clamp(13px, 1.05vw, 16px);
}

.starter-picker-heading {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--astral-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

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

.starter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(69, 132, 132, 0.55);
  background: rgba(6, 12, 16, 0.82);
  color: var(--text-bright);
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
}

.starter-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.starter-card.is-selected {
  border-color: var(--gold-light);
  background: linear-gradient(180deg, rgba(28, 63, 68, 0.88) 0%, rgba(91, 42, 37, 0.55) 100%);
  box-shadow: 0 0 18px rgba(253, 230, 138, 0.28);
}

.starter-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(11px, 0.9vw, 13.5px);
  color: var(--gold-light);
  line-height: 1.2;
}

.starter-card-desc {
  font-size: clamp(10px, 0.78vw, 12px);
  color: var(--parchment);
  line-height: 1.3;
}

.title-load-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-load-wrap.is-complete {
  opacity: 0.75;
}

.title-load-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(2, 2, 2, 0.78);
  border: 1px solid var(--arcane-slate);
  overflow: hidden;
}

.title-load-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--astral-cyan), var(--gold-light));
  transition: width 0.14s ease-out;
}

.title-load-pct {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-light);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.title-cta-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.title-play-btn {
  min-width: 210px;
  font-size: clamp(15px, 1.2vw, 19px);
}

.title-continue-btn {
  padding: 12px 22px;
  border-radius: 10px;
  border: 2px solid var(--astral-cyan);
  background: rgba(28, 63, 68, 0.85);
  color: var(--gold-light);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

/* ==================== 16:9 4-ZONE GAME COMMAND LAYOUT ==================== */

.screen-game {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--crypt-deep);
}

.hud-topbar {
  height: 50px;
  flex: 0 0 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  background: linear-gradient(180deg, #13282E 0%, #091217 100%);
  border-bottom: 1.5px solid rgba(74, 186, 186, 0.42);
  z-index: 20;
}

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

.hud-stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(2, 2, 2, 0.58);
  border: 1px solid rgba(69, 132, 132, 0.45);
  font-size: clamp(11px, 0.84vw, 13px);
  font-weight: 700;
}

.hud-biome-label {
  font-family: var(--font-display);
  color: var(--gold-light);
}

.hud-sep {
  color: var(--arcane-slate);
}

.hud-turn-label {
  color: var(--astral-cyan);
  font-variant-numeric: tabular-nums;
}

.currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(2, 2, 2, 0.65);
  border: 1px solid rgba(245, 166, 35, 0.48);
  font-weight: 800;
  font-size: clamp(11.5px, 0.86vw, 13.5px);
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
}

.currency-pill.currency-hard {
  border-color: rgba(74, 186, 186, 0.55);
  color: #E0FBFF;
}

.currency-pill img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.hud-relics {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hud-relic-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 5px;
  background: rgba(2, 2, 2, 0.6);
  border: 1px solid rgba(245, 166, 35, 0.4);
  padding: 2px;
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(74, 186, 186, 0.45);
  background: linear-gradient(180deg, rgba(28, 63, 68, 0.85) 0%, rgba(11, 22, 27, 0.95) 100%);
  color: var(--text-bright);
  font-size: clamp(10.5px, 0.8vw, 12.5px);
  font-weight: 700;
  cursor: pointer;
  overflow: visible !important;
  position: relative;
}

.hud-btn:hover {
  border-color: var(--gold-light);
}

.hud-btn.is-locked {
  opacity: 0.58;
}

.hud-btn img,
.hud-svg-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  flex: 0 0 17px;
}

.hud-btn-shop {
  border-color: var(--amber-cta);
  background: linear-gradient(180deg, rgba(91, 42, 37, 0.88) 0%, rgba(36, 18, 15, 0.95) 100%);
  color: var(--gold-light);
}

.hud-btn-quit {
  border-color: rgba(239, 68, 68, 0.52);
  background: rgba(91, 42, 37, 0.72);
  color: #FCA5A5;
}

.hud-icon-btn {
  width: 32px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(74, 186, 186, 0.42);
  background: rgba(14, 28, 34, 0.9);
  color: var(--gold-light);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==================== MAIN 3-COLUMN GRID ==================== */

.tactical-grid {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 22% 56% 22%;
}

/* LEFT PANEL: DUNGEON DAG */
.panel-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 10px;
  gap: 8px;
  background: linear-gradient(180deg, rgba(14, 27, 33, 0.96) 0%, rgba(6, 11, 15, 0.98) 100%);
  border-right: 1.5px solid rgba(69, 132, 132, 0.35);
}

.panel-section-hdr {
  font-family: var(--font-display);
  font-size: clamp(12px, 0.92vw, 14px);
  font-weight: 800;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 5px 6px;
  border-radius: 8px;
  background: rgba(28, 63, 68, 0.42);
  border: 1px solid rgba(74, 186, 186, 0.3);
}

.dag-map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 15%, rgba(91, 42, 37, 0.35), transparent 55%),
    rgba(2, 2, 2, 0.55);
  border: 1px solid rgba(69, 132, 132, 0.35);
  overflow: hidden;
}

.dag-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dag-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 5px;
  min-width: 52px;
  max-width: 74px;
  border-radius: 9px;
  border: 1.5px solid rgba(69, 132, 132, 0.55);
  background: rgba(12, 24, 30, 0.94);
  color: var(--parchment);
  cursor: pointer;
}

.dag-node img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.dag-node-lbl {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.dag-node.is-reachable {
  border-color: var(--gold-light);
  background: linear-gradient(180deg, rgba(28, 63, 68, 0.95) 0%, rgba(91, 42, 37, 0.8) 100%);
  color: #FFFFFF;
  opacity: 1 !important;
  box-shadow: 0 0 12px rgba(253, 230, 138, 0.45);
}

.dag-node.is-current {
  border-color: var(--astral-cyan);
  box-shadow: 0 0 14px rgba(74, 186, 186, 0.65);
  opacity: 0.95 !important;
}

.dag-node.is-cleared {
  border-color: #34D399;
  opacity: 0.72 !important;
}

.left-footer {
  flex: 0 0 auto;
}

.pile-summary-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid rgba(74, 186, 186, 0.45);
  background: rgba(28, 63, 68, 0.52);
  color: var(--text-bright);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

.pile-summary-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.pile-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(2, 2, 2, 0.65);
  color: var(--gold-light);
  font-weight: 800;
  font-size: 12px;
}

/* CENTER COLUMN: BATTLE STAGE (62%) + HAND TRAY (38%) */
.panel-center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.battle-stage {
  position: relative;
  flex: 0 0 62%;
  height: 62%;
  min-height: 0;
  overflow: hidden;
  background: var(--ink-black);
  border-bottom: 2px solid rgba(74, 186, 186, 0.42);
}

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

.hero-vitals-overlay {
  position: absolute;
  left: 14px;
  bottom: 10px;
  width: min(280px, 42%);
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(6, 11, 16, 0.86);
  border: 1px solid rgba(74, 186, 186, 0.5);
  pointer-events: none;
}

.hero-vitals-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 800;
}

.hero-vitals-name {
  font-family: var(--font-display);
  color: var(--gold-light);
}

.hero-shield-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(28, 63, 68, 0.9);
  border: 1px solid var(--astral-cyan);
  color: #E0FBFF;
  font-size: 11px;
}

.hero-incoming-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(153, 27, 27, 0.92);
  border: 1px solid #FCA5A5;
  color: #FEE2E2;
  font-size: 10.5px;
  animation: pulseIncoming 0.9s infinite alternate;
}

@keyframes pulseIncoming {
  from { opacity: 0.72; }
  to { opacity: 1; }
}

.hero-hp-track {
  position: relative;
  height: 16px;
  border-radius: 6px;
  background: rgba(2, 2, 2, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.hero-hp-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #059669 0%, #34D399 100%);
  transition: width 0.18s ease-out;
}

.hero-hp-preview {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(239, 68, 68, 0.95),
    rgba(239, 68, 68, 0.95) 5px,
    rgba(253, 230, 138, 0.85) 5px,
    rgba(253, 230, 138, 0.85) 10px
  );
  animation: pulseIncoming 0.65s infinite alternate;
}

.hero-hp-text {
  position: relative;
  z-index: 2;
  display: block;
  text-align: center;
  line-height: 15px;
  font-size: 11px;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  font-variant-numeric: tabular-nums;
}

/* HAND TRAY (38%) */
.hand-tray {
  flex: 0 0 38%;
  height: 38%;
  min-height: 0;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 136px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #112228 0%, #070E12 100%);
}

.tray-left-cluster,
.tray-right-cluster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  justify-content: center;
  min-width: 0;
}

.mana-orb {
  width: 62px;
  height: 62px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #A5F3FC 0%, #4ABABA 42%, #1C3F44 82%, #091217 100%);
  border: 2.5px solid var(--gold-light);
  box-shadow: 0 0 18px rgba(74, 186, 186, 0.55), inset 0 2px 8px rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mana-orb-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  font-variant-numeric: tabular-nums;
}

.pile-mini-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 4px;
  border-radius: 7px;
  border: 1px solid rgba(69, 132, 132, 0.48);
  background: rgba(8, 16, 21, 0.9);
  color: var(--parchment);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  min-width: 0;
}

.pile-mini-btn strong {
  color: var(--gold-light);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tray-piles-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.auto-play-btn {
  padding: 6px 6px;
  border-radius: 8px;
  border: 1.5px solid var(--astral-cyan);
  background: rgba(28, 63, 68, 0.72);
  color: var(--text-bright);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.auto-play-btn.is-active {
  border-color: var(--gold-light);
  background: linear-gradient(180deg, #0D9488 0%, #115E59 100%);
  box-shadow: 0 0 12px rgba(74, 186, 186, 0.55);
}

.auto-play-btn.is-boss-locked {
  border-color: var(--bronze-earth);
  background: rgba(91, 42, 37, 0.65);
  color: #FDE68A;
  opacity: 0.85;
}

.end-turn-btn {
  width: 100%;
  font-size: clamp(11px, 0.88vw, 13px);
}

/* FANNED CARD HAND (NO SIBLING OVERLAP COLLISIONS) */
.card-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  min-width: 0;
  padding: 6px 4px;
}

.hand-idle-banner {
  color: var(--parchment);
  font-family: var(--font-display);
  font-size: 14px;
  opacity: 0.8;
}

.card-in-hand {
  flex: 1 1 0;
  max-width: 118px;
  min-width: 68px;
  height: min(94%, 198px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  border-radius: 10px;
  border: 1.5px solid var(--arcane-slate);
  background: linear-gradient(180deg, #1B373D 0%, #0A1419 100%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.65);
  cursor: pointer;
  transform: translateY(var(--fan-y, 0px)) rotate(var(--fan-rot, 0deg));
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.14s ease, box-shadow 0.14s ease;
  position: relative;
}

.card-in-hand.is-playable {
  border-color: var(--astral-cyan);
}

.card-in-hand.is-combo-ready {
  border-color: var(--gold-light);
  box-shadow: 0 0 14px rgba(245, 166, 35, 0.42);
}

.card-in-hand.is-unpayable {
  opacity: 0.56;
  filter: saturate(0.65);
}

.card-in-hand.rarity-rare {
  border-color: #38BDF8;
}

.card-in-hand.rarity-epic {
  border-color: #C084FC;
}

.card-in-hand:hover {
  z-index: 15;
  transform: translateY(-18px) scale(1.09) rotate(0deg);
  border-color: var(--gold-light);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.88), 0 0 16px rgba(74, 186, 186, 0.45);
}

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

.card-cost {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--astral-cyan), var(--crypt-teal));
  border: 1px solid var(--gold-light);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: clamp(9.5px, 0.72vw, 11px);
  color: var(--gold-light);
  line-height: 1.15;
  word-break: break-word;
}

.card-hotkey {
  font-size: 9px;
  color: var(--parchment);
  opacity: 0.78;
}

.card-art-box {
  position: relative;
  height: 44px;
  border-radius: 6px;
  background: rgba(2, 2, 2, 0.52);
  border: 1px solid rgba(74, 186, 186, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-art-box img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.card-stat-chip {
  position: absolute;
  bottom: 2px;
  right: 3px;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
  background: rgba(2, 2, 2, 0.85);
}

.chip-dmg { color: #FCA5A5; }
.chip-shd { color: #67E8F9; }

.card-desc {
  flex: 1;
  display: flex;
  align-items: center;
  font-size: clamp(9px, 0.68vw, 10.5px);
  line-height: 1.24;
  color: #E2E8F0;
  word-break: break-word;
  padding: 2px 0;
}

.card-tags {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  text-transform: uppercase;
  color: var(--parchment);
  opacity: 0.88;
}

.tag-exhaust {
  color: #FDBA74;
}

/* RIGHT PANEL: COMPANION SYNERGY, FREE [Q] ULTIMATE & COMBAT LOG */
.panel-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 10px;
  gap: 10px;
  background: linear-gradient(180deg, rgba(14, 27, 33, 0.96) 0%, rgba(6, 11, 15, 0.98) 100%);
  border-left: 1.5px solid rgba(69, 132, 132, 0.35);
}

.companion-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(28, 63, 68, 0.62) 0%, rgba(9, 17, 22, 0.94) 100%);
  border: 1.5px solid rgba(74, 186, 186, 0.48);
}

.comp-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.comp-portrait-frame {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  border-radius: 10px;
  background: radial-gradient(circle, rgba(74, 186, 186, 0.32), rgba(2, 2, 2, 0.8));
  border: 1.5px solid var(--gold-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comp-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.comp-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.comp-name {
  font-family: var(--font-display);
  font-size: clamp(11.5px, 0.9vw, 13.5px);
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1.18;
}

.comp-stance-badge {
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(91, 42, 37, 0.85);
  border: 1px solid var(--amber-cta);
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 700;
}

.comp-ult-name {
  font-size: 10.5px;
  color: var(--astral-cyan);
  font-weight: 700;
}

.ult-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ult-gauge-track {
  flex: 1;
  height: 11px;
  border-radius: 999px;
  background: rgba(2, 2, 2, 0.85);
  border: 1px solid var(--arcane-slate);
  overflow: hidden;
}

.ult-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--astral-cyan) 0%, var(--amber-cta) 65%, var(--gold-light) 100%);
  transition: width 0.2s ease-out;
}

.ult-gauge-pct {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gold-light);
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ult-trigger-btn {
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1.5px solid var(--arcane-slate);
  background: rgba(12, 24, 30, 0.9);
  color: var(--parchment);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
}

.ult-trigger-btn.is-ready {
  border-color: var(--gold-light);
  background: linear-gradient(180deg, #D97706 0%, #92400E 100%);
  color: #FFFFFF;
  opacity: 1 !important;
  box-shadow: 0 0 18px rgba(245, 166, 35, 0.68);
  animation: pulseUltReady 1.2s infinite alternate;
}

@keyframes pulseUltReady {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.03); filter: brightness(1.14); }
}

.log-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: rgba(2, 2, 2, 0.55);
  border: 1px solid rgba(69, 132, 132, 0.35);
  padding: 8px;
  gap: 6px;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--parchment);
}

.speed-toggle-btn {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--astral-cyan);
  background: rgba(28, 63, 68, 0.72);
  color: var(--gold-light);
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
}

.combat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--parchment);
  padding-right: 4px;
}

.log-entry {
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(14, 27, 33, 0.75);
  border-left: 2px solid var(--arcane-slate);
  line-height: 1.32;
}

/* ==================== MODALS & SHARED OVERLAYS ==================== */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
}

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

/* While an aria-modal dialog, coach card, or boss HUD is active, hide tutorial & make background non-interactive */
body.has-modal-open #tutorial-overlay,
body.has-coach-open #tutorial-overlay,
body.has-boss-battle #tutorial-overlay,
#tutorial-overlay.is-suppressed {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.has-modal-open #screen-game,
body.has-modal-open #screen-title,
body.has-modal-open #tutorial-overlay,
body.has-modal-open #screen-game button,
body.has-modal-open #screen-title button,
body.has-modal-open #tutorial-overlay button,
body.has-modal-open #tutorial-overlay .tutorial-callout-card,
body.has-coach-open #modal-root,
body.has-coach-open #modal-root button {
  pointer-events: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 9, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: linear-gradient(180deg, #162E35 0%, #091217 100%);
  border: 2px solid var(--astral-cyan);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.88), inset 0 1px 0 rgba(253, 230, 138, 0.25);
  color: var(--text-bright);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(74, 186, 186, 0.32);
}

.modal-body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-footer {
  padding-top: 10px;
  border-top: 1px solid rgba(74, 186, 186, 0.24);
}

.modal-close-x {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--arcane-slate);
  background: rgba(2, 2, 2, 0.55);
  color: var(--parchment);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close-x:hover {
  border-color: var(--gold-light);
  color: #FFFFFF;
}

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

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

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

.shop-card-glow {
  border-color: rgba(245, 166, 35, 0.78) !important;
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.28), inset 0 0 8px rgba(74, 186, 186, 0.16);
}

.shop-card:hover,
.draft-card:not(.is-disabled):hover,
.exit-reward-card:hover {
  border-color: var(--gold-light) !important;
  transform: translateY(-2px);
}

/* OVERLAY CANVASES (IDLE-HIDDEN & ZERO POINTER INTERCEPTION) */
.overlay-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none !important;
  z-index: 240;
  display: none;
}

/* TOASTS */
.toast-root {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 280;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.game-toast {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(9, 18, 23, 0.94);
  border: 1.5px solid var(--gold-light);
  color: var(--gold-light);
  font-weight: 700;
  font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.game-toast.toast-out {
  opacity: 0;
  transform: translateY(-8px);
}

/* ==================== NON-BLOCKING FTUE TUTORIAL ==================== */

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 185;
  pointer-events: none !important;
}

.tutorial-spotlight-ring {
  position: fixed;
  border: 2.5px solid var(--gold-light);
  border-radius: 12px;
  box-shadow: 0 0 22px rgba(253, 230, 138, 0.65);
  pointer-events: none !important;
  transition: all 0.22s ease-out;
}

.tutorial-callout-card {
  position: fixed;
  top: 66px;
  left: 24%;
  width: min(350px, 48vw);
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #163238 0%, #091318 100%);
  border: 2px solid var(--gold-light);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  pointer-events: auto !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tut-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tut-step-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--astral-cyan);
}

.tut-skip-btn {
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--arcane-slate);
  background: rgba(2, 2, 2, 0.55);
  color: var(--parchment);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.tut-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-light);
}

.tut-body {
  font-size: 12.5px;
  line-height: 1.4;
  color: #E2E8F0;
}

.tut-footer {
  display: flex;
  justify-content: flex-end;
}

.tut-next-btn {
  font-size: 12px;
}

/* ==================== PREVIEW-ONLY [DEV F2] STUDIO ==================== */

.dev-f2-pill {
  position: fixed;
  bottom: 6px;
  left: 6px;
  z-index: 195;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(74, 186, 186, 0.5);
  background: rgba(2, 2, 2, 0.78);
  color: var(--astral-cyan);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.debug-panel {
  position: fixed;
  bottom: 34px;
  left: 8px;
  z-index: 290;
  width: 310px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(7, 14, 19, 0.96);
  border: 1.5px solid var(--astral-cyan);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.9);
}

.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.debug-close {
  background: transparent;
  border: none;
  color: var(--parchment);
  font-size: 18px;
  cursor: pointer;
}

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

.debug-grid button {
  padding: 6px 6px;
  border-radius: 6px;
  border: 1px solid var(--arcane-slate);
  background: rgba(28, 63, 68, 0.65);
  color: #F8FAFC;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== SPINE-DNA v2.4 OVERLAYS & 3D VFX ==================== */
.battle-vfx-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  display: none;
}

.tb-vfx-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 950;
}

/* Keep victory modal reward text strictly legible above victory star-burst & celebration canvases */
body.has-victory-modal #ui-vfx-overlay,
body.has-victory-modal .tb-vfx-overlay,
body.has-victory-modal #celebration-canvas {
  z-index: 190 !important;
}

/* ==================== <900px RESPONSIVE FALLBACK ==================== */

@media (max-width: 900px) {
  .title-main-grid {
    grid-template-columns: 1fr;
  }
  .title-hero-showcase {
    display: none;
  }
  .tactical-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 22% 56% 22%;
  }
}

/* ==================== SEASONS 2-4 (v2.1 -> v5.0) UI, FOILS, 5 DECKS & MYTHIC THEME ==================== */

.title-main-grid {
  grid-template-columns: 35% 65% !important;
  width: min(1540px, 95vw) !important;
}

.starter-picker-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.starter-picker-header-row .starter-picker-heading {
  margin-bottom: 0;
}

.torment-pill-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid #F59E0B;
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.85), rgba(36, 14, 10, 0.94));
  color: #FEF08A;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

.starter-deck-grid.starter-deck-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.starter-deck-grid-5 .starter-card {
  padding: 10px 7px !important;
  gap: 5px;
}

.starter-deck-grid-5 .starter-card img {
  width: 34px;
  height: 34px;
}

.starter-deck-grid-5 .starter-card-title {
  font-size: clamp(10.5px, 0.82vw, 12.8px) !important;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.starter-deck-grid-5 .starter-card-desc {
  font-size: clamp(9.5px, 0.72vw, 11.2px) !important;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.title-modes-btn {
  padding: 12px 20px;
  border-radius: 10px;
  border: 2px solid #F59E0B;
  background: linear-gradient(180deg, rgba(91, 42, 37, 0.88), rgba(24, 14, 18, 0.95));
  color: #FEF08A;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
}

.hud-btn-modes {
  border-color: #F59E0B;
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.82), rgba(28, 16, 12, 0.95));
  color: #FEF08A;
}

.hud-spirit-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 38, 46, 0.9);
  border: 1px solid rgba(92, 225, 255, 0.45);
  color: #BAE6FD;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.hero-parry-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(113, 63, 18, 0.92);
  border: 1px solid #FACC15;
  color: #FEF08A;
  font-size: 11px;
}

/* Rune, Chain, Transmute & Dark-Gold / Mythic Card Foils (v2.3, v2.5, v2.7, v3.7, v4.2, v4.7) */
.card-rune-chip {
  position: absolute;
  top: 2px;
  left: 3px;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 900;
  background: rgba(6, 10, 16, 0.92);
  border: 1px solid currentColor;
  letter-spacing: 0.02em;
}

.card-in-hand.is-chained {
  border-color: #FB7185 !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.52), inset 0 0 10px rgba(6, 182, 212, 0.35);
}

.card-in-hand.is-transmuted {
  border-color: #4ADE80 !important;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.42);
}

.card-in-hand.arch-curse {
  border-color: #A855F7 !important;
  background: linear-gradient(180deg, #2E1038 0%, #0E0714 100%) !important;
}

@keyframes foilShimmer {
  0%, 100% { filter: brightness(1.0); }
  50% { filter: brightness(1.12); }
}

.card-in-hand.rarity-rare,
.card-in-hand.rarity-epic,
body[data-cosmetic="cosmetic_dark_gold_foil"] .card-in-hand.is-playable,
body[data-cosmetic="cosmetic_gilded_fang_frame"] .card-in-hand,
body[data-cosmetic="cosmetic_grandmaster_foil"] .card-in-hand,
body[data-cosmetic="cosmetic_mythic_ember_gold"] .card-in-hand {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(253, 230, 138, 0.32);
}

body[data-cosmetic="cosmetic_crimson_ember_back"] .card-in-hand,
body[data-cosmetic="cosmetic_crimson_ember_back"] .card-drag-ghost {
  background: linear-gradient(180deg, #4A1818 0%, #14080A 100%) !important;
  border-color: #EF4444 !important;
}

body[data-cosmetic="cosmetic_frost_steel_back"] .card-in-hand,
body[data-cosmetic="cosmetic_frost_steel_back"] .card-drag-ghost {
  background: linear-gradient(180deg, #163B50 0%, #081520 100%) !important;
  border-color: #38BDF8 !important;
}

body[data-cosmetic="cosmetic_storm_runic_back"] .card-in-hand,
body[data-cosmetic="cosmetic_storm_runic_back"] .card-drag-ghost {
  background: linear-gradient(180deg, #1D3548 0%, #1C1608 100%) !important;
  border-color: #F59E0B !important;
}

body[data-cosmetic="cosmetic_obsidian_ward_back"] .card-in-hand,
body[data-cosmetic="cosmetic_obsidian_ward_back"] .card-drag-ghost {
  background: linear-gradient(180deg, #2D1846 0%, #0C0816 100%) !important;
  border-color: #C084FC !important;
}

body[data-cosmetic="cosmetic_crimson_ember_back"] .card-in-hand .card-name,
body[data-cosmetic="cosmetic_frost_steel_back"] .card-in-hand .card-name,
body[data-cosmetic="cosmetic_storm_runic_back"] .card-in-hand .card-name,
body[data-cosmetic="cosmetic_obsidian_ward_back"] .card-in-hand .card-name,
body[data-cosmetic="cosmetic_crimson_ember_back"] .card-drag-ghost .card-name,
body[data-cosmetic="cosmetic_frost_steel_back"] .card-drag-ghost .card-name,
body[data-cosmetic="cosmetic_storm_runic_back"] .card-drag-ghost .card-name,
body[data-cosmetic="cosmetic_obsidian_ward_back"] .card-drag-ghost .card-name {
  color: #FFF4DA !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
}

body[data-cosmetic="cosmetic_crimson_ember_back"] .card-in-hand .card-desc,
body[data-cosmetic="cosmetic_frost_steel_back"] .card-in-hand .card-desc,
body[data-cosmetic="cosmetic_storm_runic_back"] .card-in-hand .card-desc,
body[data-cosmetic="cosmetic_obsidian_ward_back"] .card-in-hand .card-desc,
body[data-cosmetic="cosmetic_crimson_ember_back"] .card-drag-ghost .card-desc,
body[data-cosmetic="cosmetic_frost_steel_back"] .card-drag-ghost .card-desc,
body[data-cosmetic="cosmetic_storm_runic_back"] .card-drag-ghost .card-desc,
body[data-cosmetic="cosmetic_obsidian_ward_back"] .card-drag-ghost .card-desc {
  color: #ECE3CE !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.78) !important;
}

body[data-cosmetic="cosmetic_crimson_ember_back"] .card-in-hand .card-tags,
body[data-cosmetic="cosmetic_frost_steel_back"] .card-in-hand .card-tags,
body[data-cosmetic="cosmetic_storm_runic_back"] .card-in-hand .card-tags,
body[data-cosmetic="cosmetic_obsidian_ward_back"] .card-in-hand .card-tags,
body[data-cosmetic="cosmetic_crimson_ember_back"] .card-drag-ghost .card-tags,
body[data-cosmetic="cosmetic_frost_steel_back"] .card-drag-ghost .card-tags,
body[data-cosmetic="cosmetic_storm_runic_back"] .card-drag-ghost .card-tags,
body[data-cosmetic="cosmetic_obsidian_ward_back"] .card-drag-ghost .card-tags {
  color: #E5C896 !important;
  border-top-color: rgba(253, 230, 138, 0.28) !important;
}

body[data-cosmetic="cosmetic_crimson_ember_back"] .card-in-hand .card-tags .tag-exhaust,
body[data-cosmetic="cosmetic_frost_steel_back"] .card-in-hand .card-tags .tag-exhaust,
body[data-cosmetic="cosmetic_storm_runic_back"] .card-in-hand .card-tags .tag-exhaust,
body[data-cosmetic="cosmetic_obsidian_ward_back"] .card-in-hand .card-tags .tag-exhaust {
  color: #FCA5A5 !important;
}

body[data-cosmetic="cosmetic_gilded_fang_frame"] .card-in-hand,
body[data-cosmetic="cosmetic_mythic_ember_gold"] .card-in-hand.rarity-epic {
  border-color: #FBBF24 !important;
  animation: foilShimmer 2.8s infinite ease-in-out;
}

/* Season 4 v4.7 Mythic Ember-Gold UI Theme */
body.theme-mythic-gold .hud-topbar {
  background: linear-gradient(180deg, #2D180A 0%, #110906 100%);
  border-bottom-color: rgba(251, 191, 36, 0.65);
}

body.theme-mythic-gold .panel-left,
body.theme-mythic-gold .panel-right {
  background: linear-gradient(180deg, rgba(32, 18, 10, 0.96) 0%, rgba(10, 6, 5, 0.98) 100%);
  border-color: rgba(245, 158, 11, 0.42);
}

body.theme-mythic-gold .companion-card {
  background: linear-gradient(180deg, rgba(68, 34, 14, 0.72) 0%, rgba(16, 9, 6, 0.95) 100%);
  border-color: rgba(251, 191, 36, 0.58);
}

.dag-node.type-forge {
  border-color: #F59E0B !important;
}

.dag-node.type-shrine_cursed {
  border-color: #C084FC !important;
}

/* Interactive Drag-and-Drop Card Ghost & Arena Drop Zone */
.card-in-hand.is-dragging {
  opacity: 0.28 !important;
  transform: scale(0.94) !important;
}

.card-drag-ghost {
  position: fixed;
  z-index: 320;
  pointer-events: none !important;
  width: 132px;
  min-height: 184px;
  border-radius: 8px;
  border: 2px solid #FDE68A;
  background: linear-gradient(180deg, #EFE5CE 0%, #DFC99B 100%);
  color: #1C1510;
  padding: 8px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.85), 0 0 18px rgba(253, 230, 138, 0.52);
  transform: translate(-50%, -55%) scale(1.06) rotate(-2deg);
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-sizing: border-box;
}

.card-drag-ghost.is-over-stage {
  border-color: #5CE1FF;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.9), 0 0 24px rgba(92, 225, 255, 0.72);
  transform: translate(-50%, -62%) scale(1.10) rotate(0deg);
}

.card-drag-ghost .card-name {
  color: #1E130B !important;
  text-shadow: none !important;
}

.card-drag-ghost .card-desc {
  color: #241911 !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

.card-drag-ghost .card-tags {
  color: #5C3D24 !important;
  font-weight: 800 !important;
}

.battle-stage.is-card-drop-target {
  box-shadow: inset 0 0 0 3px rgba(253, 230, 138, 0.65), inset 0 0 34px rgba(92, 225, 255, 0.25);
}

/* Bespoke Season 3 Spirit Companion 4x2 Sprite Emblem & Card Back 2x2 Previews */
.spirit-sprite-icon {
  display: inline-block;
  background-image: url('../assets/ui/icons/spirit_companions_sheet.png');
  background-size: 400% 200%;
  background-repeat: no-repeat;
  border-radius: 8px;
  background-color: rgba(6, 14, 20, 0.65);
  border: 1px solid rgba(163, 139, 103, 0.55);
  flex-shrink: 0;
}

.card-back-thumb {
  width: 56px;
  height: 76px;
  flex: 0 0 56px;
  border-radius: 6px;
  background-image: url('../assets/ui/card_backs_s3_sheet.png');
  background-size: 200% 200%;
  background-repeat: no-repeat;
  border: 1.5px solid rgba(253, 230, 138, 0.55);
  background-color: rgba(8, 12, 18, 0.8);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.72);
}
