/* ==========================================================================
   Brightcart Corner 3D — UI Vault `vibrant_popout_tycoon` 16:9 Stylesheet
   Target Style: vibrant_popout_tycoon (Chunky 3D Pop-out Frames, Daylight Jewel)
   Strict WebView2 Hygiene:
     - 100% Offline Font Stack (ZERO external Google Fonts!)
     - ZERO backdrop-filter: blur()! ZERO ctx.shadowBlur!
     - overflow: visible !important on all buttons & badged/pop-out elements!
     - >= 20 genuine 9-slice UI Vault regions, >= 13px HUD typography!
   ========================================================================== */

:root {
  --caramel: #DDAC7E;
  --wood-mid: #3B6998;
  --wood-deep: #181C2E;
  --cream-bg: #F4F7FC;
  --cream-bright: #FFFDF5;
  --pos-blue: #0179FC;
  --pos-blue-dark: #0A469E;
  --tip-green: #5AD814;
  --tip-green-dark: #2B7A08;
  --alert-red: #FF4B5C;
  --alert-red-dark: #A61C2B;
  --ink-navy: #181C2E;
  --ink-outline: #121524;
  --mint-soft: #9ED2C9;
  --gold-sunny: #FFD52E;
  --gold-dark: #B57A00;
  --uv-purple: #9B4DFF;
  --uv-purple-dark: #5B1EB8;

  --font-display: 'Lilita One', 'Fredoka', 'Trebuchet MS', 'Segoe UI Black', sans-serif;
  --font-hud: 'Baloo 2', 'Fredoka', 'Nunito', 'Segoe UI', sans-serif;
  --font-body: 'Baloo 2', 'Nunito', 'Segoe UI', sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1A2236;
  color: var(--ink-navy);
  font-family: var(--font-body);
  font-size: 14px;
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   GENUINE `vibrant_popout_tycoon` 9-SLICE CHROME (>= 20 Regions)
   ========================================================================== */
.ui-panel-9s {
  background-color: #FDFBF3;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 19px 20px 25px 20px;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/frame_modal.png') 56 57 74 58 fill / 19px 20px 25px 20px / 0 stretch;
  color: var(--ink-navy);
}

.ui-card-9s {
  background-color: #F5F6F6;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 11px 11px 16px 11px;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/card_common.png') 59 58 93 58 fill / 11px 11px 16px 11px / 0 stretch;
  color: var(--ink-navy);
}

.ui-ribbon-9s {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 20px 6px;
  background-color: #016CFB;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 14px 24px 14px 24px;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/ribbon_header.png') 89 111 79 110 fill / 14px 24px 14px 24px / 0 stretch;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  text-shadow: 0 2px 0 var(--ink-outline);
}

.ui-pill-9s {
  position: relative;
  overflow: visible !important;
  background-color: #1F2E45;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 9px 14px 9px 14px;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/hud_pill.png') 54 74 52 75 fill / 9px 14px 9px 14px / 0 stretch;
  color: #FFFFFF;
}

.ui-claim-banner-9s {
  background-color: #FDD41D;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 16px 18px 20px 18px;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/card_claim_banner.png') 99 89 110 89 fill / 16px 18px 20px 18px / 0 stretch;
  color: var(--ink-navy);
}

.ui-bar-track-9s {
  position: relative;
  border-style: solid;
  border-color: transparent;
  border-width: 8px 10px 8px 10px;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/bar_track.png') 46 48 46 57 fill / 8px 10px 8px 10px / 0 stretch;
  padding: 0;
  overflow: hidden;
}

/* ==========================================================================
   CHUNKY 3D POP-OUT BUTTONS (4 Genuine 9-Slice States + Overflow Safety)
   ========================================================================== */
button {
  position: relative;
  overflow: visible !important;
  cursor: pointer;
  font-family: var(--font-hud);
  font-weight: 800;
  font-size: 13.5px;
  transition: transform 0.09s ease, filter 0.12s ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.05);
}

button:active:not(:disabled) {
  transform: translateY(2px) scale(0.98);
}

button:disabled {
  cursor: not-allowed;
}

button .btn-label {
  display: inline-block;
  max-width: 100%;
  overflow: visible;
  white-space: normal;
  line-height: 1.14;
  vertical-align: middle;
}

.btn-glossy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 4px 12px 6px;
  border-style: solid;
  border-color: transparent;
  border-width: 10px 12px 14px 12px;
  font-size: 14px;
  line-height: 1.14;
  text-align: center;
}

/* State 1: Primary Lime Green 9-Slice */
.btn-glossy-green {
  background-color: #69EF05;
  background-clip: padding-box;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/btn_primary.png') 67 58 91 59 fill / 10px 12px 14px 12px / 0 stretch;
  color: #141824;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

/* State 2: Secondary Electric Violet/Blue 9-Slice */
.btn-glossy-blue,
.btn-glossy-purple {
  background-color: #8228E8;
  background-clip: padding-box;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/btn_secondary.png') 66 55 92 56 fill / 10px 12px 14px 12px / 0 stretch;
  color: #FFFFFF;
  text-shadow: 0 2px 0 rgba(18, 21, 36, 0.85);
}

/* State 3: Claim / VIP Sunny Gold 9-Slice */
.btn-glossy-gold {
  background-color: #FDCB0D;
  background-clip: padding-box;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/btn_claim.png') 54 51 103 77 fill / 10px 12px 14px 14px / 0 stretch;
  color: #181C2E;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

/* Neutral Cream / Slate Tactile Button */
.btn-glossy-cream {
  background-color: #A2B2C4;
  background-clip: padding-box;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/btn_disabled.png') 57 62 95 65 fill / 9px 11px 13px 11px / 0 stretch;
  color: #141824;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Danger / Alert Chunky Red Button */
.btn-glossy-red {
  background: linear-gradient(180deg, #FF6B7A 0%, var(--alert-red) 58%, #D92638 100%);
  border: 3px solid var(--ink-outline);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--alert-red-dark), inset 0 2px 0 rgba(255, 255, 255, 0.48);
  color: #FFFFFF;
  text-shadow: 0 2px 0 rgba(18, 21, 36, 0.8);
}

/* State 4: Disabled 9-Slice */
.btn-glossy:disabled {
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/btn_disabled.png') 57 62 95 65 fill / 9px 11px 13px 11px / 0 stretch;
  background: transparent;
  box-shadow: none;
  color: #2B3345;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  opacity: 0.72;
}

.btn-sm {
  min-height: 36px;
  padding: 2px 9px 4px;
  border-width: 8px 10px 11px 10px;
  font-size: 13.5px;
}

.btn-xs {
  min-height: 32px;
  padding: 2px 7px 3px;
  border-width: 7px 9px 10px 9px;
  font-size: 13px;
}

.btn-glossy-red.btn-sm,
.btn-glossy-red.btn-xs {
  border-width: 2.5px;
  padding: 4px 10px;
}

.btn-icon-pop {
  width: 26px;
  height: 26px;
  margin: -6px 2px -6px -6px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}
.btn-icon-sm { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.btn-icon-xs { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }

/* Reactive Red-Dot Badge (`js/notify.js`) — NEVER clipped! */
.notify-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 35;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--alert-red);
  border: 2.5px solid #FFFFFF;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(20, 20, 28, 0.45);
  animation: pulseBadge 1.4s infinite ease-in-out;
}

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

/* ==========================================================================
   PILLAR 1: FULL-BLEED 100vw×100vh HEROIC NO-BOX TITLE SCREEN
   ========================================================================== */
.title-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 5vw 28px;
}

.title-bg-art {
  position: absolute;
  inset: 0;
  background: url('../assets/art/title_bg.jpg') center center / cover no-repeat;
}

.title-warm-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 62% 68% at 64% 50%, rgba(16, 24, 44, 0.56) 0%, rgba(16, 24, 44, 0.18) 65%, rgba(16, 24, 44, 0.36) 100%),
    linear-gradient(180deg, rgba(18, 24, 42, 0.28) 0%, rgba(18, 24, 42, 0.08) 45%, rgba(18, 24, 42, 0.52) 100%);
}

/* Compact Top-Right Corner Utilities */
.title-corner-utils {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-title-util {
  min-height: 42px;
  padding: 4px 14px 6px;
  font-size: 14px;
}

/* Transparent Heroic Stage — ZERO background, ZERO border! */
.title-stage-grid {
  position: relative;
  z-index: 3;
  width: min(1380px, 94vw);
  display: grid;
  grid-template-columns: minmax(290px, 0.86fr) minmax(380px, 1.14fr);
  gap: 36px;
  align-items: center;
  background: transparent;
  border: none;
}

.title-showcase-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.title-sun-halo {
  position: absolute;
  width: 380px;
  height: 380px;
  top: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 110, 0.78) 0%, rgba(255, 185, 60, 0.22) 48%, rgba(255, 185, 60, 0) 72%);
  pointer-events: none;
}

.title-portrait-host {
  position: relative;
  width: min(390px, 34vw);
  height: min(390px, 34vw);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.title-hero-portrait {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: 50% 94%;
  filter: drop-shadow(0 14px 22px rgba(18, 21, 36, 0.52));
}

.title-mascot-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px 6px 12px;
}

.popout-pill-icon {
  width: 36px;
  height: 36px;
  margin: -10px 2px -10px -14px;
  object-fit: contain;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.4));
}

.mascot-copy {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: #DCE8FF;
}
.mascot-copy strong {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--gold-sunny);
}

/* Floating Right Logo Cluster — STRICTLY NO BOX! */
.title-hero-focal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
}

.title-ribbon {
  font-size: 15px;
  padding: 5px 28px 7px;
}

.game-logo-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(54px, 4.9vw, 72px);
  line-height: 1.02;
  letter-spacing: 0.015em;
  color: #FFFDF5;
  -webkit-text-stroke: 3.5px #181C2E;
  paint-order: stroke fill;
  text-shadow:
    0 4px 0 #B56200,
    0 8px 0 #181C2E,
    0 14px 26px rgba(12, 16, 30, 0.65);
}

.game-logo-sub {
  margin: 0;
  font-family: var(--font-hud);
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 800;
  color: #FFFDF5;
  max-width: 620px;
  text-shadow: 0 2px 0 #181C2E, 0 4px 12px rgba(12, 16, 30, 0.78);
}

.title-feature-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.feat-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-hud);
  font-size: 13.5px;
  font-weight: 800;
  border: 3px solid var(--ink-outline);
  box-shadow: 0 4px 0 rgba(18, 21, 36, 0.55);
}
.tag-ico { width: 20px; height: 20px; object-fit: contain; margin-left: -4px; }
.feat-blue { background: #E6F3FF; color: #0B4696; }
.feat-green { background: #E6FCD9; color: #1E6309; }
.feat-gold { background: #FFF4C2; color: #6E4200; }

.title-loading-wrap {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.loading-bar-outer { height: 28px; width: 100%; }
.loading-bar-inner {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5AD814, #B8F711);
  transition: width 0.18s ease;
}
.loading-label {
  font-family: var(--font-hud);
  font-size: 14px;
  font-weight: 800;
  color: #FFFDF5;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);
}

.title-ready-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4px;
}

.title-play-cta {
  min-width: 296px;
  min-height: 66px;
  padding: 6px 36px 10px;
  border-width: 15px 18px 21px 18px;
  font-family: var(--font-display);
  font-size: clamp(23px, 2vw, 29px);
  letter-spacing: 0.04em;
  color: #141C0C;
  text-shadow: 0 1.5px 0 rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0 10px 18px rgba(12, 18, 32, 0.48));
}

/* ==========================================================================
   PILLAR 2: FULL-BLEED 3D VIEWPORT & COMPACT FLOATING DIEGETIC HUD
   ========================================================================== */
.game-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.viewport-3d {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: auto;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.idle-overlay-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 28;
  pointer-events: none;
}

/* Floating Single-Row Top HUD (NO opaque SaaS bar! Strictly nowrap!) */
.top-hud-ribbon {
  position: relative;
  z-index: 20;
  min-height: 54px;
  padding: 8px 14px 2px;
  background: transparent;
  border: none;
  display: flex;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

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

.hud-venue-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  font-family: var(--font-hud);
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
}
.venue-badge {
  color: #FFFDF5;
  font-weight: 800;
}
.shift-tag {
  background: rgba(255, 213, 46, 0.22);
  color: var(--gold-sunny);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.hud-goal-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 146px;
  padding: 2px 10px 4px;
}
.goal-top-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #FFFDF5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.goal-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(10, 14, 24, 0.72);
  overflow: hidden;
}
.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-sunny), var(--tip-green));
  transition: width 0.22s ease;
}

.currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 8px;
  font-family: var(--font-hud);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pill-bucks {
  cursor: pointer;
  padding-right: 12px;
}
.curr-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.curr-icon.pop-left {
  margin: -7px 2px -7px -12px;
}
.curr-icon-sm {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin-left: -4px;
}
.plus-chip {
  background: var(--tip-green);
  color: #141824;
  font-size: 13px;
  font-weight: 900;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
}

.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  font-family: var(--font-hud);
  font-size: 13.5px;
  color: var(--gold-sunny);
  white-space: nowrap;
}

.cam-pill-group {
  display: inline-flex;
  flex-wrap: nowrap;
  background: rgba(20, 28, 46, 0.92);
  border-radius: 14px;
  padding: 3px;
  gap: 2px;
  border: 2.5px solid var(--ink-outline);
  box-shadow: 0 4px 0 rgba(18, 21, 36, 0.45);
}
.cam-btn {
  border: none;
  background: transparent;
  color: #D6E4FF;
  padding: 4px 8px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.cam-btn .btn-label {
  white-space: nowrap;
}
.cam-btn.active {
  background: linear-gradient(180deg, #3DA0FF 0%, var(--pos-blue) 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 0 var(--pos-blue-dark);
}

.btn-icon-round {
  border: 2.5px solid var(--ink-outline);
  background: rgba(24, 34, 56, 0.92);
  color: #FFFFFF;
  border-radius: 12px;
  padding: 5px 9px;
  min-height: 34px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(18, 21, 36, 0.45);
}
.btn-icon-round .btn-label { white-space: nowrap; }
.btn-icon-round.haptics-off {
  color: #B8C7E0;
}

/* Compact Floating Left/Right Workspace Docks (<= 25% total width at 1080p!) */
.workspace-columns {
  position: relative;
  z-index: 10;
  flex: 1;
  min-height: 0;
  padding: 6px 12px 10px;
  display: grid;
  grid-template-columns: 214px 1fr 252px;
  gap: 12px;
  pointer-events: none;
}

.wing-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: visible;
  pointer-events: auto;
  padding: 2px 2px 4px;
}

.glass-card {
  padding: 7px 9px 9px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}
.card-head-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
#basket-count-chip {
  padding: 1px 5px;
  font-size: 13px;
  flex-shrink: 0;
}
#btn-scan-next {
  min-height: 30px;
  padding: 1px 6px 2px;
  border-width: 6px 8px 9px 8px;
  font-size: 13px;
  flex-shrink: 0;
  white-space: nowrap;
}
#btn-scan-next .btn-label {
  white-space: nowrap;
}
.chip-pill.chip-done {
  background: #DCFCE7;
  border-color: #22C55E;
  color: #14532D;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14.5px;
  letter-spacing: 0.02em;
  color: var(--ink-navy);
}

.chip-pill {
  background: #E6F0FF;
  border: 2px solid #93C5FD;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 13px;
  font-weight: 800;
  color: #0B4696;
  white-space: nowrap;
}

/* Queue & Shelf Bars (`#3468`: all 4 queue rows unclipped!) */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 184px;
  overflow-y: auto;
}
.queue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 3px 7px;
  min-height: 26px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.18;
  white-space: nowrap;
}
.queue-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.queue-row > span:last-child {
  flex-shrink: 0;
}
.queue-row.active-head {
  border-color: var(--pos-blue);
  background: #E8F3FF;
}
.story-clue-dot {
  background: var(--gold-sunny);
  color: var(--ink-navy);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.shelf-stock-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shelf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 36px;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
}
.shelf-mini-track {
  height: 8px;
  background: #CBD5E1;
  border-radius: 999px;
  overflow: hidden;
}
.shelf-mini-fill {
  height: 100%;
  background: var(--tip-green);
  transition: width 0.2s ease;
}
.shelf-mini-fill.low { background: var(--alert-red); }

.security-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.security-btn-grid > * { min-width: 0; max-width: 100%; }
#btn-panic-alarm { grid-column: span 2; }

.status-ok {
  background: #DCFCE7;
  color: #14532D;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}
.status-alert {
  background: #FEE2E2;
  color: #991B1B;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  animation: pulseBadge 0.8s infinite;
}
.radar-note {
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #991B1B;
}

/* Compact Meta Dock Buttons */
.meta-dock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  align-content: start;
  gap: 8px;
  margin-top: auto;
  padding: 10px 4px 2px 2px;
  overflow: visible;
}
.meta-dock-grid > * { min-width: 0; max-width: 100%; }
.meta-btn {
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
  padding: 2px 3px 4px;
  border-width: 7px 6px 10px 6px;
  font-size: 13px;
}
.meta-btn .btn-icon-sm {
  width: 30px;
  height: 30px;
}
.meta-btn.span-2 {
  grid-column: span 2;
  flex-direction: row;
  gap: 6px;
}

/* Center Stage Corridor */
.center-stage-corridor {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.floating-toast-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.toast-pill {
  background: var(--ink-navy);
  color: #FFFDF5;
  border: 3px solid var(--gold-sunny);
  border-radius: 999px;
  padding: 6px 18px;
  font-family: var(--font-hud);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.35);
}

.fever-cutin-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px;
  filter: drop-shadow(0 8px 18px rgba(18, 21, 36, 0.42));
}
.fever-portrait { width: 52px; height: 52px; object-fit: contain; }
.fever-copy { display: flex; flex-direction: column; }
.fever-copy strong { font-family: var(--font-display); font-size: 20px; color: var(--ink-navy); }
.fever-copy span { font-size: 13.5px; font-weight: 800; color: #3B2804; }

/* Contextual Drink / Produce / UV / Lottery Mini-Dock */
.station-mini-dock {
  pointer-events: auto;
  width: min(490px, 96%);
  padding: 10px 14px;
  margin-bottom: 6px;
  filter: drop-shadow(0 8px 18px rgba(18, 21, 36, 0.35));
}

.pour-meter-track {
  position: relative;
  height: 26px;
  background: #182238;
  border-radius: 13px;
  border: 2.5px solid var(--ink-outline);
  overflow: hidden;
  margin: 8px 0;
}
.pour-band-good {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(158, 210, 201, 0.36);
}
.pour-band-perfect {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(90, 216, 20, 0.68);
  border-left: 2px solid #FFF;
  border-right: 2px solid #FFF;
}
.pour-fill-bar {
  height: 100%;
  background: linear-gradient(90deg, #FF9E2C, #FFD52E);
  width: 0%;
}
.station-btn-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.scale-lcd-chip {
  background: #0B1F1E;
  color: #4ADE80;
  border: 2px solid #22C55E;
  border-radius: 8px;
  padding: 2px 9px;
  font-family: monospace;
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
}
.scale-standby-sub {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin: 2px 0 4px;
}

.uv-bill-card {
  position: relative;
  background: #E4F0DC;
  border: 3px dashed #3F6235;
  border-radius: 12px;
  padding: 9px 12px;
  margin: 6px 0;
  font-family: monospace;
  font-size: 13px;
  color: #1E3A1E;
}
.uv-bill-card.uv-lit {
  background: #2E1065;
  border-color: #C084FC;
  color: #F3E8FF;
}

/* Right Wing: Dialogue, Basket & POS Cash Drawer */
.patron-header {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.patron-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #E8F1FF;
  border: 2.5px solid var(--pos-blue);
  object-fit: contain;
  flex-shrink: 0;
}
.patron-meta { flex: 1; min-width: 0; }
.patron-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.patron-name-row strong {
  font-family: var(--font-display);
  font-size: 14.5px;
  color: var(--ink-navy);
}
.arch-tag {
  font-size: 13px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: #E0F2FE;
  color: #075985;
  border: 1.5px solid #7DD3FC;
}
.patron-speech {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.24;
  color: var(--ink-navy);
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: 10px;
  padding: 5px 7px;
}

.dialogue-choices {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dialogue-choices.hidden,
.dialogue-choices[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.dialogue-card.banter-collapsed .patron-speech {
  display: none !important;
}
.dialogue-card.banter-collapsed .patron-header {
  margin-bottom: 2px;
}
.dialogue-card.banter-collapsed .dialogue-outcome {
  margin-top: 2px;
  padding: 3px 7px;
  font-size: 13px;
}
.tone-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  border-radius: 10px;
  border: 2px solid var(--ink-outline);
  font-size: 13px;
  font-weight: 700;
  background: #FFFFFF;
  color: var(--ink-navy);
  box-shadow: 0 2px 0 rgba(18, 21, 36, 0.22);
}
.tone-btn .btn-label {
  white-space: normal;
  overflow: visible;
  line-height: 1.2;
}
.tone-polite { border-left: 6px solid var(--tip-green); }
.tone-witty { border-left: 6px solid var(--pos-blue); }
.tone-chaotic { border-left: 6px solid var(--uv-purple); }
.key-hint {
  background: var(--ink-navy);
  color: #FFF;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.dialogue-outcome {
  margin-top: 5px;
  padding: 5px 8px;
  border-radius: 9px;
  background: #ECFDF5;
  border: 2px solid #34D399;
  font-size: 13px;
  font-weight: 800;
  color: #065F46;
}

/* Basket Scanner (`#3467`: all 4 basket rows unclipped!) */
.basket-items-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 196px;
  overflow-y: auto;
}
.basket-scan-hint {
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #ECFDF5;
  border: 2px solid #10B981;
  font-size: 13px;
  font-weight: 800;
  color: #065F46;
  text-align: center;
  line-height: 1.2;
}
#btn-scan-next:disabled,
#btn-scan-next.is-all-scanned {
  cursor: not-allowed;
  filter: grayscale(0.75);
  opacity: 0.72;
}
.basket-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 7px;
  min-height: 26px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #FFFFFF;
  border: 2px solid #4ADE80;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.18;
  cursor: pointer;
}
.basket-item-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.basket-item-row > strong {
  flex-shrink: 0;
  white-space: nowrap;
}
.basket-item-row.flash-needed {
  border-color: #F59E0B;
  background: #FEF3C7;
  animation: basketFlashPulse 0.35s ease 2;
}
@keyframes basketFlashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
.basket-item-row.scanned {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #475569;
  text-decoration: line-through;
}
#btn-card-tap.is-ready-pay {
  filter: brightness(1.08) drop-shadow(0 0 8px rgba(90, 216, 20, 0.55));
}
#btn-card-tap.needs-scan {
  opacity: 0.88;
}

/* POS LCD & Cash Drawer */
.pos-lcd-screen {
  position: relative;
  background: #141C2E;
  border: 3px solid var(--ink-outline);
  border-radius: 12px;
  padding: 6px 9px;
  color: #E8F3FF;
  font-family: var(--font-hud);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}
.pos-lcd-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  padding: 1px 0;
}
.pos-lcd-row.highlight-row {
  color: #7DD3FC;
  font-size: 14px;
  font-weight: 800;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin-top: 2px;
  padding-top: 2px;
}
.pos-lcd-row.given-row {
  color: #86EFAC;
  font-size: 13.5px;
  font-weight: 800;
}
.pos-paused-banner {
  position: absolute;
  inset: 0;
  background: rgba(255, 75, 92, 0.96);
  color: #FFFFFF;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  font-weight: 800;
  font-size: 13.5px;
}

.denom-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}
.denom-grid > * { min-width: 0; max-width: 100%; }

.denom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 2px;
  border-radius: 9px;
  border: 2px solid var(--ink-outline);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.05;
}
.denom-btn .btn-label { white-space: nowrap; }
.denom-btn.bill {
  background: linear-gradient(180deg, #DCFCE7 0%, #86EFAC 100%);
  color: #14532D;
  box-shadow: 0 3px 0 #15803D;
}
.denom-btn.coin {
  background: linear-gradient(180deg, #FEF08A 0%, #FACC15 100%);
  color: #713F12;
  border-radius: 999px;
  box-shadow: 0 3px 0 #A16207;
}

.drawer-actions-row {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}
.flex-grow { flex: 1; }
.full-w-cta { width: 100%; min-height: 46px; }

/* ==========================================================================
   MODALS, ANTI-SAAS `60/25/15` CARDS, 3-ICON GUIDE & VICTORY 3-STAR
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(16, 22, 38, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  pointer-events: auto;
}

.modal-card {
  width: min(1000px, 94vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 12px 18px 14px;
  will-change: transform, opacity;
  contain: layout style;
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #DBE6F5;
}

.modal-title-ribbon {
  padding: 4px 22px 6px;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 27px);
  color: #FFFFFF;
  text-shadow: 0 2px 0 var(--ink-outline);
}

.modal-head-actions { display: flex; align-items: center; gap: 8px; }
.btn-help-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--ink-outline);
  background: var(--gold-sunny);
  color: var(--ink-navy);
  font-family: var(--font-display);
  font-size: 18px;
  box-shadow: 0 3px 0 var(--gold-dark);
}
.btn-close-img {
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  padding: 0;
}
.btn-close-img img { width: 100%; height: 100%; object-fit: contain; }

/* Pillar 3: 3-Icon Visual Coach Flow Strip (`[Icon 1] -> [Icon 2] -> [Icon 3]`) */
.feature-guide-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 14px;
  background: #EBF4FF;
  border: 2.5px solid #93C5FD;
}
.fg-step-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #FFFFFF;
  border: 2px solid var(--ink-outline);
  border-radius: 12px;
  padding: 5px 11px;
  font-family: var(--font-hud);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-navy);
}
.fg-step-ico {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.fg-arrow {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--pos-blue);
}

.modal-body {
  margin-top: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 8px 10px;
}

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

.cards-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cards-grid-2 > * { min-width: 0; max-width: 100%; }

/* Shop Pack Cards — Symmetric 14px 9-Slice Border so `attachSlotBorder` `|dx|,|dy| === 0px`! */
.shop-pack-card {
  position: relative;
  overflow: visible !important;
  background-color: #DAEEFC;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 14px;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/card_rare.png') 60 59 93 59 fill / 14px / 0 stretch;
  padding: 6px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
}
.shop-pack-card.rarity-epic {
  background-color: #EADBFC;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/card_epic.png') 62 58 97 57 fill / 14px / 0 stretch;
}
.shop-pack-card.featured-pack {
  background-color: #FDF8DD;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/card_legendary.png') 62 58 99 59 fill / 14px / 0 stretch;
}

.shop-art-frame {
  width: 100%;
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}
.shop-art-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 94px;
  object-fit: contain;
}
.pack-badge {
  position: absolute;
  top: 4px;
  left: 6px;
  z-index: 6;
  padding: 2px 9px;
  border-radius: 999px;
  border: 2px solid #FFFFFF;
  font-family: var(--font-hud);
  font-size: 13px;
  font-weight: 800;
  background: var(--alert-red);
  color: #FFF;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.28);
}
.pack-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15.5px;
  line-height: 1.15;
  color: var(--ink-navy);
}

/* Portrait Visual-First Cards (Upgrades, Venues, Quests, Passes, Seasons) */
.vf-card-portrait {
  position: relative;
  overflow: visible !important;
  background-color: #F5F6F6;
  background-clip: padding-box;
  border-style: solid;
  border-color: transparent;
  border-width: 13px 13px 19px 13px;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/card_common.png') 59 58 93 58 fill / 13px 13px 19px 13px / 0 stretch;
  padding: 8px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  min-width: 0;
}
.vf-card-portrait.vf-rare {
  background-color: #DAEEFC;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/card_rare.png') 60 59 93 59 fill / 13px 13px 19px 13px / 0 stretch;
}
.vf-card-portrait.vf-featured {
  background-color: #FDF8DD;
  border-image: url('../assets/ui/vault_vibrant_popout_tycoon/card_legendary.png') 62 58 99 59 fill / 13px 13px 19px 13px / 0 stretch;
}
.vf-card-portrait.vf-locked {
  opacity: 0.82;
}

.vf-art-well {
  position: relative;
  width: 100%;
  height: 98px;
  border-radius: 12px;
  background: rgba(1, 121, 252, 0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.vf-hero-img {
  width: 86px;
  height: 86px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.vf-corner-pill {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--ink-navy);
  color: #FFFDF5;
  border-radius: 999px;
  padding: 2px 8px;
  font-family: var(--font-hud);
  font-size: 13px;
  font-weight: 800;
}

.vf-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.15;
  color: var(--ink-navy);
  max-width: 100%;
  overflow-wrap: break-word;
}

.vf-chip-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.vf-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-navy);
}
.vf-chip-icon, .vf-btn-ico {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}
.pack-short-perk {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-navy);
}

.vf-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: auto;
}
.vf-cta {
  width: 100%;
  margin-top: auto;
}

.sm-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

/* Pillar 6: Settings Mixer with Icons + Tactile Sliders + 9-Language Pill Grid */
.sm-settings-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.sm-setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FFFFFF;
  border: 2.5px solid #CBD5E1;
  border-radius: 14px;
  padding: 9px 14px;
}
.setting-label-grp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-hud);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-navy);
}
.setting-row-ico {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.setting-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.setting-range {
  width: 150px;
  height: 10px;
  accent-color: var(--pos-blue);
  cursor: pointer;
}
.lang-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
}
.lang-pill-btn {
  min-height: 36px;
  font-size: 13.5px;
}

/* Pillar 6: Victory 3-Star Slam + Rotating Sunburst + RollCounter */
.sm-summary-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #FFFDF2 0%, #FFF1C2 100%);
  border: 3.5px solid var(--ink-outline);
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.victory-sunburst-bg {
  position: absolute;
  width: 460px;
  height: 460px;
  top: -120px;
  left: 50%;
  margin-left: -230px;
  background: url('../js/ui_motion/textures/tex_sunburst_rays.png') center / contain no-repeat;
  opacity: 0.34;
  pointer-events: none;
  animation: spinSunburst 18s linear infinite;
}
@keyframes spinSunburst {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.victory-stars-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.victory-star-ico {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(18, 21, 36, 0.35));
}
.victory-star-ico.dim {
  filter: grayscale(1) opacity(0.35);
}
.victory-next-cta {
  min-width: 220px;
  min-height: 54px;
  font-family: var(--font-display);
  font-size: 20px;
}

/* Exit Modal */
.exit-modal-card {
  width: min(580px, 92vw);
  text-align: center;
  align-items: center;
  gap: 12px;
}
.exit-sub { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--ink-navy); }
.exit-rewards-grid, .exit-unclaimed-list {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.exit-rewards-grid > *, .exit-unclaimed-list > * { min-width: 0; max-width: 100%; }
.exit-reward-jump, .exit-unclaimed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 8px;
  border-radius: 14px;
  border: 2.5px solid var(--pos-blue);
  background: #F0F7FF;
  color: var(--ink-navy);
  font-size: 13px;
}
.exit-unclaimed-icon { width: 34px; height: 34px; object-fit: contain; }
.exit-unclaimed-name { font-family: var(--font-hud); font-weight: 800; font-size: 13.5px; }
.exit-unclaimed-desc { font-size: 13px; color: #334155; }
.exit-actions-row, .exit-modal-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ==========================================================================
   PILLAR 3: VISUAL SPOTLIGHT RING + ANIMATED POINTER HAND (`tut-hand`)
   ========================================================================== */
.ftue-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

body:has(#modal-backdrop:not(.hidden)) .ftue-overlay,
body:has(#exit-modal-backdrop:not(.hidden)) .ftue-overlay {
  opacity: 0;
  pointer-events: none;
}

.tut-spotlight-ring {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 140px;
  height: 52px;
  border-radius: 16px;
  border: 4px solid var(--gold-sunny);
  outline: 3px solid var(--ink-outline);
  pointer-events: none;
  will-change: transform;
  animation: spotlightPulse 1.15s infinite ease-in-out;
}

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

.tut-hand {
  position: fixed;
  left: 50%;
  top: 54%;
  width: 48px;
  height: 48px;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(12, 16, 30, 0.55));
  transition: left 0.22s ease, top 0.22s ease;
  animation: tutHandBob 0.85s infinite ease-in-out;
}
.tut-hand svg {
  width: 48px;
  height: 48px;
  display: block;
}
.tut-hand.point-right {
  animation: tutHandPointRight 0.85s infinite ease-in-out;
}
.tut-hand.point-left {
  animation: tutHandPointLeft 0.85s infinite ease-in-out;
}

@keyframes tutHandBob {
  0%, 100% { transform: translate(0, 0) rotate(-14deg); }
  50% { transform: translate(-6px, -9px) rotate(-8deg); }
}
@keyframes tutHandPointRight {
  0%, 100% { transform: translate(0, 0) rotate(90deg); }
  50% { transform: translate(8px, 0) rotate(90deg); }
}
@keyframes tutHandPointLeft {
  0%, 100% { transform: translate(0, 0) rotate(-90deg); }
  50% { transform: translate(-8px, 0) rotate(-90deg); }
}

.ftue-coach-pill {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  filter: drop-shadow(0 8px 18px rgba(12, 16, 30, 0.5));
}

.ftue-step-badge {
  background: var(--gold-sunny);
  color: var(--ink-navy);
  border-radius: 999px;
  padding: 2px 8px;
  font-family: var(--font-display);
  font-size: 13px;
}

.ftue-cue-label {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.03em;
  color: #FFFDF5;
  text-shadow: 0 2px 0 var(--ink-outline);
}

#btn-ftue-next {
  min-width: 44px;
  font-size: 16px;
  font-weight: 900;
}

.pastry-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

/* Preview-Only `[DEV F2]` Pill & Panel (placed in open floor corridor so 0 HIT_BLOCKED!) */
.dev-f2-pill {
  position: fixed;
  bottom: 8px;
  left: 248px;
  z-index: 140;
  background: #141C2B;
  color: #7DD3FC;
  border: 2px solid #38BDF8;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
}
.debug-panel {
  position: fixed;
  bottom: 44px;
  left: 248px;
  z-index: 140;
  width: 300px;
  background: #141C2B;
  color: #F8FAFC;
  border: 2px solid #38BDF8;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.debug-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

/* ==========================================================================
   RESPONSIVE COMPACT LAYOUT FOR `1280x720` (>= 13px Typography + Single-Row!)
   ========================================================================== */
@media (max-width: 1520px) {
  .top-hud-ribbon {
    padding: 6px 8px 2px;
    gap: 4px;
  }
  .top-hud-left,
  .top-hud-right {
    gap: 4px;
  }
  .hud-venue-pill {
    padding: 1px 7px 1px 6px;
    font-size: 13px;
  }
  .hud-goal-box {
    min-width: 118px;
    padding: 1px 7px 3px;
  }
  .currency-pill {
    padding: 1px 8px 1px 6px;
    font-size: 13px;
  }
  .curr-icon {
    width: 22px;
    height: 22px;
  }
  .curr-icon.pop-left {
    margin: -5px 1px -5px -9px;
  }
  .streak-chip,
  .hud-compact-hide,
  #btn-hud-haptics,
  .hud-venue-pill .venue-badge {
    display: none;
  }
  .cam-pill-group {
    padding: 2px;
    gap: 1px;
  }
  .cam-btn {
    padding: 3px 5px;
    font-size: 13px;
  }
  .btn-icon-round {
    padding: 3px 6px;
    min-height: 30px;
    font-size: 13px;
  }
  .top-hud-right .btn-sm {
    padding: 2px 7px 3px;
    min-height: 32px;
    font-size: 13px;
  }
  .workspace-columns {
    padding: 2px 8px 6px;
    grid-template-columns: 186px 1fr 232px;
    gap: 8px;
  }
  .wing-panel {
    gap: 2px;
  }
  .wing-panel .ui-card-9s {
    border-width: 6px 8px 8px 8px;
    padding: 3px 6px 3px;
  }
  .card-head {
    margin-bottom: 2px;
  }
  .queue-list {
    max-height: 118px;
    gap: 2px;
  }
  .queue-row {
    padding: 2px 5px;
    min-height: 23px;
    line-height: 1.12;
  }
  .patron-header {
    margin-bottom: 2px;
    gap: 5px;
  }
  .patron-avatar {
    width: 32px;
    height: 32px;
  }
  .patron-speech {
    margin-top: 2px;
    padding: 2px 5px;
    font-size: 13px;
    line-height: 1.12;
  }
  .dialogue-choices {
    gap: 2px;
  }
  .tone-btn {
    padding: 2px 5px;
    font-size: 13px;
  }
  .basket-items-list {
    max-height: 116px;
    gap: 2px;
  }
  .basket-item-row {
    padding: 1px 5px;
    min-height: 22px;
    line-height: 1.12;
  }
  .basket-scan-hint {
    margin-top: 2px;
    padding: 2px 6px;
    font-size: 13px;
    line-height: 1.12;
  }
  .pos-lcd-screen {
    padding: 3px 6px;
    margin-bottom: 2px;
  }
  .pos-lcd-row {
    padding: 0;
    font-size: 13px;
  }
  .pos-lcd-row.highlight-row,
  .pos-lcd-row.given-row {
    font-size: 13px;
  }
  .denom-grid {
    gap: 2px;
    margin-bottom: 2px;
  }
  .denom-btn {
    min-height: 23px;
    padding: 1px;
  }
  .drawer-actions-row {
    margin-top: 2px;
  }
  .drawer-actions-row .btn-sm {
    min-height: 26px;
    border-width: 5px 7px 7px 7px;
    padding: 1px 5px 1px;
  }
  .meta-dock-grid {
    gap: 6px;
    padding: 8px 4px 2px 2px;
  }
  .meta-btn {
    min-height: 38px;
    padding: 1px 2px 3px;
    border-width: 6px 5px 8px 5px;
    font-size: 13px;
    gap: 1px;
  }
  .meta-btn .btn-icon-sm {
    width: 24px;
    height: 24px;
  }
}

/* Compact Shop Modal Fit for 1280x720 (`#3470`: all 9 cards visible, 0 top-row clipping!) */
@media (max-width: 1520px), (max-height: 820px) {
  .modal-card[data-modal-id="shop"] {
    max-height: 95vh;
    padding: 8px 14px 10px;
  }
  .modal-card[data-modal-id="shop"] .modal-header-row {
    padding-bottom: 5px;
  }
  .modal-card[data-modal-id="shop"] .modal-title-ribbon {
    padding: 2px 18px 4px;
    border-width: 10px 18px 10px 18px;
  }
  .modal-card[data-modal-id="shop"] .modal-title {
    font-size: 19px;
  }
  .modal-card[data-modal-id="shop"] .modal-body {
    margin-top: 4px;
    padding: 6px 6px 6px;
  }
  .modal-card[data-modal-id="shop"] .shop-cards-grid {
    gap: 7px;
  }
  .modal-card[data-modal-id="shop"] .shop-pack-card {
    border-width: 10px;
    padding: 3px 8px 5px;
    gap: 3px;
  }
  .modal-card[data-modal-id="shop"] .shop-art-frame {
    height: 70px;
    padding: 0;
  }
  .modal-card[data-modal-id="shop"] .shop-art-img {
    height: 68px;
  }
  .modal-card[data-modal-id="shop"] .pack-title {
    font-size: 14px;
  }
  .modal-card[data-modal-id="shop"] .vf-cta {
    min-height: 28px;
    padding: 1px 8px 2px;
    border-width: 6px 8px 8px 8px;
    font-size: 13px;
  }
}

@media (max-width: 980px) {
  .title-stage-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .title-portrait-host {
    width: 190px;
    height: 190px;
  }
  .workspace-columns {
    grid-template-columns: 1fr;
    overflow-y: auto;
    pointer-events: auto;
  }
  .cards-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
