/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f3e8ff;
  --left-bg:      rgba(232, 255, 244, 0.72);
  --right-bg:     rgba(255, 240, 248, 0.72);
  --panel-border: rgba(160, 100, 220, 0.18);
  --card-bg:      rgba(255, 255, 255, 0.82);

  --purple:       #7c3aed;
  --purple-light: #a855f7;
  --pink:         #db2777;
  --pink-light:   #ec4899;

  --text-dark:    #1e0845;
  --text-med:     #6b21a8;
  --text-light:   #a78bca;

  --btn-primary:  linear-gradient(135deg, #db2777, #ec4899);
  --shadow:       0 4px 22px rgba(120, 50, 180, 0.18);
  --shadow-sm:    0 2px 10px rgba(120, 50, 180, 0.1);
  --glass:        rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.7);
}

body {
  font-family: 'Nunito', sans-serif;
  color: var(--text-dark);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(-45deg, #f0e6ff, #fce7f3, #e0f7ff, #eef2ff);
  background-size: 400% 400%;
  animation: bg-shift 20s ease infinite;
}
@keyframes bg-shift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

/* ── Three-column layout ── */
#game {
  display: flex;
  flex: 1;
  overflow: hidden;
}

aside {
  width: 340px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 1.1rem 0.9rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 80, 220, 0.3) transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
aside::-webkit-scrollbar       { width: 5px; }
aside::-webkit-scrollbar-thumb { background: rgba(150, 80, 220, 0.3); border-radius: 10px; }

#upgrades-panel {
  background: var(--left-bg);
  border-right: 1px solid rgba(255,255,255,0.6);
  box-shadow: 2px 0 18px rgba(120,50,180,0.07);
}
#buildings-panel {
  background: var(--right-bg);
  border-left: 1px solid rgba(255,255,255,0.6);
  box-shadow: -2px 0 18px rgba(120,50,180,0.07);
}

aside h2 {
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(219,39,119,0.15);
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Center panel ── */
#center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  position: relative;
  overflow: hidden;
  padding: 1rem;
  isolation: isolate;
}
/* glowing spotlight orb behind squishy */
#center-panel::before {
  content: '';
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(219,39,119,0.09) 0%, rgba(124,58,237,0.06) 40%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: orb-pulse 5s ease-in-out infinite alternate;
}
@keyframes orb-pulse {
  0%   { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.08); opacity: 1;   }
}

/* ── Background squishy rain ── */
#bg-squishies {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.falling-squishy {
  position: absolute;
  top: -60px;
  user-select: none;
  pointer-events: none;
  animation: squishy-fall linear forwards;
  will-change: transform;
}
@keyframes squishy-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  8%   { opacity: var(--sq-opacity, 0.18); }
  88%  { opacity: var(--sq-opacity, 0.18); }
  100% { transform: translateY(110vh) rotate(var(--sq-rotate, 270deg)); opacity: 0; }
}

/* ── SP counter ── */
#sp-display {
  text-align: center;
  line-height: 1.15;
}
#sp-count {
  display: block;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(124,58,237,0.25));
}
.sp-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-med);
}

#sps-display {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
}
#sps-value {
  color: var(--pink);
  font-weight: 800;
}

/* ── Squishy ── */
#squishy-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  position: relative;
}
/* glowing pedestal under squishy */
#squishy-wrap::after {
  content: '';
  position: absolute;
  bottom: 44px;
  width: 180px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(219,39,119,0.22) 0%, transparent 72%);
  pointer-events: none;
  animation: pedestal-pulse 3.5s ease-in-out infinite alternate;
}
@keyframes pedestal-pulse {
  0%   { opacity: 0.6; transform: scaleX(0.85); }
  100% { opacity: 1;   transform: scaleX(1.1);  }
}

#squishy {
  width: 222px;
  height: 222px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 8px 22px rgba(219, 39, 119, 0.38));
  animation: squishy-idle-glow 4s ease-in-out infinite alternate;
  transition: filter 0.15s;
}
@keyframes squishy-idle-glow {
  0%   { filter: drop-shadow(0 8px 20px rgba(219,39,119,0.35)); }
  100% { filter: drop-shadow(0 12px 36px rgba(219,39,119,0.58)) drop-shadow(0 0 28px rgba(168,85,247,0.28)); }
}

/* squeeze! button */
#squeeze-btn {
  background: var(--btn-primary);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 2.4rem;
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(219, 39, 119, 0.45), 0 0 0 0 rgba(219,39,119,0.2);
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
  overflow: hidden;
}
#squeeze-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -80%;
  width: 55%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.38), transparent);
  transform: skewX(-22deg);
  animation: btn-shimmer 2.8s ease-in-out infinite;
}
@keyframes btn-shimmer {
  0%, 35% { left: -80%; }
  65%, 100% { left: 130%; }
}
#squeeze-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(219, 39, 119, 0.55); }
#squeeze-btn:active { transform: translateY(1px);  box-shadow: 0 2px 8px  rgba(219, 39, 119, 0.3);  }

/* SVG color transitions for level changes */
#sq-body, #sq-inner               { transition: fill   0.9s ease; }
#sq-cheek-l, #sq-cheek-r          { transition: fill   0.9s ease; }
#sq-mouth                          { transition: stroke 0.9s ease; }
.sq-blush-dot                      { transition: fill   0.9s ease; }

/* Squishy level label */
#squishy-level {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.04em;
}
@keyframes level-flash {
  0%   { color: var(--pink); transform: scale(1.3); }
  55%  { color: var(--pink); }
  100% { color: var(--text-light); transform: scale(1); }
}
#squishy-level.leveled-up { animation: level-flash 1.4s ease forwards; }

/* click info */
#click-info {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 600;
}
#click-count { color: var(--text-med); font-weight: 800; }

/* ── Floating +1 popup ── */
.click-popup {
  position: absolute;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--purple);
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(124, 58, 237, 0.3);
  animation: float-up 0.7s ease-out forwards;
  transform: translateX(-50%);
}
@keyframes float-up {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-60px); }
}

/* ── Upgrades placeholder ── */
.empty-msg {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 2rem 0.5rem;
}

/* ── Building cards ── */
.building-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.9) 0%, rgba(255,245,255,0.75) 100%);
  border-radius: 16px;
  padding: 0.7rem 0.75rem;
  margin-bottom: 0.55rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1.5px solid rgba(255,255,255,0.7);
  border-left: 3px solid transparent;
  opacity: 0.6;
  transition: opacity 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s, transform 0.15s;
  backdrop-filter: blur(6px);
}
.building-card.owned {
  opacity: 1;
  border-left-color: var(--pink-light);
  border-color: rgba(255,255,255,0.7);
  border-left-color: var(--pink-light);
}
.building-card:hover {
  box-shadow: 0 8px 30px rgba(219,39,119,0.2);
  border-color: rgba(219,39,119,0.35);
  border-left-color: var(--pink);
  background: linear-gradient(135deg, rgba(255,240,248,0.95), rgba(252,231,243,0.95));
  transform: translateX(-4px) translateY(-1px);
}

.building-emoji {
  font-size: 2.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.building-mid {
  flex: 1;
  min-width: 0;
}
.building-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-dark);
  white-space: normal;
  line-height: 1.25;
}
.building-desc {
  font-size: 0.7rem;
  color: var(--text-light);
  line-height: 1.35;
  margin-top: 0.1rem;
}
.building-sps {
  font-size: 0.7rem;
  color: var(--pink);
  font-weight: 700;
  margin-top: 0.15rem;
}

.building-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.building-count {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--purple);
  line-height: 1;
  min-width: 2ch;
  text-align: center;
}

/* buy button */
.buy-btn {
  background: var(--btn-primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.3rem 0.6rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.25;
  box-shadow: 0 3px 12px rgba(219, 39, 119, 0.35);
  transition: transform 0.1s, box-shadow 0.1s;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.buy-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}
.buy-btn:hover:not(:disabled)  { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(219, 39, 119, 0.48); }
.buy-btn:active:not(:disabled) { transform: translateY(0); }
.buy-btn:disabled {
  background: linear-gradient(135deg, #d1d5db, #c4b5c8);
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-buy-label { font-size: 0.67rem; opacity: 0.88; }
.btn-cost      { font-size: 0.8rem;  font-weight: 800; }

/* ── Bottom bar ── */
#bottom-bar {
  height: 46px;
  background: rgba(15, 5, 42, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(160,100,220,0.28);
  color: rgba(255,255,255,0.82);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
}

#lifetime-area {
  white-space: nowrap;
  flex-shrink: 0;
}
#lifetime-sp { color: #d8b4fe; font-weight: 800; }

#save-area {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}
#save-area button {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  padding: 0.24rem 0.78rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
#save-area button:hover { background: rgba(255,255,255,0.22); transform: translateY(-1px); }
#save-area button.saved {
  background: rgba(52, 211, 153, 0.28);
  border-color: rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
}
#reset-btn { opacity: 0.5; }
#reset-btn:hover {
  opacity: 1 !important;
  background: rgba(248, 113, 113, 0.28) !important;
  border-color: rgba(248, 113, 113, 0.5) !important;
}

#ticker-area {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0.45;
  font-size: 0.78rem;
}
#ticker-text { transition: opacity 0.4s ease; }
#ticker-text.ticker-fade { opacity: 0; }

#music-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
#music-mute-btn {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  padding: 0.24rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  line-height: 1;
}
#music-mute-btn:hover { background: rgba(255,255,255,0.22); transform: translateY(-1px); }
#music-volume-slider {
  width: 72px;
  cursor: pointer;
  accent-color: #db2777;
  opacity: 0.75;
  transition: opacity 0.15s;
}
#music-volume-slider:hover { opacity: 1; }

/* ── Upgrade tiles ── */
.upg-purchased-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--panel-border);
}
.upg-mini {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: default;
  box-shadow: var(--shadow-sm);
  opacity: 0.78;
  transition: transform 0.12s;
}
.upg-mini:hover { transform: scale(1.12); opacity: 1; }

.upgrade-tile {
  background: linear-gradient(160deg, rgba(255,255,255,0.88), rgba(248,240,255,0.75));
  border-radius: 12px;
  padding: 0.6rem 0.65rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.7);
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s, border-color 0.15s;
  backdrop-filter: blur(4px);
}
.upgrade-tile:hover:not(.unaffordable) {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(219, 39, 119, 0.35);
  background: linear-gradient(135deg, rgba(255,240,248,0.95), rgba(248,225,255,0.95));
}
.upgrade-tile.unaffordable {
  opacity: 0.42;
  cursor: not-allowed;
}
.upg-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.upg-info { flex: 1; min-width: 0; }
.upg-name { font-size: 0.82rem; font-weight: 800; color: var(--text-dark); }
.upg-desc { font-size: 0.68rem; color: var(--text-light); line-height: 1.35; margin-top: 0.1rem; }
.upg-cost { font-size: 0.75rem; font-weight: 800; color: var(--purple); margin-top: 0.2rem; }

/* ── Collectible unlock toast (slides from left) ── */
.collectible-toast {
  position: fixed;
  bottom: 58px;
  left: 1rem;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
  border-radius: 16px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 6px 28px rgba(251,191,36,0.45);
  border-left: 4px solid #d97706;
  transform: translateX(calc(-100% - 1.5rem));
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1001;
  max-width: 280px;
  pointer-events: none;
}
.collectible-toast.show { transform: translateX(0); }
.coll-emoji { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.coll-info  { flex: 1; }
.coll-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(255,255,255,0.78); margin-bottom: 0.1rem; }
.coll-name  { font-size: 0.9rem; font-weight: 800; }
.coll-sub   { font-size: 0.68rem; opacity: 0.75; margin-top: 0.08rem; }

/* ── Achievement banner (top of screen) ── */
.achievement-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1e0845 0%, #3b0764 50%, #1e1060 100%);
  backdrop-filter: blur(16px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.8rem 2rem;
  box-shadow: 0 4px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(219,39,119,0.35) inset;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, transparent, var(--pink), var(--purple), var(--pink), transparent) 1;
  z-index: 2000;
  transform: translateY(-110%);
  transition: transform 0.5s cubic-bezier(0.34, 1.3, 0.64, 1);
  pointer-events: none;
}
.achievement-banner.show { transform: translateY(0); }
.ach-banner-icon {
  font-size: 2.8rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(219,39,119,0.6));
  animation: ach-icon-bounce 0.6s ease 0.3s both;
}
@keyframes ach-icon-bounce {
  0%   { transform: scale(0.5) rotate(-15deg); }
  60%  { transform: scale(1.25) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.ach-banner-body { text-align: left; }
.ach-banner-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--pink-light), #f0abfc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.15rem;
}
.ach-banner-name {
  font-size: 1rem;
  font-weight: 900;
  color: white;
  letter-spacing: 0.01em;
}
.ach-banner-desc {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.58);
  margin-top: 0.08rem;
}
.ach-banner-sparkles {
  font-size: 1.8rem;
  flex-shrink: 0;
  animation: sparkle-spin 1.5s ease-in-out infinite alternate;
}
@keyframes sparkle-spin {
  0%   { transform: rotate(-15deg) scale(0.9); opacity: 0.7; }
  100% { transform: rotate(15deg)  scale(1.15); opacity: 1; }
}

/* ── Level display (top of center panel) ── */
#squishy-level-top {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-med);
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(248,225,255,0.75));
  border-radius: 999px;
  padding: 0.28rem 1.1rem;
  border: 1.5px solid rgba(219,39,119,0.22);
  box-shadow: 0 2px 14px rgba(219,39,119,0.12), inset 0 1px 0 rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
}
#squishy-level-top.leveled-up, #squishy-level.leveled-up {
  animation: level-flash 1.4s ease forwards;
}

/* ── Frenzy mode — screen goes wild ── */
body.frenzy-mode {
  background: linear-gradient(-45deg, #ff006e, #ffbe0b, #fb5607, #8338ec) !important;
  background-size: 400% 400% !important;
  animation: bg-frenzy 0.38s ease infinite !important;
}
@keyframes bg-frenzy {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}
body.frenzy-mode #squishy {
  animation: squishy-frenzy-pulse 0.28s ease-in-out infinite alternate !important;
}
@keyframes squishy-frenzy-pulse {
  0%   { filter: drop-shadow(0 0 22px rgba(255,0,110,0.9))  drop-shadow(0 0 55px rgba(251,86,7,0.6));  }
  100% { filter: drop-shadow(0 0 44px rgba(255,190,11,1))   drop-shadow(0 0 90px rgba(131,56,236,0.8)); }
}

/* Frenzy emoji rain */
#frenzy-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  overflow: hidden;
}
.frenzy-emoji {
  position: absolute;
  top: -70px;
  user-select: none;
  pointer-events: none;
  animation: frenzy-drop linear forwards;
  will-change: transform;
}
@keyframes frenzy-drop {
  0%   { transform: translateY(0)     rotate(0deg)       scale(1);   opacity: 0;    }
  6%   { opacity: 0.88; }
  88%  { opacity: 0.88; }
  100% { transform: translateY(115vh) rotate(var(--frot)) scale(0.7); opacity: 0;    }
}

/* ── Frenzy display ── */
#frenzy-display {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
  border-radius: 999px;
  padding: 0.32rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 18px rgba(251,191,36,0.45);
  animation: frenzy-pulse 0.6s ease infinite alternate;
}
@keyframes frenzy-pulse {
  0%   { box-shadow: 0 0 10px rgba(251,191,36,0.4); }
  100% { box-shadow: 0 0 28px rgba(251,191,36,0.9), 0 0 60px rgba(251,191,36,0.3); }
}

/* ── Golden Squishy ── */
.golden-squishy {
  position: fixed;
  font-size: 3.2rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  z-index: 600;
  animation: golden-bob 0.75s ease-in-out infinite alternate;
}
@keyframes golden-bob {
  0%   { transform: translateY(0)     rotate(-8deg) scale(1);    filter: drop-shadow(0 0 8px  rgba(255,215,0,0.6)); }
  100% { transform: translateY(-14px) rotate(8deg)  scale(1.14); filter: drop-shadow(0 0 22px rgba(255,215,0,1));   }
}

.golden-msg {
  position: fixed;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
  border-radius: 999px;
  padding: 0.65rem 2rem;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 28px rgba(251,191,36,0.55);
  z-index: 700;
  pointer-events: none;
  white-space: nowrap;
  animation: golden-msg-anim 3s ease forwards;
}
@keyframes golden-msg-anim {
  0%   { opacity: 0; transform: translateX(-50%) translateY(20px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0);    }
  75%  { opacity: 1; transform: translateX(-50%) translateY(-8px);  }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px); }
}

/* ── Tooltip ── */
.game-tooltip {
  position: fixed;
  background: rgba(15, 5, 42, 0.94);
  backdrop-filter: blur(12px);
  color: #f0e8ff;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-size: 0.78rem;
  max-width: 230px;
  pointer-events: none;
  z-index: 900;
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  line-height: 1.55;
  border: 1px solid rgba(160,100,220,0.3);
}
.tt-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f0abfc;
  margin-bottom: 0.35rem;
}
.tt-sep  { border-top: 1px solid rgba(255,255,255,0.1); margin: 0.3rem 0; }
.tt-row  { display: flex; justify-content: space-between; gap: 0.7rem; }
.tt-row strong { color: #d8b4fe; white-space: nowrap; }
.tt-mult { color: #f0abfc; font-size: 0.72rem; }

/* ── Prestige chips badge ── */
#prestige-chips-display {
  font-size: 0.78rem;
  font-weight: 800;
  color: #92400e;
  background: linear-gradient(135deg, #fef9c3, #fde68a);
  border-radius: 999px;
  padding: 0.22rem 0.85rem;
  border: 1.5px solid #fcd34d;
  box-shadow: 0 2px 10px rgba(252,211,77,0.4);
}

/* ── Prestige button ── */
#prestige-area { display: flex; flex-direction: column; align-items: center; }
#prestige-btn {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 2rem;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(251,191,36,0.55);
  animation: frenzy-pulse 0.9s ease infinite alternate;
  transition: transform 0.1s;
  position: relative;
  overflow: hidden;
}
#prestige-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 55%);
  pointer-events: none;
}
#prestige-btn:hover { transform: translateY(-2px); }

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 30, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}
.modal-box {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border-radius: 22px;
  padding: 1.6rem;
  max-width: 420px;
  width: 90vw;
  box-shadow: 0 12px 50px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.6) inset;
  border: 1.5px solid rgba(219,39,119,0.15);
  max-height: 88vh;
  overflow-y: auto;
}
.modal-box h3 {
  font-size: 1.22rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.modal-box h4 {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0.85rem 0 0.4rem;
}
.modal-box p { font-size: 0.88rem; color: var(--text-med); line-height: 1.55; }
.modal-box button {
  background: var(--btn-primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.5rem 1.4rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(219,39,119,0.35);
  transition: transform 0.1s, box-shadow 0.1s;
}
.modal-box button:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(219,39,119,0.45); }
.modal-big-num {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin: 0.75rem 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.28rem 1.2rem;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}
.stats-grid span:nth-child(odd)  { color: var(--text-med); font-weight: 600; }
.stats-grid span:nth-child(even) { color: var(--text-dark); font-weight: 800; text-align: right; white-space: nowrap; }
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}
.stats-table td {
  padding: 0.2rem 0.25rem;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text-dark);
}
.stats-table td:last-child { text-align: right; font-weight: 800; color: var(--purple); }

/* ── iOS safe area + touch ── */
body {
  padding-top: env(safe-area-inset-top);
}
button, [role="button"], .upgrade-tile, .building-card, #squishy {
  touch-action: manipulation;
}

/* ── Mobile: drawer layout ── */
.mobile-panel-btn { display: none; }

@media (max-width: 780px) {
  body { overflow: hidden; height: 100svh; }
  #game { position: relative; overflow: hidden; }

  aside {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    bottom: 0;
    width: 88vw;
    max-width: 340px;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }
  #upgrades-panel {
    left: 0;
    border-right: none;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.28);
    transform: translateX(-100%);
  }
  #buildings-panel {
    right: 0;
    border-left: none;
    box-shadow: -6px 0 28px rgba(0, 0, 0, 0.28);
    transform: translateX(100%);
  }
  #upgrades-panel.drawer-open  { transform: translateX(0); }
  #buildings-panel.drawer-open { transform: translateX(0); }

  #panel-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    z-index: 199;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  #panel-backdrop.visible { display: block; }

  .mobile-panel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding: 0.24rem 0.6rem;
  }

  #squishy { width: 175px; height: 175px; }
  #sp-count { font-size: 2.1rem; }
  #center-panel { padding: 0.5rem; }

  #bottom-bar {
    height: auto;
    flex-wrap: wrap;
    padding: 0.4rem 0.5rem;
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
    gap: 0.35rem;
  }

  /* Lifetime + music share one line; music pushed right */
  #lifetime-area { font-size: 0.72rem; flex-shrink: 0; }
  #music-control { margin-left: auto; flex-shrink: 0; }
  #music-volume-slider { width: 54px; }

  /* Save-area: full width, buttons wrap into 2 tidy rows */
  #save-area {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    order: 5;
  }
  #save-area button {
    font-size: 0.72rem;
    padding: 0.32rem 0.6rem;
    min-height: 36px;
  }
  /* Drawer toggle buttons: bigger tap target on mobile */
  .mobile-panel-btn {
    min-width: 36px;
    min-height: 36px;
    padding: 0.32rem 0.6rem;
  }

  #ticker-area { width: 100%; order: 10; }

  /* Spin wheel: shrink to fit phone screens */
  #wheel-container { width: 100%; }
  .wheel-modal-box { padding: 1rem 0.75rem !important; }
  #wheel-pointer-arrow svg { width: 24px; height: 28px; }

  /* Buy buttons: larger tap targets */
  .buy-btn {
    padding: 0.45rem 0.7rem;
    min-height: 44px;
  }
}

/* ── Falling diamonds ── */
.falling-diamond {
  position: fixed;
  top: -60px;
  font-size: 2rem;
  cursor: pointer;
  z-index: 600;
  user-select: none;
  filter: drop-shadow(0 0 10px rgba(99,202,255,0.85));
  animation: diamond-fall linear forwards;
  transition: transform 0.1s;
}
.falling-diamond:hover {
  transform: scale(1.35);
  filter: drop-shadow(0 0 22px rgba(99,202,255,1));
}
@keyframes diamond-fall {
  0%   { transform: translateY(0)      rotate(0deg);   opacity: 0; }
  6%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(105vh)  rotate(360deg); opacity: 0; }
}

/* ── Diamond collect pop ── */
.diamond-collect-msg {
  position: fixed;
  transform: translateX(-50%);
  font-size: 1rem;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56,189,248,0.8);
  pointer-events: none;
  z-index: 700;
  animation: diamond-pop 1.4s ease forwards;
  white-space: nowrap;
}
@keyframes diamond-pop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(-8px); }
  75%  { opacity: 1; transform: translateX(-50%) translateY(-28px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-50px); }
}

/* ── Diamond area (center panel) ── */
#diamond-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.3rem 0;
  padding: 0.38rem 1rem;
  background: linear-gradient(135deg, rgba(56,189,248,0.12), rgba(99,102,241,0.08));
  border: 1.5px solid rgba(56,189,248,0.3);
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(56,189,248,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);
}
#diamond-count {
  font-size: 0.9rem;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56,189,248,0.45);
}
#diamond-spin-btn {
  font-size: 0.8rem;
  padding: 0.3rem 0.9rem;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  border-radius: 999px;
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(124,58,237,0.4);
  transition: filter 0.15s, transform 0.1s, box-shadow 0.1s;
}
#diamond-spin-btn:hover:not(:disabled) { filter: brightness(1.15); transform: scale(1.05); box-shadow: 0 4px 18px rgba(124,58,237,0.55); }
#diamond-spin-btn:disabled { opacity: 0.45; cursor: default; }

/* ── Mega click display ── */
#mega-click-display {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251,191,36,0.6);
  padding: 0.25rem 0.85rem;
  background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(245,158,11,0.08));
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 999px;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 12px rgba(251,191,36,0.15);
  animation: frenzy-pulse 0.8s ease infinite alternate;
}

/* ── Wheel confetti burst ── */
.wheel-confetti {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 2100;
  animation: confetti-burst ease-out forwards;
}
@keyframes confetti-burst {
  0%   { transform: translateY(0)    rotate(0deg)   scale(1);   opacity: 1; }
  100% { transform: translateY(-90px) rotate(540deg) scale(0.4); opacity: 0; }
}

/* ── Wheel modal ── */
.wheel-modal-box { max-width: 430px !important; }
#wheel-container {
  position: relative;
  width: 390px;
  max-width: 100%;
  margin: 0 auto 0.6rem;
}
#wheel-pointer-arrow {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  filter: drop-shadow(0 3px 8px rgba(124,58,237,0.6));
  line-height: 1;
}
#wheel-spinner {
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 8px 40px rgba(124,58,237,0.45),
    0 0 0 6px rgba(124,58,237,0.15),
    0 0 60px rgba(168,85,247,0.2);
  will-change: transform;
}
#wheel-prize-display {
  min-height: 2rem;
  font-size: 1.2rem;
  font-weight: 900;
  text-align: center;
  margin: 0.7rem 0 0.3rem;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 8px rgba(0,0,0,0.15);
}

/* ── Collection gallery ── */
.collection-modal-box { max-width: 640px !important; }

.coll-progress-wrap { margin-bottom: 1rem; }
.coll-progress-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-med);
  margin-bottom: 0.35rem;
}
.coll-progress-track {
  height: 8px;
  background: rgba(160,100,220,0.15);
  border-radius: 999px;
  overflow: hidden;
}
.coll-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  border-radius: 999px;
  transition: width 0.5s ease;
}

.coll-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.coll-gallery-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.92), rgba(248,240,255,0.8));
  border-radius: 14px;
  padding: 0.75rem 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1.5px solid rgba(255,255,255,0.7);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 140px;
}
.coll-gallery-card.unlocked:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.coll-gallery-card.locked {
  background: linear-gradient(160deg, rgba(200,190,215,0.35), rgba(180,170,200,0.25));
  border-color: rgba(160,140,190,0.25);
}

.coll-gallery-emoji {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 0.3rem;
  transition: transform 0.2s;
}
.coll-gallery-card.unlocked:hover .coll-gallery-emoji { transform: scale(1.25) rotate(-6deg); }
.coll-gallery-card.locked .coll-gallery-emoji { filter: grayscale(1) opacity(0.35); }

.coll-gallery-rarity {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  margin-bottom: 0.22rem;
}
.rarity-starter  { background: rgba(156,163,175,0.2); color: #6b7280; }
.rarity-common   { background: rgba(52,211,153,0.18); color: #059669; }
.rarity-uncommon { background: rgba(96,165,250,0.2);  color: #2563eb; }
.rarity-rare     { background: rgba(167,139,250,0.2); color: #7c3aed; }
.rarity-epic     { background: rgba(251,146,60,0.2);  color: #ea580c; }
.rarity-legendary {
  background: linear-gradient(90deg, rgba(252,211,77,0.35), rgba(251,146,60,0.3));
  color: #b45309;
  animation: rarity-shimmer 2.2s ease infinite;
}
@keyframes rarity-shimmer {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1; filter: brightness(1.25); }
}

.coll-gallery-name {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 0.14rem;
}
.coll-gallery-card.locked .coll-gallery-name { color: var(--text-light); }

.coll-gallery-flavor {
  font-size: 0.62rem;
  color: var(--text-light);
  font-style: italic;
  line-height: 1.35;
  flex: 1;
  margin-bottom: 0.18rem;
}

.coll-gallery-date {
  font-size: 0.6rem;
  font-weight: 700;
  margin-top: auto;
  color: var(--text-light);
}
.coll-gallery-card.unlocked .coll-gallery-date { color: var(--pink); }

@media (max-width: 780px) {
  .coll-gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .collection-modal-box { max-width: 98vw !important; }
}

/* ── Mobile Tab Navigation ───────────────────────────────────────────────────── */
#tab-bar { display: none; }

@media (max-width: 780px) {
  #tab-bar {
    display: flex;
    flex-shrink: 0;
    background: rgba(12, 4, 36, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(160, 100, 220, 0.3);
  }

  .tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    padding: 0.6rem 0.25rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
  }
  .tab-btn.active  { color: #f472b6; }
  .tab-btn:active  { opacity: 0.65; }

  /* Pink bar at top of active tab */
  .tab-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2.5px;
    background: linear-gradient(90deg, #db2777, #ec4899);
    border-radius: 0 0 3px 3px;
  }

  .tab-icon  { font-size: 1.45rem; line-height: 1; }
  .tab-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  /* Red dot badge */
  .tab-badge {
    display: none;
    position: absolute;
    top: 0.3rem;
    right: calc(50% - 1rem);
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 1.5px solid rgba(12, 4, 36, 0.97);
  }
  .tab-badge.has-badge { display: block; }

  /* ── Override drawer system with full-panel tab system ── */

  /* Aside panels: sit absolutely inside #game, hidden until their tab is active */
  aside {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    z-index: 50;
    transition: opacity 0.18s ease, visibility 0.18s ease !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
    padding: 1rem;
  }
  aside.tab-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Hide old drawer triggers */
  .mobile-panel-btn { display: none !important; }
  #panel-backdrop   { display: none !important; }
}

/* ── Building Themes ─────────────────────────────────────────────────────────── */
body.btheme-squeeze    { background: #fffde7 !important; animation: none !important; }
body.btheme-buddy      { background: #d4b896 !important; animation: none !important; }
body.btheme-factory    { background: #ffd8b5 !important; animation: none !important; }
body.btheme-mine       { background: #e8e8e8 !important; animation: none !important; }
body.btheme-lab        { background: #f8f8f8 !important; animation: none !important; }
body.btheme-temple     { background: #f2ebe0 !important; animation: none !important; }
body.btheme-wizard     { background: #c5d5e8 !important; animation: none !important; }
body.btheme-portal     { background: #c8e9ff !important; animation: none !important; }
body.btheme-satellite  { background: #c8edcc !important; animation: none !important; }
body.btheme-volcano    { background: #ffd0d0 !important; animation: none !important; }
body.btheme-quantum    { background: #e8d5f5 !important; animation: none !important; }
body.btheme-galaxy     { background: radial-gradient(ellipse at 50% 35%, #1a0533 0%, #0d1b5e 55%, #050510 100%) !important; animation: none !important; }
body.btheme-cosmic     { background: radial-gradient(ellipse at 40% 55%, #06061e 0%, #0d0d30 55%, #000008 100%) !important; animation: none !important; }
body.btheme-multiverse { background: #b3e5fc !important; animation: none !important; }
body.btheme-deity      { background: #fff9f0 !important; animation: none !important; }

/* FX overlay layer — sits above game content but below modals/tooltips */
#building-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 450;
  overflow: hidden;
}

/* Generic falling emojis (wizard rain, alien rain, sparkles, etc.) */
.bfx-drop {
  position: absolute;
  top: -80px;
  user-select: none;
  pointer-events: none;
  animation: bfx-fall linear forwards;
}
@keyframes bfx-fall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(115vh) rotate(var(--brot, 180deg)) scale(0.75); opacity: 0; }
}

/* Volcano */
#volcano-base {
  position: absolute;
  bottom: 0;
  left: 8%;
  font-size: 380px;
  line-height: 1;
  pointer-events: none;
  animation: volcano-rise-fall 10s linear forwards;
  filter: drop-shadow(0 0 24px rgba(255, 60, 0, 0.6));
}
@keyframes volcano-rise-fall {
  /* 0 – 5 s: rise from below the screen */
  0%   { transform: translateY(110%); }
  50%  { transform: translateY(0); }
  /* 5 – 6 s: explosion shudder at peak */
  55%  { transform: translateY(-18px) scale(1.10); }
  60%  { transform: translateY(0)     scale(0.96); }
  /* 6 – 10 s: fall back below the screen */
  100% { transform: translateY(110%); }
}
.volcano-slime {
  position: absolute;
  pointer-events: none;
  animation: slime-burst cubic-bezier(0.18, 0.88, 0.6, 1) forwards;
}
@keyframes slime-burst {
  0%   { transform: translate(0, 0) scale(1.4); opacity: 1; }
  100% { transform: translate(var(--sx, 0px), var(--sy, -200px)) scale(0.2); opacity: 0; }
}
.volcano-smoke {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  animation: smoke-rise ease-out forwards;
}
@keyframes smoke-rise {
  0%   { transform: translate(0, 0)                   scale(0.5); opacity: 0; }
  15%  {                                                            opacity: 0.65; }
  100% { transform: translate(var(--sdx, 0px), -68vh) scale(3.5); opacity: 0; }
}

/* Galaxy — milky way band sweeping across */
.milkyway-band {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 90px;
  pointer-events: none;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(200, 160, 255, 0.06) 15%,
    rgba(255, 255, 255, 0.20) 35%,
    rgba(220, 180, 255, 0.30) 50%,
    rgba(255, 255, 255, 0.20) 65%,
    rgba(200, 160, 255, 0.06) 85%,
    transparent 100%);
  animation: milkyway-sweep linear forwards;
}
@keyframes milkyway-sweep {
  0%   { transform: rotate(-18deg) translateX(-120%); opacity: 0; }
  8%   { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: rotate(-18deg) translateX(220%);  opacity: 0; }
}

/* Galaxy — drifting emoji stars */
.galaxy-driftstar {
  position: absolute;
  color: white;
  opacity: 0;
  pointer-events: none;
  animation: galaxy-drift linear forwards;
}
@keyframes galaxy-drift {
  0%   { transform: translateX(-80px); opacity: 0; }
  12%  { opacity: 0.9; }
  88%  { opacity: 0.9; }
  100% { transform: translateX(calc(100vw + 120px)); opacity: 0; }
}

/* Cosmic — shooting star */
.shooting-star {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 0 10px rgba(255, 255, 180, 0.9));
  animation: shoot-across linear forwards;
}
@keyframes shoot-across {
  0%   { transform: translate(0, 0) rotate(-28deg); opacity: 0; }
  5%   { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translate(120vw, 55vh) rotate(-28deg); opacity: 0; }
}

/* Multiverse — rainbow arch */
.rainbow-arch {
  position: absolute;
  top: 8vh;
  left: 50%;
  width: 160vw;
  height: 160vw;
  border-radius: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow:
    inset 0 0 0  42px rgba(255,   0,   0, 0.72),
    inset 0 0 0  86px rgba(255, 127,   0, 0.68),
    inset 0 0 0 130px rgba(255, 230,   0, 0.68),
    inset 0 0 0 174px rgba(  0, 200,   0, 0.62),
    inset 0 0 0 218px rgba(  0, 120, 255, 0.62),
    inset 0 0 0 262px rgba(140,   0, 255, 0.58);
  animation: rainbow-rise 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes rainbow-rise {
  0%   { opacity: 0; transform: translateX(-50%) scaleY(0.04); }
  55%  { opacity: 1; transform: translateX(-50%) scaleY(1); }
  100% { opacity: 0.88; }
}

/* Deity — squishy grows via CSS, JS removes it at 8s then triggers explosion */
body.btheme-deity #squishy-wrap {
  transform-origin: center bottom;
  animation: deity-grow 8s ease-in forwards;
}
@keyframes deity-grow {
  0%   { transform: scale(1); }
  100% { transform: scale(4.5); }
}
.deity-spark {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 0 5px white);
  animation: deity-explode ease-out forwards;
}
@keyframes deity-explode {
  0%   { transform: translate(0, 0) scale(2.2); opacity: 1; }
  100% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(0.1); opacity: 0; }
}
