/* =========================================================================
   css/style.css — Beetlebrigade Auto Clash (6cdeaaa48c9f)
   UI Vault: vibrant_popout_tycoon · Archetype: hypercasual_toy_3d
   STRICTLY ZERO fonts.googleapis.com, ZERO backdrop-filter: blur(),
   Single-row 1080p/720p Top HUD, Round 5 Compact Boosters (68-90px), Anti-SaaS 60/25/15.
   ========================================================================= */

:root {
  --uiv-font-display: 'Segoe UI Rounded', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --uiv-font-body: 'Segoe UI Rounded', 'Trebuchet MS', system-ui, sans-serif;
  --ink-dark: #181C2E;
  --cream-surface: #FFFDF5;
  --lime-accent: #93BF27;
  --gold-accent: #FFE14D;
  --teal-accent: #5FC4AE;
}

*, *::before, *::after {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-drag: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #204732;
  font-family: var(--uiv-font-body);
  color: var(--ink-dark);
}

[hidden] {
  display: none !important;
}

button, select, input {
  font-family: var(--uiv-font-display);
}

/* Alias classes so pre-scaffolded js/exit_modal.js inherits full vibrant_popout_tycoon 9-slice chrome */
.uiv-vibrant_popout_tycoon-slot-tile {
  border-style: solid;
  border-width: 16px 16px 19px 16px;
  border-image-source: url("../assets/ui/vault_vibrant_popout_tycoon/slot_dock.png");
  border-image-slice: 66 66 77 66 fill;
  border-image-repeat: stretch;
  background: none;
  color: #181822;
}

.uiv-vibrant_popout_tycoon-btn-danger {
  border-style: solid;
  border-width: 14px 16px 16px 16px;
  border-image-source: url("../assets/ui/vault_vibrant_popout_tycoon/btn_claim.png");
  border-image-slice: 66 74 79 74 fill;
  border-image-repeat: stretch;
  background: none;
  color: #181822;
  font-weight: 800;
  cursor: pointer;
}

/* Compact 9-slice overrides so inner button text NEVER squishes or truncates in 9 locales */
.compact-9slice-btn {
  border-width: 8px 12px 10px 12px !important;
  padding: 3px 10px !important;
  min-height: 36px;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.compact-tab-btn {
  border-width: 8px 12px 10px 12px !important;
  padding: 4px 12px !important;
  min-height: 38px;
  font-size: 13.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

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

.tiny-chip {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: 0 0 14px;
}

/* WebGL2 UI Motion Overlay */
#ui-motion-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2500;
}

/* =========================================================================
   HEROIC NO-BOX TITLE SCREEN (0 BOXED_LOGIN_TITLE_SCREEN)
   ========================================================================= */
#title-screen {
  position: fixed;
  inset: 0;
  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;
  align-items: center;
  padding: 18px 26px 34px;
  z-index: 400;
}

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

.title-util-pill {
  border-width: 8px 12px 10px 12px !important;
  padding: 3px 10px !important;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.clean-select {
  background: var(--cream-surface);
  color: var(--ink-dark);
  border: 2.5px solid var(--ink-dark);
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.title-center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  margin-top: -12px;
}

.title-emblem-main {
  margin: 0;
  font-family: var(--uiv-font-display);
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #FFE14D;
  -webkit-text-stroke: 2.5px #181C2E;
  text-shadow: 0 5px 0 #181C2E, 0 9px 18px rgba(24, 28, 46, 0.55);
  text-align: center;
  line-height: 1.05;
}

.title-emblem-sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(24, 28, 46, 0.78);
  border: 2.5px solid #FFE14D;
  color: #FFFDF5;
  font-size: clamp(13px, 1.4vw, 17px);
  font-weight: 800;
}

#title-hero-wrap {
  position: relative;
  width: clamp(185px, 23vh, 250px);
  height: clamp(185px, 23vh, 250px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#title-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(24, 28, 46, 0.45));
}

.title-cta-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 5;
}

.title-play-cta {
  min-width: 220px;
  min-height: 64px;
  font-size: clamp(20px, 2vw, 26px) !important;
  font-weight: 900;
  padding: 8px 28px !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.title-daily-cta {
  min-width: 170px;
  min-height: 56px;
  font-size: 16px !important;
  font-weight: 800;
  padding: 6px 18px !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* =========================================================================
   FULL-BLEED 16:9 GAMEPLAY SCREEN & FLOATING SINGLE-ROW HUD
   ========================================================================= */
#game-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

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

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

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

.hud-stat-pill {
  border-width: 7px 10px 9px 10px !important;
  padding: 2px 8px !important;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}

.hud-stat-pill.is-armed {
  outline: 3px solid #FFE14D;
}

.vip-mini-tag {
  background: #FFE14D;
  color: #181C2E;
  border: 2px solid #181C2E;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

#hud-synergy-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

.syn-mini-pill {
  background: rgba(24, 28, 46, 0.78);
  color: #E2E8F0;
  border: 2px solid #94A3B8;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.syn-mini-pill.is-active {
  background: #181C2E;
  color: #FFE14D;
}

.hud-icon-btn {
  position: relative;
  overflow: visible !important;
  width: 42px;
  height: 42px;
  border-width: 7px 8px 9px 8px !important;
  padding: 2px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 42px;
}

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

@media (max-width: 1460px) {
  #hud-top-bar {
    top: 6px;
    left: 6px;
    right: 6px;
    gap: 4px;
  }
  .hud-stat-pill {
    font-size: 13px;
    padding: 1px 6px !important;
    min-height: 34px;
  }
  .hud-icon-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }
  .hud-icon-btn img {
    width: 21px;
    height: 21px;
  }
  #hud-synergy-strip {
    display: none;
  }
}

/* =========================================================================
   BOTTOM COMPACT ORCHARD PREP DOCK & BATTLE SPEED DOCK (Round 5 Spatial Law)
   ========================================================================= */
#prep-bottom-dock {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(24, 28, 46, 0.62);
  border: 2.5px solid rgba(255, 253, 245, 0.55);
  max-width: calc(100vw - 16px);
}

.prep-offer-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: start;
  align-content: start;
  gap: 6px;
}

.prep-divider {
  width: 2px;
  height: 58px;
  background: rgba(255, 253, 245, 0.35);
  border-radius: 2px;
}

/* Round 5 Compact Booster / Draft Tile: 88x80px (strictly within 68-90px, icon ~60%, overflow: visible) */
.booster-btn {
  position: relative;
  overflow: visible !important;
  width: 88px;
  height: 80px;
  border-width: 6px 6px 8px 6px !important;
  padding: 2px 2px 3px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  cursor: pointer;
  flex: 0 0 88px;
}

.booster-art {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex: 0 0 48px;
}

.booster-short-lbl {
  display: block;
  width: 100%;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.tool-count {
  position: absolute;
  bottom: -7px;
  right: -5px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #181C2E;
  border: 2px solid #FFE14D;
  color: #FFFDF5;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.2;
}

.merge-star-tag {
  position: absolute;
  top: -8px;
  left: -5px;
  z-index: 16;
  padding: 1px 5px;
  border-radius: 8px;
  background: #FF4B5C;
  border: 2px solid #FFFDF5;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 900;
}

.prep-action-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prep-mini-btn {
  border-width: 6px 10px 8px 10px !important;
  padding: 2px 8px !important;
  min-height: 37px;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}

#btn-start-battle {
  min-width: 142px;
  height: 52px;
  border-width: 8px 14px 10px 14px !important;
  padding: 4px 14px !important;
  font-size: 16px;
  font-weight: 900;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
}

#btn-start-battle img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex: 0 0 32px;
}

#battle-bottom-dock {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(24, 28, 46, 0.72);
  border: 2px solid rgba(255, 225, 77, 0.75);
}

.speed-pill-btn {
  border-width: 6px 10px 8px 10px !important;
  padding: 2px 10px !important;
  min-height: 34px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 1360px) {
  .booster-btn {
    width: 84px;
    height: 76px;
    flex: 0 0 84px;
  }
  .booster-art {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
  }
  .booster-short-lbl {
    font-size: 9px;
  }
  #btn-start-battle {
    min-width: 132px;
    height: 48px;
    font-size: 15px;
  }
  #btn-start-battle img {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }
}

/* =========================================================================
   MODALS (Anti-SaaS 60/25/15, ZERO backdrop-filter: blur)
   ========================================================================= */
#modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1800;
  background: rgba(18, 28, 40, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

#modal-dialog {
  position: relative;
  width: min(880px, 94vw);
  max-height: min(640px, 90vh);
  padding: 24px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-header-ribbon {
  align-self: center;
  margin-top: -38px;
  padding: 6px 32px !important;
  min-width: 240px;
  text-align: center;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 900;
}

#btn-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 46px;
  height: 46px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 20;
}

#btn-modal-close img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Shop, Upgrades & Presets Grids */
.shop-top-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shop-sku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 12px;
}

.sku-item-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 8px;
  min-height: 214px;
  text-align: center;
}

.sku-corner-tag {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #FF4B5C;
  color: #FFFFFF;
  border: 2px solid #FFFDF5;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 10.5px;
  font-weight: 900;
  white-space: nowrap;
  z-index: 5;
}

.sku-hero-art {
  width: 104px;
  height: 104px;
  object-fit: contain;
  margin-top: 4px;
}

.sku-short-title {
  font-size: 13.5px;
  font-weight: 900;
  color: #181C2E;
  line-height: 1.15;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.sku-stat-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 253, 245, 0.85);
  border: 1.5px solid rgba(24, 28, 46, 0.25);
  font-size: 11.5px;
  font-weight: 800;
  color: #181C2E;
  max-width: 100%;
}

.sku-stat-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-buy-btn {
  width: 100%;
}

.shop-gift-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px !important;
  border-width: 10px 12px 12px 12px !important;
}

.gift-code-input {
  flex: 1 1 140px;
  min-width: 120px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 2.5px solid #181C2E;
  background: #FFFDF5;
  font-size: 13px;
  font-weight: 800;
}

/* Passes & Quests */
.qp-daily-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px !important;
  border-width: 10px 14px 12px 14px !important;
}

.qp-hero-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.qp-daily-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qp-short-title {
  font-size: 13.5px;
  font-weight: 900;
  color: #181C2E;
}

.qp-amt-pill,
.pass-amt-pill,
.quest-prog-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #181C2E;
}

.section-mini-label {
  font-size: 14px;
  font-weight: 900;
  color: #181C2E;
  padding-left: 4px;
}

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

.qp-quest-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 8px 6px !important;
  border-width: 10px 10px 12px 10px !important;
  text-align: center;
}

.qp-art-lg {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.qp-tabs-bar,
.qp-ctrl-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qp-xp-pill {
  border-width: 7px 12px 9px 12px !important;
  padding: 2px 10px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
}

.qp-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.qp-tier-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px !important;
  border-width: 10px 10px 12px 10px !important;
}

.qp-reward-btn {
  width: 100%;
  border-width: 8px 10px 10px 10px !important;
  padding: 4px 6px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.qp-art-md {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

/* Gallery, Chapters, Upgrades, Guide & Settings */
.gallery-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}

.gallery-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 8px !important;
  border-width: 10px 10px 12px 10px !important;
  text-align: center;
}

.upg-bar-track {
  width: 100%;
  height: 18px;
  border-width: 5px 8px !important;
  padding: 0 !important;
  overflow: hidden;
}

.upg-bar-fill {
  height: 100%;
  border-width: 4px 6px !important;
}

.preset-btn-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.stage-select-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px !important;
  border-width: 9px 9px 11px 9px !important;
  cursor: pointer;
}

.stage-tile-art {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

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

.guide-step-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 10px !important;
  min-height: 210px;
  text-align: center;
}

.guide-num-pill {
  background: #181C2E;
  color: #FFE14D;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 900;
}

.guide-step-art {
  width: 112px;
  height: 112px;
  object-fit: contain;
}

.settings-clean-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-item-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px !important;
  border-width: 9px 12px 11px 12px !important;
}

.settings-strip-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.settings-footer-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

/* =========================================================================
   FTUE SPOTLIGHT & POINTER HAND (pointer-events: none)
   ========================================================================= */
.tut-spotlight {
  position: fixed;
  z-index: 1600;
  border-radius: 18px;
  border: 4px solid #FFE14D;
  box-shadow: 0 0 0 4px #181C2E;
  pointer-events: none;
  animation: ftuePulse 1.1s ease-in-out infinite alternate;
}

.tut-hand {
  position: fixed;
  z-index: 1610;
  width: 46px;
  height: 46px;
  pointer-events: none;
  animation: ftueBob 0.8s ease-in-out infinite alternate;
}

.tut-hand img {
  width: 100%;
  height: 100%;
}

.tut-callout {
  position: fixed;
  z-index: 1610;
  pointer-events: none;
  border-width: 7px 12px 9px 12px !important;
  padding: 3px 10px !important;
  font-size: 13px;
  font-weight: 900;
}

@keyframes ftuePulse {
  from { transform: scale(0.98); }
  to { transform: scale(1.04); }
}

@keyframes ftueBob {
  from { transform: translate(0, 0); }
  to { transform: translate(6px, 10px); }
}

/* Preview-Only [DEV F2] Button */
#btn-dev-f2 {
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 2300;
  padding: 4px 9px;
  border-radius: 8px;
  border: 2px solid #FFE14D;
  background: rgba(24, 28, 46, 0.85);
  color: #FFE14D;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 900px) {
  .quest-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chapters-stage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .guide-3-grid {
    grid-template-columns: 1fr;
  }
}
