/* Crowdcrest: Era Blitz — UI Vault vibrant_popout_tycoon + 16:9 Commercial Toy-3D Layout */
/* Offline MSIX: ZERO external Google Fonts @import; crisp rounded system font stacks only */

:root {
  --font-display: 'Segoe UI Black', 'Trebuchet MS', 'Arial Rounded MT Bold', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Segoe UI', 'Trebuchet MS', system-ui, -apple-system, sans-serif;
  --ink: #181C2E;
  --sky-cyan: #76D6F5;
  --sky-mid: #4EB9E9;
  --sky-pale: #B1E5F4;
  --sand-warm: #CFA99D;
  --cream-white: #FEFEFD;
  --berry-accent: #A86C7E;
  --lime-cta: #6CE21C;
  --gold-accent: #FFD52E;
  --coral-danger: #FF4B5C;
  --violet-sec: #9B4DFF;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #3B93CA;
  font-family: var(--font-body);
  color: var(--ink);
  user-select: none;
}

button:focus {
  outline: none;
}

.is-hidden {
  display: none !important;
}

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

.screen.screen-active {
  display: block;
}

/* ============================================================================
   HEROIC NO-BOX TITLE SCREEN
   ============================================================================ */
#title-screen {
  background: linear-gradient(180deg, #4EB9E9 0%, #76D6F5 46%, #E9F6FC 100%);
}

.title-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  pointer-events: none;
}

#title-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 34%, rgba(255, 255, 255, 0.08) 0%, rgba(16, 36, 68, 0.34) 100%);
  pointer-events: none;
  z-index: 1;
}

.title-top-bar {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.title-util-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-width: 60px;
  padding: 0 10px;
  border-width: 9px 13px 9px 13px;
  border-image-width: 9px 13px 9px 13px;
  box-shadow: none;
  font-size: 13.5px;
  font-weight: 800;
  color: #FFFFFF;
  overflow: visible !important;
  position: relative;
}

.title-util-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 44px;
  padding: 0;
  border-width: 9px 10px 9px 10px;
  border-image-width: 9px 10px 9px 10px;
  box-shadow: none;
  overflow: visible !important;
  position: relative;
}

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

/* Transparent, borderless container — guarantees ZERO boxed-login-card title */
.title-hero-stack {
  position: relative;
  z-index: 4;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 36px 28px;
  background: transparent;
  border: none;
}

.title-emblem {
  font-family: var(--font-display);
  font-size: clamp(46px, 5.2vw, 76px);
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.05;
  text-align: center;
  color: #FFFFFF;
  -webkit-text-stroke: 3px #181C2E;
  paint-order: stroke fill;
  text-shadow: 0 6px 0 #181C2E, 0 12px 24px rgba(18, 28, 56, 0.42);
  margin-bottom: 8px;
}

.title-tagline {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 800;
  color: #FFFDF5;
  text-align: center;
  -webkit-text-stroke: 1.5px #181C2E;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #181C2E;
  margin-bottom: 24px;
}

.title-showcase-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(20px, 4vw, 64px);
  width: 100%;
  max-width: 1120px;
}

.title-portrait-wrap {
  position: relative;
  width: clamp(190px, 21vw, 290px);
  height: clamp(210px, 24vw, 310px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.title-portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(18, 28, 56, 0.36));
}

.title-portrait-secondary {
  width: clamp(175px, 19vw, 265px);
  height: clamp(195px, 22vw, 285px);
}

.title-cta-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 260px;
  padding-bottom: 28px;
}

.boot-loader-wrap {
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.boot-bar-track {
  width: 100%;
  height: 36px;
  padding: 2px;
  display: flex;
  align-items: center;
}

.boot-bar-fill {
  height: 100%;
  min-width: 28px;
  transition: width 140ms ease-out;
}

.boot-pct-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
  -webkit-text-stroke: 1.5px #181C2E;
  paint-order: stroke fill;
  font-variant-numeric: tabular-nums;
}

.title-play-cta {
  min-width: 240px;
  height: 76px;
  padding: 0 36px;
  border-width: 14px 16px 20px 16px;
  border-image-width: 14px 16px 20px 16px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: #181C2E;
  letter-spacing: 1px;
  filter: drop-shadow(0 8px 12px rgba(18, 28, 56, 0.35));
  overflow: visible !important;
  position: relative;
}

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

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

#vfx3d-canvas {
  z-index: 10;
}

#cutin-canvas {
  z-index: 95;
}

/* ============================================================================
   FLOATING CORNER HUD — TOP BAR (NOWRAP AT 1080p & 720p)
   ============================================================================ */
.hud-top {
  position: fixed;
  top: 8px;
  left: 12px;
  right: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  pointer-events: none;
}

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

.hud-currency-pill,
.hud-army-pill {
  height: 44px;
  padding: 0 12px 0 8px;
  min-width: 86px;
  border-width: 10px 14px 10px 14px;
  border-image-width: 10px 14px 10px 14px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
  flex-shrink: 0;
}

.hud-currency-pill > .uiv-icon-pop,
.hud-army-pill > .uiv-icon-pop {
  width: 34px;
  height: 34px;
  margin: -6px 2px -6px -8px;
}

.hud-num {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 2px 0 #10182B;
}

.hud-stage-pill {
  height: 50px;
  min-width: 196px;
  max-width: 270px;
  border-width: 8px 13px 8px 13px;
  border-image-width: 8px 13px 8px 13px;
  box-shadow: none;
  padding: 2px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  cursor: default;
  flex-shrink: 1;
  min-width: 0;
}

.stage-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.1;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #0D1528;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.stage-era-label,
.stage-phase-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.stage-phase-label {
  color: #FFD52E;
  text-shadow: 0 2px 0 #0D1528;
}

.stage-bar-track {
  width: 100%;
  height: 14px;
  border-width: 3px 5px 3px 5px;
  border-image-width: 3px 5px 3px 5px;
  box-shadow: none;
  padding: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
}

.stage-bar-fill {
  height: 100%;
  border-width: 3px 4px 3px 4px;
  border-image-width: 3px 4px 3px 4px;
  box-shadow: none;
  min-width: 8px;
  transition: width 90ms linear;
}

.hud-pill-btn,
.hud-action-btn,
.hud-icon-btn {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
  overflow: visible !important;
  flex-shrink: 0;
  box-shadow: none;
  font-family: var(--font-display);
  font-size: clamp(12px, 0.92vw, 13.5px);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.hud-speed-btn {
  min-width: 46px;
  padding: 0 6px;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #181C2E;
  border-width: 8px 9px 11px 9px;
  border-image-width: 8px 9px 11px 9px;
}

.hud-action-btn {
  padding: 0 11px;
  border-width: 8px 10px 11px 10px;
  border-image-width: 8px 10px 11px 10px;
}

.uiv-vibrant_popout_tycoon-btn-secondary .btn-label {
  color: #FFFFFF;
  text-shadow: 0 2px 0 #181C2E;
}

.hud-action-btn img {
  width: 21px;
  height: 21px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
}

.hud-action-btn .btn-label {
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
  flex-shrink: 0;
}

.hud-icon-btn {
  width: 44px;
  padding: 0;
  border-width: 8px 9px 8px 9px;
  border-image-width: 8px 9px 8px 9px;
  color: #FFFFFF;
}

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

.pause-glyph {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #0D1528;
}

/* Inline notify badge — NEVER overlaps button text or pushes scrollWidth > clientWidth (#3756) */
.notify-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 17px;
  width: 17px;
  height: 17px;
  margin-left: 2px;
  padding: 0;
  border-radius: 999px;
  background: #FF4B5C;
  border: 2px solid #FFFFFF;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

/* ============================================================================
   MYSTERY SKILL REEL BANNER (NON-BLOCKING)
   ============================================================================ */
.reel-banner {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px 14px;
  border-width: 10px 14px 13px 14px;
  border-image-width: 10px 14px 13px 14px;
  box-shadow: none;
}

.reel-banner img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.reel-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.reel-kicker {
  font-size: 13px;
  font-weight: 900;
  color: #7A3400;
}

.reel-name {
  font-size: 16px;
  font-weight: 900;
  color: #181C2E;
  white-space: nowrap;
}

/* ============================================================================
   FLOATING BOTTOM HUD — COMPACT ROUND 5 BUTTONS (74-80px, BIG ICONS)
   ============================================================================ */
.hud-bottom {
  position: fixed;
  bottom: 10px;
  left: 14px;
  right: 14px;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.hud-bottom-left {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
  flex-wrap: nowrap;
}

.hud-objective-pill {
  height: 42px;
  padding: 0 12px;
  border-width: 9px 13px 9px 13px;
  border-image-width: 9px 13px 9px 13px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #0D1528;
  cursor: default;
}

.hud-surge-btn {
  height: 44px;
  padding: 0 12px;
  border-width: 8px 10px 11px 10px;
  border-image-width: 8px 10px 11px 10px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
  overflow: visible !important;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  color: #181C2E;
  white-space: nowrap;
}

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

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

.hud-active-skills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.active-skill-chip {
  height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(24, 34, 62, 0.88);
  border: 2px solid #76D6F5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

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

.hud-bottom-right {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
  flex-wrap: nowrap;
}

/* Round 5 ratio: 76px height, 84px width, 46px icon (60.5% height, 33% area!) */
.skill-btn,
.quick-upg-btn {
  width: 82px;
  height: 76px;
  padding: 0;
  border-width: 8px 8px 12px 8px;
  border-image-width: 8px 8px 12px 8px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible !important;
  flex-shrink: 0;
}

.skill-btn img,
.quick-upg-btn img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  pointer-events: none;
  margin-top: -8px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.28));
}

.champ-btn.is-ready {
  filter: brightness(1.12) drop-shadow(0 0 8px rgba(108, 226, 28, 0.85));
}

.quick-upg-btn.is-affordable {
  filter: brightness(1.06) drop-shadow(0 0 6px rgba(255, 213, 46, 0.72));
}

.quick-upg-btn.is-locked {
  opacity: 0.72;
}

.skill-chip {
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 7px;
  border-radius: 999px;
  background: #181C2E;
  border: 2px solid #FFD52E;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.hotkey-badge {
  position: absolute;
  top: -8px;
  left: -6px;
  padding: 1px 6px;
  border-radius: 7px;
  background: #FFD52E;
  border: 2px solid #181C2E;
  color: #181C2E;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  pointer-events: none;
}

/* ============================================================================
   NON-BLOCKING VISUAL FTUE (TUT-SPOTLIGHT + TUT-HAND)
   ============================================================================ */
.ftue-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  pointer-events: none;
}

.tut-spotlight {
  position: absolute;
  left: 50%;
  top: 72%;
  width: 140px;
  height: 140px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 4px solid #FFD52E;
  box-shadow: 0 0 0 6px rgba(255, 213, 46, 0.28);
  animation: tutPulse 1.1s ease-in-out infinite;
  pointer-events: none;
}

.tut-hand {
  position: absolute;
  left: 50%;
  top: 76%;
  transform: translate(-50%, -50%);
  animation: tutBob 1.1s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.tut-pill {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translateX(-50%);
  padding: 2px 14px;
  border-width: 10px 14px 13px 14px;
  border-image-width: 10px 14px 13px 14px;
  box-shadow: none;
  font-size: 15px;
  font-weight: 900;
  color: #181C2E;
  white-space: nowrap;
  pointer-events: none;
}

.tut-skip-btn {
  position: absolute;
  top: 60px;
  right: 16px;
  height: 40px;
  padding: 0 12px;
  border-width: 8px 9px 11px 9px;
  border-image-width: 8px 9px 11px 9px;
  box-shadow: none;
  font-size: 13px;
  color: #FFFFFF;
  pointer-events: auto;
  overflow: visible !important;
}

@keyframes tutPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.9; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

@keyframes tutBob {
  0%, 100% { transform: translate(-24px, -10px); }
  50% { transform: translate(24px, -18px); }
}

/* ============================================================================
   UNIFIED FLEX-SCROLL MODALS (ANTI-SAAS 60/25/15, ZERO BACKDROP-FILTER BLUR)
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(14, 24, 48, 0.72);
  display: none;
  visibility: hidden;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

.modal-backdrop.is-open {
  display: flex;
  visibility: visible;
  pointer-events: auto;
}

/* Prevent background HUD controls from participating in hit-tests while modal dialog is open (#3755) */
body.modal-open #hud-top,
body.modal-open #hud-top .hud-cluster,
body.modal-open #hud-top button,
body.modal-open #hud-bottom,
body.modal-open #hud-bottom .hud-bottom-left,
body.modal-open #hud-bottom .hud-bottom-right,
body.modal-open #hud-bottom button {
  pointer-events: none !important;
}

.modal-card {
  display: flex;
  flex-direction: column;
  width: min(940px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border-width: 14px 14px 18px 14px;
  border-image-width: 14px 14px 18px 14px;
  box-shadow: none;
  padding: 8px 14px 12px;
  position: relative;
  z-index: 125;
  cursor: default;
  pointer-events: auto;
  isolation: isolate;
}

.modal-card.modal-card--compact {
  width: min(680px, calc(100vw - 36px));
}

/* Soft daylight toy-cream inner panel backing (eliminates #FFFDF5 whiteout glare #4303 while preserving 9-slice border) */
.modal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #E8EFF6 0%, #ECE6D8 100%);
  pointer-events: none;
}

.modal-header,
.modal-tabs,
.modal-body,
.modal-footer {
  position: relative;
  z-index: 2;
}

.modal-card button:not(.modal-close-x) {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 6px;
  padding: 2px 54px;
  min-height: 52px;
  overflow: visible;
}

.modal-ribbon {
  min-width: 210px;
  max-width: 100%;
  height: 48px;
  border-width: 11px 18px 11px 18px;
  border-image-width: 11px 18px 11px 18px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-size: clamp(15px, 1.35vw, 19px);
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #0B2D6E;
  cursor: default;
  overflow: visible;
  white-space: nowrap;
}

#modal-title-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}

.modal-card .modal-close-x,
.modal-close-x {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 130;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
  pointer-events: auto;
}

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

.modal-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 4px;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
}

.modal-tab-btn {
  height: 40px;
  min-width: 0;
  flex: 0 1 auto;
  padding: 0 14px;
  border-width: 8px 11px 9px 11px;
  border-image-width: 8px 11px 9px 11px;
  box-shadow: none;
  font-size: clamp(12px, 0.94vw, 14px);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

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

.modal-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 8px;
}

/* ANTI-SAAS 60/25/15 VISUAL-FIRST MODAL GRIDS */
.vf-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

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

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

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

.shop-card,
.upgrade-card,
.season-card,
.vf-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px 8px;
  border-width: 11px 11px 16px 11px;
  border-image-width: 11px 11px 16px 11px;
  box-shadow: none;
  min-height: 214px;
  position: relative;
  overflow: visible !important;
  cursor: default;
  text-align: center;
  isolation: isolate;
}

.shop-card::before,
.upgrade-card::before,
.season-card::before,
.vf-hero-card::before,
.vf-card-portrait::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ECEAE0 0%, #E1E9F4 100%);
  pointer-events: none;
}

.shop-card > *,
.upgrade-card > *,
.season-card > *,
.vf-hero-card > *,
.vf-card-portrait > * {
  position: relative;
  z-index: 2;
}

.shop-card > .vf-ribbon-tag,
.upgrade-card > .vf-ribbon-tag,
.season-card > .vf-ribbon-tag,
.vf-hero-card > .vf-ribbon-tag,
.vf-card-portrait > .vf-ribbon-tag,
.shop-card > .vf-card-badge,
.upgrade-card > .vf-card-badge,
.season-card > .vf-card-badge,
.vf-hero-card > .vf-card-badge,
.vf-card-portrait > .vf-card-badge {
  position: absolute;
  z-index: 6;
}

.vf-card-badge {
  position: absolute;
  top: -10px;
  right: 6px;
  z-index: 6;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FF4B5C;
  border: 2px solid #181C2E;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.vf-card-badge.badge-best {
  background: #FFD52E;
  color: #181C2E;
}

.vf-card-badge.badge-starter {
  background: #6CE21C;
  color: #181C2E;
}

.vf-card-art-wrap {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vf-card-art-wrap img {
  max-width: 92%;
  max-height: 114px;
  width: auto;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(18, 28, 56, 0.22));
}

.vf-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: #181C2E;
  line-height: 1.15;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.vf-card-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
  color: #2B3A67;
  line-height: 1.15;
}

.vf-chip-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.vf-card-cta {
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  padding: 2px 8px;
  border-width: 8px 10px 12px 10px;
  border-image-width: 8px 10px 12px 10px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: clamp(12px, 0.95vw, 14px);
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}

.vf-card-cta img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

/* VIP DAILY PERK STRIP & PASS CYCLE SELECTOR */
.vip-daily-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 12px;
  margin-bottom: 10px;
  border-width: 9px 13px 9px 13px;
  border-image-width: 9px 13px 9px 13px;
  box-shadow: none;
  max-width: 100%;
  overflow: hidden;
}

.vip-daily-info {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #0D1528;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sh-pass-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow: hidden;
}

/* ============================================================================
   SEASONS HUB (60/25/15 VISUAL CARDS, BANNER & NON-BLOCKING FEATURE GUIDE)
   ============================================================================ */
.sh-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 12px;
  margin-bottom: 8px;
  min-height: 50px;
  max-width: 100%;
  border-width: 9px 13px 9px 13px;
  border-image-width: 9px 13px 9px 13px;
  box-shadow: none;
  flex-wrap: wrap;
  overflow: hidden;
  box-sizing: border-box;
}

.sh-banner-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sh-banner-art {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.sh-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sh-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #0D1528;
  white-space: nowrap;
}

.sh-pill {
  font-size: 13px;
  font-weight: 800;
  color: #FFD52E;
  text-shadow: 0 2px 0 #0D1528;
  white-space: nowrap;
}

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

.sh-bal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(18, 28, 56, 0.52);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.sh-mini-btn {
  height: 38px;
  padding: 0 11px;
  border-width: 7px 9px 10px 9px;
  border-image-width: 7px 9px 10px 9px;
  box-shadow: none;
  font-family: var(--font-display);
  font-size: clamp(11.5px, 0.9vw, 13px);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sm-help-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #181C2E;
  background: #FFD52E;
  color: #181C2E;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible !important;
}

.vf-card-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px 8px;
  border-width: 11px 11px 16px 11px;
  border-image-width: 11px 11px 16px 11px;
  box-shadow: none;
  min-height: 214px;
  position: relative;
  overflow: visible !important;
  cursor: default;
  text-align: center;
  isolation: isolate;
}

.vf-ribbon-tag {
  position: absolute;
  top: 2px;
  right: 4px;
  z-index: 6;
  max-width: calc(100% - 8px);
  padding: 2px 7px;
  border-radius: 999px;
  background: #FF4B5C;
  border: 2px solid #181C2E;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vf-ribbon-tag.badge-best {
  background: #FFD52E;
  color: #181C2E;
}

.vf-ribbon-tag.badge-starter {
  background: #6CE21C;
  color: #181C2E;
}

.vf-art-wrap {
  width: 100%;
  height: 122px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vf-media {
  max-width: 92%;
  max-height: 116px;
  width: auto;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(18, 28, 56, 0.22));
}

.vf-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: #181C2E;
  line-height: 1.15;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

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

.cur-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(11.5px, 0.88vw, 13px);
  font-weight: 800;
  color: #2B3A67;
  line-height: 1.15;
  white-space: nowrap;
  max-width: 100%;
  min-width: 0;
}

.cur-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

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

.vf-buy-btn {
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  padding: 2px 10px;
  border-width: 8px 11px 12px 11px;
  border-image-width: 8px 11px 12px 11px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  font-size: clamp(12px, 0.94vw, 14px);
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}

.vf-btn-text {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
  padding: 0 2px;
}

.vf-buy-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.fg-banner {
  position: fixed;
  bottom: 98px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px;
  border-width: 9px 13px 9px 13px;
  border-image-width: 9px 13px 9px 13px;
  box-shadow: none;
  max-width: min(560px, 90vw);
  pointer-events: none;
}

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

.fg-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fg-banner-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: #FFD52E;
  text-shadow: 0 2px 0 #0D1528;
}

.fg-banner-step {
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #0D1528;
}

.fg-banner-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-width: 6px;
  font-size: 18px;
  font-weight: 900;
  color: #FFFFFF;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* SETTINGS & PAUSE CONTROLS */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.setting-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #F4F7FC;
  border: 2px solid #CBD8EC;
  min-width: 0;
}

.setting-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #181C2E;
  white-space: nowrap;
}

.setting-label img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

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

.setting-slider {
  width: 110px;
  accent-color: #2B9BFF;
  cursor: pointer;
}

.setting-toggle-btn {
  min-width: 66px;
  height: 38px;
  padding: 0 10px;
  border-width: 7px 8px 10px 8px;
  border-image-width: 7px 8px 10px 8px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.lang-btn {
  height: 42px;
  padding: 0 8px;
  border-width: 7px 8px 11px 8px;
  border-image-width: 7px 8px 11px 8px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gift-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.gift-input {
  flex: 1 1 auto;
  height: 42px;
  border-radius: 12px;
  border: 2px solid #181C2E;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #181C2E;
  background: #FFFFFF;
}

/* VICTORY / DEFEAT / CHEST / EXIT LAYOUTS */
.celeb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}

.celeb-hero-art {
  width: 130px;
  height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(18, 28, 56, 0.25));
}

.celeb-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.celeb-stars img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.celeb-stars img.star-dim {
  opacity: 0.28;
  filter: grayscale(1);
}

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

.celeb-loot-chip {
  height: 48px;
  padding: 0 14px;
  border-width: 9px 13px 9px 13px;
  border-image-width: 9px 13px 9px 13px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 900;
  color: #FFFFFF;
}

.celeb-loot-chip img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.modal-cta-big {
  min-width: 152px;
  max-width: 100%;
  height: 52px;
  padding: 0 20px;
  border-width: 9px 12px 14px 12px;
  border-image-width: 9px 12px 14px 12px;
  box-shadow: none;
  font-size: clamp(13px, 1.02vw, 15px);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  flex: 0 1 auto;
}

/* REBORN BANNER INSIDE UPGRADES */
.reborn-strip {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 12px;
  border-width: 12px 14px 16px 14px;
}

.reborn-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reborn-info img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.reborn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reborn-title {
  font-size: 16px;
  font-weight: 900;
  color: #181C2E;
}

.reborn-sub {
  font-size: 13px;
  font-weight: 800;
  color: #5C3200;
}

/* TOASTS */
.toast-container {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  padding: 8px 16px;
  border-radius: 14px;
  background: #181C2E;
  border: 2px solid #FFD52E;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

/* DEV F2 PREVIEW PANEL (ONLY MOUNTED WHEN window.DEBUG && !window.__MS_RELEASE__) */
.dev-f2-pill {
  position: fixed;
  bottom: 94px;
  left: 14px;
  z-index: 160;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(24, 28, 46, 0.88);
  border: 2px solid #FFD52E;
  color: #FFD52E;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.dev-f2-panel {
  position: fixed;
  bottom: 132px;
  left: 14px;
  z-index: 165;
  width: 260px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(24, 28, 46, 0.95);
  border: 2px solid #FFD52E;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dev-f2-panel button {
  height: 32px;
  border-radius: 8px;
  border: 1px solid #76D6F5;
  background: #23335B;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* RESPONSIVE TUNING FOR 1280x720 (ZERO OVERFLOW / ZERO WRAP ACROSS ALL 9 LANGS) */
@media (max-width: 1440px) {
  .hud-top {
    left: 8px;
    right: 8px;
    gap: 5px;
  }
  .hud-cluster {
    gap: 4px;
  }
  .hud-currency-pill,
  .hud-army-pill {
    min-width: 72px;
    height: 40px;
    padding: 0 8px 0 6px;
    border-width: 8px 11px 8px 11px;
    border-image-width: 8px 11px 8px 11px;
  }
  .hud-currency-pill > .uiv-icon-pop,
  .hud-army-pill > .uiv-icon-pop {
    width: 30px;
    height: 30px;
    margin: -5px 1px -5px -6px;
  }
  .hud-num {
    font-size: 14px;
  }
  .hud-stage-pill {
    min-width: 150px;
    max-width: 198px;
    height: 46px;
    padding: 2px 6px;
    border-width: 7px 10px 7px 10px;
    border-image-width: 7px 10px 7px 10px;
  }
  .stage-meta-row {
    font-size: 11px;
  }
  .hud-pill-btn,
  .hud-action-btn,
  .hud-icon-btn {
    height: 40px;
    font-size: 11.5px;
  }
  .hud-speed-btn {
    min-width: 38px;
    padding: 0 5px;
  }
  .hud-action-btn {
    padding: 0 8px;
    gap: 4px;
    border-width: 7px 8px 10px 8px;
    border-image-width: 7px 8px 10px 8px;
  }
  .hud-action-btn img {
    width: 18px;
    height: 18px;
  }
  .notify-badge {
    min-width: 15px;
    width: 15px;
    height: 15px;
    font-size: 10px;
    border-width: 1.5px;
  }
  .hud-icon-btn {
    width: 38px;
    border-width: 7px 7px 7px 7px;
    border-image-width: 7px 7px 7px 7px;
  }
  .hud-icon-btn img {
    width: 20px;
    height: 20px;
  }
  .modal-cta-big {
    min-width: 136px;
    height: 48px;
    padding: 0 16px;
    font-size: 13px;
  }
  .skill-btn,
  .quick-upg-btn {
    width: 76px;
    height: 72px;
    border-image-width: 8px 8px 12px 8px;
    box-shadow: none;
  }
  .skill-btn img,
  .quick-upg-btn img {
    width: 44px;
    height: 44px;
  }
  .vf-card-art-wrap,
  .vf-art-wrap {
    height: 92px;
  }
  .vf-card-art-wrap img,
  .vf-media {
    height: 86px;
    max-height: 88px;
  }
  .shop-card,
  .upgrade-card,
  .season-card,
  .vf-hero-card,
  .vf-card-portrait {
    min-height: 192px;
    padding: 4px 6px 6px;
  }
}

@media (max-width: 1120px) {
  .hud-action-btn .btn-label {
    display: none;
  }
  .vf-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
