/* css/style.css — Glassflask Chroma Pour (UI Vault: indigo_arcade_gloss · Play Store Glossy Casual)
   100% Offline MS Store WebView2 Safe — ZERO external Google Fonts, ZERO backdrop-filter: blur,
   Single-row 1080p/720p Top HUD, Round 5 Compact 72x76px Booster Dock, Anti-SaaS 60/25/15 Modals. */

:root {
  --gf-font-display: 'Segoe UI Rounded', 'Trebuchet MS', 'Arial Rounded MT Bold', 'Segoe UI', system-ui, sans-serif;
  --gf-font-body: 'Segoe UI', 'Trebuchet MS', system-ui, sans-serif;
  --gf-indigo-deep: #0E1030;
  --gf-indigo-mid: #23427A;
  --gf-cyan-rim: #65C4EB;
  --gf-gold: #FACC15;
  --gf-cream: #FFFDF5;
}

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

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

.hidden {
  display: none !important;
}

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

.currency-chip {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
  flex: 0 0 22px;
}

/* =========================================================================
   1. Real 0–100% Boot Progress Overlay
   ========================================================================= */
#boot-loader {
  position: fixed;
  inset: 0;
  z-index: 3200;
  background: radial-gradient(circle at 50% 42%, #242053 0%, #0E1030 78%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 220ms ease;
}

#boot-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.boot-logo {
  font-family: var(--gf-font-display);
  font-size: clamp(28px, 3.6vw, 48px);
  font-weight: 900;
  color: #FFFDF5;
  text-shadow: 0 4px 0 #181442, 0 8px 20px rgba(0, 0, 0, 0.55);
}

.boot-bar-wrap {
  width: min(380px, 78vw);
  height: 34px;
  padding: 2px;
  overflow: hidden;
}

#boot-bar-fill {
  height: 100%;
  width: 8%;
  transition: width 90ms linear;
}

#boot-pct-text {
  font-family: var(--gf-font-display);
  font-size: 15px;
  font-weight: 800;
  color: #CAE0DC;
}

/* =========================================================================
   2. Heroic No-Box Title Screen (`0 BOXED_LOGIN_TITLE_SCREEN`)
   ========================================================================= */
#title-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100vw;
  height: 100vh;
  background: url('../assets/art/title_bg.jpg') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 28px 32px;
}

#title-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 46%, rgba(12, 16, 48, 0.14) 0%, rgba(8, 10, 32, 0.62) 100%);
  pointer-events: none;
}

.title-top-utils {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.title-top-utils > * {
  pointer-events: auto;
}

.lang-dropdown {
  height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  border: 2px solid #65C4EB;
  background: #1A1748;
  color: #FFFDF5;
  font-family: var(--gf-font-display);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
}

.icon-sq-btn {
  width: 46px;
  height: 46px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible !important;
}

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

.icon-sq-btn.is-muted {
  filter: grayscale(0.85) brightness(0.75);
}

/* Strictly borderless & transparent Heroic Stage — ZERO login box! */
.title-hero-stage {
  position: relative;
  z-index: 4;
  background: transparent !important;
  border: none !important;
  border-image: none !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vw, 64px);
  margin: auto 0;
  pointer-events: none;
}

.title-mascot-wrap {
  position: relative;
  width: clamp(190px, 21vw, 290px);
  height: clamp(190px, 21vw, 290px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent !important;
  border: none !important;
}

#title-mascot-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(6, 8, 28, 0.58));
}

.title-emblem-cluster {
  background: transparent !important;
  border: none !important;
  border-image: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: min(620px, 56vw);
  pointer-events: auto;
}

.game-main-title {
  margin: 0;
  background: transparent !important;
  border: none !important;
  font-family: var(--gf-font-display);
  font-size: clamp(38px, 4.6vw, 68px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: #FFFDF5;
  -webkit-text-stroke: 2.5px #1B144A;
  text-shadow: 0 5px 0 #1B144A, 0 10px 24px rgba(0, 0, 0, 0.62);
}

.game-subtitle-tag {
  margin: 0;
  font-family: var(--gf-font-display);
  font-size: clamp(15px, 1.35vw, 21px);
  font-weight: 800;
  color: #BAE6FD;
  text-shadow: 0 2px 6px rgba(6, 8, 28, 0.82);
}

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

#btn-title-play {
  min-width: 220px;
  height: 56px;
  padding: 0 28px;
  font-size: clamp(17px, 1.45vw, 22px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.title-sec-btn {
  height: 50px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.title-sec-btn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* =========================================================================
   3. Full-Bleed 16:9 Gameplay Screen + Floating Corner HUD + Compact Dock
   ========================================================================= */
#game-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

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

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

#ui-motion-overlay {
  position: fixed;
  inset: 0;
  z-index: 1700;
  pointer-events: none;
}

/* Floating Single-Row Top HUD (`flex-wrap: nowrap` at BOTH 1080p and 720p!) */
#top-hud {
  position: fixed;
  top: 10px;
  left: 14px;
  right: 14px;
  z-index: 30;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

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

.hud-cluster > * {
  pointer-events: auto;
}

.hud-stat-pill {
  height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: clamp(13px, 1.02vw, 16px);
  font-variant-numeric: tabular-nums;
}

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

.hud-divider {
  opacity: 0.55;
  margin: 0 2px;
}

#hud-crystals-pill {
  cursor: pointer;
}

.hud-2x-btn {
  height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  overflow: visible !important;
}

.hud-2x-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.hud-2x-btn.is-armed {
  filter: brightness(1.14);
  outline: 2px solid #FACC15;
}

.hud-nav-btn {
  height: 46px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: visible !important;
  min-width: 46px;
}

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

/* Compact 720p / <=1460px single-row scaling */
@media (max-width: 1460px) {
  #top-hud {
    top: 8px;
    left: 10px;
    right: 10px;
    gap: 6px;
  }
  .hud-cluster {
    gap: 5px;
  }
  .hud-stat-pill {
    height: 40px;
    padding: 0 9px;
    font-size: 13px;
  }
  .hud-nav-btn {
    height: 42px;
    padding: 0 8px;
    min-width: 42px;
  }
  .hud-nav-btn .nav-text-opt {
    display: none;
  }
}

/* Bottom Centered Booster Dock — Round 5 Law (`72x76px` squircles, `58-68%` icon, `overflow: visible`!) */
#booster-dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 12px;
  pointer-events: none;
}

.booster-btn {
  pointer-events: auto;
  width: 74px;
  height: 76px;
  padding: 5px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  overflow: visible !important;
}

.booster-btn img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  flex: 0 0 44px;
}

.booster-caption {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.05;
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #FFFDF5;
  pointer-events: none;
}

.booster-key {
  position: absolute;
  top: -7px;
  left: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 7px;
  background: #151136;
  border: 1.5px solid #65C4EB;
  color: #BAE6FD;
  font-size: 11px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
  z-index: 12;
}

.tool-count {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 24px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #F59E0B;
  border: 2px solid #FFFDF5;
  color: #151136;
  font-family: var(--gf-font-display);
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  z-index: 14;
}

.booster-btn.is-active-tool {
  outline: 2px solid #22C55E;
}

/* =========================================================================
   4. Stage-1 FTUE Spotlight + 3-Icon Feature Guides (`pointer-events: none`)
   ========================================================================= */
.ftue-layer {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
}

.ftue-layer .tut-spotlight {
  position: fixed;
  pointer-events: none;
}

.ftue-layer .tut-hand {
  position: fixed;
  pointer-events: none;
}

.ftue-pill {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 43;
  font-family: var(--gf-font-display);
  font-weight: 800;
  color: #FFFDF5;
  white-space: nowrap;
  pointer-events: none;
}

.ftue-skip-btn {
  position: fixed;
  top: 66px;
  right: 22px;
  height: 38px;
  padding: 0 14px;
  z-index: 44;
  pointer-events: auto;
}

.fg-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2300;
  background: rgba(8, 10, 30, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fg-panel {
  width: min(560px, 92vw);
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.fg-title {
  padding: 4px 24px;
  font-size: 20px;
}

.fg-flow-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.fg-step-tile {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.fg-step-tile img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.fg-step-label {
  font-size: 13.5px;
  font-weight: 800;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fg-arrow {
  font-size: 24px;
  font-weight: 900;
  color: #FACC15;
}

.fg-ok-btn {
  min-width: 170px;
  height: 48px;
  padding: 0 24px;
}

/* =========================================================================
   5. Anti-SaaS `60/25/15` Single-Root Dialogs (`#dlg-scrim` — ZERO nested modal nodes!)
   ========================================================================= */
#dlg-scrim {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 10, 30, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.dlg-card {
  position: relative;
  width: min(940px, 94vw);
  max-height: 88vh;
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

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

.dlg-ribbon {
  padding: 2px 26px;
  font-size: clamp(17px, 1.5vw, 22px);
  white-space: nowrap;
}

.dlg-head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dlg-help-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dlg-close {
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 110ms ease;
}

.dlg-close:hover {
  transform: scale(1.08);
}

.dlg-close-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.dlg-body-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dlg-tabs, .qp-switcher, .sea-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.dlg-tab-btn, .qp-tab-btn, .sea-tab-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.qp-tab-icon, .sea-tab-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 24px;
}

.dlg-grid, .sea-grid {
  display: grid;
  gap: 12px;
  width: 100%;
}

.dlg-grid.cols-4, .qp-grid-4, .sea-grid.cols-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dlg-grid.cols-3, .sea-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dlg-grid.cols-2, .sea-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 620px;
  margin: 0 auto;
}

.shop-card, .upgrade-card, .vf-card-portrait, .season-card {
  position: relative;
  min-width: 0;
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  text-align: center;
}

.sku-ribbon-tag {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 8px;
  background: #FACC15;
  color: #151136;
  font-size: 11px;
  font-weight: 900;
  z-index: 4;
}

.sku-hero-art, .sea-art {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border-radius: 12px;
  margin-top: 4px;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.42));
}

.qp-tier-art {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.sku-short-title, .qp-tier-title, .sea-heading {
  font-family: var(--gf-font-display);
  font-size: 14px;
  font-weight: 800;
  color: #FFFDF5;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-stat-pill, .qp-reward-chip, .sea-stat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(12, 16, 48, 0.65);
  border: 1px solid rgba(101, 196, 235, 0.42);
  font-size: 12.5px;
  font-weight: 800;
  color: #FDE68A;
  white-space: nowrap;
}

.qp-chip-pair {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.sku-buy-btn, .qp-mini-btn, .sea-act-btn {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sea-seed-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
}

.sea-seed-input {
  max-width: 240px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sea-inline-btn {
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sea-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
}

.sea-banner-art {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex: 0 0 60px;
}

.sea-banner-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.sea-banner-title {
  font-family: var(--gf-font-display);
  font-size: 16px;
  font-weight: 800;
  color: #FFFDF5;
}

.version-tag {
  font-size: 12.5px;
  font-weight: 700;
  color: #BAE6FD;
  text-align: center;
  opacity: 0.85;
}

.qp-status-pill {
  font-size: 12.5px;
  font-weight: 800;
  color: #BAE6FD;
}

/* Passes Hero Banner + Giftcode Strip */
.qp-host {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qp-hero-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
}

.qp-hero-art {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex: 0 0 60px;
}

.qp-hero-mid {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qp-hero-title {
  font-size: 15px;
  font-weight: 800;
}

.qp-bar-outer {
  width: 100%;
  height: 24px;
  overflow: hidden;
}

.qp-bar-inner {
  height: 100%;
}

.qp-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qp-action-btn {
  height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.giftcode-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
}

.giftcode-input {
  flex: 1 1 auto;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid #65C4EB;
  background: #131136;
  color: #FFFDF5;
  font-family: var(--gf-font-display);
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

/* Chapters Grid */
.stage-select-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.stage-btn {
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.stage-num {
  font-size: 20px;
  font-weight: 900;
}

.stage-stars {
  font-size: 13px;
  color: #FACC15;
}

/* Settings Layout */
.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px;
}

.setting-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-label {
  min-width: 130px;
  font-size: 15px;
  font-weight: 800;
}

.setting-slider {
  flex: 1 1 auto;
  accent-color: #22C55E;
  cursor: pointer;
}

.setting-toggle-btn {
  min-width: 68px;
  height: 38px;
  padding: 0 12px;
}

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

.setting-pill-btn {
  height: 42px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Preview-Only `[DEV F2]` Pill & Panel */
.dev-f2-pill {
  position: fixed;
  bottom: 10px;
  right: 12px;
  z-index: 2900;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #65C4EB;
  background: rgba(15, 23, 42, 0.85);
  color: #65C4EB;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.dev-f2-panel {
  position: fixed;
  bottom: 42px;
  right: 12px;
  z-index: 2900;
  width: 220px;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid #65C4EB;
  background: #141236;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dev-f2-btn {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #3B5BDB;
  background: #242053;
  color: #FFFDF5;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 960px) {
  .dlg-grid.cols-4, .qp-grid-4, .sea-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-btn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .title-hero-stage {
    flex-direction: column;
    text-align: center;
  }
  .title-emblem-cluster {
    align-items: center;
    max-width: 92vw;
  }
}
