/* ============================================================================
 * Espressolane Cafe 3D — Sunlit Bistro & Cozy Stationery Craft Stylesheet
 * UI Vault: `cozy_stationery_craft` · Archetype: `cozy_pastel_storybook`
 * 100% Offline Fonts · Pure Solid & Gradient Surfaces · 60 FPS WebView2 Safe
 * CF-25 Compliant (`box-shadow: none !important` on 9-slice, 4-Card Single-Screen Shop!)
 * ============================================================================ */

:root {
  --cf-font-display: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --cf-font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --cf-font-mono: 'Consolas', 'Courier New', monospace;
  --cf-espresso-ink: #2A1912;
  --cf-cream: #FFFDF8;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #2C1D16;
  color: var(--cf-espresso-ink);
  font-family: var(--cf-font-body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

[hidden] {
  display: none !important;
}

.tabular-num {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

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

.chip-inline {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.util-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ============================================================================
 * 1. Contrast-Verified Fallbacks (`cozy_stationery_craft` light craft surfaces)
 * ============================================================================ */
.uiv-cozy_stationery_craft-frame-modal,
.uiv-cozy_stationery_craft-frame-subpanel,
.uiv-cozy_stationery_craft-hud-pill,
.uiv-cozy_stationery_craft-slot-tile,
.uiv-cozy_stationery_craft-card-common,
.uiv-cozy_stationery_craft-card-rare,
.uiv-cozy_stationery_craft-card-epic,
.uiv-cozy_stationery_craft-card-legendary,
.uiv-cozy_stationery_craft-tab-active {
  background-color: #FBF2DF;
  color: #2A1912;
}

.uiv-cozy_stationery_craft-ribbon-header {
  background-color: #F5E2BF;
  color: #2A1912;
}

.uiv-cozy_stationery_craft-btn-primary {
  background-color: #8FD158;
  color: #182310;
}

.uiv-cozy_stationery_craft-btn-secondary {
  background-color: #7AC4E6;
  color: #11222C;
}

.uiv-cozy_stationery_craft-btn-danger {
  background-color: #E07066;
  color: #260E0C;
}

.uiv-cozy_stationery_craft-btn-disabled {
  background-color: #D8CFC2;
  color: #4A3E36;
}

/* ============================================================================
 * 2. Heroic No-Box Title Screen (`0 BOXED_LOGIN_TITLE_SCREEN`)
 * ============================================================================ */
.screen-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: none;
}

.screen-layer.active {
  display: flex;
  flex-direction: column;
}

#titleScreen {
  justify-content: space-between;
  padding: 14px 22px 26px;
}

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

.title-warm-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(44, 24, 14, 0.14) 0%, rgba(28, 16, 10, 0.64) 100%),
    linear-gradient(180deg, rgba(28, 16, 10, 0.45) 0%, rgba(28, 16, 10, 0.08) 40%, rgba(28, 16, 10, 0.68) 100%);
  z-index: 1;
  pointer-events: none;
}

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

.title-wallet-cluster,
.title-utility-cluster {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.wallet-chip-btn,
.util-pill-btn {
  height: 40px;
  padding: 4px 12px;
  font-size: 13.5px;
  font-weight: 800;
  color: #2A1912;
  white-space: nowrap;
  flex-shrink: 0;
}

.util-icon-only {
  width: 42px;
  height: 40px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.title-center-showcase {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}

.title-mascot-wrap {
  width: 156px;
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-mascot-img {
  width: 148px;
  height: 148px;
  object-fit: contain;
}

.title-emblem-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.title-kicker {
  padding: 5px 24px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2A1912;
}

.title-logo-text {
  margin: 0;
  font-family: var(--cf-font-display);
  font-size: clamp(34px, 4.4vw, 58px);
  font-weight: 900;
  line-height: 1.06;
  color: #FFF9EE;
  -webkit-text-stroke: 2px #4A2C20;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 #4A2C20, 0 8px 18px rgba(18, 10, 6, 0.72);
}

.title-sector-chip {
  padding: 5px 14px;
  font-size: 13.5px;
  font-weight: 800;
  color: #2A1912;
}

.title-cta-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.title-play-cta {
  min-width: 260px;
  height: 60px;
  padding: 8px 34px;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1A2810;
}

.cta-lead-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.title-secondary-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.title-sec-btn {
  height: 46px;
  padding: 6px 16px;
  font-size: 14px;
  color: #132530;
}

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

/* ============================================================================
 * 3. Full-Bleed 3D Cafe Viewport + Single-Row Floating HUD (`>= 13px`)
 * ============================================================================ */
#gameScreen {
  position: fixed;
  inset: 0;
  background: transparent !important;
}

.cafe-viewport {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
}

#arena-canvas,
.vfx-layer-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vfx-layer-canvas {
  pointer-events: none;
}

.hud-top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap !important;
  gap: 8px;
  padding: 8px 14px 4px;
  pointer-events: none;
}

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

.hud-stat-pill {
  height: 38px;
  padding: 3px 10px;
  font-size: 13.5px;
  font-weight: 800;
  color: #2A1912;
  white-space: nowrap;
}

.hud-stat-pill.is-active {
  outline: 2.5px solid #D97706;
}

.hud-icon-btn {
  width: 40px;
  height: 38px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hud-dev-btn {
  height: 34px;
  padding: 2px 8px;
  font-family: var(--cf-font-mono);
  font-size: 12px;
  font-weight: 900;
  color: #2A1912;
}

.hud-sub-strip {
  position: relative;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 14px;
  pointer-events: none;
}

.crema-combo-bar {
  width: 210px;
  min-height: 26px;
}

.editor-hud-pill {
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 800;
  color: #166534;
}

/* ============================================================================
 * 4. Bottom Barista Action Dock (Round 5 Ratios: 46/80 = 0.575!)
 * ============================================================================ */
.barista-bottom-dock {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.dock-action-btn {
  position: relative;
  width: 122px;
  min-height: 92px;
  height: auto;
  padding: 4px 6px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background-color: #FBF2DF;
  color: #2A1912;
  pointer-events: auto;
  overflow: visible !important;
}

.dock-action-btn.is-editor-on {
  outline: 3px solid #16A34A;
}

.dock-action-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.dock-hotkey-pip {
  position: absolute;
  top: -8px;
  right: -5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #3B2318;
  border: 1.5px solid #FDE68A;
  color: #FFFDF7;
  font-family: var(--cf-font-mono);
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}

.dock-action-lbl {
  width: 100%;
  text-align: center;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.14;
  color: #2A1912;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  overflow: visible;
}

/* ============================================================================
 * 5. Spotlight FTUE Overlay
 * ============================================================================ */
.ftue-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.tut-spotlight {
  position: absolute;
  width: 118px;
  height: 94px;
  border-radius: 16px;
  border: 3px solid #F59E0B;
  animation: cfPulse 1.15s ease-in-out infinite;
  pointer-events: none;
}

.tut-hand {
  position: absolute;
  width: 46px;
  height: 46px;
  animation: cfBob 0.95s ease-in-out infinite;
  pointer-events: none;
}

.ftue-banner {
  position: absolute;
  left: 50%;
  bottom: 106px;
  transform: translateX(-50%);
  padding: 6px 16px;
  font-size: 14.5px;
  font-weight: 800;
  color: #2A1912;
  pointer-events: none;
}

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

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

/* ============================================================================
 * 6. Anti-SaaS 60/25/15 Modals + 4-Card Single-Screen Shop (0 Occlusion!)
 * ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(24, 15, 11, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-shell {
  width: min(1060px, 95vw);
  max-height: 90vh;
  padding: 12px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.shop-modal-shell {
  width: min(1060px, 95vw);
}

.trolley-laptop-shell {
  background-color: #FCEFE3;
}

.settings-modal-shell {
  width: min(760px, 92vw);
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.modal-ribbon {
  padding: 5px 22px;
  font-size: 17px;
  color: #2A1912;
  white-space: nowrap;
}

.modal-wallet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.wallet-pill {
  padding: 4px 12px;
  font-weight: 800;
  font-size: 14px;
  color: #2A1912;
}

.modal-close-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.modal-close-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.modal-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-tab-btn {
  padding: 5px 14px;
  font-size: 13.5px;
  font-weight: 800;
  color: #2A1912;
  white-space: nowrap;
}

.compact-cta-btn {
  height: 38px;
  padding: 4px 14px;
  font-size: 13.5px;
  white-space: nowrap;
}

/* 4-Column Single-Row Grid so all 4 Shop Packs / Pass Tiers / Upgrades fit 100% on 1 screen at 1080p & 720p! */
.shop-sku-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 6px 6px 8px;
}

.anti-saas-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 10px;
  padding: 6px 6px 8px;
}

.game-item-card {
  position: relative;
  min-height: 204px;
  padding: 8px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  overflow: visible;
}

.card-ribbon-tag {
  position: absolute;
  top: -7px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #D97706;
  color: #FFFDF8;
  font-size: 10px;
  font-weight: 900;
  z-index: 3;
}

.card-hero-art {
  width: 98px;
  height: 98px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-short-title {
  width: 100%;
  text-align: center;
  font-size: 13.5px;
  font-weight: 800;
  color: #2A1912;
  white-space: normal;
  line-height: 1.14;
}

.card-value-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #3B241A;
  color: #FFFDF7;
  font-size: 11.5px;
  font-weight: 800;
  max-width: 100%;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
  overflow: visible;
  text-overflow: clip;
}

.card-action-btn {
  width: 100%;
  min-height: 38px;
  padding: 4px 8px;
  font-size: 13px;
  white-space: normal;
  line-height: 1.1;
  text-align: center;
}

.pass-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
}

.pass-xp-track {
  flex: 1;
  height: 16px;
  border-radius: 999px;
  background: #3A251B;
  overflow: hidden;
}

.pass-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #83B84E 0%, #F59E0B 100%);
  transition: width 0.25s ease;
}

/* Settings Layout */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.setting-card {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.setting-lbl {
  font-weight: 800;
  font-size: 13.5px;
  color: #2A1912;
}

.craft-slider {
  flex: 1;
  accent-color: #83B84E;
}

.setting-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.setting-pill-btn {
  min-height: 36px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: normal;
  line-height: 1.1;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.lang-choice-btn {
  min-height: 32px;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 800;
}

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

.craft-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1.5px solid #8A5E48;
  background: #FFFDF8;
  color: #2A1912;
  font-family: var(--cf-font-mono);
  font-size: 13.5px;
}

.settings-footer-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Overlay Hosts */
.overlay-host {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}

.overlay-host:not(:empty) {
  pointer-events: auto;
}

#cutinOverlayHost {
  z-index: 60;
  pointer-events: none !important;
}

.motion-overlay-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 65;
  pointer-events: none;
}

/* ============================================================================
 * 7. Compact 1280x720 & Multi-Language Overflow Guards (0 Clipping!)
 * ============================================================================ */
@media (max-width: 1360px), (max-height: 780px) {
  .hud-top-bar {
    padding: 6px 10px 2px;
    gap: 4px;
  }

  .hud-cluster {
    gap: 4px;
  }

  .hud-stat-pill {
    height: 34px;
    padding: 2px 7px;
    font-size: 13px;
  }

  .hud-icon-btn {
    width: 34px;
    height: 34px;
  }

  .dock-action-btn {
    width: 98px;
    height: 76px;
    padding: 4px 4px 4px;
  }

  .dock-action-icon {
    width: 42px;
    height: 42px;
  }

  .dock-action-lbl {
    font-size: 10px;
  }

  .game-item-card {
    min-height: 182px;
    padding: 6px 6px 6px;
  }

  .card-hero-art {
    width: 82px;
    height: 82px;
  }
}
