/* Sunbeam Suds: Laundromat 3D — Cozy Pastel Storybook + UI Vault (cozy_stationery_craft)
 * Offline MSIX font stack (0 external CDNs), 0 backdrop-filter: blur() over WebGL.
 */
:root {
  --ink: #5A392E;
  --ink-deep: #3E261E;
  --cream: #FEFCEE;
  --parchment: #FBF2DF;
  --honey: #EAD0A6;
  --linen: #C6B893;
  --oak: #A88F6F;
  --mint: #6EC1B2;
  --sage: #83B84E;
  --terracotta: #DF8366;
  --gold: #F4B956;
  --font-display: 'Fredoka', 'M PLUS Rounded 1c', 'Trebuchet MS', 'Segoe UI', 'Hiragino Maru Gothic ProN', 'Malgun Gothic', sans-serif;
  --font-body: 'Quicksand', 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Malgun Gothic', 'Microsoft YaHei', sans-serif;
}

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

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

.hidden {
  display: none !important;
}

/* Full-bleed 3D WebGL Playfield (100vw x 100vh) */
#game-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
  cursor: pointer;
}

/* Idle-hidden Cut-in Director v2.0 Canvas */
#cutin-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 92;
  pointer-events: none;
  display: none;
}

/* ==========================================================================
 * HEROIC NO-BOX TITLE SCREEN (Full-bleed Key Art, ZERO Login-Box Container!)
 * ========================================================================== */
#title-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100vw;
  height: 100vh;
  background: url('../assets/art/title_bg.jpg') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 34px;
}

#title-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, rgba(254, 252, 238, 0.08) 0%, rgba(90, 57, 46, 0.28) 100%);
  pointer-events: none;
}

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

.title-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-version-tag {
  height: 40px;
  padding: 0 12px;
  border-width: 8px 11px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  filter: drop-shadow(0 3px 0 rgba(90, 57, 46, 0.3));
}

.title-save-pill {
  padding: 4px 16px;
  border-radius: 14px;
  background: rgba(254, 252, 238, 0.94);
  border: 2.5px solid #5A392E;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 0 rgba(90, 57, 46, 0.28);
}

.title-corner-btn {
  position: relative;
  overflow: visible !important;
  height: 46px;
  min-width: 46px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  filter: drop-shadow(0 3px 0 rgba(90, 57, 46, 0.35));
}

.title-corner-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
}

/* Floating Embossed Title Emblem — STRICTLY NO background/border box! */
.title-hero-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  background: transparent;
  border: none;
}

.game-main-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(46px, 5.4vw, 78px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: 0.01em;
  color: #FFFDF7;
  -webkit-text-stroke: 3px #5A392E;
  text-shadow: 0 5px 0 #5A392E, 0 10px 22px rgba(72, 42, 30, 0.35);
}

.title-subtitle-ribbon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 26px;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 800;
  color: var(--ink-deep);
  filter: drop-shadow(0 3px 0 rgba(90, 57, 46, 0.28));
}

.title-mascot-wrap {
  position: relative;
  width: clamp(165px, 18vw, 245px);
  height: clamp(180px, 24vh, 255px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#title-mascot-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(90, 57, 46, 0.32));
}

.title-bottom-cta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Real 0-100% Boot Loading Bar */
#boot-loader-wrap {
  width: min(360px, 78vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.boot-loader-track {
  width: 100%;
  height: 28px;
  padding: 3px;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(90, 57, 46, 0.72);
  border: 2.5px solid #FEFCEE;
}

#boot-loader-fill {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  background: linear-gradient(90deg, #83B84E, #B5D962);
  transition: width 160ms ease-out;
}

#boot-loader-text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: #FFFDF7;
  text-shadow: 0 2px 0 #5A392E;
}

/* Clean Primary PLAY CTA (NO attachSlotBorder ever!) */
#btn-title-play {
  min-width: 248px;
  height: 64px;
  padding: 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #FFFDF7;
  text-shadow: 0 2px 0 #3A5A1C;
  filter: drop-shadow(0 5px 0 rgba(70, 44, 34, 0.42));
}

/* ==========================================================================
 * 16:9 GAMEPLAY FLOATING HUD (Zero Sidebar Bloat, flex-wrap: nowrap at 720p)
 * ========================================================================== */
#gameplay-hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

#hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  padding: 6px 10px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

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

.hud-pill {
  height: 40px;
  padding: 0 11px;
  border-width: 9px 13px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-deep);
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 2px 0 rgba(90, 57, 46, 0.28));
}

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

.hud-open-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #67B84E;
  border: 2px solid #FFFDF7;
  flex-shrink: 0;
}

.hud-open-dot.paused {
  background: #F4B956;
}

.hud-nav-btn {
  position: relative;
  overflow: visible !important;
  height: 40px;
  padding: 0 6px;
  border-width: 8px 10px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: clamp(12px, 0.92vw, 13.5px);
  font-weight: 800;
  filter: drop-shadow(0 2px 0 rgba(90, 57, 46, 0.3));
}

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

.hud-icon-btn {
  position: relative;
  overflow: visible !important;
  width: 40px;
  height: 40px;
  padding: 0;
  border-width: 8px 9px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 0 rgba(90, 57, 46, 0.3));
}

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

.btn-lbl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.15;
}

/* Red-Dot Notification Badges (floats cleanly OUTSIDE button border!) */
.notify-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 12;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 10px;
  background: #DF4D45;
  color: #FFFDF7;
  border: 2px solid #FFFDF7;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.hud-lock-tag {
  position: absolute;
  bottom: -11px;
  right: -6px;
  z-index: 12;
  padding: 1px 5px;
  border-radius: 7px;
  background: #5A392E;
  color: #FEFCEE;
  border: 1.5px solid #EAD0A6;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.1;
  pointer-events: none;
}

/* Compact Floating Top-Left Objective Notepad (height <= 165px -> ZERO sidebar bloat!) */
#hud-objectives {
  position: fixed;
  top: 66px;
  left: 12px;
  width: 214px;
  padding: 8px 12px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  filter: drop-shadow(0 4px 0 rgba(90, 57, 46, 0.25));
}

.obj-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-deep);
}

.obj-branch-tag {
  padding: 2px 7px;
  border-radius: 8px;
  background: #E8C589;
  color: var(--ink-deep);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.obj-carry-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(254, 252, 238, 0.78);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.obj-goal-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.obj-goal-count {
  font-family: var(--font-display);
  font-weight: 800;
  color: #4C7F27;
  font-variant-numeric: tabular-nums;
}

/* Compact Bottom Action Bar (Round 5: 76-86px tiles, icon 55-62% height, overflow: visible) */
#hud-bottom-dock {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
  z-index: 24;
}

.action-tile-btn {
  position: relative;
  overflow: visible !important;
  width: 92px;
  height: 78px;
  border-width: 8px 8px 8px 8px !important;
  padding: 2px 3px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  filter: drop-shadow(0 4px 0 rgba(90, 57, 46, 0.34));
}

.action-tile-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
}

.action-tile-btn.active-boost {
  filter: drop-shadow(0 0 8px rgba(244, 185, 86, 0.95));
}

.hotkey-badge {
  position: absolute;
  top: -11px;
  right: -10px;
  z-index: 8;
  padding: 1px 6px;
  border-radius: 7px;
  background: #5A392E;
  color: #FEFCEE;
  border: 1.5px solid #EAD0A6;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
}

/* Toast Notification Banner */
#toast-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 85;
  padding: 8px 22px;
  border-radius: 18px;
  background: #FFF8E6;
  border: 3px solid #5A392E;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 4px 0 rgba(90, 57, 46, 0.3);
}

/* ==========================================================================
 * NON-BLOCKING VISUAL SPOTLIGHT FTUE (pointer-events: none backdrop -> 0 HIT_BLOCKED!)
 * ========================================================================== */
#tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 42;
  pointer-events: none;
}

#tut-spotlight {
  position: fixed;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 4px solid #FFE066;
  box-shadow: 0 0 0 6px rgba(255, 224, 102, 0.28);
  animation: tutPulse 1.1s ease-in-out infinite;
  pointer-events: none;
}

#tut-hand {
  position: fixed;
  width: 44px;
  height: 44px;
  pointer-events: none;
  animation: tutBob 0.85s ease-in-out infinite;
}

.tut-pill-bar {
  position: fixed;
  bottom: 102px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: #FFF9EB;
  border: 3px solid #5A392E;
  border-radius: 18px;
  pointer-events: auto;
  box-shadow: 0 4px 0 rgba(90, 57, 46, 0.3);
}

#tut-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-deep);
  white-space: nowrap;
}

#btn-tut-skip {
  height: 40px;
  min-width: 82px;
  border-width: 8px 10px !important;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  transition: filter 120ms ease;
}

#btn-tut-skip:hover {
  filter: brightness(1.06);
}

@keyframes tutPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.92; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

@keyframes tutBob {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-6px, -8px); }
}

/* ==========================================================================
 * COZY STATIONERY CRAFT MODALS (Strict Flex-Scroll 720p Safe, Anti-SaaS 60/25/15)
 * ========================================================================== */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(54, 34, 24, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: min(920px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 16px 14px;
  color: var(--ink-deep);
}

.modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-title-ribbon {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 900;
  color: var(--ink-deep);
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-help-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-width: 8px 9px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  color: var(--ink-deep);
  cursor: pointer;
}

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

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

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

/* Modal Sub-Tabs */
.m-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.m-tab-btn {
  height: 42px;
  padding: 0 14px;
  border-width: 8px 11px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-deep);
}

.m-tab-btn.active {
  border-width: 12px 10px 6px 20px !important;
  padding: 0 12px;
}

.m-tabs-compact {
  gap: 6px;
  margin-bottom: 10px;
}

.m-tab-btn-sm {
  height: 38px;
  padding: 0 9px;
  border-width: 7px 9px !important;
  font-size: 12.5px;
}

.m-tab-btn-sm.active {
  border-width: 10px 8px 5px 15px !important;
  padding: 0 9px;
}

.contract-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  margin-bottom: 10px;
}

.contract-banner-ico {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}

.contract-banner-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.contract-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-deep);
  font-variant-numeric: tabular-nums;
}

.contract-prog-track {
  width: 100%;
  height: 13px;
  border-radius: 8px;
  background: rgba(90, 57, 46, 0.22);
  border: 2px solid #5A392E;
  overflow: hidden;
}

.contract-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #83B84E, #F4B956);
  border-radius: 6px;
  transition: width 220ms ease;
}

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

.contract-royal-btn {
  height: 40px;
  padding: 0 12px;
  border-width: 8px 10px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  color: var(--ink-deep);
  flex-shrink: 0;
}

.pnl-early-pill {
  padding: 4px 12px;
  border-radius: 10px;
  background: rgba(244, 185, 86, 0.35);
  border: 2px solid #5A392E;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
}

/* Anti-SaaS 60/25/15 Portrait Card Grids (Strict minmax(0, 1fr) containment!) */
.vf-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.vf-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vf-grid-7d {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.vf-grid-7d > * {
  min-width: 0;
  max-width: 100%;
}

.vf-grid-3-compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.vf-grid-3-compact > * {
  min-width: 0;
  max-width: 100%;
}

.vf-grid-3-compact .vf-card-portrait {
  min-height: 184px;
  padding: 7px 8px 8px;
  gap: 4px;
}

.vf-grid-3-compact .m-art-stage {
  height: 82px;
  margin-top: 4px;
}

.vf-grid-3-compact .m-art-img {
  width: 72px;
  height: 72px;
}

.vf-grid-3-compact .m-cta-btn {
  height: 38px;
}

.vf-grid-4 > *, .vf-grid-3 > * {
  min-width: 0;
  max-width: 100%;
}

.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: 238px;
  text-align: center;
  color: var(--ink-deep);
}

.m-card-meta {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.vf-card-compact {
  min-height: 174px;
  padding: 7px 7px 8px;
  gap: 4px;
}

.vf-card-compact .m-art-stage {
  height: 78px;
  margin-top: 4px;
}

.vf-card-compact .m-art-img {
  width: 68px;
  height: 68px;
}

.vf-card-compact .m-cta-btn {
  height: 36px;
  font-size: 13px;
}

.vf-card-compact .m-rewards {
  gap: 5px;
  padding: 2px 6px;
  font-size: 12px;
}

.vf-card-compact .chip-icon {
  width: 16px;
  height: 16px;
}

.vf-card-wide {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}

.vf-card-wide .m-art-stage {
  width: 126px;
  height: 126px;
  flex-shrink: 0;
  margin-top: 0;
}

.vf-card-wide .m-art-img {
  width: 112px;
  height: 112px;
}

.vf-card-wide .m-card-meta {
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.vf-card-wide .m-title {
  font-size: 16px;
}

.vf-card-wide .m-cta-btn {
  height: 40px;
}

.m-lv-pill, .shop-badge-pill {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 6;
  padding: 2px 7px;
  border-radius: 8px;
  background: #5A392E;
  color: #FEFCEE;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
}

.shop-badge-pill {
  background: #DF5C4B;
}

.m-art-stage {
  width: 100%;
  height: 122px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 52%, rgba(255, 252, 238, 0.94) 0%, rgba(234, 208, 166, 0.36) 72%, rgba(234, 208, 166, 0.06) 100%);
}

.m-art-img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  filter: drop-shadow(0 4px 4px rgba(90, 57, 46, 0.24));
}

.shop-art-stage {
  height: 138px;
}

.shop-art-img {
  width: 124px;
  height: 124px;
}

.m-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 900;
  color: var(--ink-deep);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.m-stat-pill, .m-rewards {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(234, 208, 166, 0.52);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-deep);
  font-variant-numeric: tabular-nums;
}

.m-cta-btn {
  width: 100%;
  height: 44px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink-deep);
}

.currency-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

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

/* Settings Modal */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

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

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

.setting-ico {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.setting-label {
  flex: 1;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
}

.setting-toggle {
  min-width: 68px;
  height: 36px;
  font-size: 13px;
}

.lang-select-box {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 2.5px solid var(--ink);
  background: #FFFDF7;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.set-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.set-ver-tag {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(234, 208, 166, 0.65);
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
}

.settings-btn {
  min-width: 138px;
  height: 44px;
  font-size: 13.5px;
}

.reset-confirm-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 18px 20px;
  max-width: 520px;
  margin: 8px auto;
}

.reset-confirm-ico {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

/* P&L Celebration, Chest, Guide & Exit Modals */
.pnl-wrap, .chest-wrap, .exit-body-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 6px;
}

.pnl-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
}

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

.pnl-ledger {
  flex: 1;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pnl-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 252, 240, 0.85);
  font-size: 15px;
  font-weight: 800;
}

.pnl-net-line {
  background: #F4D89E;
  font-size: 18px;
}

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

.exit-headline {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--ink-deep);
}

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

.exit-jump-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
}

.exit-card-img, .exit-mascot-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.exit-mascot-img {
  width: 112px;
  height: 112px;
}

.exit-card-lbl {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
}

.exit-card-cnt {
  padding: 2px 8px;
  border-radius: 8px;
  background: #83B84E;
  color: #FFFDF7;
  font-size: 12px;
  font-weight: 900;
}

.exit-note {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.exit-cta {
  min-width: 156px;
  height: 48px;
  font-size: 15px;
}

.chest-big-img {
  width: 124px;
  height: 124px;
  object-fit: contain;
}

.chest-loot {
  display: flex;
  gap: 14px;
}

.chest-reward-chip {
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 900;
}

.guide-flow-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 4px;
}

.guide-flow-step {
  flex: 1;
  max-width: 210px;
  min-height: 150px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.guide-step-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.guide-step-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
}

.guide-flow-arrow {
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
}

.guide-footer {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* Preview-Only [DEV F2] Pill & Collapsible Debug Drawer (NEVER mounted in ReleaseHost!) */
#dev-f2-pill {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 45;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: #3E261E;
  color: #FEFCEE;
  border: 2px solid #EAD0A6;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

#debug-panel {
  position: fixed;
  right: 12px;
  bottom: 54px;
  z-index: 120;
  width: 248px;
  padding: 10px;
  border-radius: 14px;
  background: #FFF9EB;
  border: 3px solid #5A392E;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#debug-panel button {
  height: 32px;
  border-radius: 8px;
  border: 2px solid #5A392E;
  background: #EAD0A6;
  color: #3E261E;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/* Compact 720p vertical fit so 7-Day Boutique & 7-Day Login show all 7 Claim buttons with 0 scroll clipping */
@media (max-height: 800px) {
  .modal-card {
    max-height: 94vh;
    padding: 8px 14px 10px;
  }
  .modal-header {
    margin-bottom: 6px;
  }
  .m-tabs {
    margin-bottom: 7px;
  }
  .contract-banner {
    padding: 4px 10px;
    margin-bottom: 7px;
    border-width: 11px 12px !important;
  }
  .contract-banner-ico {
    width: 36px;
    height: 36px;
  }
  .contract-royal-btn {
    height: 34px;
    border-width: 6px 8px !important;
    font-size: 12.5px;
  }
  .vf-grid-7d {
    gap: 7px;
  }
  .vf-card-compact {
    min-height: 146px;
    padding: 5px 6px 6px;
    gap: 2px;
  }
  .vf-card-compact .m-art-stage {
    height: 58px;
    margin-top: 2px;
  }
  .vf-card-compact .m-art-img {
    width: 52px;
    height: 52px;
  }
  .vf-card-compact .m-card-meta {
    gap: 3px;
  }
  .vf-card-compact .m-cta-btn {
    height: 32px;
    border-width: 7px 9px !important;
    font-size: 12.5px;
  }
  .vf-card-wide {
    padding: 6px 12px;
  }
  .vf-card-wide .m-art-stage {
    width: 96px;
    height: 96px;
  }
  .vf-card-wide .m-art-img {
    width: 84px;
    height: 84px;
  }
}

/* Responsive fallback for narrow viewports */
@media (max-width: 900px) {
  .vf-grid-4, .vf-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
