/* ==========================================================================
 * Cinderkeep: Maze Defense — Commercial UI Vault Stylesheet (`inked_parchment_roguelite`)
 * Strict Palette Law: Matte Obsidian (#1C1917), Tarnished Bronze (#C98A32, #A38B67),
 * Crimson Wax (#9E2E2E), Aged Parchment (#EBD5AC) + Dark Ink (#1C1510, >= 11.5:1 WCAG).
 * STRICTLY ZERO cyan neon glow, ZERO backdrop-filter: blur(), ZERO opaque sidebars!
 * ========================================================================== */

:root,
[data-ui-vault-style="inked_parchment_roguelite"] {
  --ck-obsidian-deep: #0E0C0B;
  --ck-obsidian: #1C1917;
  --ck-obsidian-hi: #27221E;
  --ck-bronze: #A38B67;
  --ck-bronze-bright: #C98A32;
  --ck-bronze-dim: rgba(163, 139, 103, 0.38);
  --ck-crimson: #9E2E2E;
  --ck-crimson-deep: #681B1B;
  --ck-parchment: #EBD5AC;
  --ck-parchment-light: #F4E7CE;
  --ck-ink-dark: #1C1510;
  --ck-ink-muted: #4A3626;
  --ck-text-cream: #F4ECE0;
  --ck-text-gold: #FDE68A;
  --ck-font-display: 'Cinzel', 'Marcellus', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --ck-font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;

  /* Override vault secondary so zero teal/cyan ever leaks */
  --uiv-secondary: #8A6F4E;
  --tb-slot-style: 'inked_parchment_roguelite';
  --tb-slot-shape: rect;
  --tb-slot-radius: 2px;
  --tb-slot-chamfer: 0px;
  --tb-slot-inset: 3px 3px 3px 3px;
  --tb-slot-palette: bronze_gold;
  --tb-slot-mode: chaser_slot;
  --tb-slot-daylight: 1;
  --tb-slot-z: 3;
}

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

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

.hidden {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

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

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

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

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

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

/* ==================== 9-SLICE UI VAULT REGIONS (>= 18 REAL REGIONS) ==================== */

/* 1. Modal Frame (box-shadow instead of filter:drop-shadow so modal animates & scrolls at locked 60 FPS!) */
.vault-modal,
.modal-card {
  background-color: #1C1917;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 22px 22px 30px 22px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_modal.png') 62 63 88 63 fill / 22px 22px 30px 22px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.90);
  filter: none;
  color: var(--ck-text-cream);
}

.modal-card button,
.modal-card .shop-pack-card,
.modal-card .forge-card,
.modal-card .draft-card {
  filter: none;
}

/* 2. Subpanel Frame */
.vault-subpanel {
  background-color: #1C1917;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 12px 10px 12px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_subpanel.png') 78 92 55 92 fill / 10px 12px 10px 12px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.80));
}

/* 3. Ribbon Header */
.vault-ribbon {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 11px 32px 12px 22px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/ribbon_header.png') 58 237 60 106 fill / 11px 32px 12px 22px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  font-family: var(--ck-font-display);
  font-weight: 800;
  color: var(--ck-text-cream);
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.92);
}

/* 4. HUD Pill */
.vault-pill {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 14px 9px 14px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/hud_pill.png') 41 80 42 79 fill / 9px 14px 9px 14px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.75));
  overflow: visible !important;
  position: relative;
}

/* 5. Slot Tile */
.vault-slot {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 6px 9px 6px 11px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/slot_tile.png') 15 42 14 70 fill / 6px 9px 6px 11px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.82));
  overflow: visible !important;
  position: relative;
}

/* 6. Primary Button (Thin interior-budget border-width 11px/15px!) */
.btn-9slice-primary,
.btn-9slice {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 11px 15px 11px 15px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_primary.png') 82 70 73 83 fill / 11px 15px 11px 15px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  color: #FFF9EC;
  font-family: var(--ck-font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 3px rgba(16, 10, 5, 0.95);
  filter: drop-shadow(0 4px 9px rgba(0, 0, 0, 0.74));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2px 8px;
  min-width: 0;
  overflow: visible !important;
  position: relative;
  transition: filter 0.14s ease, transform 0.12s ease;
}

.btn-9slice-primary:not(:disabled):hover,
.btn-9slice:not(:disabled):hover {
  filter: brightness(1.10) drop-shadow(0 5px 12px rgba(201, 138, 50, 0.42));
}

/* 7. Secondary Button */
.btn-9slice-secondary,
.btn-secondary {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 13px 10px 13px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_secondary.png') 61 71 61 75 fill / 10px 13px 10px 13px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  color: var(--ck-text-cream);
  font-family: var(--ck-font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.92);
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.70));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 1px 6px;
  min-width: 0;
  overflow: visible !important;
  position: relative;
  transition: filter 0.14s ease, transform 0.12s ease;
}

.btn-9slice-secondary:not(:disabled):hover,
.btn-secondary:not(:disabled):hover {
  filter: brightness(1.12) drop-shadow(0 4px 10px rgba(201, 138, 50, 0.35));
}

/* 8. Danger Button */
.btn-9slice-danger,
.btn-danger {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 13px 9px 13px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_danger.png') 62 222 61 176 fill / 9px 13px 9px 13px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  color: #FFF2EE;
  font-family: var(--ck-font-display);
  font-weight: 800;
  text-shadow: 0 2px 3px rgba(20, 4, 4, 0.95);
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.72));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 1px 6px;
  min-width: 0;
  overflow: visible !important;
  position: relative;
}

.btn-9slice-danger:not(:disabled):hover,
.btn-danger:not(:disabled):hover {
  filter: brightness(1.12) drop-shadow(0 4px 10px rgba(158, 46, 46, 0.48));
}

/* 9. Disabled Button */
.btn-9slice-disabled,
.btn-9slice-primary:disabled,
.btn-9slice-secondary:disabled {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 13px 10px 13px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/btn_disabled.png') 63 209 62 188 fill / 10px 13px 10px 13px / 0 stretch;
  color: #AEA496;
  cursor: not-allowed;
  opacity: 0.85;
}

/* 10. Pill Button */
.btn-9slice-pill {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 12px 9px 12px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/hud_pill.png') 41 80 42 79 fill / 9px 12px 9px 12px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  color: var(--ck-text-cream);
  font-family: var(--ck-font-display);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 1px 6px;
  min-width: 0;
  overflow: visible !important;
  position: relative;
}

/* 11-14. Rarity Aged Parchment Cards (High-Contrast Dark Ink #1C1510 >= 11.5:1 + #E8DCC4 fallback!) */
.vault-card-common,
.parchment-card.rarity-common {
  background-color: #E8DCC4;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 8px 8px 8px 8px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_common.png') 48 56 46 63 fill / 8px 8px 8px 8px / 0 stretch;
  color: var(--ck-ink-dark);
  overflow: visible !important;
  position: relative;
}

.vault-card-rare,
.parchment-card.rarity-rare {
  background-color: #E8DCC4;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 9px 9px 9px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_rare.png') 75 85 75 85 fill / 9px 9px 9px 9px / 0 stretch;
  color: var(--ck-ink-dark);
  overflow: visible !important;
  position: relative;
}

.vault-card-epic,
.parchment-card.rarity-epic {
  background-color: #E8DCC4;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 9px 9px 9px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_epic.png') 80 94 79 94 fill / 9px 9px 9px 9px / 0 stretch;
  color: var(--ck-ink-dark);
  overflow: visible !important;
  position: relative;
}

.vault-card-legendary,
.parchment-card.rarity-legendary {
  background-color: #E8DCC4;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 9px 10px 9px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/card_legendary.png') 107 96 105 95 fill / 10px 9px 10px 9px / 0 stretch;
  color: var(--ck-ink-dark);
  overflow: visible !important;
  position: relative;
}

/* 15-16. Progress Bar Track & Fill */
.vault-bar-track {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 5px 9px 5px 9px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/bar_track.png') 39 70 42 69 fill / 5px 9px 5px 9px / 0 stretch;
  position: relative;
  overflow: hidden;
}

.vault-bar-fill {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 3px 5px 3px 5px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/bar_fill_primary.png') 25 30 28 28 fill / 3px 5px 3px 5px / 0 stretch;
  height: 100%;
  min-width: 8px;
  transition: width 0.18s ease-out;
}

/* 17. Active Tab */
.vault-tab-active,
.modal-tab.is-active {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 12px 6px 12px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/tab_active.png') 50 48 23 49 fill / 10px 12px 6px 12px / 0 stretch;
  color: var(--ck-text-gold);
}

/* 18-20. Shop Pack Cards, Forge Cards & Exit Reward Cards */
.shop-pack-card {
  background-color: #1C1917;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 13px 15px 12px 15px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_subpanel.png') 78 92 55 92 fill / 13px 15px 12px 15px / 0 stretch;
  overflow: visible !important;
  position: relative;
}

.forge-card {
  background-color: #1C1917;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 12px 14px 11px 14px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/frame_subpanel.png') 78 92 55 92 fill / 12px 14px 11px 14px / 0 stretch;
  overflow: visible !important;
  position: relative;
}

.exit-reward-card {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 15px 10px 15px;
  border-image: url('../assets/ui/vault_inked_parchment_roguelite/hud_pill.png') 41 80 42 79 fill / 10px 15px 10px 15px / 0 stretch;
  overflow: visible !important;
  position: relative;
}

/* Inner Button Label Overflow Guard (Keep overflow:visible on button, clip ONLY inner span) */
.btn-label {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.18;
}

/* ==================== POP-OUT BADGES & RED-DOT ROUTER (z-index >= 6) ==================== */

.notify-badge {
  position: absolute;
  top: -12px;
  right: 0;
  z-index: 12;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #D94848 0%, #8F1D1D 85%);
  border: 2px solid #FDE68A;
  color: #FFF9EC;
  font-family: var(--ck-font-body);
  font-size: 10px;
  font-weight: 800;
  line-height: 13px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.hotkey-badge {
  position: absolute;
  top: -5px;
  left: 0;
  z-index: 9;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 3px;
  background: #1B1613;
  border: 1px solid var(--ck-bronze);
  color: var(--ck-parchment-light);
  font-family: var(--ck-font-body);
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.tool-count,
.card-cost {
  position: absolute;
  top: -5px;
  right: 0;
  z-index: 9;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #3A2C20 0%, #17120E 85%);
  border: 2px solid var(--ck-bronze-bright);
  color: var(--ck-text-gold);
  font-family: var(--ck-font-body);
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

/* ==================== HEROIC FULL-BLEED TITLE SCREEN (ZERO BOXED LOGIN CARD) ==================== */

.title-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(54px, 7vh, 76px) clamp(24px, 4.5vw, 72px) clamp(20px, 3.5vh, 42px);
}

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

.title-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 26% 54%, rgba(201, 138, 50, 0.22), transparent 48%),
    radial-gradient(circle at 72% 44%, rgba(16, 12, 9, 0.56), transparent 62%),
    linear-gradient(95deg, rgba(10, 8, 7, 0.20) 0%, rgba(14, 11, 9, 0.58) 48%, rgba(10, 8, 7, 0.80) 100%);
}

.title-corner-utils {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 6;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 9px;
}

.title-layout {
  position: relative;
  z-index: 2;
  width: min(1380px, 96vw);
  max-height: 88vh;
  display: grid;
  grid-template-columns: minmax(280px, 42%) minmax(380px, 58%);
  align-items: center;
  gap: clamp(20px, 3.2vw, 52px);
  background: transparent !important;
  border: none !important;
}

.title-showcase-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
}

.title-hero-halo {
  position: absolute;
  width: min(440px, 38vw);
  height: min(440px, 38vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 138, 50, 0.38) 0%, rgba(158, 46, 46, 0.16) 50%, transparent 74%);
  pointer-events: none;
}

.title-portrait-host {
  position: relative;
  width: clamp(250px, 29vw, 410px);
  height: clamp(250px, 29vw, 410px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.92));
}

.title-hero-caption {
  margin-top: -10px;
  padding: 4px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  z-index: 4;
}

.title-hero-name {
  font-family: var(--ck-font-display);
  font-weight: 800;
  font-size: clamp(14px, 1.2vw, 18px);
  color: var(--ck-text-gold);
}

.title-hero-sep {
  color: var(--ck-bronze-bright);
  font-weight: 800;
}

.title-hero-role {
  font-size: clamp(13px, 1.0vw, 14.5px);
  color: var(--ck-parchment-light);
  font-weight: 700;
}

/* Floating Heroic Title Stack — STRICTLY ZERO background/border box! */
.title-heroic-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(10px, 1.5vh, 16px);
  padding: 0;
  min-width: 0;
  background: transparent !important;
  border: none !important;
  border-image: none !important;
  box-shadow: none !important;
}

.title-kicker-ribbon {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 2px 10px;
  text-transform: uppercase;
}

.kicker-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.game-logo-title {
  margin: 0;
  font-family: var(--ck-font-display);
  font-weight: 800;
  font-size: clamp(48px, 3.85vw, 66px);
  line-height: 1.04;
  letter-spacing: 0.03em;
  color: #FFEAA0;
  -webkit-text-stroke: 2px #160E09;
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 #2A190E,
    0 6px 0 #120B07,
    0 12px 26px rgba(0, 0, 0, 0.95),
    0 0 32px rgba(201, 138, 50, 0.48);
  overflow-wrap: break-word;
}

.game-logo-subtitle {
  margin: 0;
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--ck-parchment-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 1px 2px #0E0A08;
}

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

.starter-heading {
  font-family: var(--ck-font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--ck-bronze-bright);
}

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

.starter-card {
  background-color: #E8DCC4;
  background-clip: padding-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 6px 6px;
  min-width: 0;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.85));
  transition: transform 0.14s ease, filter 0.14s ease;
}

.starter-card:hover {
  transform: translateY(-3px);
}

.starter-card.is-selected {
  transform: translateY(-5px);
  filter: drop-shadow(0 0 14px rgba(201, 138, 50, 0.65)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.90));
}

.starter-portrait {
  width: clamp(54px, 6.2vh, 72px);
  height: clamp(54px, 6.2vh, 72px);
  object-fit: contain;
  border-radius: 4px;
  background: radial-gradient(circle, rgba(44, 32, 22, 0.88), rgba(20, 15, 11, 0.96));
  border: 1.5px solid #8A6F4E;
}

.starter-name {
  font-family: var(--ck-font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--ck-ink-dark);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starter-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--ck-ink-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.boot-status-text {
  font-size: 13px;
  font-weight: 800;
  color: var(--ck-parchment-light);
  text-align: right;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.title-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.title-play-btn {
  min-width: 280px;
  min-height: 64px;
  padding: 4px 26px;
  font-size: clamp(18px, 1.55vw, 23px);
  letter-spacing: 0.06em;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.88)) drop-shadow(0 0 18px rgba(201, 138, 50, 0.35));
}

.play-cta-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: 0 0 30px;
  margin-left: -4px;
}

.title-continue-btn {
  min-width: 180px;
  min-height: 56px;
  padding: 4px 18px;
  font-size: clamp(14px, 1.15vw, 17px);
}

.util-btn {
  flex: 0 0 auto;
  min-height: 40px;
  border-width: 8px 11px 8px 11px;
  font-size: 13px;
  padding: 1px 8px;
  overflow: visible !important;
}

.util-icon-only {
  width: 42px;
  height: 40px;
  padding: 0;
  border-width: 8px 9px 8px 9px;
  flex: 0 0 42px;
  overflow: visible !important;
}

#btn-title-lang {
  flex: 0 0 auto;
  padding: 1px 10px;
  font-size: 13px;
}

.util-btn .btn-label {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

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

/* ==================== FLOATING CORNER GAMEPLAY HUD ==================== */

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

/* Top Floating Row — NEVER wraps to 2 rows! */
.hud-top-row {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  pointer-events: none;
}

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

.hearth-vital-pill,
.stat-pill,
.hud-action-btn,
.hud-icon-sq,
.hud-quit-btn {
  pointer-events: auto;
  flex: 0 0 auto;
}

.hearth-vital-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 6px 0 2px;
}

.popout-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  margin: -7px 0 -7px -10px;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.85));
  pointer-events: none;
  flex: 0 0 28px;
}

.hearth-pop-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.hearth-bar-wrap {
  position: relative;
  width: 108px;
  height: 20px;
  display: flex;
  align-items: center;
}

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

.hearth-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #FFF9EC;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 7px 0 2px;
  color: var(--ck-parchment-light);
  font-weight: 800;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.stat-pill.resonance-pill.tier-active {
  color: var(--ck-text-gold);
  filter: drop-shadow(0 0 10px rgba(201, 138, 50, 0.52)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.78));
}

.clickable-pill {
  cursor: pointer;
}

.stat-pill-text {
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92);
}

.hud-action-btn {
  height: 40px;
  font-size: 13px;
  padding: 0 8px;
}

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

.hud-icon-sq {
  width: 40px;
  height: 40px;
  padding: 0;
}

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

.hud-quit-btn {
  height: 40px;
  font-size: 13px;
  padding: 0 9px;
}

/* Floating Boss Vital Banner */
.hud-wave-preview {
  align-self: center;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 12px;
  max-width: min(760px, 84vw);
  font-size: 11.5px;
  font-weight: 700;
  color: #EFE5CE;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.wave-preview-foes {
  color: #EBD5AC;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wave-preview-sep {
  color: #C98A32;
  opacity: 0.85;
}

.wave-preview-boss {
  color: #FDE68A;
  font-weight: 800;
  flex-shrink: 0;
}

.hud-wave-preview.is-boss-wave .wave-preview-boss {
  color: #FCA5A5;
}

.hud-boss-banner {
  align-self: center;
  margin-top: 4px;
  width: min(460px, 58vw);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 10px;
  pointer-events: none;
}

.boss-banner-portrait {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 4px;
  border: 1.5px solid var(--ck-crimson);
  background: #140E0C;
  flex: 0 0 44px;
}

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

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

.boss-banner-name {
  font-family: var(--ck-font-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--ck-text-gold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boss-chain-hint {
  font-size: 12px;
  font-weight: 800;
  color: #FFD6C9;
  background: rgba(158, 46, 46, 0.85);
  border: 1px solid var(--ck-bronze-bright);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.boss-hp-track {
  width: 100%;
  height: 16px;
}

/* ==================== BOTTOM FLOATING DOCKS (ROUND 5 SPATIAL LAWS) ==================== */

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

.hud-bottom-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  pointer-events: none;
  min-width: 0;
}

.hud-bottom-right {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  min-width: 0;
}

.hero-status-chip {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 58px;
  padding: 2px 8px;
  min-width: 148px;
  max-width: 186px;
}

.hero-chip-portrait {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  border: 1.5px solid var(--ck-bronze);
  background: radial-gradient(circle, rgba(201, 138, 50, 0.22), #120F0D);
  flex: 0 0 40px;
}

.hero-chip-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-chip-name {
  font-family: var(--ck-font-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--ck-text-gold);
  white-space: nowrap;
  overflow: visible;
}

.hero-mini-bar {
  width: 100%;
  height: 9px;
}

.hero-chip-sub {
  font-size: 12px;
  font-weight: 800;
  color: var(--ck-parchment-light);
  white-space: nowrap;
  overflow: visible;
}

/* Compact 68-90px Skill & Tool Slots (80x84px @ 1080p, 70x76px @ 720p, Icon 60% height, >= 13px text!) */
.tool-skill-strip,
.deck-ctrl-strip {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: flex-end;
  align-content: start;
  gap: 8px;
  pointer-events: none;
}

.tool-slot-btn {
  pointer-events: auto;
  width: 80px;
  height: 84px;
  flex: 0 0 80px;
  border-width: 5px 4px 5px 4px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  align-content: start;
  gap: 2px;
  padding: 2px 2px 2px;
  color: var(--ck-parchment-light);
  overflow: visible !important;
  position: relative;
  transition: transform 0.12s ease, filter 0.14s ease;
}

.tool-slot-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  filter: brightness(1.12) drop-shadow(0 6px 12px rgba(201, 138, 50, 0.36));
}

.tool-slot-btn.is-active-tool,
.ult-slot-btn.is-ult-ready {
  filter: drop-shadow(0 0 12px rgba(201, 138, 50, 0.72)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.85));
}

.tool-slot-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex: 0 0 50px;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.82));
}

.tool-slot-label {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  color: var(--ck-parchment-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.96);
}

.cooldown-pill {
  position: absolute;
  inset: 4px;
  z-index: 7;
  background: rgba(14, 11, 9, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--ck-text-gold);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Polyomino Tower Blueprint Cards (Aged Parchment 9-slice, Dark Ink #1C1510 + #E8DCC4!) */
.tower-hand-strip {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
  overflow: visible !important;
}

.tower-card {
  pointer-events: auto;
  background-color: #E8DCC4;
  background-clip: padding-box;
  width: 120px;
  height: 126px;
  flex: 0 0 120px;
  border-width: 6px 5px 6px 5px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 3px 3px 3px;
  cursor: pointer;
  overflow: visible !important;
  position: relative;
  filter: drop-shadow(0 7px 14px rgba(0, 0, 0, 0.85));
  transition: transform 0.14s ease, filter 0.14s ease;
}

.tower-card:hover {
  transform: translateY(-6px);
}

.tower-card.is-selected {
  transform: translateY(-10px) scale(1.04);
  filter: drop-shadow(0 0 14px rgba(201, 138, 50, 0.72)) drop-shadow(0 12px 20px rgba(0, 0, 0, 0.92));
}

.tower-card.is-unaffordable {
  opacity: 0.80;
  filter: saturate(0.66) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.82));
}

.tower-card.is-unaffordable .card-cost,
.tool-slot-btn.is-unaffordable .card-cost {
  background: radial-gradient(circle at 35% 30%, #7F1D1D 0%, #3F0D0D 85%);
  border-color: #F87171;
  color: #FCA5A5;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.55), 0 2px 6px rgba(0, 0, 0, 0.88);
}

.tower-card-art-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 54px;
}

.tower-card-sprite {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.poly-mini-grid {
  display: grid;
  gap: 2px;
  padding: 2px;
  background: rgba(28, 21, 16, 0.86);
  border: 1px solid var(--ck-bronze);
  border-radius: 3px;
}

.poly-pip {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.10);
}

.poly-pip.on {
  background: var(--ck-bronze-bright);
  box-shadow: inset 0 0 0 1px #FFF3CF;
}

.tower-card-name {
  display: block;
  width: 100%;
  min-width: 0;
  font-family: var(--ck-font-display);
  font-weight: 800;
  font-size: 12px;
  line-height: 1.06;
  color: var(--ck-ink-dark);
  text-align: center;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  overflow: visible;
  text-overflow: clip;
}

.tower-card-meta {
  width: 100%;
  font-size: 12px;
  font-weight: 800;
  color: var(--ck-ink-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.wave-call-btn {
  pointer-events: auto;
  height: 84px;
  min-width: 116px;
  max-width: 142px;
  border-width: 9px 10px 9px 10px;
  font-size: 13px;
  padding: 2px 6px;
}

.wave-call-btn .btn-label {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  text-align: center;
  line-height: 1.14;
}

/* ==================== COMPACT 1280x720 & <1460px RULES (ZERO TOP/BOTTOM CLIP!) ==================== */

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

@media (max-width: 1460px) {
  .hud-root {
    padding: 6px 8px 8px;
  }
  .hide-compact {
    display: none !important;
  }
  .hud-top-row {
    gap: 5px;
  }
  .hud-cluster {
    gap: 5px;
  }
  .hearth-bar-wrap {
    width: 84px;
  }
  .stat-pill {
    font-size: 13px;
    padding: 0 5px 0 1px;
  }
  .hud-action-btn {
    padding: 0 6px;
  }
  .hud-bottom-row {
    gap: 6px;
  }
  .hud-bottom-right,
  .tool-skill-strip,
  .deck-ctrl-strip,
  .tower-hand-strip {
    gap: 5px;
  }
  .hero-status-chip {
    min-width: 136px;
    max-width: 164px;
    height: 52px;
    padding: 2px 6px;
    gap: 6px;
  }
  .hero-chip-portrait {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }
  .tool-slot-btn {
    width: 70px;
    height: 76px;
    flex: 0 0 70px;
  }
  .tool-slot-icon {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
  }
  .tool-slot-label {
    font-size: 12.5px;
  }
  .tower-card {
    width: 98px;
    height: 112px;
    flex: 0 0 98px;
  }
  .tower-card-art-row {
    height: 42px;
  }
  .tower-card-sprite {
    width: 38px;
    height: 38px;
  }
  .wave-call-btn {
    height: 76px;
    min-width: 92px;
    max-width: 108px;
    font-size: 12.5px;
    padding: 2px 4px;
  }
}

@media (max-width: 1120px) {
  .hide-compact-sm,
  .hero-status-chip {
    display: none !important;
  }
  .title-layout {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }
  .title-showcase-col {
    display: none;
  }
}

/* ==================== MODALS, DRAFT, FORGE, SHOP & SETTINGS ==================== */

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 7, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: min(940px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 12px 10px;
  min-width: 0;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ck-bronze-dim);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.modal-title {
  margin: 0;
  font-family: var(--ck-font-display);
  font-weight: 800;
  font-size: clamp(17px, 1.5vw, 23px);
  color: var(--ck-text-gold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close-x {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: none;
  background: url('../assets/ui/vault_inked_parchment_roguelite/btn_close.png') center / contain no-repeat;
  color: transparent;
  font-size: 0;
  padding: 0;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.8));
  transition: transform 0.12s ease, filter 0.12s ease;
}

.modal-close-x:hover {
  transform: scale(1.07);
  filter: brightness(1.14) drop-shadow(0 4px 8px rgba(201, 138, 50, 0.45));
}

.modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-tab {
  min-height: 36px;
  padding: 2px 12px;
  font-family: var(--ck-font-display);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ck-parchment);
  background: #211C18;
  border: 1px solid var(--ck-bronze);
}

.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--ck-bronze) #14110E;
  transition: box-shadow 0.16s ease;
}

.modal-body.has-more-below {
  box-shadow: inset 0 -18px 16px -14px rgba(201, 138, 50, 0.55);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--ck-bronze-dim);
}

.modal-footer button .btn-label {
  text-transform: uppercase;
}

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

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

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

@media (max-width: 860px) {
  .modal-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Roguelite Buff Draft Cards (Aged Parchment + Ban & Lock Toggles!) */
.draft-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 6px;
  min-height: 248px;
  color: var(--ck-ink-dark);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.85));
}

.draft-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.draft-rarity-tag {
  font-family: var(--ck-font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  background: #231B15;
  color: var(--ck-text-gold);
  border: 1px solid var(--ck-bronze);
}

.draft-pin-group {
  display: flex;
  gap: 4px;
}

.draft-mini-toggle {
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid #6E553B;
  background: rgba(34, 25, 19, 0.88);
  color: var(--ck-parchment-light);
  border-radius: 3px;
}

.draft-mini-toggle.is-locked {
  background: #8B5E1A;
  border-color: #FDE68A;
  color: #FFF9EC;
}

.draft-mini-toggle.is-banned {
  background: var(--ck-crimson);
  border-color: #FCA5A5;
  color: #FFF5F5;
}

.draft-art-well {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 94px;
  background: radial-gradient(circle at 50% 42%, rgba(92, 62, 34, 0.72), rgba(24, 18, 13, 0.96));
  border: 1.5px solid #8A6F4E;
  border-radius: 6px;
}

.draft-stack-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #3B2714;
  background: rgba(201, 138, 50, 0.24);
  border: 1px solid rgba(138, 111, 78, 0.65);
}

.draft-stack-pill.is-stacking {
  color: #FFF3CF;
  background: #8B2626;
  border-color: #C98A32;
}

.draft-desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 600;
  color: #3E2B1A;
  text-align: center;
  min-height: 28px;
}

.draft-paused-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FDE68A;
  background: rgba(158, 46, 46, 0.85);
  border: 1px solid #C98A32;
}

.draft-art-well img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.75));
}

.draft-title {
  margin: 0;
  font-family: var(--ck-font-display);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ck-ink-dark);
  text-align: center;
  overflow-wrap: break-word;
}

.vf-chip-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.vf-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(24, 18, 14, 0.90);
  border: 1px solid #8E6A38;
  color: #FDE68A;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.vf-stat-chip.on-parchment {
  background: rgba(34, 24, 17, 0.92);
  border-color: #6E502B;
  color: #FFF4D2;
}

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

/* Shop & Forge Cards */
.shop-pack-card,
.forge-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
}

.shop-badge-ribbon {
  position: absolute;
  top: -10px;
  right: 8px;
  z-index: 9;
  padding: 2px 8px;
  background: linear-gradient(180deg, #B87324 0%, #7C4710 100%);
  border: 1.5px solid #FDE68A;
  color: #FFF9EC;
  font-family: var(--ck-font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.82);
}

.shop-badge-ribbon.badge-best {
  background: linear-gradient(180deg, #9E2E2E 0%, #641717 100%);
}

.shop-art-box {
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(201, 138, 50, 0.22), rgba(16, 13, 11, 0.88));
  border: 1px solid var(--ck-bronze-dim);
  border-radius: 6px;
}

.shop-art-box img {
  width: 88px;
  height: 88px;
  max-width: 88px;
  max-height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.82));
}

.shop-pack-title,
.forge-card-title {
  margin: 0;
  font-family: var(--ck-font-display);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ck-text-gold);
  text-align: center;
  overflow-wrap: break-word;
}

/* DPS Breakdown Bars */
.dps-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: rgba(28, 24, 20, 0.90);
  border: 1px solid var(--ck-bronze-dim);
  margin-bottom: 7px;
}

.dps-row img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 46px;
}

.dps-bar-col {
  flex: 1;
  min-width: 0;
}

.dps-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 3px;
}

/* Settings Controls */
.settings-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 11px;
  background: rgba(28, 24, 20, 0.90);
  border: 1px solid var(--ck-bronze-dim);
  margin-bottom: 5px;
}

.settings-lbl-grp {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

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

.settings-label {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ck-parchment-light);
}

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

.settings-toggle-btn {
  min-width: 74px;
  min-height: 32px;
  border-width: 8px 11px 8px 11px !important;
  font-size: 12.5px;
  padding: 1px 6px;
}

.settings-slider {
  width: 136px;
  accent-color: var(--ck-bronze-bright);
}

.settings-lang-block {
  margin-top: 6px;
}

.settings-lang-head {
  margin-bottom: 4px;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 4px;
}

.lang-pill-btn {
  min-height: 32px;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 700;
  background: #211C18;
  border: 1px solid var(--ck-bronze);
  color: var(--ck-parchment);
}

.lang-pill-btn.is-active {
  background: #6B471B;
  border-color: var(--ck-text-gold);
  color: #FFF9EC;
}

@media (max-height: 780px) {
  .settings-line {
    padding: 4px 10px;
    margin-bottom: 4px;
  }
  .settings-ico {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
  }
  .settings-label {
    font-size: 13px;
  }
  .settings-toggle-btn {
    min-height: 30px;
    border-width: 7px 10px 7px 10px !important;
    font-size: 12px;
  }
  .settings-lang-block {
    margin-top: 5px;
  }
  .settings-lang-head {
    margin-bottom: 3px;
  }
  .lang-grid {
    gap: 4px;
    margin-top: 3px;
  }
  .lang-pill-btn {
    min-height: 30px;
    padding: 2px 6px;
  }
}

/* ==================== FTUE TUTORIAL & TOASTS ==================== */

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

.tutorial-card {
  pointer-events: auto;
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 90vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px;
}

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

.ck-toast {
  padding: 5px 16px;
  font-family: var(--ck-font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--ck-text-gold);
  background: rgba(24, 19, 16, 0.94);
  border: 1.5px solid var(--ck-bronze-bright);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85);
}

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

.dev-f2-pill {
  position: fixed;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(24, 19, 16, 0.90);
  border: 1px solid var(--ck-bronze);
  color: var(--ck-text-gold);
  cursor: pointer;
}

#debug-panel {
  position: fixed;
  top: 58px;
  right: 14px;
  z-index: 125;
  width: 280px;
  padding: 10px;
  background: rgba(20, 16, 14, 0.96);
  border: 2px solid var(--ck-bronze-bright);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.9);
}

#debug-panel button {
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 700;
  background: #2C241E;
  border: 1px solid var(--ck-bronze);
  color: var(--ck-parchment-light);
  text-align: left;
}

/* ==================== SANCTUARY SEASONS HUB (`inked_parchment_roguelite`, ZERO CYAN!) ==================== */

.modal-card .vault-subpanel {
  filter: none;
}

.seasons-pass-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  margin-bottom: 8px;
}

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

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

.seasons-pass-title {
  font-family: var(--ck-font-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--ck-text-gold);
}

.seasons-pass-cur {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ck-parchment-light);
  font-variant-numeric: tabular-nums;
}

.inline-curr-ico {
  width: 17px;
  height: 17px;
  object-fit: contain;
  vertical-align: middle;
}

.seasons-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 8px;
}

.seasons-tabs .modal-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  padding: 2px 6px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.seasons-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ss-section-title {
  font-family: var(--ck-font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--ck-bronze-bright);
  margin: 2px 0 6px;
}

.theme-swatch {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 3px;
  border: 1.5px solid var(--ck-parchment-light);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55);
}

.dps-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

/* ==================== VISUAL-FIRST (60/25/15) DARK ROGUELITE SEASONS KIT ==================== */
.ck-vf-ico { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; flex-shrink: 0; }
.ck-vf-pass-banner {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 8px;
}
.ck-vf-pass-chest {
  width: 48px; height: 48px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.7));
}
.ck-vf-tab { gap: 5px; }
.seasons-tab-panel { display: flex; flex-direction: column; gap: 10px; }
.ck-vf-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.ck-vf-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }

.ck-vf-biome-banner {
  position: relative; height: 92px; border-radius: 6px; overflow: hidden;
  border: 2px solid #9A7440; display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.65);
}
.ck-vf-biome-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.72;
}
.ck-vf-biome-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(14, 11, 10, 0.92) 0%, rgba(18, 14, 12, 0.62) 55%, rgba(14, 11, 10, 0.85) 100%);
}
.ck-vf-biome-portrait {
  position: relative; z-index: 2; width: 66px; height: 66px; object-fit: cover;
  border-radius: 6px; border: 2px solid #D4A559; background: #1A1412; flex-shrink: 0;
}
.ck-vf-biome-body { position: relative; z-index: 2; flex: 1; min-width: 0; }
.ck-vf-toggle-btn { position: relative; z-index: 2; min-width: 82px; min-height: 38px; flex-shrink: 0; }
.ck-vf-badge {
  display: inline-block; padding: 1px 7px; border-radius: 3px;
  background: rgba(154, 116, 64, 0.28); border: 1px solid #C89B54;
  color: #F3D9A4; font-family: var(--ck-font-display); font-size: 10px; letter-spacing: 0.06em;
}
.ck-vf-banner-title {
  font-family: var(--ck-font-display); font-size: 15px; font-weight: 800;
  color: #FAF0D8; letter-spacing: 0.03em; line-height: 1.2;
}

.ck-vf-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; padding: 8px 8px 7px; min-width: 0;
}
.ck-vf-card.is-equipped { box-shadow: 0 0 0 1.5px #E5B96B, inset 0 0 18px rgba(212, 165, 89, 0.16); }
.ck-vf-card-top { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.ck-vf-rank-pill {
  padding: 1px 6px; border-radius: 3px; background: #261D17; border: 1px solid #8E6A38;
  color: #F3D9A4; font-family: var(--ck-font-display); font-size: 10px; font-weight: 800;
}
.ck-vf-eq-dot { color: #F5C35A; font-size: 13px; }
.ck-vf-plinth {
  width: 68px; height: 68px; border-radius: 8px;
  background: radial-gradient(circle at 50% 42%, rgba(212, 165, 89, 0.22), rgba(16, 13, 12, 0.92));
  border: 1.5px solid #8E6A38; display: flex; align-items: center; justify-content: center;
}
.ck-vf-plinth.lg { width: 78px; height: 78px; }
.ck-vf-plinth.crimson {
  background: radial-gradient(circle at 50% 42%, rgba(185, 48, 48, 0.34), rgba(18, 12, 12, 0.92));
  border-color: #A83232;
}
.ck-vf-plinth-img { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.75)); }
.ck-vf-plinth-img.lg { width: 64px; height: 64px; }
.ck-vf-card-title {
  font-family: var(--ck-font-display); font-size: 12.5px; font-weight: 800; color: #F4E7C8;
  line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.ck-vf-rwd-row {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 11.5px; font-weight: 800; color: #EBD5AC;
}
.ck-vf-btn-row { width: 100%; display: flex; gap: 5px; align-items: center; }
.ck-vf-cta { flex: 1; min-height: 34px; padding: 2px 6px; font-size: 11.5px; }
.ck-vf-cta .btn-label, .ck-vf-cta-sm .btn-label { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.ck-vf-cta-sm { min-width: 68px; min-height: 34px; padding: 2px 8px; font-size: 11.5px; }
.ck-vf-cta-xs { flex: 1; min-height: 30px; padding: 1px 6px; font-size: 11px; }

.ck-vf-preset-tile { flex-direction: row; align-items: center; gap: 8px; padding: 6px 8px; }
.ck-vf-preset-img { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.ck-vf-preset-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.ck-vf-hero-row { flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; }
.ck-vf-hero-ico { width: 50px; height: 50px; object-fit: contain; flex-shrink: 0; }
.ck-vf-hero-ico.round { border-radius: 6px; border: 1.5px solid #B58847; object-fit: cover; }
.ck-vf-hero-ico.crimson { border-color: #A83232; }

.ck-vf-track-box { position: relative; padding: 10px; }
.ck-vf-track-rail {
  position: absolute; left: 48px; right: 48px; top: 44px; height: 6px;
  background: #2B221D; border: 1px solid #74562C; border-radius: 999px; overflow: hidden;
}
.ck-vf-track-fill { height: 100%; background: linear-gradient(90deg, #B56E22, #F2B84B); }
.ck-vf-track-node { align-items: center; text-align: center; gap: 5px; padding: 8px; }
.ck-vf-node-chest { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.75)); }

.ck-vf-theme-card { align-items: center; text-align: center; gap: 5px; padding: 6px; }
.ck-vf-theme-thumb { width: 100%; height: 54px; border-radius: 4px; overflow: hidden; border: 2px solid #8E6A38; }
.ck-vf-theme-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ck-vf-medal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ck-vf-medal-tile { align-items: center; text-align: center; gap: 4px; padding: 7px 6px 6px; }
.ck-vf-medal-ring {
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 185, 107, 0.32), rgba(20, 15, 13, 0.95));
  border: 2px solid #C89B54; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.65);
}
.ck-vf-medal-img { width: 42px; height: 42px; object-fit: contain; }
.ck-vf-medal-tile.is-locked .ck-vf-medal-ring { border-color: #4A3E36; filter: grayscale(0.92); opacity: 0.68; }

@media (max-width: 1360px) {
  .ck-vf-biome-banner { height: 76px; }
  .ck-vf-biome-portrait { width: 54px; height: 54px; }
  .ck-vf-plinth { width: 56px; height: 56px; }
  .ck-vf-plinth-img { width: 44px; height: 44px; }
}

/* ==================== PILLAR 3: SPOTLIGHT FTUE & 3-ICON FEATURE GUIDES ==================== */

.tut-spotlight {
  position: fixed;
  z-index: 86;
  pointer-events: none !important;
  border-radius: 10px;
  border: 3px solid #FDE68A;
  box-shadow:
    0 0 0 4px rgba(201, 138, 50, 0.36),
    0 0 24px rgba(253, 230, 138, 0.65),
    inset 0 0 16px rgba(201, 138, 50, 0.35);
  animation: ckTutPulse 1.35s ease-in-out infinite;
}

@keyframes ckTutPulse {
  0%, 100% { scale: 1; opacity: 0.96; }
  50% { scale: 1.05; opacity: 1; }
}

.tut-hand {
  position: fixed;
  z-index: 87;
  width: 46px;
  height: 46px;
  pointer-events: none !important;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.92));
  animation: ckTutBob 0.95s ease-in-out infinite;
}

@keyframes ckTutBob {
  0%, 100% { translate: 0 0; }
  50% { translate: -5px -9px; }
}

.tut-callout {
  pointer-events: auto;
  position: fixed;
  z-index: 88;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  max-width: min(440px, 92vw);
}

.tut-callout-ico {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: 0 0 30px;
}

.tut-callout-text {
  font-family: var(--ck-font-display);
  font-size: 14px;
  font-weight: 800;
  color: #FDE68A;
  white-space: nowrap;
}

/* 3-Icon Visual Feature Guide Strip ([Icon 1] -> [Icon 2] -> [Icon 3]) */
.fg-strip-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.fg-step-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  text-align: center;
}

.fg-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2A1E15;
  border: 1.5px solid #C98A32;
  color: #FDE68A;
  font-family: var(--ck-font-display);
  font-size: 12px;
  font-weight: 800;
}

.fg-step-plinth {
  width: 86px;
  height: 86px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 42%, rgba(212, 165, 89, 0.26), rgba(16, 13, 11, 0.94));
  border: 1.5px solid #9A7440;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fg-step-plinth img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8));
}

.fg-step-caption {
  font-family: var(--ck-font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ck-text-cream);
  line-height: 1.22;
}

.fg-arrow {
  font-size: 24px;
  font-weight: 900;
  color: #C98A32;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  user-select: none;
}

/* Bestiary Visual Cards inside Tactical Codex (60/25/15 Anti-SaaS, Zero Cyan!) */
.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.bestiary-card {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 8px 10px !important;
  min-width: 0;
}

.bestiary-card.is-boss {
  box-shadow: inset 0 0 18px rgba(158, 46, 46, 0.24);
}

.bestiary-art-plinth {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 42%, rgba(212, 165, 89, 0.24), rgba(16, 13, 12, 0.94));
  border: 1.5px solid #8E6A38;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bestiary-art-plinth.crimson {
  background: radial-gradient(circle at 50% 42%, rgba(185, 48, 48, 0.34), rgba(18, 12, 12, 0.94));
  border-color: #B91C1C;
}

.bestiary-art-plinth img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.85));
}

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

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

.bestiary-name {
  font-family: var(--ck-font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ck-text-gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bestiary-role-pill {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #2A2018;
  border: 1px solid #8E6A38;
  color: var(--ck-parchment-light);
}

.bestiary-role-pill.is-swift {
  background: #422006;
  border-color: #F59E0B;
  color: #FDE68A;
}

.bestiary-role-pill.is-elite {
  background: #4A1919;
  border-color: #D97706;
  color: #FED7AA;
}

.bestiary-role-pill.is-boss {
  background: #7F1D1D;
  border-color: #FCA5A5;
  color: #FFF5F5;
}

.bestiary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bestiary-stat {
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(18, 14, 11, 0.90);
  border: 1px solid rgba(163, 139, 103, 0.45);
  color: var(--ck-parchment);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bestiary-counter-chip {
  font-size: 11px;
  font-weight: 700;
  color: #FDE68A;
  background: rgba(124, 45, 18, 0.34);
  border: 1px solid rgba(201, 138, 50, 0.50);
  border-radius: 3px;
  padding: 2px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Victory 3-Star Sunburst Canvas & Big Primary CTA */
.victory-fx-canvas {
  display: block;
  margin: 0 auto 4px;
  width: 340px;
  height: 108px;
  max-width: 100%;
  pointer-events: none;
}

.result-next-cta {
  min-width: 172px;
  min-height: 48px;
  font-size: 15px;
}

/* Clean non-regex aliases for Seasons Hub layout helpers */
.ss-hdr-banner { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 8px; }
.ss-hdr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ss-hdr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ss-hdr-title { font-family: var(--ck-font-display); font-weight: 800; font-size: 13.5px; color: var(--ck-text-gold); }
.ss-hdr-cur { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; color: var(--ck-parchment-light); font-variant-numeric: tabular-nums; }
.ck-vf-stat-grp { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 800; color: #EBD5AC; }
.ck-vf-btn-grp { width: 100%; display: flex; gap: 5px; align-items: center; }
.ck-vf-prog-wrap { position: relative; padding: 10px; }
.ck-vf-prog-line { position: absolute; left: 48px; right: 48px; top: 44px; height: 6px; background: #2B221D; border: 1px solid #74562C; border-radius: 999px; overflow: hidden; }
.ck-vf-prog-bar { height: 100%; background: linear-gradient(90deg, #B56E22, #F2B84B); }
.ck-vf-hero-ban { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; }
