:root {
  --olive-bark: #635E43;
  --sage-leaf: #89986E;
  --blonde-wood: #D5B887;
  --terracotta-honey: #D1915F;
  --sunlit-cream: #EBD5AB;
  --mint-meadow: #99C397;
  --linen-bg: #FAF5EA;
  --plum-ink: #4A2511;
  --text-dark: #2B1A12;
  --text-muted: #614938;
  --text-light: #FFFDF5;
  --gold-bright: #F6B93B;
  --emerald-top: #26D048;
  --emerald-bot: #13962E;
  --font-display: 'Lilita One', 'Fredoka', 'Trebuchet MS', sans-serif;
  --font-heading: 'Fredoka', 'Nunito', 'Segoe UI', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--linen-bg);
  color: var(--text-dark);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#app-root {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* ==================== 9-SLICE ANTI-DISTORTION CHROME ==================== */
.panel-9slice {
  box-sizing: border-box;
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 28px 26px 30px 26px;
  border-image: url('../assets/ui/frame_panel.png') 162 147 171 148 fill / 28px 26px 30px 26px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 8px 16px rgba(74, 37, 17, 0.22));
  color: var(--text-dark);
}

.btn-9slice-primary {
  position: relative;
  overflow: visible !important;
  box-sizing: border-box;
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 18px 26px 18px 26px;
  border-image: url('../assets/ui/btn_primary.png') 230 219 207 222 fill / 18px 26px 18px 26px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 60px;
  padding: 2px 24px;
  font-family: var(--font-display);
  font-size: clamp(20px, 1.8vw, 28px);
  letter-spacing: 0.5px;
  color: #14121F;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  filter: drop-shadow(0 5px 8px rgba(19, 95, 34, 0.35));
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.12s ease;
}

.btn-9slice-primary:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.05) drop-shadow(0 7px 12px rgba(19, 95, 34, 0.42));
}

.btn-9slice-primary:active {
  transform: translateY(2px) scale(0.98);
}

/* ==================== BUTTONS & RED-DOT OVERFLOW SAFETY ==================== */
button {
  position: relative;
  overflow: visible !important;
  font-family: var(--font-heading);
  cursor: pointer;
}

button .btn-label {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.15;
  text-align: center;
}

.notify-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 35;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FF5E62 0%, #E11D48 100%);
  border: 2.5px solid #FFFDF5;
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.28);
  animation: badgePulse 1.5s infinite ease-in-out;
  pointer-events: none;
}

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

.glossy-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 3px solid var(--plum-ink);
  background: linear-gradient(180deg, #FFFDF7 0%, #EFE1C6 100%);
  box-shadow: 0 4px 0 var(--plum-ink), inset 0 2px 0 #FFFFFF;
  color: var(--plum-ink);
  font-weight: 700;
  font-size: clamp(12px, 0.95vw, 15px);
  transition: transform 0.1s ease;
}

.glossy-pill-btn.compact {
  min-height: 38px;
  padding: 4px 12px;
}

.glossy-pill-btn.gold-tint {
  background: linear-gradient(180deg, #FFE885 0%, #F5AF31 100%);
  color: #3A1D08;
}

.glossy-pill-btn.danger-tint {
  background: linear-gradient(180deg, #FFD6CC 0%, #F29C85 100%);
  color: #4A1811;
}

.glossy-pill-btn:hover, .glossy-icon-btn:hover, .sculpted-action-btn:hover, .booster-btn:hover, .studio-nav-btn:hover {
  transform: translateY(-2px);
}

.glossy-pill-btn:active, .glossy-icon-btn:active, .sculpted-action-btn:active, .booster-btn:active, .studio-nav-btn:active {
  transform: translateY(2px);
}

.glossy-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--plum-ink);
  background: linear-gradient(180deg, #FFFDF7 0%, #EBD5AB 100%);
  box-shadow: 0 4px 0 var(--plum-ink), inset 0 2px 0 #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--plum-ink);
  padding: 0;
}

.svg-slot {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.sculpted-action-btn {
  width: 100%;
  min-height: 42px;
  padding: 6px 12px;
  border-radius: 16px;
  border: 3px solid var(--plum-ink);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(12px, 0.92vw, 14px);
  color: var(--plum-ink);
  background: linear-gradient(180deg, #FFFDF8 0%, #EBD5AB 100%);
  box-shadow: 0 4px 0 var(--plum-ink), inset 0 2px 0 rgba(255,255,255,0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s ease;
}

.sculpted-action-btn.sage-btn {
  background: linear-gradient(180deg, #CBE8C8 0%, #8AC087 100%);
  color: #1D3B1C;
}

.sculpted-action-btn.honey-btn {
  background: linear-gradient(180deg, #FFE799 0%, #E9AE48 100%);
  color: #3D200A;
}

.sculpted-action-btn.emerald-btn {
  background: linear-gradient(180deg, #4CE86B 0%, #17B339 100%);
  color: #0E2914;
}

.sculpted-action-btn.mint-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #A7F3D0 0%, #34D399 100%);
  color: #064E3B;
}

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

.ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.title-top-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
}

.studio-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 253, 245, 0.9);
  border: 2.5px solid var(--plum-ink);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--plum-ink);
  box-shadow: 0 3px 0 rgba(74, 37, 17, 0.35);
}

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

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

.title-center-stage {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vw, 64px);
  padding: 12px 40px 36px;
}

.title-showcase-art {
  position: relative;
  width: min(360px, 28vw);
  height: min(360px, 46vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-cart-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(43, 26, 18, 0.35));
  animation: gentleFloat 3.6s ease-in-out infinite;
}

.title-butterfly-img {
  position: absolute;
  top: 4%;
  right: 2%;
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(245, 158, 11, 0.45));
  animation: butterflyHover 2.3s ease-in-out infinite;
}

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

@keyframes butterflyHover {
  0%, 100% { transform: translate(0, 0) rotate(-6deg) scale(1); }
  50% { transform: translate(-5px, -10px) rotate(6deg) scale(1.06); }
}

.title-card {
  width: min(520px, 48vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 20px 14px;
}

.title-flower-crest {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.title-flower-crest img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.title-flower-crest img.crest-center {
  width: 62px;
  height: 62px;
  transform: translateY(-5px);
}

.game-logo-title {
  margin: 2px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(38px, 3.8vw, 60px);
  line-height: 1.04;
  color: #FFFDF5;
  -webkit-text-stroke: 2.5px #4A2511;
  text-shadow: 0 5px 0 #4A2511, 0 8px 18px rgba(0, 0, 0, 0.32);
}

.game-logo-subtitle {
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(15px, 1.25vw, 20px);
  color: var(--olive-bark);
}

.boot-loader-wrap {
  width: 100%;
  max-width: 340px;
  margin: 8px 0 6px;
}

.boot-bar-track {
  width: 100%;
  height: 20px;
  border-radius: 999px;
  background: #E5D4B7;
  border: 3px solid var(--plum-ink);
  overflow: hidden;
  padding: 2px;
}

.boot-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34D399 0%, #FBBF24 100%);
  transition: width 0.15s ease;
}

.boot-bar-label {
  margin-top: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--plum-ink);
  font-variant-numeric: tabular-nums;
}

.title-cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.btn-hero-play {
  min-width: 230px;
}

.title-meta-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.feature-tag {
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(153, 195, 151, 0.35);
  border: 1.5px solid var(--sage-leaf);
  font-size: 12px;
  font-weight: 800;
  color: #36492F;
}

/* ==================== GAMEPLAY 16:9 3-COLUMN STUDIO ==================== */
.arena-bg-layer {
  position: absolute;
  inset: 0;
  background: url('../assets/art/arena_bg.png') center center / cover no-repeat;
  z-index: 0;
}

.hud-top-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 24px 4px;
  width: 100%;
  max-width: 1840px;
  margin: 0 auto;
}

.hud-top-left, .hud-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.level-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFFDF7 0%, #EBD5AB 100%);
  border: 3px solid var(--plum-ink);
  box-shadow: 0 4px 0 var(--plum-ink);
}

.level-num-text {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.2vw, 20px);
  color: var(--plum-ink);
}

.chapter-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--mint-meadow);
  color: #1F3A1E;
  font-size: 12px;
  font-weight: 800;
}

.streak-hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(74, 37, 17, 0.82);
  border: 2px solid #F6B93B;
}

.hud-counter-num {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #2B1A12;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

.currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5C341C 0%, #3B1F0E 100%);
  border: 3px solid #F6B93B;
  box-shadow: 0 4px 0 rgba(43, 26, 18, 0.65);
  color: #FFFFFF;
}

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

.plus-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #22C55E;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 14px;
}

.btn-icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* 3-Column Widescreen Container occupying ~93% width */
.studio-three-col {
  position: relative;
  z-index: 10;
  flex: 1;
  min-height: 0;
  width: 94%;
  max-width: 1840px;
  margin: 0 auto;
  padding: 4px 0 12px;
  display: grid;
  grid-template-columns: minmax(230px, 23%) minmax(420px, 54%) minmax(230px, 23%);
  gap: 14px;
  align-items: stretch;
}

.studio-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.studio-col-left, .studio-col-right {
  justify-content: space-between;
}

.studio-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 6px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.card-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(14px, 1.05vw, 17px);
  color: var(--plum-ink);
}

.help-q-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--plum-ink);
  background: #FFF7E2;
  color: var(--plum-ink);
  font-weight: 800;
  font-size: 13px;
  padding: 0;
  flex-shrink: 0;
}

/* Left Column: Diorama & Pollinator */
.diorama-card {
  flex: 1;
  min-height: 0;
  justify-content: space-between;
}

.diorama-stage {
  position: relative;
  flex: 1;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 55%, rgba(255, 245, 209, 0.85) 0%, rgba(235, 213, 171, 0.2) 72%);
  border-radius: 16px;
}

.diorama-cart-img {
  max-width: 90%;
  max-height: 190px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(74, 37, 17, 0.25));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pollinator-perch {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 68px;
  height: 68px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid #D97706;
  background: radial-gradient(circle, #FFFBEB 0%, #FDE68A 100%);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pollinator-perch.ready {
  border-color: #16A34A;
  background: radial-gradient(circle, #FEF9C3 0%, #86EFAC 100%);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.75);
  animation: butterflyReadyPulse 1.2s ease-in-out infinite;
}

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

.pollinator-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.pollinator-ring {
  position: absolute;
  bottom: -7px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--plum-ink);
  color: #FFFDF5;
  font-size: 11px;
  font-weight: 800;
}

.diorama-progress-bar {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: #DFC9A6;
  border: 2px solid var(--plum-ink);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diorama-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #56C568 0%, #A3E635 100%);
  transition: width 0.3s ease;
}

.diorama-progress-text {
  position: relative;
  z-index: 2;
  font-size: 12px;
  font-weight: 800;
  color: var(--plum-ink);
}

.pollinator-hint-line {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

.meta-mini-card {
  gap: 8px;
}

.meta-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

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

.meta-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--plum-ink);
}

.meta-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Center Playfield */
.studio-col-center {
  position: relative;
  border-radius: 24px;
  background: rgba(250, 245, 234, 0.58);
  border: 3px solid rgba(158, 115, 67, 0.55);
  box-shadow: inset 0 2px 16px rgba(255, 255, 255, 0.65), 0 10px 24px rgba(74, 37, 17, 0.14);
  overflow: hidden;
}

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

#vfx-canvas {
  pointer-events: none;
  z-index: 6;
}

.cutin-banner {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(74, 37, 17, 0.94) 0%, rgba(124, 63, 24, 0.94) 100%);
  border: 3px solid #FDE047;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  animation: cutinPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cutinPop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.72); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

.cutin-portrait {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.cutin-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: #FEF08A;
  text-shadow: 0 2px 0 #2B1A12;
}

.cutin-sub {
  font-size: 13px;
  font-weight: 700;
  color: #FFFDF5;
}

.board-toast {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 16;
  pointer-events: none;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(43, 26, 18, 0.9);
  border: 2px solid #F6B93B;
  color: #FFFDF5;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.28);
}

/* Right Column: Intel, Boosters & Boutique */
.intel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

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

.intel-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  border-radius: 12px;
  background: rgba(235, 213, 171, 0.45);
  border: 1.5px solid rgba(158, 115, 67, 0.4);
  text-align: center;
}

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

.intel-val {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  color: var(--plum-ink);
  font-variant-numeric: tabular-nums;
}

.intel-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.hotkey-legend {
  font-size: 11px;
  font-weight: 800;
  color: var(--olive-bark);
  background: rgba(213, 184, 135, 0.45);
  padding: 2px 7px;
  border-radius: 8px;
}

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

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

.booster-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px 6px;
  border-radius: 16px;
  border: 3px solid var(--plum-ink);
  background: linear-gradient(180deg, #FFFDF9 0%, #F1DFBE 100%);
  box-shadow: 0 4px 0 var(--plum-ink), inset 0 2px 0 #FFFFFF;
  color: var(--plum-ink);
}

.booster-btn.locked-booster {
  opacity: 0.62;
  filter: grayscale(0.4);
}

.kbd-tag {
  position: absolute;
  top: -7px;
  left: -5px;
  padding: 1px 6px;
  border-radius: 7px;
  background: var(--plum-ink);
  color: #FFFDF5;
  font-size: 10px;
  font-weight: 800;
}

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

.booster-name {
  font-size: clamp(11px, 0.88vw, 13px);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  word-break: break-word;
}

.booster-cost {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
  background: #5C341C;
  color: #FDE047;
}

.booster-cost.free-tag {
  background: #16A34A;
  color: #FFFFFF;
}

.booster-bottom-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.booster-bottom-row > * {
  min-width: 0;
  max-width: 100%;
}

.inline-kbd {
  font-size: 11px;
  opacity: 0.8;
}

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

.studio-links-grid > * {
  min-width: 0;
  max-width: 100%;
}

.studio-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 4px;
  border-radius: 14px;
  border: 2.5px solid var(--plum-ink);
  background: linear-gradient(180deg, #FFFDF7 0%, #EBD5AB 100%);
  box-shadow: 0 3px 0 var(--plum-ink);
  color: var(--plum-ink);
  font-size: clamp(11px, 0.82vw, 12.5px);
  font-weight: 800;
}

.studio-nav-btn.accent-gold {
  background: linear-gradient(180deg, #FFE88A 0%, #F4B23E 100%);
}

.nav-btn-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ==================== TUTORIAL OVERLAY ==================== */
.tutorial-overlay {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  width: min(500px, 90vw);
  pointer-events: auto;
}

.tutorial-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.tutorial-step-pill {
  align-self: center;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--mint-meadow);
  color: #1B381A;
  font-size: 12px;
  font-weight: 800;
}

.tutorial-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--plum-ink);
}

.tutorial-body {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.35;
}

.tutorial-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(34, 20, 12, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeScrim 0.2s ease;
}

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

.modal-window {
  width: min(860px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modalSpring 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px dashed rgba(158, 115, 67, 0.45);
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 30px);
  color: #FFFDF5;
  -webkit-text-stroke: 2px #4A2511;
  text-shadow: 0 3px 0 #4A2511;
}

.modal-header-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid var(--plum-ink);
  background: #FCA5A5;
  color: #4A1515;
  font-weight: 900;
  font-size: 16px;
  padding: 0;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Shop / Cards Grid inside Modals (Strict Containment Law) */
.modal-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.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%;
}

.shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #FFFDF8 0%, #F5E6CA 100%);
  border: 3px solid #B5854B;
  box-shadow: 0 4px 0 rgba(158, 115, 67, 0.45);
}

.shop-card.featured {
  background: linear-gradient(180deg, #FFFBEB 0%, #FDE68A 100%);
  border-color: #D97706;
}

.shop-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #F59E0B 0%, #B45309 100%);
  border: 2px solid #FFFDF5;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
}

.shop-art-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-main-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.18));
}

.shop-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  color: var(--plum-ink);
}

.shop-desc {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Settings Controls */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(235, 213, 171, 0.35);
  border: 2px solid rgba(158, 115, 67, 0.35);
}

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

.settings-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--plum-ink);
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 340px;
}

.slider-group input[type="range"] {
  flex: 1;
  accent-color: #16A34A;
  height: 8px;
  cursor: pointer;
}

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

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

.lang-btn {
  padding: 8px 6px;
  border-radius: 12px;
  border: 2.5px solid var(--plum-ink);
  background: #FFFDF7;
  font-weight: 800;
  font-size: 13px;
  color: var(--plum-ink);
}

.lang-btn.active {
  background: linear-gradient(180deg, #86EFAC 0%, #22C55E 100%);
  color: #082E14;
}

/* ==================== CELEBRATION OVERLAY ==================== */
.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(28, 17, 10, 0.74);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sunburst-rays {
  position: absolute;
  width: 140vmax;
  height: 140vmax;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(253, 224, 71, 0.16) 0deg 12deg,
    rgba(253, 224, 71, 0.0) 12deg 24deg
  );
  animation: spinSun 22s linear infinite;
  pointer-events: none;
}

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

#celebration-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.celebration-content {
  position: relative;
  z-index: 5;
  width: min(560px, 90vw);
  text-align: center;
}

.fx-dom-layer {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  overflow: hidden;
}

/* ==================== PREVIEW-ONLY F2 DEBUG PANEL ==================== */
.dev-f2-pill {
  position: fixed;
  bottom: 8px;
  left: 8px;
  z-index: 200;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(20, 18, 31, 0.85);
  border: 1.5px solid #38BDF8;
  color: #38BDF8;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.debug-panel {
  position: fixed;
  bottom: 40px;
  left: 8px;
  z-index: 200;
  width: 300px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(20, 18, 31, 0.94);
  border: 2px solid #38BDF8;
  color: #F8FAFC;
  font-family: var(--font-body);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-panel button {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #1E293B;
  color: #F8FAFC;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.debug-panel button:hover {
  background: #334155;
}

/* ==================== RESPONSIVE < 900PX FALLBACK ==================== */
@media (max-width: 900px) {
  .title-center-stage {
    flex-direction: column;
    gap: 16px;
  }
  .title-showcase-art {
    width: 180px;
    height: 180px;
  }
  .title-card {
    width: 92vw;
  }
  .studio-three-col {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    width: 96%;
    gap: 8px;
  }
  .studio-col-left {
    flex-direction: row;
    align-items: center;
  }
  .diorama-stage {
    min-height: 70px;
  }
  .meta-mini-card {
    display: none;
  }
  .intel-card {
    display: none;
  }
}
