/* Cryptmaw: Lair Merge — Inked Parchment Roguelite 16:9 Full-Bleed Theme (0 Google Fonts, 0 backdrop-filter) */
:root {
  --cm-bg: #0B0B13;
  --cm-ink: #1C1714;
  --cm-ink-soft: #3B3026;
  --cm-slate: #1C1917;
  --cm-slate-hi: #29231F;
  --cm-parchment: #EBD5AC;
  --cm-parchment-hi: #F5EBD6;
  --cm-bronze: #A38B67;
  --cm-gold: #D49A3A;
  --cm-gold-hi: #FDE68A;
  --cm-emerald: #34B37E;
  --cm-aether: #4AD8E8;
  --cm-umbra: #B378FF;
  --cm-crimson: #B83333;
  --cm-font-display: 'Cinzel', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --cm-font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--cm-bg);
  color: var(--cm-parchment-hi);
  font-family: var(--cm-font-body);
  font-size: 14px;
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

/* ==================== FULL-BLEED CANVAS LAYERS ==================== */
#game-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
  touch-action: none;
}

#volumetric-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 6;
  display: none;
}

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

#cutin-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 80;
  display: none;
}

/* ==================== HEROIC NO-BOX TITLE SCREEN ==================== */
#title-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 34px;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(11, 11, 19, 0.12) 0%, rgba(11, 11, 19, 0.72) 78%),
    url('../assets/art/title_bg.jpg') center center / cover no-repeat;
}

.title-corner-dock {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  z-index: 4;
}

.title-corner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  background: rgba(28, 25, 23, 0.88);
  border: 2px solid var(--cm-bronze);
  border-radius: 6px;
  color: var(--cm-parchment-hi);
  font-family: var(--cm-font-display);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.title-corner-btn:hover {
  border-color: var(--cm-gold-hi);
  color: var(--cm-gold-hi);
}

.title-corner-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
}

/* Strictly transparent, borderless container around h1 (Heroic No-Box Title Law!) */
.title-hero-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: 3;
  margin-top: -12px;
}

.title-portrait-stage {
  width: clamp(190px, 21vh, 270px);
  height: clamp(210px, 25vh, 300px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  pointer-events: none;
}

#title-hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.78));
}

.title-emblem {
  margin: 0;
  font-family: var(--cm-font-display);
  font-size: clamp(40px, 5.2vw, 74px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: 0.05em;
  color: #FDE68A;
  text-shadow:
    0 4px 0 #1A1014,
    0 -2px 0 #1A1014,
    2px 0 0 #1A1014,
    -2px 0 0 #1A1014,
    0 10px 26px rgba(0, 0, 0, 0.85);
}

.title-tagline {
  margin: 0;
  font-family: var(--cm-font-body);
  font-size: clamp(14px, 1.3vw, 18px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #F5EBD6;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.92);
}

.title-cta-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 4;
  min-height: 92px;
}

#boot-loader {
  width: min(380px, 78vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.boot-bar-track {
  width: 100%;
  height: 22px;
  background: rgba(20, 17, 15, 0.92);
  border: 2px solid var(--cm-bronze);
  border-radius: 4px;
  padding: 2px;
  overflow: hidden;
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2E857D 0%, #4AC48C 60%, #FDE68A 100%);
  transition: width 120ms ease-out;
}

.boot-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--cm-parchment-hi);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

#btn-title-play {
  min-width: 248px;
  min-height: 64px;
  padding: 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: #FFFDF7;
  text-shadow: 0 2px 3px rgba(20, 12, 8, 0.92);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.72));
}

#btn-title-play:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 8px 18px rgba(212, 154, 58, 0.45));
}

/* ==================== FLOATING CORNER HUD ==================== */
#hud-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

#hud-top {
  position: fixed;
  top: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  pointer-events: none;
}

.hud-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  pointer-events: none;
}

.res-pill {
  pointer-events: auto;
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 11px 0 6px;
  background: rgba(24, 20, 18, 0.92);
  border: 2px solid var(--cm-bronze);
  border-radius: 5px;
  color: var(--cm-parchment-hi);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.res-pill:hover {
  border-color: var(--cm-gold-hi);
}

.res-pill img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  margin-left: -2px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7));
  pointer-events: none;
}

.res-pill .res-val {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #F7EFE0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.res-pill .res-bar {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 2px;
  height: 3px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
}

.res-pill .res-bar > i {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: 2px;
}

.res-pill.aether .res-bar > i { background: var(--cm-aether); }
.res-pill.ichor .res-bar > i { background: var(--cm-emerald); }
.res-pill.umbra .res-bar > i { background: var(--cm-umbra); }
.res-pill.maw { border-color: #34B37E; }
.res-pill.realm { border-color: #8CE9FF; }
.res-pill.gold { border-color: #D49A3A; }
.res-pill.gems { border-color: #D94F4F; }

.hud-icon-btn {
  pointer-events: auto;
  position: relative;
  overflow: visible !important;
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 20, 18, 0.92);
  border: 2px solid var(--cm-bronze);
  border-radius: 5px;
  color: var(--cm-parchment-hi);
  font-family: var(--cm-font-display);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.hud-icon-btn:hover {
  border-color: var(--cm-gold-hi);
  color: var(--cm-gold-hi);
}

.hud-icon-btn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
}

/* Compact Floating Craving Strip (top-left below resources, never a sidebar!) */
#hud-cravings {
  position: fixed;
  top: 56px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(24, 20, 18, 0.88);
  border: 2px solid var(--cm-bronze);
  border-radius: 6px;
  pointer-events: auto;
  max-width: 250px;
  z-index: 19;
}

.craving-title {
  font-family: var(--cm-font-display);
  font-size: 13px;
  font-weight: 800;
  color: #6EE7B7;
  white-space: nowrap;
}

.craving-chips {
  display: flex;
  align-items: center;
  gap: 5px;
}

.craving-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  background: rgba(52, 179, 126, 0.16);
  border: 1px solid rgba(110, 231, 183, 0.55);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
  color: #F5EBD6;
}

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

/* Bottom Compact Action & Meta Dock (78px height, 44px icons = 56% ratio, overflow: visible!) */
#hud-bottom-dock {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  pointer-events: none;
  z-index: 22;
}

.dock-tile-btn {
  pointer-events: auto;
  position: relative;
  overflow: visible !important;
  width: 86px;
  height: 78px;
  padding: 4px 5px 5px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(180deg, #2D2520 0%, #1A1512 100%);
  border: 2px solid var(--cm-bronze);
  border-radius: 6px;
  color: var(--cm-parchment-hi);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.65);
}

.dock-tile-btn:hover {
  border-color: var(--cm-gold-hi);
  transform: translateY(-2px);
}

.dock-tile-btn.accent-surge { border-color: #4AC48C; }
.dock-tile-btn.accent-nova { border-color: #4AD8E8; }
.dock-tile-btn.accent-nova.is-ready {
  border-color: #FDE68A;
  background: linear-gradient(180deg, #21454A 0%, #14262A 100%);
}
.dock-tile-btn.accent-overdrive { border-color: #B378FF; }
.dock-tile-btn.accent-overdrive.is-ready {
  border-color: #FDE68A;
  background: linear-gradient(180deg, #43285C 0%, #241436 100%);
}
.dock-tile-btn.accent-raid {
  border-color: #D94F4F;
  background: linear-gradient(180deg, #3C1E1C 0%, #211110 100%);
}
.dock-tile-btn.accent-raid.is-boss {
  border-color: #FDE68A;
  background: linear-gradient(180deg, #52211D 0%, #2B100F 100%);
}
.dock-tile-btn.accent-seasons { border-color: #8CE9FF; }
.dock-tile-btn.accent-shop { border-color: #D49A3A; }

.dock-tile-btn img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.72));
}

.dock-label {
  display: block;
  max-width: 78px;
  font-family: var(--cm-font-display);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  color: #F5EBD6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

.tool-count, .notify-badge {
  position: absolute;
  top: -8px;
  right: -7px;
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cm-font-body);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  z-index: 30;
}

.tool-count {
  background: #1C1917;
  border: 2px solid var(--cm-gold);
  color: #FDE68A;
}

.notify-badge {
  background: #C92A2A;
  border: 2px solid #FDE68A;
  color: #FFFFFF;
}

.dock-key {
  position: absolute;
  top: -7px;
  left: -6px;
  min-width: 20px;
  height: 19px;
  padding: 0 4px;
  border-radius: 4px;
  background: #141210;
  border: 1px solid var(--cm-bronze);
  color: #EBD5AC;
  font-size: 13px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
  z-index: 28;
}

/* ==================== TOAST BANNER ==================== */
#toast-container {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 90;
}

.cm-toast {
  padding: 7px 18px;
  background: rgba(24, 20, 18, 0.94);
  border: 2px solid var(--cm-gold);
  border-radius: 5px;
  color: #FDE68A;
  font-family: var(--cm-font-display);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

/* ==================== VISUAL SPOTLIGHT FTUE (NEVER BLOCKS CLICKS!) ==================== */
#tut-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

.tut-spotlight {
  position: fixed;
  border: 3px solid #FDE68A;
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(253, 230, 138, 0.25);
  pointer-events: none;
  animation: tutPulse 1.1s ease-in-out infinite;
}

.tut-hand {
  position: fixed;
  font-size: 28px;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.85));
  animation: tutBob 0.9s ease-in-out infinite;
}

.tut-pill {
  position: fixed;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: rgba(24, 20, 18, 0.95);
  border: 2px solid #FDE68A;
  border-radius: 6px;
  color: #FDE68A;
  font-family: var(--cm-font-display);
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
}

#btn-tut-skip {
  position: fixed;
  top: 56px;
  right: 16px;
  padding: 6px 14px;
  background: rgba(28, 25, 23, 0.92);
  border: 2px solid var(--cm-bronze);
  border-radius: 5px;
  color: #F5EBD6;
  font-family: var(--cm-font-display);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  z-index: 42;
}

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

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

/* ==================== FLEX-SCROLL MODALS (ANTI-SAAS 60/25/15) ==================== */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 10, 0.86);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 100;
}

#modal-backdrop.is-open {
  display: flex;
}

.modal-card,
.modal-card.uiv-inked_parchment_roguelite-frame-modal {
  display: flex;
  flex-direction: column;
  width: min(1020px, 94vw);
  max-height: 92vh;
  overflow: hidden;
  background-color: #1A1512;
  background-clip: padding-box;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.90);
  color: var(--cm-parchment-hi);
  cursor: default;
}

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

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

.modal-title {
  margin: 0;
  font-family: var(--cm-font-display);
  font-size: 22px;
  font-weight: 800;
  color: #FDE68A;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.9);
}

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

.modal-close-x {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
}

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

.modal-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px 4px;
}

.modal-tab-btn {
  padding: 8px 18px;
  background: rgba(34, 29, 26, 0.92);
  border: 2px solid var(--cm-bronze);
  border-radius: 5px;
  color: #EBD5AC;
  font-family: var(--cm-font-display);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.modal-tab-btn.is-active {
  background: #C98A32;
  border-color: #FDE68A;
  color: #1C1714;
}

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

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

/* Visual-First 60/25/15 Card Grids */
.vf-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

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

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

.vf-card-portrait {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px 8px;
  min-height: 244px;
  text-align: center;
  background-color: #EFE5CE;
  background-clip: padding-box;
  box-shadow: inset 0 0 0 2px rgba(163, 139, 103, 0.55);
  color: var(--cm-ink);
  cursor: default;
}

.vf-badge {
  position: absolute;
  top: -8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #9E2E2E;
  border: 1px solid #FDE68A;
  color: #FFFDF7;
  font-family: var(--cm-font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  z-index: 4;
}

.vf-badge.best { background: #B87314; }
.vf-badge.popular { background: #1E6B63; }

.vf-art-frame {
  width: 100%;
  height: 142px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
  background: radial-gradient(circle at 50% 55%, rgba(28, 23, 20, 0.14) 0%, rgba(28, 23, 20, 0.02) 72%);
}

.vf-art-frame img {
  max-width: 142px;
  max-height: 138px;
  height: 134px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

.vf-card-name, .vf-title-short {
  margin: 0;
  max-width: 100%;
  font-family: var(--cm-font-display);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  color: #1C1714;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== SEASONS HUB & NON-BLOCKING FEATURE GUIDE ==================== */
.sm-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  margin-bottom: 10px;
  background: rgba(24, 20, 18, 0.92);
  border: 1px solid var(--cm-bronze);
  border-radius: 6px;
  flex-wrap: wrap;
}

.sm-banner-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sm-kicker {
  font-family: var(--cm-font-display);
  font-size: 15px;
  font-weight: 800;
  color: #FDE68A;
}

.sm-balances {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.sm-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.sm-balances .sm-chip {
  padding: 3px 8px;
  background: rgba(12, 10, 10, 0.65);
  border: 1px solid rgba(163, 139, 103, 0.45);
  border-radius: 4px;
  color: #F5EBD6;
}

.sm-mini-btn {
  height: 32px;
  padding: 0 10px;
  background: linear-gradient(180deg, #C98A32 0%, #8E5918 100%);
  border: 1px solid #FDE68A;
  border-radius: 4px;
  color: #FFFDF7;
  font-family: var(--cm-font-display);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.sm-help-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #2C241E;
  border: 2px solid #FDE68A;
  color: #FDE68A;
  font-family: var(--cm-font-display);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fg-guide-banner {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 130;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  max-width: min(520px, 90vw);
  max-height: 54px;
  background: rgba(20, 17, 15, 0.96);
  border: 2px solid #FDE68A;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.78);
  pointer-events: none;
}

.fg-guide-ic {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.fg-guide-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fg-guide-kicker {
  font-family: var(--cm-font-display);
  font-size: 14px;
  font-weight: 800;
  color: #FDE68A;
}

.fg-guide-step {
  font-size: 13px;
  font-weight: 700;
  color: #F5EBD6;
}

.vf-chip-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--cm-font-body);
  font-size: 13px;
  font-weight: 800;
  color: #3B2714;
  font-variant-numeric: tabular-nums;
}

.cur-ic {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
}

.vf-cta-btn {
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: linear-gradient(180deg, #C98A32 0%, #8E5918 100%);
  border: 2px solid #2A1D12;
  border-radius: 5px;
  color: #FFFDF7;
  font-family: var(--cm-font-display);
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.vf-cta-btn:hover {
  filter: brightness(1.1);
}

.vf-cta-btn.is-secondary {
  background: linear-gradient(180deg, #2E857D 0%, #1B524D 100%);
}

.vf-cta-btn.is-danger {
  background: linear-gradient(180deg, #A33131 0%, #6E1C1C 100%);
}

.vf-cta-btn.is-done, .vf-cta-btn:disabled {
  background: #57524C;
  color: #E2DBD0;
  cursor: default;
  filter: none;
}

/* Settings & Pause Controls (never use class "card" or "row" on plain settings lines!) */
.setting-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(34, 28, 24, 0.92);
  border: 1px solid rgba(163, 139, 103, 0.45);
  border-radius: 6px;
}

.setting-entry label {
  font-family: var(--cm-font-display);
  font-size: 15px;
  font-weight: 700;
  color: #F5EBD6;
}

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

.setting-ctrl input[type="range"] {
  width: 150px;
  accent-color: #D49A3A;
  cursor: pointer;
}

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

.lang-btn {
  padding: 8px 10px;
  background: rgba(34, 28, 24, 0.92);
  border: 2px solid var(--cm-bronze);
  border-radius: 5px;
  color: #F5EBD6;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.lang-btn.is-active {
  background: #C98A32;
  border-color: #FDE68A;
  color: #1C1714;
}

.action-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

/* Chest & Victory Celebration Centerpiece */
.celebrate-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 10px;
}

.celebrate-hero-img {
  width: 132px;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(253, 230, 138, 0.45));
}

.celebrate-loot-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.loot-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(235, 213, 172, 0.96);
  border: 2px solid #8A5A1A;
  border-radius: 6px;
  color: #1C1714;
  font-size: 16px;
  font-weight: 800;
}

.loot-pill img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Preview-Only DEV F2 Panel (never mounted when __MS_RELEASE__ === true) */
#dev-f2-pill {
  position: fixed;
  top: 102px;
  left: 12px;
  padding: 5px 10px;
  background: rgba(20, 16, 15, 0.92);
  border: 2px solid #D49A3A;
  border-radius: 4px;
  color: #FDE68A;
  font-family: var(--cm-font-body);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  z-index: 35;
}

#debug-panel {
  position: fixed;
  top: 138px;
  left: 12px;
  width: 256px;
  padding: 10px;
  background: rgba(18, 15, 14, 0.96);
  border: 2px solid #D49A3A;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 120;
}

#debug-panel button {
  padding: 6px 8px;
  background: #2C241E;
  border: 1px solid #A38B67;
  border-radius: 4px;
  color: #F5EBD6;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

#debug-panel button:hover {
  border-color: #FDE68A;
  color: #FDE68A;
}

/* ==================== 720p RESPONSIVE TUNING ==================== */
@media (max-width: 1366px), (max-height: 780px) {
  .res-pill {
    height: 36px;
    padding: 0 8px 0 5px;
    gap: 4px;
  }
  .res-pill img {
    width: 24px;
    height: 24px;
  }
  .res-pill .res-val {
    font-size: 13px;
  }
  .hud-icon-btn {
    width: 38px;
    height: 38px;
  }
  .hud-icon-btn img {
    width: 22px;
    height: 22px;
  }
  .dock-tile-btn {
    width: 72px;
    height: 66px;
  }
  .dock-tile-btn img {
    width: 36px;
    height: 36px;
  }
  #modal-backdrop {
    padding: 8px;
  }
  .modal-card,
  .modal-card.uiv-inked_parchment_roguelite-frame-modal {
    max-height: 96vh;
    border-width: 16px 18px 20px 18px !important;
  }
  .modal-header {
    padding: 2px 8px 5px;
  }
  .modal-title {
    font-size: 19px;
  }
  .modal-close-x {
    width: 32px;
    height: 32px;
  }
  .modal-close-x img {
    width: 30px;
    height: 30px;
  }
  .modal-tabs {
    padding: 5px 8px 3px;
    gap: 6px;
  }
  .modal-tab-btn {
    padding: 5px 13px;
    font-size: 13px;
  }
  .modal-body {
    padding: 6px 8px 8px;
  }
  .modal-footer {
    padding: 6px 8px 2px;
  }
  .sm-banner {
    padding: 4px 10px;
    margin-bottom: 6px;
  }
  .vf-grid-3, .vf-grid-4 {
    gap: 8px;
  }
  .vf-card-portrait.uiv-inked_parchment_roguelite-card-common,
  .vf-card-portrait.uiv-inked_parchment_roguelite-card-rare,
  .vf-card-portrait.uiv-inked_parchment_roguelite-card-epic,
  .vf-card-portrait.uiv-inked_parchment_roguelite-card-legendary {
    border-width: 12px 14px 12px 14px !important;
  }
  .vf-card-portrait {
    min-height: 0;
    padding: 3px 6px 5px;
    gap: 3px;
  }
  .vf-art-frame {
    height: 92px;
  }
  .vf-art-frame img {
    height: 88px;
    max-width: 96px;
    max-height: 88px;
  }
  .vf-grid-4 .vf-art-frame {
    height: 112px;
  }
  .vf-grid-4 .vf-art-frame img {
    height: 106px;
    max-width: 112px;
    max-height: 106px;
  }
  .vf-card-name, .vf-title-short {
    font-size: 14px;
  }
  .vf-badge {
    top: -6px;
    right: 6px;
    padding: 1px 6px;
    font-size: 12px;
  }
  .vf-cta-btn {
    min-height: 34px;
    padding: 4px 8px;
    font-size: 13px;
  }
}

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