/* css/game.css — Sugarstruck: Patisserie Merge (UI Vault: plush_stitched_casual · Offline-First)
 * Zero Google Fonts external network calls · Zero backdrop-filter: blur over canvas · Full-bleed 16:9
 */
:root {
  --font-display: 'Arial Rounded MT Bold', 'Segoe UI', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ink: #261209;
  --ink-soft: #4E2A1A;
  --cream: #FAE4BC;
  --caramel: #EFA36A;
  --terracotta: #DB7040;
  --berry: #EC4C66;
  --mint: #55D418;
  --sky: #2DA7FD;
  --gold: #FFD54F;
}

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

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

.hidden {
  display: none !important;
}

button {
  font-family: var(--font-display);
  color: var(--ink);
  cursor: pointer;
  outline: none;
}

/* Proportional crisp 9-slice overrides so compact 720p/1080p pills & buttons never pinch or clip */
.uiv-plush_stitched_casual-hud-pill {
  border-width: 10px 14px 10px 14px;
  border-image-width: 10px 14px 10px 14px;
  color: var(--ink);
}
.uiv-plush_stitched_casual-btn-primary,
.uiv-plush_stitched_casual-btn-secondary,
.uiv-plush_stitched_casual-btn-danger,
.uiv-plush_stitched_casual-btn-disabled {
  border-width: 8px 11px 9px 11px;
  border-image-width: 8px 11px 9px 11px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1.1;
  overflow: visible !important;
  position: relative;
}
.uiv-plush_stitched_casual-btn-primary > span,
.uiv-plush_stitched_casual-btn-secondary > span,
.uiv-plush_stitched_casual-btn-danger > span,
.uiv-plush_stitched_casual-btn-disabled > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.uiv-plush_stitched_casual-frame-subpanel {
  border-width: 10px 12px 10px 12px;
  border-image-width: 10px 12px 10px 12px;
  background-color: #FFF7E8;
  background-clip: padding-box;
  border-radius: 14px;
  color: var(--ink);
  cursor: default;
}
.uiv-plush_stitched_casual-slot-tile {
  border-width: 8px 9px 10px 8px;
  border-image-width: 8px 9px 10px 8px;
  background-color: #FBF0D9;
  background-clip: padding-box;
  border-radius: 12px;
  color: var(--ink);
}
.uiv-plush_stitched_casual-tab-active {
  border-width: 10px 14px 10px 14px;
  border-image-width: 10px 14px 10px 14px;
  background-color: #EC4C66;
  background-clip: padding-box;
  border-radius: 14px;
  color: #FFFFFF !important;
  text-shadow: 0 1.5px 0 rgba(90, 18, 38, 0.72);
}
.uiv-plush_stitched_casual-ribbon-header {
  border-width: 14px 36px 14px 36px;
  border-image-width: 14px 36px 14px 36px;
  background-color: #2DA7FD;
  background-clip: padding-box;
  border-radius: 16px;
  color: var(--ink);
  cursor: default;
}
.uiv-plush_stitched_casual-frame-modal {
  border-width: 18px 20px 18px 20px;
  border-image-width: 18px 20px 18px 20px;
  background-color: #FFF4DF;
  background-clip: padding-box;
  border-radius: 26px;
  color: var(--ink);
  cursor: default;
}
.uiv-plush_stitched_casual-card-common,
.uiv-plush_stitched_casual-card-rare,
.uiv-plush_stitched_casual-card-epic,
.uiv-plush_stitched_casual-card-legendary {
  border-width: 12px 14px 12px 14px;
  border-image-width: 12px 14px 12px 14px;
  background-color: #FFF9EE;
  background-clip: padding-box;
  border-radius: 16px;
  color: var(--ink);
  cursor: default;
}
.uiv-plush_stitched_casual-bar-track {
  border-width: 8px 10px 8px 10px;
  border-image-width: 8px 10px 8px 10px;
  cursor: default;
}
.uiv-plush_stitched_casual-bar-fill-primary {
  border-width: 5px 7px 5px 7px;
  border-image-width: 5px 7px 5px 7px;
  cursor: default;
}

/* ==========================================================================
 * 1. HEROIC NO-BOX TITLE SCREEN
 * ========================================================================== */
#title-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: url('../assets/art/title_bg.jpg') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.8vh, 20px);
  padding: 24px;
}
#title-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 48%, rgba(255, 248, 232, 0.12) 0%, rgba(78, 42, 26, 0.34) 100%);
}

.title-corner-dock {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
}
.title-icon-btn {
  height: 44px;
  min-width: 52px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 900;
  border-width: 7px 10px 8px 10px !important;
  border-image-width: 7px 10px 8px 10px !important;
}
.title-icon-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Strictly transparent borderless title lockup — ZERO boxed login card! */
.title-emblem {
  position: relative;
  z-index: 42;
  background: transparent;
  border: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.title-emblem h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(46px, 5.4vw, 82px);
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.02;
  color: #FFFDF5;
  -webkit-text-stroke: 2.5px #4E2A1A;
  text-shadow: 0 5px 0 #4E2A1A, 0 10px 22px rgba(78, 42, 26, 0.42);
}
.title-sub {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 32px);
  font-weight: 900;
  color: #FFE484;
  -webkit-text-stroke: 1.4px #4E2A1A;
  text-shadow: 0 3px 0 #4E2A1A;
}

.title-hero-stage {
  position: relative;
  z-index: 42;
  width: clamp(160px, 19vh, 220px);
  height: clamp(160px, 19vh, 220px);
  display: flex;
  align-items: center;
  justify-content: center;
}
#title-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(78, 42, 26, 0.35));
}

.title-cta-area {
  position: relative;
  z-index: 42;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#btn-title-play {
  min-width: 244px;
  height: 68px;
  padding: 0 28px;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.25;
  filter: drop-shadow(0 6px 0 rgba(78, 42, 26, 0.38));
}
#btn-title-play > span {
  overflow: visible;
  line-height: 1.25;
}

.title-loading {
  width: min(320px, 72vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.load-track {
  width: 100%;
  height: 28px;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.load-fill {
  height: 100%;
  width: 5%;
  transition: width 120ms ease-out;
}
.load-caption {
  font-size: 14px;
  font-weight: 900;
  color: #FFFDF5;
  text-shadow: 0 2px 0 #4E2A1A;
}

/* ==========================================================================
 * 2. FULL-BLEED 16:9 GAMEPLAY CANVAS & FLOATING HUD
 * ========================================================================== */
#game-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
}

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
}

#volumetric-vfx-canvas,
#ui-motion-overlay,
#cutin-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}
#volumetric-vfx-canvas { z-index: 94; }
#ui-motion-overlay { z-index: 95; }
#cutin-canvas { z-index: 98; }

#hud-layer {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

/* TOP BAR — flex-wrap: nowrap guaranteed at 1280x720 across all 9 languages */
#top-hud {
  position: fixed;
  top: 6px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  pointer-events: none;
}
.hud-group {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  pointer-events: auto;
  min-width: 0;
}

.hud-pill {
  height: 44px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: default;
}
.hud-pill img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}
.hud-chapter {
  min-width: 68px;
  justify-content: center;
}
#hud-gems-pill,
#hud-stars-pill {
  cursor: pointer;
}
.hud-star-tag {
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 7px;
  background: rgba(219, 112, 64, 0.22);
  border: 1.5px solid rgba(125, 62, 32, 0.45);
  color: #4E2A1A;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.hud-btn {
  height: 44px;
  padding: 0 7px;
  font-size: clamp(12.5px, 0.95vw, 14px);
  font-weight: 900;
  white-space: nowrap;
  flex: 0 0 auto;
}
.hud-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}
.hud-btn-sq {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-width: 7px 8px 8px 8px !important;
  border-image-width: 7px 8px 8px 8px !important;
}
.hud-btn-sq img {
  width: 24px;
  height: 24px;
}
.hud-btn.is-muted {
  opacity: 0.65;
}

.notify-badge {
  position: absolute;
  top: -8px;
  right: -7px;
  z-index: 35;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #EC4C66;
  border: 2px solid #FFFDF5;
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* ALWAYS-OPEN 3-SLOT GUEST ORDER RAIL + CRITIC TASTING CHIP (#3628 wider Serve button fit across all 9 langs!) */
#order-rail {
  position: fixed;
  top: 56px;
  left: 16px;
  max-width: calc(56vw - 14px);
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  pointer-events: auto;
  z-index: 26;
}
.order-chip {
  position: relative;
  height: 74px;
  min-width: 164px;
  max-width: 220px;
  padding: 0 3px;
  border-width: 7px 8px 7px 8px !important;
  border-image-width: 7px 8px 7px 8px !important;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 0;
  overflow: visible !important;
}
.order-chip.is-ready {
  filter: drop-shadow(0 0 8px rgba(85, 212, 24, 0.55));
}
.order-pastry-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}
.order-meta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}
.order-rewards {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.mini-cur {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.mini-cur img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}
.order-serve-btn {
  height: 30px;
  min-width: 82px;
  width: 100%;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 900;
  border-width: 5px 6px 5px 6px !important;
  border-image-width: 5px 6px 5px 6px !important;
}
.order-serve-btn > span {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.order-guest-dot {
  position: absolute;
  top: -10px;
  left: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  background: #FFFDF5;
  border: 2px solid #4E2A1A;
  pointer-events: none;
}

/* BOTTOM FLOATING DOCK: PANTRY + CONTROLS (Left) & DIORAMA BAR (Right) */
#bottom-dock {
  position: fixed;
  bottom: 8px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  z-index: 26;
}
.dock-left, .dock-right {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
#pantry-slots {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pantry-slot {
  width: clamp(46px, 4.1vw, 56px);
  height: clamp(46px, 4.1vw, 56px);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pantry-slot img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}
.pantry-plus {
  font-size: 18px;
  font-weight: 900;
  color: #261209;
}

.dock-ctrl-btn {
  height: 46px;
  padding: 0 8px;
  font-size: clamp(12.5px, 0.95vw, 14px);
  font-weight: 900;
  white-space: nowrap;
  flex: 0 0 auto;
}
.dock-ctrl-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.rush-meter-box {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rush-track {
  width: clamp(86px, 8vw, 128px);
  height: 26px;
  padding: 0;
  overflow: hidden;
}
.rush-fill {
  height: 100%;
  width: 25%;
  transition: width 160ms ease-out;
}
#btn-sugar-rush.is-rush-ready {
  animation: tbPulseGlow 0.9s ease-in-out infinite alternate;
}
@keyframes tbPulseGlow {
  from { filter: drop-shadow(0 0 3px #FFD54F); }
  to   { filter: drop-shadow(0 0 12px #FF9800); }
}

/* ==========================================================================
 * 3. FLEX-SCROLL ANTI-SAAS (60/25/15) MODALS (#3629 opaque panel + backdrop, #3635 active tabs)
 * ========================================================================== */
#modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(28, 12, 5, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

#modal-backdrop.is-celebration {
  background: rgba(28, 12, 5, 0.34);
  justify-content: flex-end;
  padding-right: clamp(20px, 4.5vw, 68px);
}
#active-modal-card.modal-card.is-celebration {
  width: min(440px, 42vw);
  max-height: 82vh;
}
#active-modal-card.modal-card.is-celebration .modal-footer {
  justify-content: center;
}

#active-modal-card.modal-card {
  display: flex;
  flex-direction: column;
  width: min(920px, 92vw);
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  background-color: #FFF4DF;
  background-clip: padding-box;
  border-radius: 26px;
  box-shadow: 0 18px 44px rgba(28, 12, 5, 0.56);
}

.modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 6px 8px;
}
.modal-ribbon {
  flex: 1 1 auto;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 900;
  text-align: center;
}
.modal-hdr-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-help-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 16px;
  font-weight: 900;
  border-width: 7px 8px 8px 8px !important;
  border-image-width: 7px 8px 8px 8px !important;
}
.modal-close-x {
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close-x img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.modal-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 6px 10px;
}
.m-tab {
  height: 42px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 120ms ease, opacity 120ms ease;
}
.m-tab.is-active,
.style-btn.is-active,
.lang-btn.is-active {
  background-color: #EC4C66;
  background-clip: padding-box;
  border-radius: 14px;
  color: #FFFFFF !important;
  text-shadow: 0 1.5px 0 rgba(90, 18, 38, 0.75);
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 6px rgba(78, 42, 26, 0.30));
  opacity: 1;
}
.m-tab:not(.is-active),
.style-btn:not(.is-active),
.lang-btn:not(.is-active) {
  background-color: #EED8B4;
  background-clip: padding-box;
  border-radius: 14px;
  color: #5C3A28;
  opacity: 0.76;
  filter: saturate(0.72);
}
.m-tab:not(.is-active):hover,
.style-btn:not(.is-active):hover,
.lang-btn:not(.is-active):hover {
  opacity: 0.96;
}
.ui-arrow-svg {
  display: inline-block;
  vertical-align: -2px;
  margin: 0 3px;
  color: #DB7040;
  flex: 0 0 auto;
}
.ui-lock-svg {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 2px;
  flex: 0 0 auto;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px 8px;
}

.modal-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 6px 2px;
}
.footer-balances {
  display: flex;
  align-items: center;
  gap: 12px;
}
.m-action-btn {
  height: 46px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 900;
}

/* Balanced Modal Grids — strict minmax(0, 1fr) containment */
.modal-grid {
  display: grid;
  gap: 12px;
  width: 100%;
}
.modal-grid > * {
  min-width: 0;
  max-width: 100%;
}
.grid-1 { grid-template-columns: minmax(0, 320px); justify-content: center; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.shop-card, .upgrade-card, .quest-card, .recipe-card, .clue-card, .exit-reward-card, .celeb-card, .sz-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px;
  text-align: center;
  overflow: visible !important;
}
.recipe-card.is-locked .m-art,
.clue-card.is-locked .m-art {
  filter: grayscale(0.85) opacity(0.55);
}
.exit-reward-card { cursor: pointer; }

.m-badge {
  position: absolute;
  top: -8px;
  right: 6px;
  z-index: 6;
  padding: 2px 8px;
  border-radius: 10px;
  background: #EC4C66;
  border: 2px solid #FFFDF5;
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
}

.m-art-wrap {
  width: 100%;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-art {
  width: 84px;
  height: 84px;
  object-fit: contain;
}
.m-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cur-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.cur-chip-ico {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.cur-chip-labeled {
  padding: 2px 8px 2px 5px;
  border-radius: 12px;
  background: rgba(78, 42, 26, 0.08);
  border: 1.5px solid rgba(78, 42, 26, 0.22);
  gap: 5px;
}
.cur-chip-labeled.is-total {
  background: rgba(236, 76, 102, 0.12);
  border-color: rgba(236, 76, 102, 0.42);
}
.cur-chip-labeled.is-spend {
  background: rgba(255, 193, 7, 0.18);
  border-color: rgba(180, 104, 24, 0.42);
}
.star-role-tag {
  font-size: 11px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 8px;
  line-height: 1.2;
  white-space: nowrap;
}
.star-role-tag.is-total {
  background: #EC4C66;
  color: #FFFFFF;
}
.star-role-tag.is-spend {
  background: #DB7040;
  color: #FFFFFF;
}
.stat-pill {
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(78, 42, 26, 0.12);
  font-size: 12.5px;
  font-weight: 900;
  color: var(--ink);
}
.m-cta {
  width: 100%;
  height: 40px;
  font-size: 13.5px;
  font-weight: 900;
}

.style-picker-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}
.style-btn {
  height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 900;
}
.style-btn.is-locked-style {
  opacity: 0.65;
  filter: grayscale(0.45);
}

/* Horizontal Showcase Pass Track */
.ms-strip-wrap {
  margin-bottom: 10px;
  padding: 4px 6px;
}
.ms-strip-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 2px dashed rgba(78, 42, 26, 0.18);
}
.ms-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 2px 0;
}
.ms-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ms-ico {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.ms-btn {
  width: 100%;
  height: 32px;
  font-size: 12.5px;
  border-width: 6px 8px !important;
  border-image-width: 6px 8px !important;
}

.q-prog-wrap {
  position: relative;
  width: 100%;
  height: 18px;
  border-radius: 9px;
  background: rgba(78, 42, 26, 0.18);
  overflow: hidden;
}
.q-prog-fill {
  height: 100%;
  background: #55D418;
}
.q-prog-txt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
}

/* Settings */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 10px;
}
.setting-lbl {
  font-size: 15px;
  font-weight: 900;
  min-width: 110px;
}
.opt-line input[type="range"] {
  flex: 1 1 auto;
  accent-color: #DB7040;
}
.setting-toggle {
  min-width: 78px;
  height: 38px;
  font-size: 13.5px;
}
.setting-lang-box {
  padding: 6px 10px;
}
.lang-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.lang-btn {
  height: 38px;
  font-size: 13.5px;
  font-weight: 800;
}
.save-badge {
  font-size: 13.5px;
  font-weight: 900;
  color: #2E7D32;
}
.settings-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.reset-confirm-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(236, 76, 102, 0.14);
  border: 2px solid #EC4C66;
}
.reset-confirm-txt {
  font-size: 13px;
  font-weight: 900;
  color: #8F1B30;
  white-space: nowrap;
}
.btn-reset-sm {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

/* 3-Icon Visual Feature Guide */
.fg-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 6px;
}
.fg-step {
  width: 170px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.fg-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.fg-label {
  font-size: 15px;
  font-weight: 900;
}
.fg-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #DB7040;
  flex: 0 0 auto;
}

.exit-headline {
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 12px;
}

.celeb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px;
}
.celeb-art {
  width: 112px;
  height: 112px;
  object-fit: contain;
}
.celeb-rewards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.celeb-card {
  width: 150px;
}

/* Critic Tasting Verdict Summary Banner (#4009) */
.critic-verdict-card {
  position: fixed;
  top: 66px;
  right: 20px;
  z-index: 75;
  width: min(392px, 40vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 8px 8px;
  pointer-events: auto;
  box-shadow: 0 14px 36px rgba(38, 18, 9, 0.44);
}
.cv-ribbon {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
  text-align: center;
  border-width: 10px 26px 10px 26px !important;
  border-image-width: 10px 26px 10px 26px !important;
}
.cv-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 14px;
  background: rgba(255, 251, 240, 0.85);
  border: 2px solid rgba(78, 42, 26, 0.18);
}
.cv-portraits {
  position: relative;
  width: 74px;
  height: 70px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv-critic-img {
  width: 66px;
  height: 66px;
  object-fit: contain;
}
.cv-dish-img {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #FFFDF5;
  border: 2.5px solid #4E2A1A;
  border-radius: 50%;
  padding: 2px;
}
.cv-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cv-stars-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cv-verdict-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: #4E2A1A;
  line-height: 1.15;
}
.cv-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cv-rewards-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 12px;
  background: rgba(255, 213, 79, 0.22);
  border: 1.5px solid rgba(180, 104, 24, 0.35);
}
.cv-claimed-pill {
  font-size: 11.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 9px;
  background: #55D418;
  color: #163B04;
  border: 1.5px solid #2E6B0D;
}
.cv-hint-txt {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #5C3A28;
  line-height: 1.2;
}
.cv-actions {
  display: flex;
  justify-content: center;
}
.cv-ok-btn {
  min-width: 156px;
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 900;
}

/* ==========================================================================
 * 4. VISUAL SPOTLIGHT FTUE & TOAST & PREVIEW DEBUG
 * ========================================================================== */
.tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  pointer-events: none;
}
.tut-spotlight {
  position: fixed;
  border-radius: 18px;
  border: 4px solid #FFD54F;
  box-shadow: 0 0 0 4px rgba(78, 42, 26, 0.35);
  animation: tutRingPulse 1s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes tutRingPulse {
  from { transform: scale(0.96); }
  to   { transform: scale(1.06); }
}
.tut-hand {
  position: fixed;
  z-index: 68;
  pointer-events: none;
  animation: tutHandBob 0.8s ease-in-out infinite alternate;
}
@keyframes tutHandBob {
  from { transform: translate(0, 0) rotate(-10deg); }
  to   { transform: translate(-8px, -10px) rotate(-4deg); }
}
.tut-pill {
  position: fixed;
  z-index: 68;
  min-width: 180px;
  height: 44px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  pointer-events: none;
}
.tut-skip {
  position: fixed;
  top: 62px;
  right: 16px;
  z-index: 70;
  height: 40px;
  padding: 0 12px;
  font-size: 13.5px;
  pointer-events: auto;
}

#game-toast {
  position: fixed;
  bottom: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 90;
  padding: 7px 12px 7px 16px;
  border-radius: 18px;
  background: #FFFDF5;
  border: 3px solid #4E2A1A;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  display: none;
  align-items: center;
  gap: 10px;
  max-width: min(560px, 84vw);
  box-shadow: 0 8px 20px rgba(38, 18, 9, 0.30);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
#game-toast.is-visible {
  display: inline-flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  cursor: pointer;
}
.toast-close-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #4E2A1A;
  background: #FAE4BC;
  color: #4E2A1A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.toast-close-btn:hover {
  background: #EC4C66;
  color: #FFFFFF;
}

/* Preview-only DEV F2 pill */
#debug-wrap {
  position: fixed;
  bottom: 72px;
  right: 14px;
  z-index: 92;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.dev-pill {
  background: rgba(38, 18, 9, 0.82);
  color: #FFE484;
  border: 2px solid #FFE484;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}
.dev-panel {
  background: #FFFDF5;
  border: 3px solid #4E2A1A;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 210px;
}
.dev-title {
  font-size: 13px;
  font-weight: 900;
}
.dev-panel button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid #4E2A1A;
  background: #FAE4BC;
  font-size: 12.5px;
  font-weight: 800;
  text-align: left;
}

/* Responsive compact tweaks for 1280x720 (guarantees 0 overlap & 0 clipping even with Seasons unlocked across all 9 langs!) */
@media (max-width: 1366px) {
  #top-hud { left: 8px; right: 8px; gap: 4px; }
  .hud-group { gap: 4px; }
  .hud-pill {
    height: 38px;
    padding: 0 4px;
    gap: 3px;
    font-size: 12px;
    border-width: 8px 10px 8px 10px;
    border-image-width: 8px 10px 8px 10px;
  }
  .hud-pill img { width: 20px; height: 20px; }
  .hud-chapter { min-width: 50px; }
  .hud-btn {
    height: 38px;
    padding: 0 4px;
    gap: 3px;
    font-size: 11.5px;
    border-width: 7px 8px 8px 8px;
    border-image-width: 7px 8px 8px 8px;
  }
  .hud-btn img { width: 19px; height: 19px; }
  .hud-btn-sq {
    width: 36px;
    min-width: 36px;
    height: 38px;
    border-width: 6px 6px 7px 6px !important;
    border-image-width: 6px 6px 7px 6px !important;
  }
  .hud-btn-sq img { width: 19px; height: 19px; }
  #order-rail { max-width: calc(56vw - 12px); gap: 5px; }
  .order-chip { height: 68px; min-width: 158px; max-width: 172px; gap: 4px; }
  .order-pastry-img { width: 38px; height: 38px; }
  .order-serve-btn { height: 28px; min-width: 78px; font-size: 11.5px; padding: 0 4px; }
  .pantry-slot { width: 42px; height: 42px; }
  #pantry-slots.is-expanded .pantry-slot { width: 36px; height: 36px; }
  #pantry-slots.is-xl .pantry-slot { width: 32px; height: 32px; }
  .m-tab { padding: 0 11px; font-size: 13px; }
  .dock-ctrl-btn { height: 42px; padding: 0 6px; font-size: 12.5px; }
  .rush-track { width: 64px; }
  .m-art-wrap { height: 70px; }
  .m-art { width: 66px; height: 66px; }
  .m-cta { height: 36px; font-size: 13px; }
  .hud-star-tag { font-size: 8.5px; padding: 1px 4px; }
  .critic-verdict-card { top: 54px; right: 14px; width: min(360px, 40vw); gap: 6px; }
  .cv-ribbon { min-height: 32px; font-size: 15px; }
  .cv-ok-btn { height: 34px; font-size: 12.5px; }
}
