/* ==========================================================================
   Sproutwheel Wardens — Ornate Storybook RPG UI Vault (`ornate_storybook_rpg`)
   - 25+ Genuine 9-Slice Carved Wood / Antique Brass / Gem / Parchment Regions
   - ZERO backdrop-filter: blur(), ZERO external font requests, ZERO shadowBlur
   - Overflow-safe 9-Language Typography & 1920x1080 + 1280x720 Spatial Balance
   ========================================================================== */

:root {
  --meadow-turf: #80BB79;
  --sunlit-soil: #DED092;
  --harvest-gold: #D2AB63;
  --sprinkler-teal: #41767A;
  --deep-slate: #2B2230;
  --tomato-crimson: #CF3435;
  --sprout-lime: #B1C63C;
  --forest-ink: #3F5134;
  --orchard-leaf: #6F984A;
  --bark-amber: #8C4A1F;
  --mint-glow: #7BC787;
  --sunbeam-yellow: #FFE14D;
  --comic-ink: #140E1A;
  --card-parchment: #EDD5A7;
  --modal-plum: #2E252E;
  --font-display: 'Lilita One', 'Segoe UI Black', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
  --font-body: 'Segoe UI', 'Trebuchet MS', Tahoma, sans-serif;
}

*, *::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-color: #2B2230;
  font-family: var(--font-body);
  color: #1D141F;
}

/* ==========================================================================
   Typography Helpers
   ========================================================================== */
.title-extruded {
  font-family: var(--font-display);
  font-weight: 900;
  color: #FFE14D;
  -webkit-text-stroke: 3px var(--comic-ink);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--comic-ink), 0 8px 18px rgba(20, 14, 26, 0.6);
  letter-spacing: 0.02em;
}

.hud-num {
  font-family: var(--font-display);
  font-weight: 800;
  color: #FFFFFF;
  -webkit-text-stroke: 1.4px var(--comic-ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--comic-ink);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   ORNATE STORYBOOK RPG — GENUINE 9-SLICE SURFACES (`vault_ornate_storybook_rpg`)
   `background-clip: padding-box` keeps carved outer corners 100% transparent
   while reporting true center luminance for WCAG 2.1 contrast!
   ========================================================================== */
.panel-9slice,
.modal-window {
  background-color: #2E252E;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  border-width: 22px 26px 22px 26px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_modal.png') 87 103 86 103 fill / 22px 26px 22px 26px / 0 stretch;
  color: #FFF8E7;
}

.subpanel-9slice,
.side-card,
.gh-yield-banner,
.qp-hero-banner,
.shop-daily-banner,
.settings-row {
  background-color: #EDD5A7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  border-width: 11px 13px 11px 13px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_subpanel.png') 76 90 75 88 fill / 11px 13px 11px 13px / 0 stretch;
  color: #1D141F;
}

.ribbon-9slice,
.title-sub-banner,
.vic-ribbon-banner {
  background-color: #F2D8A7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  border-width: 12px 28px 12px 30px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/ribbon_header.png') 93 171 93 197 fill / 12px 28px 12px 30px / 0 stretch;
  color: #1D141F;
}

.pill-9slice,
.stat-pill,
.lang-pill-wrap {
  position: relative;
  overflow: visible !important;
  background-color: #2E1F15;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  border-width: 8px 14px 9px 14px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/hud_pill.png') 45 80 56 78 fill / 8px 14px 9px 14px / 0 stretch;
  color: #FFF8E7;
}

.dock-9slice,
.arena-bottom-dock {
  background-color: #2E252E;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  border-width: 11px 14px 11px 14px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_modal.png') 87 103 86 103 fill / 11px 14px 11px 14px / 0 stretch;
  color: #FFF8E7;
  contain: layout style;
}

/* 4 Storybook Rarity Card Frames (`card_common/rare/epic/legendary.png`) */
.card-9slice-common,
.rarity-common {
  background-color: #5E514B !important;
  background-clip: padding-box !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  border-width: 12px 11px 11px 11px !important;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_common.png') 129 113 104 112 fill / 12px 11px 11px 11px / 0 stretch !important;
  color: #FFF8E7 !important;
}

.card-9slice-rare,
.rarity-rare {
  background-color: #0A2685 !important;
  background-clip: padding-box !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  border-width: 12px 11px 11px 11px !important;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_rare.png') 135 116 126 112 fill / 12px 11px 11px 11px / 0 stretch !important;
  color: #FFF8E7 !important;
}

.card-9slice-epic,
.rarity-epic {
  background-color: #4D177E !important;
  background-clip: padding-box !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  border-width: 12px 11px 11px 11px !important;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_epic.png') 132 114 107 116 fill / 12px 11px 11px 11px / 0 stretch !important;
  color: #FFF8E7 !important;
}

.card-9slice-legendary,
.rarity-legendary {
  background-color: #E58F0B !important;
  background-clip: padding-box !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  border-width: 12px 11px 11px 11px !important;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_legendary.png') 131 117 114 115 fill / 12px 11px 11px 11px / 0 stretch !important;
  color: #181822 !important;
}

/* ==========================================================================
   Buttons — 4 Carved Brass/Gem 9-Slice States + Zero Clipping / Zero Ellipsis
   ========================================================================== */
.btn-game {
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 12px;
  background-color: #37AA2E;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-radius: 0;
  border-width: 7px 11px 8px 11px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_primary.png') 77 82 76 86 fill / 7px 11px 8px 11px / 0 stretch;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(13px, 0.98vw, 15px);
  line-height: 1.12;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  text-decoration: none;
  box-shadow: none;
}

.btn-game:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.07);
}

.btn-game:active:not(:disabled) {
  transform: translateY(2px);
}

.btn-label {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  text-align: center;
  line-height: 1.12;
}

/* Primary Emerald Gem (`btn_primary.png`) */
.btn-green {
  background-color: #37AA2E;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_primary.png') 77 82 76 86 fill / 7px 11px 8px 11px / 0 stretch;
  color: #FFFFFF;
  -webkit-text-stroke: 1.2px #140E1A;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #140E1A;
}

/* Secondary Burnished Gold (`btn_secondary.png` — dark ink 8.23:1 contrast!) */
.btn-yellow {
  background-color: #E99F0F;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_secondary.png') 77 84 84 90 fill / 7px 11px 8px 11px / 0 stretch;
  color: #181822;
  -webkit-text-stroke: 0px transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* Royal Sapphire (`card_rare.png` — crisp white 12.89:1 contrast!) */
.btn-teal {
  background-color: #0A2685;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/card_rare.png') 135 116 126 112 fill / 7px 10px 8px 10px / 0 stretch;
  color: #FFFFFF;
  -webkit-text-stroke: 1.1px #0B1024;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #0B1024;
}

/* Danger Ruby (`btn_danger.png`) */
.btn-crimson {
  background-color: #CF3435;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_danger.png') 77 81 76 83 fill / 7px 11px 8px 11px / 0 stretch;
  color: #FFFFFF;
  -webkit-text-stroke: 1.2px #1E080A;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #1E080A;
}

/* Slate Stone / Utility / Disabled (`btn_disabled.png`) */
.btn-slate,
.btn-game:disabled,
.btn-game.is-disabled {
  background-color: #666E7A;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_disabled.png') 77 84 75 90 fill / 7px 11px 8px 11px / 0 stretch;
  color: #FFFFFF;
  -webkit-text-stroke: 1.1px #141820;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #141820;
}

.btn-game:disabled,
.btn-game.is-disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.btn-close-img {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent url('../assets/ui/vault_ornate_storybook_rpg/btn_close.png') center / contain no-repeat;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s ease;
}
.btn-close-img:hover {
  transform: scale(1.08);
}

.hotkey-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: #1B1324;
  border: 1.5px solid #D2AB63;
  color: #FFE14D;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.ui-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
}

.ui-icon-sm {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
}

/* Red-Dot Notification Badge (NEVER clipped!) */
.notify-badge {
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: #FF3B4E;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  z-index: 35;
  pointer-events: none;
  animation: notifyPulse 1.5s infinite ease-in-out;
}
.notify-badge.hidden {
  display: none !important;
}

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

/* ==========================================================================
   PILLAR 1 — HEROIC NO-BOX TITLE SCREEN (`0 BOXED_LOGIN_TITLE_SCREEN`)
   Full-bleed 16:9 Orchard Battlefield + Floating Storybook Title + Live Hero
   ========================================================================== */
#screen-title {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 34px;
  background: #3F5134 url('../assets/art/title_bg.jpg') center center / cover no-repeat;
}
#screen-title.hidden {
  display: none !important;
}

#screen-title::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(22, 14, 30, 0.66) 0%, rgba(22, 14, 30, 0.18) 54%, rgba(22, 14, 30, 0.44) 100%);
  pointer-events: none;
}

.title-top-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lang-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: 14px;
}

.lang-select-ctrl {
  background: #FFF8E7;
  color: #1D141F;
  border: 2px solid #5A351C;
  border-radius: 8px;
  padding: 4px 8px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
}

/* CRITICAL: Keep .title-center-stage and .title-brand-col 100% unboxed! */
.title-center-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(340px, 600px) minmax(280px, 440px);
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: 1320px;
  width: 100%;
  margin: auto;
  background: transparent;
  border: none;
}

.title-brand-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  background: transparent;
  border: none;
}

.title-logo-text {
  margin: 0;
  font-size: clamp(44px, 4.8vw, 72px);
  line-height: 1.02;
}

.title-sub-banner {
  margin: 0;
  padding: 6px 18px;
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 800;
  max-width: 540px;
}

/* Real 0-100% Loading Bar */
.boot-loader-card {
  width: 100%;
  max-width: 440px;
  background-color: #2E252E;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 14px 18px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_modal.png') 87 103 86 103 fill / 14px 18px / 0 stretch;
  padding: 8px 12px;
}

.boot-loader-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #FFF8E7;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 6px;
}

.boot-bar-outer {
  width: 100%;
  height: 24px;
  background-color: #28211C;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 5px 14px 5px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/bar_track.png') 55 235 54 170 fill / 5px 14px 5px 12px / 0 stretch;
  overflow: hidden;
}

.boot-bar-inner {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #44B848 0%, #B1C63C 55%, #FFE14D 100%);
  transition: width 0.14s ease-out;
}

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

#btn-title-play {
  min-width: 238px;
  min-height: 62px;
  border-width: 11px 18px 12px 18px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_secondary.png') 77 84 84 90 fill / 11px 18px 12px 18px / 0 stretch;
  font-size: clamp(20px, 1.75vw, 26px);
  letter-spacing: 0.03em;
}

#btn-title-greenhouse,
#btn-title-shop {
  min-height: 52px;
  padding: 6px 16px;
}

.title-portrait-wrap {
  position: relative;
  width: min(390px, 34vw);
  height: min(390px, 46vh);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-portrait-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.55));
}

.title-footer-strip {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #FFF8E7;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);
  font-size: 13px;
  font-weight: 800;
}

/* ==========================================================================
   PILLAR 2 — GAMEPLAY 16:9 FULL-BLEED LAYOUT & SPATIAL READABILITY
   Arena >= 76-83.5% Viewport + Carved Oak Tactical Command Sidebar
   ========================================================================== */
#screen-game {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: 100vh;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
#screen-game.hidden {
  display: none !important;
}

.arena-stage-col {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #4E7A44;
}

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

#vfx-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  display: none;
}

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

#sky-bonus-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 24%;
  height: 20%;
  pointer-events: none;
  z-index: 45;
}

.sky-bonus-actor {
  position: absolute;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background-color: #E99F0F;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 7px 11px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_secondary.png') 77 84 84 90 fill / 7px 11px / 0 stretch;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  color: #181822;
}

/* Top Floating Arena HUD Bar — STRICT `flex-wrap: nowrap` at 1080p & 720p! */
.arena-top-hud {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

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

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

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 3px 10px;
  font-size: 14px;
  white-space: nowrap;
}

/* Pop-out silhouette icons on top HUD pills */
.stat-pill > .ui-icon {
  width: 28px;
  height: 28px;
  margin-left: -6px;
}

.hp-bar-wrap,
.xp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mini-meter {
  width: 96px;
  height: 15px;
  background: #1A1218;
  border: 2px solid #D2AB63;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.mini-meter-fill {
  height: 100%;
  width: 100%;
  transition: width 0.16s ease-out;
}

.fill-hp {
  background: linear-gradient(90deg, #44B848 0%, #8CE064 100%);
}
.fill-xp {
  background: linear-gradient(90deg, #3FC5F0 0%, #8AE9FF 100%);
}
.fill-boss {
  background: linear-gradient(90deg, #CF3435 0%, #F2B029 100%);
}

.hud-util-btn {
  min-height: 40px;
  padding: 4px 10px;
  font-size: 13px;
}

/* Boss HP Strip under Top HUD */
#boss-hud-banner {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  min-width: 360px;
  max-width: 520px;
  padding: 6px 14px;
  background-color: #2E252E;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 14px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_modal.png') 87 103 86 103 fill / 10px 14px / 0 stretch;
  color: #FFF8E7;
  pointer-events: none;
}
#boss-hud-banner.hidden {
  display: none !important;
}

/* Slice Hover Tooltip */
#wheel-hover-card {
  position: absolute;
  top: 60px;
  left: 14px;
  z-index: 26;
  max-width: 290px;
  padding: 8px 12px;
  background-color: #EDD5A7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_subpanel.png') 76 90 75 88 fill / 10px 12px / 0 stretch;
  font-size: 13px;
  font-weight: 800;
  color: #1D141F;
  pointer-events: none;
}
#wheel-hover-card.hidden {
  display: none !important;
}

.water-pip-row {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}
.water-pip {
  display: inline-block;
  width: 9px;
  height: 12px;
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  background: #2CC6FF;
  border: 1.5px solid #143642;
  flex-shrink: 0;
}

/* Bottom Crop Shop & Tools Dock */
.arena-bottom-dock {
  position: absolute;
  bottom: 8px;
  left: 12px;
  right: 12px;
  z-index: 48;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
}

.crop-shop-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  flex: 1.25 1 auto;
  min-width: 0;
}

.crop-buy-card {
  position: relative;
  overflow: visible !important;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 52px;
  max-height: 58px;
  padding: 3px 6px;
  background-color: #EDD5A7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 6px 8px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_subpanel.png') 76 90 75 88 fill / 6px 8px / 0 stretch;
  color: #1D141F;
  cursor: grab;
  text-align: left;
  user-select: none;
  touch-action: none;
  transition: transform 0.1s ease, filter 0.1s ease;
}
.crop-buy-card.is-dragging {
  cursor: grabbing;
  opacity: 0.55;
  transform: scale(0.96);
}
.crop-buy-card:hover:not(.sold):not(.cant-afford) {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.crop-buy-card.sold {
  opacity: 0.42;
  pointer-events: none;
}
.crop-buy-card.cant-afford {
  opacity: 0.76;
}
.crop-buy-card > * {
  pointer-events: none;
}

.crop-hotkey {
  position: absolute;
  top: -9px;
  left: -7px;
  z-index: 5;
}

.crop-card-thumb {
  width: 48px;
  height: 48px;
  background-color: #412517;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 2px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/slot_tile.png') 35 85 19 85 fill / 2px / 0 stretch;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.crop-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.crop-card-info {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.crop-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  line-height: 1.15;
  color: #1D141F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
}
:lang(ja) .crop-card-title,
:lang(de) .crop-card-title,
:lang(ru) .crop-card-title {
  font-size: 11.5px;
  letter-spacing: -0.2px;
}
.crop-card-meta {
  font-size: 12.5px;
  font-weight: 800;
  color: #3A2010;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
  white-space: nowrap;
}

/* Floating Drag-and-Drop Ghost */
#crop-drag-ghost {
  position: fixed;
  z-index: 320;
  pointer-events: none;
  transform: translate(-50%, -62%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 12px;
  background: rgba(255, 244, 212, 0.96);
  border: 2.5px solid #FFE14D;
  box-shadow: 0 8px 22px rgba(20, 14, 26, 0.45);
  color: #1D141F;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}
#crop-drag-ghost.hidden {
  display: none;
}
#crop-drag-ghost img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

/* Overdrive Ready vs Charging visual states & Shake feedback */
#btn-sprinkler-overdrive.overdrive-charging {
  filter: saturate(0.72) brightness(0.92);
}
#btn-sprinkler-overdrive.overdrive-ready {
  filter: brightness(1.08);
  box-shadow: 0 0 14px rgba(104, 240, 128, 0.65);
}
@keyframes btnShakeAnim {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
}
.btn-shake {
  animation: btnShakeAnim 0.32s ease;
}

/* Biome landscape preview & Seeds chip distinction */
.sh-biome-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.sh-chip-seeds {
  background: rgba(34, 150, 66, 0.22);
  border-color: rgba(114, 224, 96, 0.65);
}

/* Shop Pack Detail & Purchase Confirmation Modal (#3068) */
.shop-confirm-backdrop {
  z-index: 260;
}
.shop-confirm-window {
  width: min(460px, 92vw);
}
.shop-confirm-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.shop-confirm-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 12px 6px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 232, 130, 0.24), rgba(29, 20, 31, 0.28));
  border: 2px solid rgba(233, 159, 15, 0.45);
}
.shop-confirm-art {
  width: 126px;
  height: 126px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}
.shop-confirm-kind {
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(29, 20, 31, 0.72);
  color: #FFE89E;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.shop-confirm-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #FFF8E7;
  text-shadow: 0 2px 0 #1D141F;
}
.shop-confirm-chips {
  justify-content: center;
}
.shop-confirm-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
  font-weight: 700;
  color: #F4E9D4;
}
.shop-confirm-sandbox {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(44, 198, 255, 0.14);
  border: 1.5px solid rgba(111, 227, 255, 0.42);
  color: #D9F7FF;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.shop-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}
.shop-confirm-actions .btn-game {
  min-height: 46px;
}

.dock-tools-cluster {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.dock-tools-cluster .btn-game {
  min-height: 46px;
  padding: 4px 9px;
  font-size: 13px;
}

.btn-tool.active-tool {
  outline: 3px solid #FFE14D;
  transform: translateY(-2px);
}

/* ==========================================================================
   RIGHT TACTICAL COMMAND SIDEBAR (Carved Oak & Brass Storybook Rail)
   ========================================================================== */
.tactical-sidebar {
  position: relative;
  z-index: 25;
  width: 320px;
  height: 100vh;
  background: linear-gradient(180deg, #2A1E28 0%, #1E151E 100%);
  border-left: 4px solid #C88B32;
  box-shadow: inset 3px 0 0 #140E1A;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  color: #FFF8E7;
  contain: layout style paint;
}

.side-card {
  padding: 5px 8px;
}

.side-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: #2A1810;
  margin-bottom: 5px;
}

.side-tag-pill {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 800;
  color: #4A2410;
  background: rgba(255, 248, 231, 0.78);
  border: 1.5px solid #8C5327;
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
}
.wave-timer-pill {
  font-variant-numeric: tabular-nums;
  background: #2E1F15;
  color: #FFE14D;
  border-color: #C88B32;
}
.wave-timer-pill.is-boss {
  background: #7A1520;
  color: #FFE14D;
  border-color: #FF5964;
}
.wave-timer-pill.is-paused {
  background: #475569;
  color: #FFFFFF;
  border-color: #CBD5E1;
}

.side-obj-line {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 800;
  color: #243B1C;
}

.offline-row-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.offline-chip-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* Speed + Pause Row (extra width for Pause so it never wraps mid-word!) */
.speed-row {
  display: grid;
  grid-template-columns: 0.78fr 0.78fr 0.78fr 1.42fr;
  gap: 5px;
}
.speed-row > * {
  min-width: 0;
  padding: 2px 3px;
  min-height: 36px;
  border-width: 5px 6px 6px 6px;
  font-size: 13px;
}
.btn-speed.is-active {
  background-color: #E99F0F;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_secondary.png') 77 84 84 90 fill / 6px 9px 7px 9px / 0 stretch;
  color: #181822;
  -webkit-text-stroke: 0px transparent;
  text-shadow: none;
  outline: 2px solid #FFF8E7;
}

/* 10-Wave Boss Timeline */
.wave-pips-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
  margin-top: 3px;
}
.wave-pip {
  height: 22px;
  border-radius: 5px;
  border: 2px solid var(--comic-ink);
  background: #D8C49E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  color: #2A1810;
}
.wave-pip.cleared {
  background: #44B848;
  color: #14121F;
}
.wave-pip.current {
  background: #FFE14D;
  color: #1D141F;
  transform: scale(1.06);
}
.wave-pip.boss-node {
  border-color: #7A1520;
  background: #F4B8C0;
  color: #54101A;
}
.wave-pip.boss-node.current {
  background: #CF3435;
  color: #FFFFFF;
}

/* Wheel & Sprinkler Control Deck */
.rotate-btn-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}
.rotate-btn-row > * {
  min-width: 0;
  min-height: 38px;
  padding: 4px 5px;
  font-size: 13px;
}

.overdrive-btn {
  width: 100%;
  min-height: 44px;
  position: relative;
}

.ult-ready-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.ult-ready-strip > * {
  min-width: 0;
  min-height: 38px;
  padding: 2px 4px;
  border-width: 5px 6px 6px 6px;
  gap: 4px;
  font-size: 12.5px;
}

/* Meta Navigation Grid in Sidebar */
.meta-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
  padding-top: 2px;
}
.meta-nav-grid > * {
  min-width: 0;
  max-width: 100%;
  padding: 4px 6px;
  min-height: 40px;
  font-size: 13px;
}
.meta-span-2 {
  grid-column: 1 / -1;
}

.wheel-preview-pill {
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #FFF8E7;
  border: 2px solid #0A2685;
  font-size: 13px;
  font-weight: 800;
  color: #1D141F;
  text-align: center;
}
.wheel-preview-pill.hidden {
  display: none !important;
}

/* ==========================================================================
   PILLAR 3 — SPOTLIGHT RING + ANIMATED DRAG POINTER (`tut-hand`) & 3-ICON GUIDE
   ========================================================================== */
.tut-visual-layer {
  position: fixed;
  inset: 0;
  z-index: 84;
  pointer-events: none !important;
}
.tut-visual-layer.hidden {
  display: none !important;
}

.tut-spotlight-ring {
  position: fixed;
  pointer-events: none !important;
  border-radius: 16px;
  border: 3.5px solid #FFE14D;
  outline: 2.5px solid rgba(20, 14, 26, 0.72);
  will-change: transform;
  animation: tutRingPulse 1.3s infinite ease-in-out;
}
.tut-spotlight-ring.tut-ring-dest {
  border-style: dashed;
  border-radius: 50%;
  border-color: #7CE8FF;
}

.is-software-gl .tut-spotlight-ring,
.is-software-gl .notify-badge {
  animation: none !important;
}

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

.tut-hand {
  position: fixed;
  left: 0;
  top: 0;
  width: 56px;
  height: 56px;
  pointer-events: none !important;
  z-index: 86;
  will-change: transform;
}

.tut-hand.is-dragging {
  animation: tutDragMotion 1.7s infinite cubic-bezier(0.28, 0.84, 0.42, 1);
}

.tut-hand.is-tapping {
  animation: tutTapMotion 0.95s infinite ease-in-out;
}

@keyframes tutDragMotion {
  0% { transform: translate3d(var(--tut-x0, 160px), var(--tut-y0, 960px), 0); }
  14% { transform: translate3d(var(--tut-x0, 160px), calc(var(--tut-y0, 960px) + 4px), 0); }
  68% { transform: translate3d(var(--tut-x1, 320px), var(--tut-y1, 480px), 0); }
  84% { transform: translate3d(var(--tut-x1, 320px), var(--tut-y1, 480px), 0); }
  100% { transform: translate3d(var(--tut-x0, 160px), var(--tut-y0, 960px), 0); }
}

@keyframes tutTapMotion {
  0%, 100% { transform: translate3d(var(--tut-x0, 200px), var(--tut-y0, 300px), 0); }
  50% { transform: translate3d(var(--tut-x0, 200px), calc(var(--tut-y0, 300px) - 8px), 0); }
}

#tutorial-overlay {
  position: fixed;
  bottom: 96px;
  left: 16px;
  z-index: 85;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background-color: #EDD5A7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 14px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_subpanel.png') 76 90 75 88 fill / 10px 14px / 0 stretch;
  pointer-events: none;
  contain: layout style paint;
}
#tutorial-overlay.hidden {
  display: none !important;
}
#tutorial-overlay .tut-skip-btn {
  pointer-events: auto;
  min-height: 34px;
  padding: 3px 10px;
  font-size: 13px;
}
.tut-cue-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}
.tut-cue-copy {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tut-step-pill {
  padding: 2px 7px;
  border-radius: 999px;
  background: #2E1F15;
  color: #FFE14D;
  font-family: var(--font-display);
  font-size: 13px;
}
.tut-cue-label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: #1D141F;
  letter-spacing: 0.02em;
}

/* 3-Icon Visual Coach Flow Strip (`js/feature_guides.js`) */
.guide-flow-strip {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  padding: 6px 2px;
}
.guide-flow-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 8px;
  text-align: center;
}
.guide-step-num {
  position: absolute;
  top: -8px;
  left: -6px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #FFE14D;
  border: 2px solid #140E1A;
  color: #140E1A;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  line-height: 22px;
  z-index: 4;
}
.guide-art-stage {
  width: 100%;
  height: 84px;
  border-radius: 10px;
  background: rgba(255, 248, 231, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}
.guide-art-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.38));
}
.guide-step-caption {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.15;
}
.rarity-rare .guide-step-caption,
.rarity-epic .guide-step-caption,
.rarity-common .guide-step-caption {
  color: #FFF8E7;
  -webkit-text-stroke: 1.1px #140E1A;
  paint-order: stroke fill;
}
.rarity-legendary .guide-step-caption {
  color: #181822;
}
.guide-flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: #FFE14D;
  text-shadow: 0 3px 0 #140E1A;
  flex-shrink: 0;
}

/* ==========================================================================
   MODALS — `ornate_storybook_rpg` 9-Slice Windows + Anti-SaaS 60/25/15 Grids
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(14, 10, 20, 0.80);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-backdrop.hidden {
  display: none !important;
}

.modal-window {
  position: relative;
  width: min(940px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  overflow: hidden;
  contain: layout style paint;
  will-change: transform, opacity;
}

.modal-window.modal-md {
  width: min(720px, 94vw);
}

.modal-window.modal-sm {
  width: min(560px, 92vw);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(242, 176, 41, 0.35);
  margin-bottom: 10px;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 2vw, 29px);
  color: #FFE14D;
  -webkit-text-stroke: 1.8px #140E1A;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #140E1A;
}

.modal-sub-caption {
  font-size: 13.5px;
  font-weight: 700;
  color: #EDE2CE;
  margin-top: 2px;
}

.modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 4px 4px 2px;
  flex: 1 1 auto;
}
#modal-draft .modal-body {
  overflow-y: hidden;
  overflow-x: hidden;
  padding: 12px 10px 10px;
}

/* Symmetrical Overflow-Safe Grids */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.grid-4 > *, .grid-3 > *, .grid-2 > * {
  min-width: 0;
  max-width: 100%;
}

/* Tabs (`tab_active.png` + `btn_disabled.png`) */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

/* 5-Tab Compact Single-Row Seasons Hub Bar (`flex-wrap: nowrap` safe at 1280x720 across 9 langs!) */
.seasons-tab-bar {
  flex-wrap: nowrap !important;
  gap: 5px;
  overflow: hidden;
}
.seasons-tab-bar .tab-btn {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  padding: 4px 6px;
  min-height: 36px;
  border-width: 6px 8px 6px 8px;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden !important;
  text-overflow: ellipsis;
}
.seasons-tab-bar .tab-btn.active {
  border-width: 7px 9px 4px 9px;
}

/* One-click Cosmetic Theme / Trail Swatch Strip inside S4/S5 Visual Cards */
.sh-swatch-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin: 1px 0;
}
.sh-swatch-btn {
  flex: 1 1 0;
  min-width: 28px;
  height: 22px;
  padding: 0 3px;
  border-radius: 6px;
  border: 2px solid #140E1A;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: #FFF8E7;
  text-shadow: 0 1px 0 #140E1A;
  transition: transform 0.1s ease;
}
.sh-swatch-btn:hover {
  transform: translateY(-1px);
}
.sh-swatch-btn.is-active {
  border-color: #FFE14D;
  outline: 2px solid #FFF8E7;
}
.sh-swatch-btn.is-locked {
  opacity: 0.48;
  filter: grayscale(0.5);
}

.tab-btn {
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  min-height: 40px;
  background-color: #5A5260;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-radius: 0;
  border-width: 7px 14px 7px 14px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/btn_disabled.png') 77 84 75 90 fill / 7px 14px 7px 14px / 0 stretch;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: #F4ECE0;
  -webkit-text-stroke: 1px #140E1A;
  paint-order: stroke fill;
  cursor: pointer;
}

.tab-btn.active {
  background-color: #7A3F1E;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/tab_active.png') 48 129 18 127 fill / 9px 16px 5px 16px / 0 stretch;
  color: #FFE14D;
  -webkit-text-stroke: 1.2px #140E1A;
  paint-order: stroke fill;
  transform: translateY(-1px);
}

/* ==========================================================================
   PILLAR 5 — VISUAL-FIRST CARDS (Quest Passes, Shop, Seasons, Greenhouse, Draft)
   ========================================================================== */
.sh-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.sh-grid > * {
  min-width: 0;
  max-width: 100%;
}

.season-card,
.shop-pack-card,
.perk-card {
  position: relative;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  background-color: #EDD5A7;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 12px 11px 11px 11px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/frame_subpanel.png') 76 90 75 88 fill / 12px 11px 11px 11px / 0 stretch;
  color: #1D141F;
}

.perk-card {
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s ease;
}
.perk-card:hover {
  transform: translateY(-4px);
}
.perk-hotkey {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 6;
}

.sh-art-stage,
.shop-art-stage {
  width: 100%;
  height: 104px;
  border-radius: 10px;
  background: rgba(255, 248, 231, 0.18);
  border: 1.5px solid rgba(255, 248, 231, 0.24);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rarity-legendary .sh-art-stage,
.rarity-legendary .shop-art-stage {
  background: rgba(255, 252, 235, 0.42);
  border-color: rgba(110, 66, 38, 0.32);
}

.sh-art-img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 92px;
  object-fit: contain;
}

.shop-art-stage {
  height: 82px;
}
.shop-pack-art {
  width: 100%;
  height: 76px;
  object-fit: contain;
}

.sh-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.sh-title,
.shop-pack-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14.5px;
  line-height: 1.14;
  color: inherit;
}

.rarity-common .sh-title,
.rarity-rare .sh-title,
.rarity-epic .sh-title,
.rarity-common .shop-pack-name,
.rarity-rare .shop-pack-name,
.rarity-epic .shop-pack-name {
  color: #FFF8E7;
  -webkit-text-stroke: 1.1px #140E1A;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #140E1A;
}

.rarity-legendary .sh-title,
.rarity-legendary .shop-pack-name {
  color: #181822;
  -webkit-text-stroke: 0px transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.sh-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
  color: inherit;
  flex-shrink: 0;
}

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

.sh-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background-color: #FFF6DC;
  border: 1.5px solid #6E4226;
  font-size: 13px;
  font-weight: 800;
  color: #1D141F !important;
  -webkit-text-stroke: 0px transparent !important;
  text-shadow: none !important;
}
.sh-chip-ico {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.sh-act-btn,
.shop-buy-btn {
  min-height: 38px;
  padding: 4px 8px;
  font-size: 13px;
  width: 100%;
}

/* Shop Top Daily Banner + 3x3 Grid */
.shop-daily-banner,
.gh-yield-banner,
.qp-hero-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  margin-bottom: 12px;
}
.shop-sku-grid {
  padding-top: 8px;
}
.shop-gift-left,
.qp-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 280px;
  min-width: 0;
}
.shop-gift-ico {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}
.shop-gift-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.shop-gift-title,
.gh-banner-title,
.qp-hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  color: #1D141F;
}

.shop-pack-badge {
  position: absolute;
  top: -15px;
  left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #CF3435;
  border: 2px solid #140E1A;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11.5px;
  z-index: 6;
}
.shop-pack-badge.badge-best { background: #FFE14D; color: #140E1A; }
.shop-pack-badge.badge-starter { background: #44B848; color: #FFFFFF; -webkit-text-stroke: 0.8px #140E1A; paint-order: stroke fill; }

/* Quest Passes Hub Hero Banner & Ornate Progress Bar */
.qp-hero-art {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}
.qp-hero-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qp-hero-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.qp-status-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.qp-status-tag.is-prem {
  background: #44B848;
  color: #FFFFFF;
  border: 1.5px solid #140E1A;
}
.qp-status-tag.is-free {
  background: #2E1F15;
  color: #FFE14D;
  border: 1.5px solid #8C5327;
}
.qp-subswitch {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}
.qp-sub-btn {
  padding: 3px 10px;
  border-radius: 999px;
  border: 2px solid #5A351C;
  background: #FFF6DC;
  color: #2A1810;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
}
.qp-sub-btn.active {
  background: #0A2685;
  border-color: #140E1A;
  color: #FFE14D;
}
.qp-meter-shell {
  position: relative;
  width: 100%;
  height: 24px;
  background-color: #28211C;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 5px 14px 5px 12px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/bar_track.png') 55 235 54 170 fill / 5px 14px 5px 12px / 0 stretch;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qp-meter-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #44B848 0%, #F2B029 100%);
  transition: width 0.2s ease-out;
}
.qp-meter-txt {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: #FFFFFF;
  -webkit-text-stroke: 1.1px #140E1A;
  paint-order: stroke fill;
}
.qp-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   PILLAR 6 — VICTORY 3-STAR SLAM + ICON SETTINGS SLIDERS & SWITCHES
   ========================================================================== */
.vic-sunburst-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 82px;
  margin: 0 auto 4px;
}
#vic-star-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
.vic-ribbon-banner {
  display: inline-block;
  padding: 4px 20px;
}
.vic-ribbon-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, 1.9vw, 27px);
  color: #1D141F;
}
.vic-loot-ico {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}
.vic-cta-strip {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}
.vic-cta-strip-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.vic-next-cta {
  min-height: 52px;
  font-size: 17px;
}

/* Settings Rows, Icon Sliders & Switches */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  margin-bottom: 7px;
}
.settings-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.settings-svg-ico {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-label {
  font-weight: 800;
  font-size: 14.5px;
  color: #1D141F;
}
.settings-ctrl-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.storybook-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 118px;
  height: 12px;
  border-radius: 999px;
  background: #2E1F15;
  border: 2px solid #8C5327;
  outline: none;
  cursor: pointer;
}
.storybook-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFE14D;
  border: 2.5px solid #140E1A;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.settings-switch-btn {
  min-width: 72px;
  min-height: 36px;
  padding: 3px 10px;
  font-size: 13px;
}
.storybook-input {
  flex: 1;
  min-width: 0;
  max-width: 180px;
  padding: 6px 10px;
  background: #FFF8E7;
  color: #1D141F;
  border: 2px solid #5A351C;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 13.5px;
}

/* Floating Toast */
#toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 130;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.game-toast {
  pointer-events: none;
  padding: 7px 16px;
  background-color: #2E1F15;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 8px 14px;
  border-image: url('../assets/ui/vault_ornate_storybook_rpg/hud_pill.png') 45 80 56 78 fill / 8px 14px / 0 stretch;
  color: #FFE14D;
  font-family: var(--font-display);
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   1280x720 COMPACT SINGLE-ROW HUD GUARD (9-Language Zero-Wrap / Zero-Clip!)
   ========================================================================== */
@media (max-width: 1460px) {
  #screen-game {
    grid-template-columns: minmax(0, 1fr) 302px;
  }
  .tactical-sidebar {
    width: 302px;
    padding: 6px 8px;
    gap: 5px;
  }
  .arena-top-hud {
    top: 6px;
    left: 8px;
    right: 8px;
    gap: 4px;
  }
  .hud-cluster {
    gap: 4px;
  }
  .stat-pill {
    min-height: 34px;
    padding: 2px 5px;
    border-width: 5px 7px 5px 7px;
    font-size: 12.5px;
    gap: 4px;
  }
  .stat-pill > .ui-icon {
    width: 20px;
    height: 20px;
    margin-left: -2px;
  }
  .mini-meter {
    width: 50px;
    height: 12px;
  }
  .hud-util-btn {
    min-height: 34px;
    padding: 2px 5px;
    border-width: 5px 6px 5px 6px;
    font-size: 12px;
  }
  .hud-util-btn .btn-label {
    white-space: nowrap;
  }
  .arena-bottom-dock {
    bottom: 6px;
    left: 8px;
    right: 8px;
    gap: 5px;
    padding: 3px 5px;
    border-width: 7px 9px;
  }
  .crop-buy-card {
    padding: 2px 4px;
    border-width: 4px 5px;
    min-height: 48px;
    max-height: 54px;
    gap: 4px;
  }
  .crop-card-thumb {
    width: 40px;
    height: 40px;
    border-width: 2px;
  }
  .crop-card-title {
    font-size: 11.5px;
  }
  :lang(ja) .crop-card-title,
  :lang(de) .crop-card-title,
  :lang(ru) .crop-card-title {
    font-size: 10.5px;
  }
  .crop-card-meta {
    font-size: 11.5px;
  }
  .dock-tools-cluster {
    gap: 3px;
  }
  .dock-tools-cluster .hotkey-pill {
    display: none;
  }
  .dock-tools-cluster .btn-game {
    min-height: 40px;
    padding: 2px 5px;
    border-width: 5px 6px 5px 6px;
    font-size: 11.5px;
    gap: 3px;
  }
  #btn-start-wave {
    min-width: 84px !important;
  }
  .side-card {
    padding: 3px 6px;
    border-width: 7px 9px;
  }
  .rotate-btn-row > *,
  .ult-ready-strip > *,
  .meta-nav-grid > * {
    border-width: 4px 6px 5px 6px;
    padding: 2px 4px;
    min-height: 33px;
    font-size: 12px;
  }
  #tutorial-overlay {
    bottom: 88px;
    left: 10px;
  }
}

/* Narrow fallback (< 980px) */
@media (max-width: 980px) {
  #screen-game {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .tactical-sidebar {
    width: 100vw;
    height: auto;
    max-height: 34vh;
    border-left: none;
    border-top: 4px solid #C88B32;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .tactical-sidebar .side-card {
    flex: 1 1 220px;
  }
  .title-center-stage {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .title-brand-col {
    align-items: center;
  }
  .grid-4, .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
