/* brownie/theme.css — warm kitchen palette, phone-portrait frame, swipe pager. */

:root {
  /* Warm kitchen palette — deepened for contrast */
  --cocoa-950: #14080a;
  --cocoa-900: #1d100c;
  --cocoa-800: #2a180f;
  --cocoa-700: #3a2316;
  --cocoa-600: #523220;
  --cocoa-500: #75462b;
  --cocoa-400: #a36340;
  --caramel:   #d28a5a;
  --caramel-2: #b06a3c;
  --butter:    #f4ce82;
  --butter-2:  #ecb965;
  --cream:     #f6e9cf;
  --cream-lt:  #fdf5e2;
  --parchment: #d8c39a;
  --fudge:     #3a1b0f;
  --mint:      #6ca97a;
  --berry:     #c44b6a;
  --berry-2:   #8a2d4c;

  --radius: 14px;
  --radius-sm: 10px;

  --tabbar-h: 68px;
  --hud-h: 128px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 0%, #2a1810 0%, #0a0503 70%),
    #050201;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--cream);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#root { height: 100vh; width: 100vw; }

/* ── Phone stage ───────────────────────────────────────────── */

.be-stage {
  position: fixed;
  inset: 0;
  display: block;
  overflow: hidden;
}

.be-phone {
  width: 100vw;
  height: 100vh;
  background: var(--cocoa-950);
  position: relative;
  overflow: hidden;
}

/* On large viewports, frame the design as a phone-shaped card so it's still presentable. */
@media (min-width: 600px) and (min-height: 760px) {
  .be-stage {
    display: grid;
    place-items: center;
  }
  .be-phone {
    width: min(440px, calc(100vh * 0.52));
    height: min(900px, calc(100vh - 32px));
    border-radius: 38px;
    box-shadow:
      0 0 0 8px #0a0402,
      0 0 0 9px #2a1810,
      0 30px 80px rgba(0, 0, 0, 0.7),
      inset 0 0 60px rgba(0, 0, 0, 0.4);
  }
}

/* ── Pager ─────────────────────────────────────────────────── */

.be-pager {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 380ms cubic-bezier(.2, .9, .25, 1);
  will-change: transform;
}
.be-pager.dragging { transition: none; }
.be-page {
  width: calc(100% / 3);
  height: 100%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* ── Bottom tab bar (replaces dots + page label) ──────────── */

.be-tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--tabbar-h);
  background: linear-gradient(180deg, rgba(20,8,4,0.92) 0%, var(--cocoa-950) 100%);
  border-top: 1px solid rgba(244, 200, 121, 0.12);
  backdrop-filter: blur(10px);
  display: flex;
  z-index: 50;
  padding-bottom: max(0px, env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}

/* Mobile-first sizing — small phones: shrink hero & tighten spacing */
@media (max-height: 720px) {
  :root { --hud-h: 110px; --tabbar-h: 60px; }
  .hud-count { font-size: 34px; }
  .hud { padding: 14px 16px 10px; }
  .brownie-wrap { width: 180px; height: 180px; }
  .hero-rays { width: 360px; height: 360px; }
  .hero-glow { width: 220px; height: 220px; }
  .plate { width: 240px; bottom: calc(var(--tabbar-h) + 50px); }
  .page-header h2 { font-size: 19px; }
  .page-header .sub { font-size: 11px; }
}
@media (max-width: 380px) {
  .hud-count { font-size: 36px; }
  .producer-row { grid-template-columns: 48px 1fr auto; padding: 10px 12px; gap: 10px; }
  .producer-icon { width: 48px; height: 48px; }
  .producer-icon svg { width: 30px; height: 30px; }
  .producer-name { font-size: 15px; }
  .producer-count { font-size: 26px; }
  .ups-card { grid-template-columns: 42px 1fr auto; padding: 10px 12px; gap: 10px; }
  .ups-card-icon { width: 42px; height: 42px; }
  .ups-card-icon svg { width: 26px; height: 26px; }
}
.be-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  color: rgba(216, 195, 154, 0.5);
  transition: color 200ms;
  padding: 6px 0 8px;
}
.be-tab svg { width: 22px; height: 22px; }
.be-tab .lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.be-tab .pip {
  position: absolute;
  top: 0;
  width: 36px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--butter);
  transform: scaleX(0);
  transition: transform 250ms cubic-bezier(.2,.9,.25,1);
}
.be-tab.active { color: var(--butter); }
.be-tab.active .pip { transform: scaleX(1); }
.be-tab:active { transform: translateY(1px); }

/* ── Bakery page ───────────────────────────────────────────── */

.bakery-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, #4a2818 0%, #1f1109 55%, #0a0503 92%);
}

/* soft vignette */
.bakery-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

/* drifting particles in the bg */
.bakery-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--butter);
  opacity: 0;
  pointer-events: none;
  animation: particleDrift var(--dur, 8s) ease-in-out var(--delay, 0s) infinite;
  filter: blur(0.5px);
}
@keyframes particleDrift {
  0%   { opacity: 0; transform: translateY(20px) scale(0.6); }
  20%  { opacity: 0.8; }
  80%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-90px) scale(1); }
}

/* round plate / pedestal under the brownie */
.plate {
  position: absolute;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 70px);
  transform: translateX(-50%);
  width: 300px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(244, 200, 121, 0.35) 0%, rgba(244,200,121,0.08) 35%, transparent 65%),
    radial-gradient(ellipse at 50% 60%, #3a2316 0%, #1a0c06 70%);
  box-shadow:
    0 1px 0 rgba(255, 220, 160, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 1;
}
.plate::before {
  content: '';
  position: absolute;
  inset: 4px 30px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, rgba(0,0,0,0.5), transparent 70%);
}

/* HUD */
.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 18px 20px 14px;
  padding-top: max(18px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  z-index: 5;
  text-align: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
}

/* When Telegram WebApp 8.0 fullscreen is active, push content below the
 * floating Close + menu buttons (Telegram doesn't always count them in
 * --tg-content-safe-area-inset-top). */
body.tg-fullscreen { --hud-h: 216px; }
@media (max-height: 720px) {
  body.tg-fullscreen { --hud-h: 196px; }
}
body.tg-fullscreen .hud,
body.tg-fullscreen .page-header {
  padding-top: max(100px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
}
body.tg-fullscreen .page-header .crumbs-pill {
  top: max(100px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
}
body.tg-fullscreen .store-list { top: 226px; }
body.tg-fullscreen .ups-scroll  { top: 218px; }
.hud-title {
  font-family: 'Fraunces', 'Georgia', serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--butter-2);
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
  display: block;
  margin-bottom: 6px;
}
.hud-count {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
  color: var(--cream-lt);
  text-shadow: 0 2px 0 rgba(0,0,0,0.5), 0 0 24px rgba(244, 200, 121, 0.18);
  letter-spacing: -0.015em;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}
.hud-count small { font-size: 14px; opacity: 0.7; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.hud-bps {
  font-size: 13px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.85;
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.hud-bps b { color: var(--butter); font-weight: 800; }

/* Brownie hero */
.hero-stage {
  position: absolute;
  top: var(--hud-h);
  left: 0; right: 0;
  bottom: var(--tabbar-h);
  display: grid;
  place-items: center;
  z-index: 2;
}
.hero-rays {
  position: absolute;
  width: 520px;
  height: 520px;
  background:
    radial-gradient(circle, rgba(255, 220, 150, 0.22) 0%, rgba(255, 220, 150, 0.08) 30%, transparent 60%);
  filter: blur(20px);
  pointer-events: none;
  animation: heroBreathe 5s ease-in-out infinite;
}
.hero-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 140, 0.45), transparent 65%);
  filter: blur(18px);
  animation: heroBreathe 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes heroBreathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.08); opacity: 1; }
}

/* steam rising from the brownie */
.steam {
  position: absolute;
  bottom: 60%;
  width: 14px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 240, 210, 0.5), transparent 70%);
  filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  animation: steamRise var(--sdur, 3.6s) ease-out var(--sdelay, 0s) infinite;
}
@keyframes steamRise {
  0%   { transform: translateY(0) scale(0.8); opacity: 0; }
  20%  { opacity: 0.7; }
  100% { transform: translateY(-130px) scale(1.4); opacity: 0; }
}

/* THE brownie */
.brownie-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  z-index: 3;
}
.brownie {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 18px 22px rgba(0,0,0,0.7)) drop-shadow(0 0 30px rgba(244, 200, 121, 0.18));
  animation: idleBob 3.2s ease-in-out infinite;
  transition: transform 80ms ease-out;
}
.brownie:hover { filter: drop-shadow(0 18px 22px rgba(0,0,0,0.7)) drop-shadow(0 0 40px rgba(244, 200, 121, 0.35)); }
.brownie:active { transform: scale(0.93); animation-play-state: paused; }
.brownie svg { width: 100%; height: 100%; }
@keyframes idleBob {
  0%, 100% { transform: translateY(0) rotate(-0.6deg); }
  50%      { transform: translateY(-5px) rotate(0.6deg); }
}

/* tap ring */
.tap-ring {
  position: absolute;
  border: 3px solid var(--butter);
  border-radius: 22%;
  animation: tapRing 600ms ease-out forwards;
  pointer-events: none;
}
@keyframes tapRing {
  0%   { inset: 10%; opacity: 0.8; }
  100% { inset: -20%; opacity: 0; }
}

/* Floating gain text */
.gain {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  font-family: 'Fraunces', serif;
  font-size: 24px;
  color: var(--butter);
  text-shadow: 0 2px 4px rgba(0,0,0,0.85), 0 0 12px rgba(244,200,121,0.7);
  animation: gainFloat 1000ms cubic-bezier(.2,.8,.3,1) forwards;
  z-index: 10;
  white-space: nowrap;
}
@keyframes gainFloat {
  0%   { transform: translate(-50%, 0) scale(0.6); opacity: 0; }
  20%  { transform: translate(-50%, -10px) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -90px) scale(0.85); opacity: 0; }
}

/* Crumb burst on tap */
.crumb-burst {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8a4a25, #2a1408 80%);
  pointer-events: none;
  animation: crumbBurst 700ms ease-out forwards;
  z-index: 9;
}
@keyframes crumbBurst {
  0%   { transform: translate(-50%,-50%) scale(0.6); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.4); opacity: 0; }
}

/* Cursor bots orbiting */
.cursor-bot-orbit {
  position: absolute;
  left: 50%; top: 50%;
  width: 30px; height: 30px;
  pointer-events: none;
  animation: orbitSpin var(--spin-dur, 12s) linear infinite;
  transform-origin: 50% 50%;
}
@keyframes orbitSpin { to { transform: translate(-50%,-50%) rotate(360deg); } }
.cursor-bot {
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6));
}

/* Buff strip — bps achievement-style status */
.bps-chip {
  position: absolute;
  top: calc(var(--hud-h) - 8px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(244,200,121,0.18), rgba(244,200,121,0.06));
  border: 1px solid rgba(244,200,121,0.25);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  color: var(--butter);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 4;
  white-space: nowrap;
}

/* ── Generic page header (Store, Mastery) ──────────────────── */

.page-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 18px 18px 12px;
  padding-top: max(18px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  z-index: 5;
  background: linear-gradient(180deg, var(--cocoa-900) 0%, rgba(29,16,12,0.92) 100%);
  border-bottom: 1px solid rgba(244,200,121, 0.1);
}
.page-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--cream-lt);
  margin: 0 0 2px;
  letter-spacing: -0.005em;
}
.page-header .sub {
  font-size: 12px;
  color: var(--parchment);
  opacity: 0.7;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.page-header .crumbs-pill {
  position: absolute;
  top: 18px;
  top: max(18px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  right: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(244,200,121, 0.2);
  border-radius: 20px;
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--butter);
}
.page-header .crumbs-pill .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8a4a25, #2a1408 80%);
  border: 1px solid rgba(244,200,121, 0.3);
}

/* ── Store page ────────────────────────────────────────────── */

.store-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--cocoa-900) 0%, var(--cocoa-950) 100%);
}

.buy-chips {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  background: rgba(0,0,0,0.3);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(244,200,121, 0.08);
}
.chip {
  flex: 1;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--parchment);
  cursor: pointer;
  transition: all 180ms;
  text-align: center;
}
.chip:not(.active):hover { color: var(--cream); }
.chip.active {
  background: linear-gradient(180deg, var(--caramel), var(--caramel-2));
  color: var(--cocoa-950);
  box-shadow: 0 2px 8px rgba(244, 200, 121, 0.15), inset 0 1px 0 rgba(255,255,255, 0.2);
}

.store-list {
  position: absolute;
  top: 138px;
  bottom: var(--tabbar-h);
  left: 0;
  right: 0;
  overflow-y: auto;
  padding: 12px 14px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--cocoa-600) transparent;
  -webkit-overflow-scrolling: touch;
}
.store-list::-webkit-scrollbar { width: 6px; }
.store-list::-webkit-scrollbar-thumb { background: var(--cocoa-600); border-radius: 3px; }

.producer-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(20, 10, 6, 0.55);
  border-radius: var(--radius);
  border: 1px solid rgba(244, 200, 121, 0.04);
  cursor: not-allowed;
  transition: all 150ms;
  position: relative;
  overflow: hidden;
  opacity: 0.78;
}
.producer-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(244,200,121,0.10) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 200ms;
  pointer-events: none;
}
.producer-row.affordable {
  background: linear-gradient(180deg, #7a4828 0%, #4a2814 100%);
  border-color: var(--butter);
  border-width: 1.5px;
  cursor: pointer;
  opacity: 1;
  box-shadow:
    0 0 0 1px rgba(244, 200, 121, 0.25),
    0 0 22px rgba(244, 200, 121, 0.18),
    0 4px 16px rgba(0,0,0, 0.4);
  animation: affordablePulse 2.4s ease-in-out infinite;
}
.producer-row.affordable::before { opacity: 1; animation: shimmer 3s linear infinite; }
.producer-row.affordable .producer-name { color: var(--cream-lt); }
.producer-row.affordable .producer-icon {
  background: linear-gradient(180deg, var(--caramel), var(--caramel-2));
  border-color: var(--butter);
  box-shadow: 0 0 12px rgba(244, 200, 121, 0.3), inset 0 1px 0 rgba(255,255,255, 0.15);
}
.producer-row.affordable:hover { filter: brightness(1.06); }
.producer-row.affordable:active { transform: translateY(1px); }
.producer-row.locked {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(0,0,0,0.35);
  border-style: dashed;
}
.producer-row.locked .producer-icon { filter: grayscale(0.7) brightness(0.55); }
.producer-row.locked .producer-name { color: var(--parchment); opacity: 0.7; }

@keyframes affordablePulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(244,200,121,0.25), 0 0 22px rgba(244,200,121,0.18), 0 4px 16px rgba(0,0,0,0.4); }
  50%      { box-shadow: 0 0 0 1px rgba(244,200,121,0.4),  0 0 32px rgba(244,200,121,0.32), 0 4px 16px rgba(0,0,0,0.4); }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.producer-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--cocoa-600) 0%, var(--cocoa-800) 100%);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 200, 120, 0.12);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255, 0.05);
}
.producer-icon svg { width: 36px; height: 36px; }

.producer-body { min-width: 0; }
.producer-name {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--cream);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.producer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
}
.producer-price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--butter);
}
.producer-price .crumb-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b06a3c, #3a1a08);
  border: 1px solid rgba(0,0,0,0.4);
}
.producer-bps {
  color: var(--parchment);
  opacity: 0.7;
  font-size: 11px;
  font-weight: 600;
}
.producer-tag {
  font-size: 11px;
  color: var(--parchment);
  opacity: 0.55;
  margin-top: 2px;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.producer-count {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 30px;
  color: var(--butter);
  line-height: 0.9;
  text-align: center;
  min-width: 36px;
}
.producer-row.locked .producer-count,
.producer-row:not(.affordable) .producer-count { color: var(--parchment); opacity: 0.6; }
.producer-row.affordable .producer-count { color: var(--cream-lt); }
.producer-count small {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--parchment);
  opacity: 0.55;
  letter-spacing: 0.16em;
  margin-top: 4px;
  text-transform: uppercase;
}
.producer-row.locked .producer-count { color: var(--parchment); opacity: 0.5; }

/* ── Mastery (upgrades) page ──────────────────────────────── */

.ups-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--cocoa-900), var(--cocoa-950));
}

.ups-tabs {
  display: flex;
  gap: 4px;
  padding: 0 14px;
  margin-top: 10px;
}
.ups-tab {
  flex: 1;
  padding: 10px 0 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--parchment);
  opacity: 0.55;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 200ms;
}
.ups-tab.active {
  color: var(--butter);
  opacity: 1;
  border-bottom-color: var(--butter);
}

.ups-scroll {
  position: absolute;
  top: 130px;
  bottom: var(--tabbar-h);
  left: 0; right: 0;
  overflow-y: auto;
  padding: 14px 16px 24px;
}
.ups-scroll::-webkit-scrollbar { width: 6px; }
.ups-scroll::-webkit-scrollbar-thumb { background: var(--cocoa-600); border-radius: 3px; }

/* Upgrades list — full-width cards instead of icon grid */
.ups-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(20, 10, 6, 0.55);
  border-radius: 12px;
  border: 1px solid rgba(244,200,121, 0.04);
  cursor: not-allowed;
  transition: all 150ms;
  opacity: 0.62;
}
.ups-card.affordable {
  background: linear-gradient(180deg, #7a4828 0%, #4a2814 100%);
  border-color: var(--butter);
  border-width: 1.5px;
  cursor: pointer;
  opacity: 1;
  box-shadow:
    0 0 0 1px rgba(244, 200, 121, 0.25),
    0 0 22px rgba(244, 200, 121, 0.18),
    0 4px 16px rgba(0,0,0, 0.4);
  animation: affordablePulse 2.4s ease-in-out infinite;
}
.ups-card.affordable .ups-card-icon {
  background: linear-gradient(180deg, var(--caramel), var(--caramel-2));
  border-color: var(--butter);
  box-shadow: 0 0 12px rgba(244, 200, 121, 0.3);
}
.ups-card.affordable:hover { filter: brightness(1.06); }
.ups-card.affordable:active { transform: translateY(1px); }
.ups-card.bought {
  background: linear-gradient(180deg, rgba(108,169,122,0.15), rgba(58,107,68,0.1));
  border-color: rgba(108,169,122, 0.45);
  cursor: default;
  opacity: 0.85;
}
.ups-card.bought .ups-card-name { color: #b9d9c0; }
.ups-card.locked {
  opacity: 0.42;
  cursor: not-allowed;
  background: rgba(0,0,0,0.3);
  border-style: dashed;
}
.ups-card.locked .ups-card-icon { filter: grayscale(0.7) brightness(0.55); }
.ups-card-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--cocoa-600), var(--cocoa-800));
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,200,120, 0.12);
}
.ups-card-icon svg { width: 30px; height: 30px; }
.ups-card-name {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--cream);
  line-height: 1.15;
}
.ups-card-desc {
  font-size: 11px;
  color: var(--parchment);
  opacity: 0.75;
  margin-top: 3px;
  line-height: 1.3;
}
.ups-card-price {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--butter);
  text-align: right;
  white-space: nowrap;
}
.ups-card-price small { display: block; font-size: 9px; font-weight: 700; color: var(--parchment); opacity: 0.6; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 2px; }
.ups-card.bought .ups-card-price { color: var(--cream-lt); }

/* Stats rows */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  margin-bottom: 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid rgba(244,200,121, 0.05);
}
.stat-row .k { color: var(--parchment); opacity: 0.85; font-weight: 600; letter-spacing: 0.02em; }
.stat-row .v { color: var(--butter); font-weight: 800; font-family: 'Fraunces', serif; font-size: 15px; }

/* Achievements grid */
.section-label {
  font-size: 10px;
  color: var(--parchment);
  opacity: 0.6;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  margin: 18px 4px 8px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.ach-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--cocoa-900);
  border: 1px solid rgba(244,200,121,0.06);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--parchment);
  opacity: 0.4;
  transition: all 180ms;
}
.ach-cell.got {
  opacity: 1;
  background: linear-gradient(180deg, var(--caramel-2), var(--cocoa-700));
  border-color: var(--butter);
  color: var(--butter);
  text-shadow: 0 0 8px rgba(244, 200, 121, 0.5);
}

/* Prestige card */
.prestige-card {
  margin: 14px 0 0;
  padding: 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(196, 75, 106, 0.45), transparent 70%),
    linear-gradient(180deg, #3a1120, #1a0810);
  border: 1px solid rgba(230, 130, 170, 0.3);
  position: relative;
  overflow: hidden;
}
.prestige-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,180,180,0.25), transparent 70%);
  filter: blur(10px);
}
.prestige-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 800;
  color: #f2b6c8;
  margin: 0 0 6px;
}
.prestige-card p {
  font-size: 12px;
  color: var(--parchment);
  opacity: 0.85;
  margin: 0 0 12px;
  line-height: 1.5;
}
.prestige-card p b { color: #f2b6c8; }
.prestige-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e682aa;
  background: linear-gradient(180deg, #c94870, #8a2d4c);
  color: var(--cream-lt);
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: all 150ms;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 0 rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}
.prestige-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: var(--cocoa-700);
  border-color: var(--cocoa-600);
  color: var(--parchment);
  box-shadow: none;
}
.prestige-btn:not(:disabled):hover { filter: brightness(1.08); }
.prestige-btn:not(:disabled):active { transform: translateY(1px); }

/* Hard reset tiny button */
.hard-reset {
  margin-top: 24px;
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(196, 75, 106, 0.25);
  border-radius: 8px;
  color: rgba(230, 130, 170, 0.55);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 150ms;
}
.hard-reset:hover { color: #f2b6c8; border-color: #e682aa; }

/* Progress bar (e.g. next milestone) */
.progress-rail {
  height: 6px;
  background: rgba(0,0,0,0.45);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--caramel), var(--butter));
  transition: width 400ms ease-out;
  border-radius: 3px;
}

/* ──────────────────────────────────────────────────────────────────────
 * Boot / loading screen — same warm bakery vibe as the gameplay.
 * ───────────────────────────────────────────────────────────────────── */
.boot-title {
  position: absolute;
  top: 16%;
  left: 0; right: 0;
  text-align: center;
  z-index: 10;
  pointer-events: none;
}
.boot-title-eyebrow {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--butter);
  opacity: 0.75;
  margin-bottom: 8px;
}
.boot-title-name {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--cream-lt);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7), 0 0 28px rgba(244, 200, 121, 0.18);
}
.boot-title-sub {
  margin-top: 4px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.6;
}

.boot-status {
  position: absolute;
  bottom: 14%;
  left: 0; right: 0;
  text-align: center;
  z-index: 10;
  pointer-events: none;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--cream);
  opacity: 0.8;
  letter-spacing: 0.04em;
}
.boot-status .dot {
  display: inline-block;
  opacity: 0;
  animation: bootDot 1.4s ease-in-out infinite;
}
.boot-status .dot:nth-child(1) { animation-delay: 0s; }
.boot-status .dot:nth-child(2) { animation-delay: 0.18s; }
.boot-status .dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes bootDot {
  0%, 80%, 100% { opacity: 0; transform: translateY(2px); }
  40%           { opacity: 1; transform: translateY(0); }
}

.boot-progress-rail {
  position: absolute;
  bottom: 9%;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 3px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(246, 233, 207, 0.08);
  z-index: 10;
}
.boot-progress-fill {
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--butter) 50%, transparent);
  animation: bootSlide 1.6s ease-in-out infinite;
}
@keyframes bootSlide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* error/connection-failed screen — uses the same bakery backdrop */
.boot-error-card {
  position: absolute;
  top: 50%;
  left: 30px; right: 30px;
  transform: translateY(-50%);
  text-align: center;
  z-index: 10;
}
.boot-error-title {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--berry);
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(196, 75, 106, 0.3);
}
.boot-error-msg {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--cream);
  opacity: 0.75;
  line-height: 1.55;
  margin-bottom: 24px;
}
.boot-retry {
  background: linear-gradient(180deg, rgba(210, 138, 90, 0.22), rgba(176, 106, 60, 0.16));
  border: 1px solid var(--caramel);
  color: var(--cream-lt);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 12px 26px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 80ms ease-out;
}
.boot-retry:hover  { background: linear-gradient(180deg, rgba(210, 138, 90, 0.34), rgba(176, 106, 60, 0.22)); }
.boot-retry:active { transform: scale(0.97); }

/* ──────────────────────────────────────────────────────────────────────
 * Welcome-back / offline-earnings modal — shown once on boot if the
 * server-applied offline gain was non-zero.
 * ───────────────────────────────────────────────────────────────────── */
.welcome-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(74, 36, 18, 0.55) 0%, rgba(8, 4, 2, 0.88) 60%),
    rgba(8, 4, 2, 0.78);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: grid;
  place-items: center;
  animation: welcomeFade 240ms ease-out;
}
@keyframes welcomeFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Ambient gold rays behind the card — slow breathing pulse like the bakery hero. */
.welcome-overlay::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 520px; height: 520px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 220, 150, 0.28) 0%, rgba(255, 220, 150, 0.08) 30%, transparent 60%);
  filter: blur(18px);
  pointer-events: none;
  animation: heroBreathe 5s ease-in-out infinite;
}

.welcome-card {
  width: min(88%, 340px);
  padding: 64px 24px 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% -10%, rgba(244, 200, 121, 0.16) 0%, transparent 60%),
    linear-gradient(180deg, var(--cocoa-700) 0%, var(--cocoa-900) 100%);
  border: 1.5px solid var(--butter-2);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.6),
    0 0 48px rgba(244, 200, 121, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  position: relative;
  animation: welcomePop 380ms cubic-bezier(0.18, 0.9, 0.32, 1.25);
}
@keyframes welcomePop {
  0%   { opacity: 0; transform: translateY(22px) scale(0.9); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.welcome-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 220, 150, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(196, 75, 106, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* Floating brownie + steam at the top of the card */
.welcome-brownie {
  position: absolute;
  top: -38px;
  left: 50%;
  width: 96px;
  height: 96px;
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 22px rgba(244, 200, 121, 0.35));
  animation: idleBob 3.2s ease-in-out infinite;
  z-index: 2;
}
.welcome-brownie svg { width: 100%; height: 100%; }
.welcome-steam {
  position: absolute;
  bottom: 100%;
  width: 12px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 240, 210, 0.55), transparent 70%);
  filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  animation: steamRise var(--sdur, 3.4s) ease-out var(--sdelay, 0s) infinite;
}

.welcome-eyebrow {
  position: relative;
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--butter);
  margin-bottom: 8px;
  opacity: 0.9;
}
.welcome-eyebrow::before,
.welcome-eyebrow::after {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--butter-2));
  vertical-align: middle;
  margin: 0 10px 2px;
  opacity: 0.6;
}
.welcome-eyebrow::after {
  background: linear-gradient(90deg, var(--butter-2), transparent);
}
.welcome-title {
  position: relative;
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--cream-lt);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.welcome-sub {
  position: relative;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.7;
  margin-bottom: 24px;
}

/* The big +crumbs number + sparkle backdrop */
.welcome-amount-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 6px;
}
.welcome-amount-wrap::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 220px; height: 220px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(244, 200, 121, 0.32) 0%, transparent 55%);
  filter: blur(8px);
  pointer-events: none;
  z-index: -1;
  animation: heroBreathe 3.2s ease-in-out infinite;
}
.welcome-amount {
  position: relative;
  font-family: 'Fraunces', serif;
  font-size: 44px;
  font-weight: 900;
  color: var(--butter);
  letter-spacing: -0.02em;
  text-shadow: 0 0 22px rgba(244, 200, 121, 0.5), 0 2px 4px rgba(0, 0, 0, 0.5);
  display: inline-block;
  animation: amountPop 600ms cubic-bezier(0.2, 1.4, 0.4, 1) 200ms backwards;
}
@keyframes amountPop {
  0%   { opacity: 0; transform: scale(0.6); }
  60%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
.welcome-amount-unit {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.7;
  margin-left: 8px;
}

/* Floating sparkles around the amount */
.welcome-sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--butter);
  pointer-events: none;
  opacity: 0;
  animation: sparkleFloat var(--dur, 2.6s) ease-out var(--delay, 0s) infinite;
  filter: blur(0.5px);
  box-shadow: 0 0 6px var(--butter);
}
@keyframes sparkleFloat {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.6); }
  20%  { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, -50px)) scale(1); }
}

.welcome-meta {
  position: relative;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.55;
  margin: 4px 0 22px;
  letter-spacing: 0.04em;
}
.welcome-meta b {
  color: var(--butter);
  font-weight: 800;
  opacity: 0.9;
}

.welcome-collect {
  position: relative;
  width: 100%;
  padding: 14px 0;
  border-radius: 14px;
  border: 1.5px solid var(--butter-2);
  background:
    linear-gradient(180deg, var(--butter-2) 0%, var(--caramel-2) 100%);
  color: var(--cocoa-950);
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 120ms ease-out, transform 80ms ease-out;
  box-shadow:
    0 8px 24px rgba(244, 200, 121, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.welcome-collect::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: welcomeShimmer 3s ease-in-out 600ms infinite;
}
@keyframes welcomeShimmer {
  0%, 50% { left: -100%; }
  100%    { left: 200%; }
}
.welcome-collect:hover  { filter: brightness(1.08); }
.welcome-collect:active { transform: scale(0.97); }

/* ──────────────────────────────────────────────────────────────────────
 * Onboarding carousel — shown on first launch only.
 * ───────────────────────────────────────────────────────────────────── */
.onb-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: welcomeFade 240ms ease-out;
}
.onb-skip {
  position: absolute;
  top: max(18px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px));
  right: 18px;
  z-index: 5;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(244, 200, 121, 0.18);
  border-radius: 999px;
  color: var(--cream);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}
body.tg-fullscreen .onb-skip {
  top: max(100px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px));
}
.onb-skip:hover { opacity: 1; }

.onb-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 30px 0;
  text-align: center;
  position: relative;
  z-index: 2;
  animation: onbSlide 360ms cubic-bezier(0.18, 0.9, 0.32, 1.05);
}
@keyframes onbSlide {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.onb-visual {
  position: relative;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
}
.onb-glow {
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, rgba(244, 200, 121, 0.32) 0%, transparent 60%);
  filter: blur(14px);
  animation: heroBreathe 4s ease-in-out infinite;
  pointer-events: none;
}
.onb-brownie {
  position: relative;
  width: 160px;
  height: 160px;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 28px rgba(244, 200, 121, 0.32));
  animation: idleBob 3.2s ease-in-out infinite;
}
.onb-brownie svg { width: 100%; height: 100%; }
.onb-tap-ring {
  position: absolute;
  width: 180px; height: 180px;
  border: 2.5px solid var(--butter);
  border-radius: 22%;
  pointer-events: none;
  animation: onbTapRing 1.6s ease-out infinite;
}
@keyframes onbTapRing {
  0%   { opacity: 0.9; transform: scale(0.85); }
  100% { opacity: 0;   transform: scale(1.2); }
}

.onb-card-preview {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  width: 240px;
  background:
    linear-gradient(180deg, rgba(210, 138, 90, 0.18) 0%, rgba(58, 35, 22, 0.85) 100%);
  border: 1.5px solid var(--butter-2);
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(244, 200, 121, 0.25);
}
.onb-card-icon {
  width: 56px; height: 56px;
  background: linear-gradient(180deg, var(--caramel) 0%, var(--caramel-2) 100%);
  border-radius: 12px;
  border: 1.5px solid var(--butter-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.onb-card-icon svg { width: 32px; height: 32px; }
.onb-card-body { text-align: left; }
.onb-card-name {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--cream-lt);
  margin-bottom: 2px;
}
.onb-card-meta {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--butter);
  opacity: 0.9;
}

.onb-star {
  width: 130px; height: 130px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 24px rgba(244, 200, 121, 0.4));
  animation: idleBob 3.4s ease-in-out infinite;
}

.onb-eyebrow {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--butter);
  opacity: 0.85;
  margin-bottom: 10px;
}
.onb-title {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--cream-lt);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 14px;
}
.onb-body {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.78;
  line-height: 1.55;
  max-width: 320px;
}

.onb-footer {
  position: relative;
  z-index: 2;
  padding: 0 24px;
  padding-bottom: max(28px, env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.onb-dots {
  display: flex;
  gap: 8px;
}
.onb-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(246, 233, 207, 0.18);
  cursor: pointer;
  transition: background 0.25s, width 0.25s, transform 0.2s;
}
.onb-dot.active {
  width: 22px;
  border-radius: 4px;
  background: var(--butter);
  box-shadow: 0 0 10px rgba(244, 200, 121, 0.5);
}
.onb-buttons {
  display: flex;
  gap: 10px;
  width: 100%;
}
.onb-back, .onb-next {
  flex: 1;
  padding: 14px 0;
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 120ms ease-out, transform 80ms ease-out;
}
.onb-back {
  background: transparent;
  border: 1px solid rgba(244, 200, 121, 0.3);
  color: var(--cream);
  flex: 0 0 90px;
}
.onb-back:hover { background: rgba(210, 138, 90, 0.12); }
.onb-next {
  border: 1.5px solid var(--butter-2);
  background: linear-gradient(180deg, var(--butter-2) 0%, var(--caramel-2) 100%);
  color: var(--cocoa-950);
  box-shadow:
    0 8px 22px rgba(244, 200, 121, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}
.onb-next:hover  { filter: brightness(1.08); }
.onb-next:active { transform: scale(0.97); }
.onb-back:active { transform: scale(0.97); }

/* Naming step */
.onb-sign {
  position: relative;
  padding: 18px 26px 16px;
  background:
    linear-gradient(180deg, var(--cocoa-700) 0%, var(--cocoa-900) 100%);
  border: 1.5px solid var(--butter-2);
  border-radius: 14px;
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(244, 200, 121, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  min-width: 200px;
  animation: idleBob 3.4s ease-in-out infinite;
}
.onb-sign-eyebrow {
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--butter);
  opacity: 0.7;
  margin-bottom: 4px;
}
.onb-sign-name {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--cream-lt);
}

.onb-input-wrap {
  position: relative;
  width: min(100%, 320px);
  margin-top: 18px;
}
.onb-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(244, 200, 121, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: var(--cream-lt);
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
  box-sizing: border-box;
}
.onb-input::placeholder {
  color: var(--parchment);
  opacity: 0.4;
  font-weight: 600;
  font-size: 16px;
}
.onb-input:focus {
  border-color: var(--butter);
  box-shadow: 0 0 0 4px rgba(244, 200, 121, 0.12), 0 0 16px rgba(244, 200, 121, 0.18);
}
.onb-input-meta {
  position: absolute;
  bottom: -18px;
  right: 4px;
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.4;
  letter-spacing: 0.08em;
}

/* ──────────────────────────────────────────────────────────────────────
 * HUD boost chip — visible on Bakery while a 2× boost is active.
 * ───────────────────────────────────────────────────────────────────── */
.boost-chip {
  position: absolute;
  top: calc(var(--hud-h) - 8px);
  left: 50%;
  transform: translate(-50%, calc(var(--bps-chip-offset, 0px)));
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(244, 200, 121, 0.28), rgba(176, 106, 60, 0.18));
  border: 1px solid var(--butter-2);
  box-shadow: 0 0 14px rgba(244, 200, 121, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--cream-lt);
  white-space: nowrap;
  animation: boostPulse 2.4s ease-in-out infinite;
}
.boost-chip .boost-bolt {
  font-size: 14px;
  filter: drop-shadow(0 0 4px rgba(244, 200, 121, 0.7));
}
.boost-chip .boost-countdown {
  color: var(--butter);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-left: 4px;
  opacity: 0.85;
}
@keyframes boostPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(244, 200, 121, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
  50%      { box-shadow: 0 0 22px rgba(244, 200, 121, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
}
/* nudge boost chip below bps chip when both are visible */
.bps-chip ~ .boost-chip { margin-top: 38px; }

/* ──────────────────────────────────────────────────────────────────────
 * Shop sub-tab — Daily / Boost / Referral
 * ───────────────────────────────────────────────────────────────────── */
.shop-tab { padding: 4px 0 24px; position: relative; }

.shop-flash {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 0 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(108, 169, 122, 0.22), rgba(108, 169, 122, 0.08));
  border: 1px solid var(--mint);
  border-radius: 12px;
  color: var(--cream-lt);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.06em;
  animation: welcomeFade 200ms ease-out;
}
.shop-flash.err {
  background: linear-gradient(180deg, rgba(196, 75, 106, 0.22), rgba(196, 75, 106, 0.08));
  border-color: var(--berry);
}

.shop-section { margin-bottom: 22px; }
.shop-section-title {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--butter);
  opacity: 0.85;
  margin: 4px 4px 8px;
}
.shop-section-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.65;
  line-height: 1.5;
  margin: 0 4px 12px;
}
.shop-section-sub b { color: var(--butter); font-weight: 800; opacity: 0.9; }

.shop-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(58, 35, 22, 0.85) 0%, rgba(42, 24, 15, 0.85) 100%);
  border: 1px solid rgba(244, 200, 121, 0.18);
  border-radius: 14px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}
.shop-card.daily-card.ready {
  background: linear-gradient(180deg, rgba(210, 138, 90, 0.28) 0%, rgba(176, 106, 60, 0.16) 100%);
  border-color: var(--butter-2);
  box-shadow: 0 0 22px rgba(244, 200, 121, 0.22);
  animation: affordablePulse 2.4s ease-in-out infinite;
}
.shop-card-icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(244, 200, 121, 0.25);
  background: rgba(0, 0, 0, 0.35);
}
.shop-card-icon svg { width: 28px; height: 28px; color: var(--butter); }
.shop-card-icon.daily-icon { color: var(--butter); }
.shop-card-icon.boost-icon {
  font-size: 22px;
  color: var(--butter);
  text-shadow: 0 0 8px rgba(244, 200, 121, 0.7);
}
.shop-card-body { flex: 1; min-width: 0; }
.shop-card-name {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--cream-lt);
  margin-bottom: 2px;
}
.shop-card-meta {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.7;
  line-height: 1.35;
}

.shop-cta {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--butter-2);
  background: linear-gradient(180deg, var(--butter-2) 0%, var(--caramel-2) 100%);
  color: var(--cocoa-950);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 120ms, transform 80ms;
  box-shadow: 0 4px 12px rgba(244, 200, 121, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}
.shop-cta:hover  { filter: brightness(1.07); }
.shop-cta:active { transform: scale(0.96); }
.shop-cta:disabled {
  background: linear-gradient(180deg, rgba(108, 76, 56, 0.6) 0%, rgba(80, 56, 40, 0.6) 100%);
  border-color: rgba(244, 200, 121, 0.18);
  color: rgba(246, 233, 207, 0.5);
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
  transform: none;
}
.shop-cta.stars .star { color: var(--cocoa-950); margin-right: 2px; }
.shop-cta-ghost {
  flex-shrink: 0;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(244, 200, 121, 0.25);
  background: transparent;
  color: var(--cream);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.shop-cta-ghost:hover  { background: rgba(210, 138, 90, 0.15); }
.shop-cta-ghost:active { transform: scale(0.96); }
.shop-cta-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.referral-card {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.referral-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0 4px;
}
.referral-label {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--butter);
  opacity: 0.75;
}
.referral-code {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--cream-lt);
  letter-spacing: 0.12em;
  cursor: pointer;
  text-shadow: 0 0 14px rgba(244, 200, 121, 0.3);
}
.referral-stats {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.7;
  margin-top: 4px;
}
.referral-stats b { color: var(--butter); font-weight: 800; opacity: 0.95; }
.referral-buttons {
  display: flex;
  gap: 8px;
}
.referral-buttons .shop-cta { flex: 1; }

/* ──────────────────────────────────────────────────────────────────────
 * Play-on-Telegram screen — shown when the page is opened OUTSIDE Telegram.
 * Visitors get the brand + a single big "Open in Telegram" CTA.
 * ───────────────────────────────────────────────────────────────────── */
.play-tg-card {
  position: absolute;
  bottom: 14%;
  left: 24px; right: 24px;
  z-index: 10;
  text-align: center;
  padding: 22px 22px 20px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% -30%, rgba(244, 200, 121, 0.18) 0%, transparent 60%),
    linear-gradient(180deg, var(--cocoa-700) 0%, var(--cocoa-900) 100%);
  border: 1.5px solid var(--butter-2);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(244, 200, 121, 0.18);
  animation: welcomePop 380ms cubic-bezier(0.18, 0.9, 0.32, 1.25);
}
.play-tg-eyebrow {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--butter);
  opacity: 0.85;
  margin-bottom: 6px;
}
.play-tg-title {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--cream-lt);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.play-tg-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.7;
  line-height: 1.5;
  margin-bottom: 18px;
}
.play-tg-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 0;
  border-radius: 12px;
  border: 1.5px solid var(--butter-2);
  background: linear-gradient(180deg, #2aabee 0%, #229ed9 100%);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 120ms, transform 80ms;
  box-shadow:
    0 8px 24px rgba(34, 158, 217, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.play-tg-cta:hover  { filter: brightness(1.07); }
.play-tg-cta:active { transform: scale(0.97); }
.play-tg-meta {
  margin-top: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.6;
}
.play-tg-meta b { color: var(--butter); font-weight: 800; }
.play-tg-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(244, 200, 121, 0.12);
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--parchment);
  opacity: 0.55;
}
.play-tg-foot a {
  color: var(--butter);
  text-decoration: none;
  font-weight: 700;
}
.play-tg-foot a:hover { text-decoration: underline; }
