/* Pinepaw: Woodland Merge — Cozy Stationery Craft Design System (`css/game.css`)
 * Offline MSIX Clean: ZERO external Google Fonts @import, ZERO backdrop-filter blur.
 */

:root {
  --font-display: 'Fredoka', 'M PLUS Rounded 1c', 'Trebuchet MS', 'Segoe UI', 'Hiragino Maru Gothic ProN', 'Yu Gothic UI', sans-serif;
  --font-body: 'Quicksand', 'Segoe UI', 'Hiragino Sans', 'Malgun Gothic', sans-serif;
  --ink: #4A2C20;
  --ink-strong: #351D14;
  --cream: #FBF2DF;
  --cream-bright: #FFFDF7;
  --honey: #E9C89B;
  --honey-deep: #C58C5B;
  --sage: #83B84E;
  --sage-deep: #4E7B3A;
  --coral: #CF5C52;
  --sky: #68B2D8;
  --gold: #F4B956;
  --border-cocoa: #6D4538;
}

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

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

/* ============================================================================
 * 1. HEROIC NO-BOX TITLE SCREEN (`#title-screen`)
 * ==========================================================================*/
#title-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #F4E6C5;
}

.title-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.title-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, rgba(255, 253, 247, 0.08) 0%, rgba(74, 44, 32, 0.22) 100%);
  pointer-events: none;
}

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

/* Transparent wrapper around H1 — ZERO box/card/border wrapping the title! */
.title-hero-header {
  position: absolute;
  top: 5.5vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
  background: transparent;
  border: none;
  pointer-events: none;
  width: min(92vw, 960px);
}

#title-logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 5.1vw, 74px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: #FFFDF7;
  -webkit-text-stroke: 2.5px #5C382B;
  text-shadow: 0 5px 0 #5C382B, 0 10px 22px rgba(58, 35, 24, 0.35);
}

.title-sub-pill {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 20px;
  border-radius: 999px;
  background: rgba(251, 242, 223, 0.94);
  border: 2.5px solid #6D4538;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(92, 56, 43, 0.3);
}

/* Living animated woodland crafter showcase (cleanly disposed on Play) */
#title-hero-showcase {
  position: absolute;
  right: 8vw;
  bottom: 9vh;
  z-index: 9;
  width: clamp(190px, 21vw, 310px);
  height: clamp(220px, 28vw, 360px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

#title-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(58, 35, 24, 0.28));
}

.title-cta-dock {
  position: absolute;
  bottom: 11vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#title-loader {
  width: min(360px, 80vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.loader-label-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(251, 242, 223, 0.94);
  border: 2px solid #6D4538;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-strong);
}

.loader-track {
  width: 100%;
  height: 22px;
  background: #6D4538;
  border: 2.5px solid #4A2C20;
  border-radius: 999px;
  padding: 2px;
  overflow: hidden;
}

.loader-fill {
  width: 5%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #A9D96C 0%, #7CB342 100%);
  transition: width 0.14s ease-out;
}

#btn-title-play {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 250px;
  height: 68px;
  padding: 0 34px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #2A190F;
  filter: drop-shadow(0 5px 0 rgba(74, 44, 32, 0.45));
  transition: transform 0.12s ease;
}

#btn-title-play:hover {
  transform: translateY(-2px) scale(1.03);
}

#btn-title-play:active {
  transform: translateY(2px) scale(0.98);
}

.title-version-badge {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 12;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(251, 242, 223, 0.94);
  border: 2px solid #6D4538;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
  box-shadow: 0 3px 0 rgba(92, 56, 43, 0.25);
}

/* ============================================================================
 * 2. FULL-BLEED 16:9 GAMEPLAY CANVAS & FLOATING CORNER HUD
 * ==========================================================================*/
#game-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  overflow: hidden;
}

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

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

#ui-vfx-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 160;
  pointer-events: none;
}

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

/* TOP BAR — strict flex-wrap: nowrap at 1080p & 720p */
#hud-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 10px 14px;
  pointer-events: none;
}

#hud-resources,
#hud-top-right {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  pointer-events: auto;
}

.hud-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 14px 0 8px;
  border-radius: 999px;
  background: rgba(251, 242, 223, 0.96);
  border: 2.5px solid var(--border-cocoa);
  color: var(--ink-strong);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 3px 0 rgba(92, 56, 43, 0.28);
}

.hud-pill-ico {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}

.hud-timer-chip {
  display: none;
  padding: 2px 6px;
  border-radius: 999px;
  background: #E9C89B;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 800;
}

.hud-bonus-chip {
  display: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: #F4B956;
  border: 1.5px solid #6D4538;
  color: #2A190F;
  font-size: 12px;
  font-weight: 800;
}

.hud-sundial-pill {
  padding: 0 12px;
  background: rgba(255, 249, 232, 0.95);
}

.sundial-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #F4B956;
  border: 2px solid #6D4538;
  flex-shrink: 0;
}

/* Zone restoration progress pill */
.hud-zone-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(251, 242, 223, 0.96);
  border: 2.5px solid var(--border-cocoa);
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 3px 0 rgba(92, 56, 43, 0.28);
}

.zone-bar-track {
  width: 82px;
  height: 12px;
  border-radius: 999px;
  background: #7A5443;
  border: 1.5px solid #4A2C20;
  overflow: hidden;
  flex-shrink: 0;
}

.zone-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(180deg, #9FD662 0%, #6CA338 100%);
  border-radius: 999px;
  transition: width 0.2s ease;
}

/* Compact top-right icon utility buttons (46x46px, icon 28px = 61%) */
.icon-util-btn {
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  padding: 0 8px;
  border-radius: 14px;
  background: rgba(251, 242, 223, 0.96);
  border: 2.5px solid var(--border-cocoa);
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 3px 0 rgba(92, 56, 43, 0.28);
  transition: transform 0.1s ease;
}

.icon-util-btn:hover {
  transform: translateY(-1px);
  background: #FFFDF7;
}

.icon-util-btn img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  pointer-events: none;
}

.icon-util-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--ink-strong);
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.audio-mute-btn.is-muted svg .sound-wave {
  display: none;
}

.audio-mute-btn .sound-slash {
  display: none;
}

.audio-mute-btn.is-muted .sound-slash {
  display: block;
  stroke: #CF5C52;
}

/* ============================================================================
 * 3. LEFT FLOATING CAMP ORDERS TICKETS (<17% width, non-blocking)
 * ==========================================================================*/
#hud-orders-dock {
  position: fixed;
  left: 14px;
  top: 68px;
  width: 204px;
  z-index: 26;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.orders-header-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(251, 242, 223, 0.95);
  border: 2px solid var(--border-cocoa);
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

#hud-orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-ticket {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(251, 242, 223, 0.95);
  border: 2.5px solid var(--border-cocoa);
  box-shadow: 0 3px 0 rgba(92, 56, 43, 0.25);
}

.order-ticket.is-ready {
  border-color: #4E7B3A;
  background: #FFFDF7;
}

.order-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-item-ico {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(233, 200, 155, 0.35);
  border-radius: 10px;
  padding: 3px;
}

.order-info {
  flex: 1 1 auto;
  min-width: 0;
}

.order-item-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-strong);
  line-height: 1.2;
}

.order-reward-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.mini-cur-ico {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.order-deliver-btn {
  width: 100%;
  min-height: 34px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #2A190F;
  border-width: 7px 9px 7px 9px !important;
  border-image-width: 7px 9px 7px 9px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* ============================================================================
 * 4. BOTTOM-LEFT & BOTTOM-RIGHT COMPACT ACTION BUTTONS (Round 5 Golden Ratios!)
 * ==========================================================================*/
#hud-bottom-left {
  position: fixed;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
  z-index: 26;
}

#hud-bottom-right {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
  z-index: 26;
}

/* Round 5: height 80px (<= 105px), icon 42px (52.5% fill >= 32%), overflow: visible! */
.tool-btn,
.hud-btn {
  position: relative;
  overflow: visible !important;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 82px;
  height: 80px;
  padding: 6px 10px;
  border-radius: 16px;
  background: rgba(251, 242, 223, 0.96);
  border: 2.5px solid var(--border-cocoa);
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 0 rgba(92, 56, 43, 0.32);
  transition: transform 0.1s ease;
}

.tool-btn:hover,
.hud-btn:hover {
  transform: translateY(-2px);
  background: #FFFDF7;
}

.tool-btn:active,
.hud-btn:active {
  transform: translateY(1px);
}

.tool-btn.is-primary-tool {
  background: #E7F5CF;
  border-color: #4E7B3A;
}

.tool-btn img,
.hud-btn img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  pointer-events: none;
  flex-shrink: 0;
}

.tool-btn .btn-lbl,
.hud-btn .btn-lbl {
  font-size: 13px;
  line-height: 1.1;
  color: var(--ink-strong);
  white-space: nowrap;
}

/* Badges sit crisply inside top-right corner so button scrollWidth === clientWidth (0 clipping/overflow!) */
.notify-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 30;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 999px;
  background: #CF5C52;
  border: 2px solid #FFFDF7;
  color: #FFFDF7;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.tool-count {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 30;
  min-width: 20px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #6D4538;
  border: 2px solid #FFFDF7;
  color: #FFFDF7;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ============================================================================
 * 5. COZY TOAST & VISUAL SPOTLIGHT FTUE (pointer-events: none on cues!)
 * ==========================================================================*/
#cozy-toast {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 150;
  padding: 8px 18px;
  border-radius: 999px;
  background: #5C382B;
  border: 2px solid #FBF2DF;
  color: #FFFDF7;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#cozy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#tut-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  display: none;
}

#tut-layer.tut-hidden {
  opacity: 0;
}

#tut-spotlight {
  position: fixed;
  border-radius: 18px;
  border: 4px solid #FFD54F;
  box-shadow: 0 0 0 4px rgba(92, 56, 43, 0.35);
  pointer-events: none;
  animation: tutPulse 1.1s ease-in-out infinite;
}

#tut-hand {
  position: fixed;
  width: 40px;
  height: 40px;
  pointer-events: none;
  animation: tutBounce 0.9s ease-in-out infinite;
}

#tut-pill {
  position: fixed;
  padding: 6px 14px;
  border-radius: 999px;
  background: #FFFDF7;
  border: 2.5px solid #5C382B;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
}

#btn-tut-skip {
  position: fixed;
  top: 68px;
  right: 16px;
  pointer-events: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(251, 242, 223, 0.96);
  border: 2px solid #6D4538;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

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

@keyframes tutBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ============================================================================
 * 6. MODALS — MANDATORY FLEX SCROLL + ANTI-SAAS 60/25/15 CARDS
 * ==========================================================================*/
#modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  pointer-events: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(58, 38, 28, 0.56);
}

#modal-backdrop.is-open {
  display: flex;
  pointer-events: auto;
}

#modal-backdrop[aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
}

#active-modal-card.modal-card {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  width: min(880px, 94vw);
  overflow: hidden;
  padding: 8px 10px 10px;
  color: var(--ink-strong);
}

.modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 10px 8px;
}

#modal-title {
  margin: 0;
  padding: 4px 18px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  color: var(--ink-strong);
  border-width: 8px 14px 8px 14px !important;
  border-image-width: 8px 14px 8px 14px !important;
}

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

#btn-modal-close img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

#modal-tabs {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding: 0 12px 8px;
}

.modal-tab-btn {
  padding: 6px 13px;
  border-radius: 12px;
  border: 2px solid #8A614A;
  background: #EFE0C2;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-tab-btn.is-active {
  border-width: 8px 12px 6px 14px !important;
  border-image-width: 8px 12px 6px 14px !important;
  background: transparent;
  color: #2A190F;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 12px 12px;
}

/* Visual-First 60/25/15 Card Grids */
.vf-grid {
  display: grid;
  gap: 12px;
}
.vf-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vf-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vf-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.vf-card-portrait {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 8px 10px;
  min-height: 214px;
  text-align: center;
  cursor: default;
}

.vf-art-box {
  width: 100%;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vf-art-img {
  max-width: 94%;
  max-height: 100px;
  width: auto;
  height: 92px;
  object-fit: contain;
  pointer-events: none;
}

.art-silhouette {
  filter: brightness(0.35) sepia(0.4);
  opacity: 0.65;
}

.vf-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-strong);
  line-height: 1.2;
}

.vf-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.lv-pill,
.delta-pill {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(233, 200, 155, 0.65);
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 800;
}

.cur-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink-strong);
}

.cur-chip-ico {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.card-ribbon,
.vf-tag-pill {
  position: absolute;
  top: 4px;
  right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #FFFDF7;
  pointer-events: none;
}
.tag-starter { background: #4E7B3A; }
.tag-popular { background: #2D6484; }
.tag-best { background: #C46B1E; }

/* Cozy 9-slice buttons with clean scaled border-image width */
.cozy-btn {
  min-width: 150px;
  height: 50px;
  padding: 4px 20px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: #2A190F;
  border-width: 10px 12px 10px 12px !important;
  border-image-width: 10px 12px 10px 12px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.cozy-btn-sm {
  width: 100%;
  min-height: 38px;
  padding: 2px 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: #2A190F;
  border-width: 8px 10px 8px 10px !important;
  border-image-width: 8px 10px 8px 10px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.cozy-btn-xs {
  min-width: 72px;
  min-height: 34px;
  padding: 2px 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #2A190F;
  border-width: 7px 9px 7px 9px !important;
  border-image-width: 7px 9px 7px 9px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Seasons Banner */
.seasons-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.season-hero-banner,
.sn-hero-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-width: 10px 10px 10px 10px !important;
  border-image-width: 10px 10px 10px 10px !important;
  cursor: default;
}

.season-banner-img,
.sn-banner-art {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

.season-banner-info,
.sn-banner-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.season-banner-title,
.sn-banner-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-strong);
}

.season-banner-sub,
.sn-banner-sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.sn-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sn-help-btn {
  min-width: 36px !important;
  padding: 2px 8px !important;
}

.season-hero-banner .cozy-btn-sm {
  width: auto;
  min-width: 130px;
}

/* Settings Modal */
.settings-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-row,
.settings-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(233, 200, 155, 0.35);
  border: 2px solid rgba(109, 69, 56, 0.3);
}

.settings-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-strong);
  min-width: 100px;
}

.settings-row input[type="range"],
.settings-line input[type="range"] {
  flex: 1 1 auto;
  accent-color: #6D4538;
}

.settings-lang-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(233, 200, 155, 0.3);
  border: 2px solid rgba(109, 69, 56, 0.3);
}

.settings-lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lang-chip {
  padding: 6px 13px;
  border-radius: 10px;
  border: 2px solid var(--border-cocoa);
  background: #FFFDF7;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.lang-chip.is-selected {
  background: #83B84E;
  color: #FFFDF7;
  border-color: #4E7B3A;
}

.cozy-input {
  flex: 1 1 auto;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 2px solid var(--border-cocoa);
  background: #FFFDF7;
  color: var(--ink-strong);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
}

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

.settings-version-foot {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  opacity: 0.78;
  margin-top: 2px;
}

.pause-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 6px 10px;
  text-align: center;
}

.pause-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.daily-grid .vf-card-portrait.is-day7 {
  grid-column: span 2;
}

/* Chest, Victory & Exit Modals */
.chest-modal-wrap,
.victory-modal-wrap,
.exit-modal-wrap,
.chest-stage-wrap,
.victory-stage-wrap,
.exit-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 6px;
  text-align: center;
}

.chest-hero-img,
.victory-hero-img,
.exit-hero-img {
  width: 128px;
  height: 128px;
  object-fit: contain;
}

.victory-zone-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--ink-strong);
  margin: 6px 0;
}

.chest-rewards-row,
.chest-loot-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chest-loot-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 92px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-strong);
}

.loot-ico {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.exit-modal-desc,
.exit-stage-desc {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.exit-rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  width: 100%;
}

.exit-reward-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  color: var(--ink-strong);
}

.exit-reward-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.exit-reward-name {
  font-size: 13px;
  font-weight: 800;
}

.exit-reward-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: #CF5C52;
  color: #FFFDF7;
  font-size: 12px;
  font-weight: 800;
}

.exit-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.is-locked-hud {
  display: none !important;
}

.vf-card-portrait.is-locked {
  opacity: 0.88;
}

/* Consolidated Single Return-Day Summary Banner (1 clean card, 0 overlapping modals!) */
.return-summary-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 125;
  width: min(500px, 90vw);
  max-height: 82vh;
  padding: 16px 20px 18px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: var(--ink-strong);
  box-shadow: 0 12px 32px rgba(58, 35, 24, 0.36);
}

.return-summary-title {
  margin: 0;
  padding: 4px 18px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--ink-strong);
}

.return-summary-hero {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.return-summary-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Non-Blocking Contextual Feature Guide Banner */
.season-guide-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 155;
  pointer-events: none;
  max-width: min(680px, 92vw);
}

.season-guide-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-width: 10px 10px 10px 10px !important;
  border-image-width: 10px 10px 10px 10px !important;
  pointer-events: none;
}

.season-guide-ico {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.season-guide-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.season-guide-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-strong);
}

.season-guide-steps {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.season-guide-ok {
  pointer-events: auto;
  cursor: pointer;
  flex-shrink: 0;
}

/* Preview-only [DEV F2] Pill & Panel (strictly hidden in ReleaseHost) */
.dev-f2-pill {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 90;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(58, 38, 28, 0.86);
  border: 1.5px solid #F4B956;
  color: #FFFDF7;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.debug-panel {
  position: fixed;
  left: 50%;
  bottom: 46px;
  transform: translateX(-50%);
  z-index: 92;
  width: 230px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(45, 28, 20, 0.94);
  border: 2px solid #F4B956;
  color: #FFFDF7;
  display: none;
  flex-direction: column;
  gap: 6px;
}

.debug-title {
  font-size: 13px;
  font-weight: 800;
  color: #F4B956;
}

.debug-panel button {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #C58C5B;
  background: #5C382B;
  color: #FFFDF7;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

/* Compact 720p tuning */
@media (max-height: 760px) {
  #hud-top-right {
    gap: 6px;
  }
  .hud-pill,
  .hud-zone-pill {
    height: 40px;
    font-size: 14px;
  }
  .icon-util-btn {
    min-width: 40px;
    height: 40px;
  }
  .tool-btn,
  .hud-btn {
    min-width: 76px;
    height: 74px;
    padding: 5px 9px;
  }
  .tool-btn img,
  .hud-btn img {
    width: 38px;
    height: 38px;
  }
  .vf-card-portrait {
    min-height: 178px;
    padding: 6px 6px 8px;
    gap: 4px;
  }
  .vf-art-box {
    height: 92px;
  }
  .vf-art-img {
    height: 86px;
  }
  .sn-hero-banner {
    padding: 6px 12px;
  }
  .sn-banner-art {
    width: 50px;
    height: 50px;
  }
}
