/* ==========================================================================
 * Fablehelm: Skydeck Clash — Ornate Storybook RPG Commercial Stylesheet
 * UI Vault: ornate_storybook_rpg (Carved Oak, Forged Brass, Jewel Rarity Cards)
 * Enforces:
 *  - >= 18 real 9-slice border-image regions (ZERO stretched PNGs!)
 *  - Full-bleed 100vw x 100vh Skydeck (#game-canvas >= 72% unobstructed)
 *  - Floating corner HUD clusters (ZERO solid top bar, ZERO opaque sidebars)
 *  - Top HUD flex-wrap: nowrap !important + <=1460px compact rules (0 wrap at 1280x720)
 *  - Round 5 Spatial Laws: compact <=108px action stacks, 55-68% icon fit,
 *    overflow: visible !important + badge z-index >= 8, 44-50% card art window
 *  - ZERO backdrop-filter: blur(), ZERO ctx.shadowBlur
 * ========================================================================== */

:root,
html[data-ui-vault-style="ornate_storybook_rpg"] {
  --fh-oak-deep: #241712;
  --fh-oak-mid: #412517;
  --fh-oak-warm: #774B33;
  --fh-plum-dark: #2B2230;
  --fh-brass: #D6A85D;
  --fh-brass-bright: #FFD166;
  --fh-parchment: #F2D8A7;
  --fh-cream: #FFF8E7;
  --fh-ink: #1D141F;
  --fh-ink-brown: #2A1910;
  --fh-emerald: #44B848;
  --fh-ruby: #D63C44;
  --fh-violet: #8B46DF;
  --fh-sky-teal: #ADCDBD;

  --font-display: 'Segoe UI Black', 'Arial Black', 'Trebuchet MS', sans-serif;
  --font-body: 'Segoe UI', 'Calibri', system-ui, sans-serif;

  /* TrackBUIMotion v2.7.0 <-> Ornate Storybook RPG Slot Contract */
  --tb-slot-style: 'ornate_storybook_rpg';
  --tb-slot-shape: rect;
  --tb-slot-radius: 10px;
  --tb-slot-chamfer: 0px;
  --tb-slot-inset: 3px 3px 4px 3px;
  --tb-slot-palette: gold;
  --tb-slot-mode: chaser_slot;
  --tb-slot-daylight: 0;
  --tb-slot-z: 3;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #1B1522;
  color: var(--fh-cream);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

button {
  font-family: var(--font-display);
  cursor: pointer;
  outline: none;
  min-width: 0;
  overflow-wrap: break-word;
}

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

/* ==========================================================================
 * 20+ REAL 9-SLICE BORDER-IMAGE REGIONS (assets/ui/vault_ornate_storybook_rpg)
 * ========================================================================== */

/* 1. Modal Sheet — frame_modal.png (dark center #2E252E -> light text; NEVER on Title!) */
.modal-card,
.dlg-sheet {
  background-color: #2E252E;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 24px 28px 24px 28px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_modal.png') 87 103 86 103 fill / 24px 28px 24px 28px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  color: var(--fh-cream);
}

/* 2. Warm Parchment Subpanel — frame_subpanel.png (cream center #EDD5A7 -> dark ink!) */
.subpanel-9slice,
.modal-subpanel {
  background-color: #EDD5A7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 12px 13px 12px 13px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_subpanel.png') 76 90 75 88 fill / 12px 13px 12px 13px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 6px 14px rgba(14, 9, 6, 0.56);
  color: var(--fh-ink);
}

/* 3. Storybook Scroll Ribbon — ribbon_header.png (cream scroll #F2D8A7 -> dark ink!) */
.ribbon-title,
.modal-ribbon-hdr {
  background-color: #F2D8A7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 12px 26px 12px 30px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/ribbon_header.png') 93 171 93 197 fill / 12px 26px 12px 30px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  color: var(--fh-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 8px;
  box-shadow: 0 4px 8px rgba(12, 7, 5, 0.5);
}

/* 4. Carved Leather & Brass HUD Pill — hud_pill.png (dark center #2E1F15 -> white text) */
.hud-pill,
.rival-chip {
  background-color: #2E1F15;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 13px 10px 13px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/hud_pill.png') 45 80 56 78 fill / 9px 13px 10px 13px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 8px rgba(12, 8, 5, 0.58);
  color: #FFFFFF;
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* 5. Beveled Oak & Brass Socket Tile — slot_tile.png */
.slot-tile-ui,
.treasure-socket,
.synergy-chip {
  background-color: #261810;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 11px 9px 11px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/slot_tile.png') 35 85 19 85 fill / 9px 11px 9px 11px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 8px rgba(10, 6, 4, 0.58);
  color: #FFFFFF;
  position: relative;
  overflow: visible !important;
}

/* 6. Emerald Gem Brass Button — btn_primary.png */
.btn-primary-9slice {
  background-color: #215F26;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 11px 13px 11px 13px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_primary.png') 77 82 76 86 fill / 11px 13px 11px 13px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 5px 10px rgba(8, 12, 8, 0.58);
  color: #FFFFFF;
  font-weight: 900;
  text-shadow: 0 2px 0 #0D2610, 0 0 4px rgba(8, 26, 10, 0.9);
  -webkit-text-stroke: 1.4px #0D2610;
  paint-order: stroke fill;
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease;
}

.btn-primary-9slice:not(:disabled):hover {
  transform: translateY(-1px);
}

/* 7. Amber Gold Brass Button — btn_secondary.png */
.btn-secondary-9slice {
  background-color: #E99F0F;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 12px 11px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_secondary.png') 77 84 84 90 fill / 10px 12px 11px 12px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 8px rgba(12, 8, 4, 0.55);
  color: #1D141F;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 248, 225, 0.72);
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: transform 0.12s ease;
}

.btn-secondary-9slice:not(:disabled):hover {
  transform: translateY(-1px);
}

/* 8. Ruby Crimson Brass Button — btn_danger.png */
.btn-danger-9slice {
  background-color: #7D1B22;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 12px 10px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_danger.png') 77 81 76 83 fill / 10px 12px 10px 12px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 8px rgba(18, 6, 6, 0.58);
  color: #FFF8F6;
  text-shadow: 0 2px 0 #3A0A0E;
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-danger-9slice:not(:disabled):hover {
  transform: translateY(-1px);
}

/* 9. Slate Iron Disabled Button — btn_disabled.png */
.btn-disabled-9slice,
button.is-disabled-9slice {
  background-color: #484F5A;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 12px 10px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_disabled.png') 77 84 75 90 fill / 10px 12px 10px 12px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* 10. Game Art Kit Gold CTA — assets/ui/btn_primary.png */
.cta-gold-9slice {
  background-color: #FAAE04;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 12px 10px 12px;
  border-image: url('../assets/ui/btn_primary.png') 92 90 91 92 fill / 10px 12px 10px 12px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 8px rgba(12, 8, 4, 0.58);
  color: #14121F;
  text-shadow: 0 1px 0 rgba(255, 250, 224, 0.72);
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.cta-gold-9slice:not(:disabled):hover {
  transform: translateY(-1px);
}

/* 11. Game Art Kit Parchment Panel — assets/ui/frame_panel.png */
.panel-heroic-9slice {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 22px 34px 18px 34px;
  border-image: url('../assets/ui/frame_panel.png') 174 356 138 355 fill / 22px 34px 18px 34px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  color: #14121F;
}

/* 12-15. 4 Distinct Rarity Collectible Cards (thin 11-12px border-width for crisp text room!) */
.rarity-card-9slice,
.shop-draft-card,
.captain-pick-card,
.iap-pack-card {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 11px 11px 11px 11px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_common.png') 129 113 104 112 fill / 11px 11px 11px 11px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 6px 12px rgba(10, 6, 12, 0.65);
  color: #FFFFFF;
  position: relative;
  overflow: visible !important;
  min-width: 0;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.rarity-rare {
  border-width: 11px 11px 11px 11px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_rare.png') 135 116 126 112 fill / 11px 11px 11px 11px / 0 stretch;
  color: #FFFFFF;
}

.rarity-epic {
  border-width: 11px 11px 11px 11px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_epic.png') 132 114 107 116 fill / 11px 11px 11px 11px / 0 stretch;
  color: #FFFFFF;
}

.rarity-legendary,
.captain-pick-card.is-selected {
  background-color: #E58F0B;
  background-clip: padding-box;
  border-width: 12px 11px 12px 11px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_legendary.png') 131 117 114 115 fill / 12px 11px 12px 11px / 0 stretch;
  color: #181822;
}

/* 16-17. Progress Gauge Track & Ruby/Gold Fill — bar_track.png + bar_fill_primary.png */
.progress-bar-track {
  background-color: #28211C;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 6px 14px 6px 14px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/bar_track.png') 55 235 54 170 fill / 6px 14px 6px 14px / 0 stretch;
  border-radius: 0;
  position: relative;
  height: 22px;
  overflow: hidden;
}

.progress-bar-fill {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 4px 8px 4px 10px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/bar_fill_primary.png') 44 86 44 136 fill / 4px 8px 4px 10px / 0 stretch;
  height: 100%;
  min-width: 14px;
  transition: width 0.22s ease-out;
}

/* 18. Modal Active Tab — tab_active.png */
.modal-tab-btn {
  background: rgba(34, 23, 18, 0.85);
  border: 2px solid #8A5B36;
  color: #EAD8BE;
  padding: 6px 14px;
  font-size: clamp(11.5px, 0.92vw, 14px);
  letter-spacing: 0.03em;
  position: relative;
  overflow: visible !important;
}

.modal-tab-btn.is-active {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 16px 5px 16px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/tab_active.png') 48 129 18 127 fill / 9px 16px 5px 16px / 0 stretch;
  color: #FFF8E7;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.85);
}

/* 19. Vault Circular Close Badge — btn_close.png (1:1 aspect ratio, contain) */
.modal-close-x {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  border: none;
  background: url('../assets/ui/vault_ornate_storybook_rpg/btn_close.png') center / contain no-repeat;
  color: transparent;
  font-size: 0;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
  transition: transform 0.12s ease, filter 0.12s ease;
}

.modal-close-x:hover {
  transform: scale(1.08);
  filter: brightness(1.12) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.75));
}

/* ==========================================================================
 * BADGES, POP-OUT ICONS & SAFE INNER LABELS (z-index >= 8, overflow: visible)
 * ========================================================================== */

.has-badge {
  position: relative;
  overflow: visible !important;
}

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

.notify-badge {
  position: absolute;
  top: -8px;
  right: -3px;
  z-index: 12;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #FF6B6B 0%, #D62828 75%);
  border: 2px solid #FFF8E7;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

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

.uiv-icon-pop {
  position: relative;
  z-index: 9;
  width: 28px;
  height: 28px;
  margin: -7px 1px -7px -9px;
  object-fit: contain;
  flex: 0 0 28px;
  pointer-events: none;
}

.hotkey-chip {
  position: absolute;
  top: -8px;
  right: -3px;
  z-index: 9;
  padding: 1px 5px;
  border-radius: 4px;
  background: #241712;
  border: 1.5px solid var(--fh-brass);
  color: var(--fh-cream);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 11.5px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.mini-cur-ico,
.rwd-ico {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: -3px;
  flex: 0 0 18px;
}

.mini-cur-ico {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 2px;
}

/* ==========================================================================
 * SCENE 1: TITLE SCREEN
 * ========================================================================== */

.screen-title {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 36px) clamp(20px, 4vw, 64px);
}

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

.title-scrim-layer {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 27% 52%, rgba(255, 209, 102, 0.22), transparent 48%),
    radial-gradient(ellipse at 68% 46%, rgba(16, 10, 22, 0.56) 0%, rgba(16, 10, 22, 0.24) 55%, transparent 80%),
    linear-gradient(180deg, rgba(14, 9, 20, 0.35) 0%, rgba(14, 9, 20, 0.12) 48%, rgba(14, 9, 20, 0.52) 100%);
  z-index: 1;
}

.title-corner-utils {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-stage-grid {
  position: relative;
  z-index: 2;
  width: min(1380px, 95vw);
  display: grid;
  grid-template-columns: minmax(290px, 42%) minmax(380px, 58%);
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
}

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

.title-hero-halo {
  position: absolute;
  width: min(410px, 34vw);
  height: min(410px, 46vh);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.42) 0%, rgba(214, 168, 93, 0.16) 52%, transparent 74%);
  pointer-events: none;
}

.title-hero-portrait-wrap {
  position: relative;
  width: min(370px, 31vw);
  height: min(380px, 46vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-hero-portrait {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(12, 8, 16, 0.78));
}

.title-captain-banner {
  margin-top: -12px;
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px;
  max-width: min(380px, 92%);
}

.title-captain-crest {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 34px;
}

.title-captain-meta {
  min-width: 0;
}

.title-captain-name {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.15vw, 18px);
  color: var(--fh-ink);
  line-height: 1.15;
}

.title-captain-aura {
  font-size: clamp(12px, 0.92vw, 13.5px);
  font-weight: 800;
  color: #4D301B;
  line-height: 1.22;
}

/* Pillar 1 Heroic No-Box Title Stage: ZERO background, ZERO border, ZERO login plaque! */
.title-heroic-stage {
  background: transparent !important;
  border: none !important;
  border-image: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0;
  gap: clamp(10px, 1.5vh, 16px);
}

.ribbon-title-text {
  font-family: var(--font-display);
  font-size: clamp(12.5px, 1vw, 15px);
  letter-spacing: 0.06em;
  color: var(--fh-ink);
}

.game-logo-title {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 3.55vw, 58px);
  line-height: 1.06;
  letter-spacing: 0.015em;
  color: #FFF8E7;
  -webkit-text-stroke: 4px #150C1D;
  paint-order: stroke fill;
  text-shadow:
    0 4px 0 #472512,
    0 7px 0 #150C1D,
    0 14px 28px rgba(8, 4, 14, 0.92);
}

.game-logo-subtitle {
  margin: 0;
  font-size: clamp(14px, 1.15vw, 18px);
  font-weight: 800;
  color: #FFF3DA;
  max-width: 580px;
  line-height: 1.3;
  text-shadow: 0 2px 6px rgba(10, 6, 16, 0.96), 0 1px 2px #000000;
}

.preload-wrap {
  width: min(420px, 92%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0;
}

.preload-status-text {
  font-size: 13px;
  font-weight: 800;
  color: var(--fh-brass-bright);
  letter-spacing: 0.03em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.title-cta-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.4vh, 14px);
}

.title-play-btn {
  width: min(296px, 84%);
  min-width: 240px;
  min-height: 62px;
  height: 64px;
  padding: 4px 26px;
  font-size: clamp(21px, 1.65vw, 26px);
  letter-spacing: 0.06em;
  filter: drop-shadow(0 8px 18px rgba(8, 5, 14, 0.78));
}

.title-play-btn .btn-inline-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.title-continue-btn {
  width: min(276px, 80%);
  min-height: 46px;
  font-size: clamp(14px, 1.1vw, 16.5px);
}

.btn-inline-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 28px;
}

.title-nav-grid {
  width: min(560px, 96%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.title-nav-grid.seasons-unlocked {
  width: min(680px, 98%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.title-nav-btn {
  min-height: 48px;
  padding: 3px 10px;
  font-size: clamp(12.5px, 0.96vw, 15px);
  filter: drop-shadow(0 6px 12px rgba(8, 5, 14, 0.68));
}

.nav-btn-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: 0 0 26px;
}

.utility-pill-btn {
  min-height: 38px;
  height: 38px;
  padding: 2px 12px;
  font-size: 13px;
}

/* ==========================================================================
 * SCENE 2: FULL-BLEED SKYDECK ARENA & FLOATING CORNER HUD
 * ========================================================================== */

.screen-game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

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

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

.vfx-3d-overlay {
  z-index: 12;
}

.cutin-overlay-canvas {
  z-index: 60;
}

.ui-motion-overlay {
  z-index: 65;
}

.hud-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
}

/* TOP FLOATING HUD — ZERO solid full-width bar, NEVER wraps to 2 rows! */
.hud-top {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

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

.hud-top-left,
.hud-top-right {
  flex: 0 0 auto;
}

.hud-stat-val {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(13.5px, 1.05vw, 16.5px);
  color: #FFFFFF;
  -webkit-text-stroke: 1.6px #1C1B29;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #1C1B29;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.currency-crowns-btn {
  cursor: pointer;
}

.crowns-plus-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #14532D;
  border: 1.5px solid #FFFFFF;
  color: #FFFFFF;
  font-size: 12px;
  line-height: 1;
  margin-left: 2px;
}

/* Floating 5-Rival Scouting Bar (Center Top) */
.rival-scout-bar {
  flex: 0 1 auto;
  justify-content: center;
  gap: 6px;
  overflow: visible !important;
}

.rival-chip {
  padding: 0 6px 0 4px;
  min-height: 36px;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.rival-chip:hover {
  transform: translateY(2px) scale(1.04);
}

.rival-chip.is-next {
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.88), 0 4px 8px rgba(0, 0, 0, 0.72);
}

.rival-chip.is-eliminated {
  opacity: 0.48;
  filter: grayscale(0.85);
}

.rival-avatar-ring {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--fh-brass-bright);
  background: #1B1522;
  overflow: hidden;
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rival-avatar-ring img,
.rival-avatar-ring canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rival-chip-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.rival-chip-hearts {
  font-family: var(--font-display);
  font-size: 12.5px;
  color: #FFD166;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rival-chip-tribe {
  font-size: 11.8px;
  font-weight: 800;
  color: #E2D4C0;
  white-space: nowrap;
}

.rival-next-badge {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  padding: 0 5px;
  border-radius: 3px;
  background: #D63C44;
  border: 1px solid #FFF8E7;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 11.5px;
  line-height: 1.1;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
}

.rival-boss-badge {
  position: absolute;
  top: -10px;
  right: -4px;
  z-index: 10;
  padding: 0 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #DC2626 0%, #7F1D1D 100%);
  border: 1px solid #FDE047;
  color: #FEF08A;
  font-family: var(--font-display);
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

/* Top-Right Compact Controls */
.hud-ctrl-btn {
  min-height: 38px;
  max-height: 42px;
  padding: 1px 10px;
  font-size: clamp(12.5px, 0.92vw, 14px);
  overflow: visible !important;
}

.hud-ctrl-btn.has-badge {
  padding-right: 12px;
}

.hud-ctrl-btn .notify-badge {
  top: -6px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  font-size: 10px;
  line-height: 12px;
  border-width: 1.5px;
  pointer-events: none;
}

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

/* Round 5 Icon Button Rule: icons 55%-68% height inside square icon buttons! */
.hud-icon-sq {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hud-sq-img,
.sys-svg-icon {
  width: 64%;
  height: 64%;
  object-fit: contain;
  color: var(--fh-cream);
  filter: brightness(1.18) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}

.hud-quit-btn {
  min-height: 38px;
  max-height: 42px;
  padding: 1px 9px;
  font-size: clamp(12.5px, 0.92vw, 14px);
}

/* Subtle Floating Phase Banner */
.phase-banner {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 54;
  padding: 4px 18px;
  background: rgba(36, 23, 18, 0.92);
  border: 2px solid var(--fh-brass);
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

.phase-banner-text {
  font-family: var(--font-display);
  font-size: clamp(12px, 1vw, 15px);
  color: var(--fh-brass-bright);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Floating Treasure Hoard & Synergy Micro-Cluster (Bottom-Left above tray) */
.treasure-hoard-cluster {
  position: absolute;
  left: 12px;
  bottom: 176px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
  max-width: 250px;
}

.synergy-pills-row,
.treasure-sockets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  pointer-events: auto;
}

.synergy-chip {
  padding: 1px 7px;
  font-family: var(--font-display);
  font-size: 12.5px;
  color: #FFE8A3;
  cursor: pointer;
}

.treasure-socket {
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.treasure-socket canvas,
.treasure-socket img {
  width: 76%;
  height: 76%;
  object-fit: contain;
}

/* Floating Turn Order Strip (Right Edge during Clash) */
.turn-order-strip {
  position: absolute;
  right: 12px;
  top: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px;
  background: rgba(30, 20, 16, 0.84);
  border: 1.5px solid var(--fh-brass);
  border-radius: 8px;
  pointer-events: auto;
}

.turn-strip-hdr {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--fh-brass-bright);
  letter-spacing: 0.04em;
}

.turn-order-nodes {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.turn-node-pill {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(56, 38, 30, 0.92);
  border-left: 3px solid #60A5FA;
  color: #FFF8E7;
  max-width: 126px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-node-pill.is-enemy {
  border-left-color: #F87171;
}

/* ==========================================================================
 * FLOATING COMPACT BOTTOM DRAFT / COMMAND TRAY
 * Leaves >= 72% of viewport completely open for the Skyship Battle Deck!
 * ========================================================================== */

.draft-tray {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1260px, 98vw);
  display: grid;
  grid-template-columns: minmax(215px, 248px) minmax(0, 1fr) minmax(228px, 256px);
  align-items: end;
  gap: 10px;
  pointer-events: none;
}

.compass-module,
.shop-cards-stage,
.draft-actions-col {
  pointer-events: auto;
}

/* Left Wing: Sky-Helm Resonance & Brass Overdrive Compass */
.compass-module {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 6px;
}

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

.compass-captain-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #8A5428;
  background: #241712;
  object-fit: cover;
  flex: 0 0 38px;
}

.compass-info {
  flex: 1;
  min-width: 0;
}

.compass-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 3px;
  min-width: 0;
}

.compass-captain-name {
  font-family: var(--font-display);
  font-size: clamp(11px, 0.85vw, 12.8px);
  color: var(--fh-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.compass-ult-tag {
  flex: 0 1 auto;
  color: #FDE047;
  font-family: var(--font-display);
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px #000000, 0 0 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.compass-bar-track {
  position: relative;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #161426 0%, #261C34 100%);
  border: 2px solid #9A6B3A;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.78);
  overflow: hidden;
}

.compass-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0EA5E9 0%, #F59E0B 55%, #FDE047 100%);
  border-radius: 999px;
  transition: width 0.24s ease-out;
}

.compass-bar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 6px 0 4px;
  pointer-events: none;
  z-index: 2;
}

.compass-bar-left {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.compass-bar-ico {
  width: 12px;
  height: 12px;
  object-fit: contain;
  flex: 0 0 12px;
  pointer-events: none;
}

.compass-pct-label {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 10.5px;
  color: #FFFFFF;
  text-shadow: 0 1px 2px #000000, 0 0 4px rgba(0, 0, 0, 0.92);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compass-charge-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  color: #4A2C16;
  line-height: 1.15;
  white-space: nowrap;
  overflow: visible;
}

.compass-charge-hint .ch-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.compass-charge-hint .ch-ico {
  width: 12px;
  height: 12px;
  object-fit: contain;
  flex: 0 0 12px;
}

.compass-charge-hint .ch-sep {
  opacity: 0.6;
}

@keyframes ultDeniedShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

.btn-ult-compass.ult-denied-shake {
  animation: ultDeniedShake 0.28s ease-out;
}

.btn-ult-compass {
  position: relative;
  width: 100%;
  min-height: 38px;
  max-height: 44px;
  border-width: 8px 9px 9px 9px;
  padding: 2px 5px;
  font-size: clamp(11.6px, 0.86vw, 13px);
}

.btn-ult-compass.is-charging {
  opacity: 0.95;
  background-image: linear-gradient(90deg, rgba(245, 158, 11, 0.34) var(--charge-pct, 0%), rgba(24, 18, 14, 0.12) var(--charge-pct, 0%));
}

.btn-ult-compass.is-ready {
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_primary.png') 77 82 76 86 fill / 10px 12px 10px 12px / 0 stretch;
  color: #FFFFFF;
  filter: drop-shadow(0 0 12px rgba(255, 209, 102, 0.85));
}

.btn-ult-compass.is-armed {
  filter: drop-shadow(0 0 14px rgba(74, 222, 128, 0.92));
}

.btn-mini-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 18px;
}

/* Center: 3-Card Skyport Draft Shop (Round 5 Card Art Window: 44%-50% height & >=85% inner width!) */
.shop-cards-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.draft-mode-ribbon {
  margin-bottom: 4px;
  padding: 2px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #9E2A2B, #E09F3E, #9E2A2B);
  border: 1.5px solid #FFF8E7;
  color: #FFF8E7;
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}

.shop-cards-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  overflow: visible !important;
}

.shop-draft-card {
  height: 154px;
  padding: 3px 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  cursor: pointer;
  overflow: visible !important;
}

.shop-draft-card:hover:not(.is-bought) {
  transform: translateY(-8px) scale(1.04);
  z-index: 15;
}

.shop-draft-card.is-bought {
  opacity: 0.36;
  pointer-events: none;
  filter: grayscale(0.7);
}

.shop-draft-card.is-locked-card::after {
  content: attr(data-locked-label);
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 0 6px;
  border-radius: 3px;
  background: #1D4ED8;
  border: 1px solid #DBEAFE;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 9px;
}

/* Pop-out Cost & Hotkey Badges (z-index >= 8, overflow: visible!) */
.card-cost-badge {
  position: absolute;
  top: -14px;
  left: -12px;
  z-index: 9;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE082 0%, #C98A18 78%);
  border: 2px solid #2A1910;
  color: #1D141F;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.card-merge-tag {
  position: absolute;
  top: -14px;
  left: 18px;
  z-index: 9;
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FEF08A, #F59E0B);
  border: 1.5px solid #2A1910;
  color: #1D141F;
  font-family: var(--font-display);
  font-size: 9.5px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.card-hdr-name {
  width: 100%;
  font-family: var(--font-display);
  font-size: clamp(12px, 0.92vw, 13.5px);
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.shop-draft-card:not(.rarity-legendary) .card-hdr-name {
  color: #FFF8E7;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92);
}

.shop-draft-card.rarity-legendary .card-hdr-name {
  color: #1D141F;
  text-shadow: 0 1px 0 rgba(255, 250, 230, 0.65);
}

/* Round 5 Mandatory Card Illustration Window: 46% height (44-50%) & 90% inner width (>=85%)! */
.card-illus-box {
  width: 90%;
  height: 47%;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 42%, rgba(255, 236, 179, 0.28) 0%, rgba(22, 16, 24, 0.78) 100%);
  border: 1.5px solid rgba(214, 168, 93, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 47%;
}

.card-illus-box canvas,
.card-illus-box img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.card-bottom-meta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 2px;
}

.card-role-pill {
  flex: 1;
  min-width: 0;
  font-size: 11.6px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.shop-draft-card:not(.rarity-legendary) .card-role-pill {
  color: #FDE68A;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.shop-draft-card.rarity-legendary .card-role-pill {
  color: #2A160B;
}

.card-stats-pill {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(24, 16, 22, 0.88);
  border: 1px solid var(--fh-brass);
  color: #FFF8E7;
  font-family: var(--font-display);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Right Wing: Compact Draft Action Stack (Round 5: height <= 108px, align-content: start!) */
.draft-actions-col {
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: 106px;
}

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

.draft-action-btn {
  height: 42px;
  max-height: 44px;
  border-width: 8px 9px 9px 9px;
  padding: 0 3px;
  font-size: clamp(11.8px, 0.88vw, 13px);
  gap: 4px;
}

.draft-action-btn .btn-mini-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.draft-action-btn.is-active-lock {
  filter: brightness(1.15) drop-shadow(0 0 10px rgba(96, 165, 250, 0.85));
}

.free-reroll-tag {
  position: absolute;
  top: -18px;
  left: 2px;
  bottom: auto;
  transform: none;
  z-index: 10;
  padding: 1px 4px;
  border-radius: 4px;
  background: #16A34A;
  border: 1px solid #DCFCE7;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

.free-reroll-tag.is-paid {
  background: #B45309;
  border-color: #FEF3C7;
}

.clash-cta-btn {
  width: 100%;
  height: 52px;
  max-height: 56px;
  padding: 2px 10px;
  font-size: clamp(14px, 1.15vw, 18px);
  letter-spacing: 0.05em;
}

/* Floating Non-Blocking Hover Inspector */
.floating-inspector {
  position: fixed;
  z-index: 55;
  width: min(290px, 32vw);
  padding: 6px 10px;
  pointer-events: none;
}

.insp-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  color: var(--fh-ink);
  margin-bottom: 2px;
}

.insp-tags {
  font-size: 11px;
  font-weight: 800;
  color: #6E3B16;
  margin-bottom: 4px;
}

.insp-desc {
  font-size: 12px;
  font-weight: 700;
  color: #261812;
  line-height: 1.32;
}

/* ==========================================================================
 * MODALS, SHOP, CAPTAINS, SKY-PASS, SETTINGS & EXIT
 * ========================================================================== */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal-root.hidden,
.modal-root.is-closing,
.modal-root.is-closing * {
  pointer-events: none !important;
}

.modal-root.is-closing .modal-backdrop,
.modal-root.is-closing .dlg-backdrop {
  opacity: 0;
  transition: opacity 0.16s ease;
}

/* Modal Backdrop Hit-Test & Accessibility Shield:
 * When any modal dialog is active, keep the full-bleed skydeck canvas visible behind
 * the dimmed veil while cleanly shielding background HUD/Title/Tutorial controls from
 * pointer hit-tests, Tab focus, and accidental overlay occlusion (VPS #3220). */
body.modal-open #hud-layer,
body.modal-open #tutorial-root,
body.modal-open #screen-title .title-corner-utils,
body.modal-open #screen-title .title-cta-group {
  visibility: hidden !important;
  pointer-events: none !important;
}

.modal-card,
.dlg-sheet {
  width: min(1040px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 12px;
  overflow: hidden;
  will-change: transform, opacity;
  contain: layout paint;
}

.modal-header,
.dlg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid rgba(214, 168, 93, 0.35);
}

.modal-title,
.dlg-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.5vw, 25px);
  color: #FFF8E7;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

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

.modal-body,
.dlg-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--fh-brass) rgba(20, 14, 22, 0.7);
}

.modal-footer,
.dlg-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
  border-top: 1.5px solid rgba(214, 168, 93, 0.3);
}

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

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

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

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

/* Captain Draft & Roster Cards */
.captain-pick-card {
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
}

.captain-card-art {
  width: 88%;
  height: 112px;
  border-radius: 8px;
  background: radial-gradient(circle, rgba(255, 220, 130, 0.25), rgba(20, 14, 24, 0.85));
  border: 1.5px solid var(--fh-brass);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.captain-card-art img,
.captain-card-art canvas {
  max-width: 90%;
  max-height: 92%;
  object-fit: contain;
}

/* Shop IAP Pack Cards */
.iap-pack-card {
  padding: 8px 8px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  text-align: center;
  contain: layout style;
}

.iap-badge-ribbon {
  position: absolute;
  top: -12px;
  right: -6px;
  z-index: 9;
  padding: 2px 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #FDE047, #D97706);
  border: 1.5px solid #1D141F;
  color: #1D141F;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.iap-art-box {
  width: 88%;
  height: 94px;
  margin: 0 auto;
  border-radius: 6px;
  background: radial-gradient(circle, rgba(255, 224, 140, 0.25), rgba(18, 12, 22, 0.82));
  border: 1.5px solid rgba(214, 168, 93, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.iap-art-box img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
}

.iap-pack-title {
  font-family: var(--font-display);
  font-size: clamp(12px, 0.95vw, 14.5px);
  line-height: 1.15;
}

.iap-pack-desc {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.28;
  opacity: 0.95;
}

.iap-pack-card.rarity-legendary .iap-pack-title,
.iap-pack-card.rarity-legendary .iap-pack-desc {
  color: #1D141F;
}

/* Settings Rows */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: rgba(24, 16, 26, 0.58);
  border: 1px solid rgba(214, 168, 93, 0.32);
  border-radius: 6px;
  margin-bottom: 8px;
}

.settings-label {
  font-family: var(--font-display);
  font-size: 14px;
  color: #FFF8E7;
}

.settings-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-slider {
  width: 140px;
  accent-color: #F2B029;
  cursor: pointer;
}

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

/* Tutorial Spotlight + Animated Pointer Hand + 3-Icon Feature Guide Strip */
.tutorial-root {
  position: fixed;
  inset: 0;
  z-index: 85;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
}

@keyframes fhSpotPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.92), 0 0 18px rgba(255, 209, 102, 0.72);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 236, 153, 0.98), 0 0 28px rgba(255, 209, 102, 0.95);
    transform: scale(1.02);
  }
}

@keyframes fhHandTap {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6px, -8px) scale(0.94); }
}

.tut-spotlight {
  position: fixed;
  border: 3px solid #FFE082;
  border-radius: 14px;
  background: rgba(255, 209, 102, 0.08);
  pointer-events: none;
  animation: fhSpotPulse 1.35s ease-in-out infinite;
  transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.tut-hand {
  position: fixed;
  width: 52px;
  height: 52px;
  z-index: 88;
  pointer-events: none;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.85));
  animation: fhHandTap 0.95s ease-in-out infinite;
}

.tut-coach-pill {
  position: fixed;
  z-index: 89;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  pointer-events: auto;
  max-width: 420px;
}

.tut-coach-lbl {
  font-family: var(--font-display);
  font-size: 14.5px;
  color: #1D141F;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tut-skip-btn {
  position: fixed;
  top: 62px;
  right: 14px;
  pointer-events: auto;
  min-height: 36px;
  padding: 2px 12px;
  font-size: 12.5px;
}

.toast-stack {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  pointer-events: none;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 13px;
}

/* Preview-Only [DEV F2] Debug Panel */
.debug-root {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 130;
  pointer-events: none;
}

.dev-f2-pill {
  pointer-events: auto;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid #38BDF8;
  color: #38BDF8;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
}

.debug-panel-box {
  pointer-events: auto;
  margin-bottom: 6px;
  width: 280px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #38BDF8;
  color: #F8FAFC;
  font-family: var(--font-body);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.debug-mini-btn {
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #475569;
  background: #1E293B;
  color: #E2E8F0;
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 700;
}

.debug-mini-btn:hover {
  background: #334155;
  border-color: #38BDF8;
}

/* ==========================================================================
 * COMPACT <=1460px & 1280x720 RULES (Guarantees ZERO 2-Row HUD Wrap!)
 * ========================================================================== */

@media (max-width: 1460px) {
  .hud-top {
    top: 6px;
    left: 6px;
    right: 6px;
    gap: 4px;
  }

  .hud-cluster {
    gap: 3px;
  }

  .hud-pill {
    border-width: 6px 9px 7px 9px;
    padding: 0 3px 0 2px;
    min-height: 31px;
    gap: 3px;
  }

  .rival-scout-bar {
    gap: 3px;
  }

  .rival-chip {
    border-width: 5px 6px 6px 6px;
    padding: 0 2px;
    min-height: 30px;
    gap: 2px;
  }

  .uiv-icon-pop {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    margin: -5px 0 -5px -6px;
  }

  .hud-stat-val {
    font-size: 12px;
  }

  .rival-avatar-ring {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
  }

  .rival-chip-hearts {
    font-size: 11px;
  }

  .rival-chip-tribe {
    display: none;
  }

  .hud-hide-compact {
    display: none !important;
  }

  .hud-ctrl-btn,
  .hud-quit-btn {
    border-width: 7px 8px 8px 8px;
    min-height: 32px;
    padding: 0 5px;
    font-size: 11.5px;
  }

  .hud-icon-sq {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .draft-tray {
    bottom: 5px;
    width: min(1210px, 98.5vw);
    grid-template-columns: 222px minmax(0, 1fr) 214px;
    gap: 7px;
  }

  .btn-ult-compass .btn-mini-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
  }

  .shop-draft-card {
    height: 138px;
    border-width: 9px 9px 9px 9px;
  }

  .draft-actions-col {
    max-height: 96px;
    gap: 5px;
  }

  .draft-action-btn {
    height: 38px;
    font-size: 11.8px;
  }

  .draft-action-btn .btn-mini-icon {
    display: none;
  }

  .clash-cta-btn {
    height: 46px;
    font-size: 14px;
  }

  .treasure-hoard-cluster {
    bottom: 152px;
    left: 8px;
  }
}

@media (max-width: 900px) {
  .title-stage-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .title-hero-portrait-wrap {
    height: 28vh;
  }

  .draft-tray {
    grid-template-columns: 150px minmax(0, 1fr) 144px;
  }
}

/* ==========================================================================
 * SEASONS 1-3 ORNATE STORYBOOK RPG MODAL, FOILS & SYNERGY HIGHLIGHT
 * ========================================================================== */

.seasons-tabs-row .modal-tab-btn {
  padding: 5px 11px;
  font-size: clamp(11px, 0.88vw, 13px);
}

.season-section-box {
  padding: 8px 12px;
  margin-bottom: 8px;
}

.season-sec-hdr {
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--fh-ink);
  margin-bottom: 4px;
}

.season-sec-label {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--fh-brass-bright);
  letter-spacing: 0.04em;
  margin: 4px 0 6px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
 * ROUND 7-9 VISUAL-FIRST 60/25/15 CARDS, FEATURE GUIDES & SETTINGS SWITCHES
 * ========================================================================== */

.dlg-tab-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dlg-tab-strip .modal-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: clamp(12px, 0.92vw, 13.5px);
}

.tab-mini-ico {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 20px;
}

.season-hero-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px;
  margin-bottom: 8px;
}

.season-hero-art {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 54px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55));
}

.season-hero-info {
  flex: 1;
  min-width: 0;
}

.season-hero-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: #1D141F;
  line-height: 1.15;
}

.uiv-meter-shell {
  background-color: #28211C;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 5px 12px 5px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/bar_track.png') 55 235 54 170 fill / 5px 12px 5px 12px / 0 stretch;
  position: relative;
  height: 18px;
  overflow: hidden;
  margin-top: 4px;
}

.uiv-meter-fill {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 4px 8px 4px 10px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/bar_fill_primary.png') 44 86 44 136 fill / 4px 8px 4px 10px / 0 stretch;
  height: 100%;
  min-width: 12px;
}

/* Visual-First 60/25/15 Portrait Card (>=55% Art, <=3-word Title, Chip + CTA) */
.vf-card-portrait,
.vf-medal-tile {
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 11px 11px 11px 11px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_common.png') 129 113 104 112 fill / 11px 11px 11px 11px / 0 stretch;
  box-shadow: 0 6px 12px rgba(10, 6, 12, 0.62);
  color: #FFF8E7;
  position: relative;
  overflow: visible !important;
  min-width: 0;
  padding: 6px 6px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  gap: 5px;
}

.vf-card-portrait.rarity-rare,
.vf-medal-tile.rarity-rare {
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_rare.png') 135 116 126 112 fill / 11px 11px 11px 11px / 0 stretch;
}

.vf-card-portrait.rarity-epic,
.vf-medal-tile.rarity-epic {
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_epic.png') 132 114 107 116 fill / 11px 11px 11px 11px / 0 stretch;
}

.vf-card-portrait.rarity-legendary,
.vf-medal-tile.rarity-legendary {
  background-color: #E58F0B;
  background-clip: padding-box;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_legendary.png') 131 117 114 115 fill / 11px 11px 11px 11px / 0 stretch;
  color: #181822;
}

.vf-medal-tile.is-locked-medal {
  opacity: 0.78;
}

.vf-medal-tile.is-locked-medal .vf-art-stage img {
  filter: grayscale(0.75) brightness(0.88);
}

.vf-art-stage {
  width: 92%;
  height: 82px;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 42%, rgba(255, 232, 168, 0.30) 0%, rgba(18, 12, 24, 0.82) 100%);
  border: 1.5px solid rgba(214, 168, 93, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.vf-art-stage.tall-art {
  height: 98px;
}

.vf-art-stage img,
.vf-art-stage canvas {
  width: 82%;
  height: 86%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

.vf-card-name {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.14;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vf-stat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(20, 14, 24, 0.84);
  border: 1px solid rgba(214, 168, 93, 0.72);
  color: #FFE8A3;
  font-family: var(--font-display);
  font-size: 12px;
  white-space: nowrap;
  max-width: 100%;
}

.vf-stat-chip.vf-pass-reward-chip {
  border-radius: 8px;
  white-space: normal;
  text-align: center;
  line-height: 1.18;
  font-size: 11.2px;
  padding: 3px 6px;
  width: 100%;
  min-height: 28px;
}

.vf-card-cta {
  width: 100%;
  min-height: 36px;
  padding: 2px 8px;
  font-size: 12px;
}

/* Balanced Shop Layout: 2 Featured Top + 2x4 Packs (ZERO orphan rows!) */
.shop-featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

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

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

.shop-bazaar-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* Clash Result Feedback Banner (VPS #3624: top 40% leaves generous room above for 3 victory stars!) */
.clash-result-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 48;
  pointer-events: none;
  animation: crbPopIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes crbPopIn {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.84); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.crb-card {
  min-width: 280px;
  padding: 10px 26px;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
}

.clash-result-banner.is-victory .crb-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 30px);
  color: #FDE047;
  text-shadow: 0 2px 0 #422006, 0 4px 10px rgba(0, 0, 0, 0.75);
  letter-spacing: 0.04em;
}

.clash-result-banner.is-defeat .crb-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 30px);
  color: #FB7185;
  text-shadow: 0 2px 0 #450A0A, 0 4px 10px rgba(0, 0, 0, 0.75);
  letter-spacing: 0.04em;
}

.crb-sub {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 15px;
  color: #2C1A12;
}

.crb-chips {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.crb-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(34, 22, 16, 0.9);
  border: 1.5px solid #D6A85D;
  font-family: var(--font-display);
  font-size: 13px;
  color: #FFF8E7;
}

.crb-chip.is-gold { color: #FDE047; }
.crb-chip.is-xp { color: #93C5FD; border-color: #60A5FA; }

.crb-ico {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

/* Captain Hearts Damage Impact Animation */
@keyframes heartsHitPulse {
  0% { transform: scale(1); filter: brightness(1); }
  22% { transform: scale(1.24) translateX(-4px); filter: brightness(1.5) drop-shadow(0 0 10px #EF4444); }
  48% { transform: scale(1.18) translateX(4px); filter: brightness(1.35) drop-shadow(0 0 8px #EF4444); }
  72% { transform: scale(0.95) translateX(-2px); }
  100% { transform: scale(1); filter: brightness(1); }
}

.hearts-pill.hearts-hit-anim {
  animation: heartsHitPulse 0.52s ease-out;
}

/* Full-Deck Replace Economy Tag on Shop Cards */
.card-replace-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  padding: 1px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #F59E0B 0%, #B45309 100%);
  border: 1.5px solid #FFF8E7;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* PC FPS Counter Pill & Settings VFX Quality Controls */
.hud-fps-pill {
  position: fixed;
  top: 52px;
  left: 12px;
  z-index: 120;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(20, 14, 12, 0.84);
  border: 1.5px solid #D6A85D;
  color: #86EFAC;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
}

.settings-perf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: 8px;
  margin-bottom: 8px;
}

.vfx-quality-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vfx-q-btn {
  min-height: 30px !important;
  padding: 1px 8px !important;
  font-size: 11px !important;
}

.shop-featured-grid > *,
.shop-packs-grid > * {
  min-width: 0;
  max-width: 100%;
}

.iap-pack-card.is-featured-horizontal {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 8px 10px;
}

.iap-pack-card.is-featured-horizontal .iap-art-box {
  width: 96px;
  height: 86px;
  flex: 0 0 96px;
  margin: 0;
}

.iap-pack-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Pillar 3: 3-Icon Visual Strip Feature Guide (`js/feature_guides.js`) */
.fg-tabs-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.fg-visual-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 6px;
}

.fg-step-box {
  flex: 1;
  max-width: 240px;
  min-height: 176px;
  padding: 12px 10px;
}

.fg-step-num {
  position: absolute;
  top: -12px;
  left: -10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE082, #C98A18);
  border: 2px solid #1D141F;
  color: #1D141F;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 24px;
  text-align: center;
}

.fg-step-img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  margin: 8px auto;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.65));
}

.fg-step-lbl {
  font-family: var(--font-display);
  font-size: 15px;
  color: #FFF8E7;
  line-height: 1.2;
}

.fg-arrow {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--fh-brass-bright);
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.85);
  flex: 0 0 auto;
}

/* Pillar 6: Tactile Settings Sliders + Brass Toggle Switches + 3-Star Victory */
.settings-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(24, 16, 26, 0.64);
  border: 1.5px solid rgba(214, 168, 93, 0.36);
  border-radius: 8px;
  margin-bottom: 8px;
}

.settings-lbl-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.toggle-switch-pill {
  position: relative;
  width: 66px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid #8A5B36;
  background: #2C222E;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.toggle-switch-pill.is-on {
  background: #216E2A;
  border-color: #FFD166;
}

.toggle-knob {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFF8E7, #D6A85D);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  transform: translateX(0);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.toggle-switch-pill.is-on .toggle-knob {
  transform: translateX(34px);
}

.victory-stars-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 6px;
}

.victory-star-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(255, 209, 102, 0.85));
}

.victory-star-img.center-star {
  width: 66px;
  height: 66px;
  transform: translateY(-6px);
}

/* VPS #3450: Clear Victory vs Defeat visual distinction in Voyage Summary */
.dlg-sheet.is-summary-defeat .dlg-title {
  color: #FCA5A5;
  text-shadow: 0 2px 0 #450A0A, 0 4px 10px rgba(0, 0, 0, 0.85);
}

.dlg-sheet.is-summary-victory .dlg-title {
  color: #FDE047;
  text-shadow: 0 2px 0 #422006, 0 4px 10px rgba(0, 0, 0, 0.85);
}

.summary-outcome-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.summary-outcome-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.05em;
  border: 1.5px solid #FFF8E7;
}

.summary-outcome-pill.is-win {
  background: linear-gradient(180deg, #F59E0B, #B45309);
  color: #FFF8E7;
}

.summary-outcome-pill.is-loss {
  background: linear-gradient(180deg, #DC2626, #7F1D1D);
  color: #FFF8E7;
}

.summary-outcome-sub {
  font-family: var(--font-display);
  font-size: 13px;
  color: #F2D8A7;
}

.victory-star-img.defeat-emblem {
  filter: hue-rotate(-14deg) saturate(1.2) drop-shadow(0 4px 12px rgba(220, 38, 38, 0.82));
}

.season-subfilter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.season-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.synergy-chip.is-highlighted {
  outline: 2px solid #FFF08A;
  filter: brightness(1.18);
}

.shop-draft-card.is-synergy-match {
  outline: 2.5px solid #2DD4BF;
  outline-offset: 1px;
}

.shop-draft-card.foil-sunlit-gold .card-illus-box {
  border-color: #FFD166;
  background: radial-gradient(circle at 50% 38%, rgba(255, 224, 102, 0.45) 0%, rgba(36, 22, 12, 0.82) 100%);
}

.shop-draft-card.foil-prism-gale .card-illus-box {
  border-color: #2DD4BF;
  background: radial-gradient(circle at 48% 38%, rgba(45, 212, 191, 0.42) 0%, rgba(20, 28, 38, 0.84) 100%);
}

.shop-draft-card.foil-astral-etched .card-illus-box {
  border-color: #C084FC;
  background: radial-gradient(circle at 50% 38%, rgba(192, 132, 252, 0.44) 0%, rgba(22, 16, 36, 0.86) 100%);
}
