/* ==========================================================================
   css/style.css — Anvilshire Craft Guild (232897825a9d)
   UI Vault: ornate_storybook_rpg · Archetype: playstore_cartoon_vibrant
   Offline System Storybook Fonts · Zero backdrop-filter · Zero shadowBlur
   ========================================================================== */

:root {
  --as-font-display: 'Segoe UI Rounded', 'Trebuchet MS', 'Georgia', system-ui, sans-serif;
  --as-font-body: 'Segoe UI', 'Trebuchet MS', system-ui, sans-serif;
  --as-ink-light: #FFF8E7;
  --as-ink-dark: #181822;
  --as-ink-ironwood: #291910;
  --as-brass: #DAC380;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #1B1522;
  font-family: var(--as-font-body);
  color: var(--as-ink-light);
  touch-action: manipulation;
}

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

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

/* --------------------------------------------------------------------------
   1. HEROIC NO-BOX TITLE SCREEN (0 BOXED_LOGIN_TITLE_SCREEN)
   -------------------------------------------------------------------------- */
.screen-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: none;
}

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

#title-screen {
  background: url('../assets/art/title_bg.jpg') center center / cover no-repeat;
  z-index: 40;
}

.title-hearth-glaze {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 240, 200, 0.10) 0%, rgba(24, 14, 10, 0.44) 100%);
  pointer-events: none;
}

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

.title-icon-btn {
  width: 48px;
  height: 48px;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: visible;
}

.title-icon-btn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.storybook-select {
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 2.5px solid var(--as-brass);
  background: #2B2230;
  color: var(--as-ink-light);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.title-open-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 5vh 24px 6vh;
  pointer-events: none;
}

.title-emblem-cluster {
  text-align: center;
  margin-top: 1vh;
}

.title-game-logo {
  margin: 0;
  font-family: var(--as-font-display);
  font-size: clamp(34px, 4.8vw, 64px);
  font-weight: 900;
  color: #FFF8E7;
  -webkit-text-stroke: 2.5px #291910;
  text-shadow: 0 5px 0 #291910, 0 10px 22px rgba(18, 10, 8, 0.75);
}

.title-game-tagline {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 22px;
  font-size: clamp(14px, 1.45vw, 18px);
  font-weight: 900;
  color: var(--as-ink-dark);
}

.title-mascot-stage {
  position: relative;
  width: min(305px, 38vh);
  height: min(305px, 38vh);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.title-mascot-shadow {
  position: absolute;
  bottom: 24px;
  width: 60%;
  height: 18px;
  border-radius: 50%;
  background: rgba(28, 14, 8, 0.38);
}

.title-mascot-img {
  position: relative;
  z-index: 2;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.title-cta-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.title-play-cta {
  min-width: 248px;
  height: 64px;
  padding: 0 34px;
  font-size: clamp(21px, 2.2vw, 27px);
  font-weight: 900;
  color: var(--as-ink-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.title-mode-pills {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-mode-btn {
  height: 46px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 900;
  color: var(--as-ink-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
}

.title-mode-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   2. FULL-BLEED 16:9 GAMEPLAY COURTYARD + SINGLE-ROW FLOATING TOP HUD
   -------------------------------------------------------------------------- */
#gameplay-screen {
  z-index: 10;
}

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

#cutin-canvas,
#ui-motion-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

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

#ui-motion-canvas {
  z-index: 2500;
}

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

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

.hud-pill-btn {
  height: 43px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 900;
  color: #FFF8E7;
  white-space: nowrap;
  cursor: pointer;
  overflow: visible;
}

.hud-rank-ribbon {
  height: 43px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 900;
  color: var(--as-ink-dark);
  white-space: nowrap;
}

.hud-icon-btn {
  width: 44px;
  height: 44px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: visible;
  flex: 0 0 44px;
}

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

@media (max-width: 1460px) {
  .hud-top-bar {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 5px;
  }
  .hud-cluster {
    gap: 5px;
  }
  .hud-pill-btn,
  .hud-rank-ribbon {
    height: 39px;
    padding: 0 9px;
    font-size: 13px;
  }
  .hud-icon-btn {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    padding: 5px;
  }
  .hud-icon-btn img {
    width: 23px;
    height: 23px;
  }
}

/* --------------------------------------------------------------------------
   3. FLOATING COUNTER HAGGLE WIDGET ([A] Discount / [S] Sell / [D] 2x Price!)
   -------------------------------------------------------------------------- */
.counter-haggle-widget {
  position: fixed;
  right: 2.2vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 125;
  width: 268px;
  padding: 6px 8px;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  pointer-events: auto;
}

.counter-haggle-widget.is-visible {
  display: flex;
}

.haggle-item-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.haggle-item-head img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.haggle-stock-pill {
  padding: 2px 10px;
  border-radius: 10px;
  background: #291910;
  color: #FFF8E7;
  font-size: 13px;
  font-weight: 900;
}

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

.haggle-act-btn {
  width: 100%;
  min-height: 40px;
  border-width: 8px 12px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.15;
  min-width: 0;
  white-space: nowrap;
}

.haggle-act-btn > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.haggle-act-btn > small {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
}

/* --------------------------------------------------------------------------
   4. BOTTOM COMPACT SMITHY DOCK (4 Forge Slots + Blueprints + Raid + Guide)
   -------------------------------------------------------------------------- */
.booster-dock {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-wrap: nowrap;
  align-items: start;
  align-content: start;
  gap: 9px;
  pointer-events: auto;
}

.booster-btn {
  position: relative;
  width: 88px;
  height: 82px;
  border-width: 8px;
  padding: 4px 2px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  overflow: visible;
  color: #FFF8E7;
}

.booster-btn.is-ready {
  outline: 3.5px solid #FACC15;
  transform: translateY(-4px);
}

.booster-btn img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.booster-short-lbl {
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  color: #FFF8E7;
  background: rgba(24, 14, 10, 0.88);
  padding: 1px 3px;
  border-radius: 6px;
  max-width: 82px;
  white-space: nowrap;
}

.tool-hotkey {
  position: absolute;
  top: -6px;
  left: -6px;
  padding: 1px 5px;
  border-radius: 7px;
  background: #FDE047;
  border: 1.5px solid #291910;
  color: #181822;
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   5. STAGE 1 NON-BLOCKING VISUAL SPOTLIGHT FTUE (.tut-spotlight + .tut-hand)
   -------------------------------------------------------------------------- */
.tut-layer {
  position: fixed;
  inset: 0;
  z-index: 140;
  pointer-events: none;
  display: none;
}

.tut-layer.is-active {
  display: block;
}

.tut-spotlight {
  position: absolute;
  border-radius: 50%;
  border: 4px dashed #FACC15;
  box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.25);
  animation: tutPulse 1.3s ease-in-out infinite;
}

.tut-hand {
  position: absolute;
  animation: tutTap 1.1s ease-in-out infinite;
}

.tut-caption {
  position: absolute;
  transform: translateX(-50%);
  padding: 8px 18px;
  font-size: 14.5px;
  font-weight: 900;
  color: #FFF8E7;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes tutPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.85; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes tutTap {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-4px, -10px); }
}

/* --------------------------------------------------------------------------
   6. ANTI-SAAS 60/25/15 ORNATE STORYBOOK MODALS
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1800;
  background: rgba(16, 10, 20, 0.76);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

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

.modal-shell {
  position: relative;
  width: min(860px, 94vw);
  max-height: min(640px, 88vh);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-header-ribbon {
  align-self: center;
  min-width: 240px;
  padding: 8px 28px;
  text-align: center;
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 900;
  color: var(--as-ink-dark);
}

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

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

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

.modal-tabs-strip,
.qp-switcher-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-tab-btn,
.qp-switch-btn {
  height: 40px;
  padding: 0 15px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
}

.modal-grid-view,
.qp-tiers-grid,
.qp-quests-grid,
.fg-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 12px;
}

.fg-guide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shop-card,
.upgrade-card,
.season-card,
.qp-card {
  position: relative;
  min-height: 198px;
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  text-align: center;
}

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

.sku-short-title,
.qp-short-title {
  font-size: 14px;
  font-weight: 900;
  color: #FFF8E7;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-short-title.is-dark-ink,
.qp-short-title.is-dark-ink {
  color: #181822;
}

.sku-stat-pill,
.qp-reward-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(24, 16, 28, 0.78);
  border: 1.5px solid rgba(218, 195, 128, 0.45);
  font-size: 12.5px;
  font-weight: 900;
  color: #FDE047;
}

.sku-buy-btn,
.qp-action-btn {
  width: 100%;
  min-height: 38px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
}

/* Featured Pass Banner */
.qp-featured-banner {
  flex-direction: row;
  min-height: 128px;
  padding: 14px 18px;
  gap: 16px;
  text-align: left;
  margin-bottom: 10px;
}

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

.qp-banner-meta {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

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

.qp-banner-actions .qp-action-btn {
  width: auto;
  padding: 0 16px;
}

.qp-meter-outer {
  position: relative;
  width: 100%;
  height: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.qp-meter-fill {
  height: 100%;
  transition: width 220ms ease;
}

.qp-meter-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: #FFF8E7;
}

.vip-claim-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  color: var(--as-ink-dark);
}

.vip-strip-text {
  font-weight: 900;
  color: var(--as-ink-dark);
}

.vip-claim-strip .sku-buy-btn {
  width: auto;
  padding: 0 14px;
}

/* Settings Controls (frame_subpanel uses dark ink on warm parchment) */
.settings-panel-box {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--as-ink-dark);
}

.settings-control-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--as-ink-dark);
}

.settings-control-line input[type="range"] {
  width: 180px;
  accent-color: #D97706;
}

.giftcode-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.storybook-code-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 2.5px solid #6E4226;
  background: #FFF8E7;
  color: var(--as-ink-dark);
  font-size: 14px;
  font-weight: 800;
}

.giftcode-bar .sku-buy-btn {
  width: auto;
  padding: 0 18px;
}

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

/* Preview-only [DEV F2] Panel */
.dev-f2-btn {
  position: fixed;
  bottom: 12px;
  right: 14px;
  z-index: 2200;
  display: none;
  padding: 4px 10px;
  border-radius: 10px;
  border: 2px solid #DAC380;
  background: #2B2230;
  color: #FFF8E7;
  font-size: 11.5px;
  font-weight: 900;
  cursor: pointer;
}

.dev-f2-drawer {
  position: fixed;
  bottom: 48px;
  right: 14px;
  z-index: 2200;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 2.5px solid #DAC380;
  background: #2B2230;
}

.dev-f2-drawer.is-open {
  display: flex;
}
