/* =========================================================================
 * css/style.css — Cozy Pastel Storybook UI ("Bloom Braid: Rope Sort")
 * Archetype: Cats & Soup / Animal Restaurant Sunlit Cat-Atelier
 * Palette: #FAEDD2, #F4F6EB, #DCAE90, #B7CBBE, #6ED4D6, #A9EAE9, #AA6891, #5A3E36
 * STRICTLY ZERO dark obsidian/neon, 9-slice border-image only, ZERO clipped badges!
 * ========================================================================= */

:root {
  --bg-cream: #FAEDD2;
  --bg-linen: #F4F6EB;
  --parchment: #FFFDF7;
  --parchment-warm: #FDF6E7;
  --wood-tan: #DCAE90;
  --wood-deep: #B58363;
  --sage-mist: #B7CBBE;
  --aqua-bloom: #6ED4D6;
  --mint-breeze: #A9EAE9;
  --plum-mauve: #AA6891;
  --ink-cocoa: #4A3028;
  --ink-soft: #4F342A;
  --gold-sun: #F6AD55;
  --coral-dot: #E55353;

  --font-display: 'Segoe UI Rounded', 'Trebuchet MS', 'Yu Gothic UI', 'Malgun Gothic', 'Microsoft YaHei UI', system-ui, sans-serif;
  --font-body: 'Segoe UI', 'Yu Gothic UI', 'Malgun Gothic', 'Microsoft YaHei UI', system-ui, sans-serif;
}

[hidden] {
  display: none !important;
}

*, *::before, *::after {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-drag: none;
}

input, select, textarea {
  user-select: text;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-cream);
  color: var(--ink-cocoa);
  font-family: var(--font-body);
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}

.hud-num {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink-cocoa);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
 * UNIVERSAL BUTTONS, LABELS & 9-SLICE ANTI-DISTORTION LAW
 * ========================================================================= */
button {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink-cocoa);
  cursor: pointer;
  overflow: visible !important;
  position: relative;
  transition: transform 0.12s ease, filter 0.14s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1.5px);
  filter: brightness(1.04);
}

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

button:disabled {
  cursor: default;
  opacity: 0.68;
}

.btn-label {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(11px, 0.92vw, 14px);
  line-height: 1.25;
  vertical-align: middle;
}

/* Painted 9-Slice Primary Button (`btn_primary.png` 1144x499, slice 132 126 188 126) */
.btn-9slice {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible !important;
  position: relative;
  border-width: 12px 14px 16px 14px;
  border-image: url('../assets/ui/btn_primary.png') 132 126 188 126 fill / 12px 14px 16px 14px / 0 stretch;
  filter: drop-shadow(0 3px 0 rgba(90, 62, 54, 0.28));
  color: #5A3E36;
  padding: 2px 10px;
  min-height: 40px;
  text-decoration: none;
}

.btn-9slice:hover:not(:disabled) {
  filter: brightness(1.04) drop-shadow(0 4px 0 rgba(90, 62, 54, 0.30));
}

.btn-9slice.btn-hero {
  border-width: 18px 20px 24px 20px;
  border-image-width: 18px 20px 24px 20px;
  min-height: 54px;
  padding: 2px 22px;
}

.btn-9slice.btn-hero .btn-label {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.35vw, 21px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Painted 9-Slice Modal & Hero Frame (`frame_panel.png` 1306x699, slice 302 597 282 452) */
.panel-9slice {
  box-sizing: border-box;
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  border-width: 36px 46px 34px 42px;
  border-image: url('../assets/ui/frame_panel.png') 302 597 282 452 fill / 36px 46px 34px 42px / 0 stretch;
  filter: drop-shadow(0 12px 24px rgba(90, 62, 54, 0.24));
  color: #5A3E36;
}

/* Tactile Secondary Cozy Cream Button */
.btn-secondary-cozy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--parchment);
  border: 2.5px solid var(--wood-tan);
  border-bottom-width: 4px;
  border-radius: 14px;
  padding: 7px 14px;
  min-height: 38px;
  color: var(--ink-cocoa);
  overflow: visible !important;
  position: relative;
}

.btn-secondary-cozy:hover:not(:disabled) {
  background: #FFF9EC;
  border-color: var(--wood-deep);
}

/* Compact Sidebar Parchment Card (preserves full inner width on 1280px screens!) */
.parchment-card {
  background: rgba(255, 253, 247, 0.94);
  border: 2.5px solid var(--wood-tan);
  border-radius: 18px;
  box-shadow: 0 4px 0 rgba(181, 131, 99, 0.24), inset 0 0 0 2px rgba(250, 237, 210, 0.75);
  padding: 9px 11px;
  color: var(--ink-cocoa);
  overflow: visible !important;
  position: relative;
}

/* Universal Unclipped Red-Dot Notification Badge */
.notify-badge {
  position: absolute;
  top: -2px;
  right: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FF8A8A, var(--coral-dot));
  border: 2px solid var(--parchment);
  box-shadow: 0 2px 5px rgba(90, 62, 54, 0.35), 0 0 0 0 rgba(255, 107, 107, 0.48);
  z-index: 30;
  pointer-events: none;
  animation: notifyPulse 1.6s ease-in-out infinite;
}

@keyframes notifyPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 5px rgba(90, 62, 54, 0.35), 0 0 0 0 rgba(255, 107, 107, 0.48);
  }
  50% {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(90, 62, 54, 0.35), 0 0 0 4px rgba(255, 107, 107, 0);
  }
}

/* Progressive Feature Unlock States (`js/unlocks.js`) */
.feature-hidden {
  display: none !important;
}

.feature-locked {
  opacity: 0.96;
  filter: none;
  background-color: #F7EFE1 !important;
  border-color: #C79E80 !important;
  color: #38221B !important;
}

.feature-locked::after {
  content: attr(data-lock-label);
  position: absolute;
  bottom: -7px;
  right: 8px;
  background: var(--plum-mauve);
  color: #FFFDF7;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9px;
  border: 1.5px solid #FFFDF7;
  white-space: nowrap;
  pointer-events: none;
  z-index: 18;
}

.btn-icon-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.btn-icon-sm, .inline-icon-sm {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  vertical-align: middle;
}

/* =========================================================================
 * TITLE SCREEN (#title-screen)
 * ========================================================================= */
.title-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.title-bg-layer {
  position: absolute;
  inset: 0;
  background: var(--bg-cream) url('../assets/art/title_bg.png') center center / cover no-repeat;
  z-index: 0;
}

.title-sunlight-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 253, 247, 0.14), rgba(250, 237, 210, 0.56));
  z-index: 1;
  pointer-events: none;
}

.title-top-bar {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.cozy-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 253, 247, 0.94);
  border: 2px solid var(--wood-tan);
  border-bottom-width: 3.5px;
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--ink-cocoa);
  box-shadow: 0 3px 8px rgba(90, 62, 54, 0.14);
}

.title-center-card {
  position: relative;
  z-index: 2;
  width: min(560px, 92vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: cozyPopIn 0.36s cubic-bezier(0.22, 1.25, 0.36, 1);
}

.title-mascot-crest {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-top: -8px;
  position: relative;
  padding: 6px 14px;
}

.title-mascot-crest::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  width: 152px;
  height: 136px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 250, 234, 0.96) 0%, rgba(254, 240, 205, 0.62) 54%, rgba(250, 237, 210, 0) 78%);
  pointer-events: none;
  z-index: 0;
}

.title-mochi-hero,
.title-mochi-hero.tb-portrait-feather {
  position: relative;
  z-index: 1;
  width: 102px;
  height: 114px;
  object-fit: contain;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(ellipse 65% 67% at 50% 49%, #000 52%, rgba(0, 0, 0, 0.56) 74%, transparent 96%) !important;
  mask-image: radial-gradient(ellipse 65% 67% at 50% 49%, #000 52%, rgba(0, 0, 0, 0.56) 74%, transparent 96%) !important;
  -webkit-mask-composite: source-over;
  mask-composite: add;
  filter: drop-shadow(0 6px 14px rgba(246, 173, 85, 0.34));
  animation: gentleFloat 3.2s ease-in-out infinite;
}

.crest-bloom {
  position: relative;
  z-index: 2;
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(90, 62, 54, 0.18));
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.title-emblem {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.1vw, 40px);
  font-weight: 800;
  line-height: 1.12;
  color: #FFF9EE;
  -webkit-text-stroke: 2px #5A3E36;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #5A3E36;
}

.title-tagline {
  margin: 0 0 4px;
  font-size: clamp(13px, 1.15vw, 16px);
  color: var(--ink-soft);
  font-weight: 700;
}

.title-loading-wrap {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 0 4px;
}

.title-loading-track {
  width: 100%;
  height: 16px;
  background: var(--parchment-warm);
  border: 2px solid var(--wood-tan);
  border-radius: 999px;
  overflow: hidden;
  padding: 2px;
}

.title-loading-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--aqua-bloom), #8DE2D5, var(--gold-sun));
  transition: width 0.16s ease-out;
}

.title-loading-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 700;
}

.title-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.btn-9slice.btn-hero.title-play-btn,
.title-play-btn {
  min-width: 228px;
  min-height: 54px;
  padding: 10px 30px;
  border-image: none !important;
  border: 2.5px solid #449FA3 !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #A2F5ED 0%, #6ED4D6 55%, #4CC0C4 100%) !important;
  box-shadow: 0 7px 18px rgba(76, 192, 196, 0.38), 0 3px 8px rgba(90, 62, 54, 0.14), inset 0 2px 0 rgba(255, 255, 255, 0.85) !important;
  filter: none !important;
  color: #173639 !important;
}

.btn-9slice.btn-hero.title-play-btn:hover:not(:disabled),
.title-play-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #B4FAF3 0%, #7CE0E2 55%, #56CACD 100%) !important;
  box-shadow: 0 9px 22px rgba(76, 192, 196, 0.48), 0 4px 10px rgba(90, 62, 54, 0.16), inset 0 2px 0 rgba(255, 255, 255, 0.92) !important;
  filter: none !important;
}

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

.title-sub-btn {
  min-width: 182px;
  background: #FFFDF7 !important;
  border: 2px solid #C69370 !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 12px rgba(90, 62, 54, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #2E1B15 !important;
}

.title-sub-btn .btn-label {
  color: #2E1B15 !important;
  font-weight: 800;
}

/* =========================================================================
 * 16:9 3-COLUMN COZY CAT-ATELIER SHELL (#game-shell)
 * ========================================================================= */
.game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.arena-bg-layer {
  position: absolute;
  inset: 0;
  background: var(--bg-linen) url('../assets/art/arena_bg.png') center center / cover no-repeat;
  opacity: 0.44;
  z-index: 0;
  pointer-events: none;
}

/* TOP BAR (56px, zero wrap/overflow across all 9 languages at 1280x720+) */
.top-bar {
  position: relative;
  z-index: 10;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px;
  background: rgba(255, 253, 247, 0.90);
  border-bottom: 2.5px solid var(--wood-tan);
  box-shadow: 0 3px 10px rgba(90, 62, 54, 0.08);
  min-width: 0;
}

.top-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.top-cluster-left {
  flex: 0 1 auto;
}

.top-cluster-center {
  flex: 1 1 auto;
  justify-content: center;
  gap: 10px;
}

.top-cluster-right {
  flex: 0 1 auto;
  justify-content: flex-end;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px;
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-bottom-width: 3px;
  border-radius: 999px;
  color: var(--ink-cocoa);
  min-width: 0;
}

.hud-name-pill {
  max-width: 175px;
}

.hud-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-cream);
  border: 1.5px solid var(--wood-tan);
  flex-shrink: 0;
}

.edit-pen-svg {
  opacity: 0.65;
  flex-shrink: 0;
}

.hud-coins-pill {
  background: #FFF9EB;
  border-color: #E3B678;
}

.hud-coin-icon {
  width: 21px;
  height: 21px;
  object-fit: contain;
  flex-shrink: 0;
}

.hud-plus-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--aqua-bloom);
  color: var(--ink-cocoa);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.hud-pill-pop {
  animation: hudPop 0.24s ease-out;
}

@keyframes hudPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.level-badge-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.08;
  min-width: 0;
}

.level-badge-text {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.05vw, 16px);
  font-weight: 700;
  color: var(--ink-cocoa);
  white-space: nowrap;
}

.chapter-sub-text {
  font-size: 10.5px;
  color: var(--ink-soft);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pot-quota-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 999px;
  padding: 4px 11px 4px 7px;
  min-width: 155px;
  max-width: 240px;
}

.pot-quota-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.pot-quota-track {
  flex: 1 1 68px;
  height: 11px;
  background: var(--parchment-warm);
  border: 1.5px solid var(--wood-tan);
  border-radius: 999px;
  overflow: hidden;
  min-width: 48px;
}

.pot-quota-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--aqua-bloom), #5FD3A6);
  border-radius: 999px;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.pot-quota-text {
  font-size: 12px;
  white-space: nowrap;
}

.hud-mode-pill {
  max-width: 112px;
  background: #F1FAF8;
  border-color: #8AC8C5;
}

.hud-mode-pill.is-tactician {
  background: #FBF0F6;
  border-color: var(--plum-mauve);
}

.zoom-pill-group {
  display: inline-flex;
  align-items: center;
  height: 36px;
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-bottom-width: 3px;
  border-radius: 999px;
  padding: 0 3px;
}

.zoom-step-btn {
  width: 24px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 800;
  padding: 0;
  line-height: 1;
}

.zoom-pct-btn {
  border: none;
  background: transparent;
  font-size: 11.5px;
  padding: 0 4px;
  min-width: 38px;
}

.hud-zen-pill {
  max-width: 88px;
}

.hud-zen-pill.is-active {
  background: #E8F8F5;
  border-color: var(--aqua-bloom);
}

.hud-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-bottom-width: 3px;
  padding: 0;
  flex-shrink: 0;
}

.hud-quit-pill {
  max-width: 116px;
  background: #FFF5F5;
  border-color: #DFA5A5;
}

/* 3-COLUMN WORKBENCH BODY (fills >= 94% of 16:9 viewport!) */
.atelier-columns {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  width: min(1860px, 97vw);
  margin: 0 auto;
  padding: 10px 8px 12px;
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.side-panel {
  width: 22%;
  min-width: 236px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
}

.center-stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#board-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.board-tooltip {
  position: absolute;
  left: 50%;
  top: 48px;
  transform: translate(-50%, -6px);
  background: rgba(255, 253, 247, 0.97);
  border: 2px solid var(--plum-mauve);
  color: var(--ink-cocoa);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(90, 62, 54, 0.20);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 15;
  max-width: 88%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-tooltip[hidden] {
  display: none !important;
}

.board-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* =========================================================================
 * LEFT PANEL CARDS (Mochi, 7-Day Streak, Daily, Home Puzzle, Botanical Album)
 * ========================================================================= */
.mochi-card {
  padding: 8px 10px;
}

.mochi-stage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#mochi-canvas {
  width: 106px;
  height: 96px;
  flex-shrink: 0;
  cursor: pointer;
}

.mochi-bubble-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mochi-name-tag {
  display: inline-flex;
  align-self: flex-start;
  background: var(--bg-cream);
  border: 1.5px solid var(--wood-tan);
  border-radius: 999px;
  padding: 1px 9px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-cocoa);
}

.mochi-speech {
  background: var(--parchment-warm);
  border: 1.5px dashed var(--wood-tan);
  border-radius: 12px;
  padding: 6px 8px;
  font-size: 11.5px;
  line-height: 1.32;
  color: var(--ink-cocoa);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.speech-pop {
  animation: hudPop 0.24s ease-out;
}

.meta-card-btn {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  min-width: 0;
}

.streak-mini-card {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.meta-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding-right: 2px;
}

.meta-card-head .meta-card-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(11.5px, 0.9vw, 13.5px);
}

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

.meta-card-icon-lg {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 3px rgba(90, 62, 54, 0.16));
}

.meta-card-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.meta-card-title {
  font-family: var(--font-display);
  font-size: clamp(12px, 0.96vw, 14px);
  font-weight: 700;
  color: var(--ink-cocoa);
}

.meta-card-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: #3B241C;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-pill-count {
  flex: 0 0 auto;
  margin-left: 4px;
  font-size: 10.5px;
  font-weight: 800;
  color: #2E1B15;
  background: #FDF3DF;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1.5px solid #C89674;
  white-space: nowrap;
}

.streak-mini-dots {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.s-dot {
  height: 20px;
  border-radius: 7px;
  background: var(--parchment-warm);
  border: 1.5px solid var(--wood-tan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.s-dot.is-done {
  background: #C6F6D5;
  border-color: #48BB78;
  color: #22543D;
}

.s-dot.is-ready {
  background: #FEFCBF;
  border-color: var(--gold-sun);
  color: var(--ink-cocoa);
}

.s-dot-chest {
  background: #FDE8E8;
  border-color: var(--plum-mauve);
}

/* =========================================================================
 * RIGHT PANEL CARDS (Intel, Boosters, 6-Theme Swapper, Passes & Boutique)
 * ========================================================================= */
.card-section-title {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.intel-stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--parchment-warm);
  border: 1.5px solid rgba(220, 174, 144, 0.7);
  border-radius: 11px;
  padding: 5px 7px;
  min-width: 0;
}

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

.intel-stat-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.intel-stat-lbl {
  font-size: 10px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-stat-num {
  font-size: 13.5px;
}

.booster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 9px;
}

.booster-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--parchment-warm);
  border: 2px solid var(--wood-tan);
  border-bottom-width: 3px;
  border-radius: 14px;
  padding: 5px 5px;
  min-height: 61px;
  min-width: 0;
}

.booster-btn.is-hint-active {
  background: #E6FFFA;
  border-color: #38B2AC;
  box-shadow: 0 0 0 2px rgba(56, 178, 172, 0.24);
}

.booster-btn.is-hint-free-flash {
  animation: hintFreeFlash 0.56s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes hintFreeFlash {
  0% { transform: scale(1); box-shadow: 0 0 0 2px rgba(56, 178, 172, 0.28); }
  30% { transform: scale(1.06); box-shadow: 0 0 0 5px rgba(56, 178, 172, 0.48); background: #CCFBF1; }
  100% { transform: scale(1); box-shadow: 0 0 0 2px rgba(56, 178, 172, 0.24); }
}

.hint-free-tag {
  position: absolute;
  top: 4px;
  right: 5px;
  background: #0D9488;
  color: #FFFFFF;
  border: 1px solid #0F766E;
  border-radius: 6px;
  padding: 0 4.5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.4;
  pointer-events: none;
  z-index: 2;
}

.hint-free-tag[hidden] {
  display: none !important;
}

.hint-free-pop {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translate(-50%, -100%);
  background: #0F766E;
  color: #FFFFFF;
  border: 1.5px solid #99F6E4;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  z-index: 40;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.28);
  animation: hintFreePopFloat 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes hintFreePopFloat {
  0% { opacity: 0; transform: translate(-50%, -70%) scale(0.86); }
  18% { opacity: 1; transform: translate(-50%, -108%) scale(1.04); }
  72% { opacity: 1; transform: translate(-50%, -126%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -152%) scale(0.96); }
}

.booster-btn:hover:not(:disabled) {
  background: #FFFDF8;
  border-color: var(--aqua-bloom);
}

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

.hotkey-tag {
  position: absolute;
  top: 4px;
  left: 5px;
  background: var(--parchment);
  border: 1.5px solid var(--wood-tan);
  border-radius: 6px;
  padding: 0 4.5px;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ink-soft);
  line-height: 1.35;
}

.booster-count-pill {
  background: var(--parchment);
  border: 1.5px solid var(--wood-tan);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  line-height: 1.35;
}

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

.theme-mini-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--parchment-warm);
  border: 1.8px solid rgba(220, 174, 144, 0.75);
  border-radius: 11px;
  padding: 4px 3px;
  min-width: 0;
}

.theme-mini-pill.is-active {
  background: #E6FFFA;
  border-color: var(--aqua-bloom);
  box-shadow: inset 0 0 0 1px var(--aqua-bloom);
}

.theme-mini-pill.is-locked {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.theme-mini-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.theme-mini-lbl {
  font-size: 9.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-cta-stack {
  margin-top: 2px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.right-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 8px;
  min-width: 0;
}

.right-shop-btn {
  width: 100%;
  min-height: 44px;
  padding: 2px 8px;
  min-width: 0;
}

.right-cta-btn .btn-label,
.right-shop-btn .btn-label {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

/* =========================================================================
 * MODALS, GRIDS & CELEBRATIONS (`#modal-root` — `js/modals.js` & `js/exit_modal.js`)
 * ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(58, 40, 34, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: scrimFadeIn 0.2s ease-out;
}

.modal-backdrop.is-closing {
  opacity: 0;
  transition: opacity 0.17s ease-in;
}

.modal-backdrop.is-closing .modal-card {
  transform: scale(0.9);
  transition: transform 0.17s ease-in;
}

@keyframes scrimFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cozyPopIn {
  0% { opacity: 0; transform: scale(0.84); }
  70% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

.modal-card {
  width: min(680px, 94vw);
  max-height: min(90vh, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  animation: cozyPopIn 0.25s cubic-bezier(0.22, 1.25, 0.36, 1);
  min-width: 0;
  overflow: hidden;
}

.modal-card-wide {
  width: min(880px, 95vw);
}

.shop-modal-card, .modal-card:has(.shop-grid) {
  width: min(960px, 95vw);
}

.modal-card-compact {
  width: min(500px, 93vw);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 2px dashed rgba(220, 174, 144, 0.65);
  margin-bottom: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.modal-header-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.6vw, 23px);
  font-weight: 800;
  color: var(--ink-cocoa);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-header-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.modal-help-btn, .modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  padding: 0;
}

.coach-card {
  display: none;
  background: #FFF9EB;
  border: 1.8px solid var(--wood-tan);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-cocoa);
}

.coach-card.is-open {
  display: block;
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  outline: none;
}

.modal-body > * {
  flex-shrink: 0;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(220, 174, 144, 0.22);
  border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(181, 131, 99, 0.72);
  border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(90, 62, 54, 0.85);
}

.modal-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px dashed rgba(220, 174, 144, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

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

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

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

.modal-sub-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* SHOP MODAL */
.shop-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.shop-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: #3E261E;
}

.shop-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  color: #24120B;
  border: 2px solid #B7791F;
  box-shadow: 0 2px 6px rgba(90, 62, 54, 0.12);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13.5px;
  font-weight: 800;
}

.shop-balance-pill span {
  color: #24120B;
}

.shop-status-banner {
  display: none;
  background: #E6FFFA;
  border: 1.8px solid var(--aqua-bloom);
  border-radius: 11px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.shop-status-banner.is-visible {
  display: block;
}

.shop-card {
  position: relative;
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 118px;
  align-items: center;
  column-gap: 10px;
  min-height: 104px;
  height: 100%;
  overflow: visible !important;
}

.shop-card-starter-glow {
  border-color: #6ED4D6;
  box-shadow: 0 0 0 2px rgba(110, 212, 214, 0.35), 0 4px 12px rgba(49, 151, 149, 0.16);
}

.hud-booster-css-glow {
  border-color: #F687B3 !important;
  box-shadow: 0 0 0 2px rgba(246, 135, 179, 0.28), 0 2px 6px rgba(184, 50, 128, 0.14);
}

.shop-badge {
  position: absolute;
  top: -9px;
  left: 12px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  color: #FFFDF7;
  background: var(--plum-mauve);
  border: 1.5px solid #FFFDF7;
  letter-spacing: 0.04em;
  z-index: 5;
}

.badge-starter { background: #DD6B20; }
.badge-popular { background: #319795; }
.badge-best { background: #B83280; }
.badge-pass { background: #805AD5; }
.badge-vip { background: #D69E2E; color: #5A3E36; }

.shop-card-media {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: var(--parchment-warm);
  border: 1.5px solid rgba(220, 174, 144, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shop-card-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.shop-card-info {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  overflow: visible;
}

.shop-card-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: #36211B;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.shop-card-desc {
  font-size: 11.5px;
  font-weight: 600;
  color: #452C23;
  line-height: 1.34;
  display: block;
  overflow: visible;
  white-space: normal;
  overflow-wrap: break-word;
}

.shop-buy-btn {
  width: 136px;
  min-width: 136px;
  max-width: 142px;
  min-height: 40px;
  padding: 2px 6px;
  justify-self: end;
  align-self: center;
  flex-shrink: 0;
}

.shop-buy-btn .btn-label {
  font-size: clamp(10.5px, 0.8vw, 12.2px);
}

/* DAILY STREAK & CHALLENGE MODAL */
.streak-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.streak-day-card {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 14px;
  padding: 8px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  min-width: 0;
}

.streak-day-card.is-ready {
  background: #FFFBEB;
  border-color: var(--gold-sun);
  box-shadow: 0 0 0 2px rgba(246, 173, 85, 0.32);
}

.streak-day-card.is-claimed {
  background: #F0FFF4;
  border-color: #68D391;
}

.streak-day-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
}

.streak-day-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.streak-day-reward {
  font-size: 11.5px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.streak-status-pill {
  width: 100%;
  border-radius: 9px;
  border: 1.5px solid var(--wood-tan);
  background: var(--parchment-warm);
  padding: 4px 4px;
  font-size: 10.5px;
}

.streak-claim-btn {
  width: 100%;
  min-height: 32px;
  padding: 0 4px;
}

.daily-challenge-box {
  background: var(--parchment);
  border: 2px solid var(--aqua-bloom);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.daily-challenge-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.daily-challenge-desc {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* HOME PICTURE PUZZLE GALLERY */
.puzzle-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.puzzle-pieces-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #E6FFFA;
  border: 2px solid var(--aqua-bloom);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 700;
}

.puzzle-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.puzzle-tab-pill {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 999px;
  padding: 4px 11px;
}

.puzzle-tab-pill.is-active {
  background: var(--bg-cream);
  border-color: var(--ink-cocoa);
}

.puzzle-desc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.puzzle-progress-pill {
  background: var(--parchment);
  border: 1.5px solid var(--wood-tan);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 700;
  color: var(--ink-cocoa);
}

.puzzle-frame-wrap {
  background: #EAD4B8;
  border: 4px solid var(--wood-deep);
  border-radius: 16px;
  padding: 8px;
  width: min(460px, 100%);
  margin: 0 auto;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  aspect-ratio: 16 / 9;
  gap: 3px;
  background: rgba(90, 62, 54, 0.18);
  border-radius: 10px;
  overflow: hidden;
}

.puzzle-slot {
  border: 1.5px dashed rgba(90, 62, 54, 0.35);
  background-color: var(--parchment-warm);
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 4px;
}

.puzzle-slot.is-placed {
  border: none;
  opacity: 1 !important;
}

.puzzle-slot.is-placeable {
  background-color: #E6FFFA;
  border-color: var(--aqua-bloom);
  cursor: pointer;
}

.puzzle-slot-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
}

.puzzle-reward-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 14px;
  padding: 8px 12px;
}

.puzzle-reward-info {
  font-size: 12.5px;
  font-weight: 700;
}

/* BOTANICAL ALBUM & 6-THEME WARDROBE */
.album-tabs {
  margin-bottom: 2px;
}

.album-tab-btn {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 12px;
  padding: 7px 12px;
}

.album-tab-btn.is-active {
  background: #E6FFFA;
  border-color: var(--aqua-bloom);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.album-species-card {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 14px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  min-width: 0;
}

.album-species-card.is-undiscovered .album-bloom-img {
  filter: brightness(0.35) opacity(0.45);
}

.album-species-art {
  position: relative;
  width: 52px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-bloom-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  transform: translateY(-6px);
}

.album-pot-mini {
  position: absolute;
  bottom: 0;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.album-species-name {
  font-size: 11.5px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-species-count {
  font-size: 10.5px;
  color: var(--ink-soft);
}

.album-done-pill {
  font-size: 10px;
  background: #E6FFFA;
  border: 1px solid var(--aqua-bloom);
  border-radius: 999px;
  padding: 1px 8px;
}

.theme-wardrobe-card {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-wardrobe-card.is-equipped {
  border-color: var(--aqua-bloom);
  background: #F2FFFD;
}

.theme-wardrobe-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

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

.theme-wardrobe-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.theme-wardrobe-desc {
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* EVENT PASSES & TRACKBCOMBO COMMUNITY */
.pass-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 14px;
  padding: 8px 12px;
}

.pass-prog-summary {
  font-size: 13px;
  font-weight: 700;
}

.pass-track {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pass-tier-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 14px;
  padding: 8px 10px;
}

.pass-tier-row.is-reached {
  border-color: var(--aqua-bloom);
}

.pass-tier-title {
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.pass-mini-bar {
  height: 8px;
  background: var(--parchment-warm);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--wood-tan);
}

.pass-mini-fill {
  height: 100%;
  background: var(--aqua-bloom);
}

.pass-reward-cell {
  background: var(--parchment-warm);
  border: 1.5px solid rgba(220, 174, 144, 0.7);
  border-radius: 10px;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.pass-reward-cell.is-prem {
  background: #FFF9EB;
  border-color: #E3B678;
}

.pass-rw-text {
  font-size: 11px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-footer {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 14px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.community-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.community-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
}

.community-ticket-btn {
  background: #FFF9EB;
  border: 1.8px solid #E3B678;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
}

.community-status {
  display: none;
  font-size: 12px;
  color: #2C7A7B;
  font-weight: 700;
}

.community-status.is-visible {
  display: block;
}

.community-grid, .passes-community-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.giftcode-group {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 240px;
}

.cozy-input, .cozy-select {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink-cocoa);
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 11px;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.cozy-input:focus, .cozy-select:focus {
  border-color: var(--aqua-bloom);
}

.giftcode-input {
  flex: 1 1 190px;
  min-width: 190px;
}

.community-action-btn {
  flex: 1 1 180px;
}

/* SETTINGS MODAL */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--parchment);
  border: 1.8px solid var(--wood-tan);
  border-radius: 14px;
  padding: 9px 11px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--parchment);
  border: 1.8px solid rgba(220, 174, 144, 0.72);
  border-radius: 13px;
  padding: 7px 11px;
}

.settings-section .settings-row {
  border: none;
  padding: 0;
  background: transparent;
}

.settings-label-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.settings-label {
  font-size: 13.5px;
  font-weight: 700;
}

.settings-sub {
  font-size: 11px;
  color: var(--ink-soft);
}

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

.lang-pill {
  background: var(--parchment-warm);
  border: 1.8px solid var(--wood-tan);
  border-radius: 10px;
  padding: 5px 8px;
}

.lang-pill.is-active {
  background: #E6FFFA;
  border-color: var(--aqua-bloom);
}

.settings-name-group, .segmented-pills, .settings-audio-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-pill {
  background: var(--parchment-warm);
  border: 2px solid var(--wood-tan);
  border-radius: 999px;
  padding: 4px 12px;
  min-width: 68px;
}

.toggle-pill.is-on {
  background: #C6F6D5;
  border-color: #48BB78;
}

.range-slider {
  width: 115px;
  accent-color: var(--aqua-bloom);
  cursor: pointer;
}

.settings-pct {
  width: 40px;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

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

.settings-autosave-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F0FFF4;
  border: 1.5px solid #9AE6B4;
  border-radius: 12px;
  padding: 6px 11px;
  font-size: 11.5px;
}

.settings-autosave-title {
  font-weight: 800;
}

.settings-autosave-desc {
  color: var(--ink-soft);
  font-size: 11px;
}

.name-editor-input {
  width: 100%;
  font-size: 15px;
  padding: 9px 12px;
}

/* VICTORY, DEADLOCK, 3-BEAT CHEST & UNLOCK MODALS */
.victory-hero, .chest-stage {
  position: relative;
  height: 138px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.celebration-sunburst {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(251, 211, 141, 0.36) 0deg 15deg, rgba(255, 253, 247, 0) 15deg 30deg);
  animation: spinSun 14s linear infinite;
  pointer-events: none;
}

@keyframes spinSun {
  to { transform: rotate(360deg); }
}

.victory-mochi {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 120px;
  object-fit: contain;
}

.victory-quote {
  margin: 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.victory-stat-pill, .victory-reward-card {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.victory-rw-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.chest-stage {
  cursor: pointer;
  height: 156px;
}

.chest-burst-canvas {
  position: absolute;
  width: 180px;
  height: 180px;
  pointer-events: none;
  z-index: 3;
}

.chest-main-img {
  position: relative;
  z-index: 2;
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.chest-stage.beat-1 .chest-main-img {
  animation: chestJiggle 0.42s ease-in-out infinite;
}

@keyframes chestJiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-6deg) scale(1.06, 0.95); }
  75% { transform: rotate(6deg) scale(1.06, 0.95); }
}

.chest-tap-hint {
  position: relative;
  z-index: 4;
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.chest-reward-card {
  background: var(--parchment);
  border: 2px solid #E3B678;
  border-radius: 13px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  animation: cozyPopIn 0.28s cubic-bezier(0.22, 1.25, 0.36, 1) backwards;
}

.chest-rw-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.chest-rw-label {
  font-size: 11.5px;
  font-weight: 700;
}

.unlock-banner-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 6px 0;
}

.unlock-banner-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.unlock-feature-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
}

.unlock-feature-desc {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* EXIT RETENTION MODAL (`js/exit_modal.js`) */
.exit-lead-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exit-mochi-avatar {
  width: 64px;
  height: 76px;
  object-fit: contain;
  flex-shrink: 0;
}

.exit-subtitle {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.38;
  color: var(--ink-cocoa);
}

.exit-reward-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.exit-reward-card {
  width: 100%;
  background: var(--parchment);
  border: 2px solid var(--aqua-bloom);
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.exit-reward-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.exit-reward-text {
  flex: 1 1 auto;
  min-width: 0;
}

.exit-reward-title {
  font-size: 13.5px;
  font-weight: 800;
}

.exit-reward-sub {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.exit-autosave-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #F0FFF4;
  border: 1.8px solid #9AE6B4;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
}

/* =========================================================================
 * NON-BLOCKING FTUE TUTORIAL (`#tutorial-root` — `js/tutorial.js`)
 * ========================================================================= */
.tutorial-spotlight {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}

body.modal-open #tutorial-root,
body.modal-open .tutorial-spotlight,
body.modal-open .tutorial-bar,
body.photo-mode-open #tutorial-root {
  display: none !important;
}

.tutorial-skip-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--parchment-warm);
  border: 2px solid var(--wood-tan);
  border-bottom-width: 3.5px;
  border-radius: 14px;
  padding: 7px 14px;
  min-height: 38px;
}

.tutorial-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(740px, 92vw);
  background: rgba(255, 253, 247, 0.97);
  border: 3px solid var(--aqua-bloom);
  border-radius: 20px;
  box-shadow: 0 10px 26px rgba(90, 62, 54, 0.24);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 96;
  animation: cozyPopIn 0.24s ease-out;
}

.tutorial-mochi {
  width: 54px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

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

.tutorial-step-badge {
  display: inline-block;
  background: #E6FFFA;
  border: 1.5px solid var(--aqua-bloom);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 2px;
}

.tutorial-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.tutorial-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.32;
}

.tutorial-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* =========================================================================
 * OVERLAYS: BEZIER FLYING COINS, CUT-IN CANVAS & PREVIEW-ONLY F2 DEBUG
 * ========================================================================= */
.fx-fly-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  overflow: hidden;
}

.fx-flying-icon {
  position: absolute;
  width: 26px;
  height: 26px;
  object-fit: contain;
  will-change: transform, opacity;
  filter: drop-shadow(0 3px 5px rgba(90, 62, 54, 0.28));
}

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

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

.shop-grid {
  padding: 12px 8px;
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 14px 12px;
}

.shop-badge {
  z-index: 5;
}

.title-mascot-crest {
  position: relative;
}

/* Preview-only [DEV F2] pill & collapsible panel */
.dev-f2-pill {
  position: fixed;
  bottom: 8px;
  left: 8px;
  z-index: 240;
  background: rgba(90, 62, 54, 0.86);
  color: #FFFDF7;
  border: 1.5px solid var(--wood-tan);
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
}

.debug-panel {
  position: fixed;
  bottom: 38px;
  left: 8px;
  z-index: 241;
  width: 268px;
  background: rgba(255, 253, 247, 0.98);
  border: 2.5px solid var(--ink-cocoa);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-panel-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  border-bottom: 1.5px solid var(--wood-tan);
  padding-bottom: 4px;
}

.debug-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.debug-act-btn {
  background: var(--parchment-warm);
  border: 1.5px solid var(--wood-tan);
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 11px;
  text-align: center;
}

.debug-act-btn.is-wide {
  grid-column: span 2;
}

/* =========================================================================
 * RESPONSIVE < 900px STACK FALLBACK (Split-Screen & Narrow Windows)
 * ========================================================================= */
@media (max-width: 1120px) {
  .chapter-sub-text { display: none; }
  .hud-name-pill { max-width: 130px; }
  .side-panel { min-width: 204px; }
}

@media (max-width: 900px) {
  .top-bar {
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
    padding: 6px 10px;
  }

  .atelier-columns {
    flex-direction: column;
    overflow-y: auto;
    gap: 8px;
    padding: 6px 8px 10px;
  }

  .side-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .left-panel > *, .right-panel > * {
    flex: 1 1 160px;
  }

  .mochi-card {
    flex: 1 1 100%;
  }

  .center-stage {
    min-height: 360px;
    flex: 1 0 380px;
  }

  .streak-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-grid, .pass-tier-row {
    grid-template-columns: 1fr;
  }
}


/* =========================================================================
 * SEASONS 2–4 (v2.1 → v5.0) — CONSERVATORY, MODES, HERBARIUM, LOOM & LIGHTING
 * ========================================================================= */

/* Compact vertical comfort at 720p so all 7 left-panel cards fit cleanly on screen */
@media (max-height: 780px) {
  .side-panel {
    gap: 6px;
  }
  .parchment-card {
    padding: 6px 9px;
  }
  #mochi-canvas {
    width: 88px;
    height: 78px;
  }
  .meta-card-btn {
    padding: 5px 9px;
  }
  .meta-card-icon-lg {
    width: 28px;
    height: 28px;
  }
}

/* Four-Season Balcony Lighting Moods (v3.7) */
.game-shell.lighting-golden_sunset .arena-bg-layer {
  filter: sepia(0.28) saturate(1.22) brightness(0.98);
  opacity: 0.56;
}
.game-shell.lighting-starlight {
  background-color: #E2E7F7;
}
.game-shell.lighting-starlight .arena-bg-layer {
  filter: hue-rotate(185deg) saturate(0.92) brightness(0.86);
  opacity: 0.52;
}
.game-shell.lighting-rain {
  background-color: #E3F0EE;
}
.game-shell.lighting-rain .arena-bg-layer {
  filter: hue-rotate(130deg) saturate(0.88) brightness(0.94);
  opacity: 0.50;
}

/* Wind-Chime Cascade Fever Bar (v2.5) */
.fever-bar-wrap {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1.5px dashed rgba(220, 174, 144, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.fever-bar-lbl {
  font-size: 10.5px;
  font-weight: 800;
  color: #4A3028;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fever-bar-wrap.is-fever-active .fever-bar-lbl {
  color: #975A16;
}

.fever-pips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.fever-pip {
  width: 18px;
  height: 9px;
  border-radius: 999px;
  background: var(--parchment-warm);
  border: 1.5px solid var(--wood-tan);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.fever-pip.is-lit {
  background: linear-gradient(90deg, #F6E05E, #F6AD55);
  border-color: #B7791F;
}

/* Deadlock Guard gentle pulse on Hint / Undo (v3.4) */
.booster-btn.deadlock-guard-pulse {
  border-color: #D69E2E !important;
  background: #FFFBEB !important;
  animation: guardPulse 1.3s ease-in-out infinite;
}

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

/* Theme Swapper Header Row */
.card-section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.card-section-head-row .card-section-title {
  margin-bottom: 0;
}

.mini-wardrobe-link {
  background: var(--parchment-warm);
  border: 1.5px solid var(--wood-tan);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-cocoa);
  line-height: 1.3;
  flex-shrink: 0;
}

/* Veranda Photo Postcard Mode (v4.4) */
.game-shell.is-photo-mode .top-bar,
.game-shell.is-photo-mode .side-panel {
  display: none !important;
}

.photo-postcard-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 18px;
}

.photo-postcard-frame {
  position: fixed;
  inset: 14px;
  border-radius: 24px;
  border: 10px solid #F48FB1;
  box-shadow: inset 0 0 0 3px #FFFDF7;
  pointer-events: none;
}

.photo-postcard-frame.border-gilded_nouveau {
  border-color: #D69E2E;
  box-shadow: inset 0 0 0 4px #FFFBEB;
}

.photo-postcard-frame.border-wisteria_trellis {
  border-color: #9F7AEA;
  box-shadow: inset 0 0 0 4px #FAF5FF;
}

.photo-postcard-frame.border-starlight_atrium {
  border-color: #4DB6AC;
  box-shadow: inset 0 0 0 4px #E6FFFA;
}

.photo-postcard-toolbar {
  pointer-events: auto;
  background: rgba(255, 253, 247, 0.96);
  border: 2.5px solid var(--wood-tan);
  border-radius: 999px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  box-shadow: 0 6px 18px rgba(90, 62, 54, 0.22);
}

.photo-border-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.photo-act-btn {
  min-height: 36px;
}

/* Multi-Tab Bars (3 & 4 Tabs, zero overflow) */
.modal-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

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

.s24-tab-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
}

.s24-currency-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--parchment-warm);
  border: 1.8px solid var(--wood-tan);
  border-radius: 14px;
  padding: 7px 12px;
}

.s24-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFFDF7;
  border: 1.5px solid #C89674;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #36211B;
}

/* 30-Day Pressed-Petal Calendar Archive (v3.1) */
.petal-calendar-box {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

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

.petal-day-btn {
  min-height: 32px;
  border-radius: 9px;
  border: 1.5px solid var(--wood-tan);
  background: var(--parchment-warm);
  font-size: 11px;
  font-weight: 800;
  color: #3B241C;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.petal-day-btn.is-cleared {
  background: #FEEBC8;
  border-color: #DD6B20;
  color: #652B19;
}

.petal-day-btn.is-today {
  box-shadow: 0 0 0 2px var(--aqua-bloom);
}

.petal-trophy-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.petal-trophy-card {
  background: var(--parchment-warm);
  border: 1.5px solid var(--wood-tan);
  border-radius: 11px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
}

/* Hanging Garden Conservatory Diorama & Koi Atrium (v3.2, v4.1, v3.9) */
.garden-canvas-wrap {
  position: relative;
  width: 100%;
  height: 196px;
  border-radius: 16px;
  border: 2.5px solid var(--wood-tan);
  overflow: hidden;
  background: #FAF2E1;
}

.garden-diorama-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

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

.garden-decor-card {
  background: var(--parchment);
  border: 1.8px solid var(--wood-tan);
  border-radius: 13px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  min-width: 0;
}

.garden-decor-card.is-owned {
  background: #F0FFF4;
  border-color: #68D391;
}

.garden-decor-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.garden-decor-title {
  font-size: 11px;
  font-weight: 800;
  color: #36211B;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Botanical Herbarium 40 Cards & 12 Artisan Loom Charms (v3.3, v4.3) */
.herb-set-card {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 15px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.herb-cards-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.herb-mini-card {
  background: var(--parchment-warm);
  border: 1.6px solid var(--wood-tan);
  border-radius: 11px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  min-width: 0;
}

.herb-mini-card.is-unlocked {
  background: #FFFDF7;
  border-color: #68D391;
}

.herb-mini-card.is-locked {
  opacity: 0.58;
  filter: grayscale(0.6);
}

.loom-charm-card {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 14px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-width: 0;
}

.loom-charm-card.is-owned {
  background: #FFFBEB;
  border-color: #D69E2E;
}

.loom-charm-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* Weaver Modes, Trials, Leaderboards & Co-op (v2.6, v2.9, v3.6, v4.5, v4.6, v4.9) */
.mode-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mode-stage-card {
  background: var(--parchment);
  border: 2px solid var(--wood-tan);
  border-radius: 14px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.mode-stage-card.is-cleared {
  background: #F0FFF4;
  border-color: #48BB78;
}

.board-rank-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.board-rank-row {
  background: var(--parchment);
  border: 1.6px solid var(--wood-tan);
  border-radius: 11px;
  padding: 6px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
}

.board-rank-row.is-player {
  background: #E6FFFA;
  border-color: #38B2AC;
}

.coop-meter-bar {
  width: 100%;
  height: 16px;
  background: var(--parchment-warm);
  border: 2px solid var(--wood-tan);
  border-radius: 999px;
  overflow: hidden;
  padding: 2px;
}

.coop-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6ED4D6, #68D391, #F6AD55);
  transition: width 0.3s ease;
}

/* =========================================================================
 * v1.0.2 DAY-0 OFFLINE VAULT, ATELIER NEWS / SPOTLIGHT & GIFTCODE PANELS
 * ========================================================================= */
.btn-icon-xs {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.hud-vault-pill,
.cozy-top-pill-vault,
.cozy-top-pill-news,
.hud-news-btn {
  position: relative;
}

.hud-vault-pill.has-vault-coins,
.cozy-top-pill-vault.has-vault-coins {
  border-color: #D69E2E;
  background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%);
}

.hud-vault-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: #F6AD55;
  color: #3D241C;
  border: 1.5px solid #5A3E36;
  line-height: 1.15;
}

.hud-vault-badge:empty {
  display: none;
}

.shop-utility-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.shop-utility-btn {
  flex: 1 1 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
}

.settings-giftcode-box {
  margin-top: 2px;
}

.settings-giftcode-box .giftcode-group {
  flex: 0 0 auto;
  width: 100%;
}

.settings-toggles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 640px) {
  .settings-toggles-grid {
    grid-template-columns: 1fr;
  }
}

.giftcode-hint-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: #7A5447;
}

.offline-vault-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #FFFDF7 0%, #FEF3C7 100%);
  border: 2px solid #D69E2E;
  border-radius: 16px;
  padding: 12px 14px;
}

.offline-vault-chest-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
}

.offline-vault-amount-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.offline-vault-amount {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #4A3028;
}

.offline-vault-sub {
  font-size: 12.5px;
  font-weight: 700;
  color: #7A5447;
}

.vault-progress-track {
  width: 100%;
  height: 14px;
  background: var(--parchment-warm);
  border: 2px solid var(--wood-tan);
  border-radius: 999px;
  overflow: hidden;
  padding: 2px;
}

.vault-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6ED4D6 0%, #F6AD55 100%);
  transition: width 0.3s ease;
}

.vault-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.vault-stat-box {
  background: var(--parchment);
  border: 1.8px solid var(--wood-tan);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-cocoa);
  text-align: center;
}

.news-section-head {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #5A3E36;
  margin-top: 4px;
}

.news-cards-list,
.promo-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-card {
  background: var(--parchment);
  border: 1.8px solid var(--wood-tan);
  border-radius: 14px;
  padding: 10px 12px;
}

.news-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.news-tag,
.promo-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #E6FFFA;
  color: #0F766E;
  border: 1.4px solid #6ED4D6;
}

.promo-tag {
  background: #FEF3C7;
  color: #92400E;
  border-color: #F6AD55;
  margin-bottom: 4px;
}

.news-card-title,
.promo-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #4A3028;
}

.news-card-body,
.promo-card-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.42;
  color: #6B4B3E;
  font-weight: 600;
}

.promo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #FFFDF7 0%, #F0FDF4 100%);
  border: 2px solid #6ED4D6;
  border-radius: 14px;
  padding: 10px 13px;
}

.promo-card-info {
  flex: 1 1 240px;
}

.promo-visit-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
}

/* =========================================================================
 * LOOSE BOTTOM-END BOARD RULE PILL & HOW-TO-PLAY MODAL (Bug #1918)
 * ========================================================================= */
.board-rule-pill {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 94%;
  padding: 5px 13px 5px 7px;
  border-radius: 999px;
  border: 1.5px solid rgba(181, 139, 108, 0.72);
  background: rgba(255, 253, 247, 0.90);
  color: var(--ink-cocoa);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(90, 62, 54, 0.14);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.board-rule-pill:hover {
  background: #FFFDF7;
  border-color: #0F766E;
  transform: translateX(-50%) translateY(-1px);
}

.board-rule-pill.is-tight-warning {
  background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%);
  border-color: #D69E2E;
  color: #5A3E36;
  box-shadow: 0 4px 12px rgba(183, 121, 31, 0.22);
}

.board-rule-pill.is-tight-warning .board-rule-dot {
  background: #F6AD55;
  border-color: #975A16;
  color: #3D241C;
}

.board-rule-dot {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #6ED4D6;
  border: 1.5px solid #0F766E;
  color: #134E4A;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
}

.board-rule-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.tutorial-active .board-rule-pill,
body.photo-mode .board-rule-pill {
  opacity: 0;
  pointer-events: none;
}

/* Hide floating board rule pill & board tooltip whenever any modal dialog is open (#2968) */
body.modal-open .board-rule-pill,
body:has(.modal-backdrop) .board-rule-pill,
body.modal-open .board-tooltip,
body:has(.modal-backdrop) .board-tooltip {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.howto-rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.howto-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFFDF7 0%, #FAF3E6 100%);
  border: 1.5px solid rgba(181, 139, 108, 0.55);
}

.howto-rule-badge {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #FEF9EE;
  border: 1.5px solid var(--wood-tan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.howto-rule-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.howto-rule-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.howto-rule-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: #4A3028;
  margin-bottom: 3px;
}

.howto-rule-desc {
  font-size: 12.2px;
  line-height: 1.42;
  color: #6B4B3E;
  font-weight: 600;
}
