/* Chibiguard: Merge Bastion — Ornate Storybook RPG UI Vault Stylesheet (100% Offline, 0 External Fonts, 0 backdrop-filter) */

:root {
  --font-display: 'Segoe UI Black', 'Trebuchet MS', 'Arial Rounded MT Bold', Impact, system-ui, sans-serif;
  --font-body: 'Segoe UI', 'Trebuchet MS', system-ui, -apple-system, sans-serif;
  --ink: #1C1B29;
  --cream: #FFF9E6;
  --meadow: #9BB844;
  --pine: #3F503C;
  --oak: #7E5942;
  --parchment: #E8DFAE;
  --moss: #738D47;
  --brass: #B78450;
  --gold: #FFD54F;
  --gold-deep: #D98A12;
  --ruby: #FF4D6D;
  --cyan: #5CE1FF;
  --uiv-font-display: var(--font-display);
  --uiv-font-body: var(--font-body);
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #233024;
  color: var(--cream);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

button {
  font-family: var(--font-display);
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
  outline: none;
  position: relative;
  overflow: visible !important;
}

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

.uiv-text-clip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* ===== PROPORTIONAL 9-SLICE OVERRIDES (CRISP CORNERS + ZERO VERTICAL CLIPPING) ===== */
.uiv-pill-compact {
  border-width: 8px 14px 10px 14px !important;
  border-image-width: 8px 14px 10px 14px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 4px;
  white-space: nowrap;
  color: #FFF8E7;
  font-size: clamp(13px, 1.05vw, 15px);
  text-shadow: 0 2px 0 rgba(20, 14, 24, 0.9);
  font-variant-numeric: tabular-nums;
}

.uiv-btn-hud {
  border-width: 9px 12px 10px 12px !important;
  border-image-width: 9px 12px 10px 12px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 42px;
  padding: 0 6px;
  white-space: nowrap;
  font-size: clamp(12px, 0.95vw, 14px);
  font-weight: 800;
  line-height: 1.1;
  filter: drop-shadow(0 3px 0 rgba(16, 12, 22, 0.55));
  transition: transform 0.12s ease, filter 0.12s ease;
}
.uiv-btn-hud:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: drop-shadow(0 4px 0 rgba(16, 12, 22, 0.65)) brightness(1.06);
}
.uiv-btn-hud:active:not(:disabled) {
  transform: translateY(1px);
}

.uiv-btn-cta {
  border-width: 13px 18px 13px 18px !important;
  border-image-width: 13px 18px 13px 18px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 12px;
  white-space: nowrap;
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.02em;
  filter: drop-shadow(0 4px 0 rgba(16, 12, 22, 0.6));
  transition: transform 0.12s ease, filter 0.12s ease;
}
.uiv-btn-cta:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: drop-shadow(0 6px 0 rgba(16, 12, 22, 0.68)) brightness(1.07);
}
.uiv-btn-cta:active:not(:disabled) {
  transform: translateY(1px);
}

.uiv-btn-primary-dark {
  color: #FFFDF5 !important;
  text-shadow:
    0 2px 0 #1A1024,
    0 -1px 0 #1A1024,
    1.5px 0 0 #1A1024,
    -1.5px 0 0 #1A1024,
    1px 1.5px 0 #1A1024,
    -1px 1.5px 0 #1A1024;
}

.uiv-ornate_storybook_rpg-btn-disabled {
  color: #CBD5E1 !important;
  text-shadow: 0 1.5px 0 #14101C;
  filter: saturate(0.45) brightness(0.92);
  opacity: 0.78 !important;
  cursor: not-allowed;
}

.uiv-btn-danger-light {
  color: #FFF9EC !important;
  text-shadow: 0 2px 0 rgba(40, 8, 12, 0.85);
}

.uiv-modal-shell {
  border-width: 18px 22px 18px 22px !important;
  border-image-width: 18px 22px 18px 22px !important;
  cursor: default !important;
  filter: drop-shadow(0 18px 30px rgba(8, 6, 14, 0.72));
}

.uiv-ribbon-title {
  border-width: 10px 24px 10px 26px !important;
  border-image-width: 10px 24px 10px 26px !important;
  cursor: default !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  color: #1D141F;
  font-size: clamp(15px, 1.3vw, 20px);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 rgba(255, 250, 225, 0.7);
}

.uiv-subpanel-clean {
  border-width: 10px 14px 10px 14px !important;
  border-image-width: 10px 14px 10px 14px !important;
  cursor: default !important;
  color: #FFF7DC;
}

.uiv-card-shell {
  border-width: 14px 12px 12px 12px !important;
  border-image-width: 14px 12px 12px 12px !important;
  cursor: default !important;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 5px 6px 6px;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  filter: drop-shadow(0 4px 6px rgba(10, 8, 16, 0.45));
}

/* ===== CANVAS STAGE LAYERS (100vw x 100vh FULL-BLEED) ===== */
#stage-root {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

#vfx-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  display: none;
}

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

/* ===== HEROIC NO-BOX TITLE SCREEN (PILLAR 1: ZERO OPAQUE LOGIN BOX!) ===== */
#title-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 36px;
  background-color: #1f2e22;
  background-image:
    radial-gradient(ellipse at 50% 44%, rgba(28, 22, 34, 0.10) 0%, rgba(18, 16, 28, 0.56) 100%),
    url('../assets/art/title_bg.jpg');
  background-size: cover;
  background-position: center center;
}

#title-screen.hidden {
  display: none !important;
}

.title-top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  z-index: 6;
}

.title-stage-center {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 5;
  background: transparent;
  border: none;
  pointer-events: none;
}

/* Live Hero Portraits flanking the sunlit meadow cleanly */
.title-hero-flank {
  position: fixed;
  bottom: 34px;
  width: clamp(180px, 19vw, 310px);
  height: clamp(200px, 34vh, 340px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
}
.title-hero-flank.left { left: clamp(18px, 5vw, 90px); }
.title-hero-flank.right { right: clamp(18px, 5vw, 90px); }

.title-hero-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(12, 10, 18, 0.62));
}

/* Floating Heroic Title Logo (ZERO box border / background behind h1!) */
.title-emblem {
  font-family: var(--font-display);
  font-size: clamp(42px, 5.2vw, 76px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: 0.03em;
  text-align: center;
  color: #FFF9E2;
  -webkit-text-stroke: 2.5px #1C1726;
  text-shadow:
    0 5px 0 #1C1726,
    0 10px 22px rgba(14, 10, 22, 0.65);
  max-width: 82vw;
  pointer-events: none;
}

.title-subtitle {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.45vw, 22px);
  font-weight: 800;
  color: #FFE8A3;
  text-shadow: 0 2px 0 #1C1726, 0 4px 12px rgba(12, 10, 20, 0.8);
  text-align: center;
  letter-spacing: 0.02em;
}

.title-cta-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  pointer-events: auto;
  z-index: 6;
}

/* Real 0-100% Loading Bar */
#title-loader-wrap {
  width: min(400px, 78vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.loader-track {
  width: 100%;
  height: 28px;
  border-width: 7px 14px 7px 14px !important;
  border-image-width: 7px 14px 7px 14px !important;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.loader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(180deg, #FFE066 0%, #F59E0B 55%, #C86D00 100%);
  border-radius: 4px;
  transition: width 0.14s ease-out;
}

.loader-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #FFF8E0;
  text-shadow: 0 2px 0 #1C1726;
  font-variant-numeric: tabular-nums;
}

#btn-title-play {
  min-width: 250px;
  min-height: 64px;
  font-size: clamp(20px, 1.9vw, 28px);
  letter-spacing: 0.06em;
  display: none;
}
#btn-title-play.ready {
  display: inline-flex;
}

.title-version-tag {
  position: fixed;
  bottom: 12px;
  left: 16px;
  z-index: 8;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(20, 14, 28, 0.76);
  border: 1.5px solid rgba(183, 132, 80, 0.65);
  color: #FFF4D6;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.hud-cur-lbl {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 800;
  color: #FFE8A3;
  letter-spacing: 0.01em;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.94;
}

/* ===== FLOATING GAMEPLAY HUD (ZERO SIDEBAR BLOAT, POINTER-THROUGH WRAPPER) ===== */
#game-hud {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 14px 12px;
}

#game-hud.active {
  display: flex;
}

#hud-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.hud-cluster {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
  flex-shrink: 0;
}

.hud-icon-sm {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
}

.hud-icon-btn {
  width: 44px;
  height: 44px;
  padding: 0 !important;
  min-height: 44px;
}
.hud-icon-btn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
}

/* Top-Center Wall HP & Wave Progress */
.hud-center-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
  flex: 0 1 320px;
  min-width: 220px;
}

.wall-hp-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wall-bar-track {
  flex: 1 1 auto;
  height: 28px;
  border-width: 7px 14px 7px 14px !important;
  border-image-width: 7px 14px 7px 14px !important;
  position: relative;
  overflow: hidden;
}

.wall-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #5CE667 0%, #2AA83B 55%, #197426 100%);
  border-radius: 3px;
  transition: width 0.08s linear;
}
.wall-bar-fill.low {
  background: linear-gradient(180deg, #FF7070 0%, #DC2626 60%, #991B1B 100%);
}

.wall-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 1.5px 0 #18121E;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.boss-hp-bar {
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.boss-hp-bar.active {
  display: flex;
}
.boss-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #FF6B6B 0%, #C81E1E 60%, #7F1D1D 100%);
  border-radius: 3px;
  transition: width 0.15s ease-out;
}

.wave-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-pill {
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(34, 24, 28, 0.88);
  border: 1.5px solid #B78450;
  color: #FFE9A8;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stage-map-btn {
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, filter 0.15s ease;
}
.stage-map-btn:hover {
  border-color: #FFD54F;
  filter: brightness(1.12);
  transform: translateY(-1px);
}

/* Bottom Floating Action Dock (Compact Center — >= 78% Open Canvas!) */
#hud-bottom {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  width: 100%;
  pointer-events: none;
}

.bottom-dock-panel {
  pointer-events: auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-width: 10px 18px 12px 18px !important;
  border-image-width: 10px 18px 12px 18px !important;
  cursor: default !important;
  max-width: 96vw;
}

.dock-action-btn {
  border-width: 9px 16px 10px 16px !important;
  border-image-width: 9px 16px 10px 16px !important;
  min-height: 54px;
  padding: 2px 14px !important;
  gap: 10px;
  font-size: clamp(13px, 1.05vw, 15px);
  justify-content: center;
  align-items: center;
}
.dock-action-btn > .hud-icon-sm {
  position: static;
  flex-shrink: 0;
  margin: 0;
}
.dock-action-btn > .dock-btn-label {
  position: static;
  flex: 0 1 auto;
  padding: 0 2px;
  letter-spacing: 0.02em;
}

.dock-cost-chip {
  position: static;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(18, 13, 26, 0.90);
  border: 1.5px solid rgba(255, 213, 79, 0.65);
  color: #FFF8E0;
  text-shadow: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dock-cost-chip img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.hotkey-cap {
  position: static;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(18, 13, 26, 0.92);
  border: 1.5px solid rgba(255, 232, 163, 0.75);
  color: #FFE8A3;
  text-shadow: none;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

/* Round 5 Compact Square Booster / Ultimate Button (72x72px, 64% icon fill!) */
#btn-ultimate {
  width: 74px;
  height: 74px;
  min-height: 74px;
  padding: 4px !important;
  border-width: 10px 10px 10px 10px !important;
  border-image-width: 10px 10px 10px 10px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
}

#btn-ultimate .ult-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}

#btn-ultimate .ult-pct {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 999px;
  background: #1D141F;
  border: 1.5px solid #FFD54F;
  color: #FFF9E6;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  z-index: 8;
  font-variant-numeric: tabular-nums;
}

.synergy-strip {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.syn-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(34, 24, 34, 0.88);
  border: 2px solid #8C633B;
  color: #FFF6DC;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.syn-badge.lit {
  border-color: #FFD54F;
  background: rgba(74, 48, 22, 0.94);
  color: #FFE98A;
}
.syn-badge img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.blessing-boost-btn {
  min-height: 38px !important;
  padding: 0 8px !important;
  gap: 5px;
  color: #FFE8A3;
  font-size: 12.5px !important;
}
.blessing-boost-btn.active {
  color: #5CE667;
  filter: drop-shadow(0 0 6px rgba(255, 213, 79, 0.75)) brightness(1.08);
}

/* Red-Dot Notification Badge (NEVER clipped!) */
.notify-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #E11D48;
  border: 2px solid #FFF8E7;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  z-index: 30;
  pointer-events: none;
  display: none;
}
.notify-badge.visible {
  display: inline-block;
}

/* Toast Banner (non-blocking, below Boss HP Bar & behind open modals) */
#toast-banner {
  position: fixed;
  top: 108px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 190;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(32, 22, 34, 0.94);
  border: 2px solid #FFD54F;
  color: #FFF9E2;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
#toast-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== FLEX-SCROLL MODALS (STRICT 90VH CONTAINMENT, ZERO CLIPPING AT 720P!) ===== */
#modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(16, 12, 24, 0.74);
  padding: 16px;
}

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

.modal-card {
  display: flex;
  flex-direction: column;
  width: min(940px, 94vw);
  max-height: min(88vh, 660px);
  overflow: hidden;
  position: relative;
  padding: 4px 10px 6px;
}

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

.modal-header {
  flex: 0 0 auto;
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 4px;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.modal-paused-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.94);
  border: 1.5px solid #FFF3B0;
  color: #FFFDF5;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-shadow: 0 1px 0 #1C1726;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.modal-close-x {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-close-x img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
}

.modal-tabs {
  flex: 0 0 auto;
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0 4px 4px;
}

.modal-tab-btn {
  border-width: 7px 14px 5px 14px !important;
  border-image-width: 7px 14px 5px 14px !important;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: #E5D4B8;
  opacity: 0.80;
}
.modal-tab-btn.active {
  opacity: 1;
  color: #FFF9E6;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 2;
  isolation: isolate;
  padding: 8px 4px 4px;
}

.modal-footer {
  flex: 0 0 auto;
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px 0;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(20, 14, 28, 0.78);
  border: 1.5px solid rgba(183, 132, 80, 0.65);
  color: #FFE8A3;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.defeat-keep-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(26, 20, 34, 0.88);
  border: 1.5px solid #FFD86B;
  color: #FFF7DC;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  text-shadow: 0 1px 0 #140D1C;
}
.defeat-keep-banner img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Anti-SaaS 60/25/15 Card Grids (strict minmax(0, 1fr), uniform row alignment, zero bottom clipping at 720p & 784p!) */
.vf-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}
.vf-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}
.vf-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}
.vf-grid-3 > *, .vf-grid-4 > *, .vf-grid-2 > * {
  min-width: 0;
  max-width: 100%;
}

.vf-card-portrait {
  border-width: 10px 10px 9px 10px !important;
  border-image-width: 10px 10px 9px 10px !important;
  height: 210px;
  min-height: 210px;
  gap: 2px;
  padding: 3px 6px 3px;
}

.vf-card-portrait.lb-me {
  box-shadow: 0 0 0 2.5px #FFD54F;
}

.vf-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 9px;
  border-radius: 999px;
  background: #D9363E;
  border: 1.5px solid #FFE8A3;
  color: #FFF9E6;
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
  z-index: 6;
}
.vf-badge.gold {
  background: #D97706;
}
.vf-badge.purple {
  background: #7C3AED;
}

.vf-art-box {
  width: 100%;
  flex: 0 0 102px;
  height: 102px;
  min-height: 102px;
  max-height: 102px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding: 4px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 42%, rgba(255, 245, 206, 0.28) 0%, rgba(28, 18, 34, 0.34) 72%, rgba(16, 10, 22, 0.50) 100%);
  border: 1.5px solid rgba(255, 232, 163, 0.34);
  overflow: hidden;
}
.vf-art-box img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(10, 6, 16, 0.62));
}

.vf-title {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1.5px 0 rgba(16, 12, 22, 0.65);
}

.uiv-ornate_storybook_rpg-card-legendary .vf-title {
  color: #1D141F;
  text-shadow: 0 1px 0 rgba(255, 250, 220, 0.6);
}

.vf-chips {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 5px;
  max-width: 100%;
}

.vf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(20, 14, 28, 0.78);
  color: #FFF8E0;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.vf-chip img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.vf-cta {
  flex: 0 0 auto;
  width: 100%;
  border-width: 6px 10px 7px 10px !important;
  border-image-width: 6px 10px 7px 10px !important;
  min-height: 30px !important;
  height: 30px;
  font-size: 13px !important;
  margin-top: 0;
}

/* Compact banner-modal card heights so 6 cards + top banner NEVER overflow at 784p or 720p! */
.modal-body.has-banner .vf-card-portrait,
.modal-body:has(.season-banner, .sm-hero-head) .vf-card-portrait {
  height: 192px;
  min-height: 192px;
  gap: 2px;
  padding: 2px 5px 3px;
}
.modal-body.has-banner .vf-art-box,
.modal-body:has(.season-banner, .sm-hero-head) .vf-art-box {
  flex: 0 0 90px;
  height: 90px;
  min-height: 90px;
  max-height: 90px;
  padding: 3px;
}
.modal-body.has-banner .vf-cta,
.modal-body:has(.season-banner, .sm-hero-head) .vf-cta {
  min-height: 28px !important;
  height: 28px;
  font-size: 12.5px !important;
}

/* Season / Event Banner (High-Contrast Cream/Gold #FFF7DC / #FFD86B on Dark Panel >= 10:1!) */
.season-banner, .sm-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 10px;
  margin-bottom: 6px;
  min-height: 44px;
}
.uiv-subpanel-clean.season-banner,
.season-banner {
  border-image: none !important;
  border: 2px solid #B78450 !important;
  background: rgba(26, 18, 34, 0.94) !important;
  color: #FFF7DC !important;
  border-radius: 12px;
}
.sm-hero-head {
  background: rgba(34, 24, 30, 0.86);
  border: 2px solid #B78450;
  border-radius: 12px;
  color: #FFF7DC;
}
.season-banner-left, .sm-hero-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.season-banner strong,
.season-banner-left strong,
.sm-hero-left strong {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 900;
  color: #FFD86B !important;
  text-shadow: 0 1.5px 0 #140D1C, 0 0 6px rgba(14, 10, 22, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.season-banner-left img, .sm-hero-left img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}
.season-steps, .sm-pip-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.season-dot, .sm-pip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(28, 20, 32, 0.88);
  border: 2px solid #9C784E;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #FFE8A3;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.season-dot:hover, .sm-pip:hover {
  transform: scale(1.1);
  border-color: #FFD54F;
}
.season-dot.ready, .sm-pip.ready {
  background: #D97706;
  border-color: #FFF6CC;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(255, 213, 79, 0.85);
}
.season-dot.done, .sm-pip.done {
  background: #2AA83B;
  border-color: #FFF6CC;
  color: #FFFFFF;
}

.giftcode-input {
  height: 38px;
  width: 162px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(16, 12, 24, 0.90);
  border: 2px solid #B78450;
  color: #FFF9E6;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  outline: none;
}
.giftcode-input:focus {
  border-color: #FFD54F;
}

/* Settings Layout */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(24, 18, 30, 0.56);
  border: 1.5px solid rgba(183, 132, 80, 0.45);
}
.setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: #FFF8E7;
}
.setting-label img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.setting-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setting-slider {
  width: 140px;
  accent-color: #F2B029;
  cursor: pointer;
}
.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}
.lang-btn {
  min-height: 32px !important;
  font-size: 12.5px !important;
  padding: 0 6px !important;
}
.lang-btn.active {
  outline: 2px solid #FFD54F;
  outline-offset: -2px;
}

/* Visual 3-Icon Guide Strip */
.guide-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* ===== VISUAL SPOTLIGHT FTUE (ROUND 8: ZERO PROSE BANNERS!) ===== */
#tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  display: none;
}
#tut-overlay.active {
  display: block;
}
.tut-spotlight {
  position: fixed;
  border: 3px solid #FFD54F;
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(255, 213, 79, 0.35);
  pointer-events: none;
  transition: all 0.25s ease;
  animation: tutPulse 1.15s ease-in-out infinite;
}
@keyframes tutPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.tut-hand {
  position: fixed;
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 155;
  animation: tutBounce 0.85s ease-in-out infinite;
}
@keyframes tutBounce {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6px, 8px) scale(0.94); }
}
.tut-pill {
  position: fixed;
  padding: 6px 14px;
  border-radius: 999px;
  background: #23182B;
  border: 2px solid #FFD54F;
  color: #FFF8E0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
  z-index: 156;
}
#btn-tut-skip {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 160;
  pointer-events: auto;
}

/* ===== PREVIEW-ONLY [DEV F2] PILL & PANEL (100% UNMOUNTED IN RELEASE!) ===== */
#btn-dev-f2 {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 180;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(24, 18, 34, 0.86);
  border: 1.5px solid #FFD54F;
  color: #FFD54F;
  font-size: 12px;
  font-weight: 800;
  pointer-events: auto;
}
#debug-panel {
  position: fixed;
  bottom: 48px;
  right: 12px;
  z-index: 250;
  width: 260px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(22, 16, 30, 0.95);
  border: 2px solid #FFD54F;
  display: none;
  flex-direction: column;
  gap: 6px;
}
#debug-panel.open {
  display: flex;
}
.dev-btn {
  padding: 6px 8px;
  border-radius: 6px;
  background: #3B2D4A;
  border: 1px solid #B78450;
  color: #FFF9E6;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}
.dev-btn:hover {
  background: #523D66;
}

/* ===== RESPONSIVE 720P, 784P & COMPACT HEIGHT FALLBACK ===== */
@media (max-width: 1360px) {
  #hud-top {
    gap: 6px;
  }
  .hud-cluster {
    gap: 5px;
  }
  .hud-cur-lbl {
    font-size: 10.5px;
    max-width: 58px;
  }
  .hud-center-cluster {
    flex: 0 1 240px;
    min-width: 185px;
  }
  .uiv-pill-compact {
    min-height: 36px;
    font-size: 13px;
    border-width: 6px 11px 8px 11px !important;
    border-image-width: 6px 11px 8px 11px !important;
  }
  .uiv-btn-hud {
    min-height: 38px;
    font-size: 12px;
    padding: 0 4px;
    border-width: 8px 10px 9px 10px !important;
    border-image-width: 8px 10px 9px 10px !important;
  }
  .dock-action-btn {
    border-width: 8px 14px 9px 14px !important;
    border-image-width: 8px 14px 9px 14px !important;
    min-height: 48px;
    padding: 2px 11px !important;
    gap: 8px;
  }
}

@media (max-width: 1360px), (max-height: 760px) {
  .vf-grid-3, .vf-grid-4, .vf-grid-2 {
    gap: 8px;
  }
  .modal-header {
    padding-bottom: 3px;
  }
  .modal-tabs {
    padding-bottom: 3px;
    flex-wrap: nowrap;
  }
  .modal-tab-btn {
    min-height: 30px;
  }
  .sm-hero-head, .season-banner {
    padding: 3px 9px;
    margin-bottom: 5px;
    min-height: 40px;
  }
  .sm-hero-left img, .season-banner-left img {
    width: 28px;
    height: 28px;
  }
  .vf-art-box {
    flex: 0 0 88px;
    height: 88px;
    min-height: 88px;
    max-height: 88px;
    padding: 3px;
  }
  .vf-art-box img {
    width: 100%;
    height: 100%;
  }
  .vf-card-portrait {
    border-width: 10px 9px 9px 9px !important;
    border-image-width: 10px 9px 9px 9px !important;
    height: 192px;
    min-height: 192px;
    gap: 2px;
    padding: 2px 5px 3px;
  }
  .modal-body.has-banner .vf-card-portrait,
  .modal-body:has(.season-banner, .sm-hero-head) .vf-card-portrait {
    height: 174px;
    min-height: 174px;
  }
  .modal-body.has-banner .vf-art-box,
  .modal-body:has(.season-banner, .sm-hero-head) .vf-art-box {
    flex: 0 0 76px;
    height: 76px;
    min-height: 76px;
    max-height: 76px;
  }
  .modal-body.has-banner .vf-cta,
  .modal-body:has(.season-banner, .sm-hero-head) .vf-cta {
    min-height: 27px !important;
    height: 27px;
    font-size: 12px !important;
  }
  .vf-title {
    font-size: 13.5px;
    line-height: 1.12;
  }
  .vf-chip {
    font-size: 11.5px;
    padding: 1px 6px;
  }
  .vf-cta {
    min-height: 28px !important;
    height: 28px;
    font-size: 12.5px !important;
  }
}

@media (max-width: 900px) {
  .vf-grid-3, .vf-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .title-hero-flank {
    display: none;
  }
  .hud-center-cluster {
    min-width: 150px;
  }
}
