/* ============ WhiteCat Idle — design tokens ============ */
:root {
  /* Pastel palette: muted dusty rose / mauve / sage */
  --bg: #f7f1ee;
  --bg-2: #efe5e1;
  --surface: #fdfaf8;
  --surface-2: #f5ecea;
  --ink: #4a4147;
  --ink-soft: #8a7e85;
  --ink-mute: #b3a8af;
  --line: #e3d3d0;
  --line-soft: #ede1de;

  --pink: #d9a7b3;        /* dusty rose */
  --pink-deep: #a87584;   /* deeper mauve */
  --pink-soft: #e6c2cb;
  --pink-bg: #f1dfe2;
  --lav: #b9a8c4;         /* muted lavender */
  --lav-soft: #d4c6dc;
  --lav-bg: #e6dde9;
  --mint: #a8c4b3;        /* sage */
  --butter: #e8d8a8;      /* muted butter */
  --sky: #b8c8d6;         /* dusty sky */
}

[data-theme="dark"] {
  /* Dusky pastel night */
  --bg: #1f1a1f;
  --bg-2: #292229;
  --surface: #2a232b;
  --surface-2: #322a32;
  --ink: #ede2e8;
  --ink-soft: #b8a8b3;
  --ink-mute: #7e7079;
  --line: #3d3340;
  --line-soft: #352d38;

  --pink: #c08c9a;
  --pink-deep: #d9a7b3;
  --pink-soft: #6a4a55;
  --pink-bg: #3a2a30;
  --lav: #a892b8;
  --lav-soft: #5a4a68;
  --lav-bg: #322840;
  --mint: #88a896;
  --butter: #b8a878;
  --sky: #9aabbf;

  --shadow-sm: 0 1px 2px rgba(120, 100, 110, 0.06), 0 2px 6px rgba(120, 100, 110, 0.05);
  --shadow-md: 0 2px 6px rgba(120, 100, 110, 0.08), 0 8px 22px rgba(120, 100, 110, 0.08);
  --shadow-lg: 0 4px 10px rgba(120, 100, 110, 0.10), 0 18px 40px rgba(120, 100, 110, 0.12);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --font-display: "Fredoka", "Quicksand", system-ui, sans-serif;
  --font-body: "Quicksand", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* ===== Accessible focus ===== */
:focus-visible {
  outline: 2px solid var(--pink-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

/* sr-only: visually hidden but readable by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button { font-family: inherit; color: inherit; }

/* ===== App shell ===== */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--pink-bg) 0%, transparent 50%),
    radial-gradient(900px 500px at 110% 110%, var(--lav-bg) 0%, transparent 55%),
    var(--bg);
}

/* ===== Sidebar ===== */
.sidebar {
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--pink-soft), var(--lav-soft));
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.2px;
  line-height: 1;
}
.brand-sub {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: 3px;
}

/* Auth block */
.auth-block { margin-bottom: 14px; }
.auth-login {
  display: block;
  text-align: center;
  padding: 10px 12px;
  background: linear-gradient(135deg, #ff66aa, #ff4488);
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.auth-login:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 68, 136, 0.4); }
.auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--card-bg, rgba(255,255,255,0.05));
  border-radius: 10px;
}
.auth-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.auth-info { flex: 1; min-width: 0; }
.auth-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-logout {
  background: none;
  border: none;
  color: var(--ink-mute);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
}
.auth-logout:hover { color: var(--ink); }

/* Resource cards */
.resources { display: flex; flex-direction: column; gap: 10px; }
.res-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.res-icon {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.res-icon.pp { background: var(--pink-bg); color: var(--pink-deep); }
.res-icon.fish { background: var(--lav-bg); color: #8765a8; }
.res-icon.cb { background: #fff4d6; color: #c79b22; }
.res-label {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.res-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.res-rate {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* Nav */
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.nav-item:hover { background: var(--bg-2); color: var(--ink); }
.nav-item.active {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.nav-item .nav-ico {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--pink-deep);
}
.nav-item.active .nav-ico { color: var(--pink-deep); }

.nav-badge {
  margin-left: auto;
  background: var(--pink);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  letter-spacing: 0.4px;
}

.sidebar-footer { margin-top: auto; }
.nap-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--lav-soft);
  background: linear-gradient(180deg, #f7eefb, #efe1f6);
  color: #6b4a82;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: var(--shadow-sm);
}
.nap-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.nap-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.nap-hint {
  text-align: center;
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 8px;
}

/* ===== Main ===== */
.main {
  padding: 28px 36px 40px;
  overflow-y: auto;
  max-height: 100vh;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  line-height: 1;
}
.page-sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 6px;
}

/* ===== Play screen ===== */
.play-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.cat-stage {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  padding: 28px;
  position: relative;
  overflow: hidden;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.stage-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 20%, var(--pink-bg) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, var(--lav-bg) 0%, transparent 45%),
    var(--surface-2);
  pointer-events: none;
}

.stage-floor {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 110px;
  background: linear-gradient(180deg, transparent, var(--pink-bg) 80%);
  pointer-events: none;
}

.cat-wrap {
  position: relative;
  z-index: 2;
  cursor: pointer;
  transition: transform 0.08s ease;
}
.cat-wrap:active { transform: scale(0.96); }
.cat-wrap.purring { animation: purr 1.6s ease-in-out infinite; }

@keyframes purr {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.01); }
}

.cat-floater {
  position: absolute;
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--pink-deep);
  animation: floatUp 1.1s ease-out forwards;
  z-index: 3;
}
@keyframes floatUp {
  0% { transform: translate(-50%, 0) scale(0.7); opacity: 0; }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); }
  100% { transform: translate(-50%, -90px) scale(1); opacity: 0; }
}

.cat-heart {
  position: absolute;
  pointer-events: none;
  animation: heartUp 1.4s ease-out forwards;
  z-index: 3;
}
@keyframes heartUp {
  0% { transform: translate(-50%, 0) scale(0.5) rotate(-10deg); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translate(-50%, -100px) scale(1.1) rotate(10deg); opacity: 0; }
}

.stage-info {
  position: absolute;
  top: 22px; left: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}
.cat-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}
.cat-mood {
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.mood-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }

.stage-level {
  position: absolute;
  top: 22px; right: 22px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.level-pill {
  background: var(--pink);
  color: white;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  display: flex; align-items: center; gap: 6px;
}
.xp-bar {
  width: 180px;
  height: 8px;
  background: var(--pink-bg);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--pink-deep));
  border-radius: var(--r-pill);
  transition: width 0.3s ease;
}
.xp-text {
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.stage-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--line-soft);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--ink-soft);
  backdrop-filter: blur(4px);
}

/* Side panel on Play */
.side-panel { display: flex; flex-direction: column; gap: 18px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.panel-sub { font-size: 11px; color: var(--ink-mute); }

/* Helpers list (Play side panel) */
.helpers { display: flex; flex-direction: column; gap: 10px; }
.helper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.helper:hover:not(.locked) { background: var(--pink-bg); border-color: var(--pink-soft); }
.helper.locked { opacity: 0.5; cursor: not-allowed; }
.helper-ico {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--pink-bg);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.helper-mid { flex: 1; min-width: 0; }
.helper-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.helper-meta { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.helper-cost {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  color: var(--pink-deep);
  white-space: nowrap;
}
.helper-cost.cant { color: var(--ink-mute); }
.helper-count {
  background: var(--lav-bg);
  color: #6b4a82;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

/* Quests */
.quest {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.quest:last-child { border-bottom: none; padding-bottom: 0; }
.quest:first-child { padding-top: 0; }
.quest-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quest-name { font-size: 13px; font-weight: 600; }
.quest-reward { font-size: 11px; color: var(--pink-deep); font-weight: 600; }
.quest-prog {
  height: 6px;
  background: var(--bg-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.quest-prog-fill {
  height: 100%;
  background: var(--mint);
  border-radius: var(--r-pill);
}
.quest.done .quest-prog-fill { background: var(--lav); }
.quest-meta { font-size: 11px; color: var(--ink-mute); }

/* ===== Skill tree ===== */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skill-branch {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.branch-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.branch-ico {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
}
.branch-ico.rhythm { background: var(--pink-bg); color: var(--pink-deep); }
.branch-ico.cute { background: var(--lav-bg); color: #8765a8; }
.branch-ico.luck { background: #fff4d6; color: #c79b22; }
.branch-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.branch-desc { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

.skill-node {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}
.skill-node:hover { background: var(--surface-2); border-color: var(--line-soft); }
.skill-node.locked { opacity: 0.45; cursor: not-allowed; }
.skill-node.maxed { background: var(--bg-2); }
.skill-node.affordable { background: var(--pink-bg); border-color: var(--pink-soft); }

.skill-icon {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  display: grid; place-items: center;
}
.skill-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.skill-desc { font-size: 11px; color: var(--ink-soft); margin-top: 2px; line-height: 1.35; }
.skill-pips { display: flex; gap: 3px; margin-top: 6px; }
.skill-pip {
  width: 14px; height: 4px;
  border-radius: 2px;
  background: var(--line);
}
.skill-pip.on { background: var(--pink-deep); }
.skill-cost {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  color: var(--pink-deep);
  text-align: right;
}
.skill-cost.maxed { color: var(--lav); }
.skill-cost.locked { color: var(--ink-mute); }

.skill-points-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(120deg, var(--pink-bg), var(--lav-bg));
  border: 1px solid var(--pink-soft);
  border-radius: var(--r-lg);
  margin-bottom: 22px;
}
.sp-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--pink-deep);
  line-height: 1;
}
.sp-meta { flex: 1; }
.sp-meta-title { font-weight: 600; font-size: 14px; }
.sp-meta-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ===== Outfits ===== */
.outfit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}
.outfit {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.outfit:hover:not(.locked) { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.outfit.locked { opacity: 0.55; cursor: not-allowed; }
.outfit.equipped { border-color: var(--pink); border-width: 2px; padding: 15px; }
.outfit-thumb {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  background: linear-gradient(160deg, var(--surface-2), var(--bg-2));
  display: grid; place-items: center;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.outfit-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.outfit-bonus { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.outfit-tag {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.tag-equipped { background: var(--pink); color: white; }
.tag-locked { background: var(--bg-2); color: var(--ink-mute); }
.tag-new { background: var(--mint); color: #2e6a55; }

/* ===== Stats ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin-top: 6px;
  line-height: 1;
}
.stat-trend { font-size: 11px; color: var(--mint); margin-top: 6px; }
.stat-trend.dim { color: var(--ink-mute); }

.stat-section {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-top: 18px;
  box-shadow: var(--shadow-sm);
}
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13px;
}
.stat-row:last-child { border-bottom: none; }
.stat-row .lbl { color: var(--ink-soft); }
.stat-row .val { font-family: var(--font-display); font-weight: 600; }

/* ===== Nap modal ===== */
.modal-veil {
  position: fixed; inset: 0;
  background: rgba(20, 14, 18, 0.45);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 480px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-cat { margin: 0 auto 18px; }
.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}
.modal-body { color: var(--ink-soft); font-size: 14px; margin: 10px 0 22px; line-height: 1.5; }
.modal-stat {
  display: flex; justify-content: center; gap: 24px;
  padding: 16px;
  background: var(--bg-2);
  border-radius: var(--r-md);
  margin-bottom: 22px;
}
.modal-stat-item .lbl { font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 1px; }
.modal-stat-item .val { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--pink-deep); margin-top: 4px; }
.modal-actions { display: flex; gap: 10px; }
.btn {
  flex: 1;
  padding: 12px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.btn:hover { background: var(--bg-2); }
.btn.primary {
  background: linear-gradient(180deg, var(--pink), var(--pink-deep));
  color: white;
  border-color: var(--pink-deep);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ===== Toast ===== */
.toast-stack {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
}
.toast {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease;
  max-width: 280px;
}
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast .toast-ico {
  width: 28px; height: 28px;
  border-radius: 9px;
  background: var(--pink-bg);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.toast-title { font-weight: 600; font-size: 13px; }
.toast-sub { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }

/* Sparkles in stage bg */
.sparkle {
  position: absolute;
  pointer-events: none;
  animation: sparkleFloat 6s ease-in-out infinite;
  opacity: 0.5;
}
@keyframes sparkleFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
  50% { transform: translateY(-12px) rotate(180deg); opacity: 0.8; }
}

/* ===== Perma upgrades ===== */
.perma-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.perma {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.perma.owned { background: var(--bg-2); cursor: default; opacity: 0.85; }
.perma.affordable { background: var(--pink-bg); border-color: var(--pink-soft); }
.perma:hover:not(.owned) { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.perma-ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--lav-bg);
  color: var(--pink-deep);
  display: grid; place-items: center;
}
.perma-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.perma-desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.perma-effect { font-size: 11px; color: var(--pink-deep); font-weight: 600; margin-top: 4px; }
.perma-cost {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--pink-deep);
  white-space: nowrap;
}
.perma-cost.owned { color: var(--mint); }
.perma-cost.cant { color: var(--ink-mute); }

/* ===== Theme toggle ===== */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  margin-top: 4px;
}
.theme-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}
.theme-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ===== Events ===== */
/* shared accent helpers — pulled from existing tokens */
.event-pink   { --ev: var(--pink); --ev-deep: var(--pink-deep); --ev-bg: var(--pink-bg); --ev-soft: var(--pink-soft); }
.event-lav    { --ev: var(--lav); --ev-deep: #8765a8; --ev-bg: var(--lav-bg); --ev-soft: var(--lav-soft); }
.event-mint   { --ev: var(--mint); --ev-deep: #4a8a72; --ev-bg: #dceee4; --ev-soft: #b8d8c6; }
.event-butter { --ev: var(--butter); --ev-deep: #c79b22; --ev-bg: #fff4d6; --ev-soft: #f0dc9a; }
[data-theme="dark"] .event-mint   { --ev-bg: #2a3a32; --ev-soft: #4a6a56; --ev-deep: #a8d8c0; }
[data-theme="dark"] .event-butter { --ev-bg: #3a3220; --ev-soft: #5a5030; --ev-deep: #e8c878; }

.events-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.event-chip {
  flex: 1 1 220px;
  min-width: 220px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--ev-soft, var(--line));
  border-left: 3px solid var(--ev, var(--pink));
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  animation: chipIn 0.3s ease;
}
@keyframes chipIn {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.event-chip-ico {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--ev-bg, var(--pink-bg));
  color: var(--ev-deep, var(--pink-deep));
  display: grid; place-items: center;
}
.event-chip-mid { min-width: 0; }
.event-chip-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.event-chip-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.1;
  color: var(--ink);
}
.event-chip-time {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ev-deep, var(--pink-deep));
}
.event-chip-desc {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 1px;
}
.event-chip-bar {
  margin-top: 6px;
  height: 4px;
  background: var(--bg-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.event-chip-fill {
  height: 100%;
  background: var(--ev, var(--pink));
  border-radius: var(--r-pill);
  transition: width 0.1s linear;
}

/* Click-to-claim popup pinned inside the stage */
.event-popup {
  position: absolute;
  top: 70px;
  right: 22px;
  z-index: 5;
  width: 200px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--ev-soft, var(--pink-soft));
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md), 0 0 0 4px color-mix(in srgb, var(--ev, var(--pink)) 18%, transparent);
  text-align: center;
  cursor: pointer;
  animation: popupIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), popupBob 2.4s ease-in-out 0.4s infinite;
  user-select: none;
}
.event-popup:hover { transform: translateY(-2px); }
.event-popup:active { transform: translateY(0) scale(0.97); }

@keyframes popupIn {
  from { transform: scale(0.7) translateY(-10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes popupBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.event-popup-burst {
  position: absolute;
  inset: -20px;
  border-radius: var(--r-xl);
  background: radial-gradient(circle, color-mix(in srgb, var(--ev, var(--pink)) 30%, transparent) 0%, transparent 65%);
  pointer-events: none;
  animation: burstPulse 2s ease-in-out infinite;
  z-index: -1;
}
@keyframes burstPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.event-popup-close {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--bg-2);
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
}
.event-popup-close:hover { background: var(--line); color: var(--ink); }

.event-popup-ico {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--ev-bg, var(--pink-bg));
  color: var(--ev-deep, var(--pink-deep));
  display: grid; place-items: center;
  margin: 4px auto 8px;
  box-shadow: var(--shadow-sm);
}
.event-popup-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.event-popup-desc {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 3px;
  line-height: 1.35;
}
.event-popup-cta {
  margin: 10px 0 8px;
  padding: 7px 12px;
  background: linear-gradient(180deg, var(--ev, var(--pink)), var(--ev-deep, var(--pink-deep)));
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.2px;
  border-radius: var(--r-pill);
}
.event-popup-bar {
  height: 4px;
  background: var(--bg-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: 6px;
}
.event-popup-fill {
  height: 100%;
  background: var(--ev, var(--pink));
  transition: width 0.1s linear;
}
.event-popup-timer {
  margin-top: 4px;
  font-size: 10px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

/* ===== Debug trigger in sidebar ===== */
.debug-trigger {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  color: var(--ink-mute);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.debug-trigger:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
  background: var(--bg-2);
}

/* ===== Debug panel modal ===== */
.debug-veil {
  position: fixed; inset: 0;
  background: rgba(20, 14, 18, 0.55);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  z-index: 120;
  animation: fadeIn 0.18s ease;
  padding: 24px;
}
.debug-panel {
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.debug-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.debug-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--pink-deep);
}
.debug-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin-top: 4px;
}
.debug-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.debug-close {
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 20px;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid; place-items: center;
  line-height: 1;
  padding: 0;
}
.debug-close:hover { background: var(--bg-2); color: var(--ink); }

.debug-section { margin-top: 18px; }
.debug-section:first-of-type { margin-top: 0; }
.debug-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.debug-pill {
  background: var(--bg-2);
  color: var(--ink-soft);
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-size: 10px;
  letter-spacing: 0.6px;
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.debug-gacha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
.debug-tier-btn {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 2px solid var(--line-soft);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.debug-tier-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  filter: brightness(1.05);
}
.debug-tier-btn:disabled { opacity: .5; cursor: default; }
.debug-tier-btn.active {
  box-shadow: 0 0 0 2px rgba(255,255,255,.3) inset, 0 6px 18px rgba(0,0,0,.18);
}
.debug-tier-stars {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -1px;
}
.debug-tier-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  opacity: .9;
}
.debug-tier-clear {
  border-color: var(--line);
  color: var(--ink-soft);
}
.debug-event-btn {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--ev, var(--pink));
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
  color: var(--ink);
}
.debug-event-btn:hover {
  background: var(--ev-bg, var(--pink-bg));
  border-color: var(--ev-soft, var(--pink-soft));
  border-left-color: var(--ev, var(--pink));
  transform: translateY(-1px);
}
.debug-event-ico {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--ev-bg, var(--pink-bg));
  color: var(--ev-deep, var(--pink-deep));
  display: grid; place-items: center;
}
.debug-event-text { display: flex; flex-direction: column; min-width: 0; }
.debug-event-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.1;
}
.debug-event-desc {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.debug-event-tag {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 7px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ev, var(--pink)) 22%, transparent);
  color: var(--ev-deep, var(--pink-deep));
  white-space: nowrap;
}

.debug-cheats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.debug-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.12s ease;
}
.debug-btn:hover {
  background: var(--pink-bg);
  border-color: var(--pink-soft);
  color: var(--pink-deep);
}
.debug-btn.danger {
  color: #b54a4a;
  border-color: #e8c4c4;
  background: #fbeded;
  margin-left: auto;
}
[data-theme="dark"] .debug-btn.danger {
  color: #ff9a9a;
  border-color: #5a3030;
  background: #3a2222;
}
.debug-btn.danger:hover { background: #f5d8d8; }
[data-theme="dark"] .debug-btn.danger:hover { background: #4a2828; }

.debug-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-soft);
  font-size: 11px;
  color: var(--ink-mute);
  text-align: center;
}

/* small responsive */
@media (max-width: 1100px) {
  .play-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .event-popup { top: auto; right: 22px; bottom: 80px; }
}

/* ============ Stage decorations (one per perma upgrade owned) ============ */
.stage-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.decor {
  position: absolute;
  filter: drop-shadow(0 4px 8px rgba(80, 60, 70, 0.10));
  animation: decorFloatIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes decorFloatIn {
  0%   { opacity: 0; transform: translateY(8px) scale(0.6); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Strong celebratory entrance on first-purchase */
.decor.decor-pop {
  animation: decorPop 1100ms cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 4;
}
@keyframes decorPop {
  0%   { opacity: 0; transform: translateY(-30px) scale(0.2) rotate(-12deg); }
  35%  { opacity: 1; transform: translateY(0) scale(1.25) rotate(6deg); }
  55%  { transform: translateY(0) scale(0.92) rotate(-3deg); }
  75%  { transform: translateY(0) scale(1.06) rotate(1deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
/* shared shimmer ring during pop */
.decor.decor-pop::before {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  border: 2px solid var(--pink-deep);
  opacity: 0;
  animation: decorRing 1100ms ease-out;
}
@keyframes decorRing {
  0%   { transform: scale(0.3); opacity: 0; }
  20%  { opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* —— Pro Tablet (bottom-left, on floor) —— */
.decor-tablet {
  bottom: 18px;
  left: 22px;
  width: 96px;
  height: 64px;
}
.d-tablet-pad {
  position: absolute;
  inset: 8px 0 0 0;
  background: linear-gradient(160deg, #3a3540, #25212a);
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.04);
}
.d-tablet-active {
  position: absolute;
  inset: 6px 18px 6px 6px;
  background: linear-gradient(160deg, var(--lav-soft), var(--pink-soft));
  border-radius: 4px;
  opacity: 0.75;
}
.d-tablet-led {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #a8d4b0;
  box-shadow: 0 0 6px #a8d4b0;
  animation: ledPulse 1.8s ease-in-out infinite;
}
@keyframes ledPulse { 0%,100%{opacity:.6} 50%{opacity:1} }
.d-tablet-pen {
  position: absolute;
  left: 70px;
  top: -2px;
  width: 36px;
  height: 6px;
  background: linear-gradient(90deg, var(--pink-deep) 0%, var(--pink-deep) 70%, #6b5560 70%, #6b5560 100%);
  border-radius: 6px;
  transform: rotate(-22deg);
  transform-origin: left center;
}
.d-tablet-pen::before {
  content: "";
  position: absolute;
  right: -6px; top: 0;
  width: 0; height: 0;
  border-left: 6px solid #6b5560;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

/* —— Custom Skin (top-right, sticky-note style) —— */
.decor-skin {
  top: 78px;
  right: 28px;
  width: 78px;
  height: 32px;
  background: var(--butter);
  border-radius: 4px;
  transform: rotate(6deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(180, 140, 50, 0.18);
}
.d-skin-tape {
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  width: 32px; height: 10px;
  background: rgba(255,255,255,0.55);
  border-radius: 2px;
}
.d-skin-name {
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 12px;
  font-weight: 600;
  color: #8a6a14;
  letter-spacing: 0.5px;
}

/* —— Studio Headphones (top-left, hanging from a hook) —— */
.decor-headphones {
  top: 62px;
  left: 28px;
  width: 56px;
  height: 56px;
}
.d-hp-hook {
  position: absolute;
  top: 0; left: 50%;
  width: 8px; height: 8px;
  background: var(--ink-soft);
  border-radius: 50%;
  transform: translateX(-50%);
}
.d-hp-cord {
  position: absolute;
  top: 6px; left: 50%;
  width: 2px; height: 14px;
  background: var(--ink-soft);
  transform: translateX(-50%);
}
.d-hp-band {
  position: absolute;
  top: 18px; left: 6px;
  width: 44px; height: 22px;
  border: 4px solid #2a232a;
  border-bottom: none;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}
.d-hp-cup {
  position: absolute;
  top: 32px;
  width: 16px;
  height: 20px;
  background: linear-gradient(180deg, #3a323a, #1f1a1f);
  border-radius: 5px;
}
.d-hp-cup-l { left: 4px; }
.d-hp-cup-r { right: 4px; }
.d-hp-cup::after {
  content: "";
  position: absolute;
  inset: 3px 3px 6px;
  background: var(--pink-deep);
  border-radius: 3px;
  opacity: 0.6;
}

/* —— Energy Drink (bottom-right, on floor) —— */
.decor-energy {
  bottom: 22px;
  right: 32px;
  width: 32px;
  height: 56px;
}
.d-can {
  position: absolute;
  inset: 4px 0 0 0;
  background: linear-gradient(160deg, var(--mint) 0%, #88a892 100%);
  border-radius: 5px;
  box-shadow: inset -3px 0 0 rgba(0,0,0,0.10), inset 3px 0 0 rgba(255,255,255,0.18);
}
.d-can-top {
  position: absolute;
  top: 0; left: 2px; right: 2px;
  height: 4px;
  background: #8e9e92;
  border-radius: 3px 3px 0 0;
}
.d-can-stripe {
  position: absolute;
  left: 0; right: 0; top: 38%;
  height: 9px;
  background: var(--surface);
}
.d-can-bolt {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 14px;
  background: var(--pink-deep);
  clip-path: polygon(55% 0, 0 60%, 45% 60%, 25% 100%, 100% 35%, 55% 35%);
}

/* —— Cloud Saves (top center, floating) —— */
.decor-cloud {
  top: 50px;
  left: 50%;
  width: 80px;
  height: 38px;
  transform: translateX(-50%);
  animation: decorFloatIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards,
             cloudDrift 6s ease-in-out infinite;
}
@keyframes cloudDrift {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-6px); }
}
.d-cloud { position: absolute; inset: 0; }
.d-cloud-puff {
  position: absolute;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 2px 0 var(--line) inset;
}
.d-cloud-puff.p1 { left: 0;   bottom: 0; width: 28px; height: 28px; }
.d-cloud-puff.p2 { left: 18px; bottom: 8px; width: 36px; height: 30px; }
.d-cloud-puff.p3 { right: 0;   bottom: 0; width: 28px; height: 24px; }
.d-cloud-puff.p4 { left: 32px; bottom: 14px; width: 28px; height: 24px; }

/* —— Supporter Tag (middle-right wall pin) —— */
.decor-supporter {
  top: 200px;
  right: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.d-pin {
  width: 34px; height: 34px;
  background: linear-gradient(160deg, var(--pink-deep), #864e60);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(120, 60, 80, 0.25), inset 0 -2px 4px rgba(0,0,0,0.15), inset 0 2px 3px rgba(255,255,255,0.25);
}
.d-pin-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--pink-deep);
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

/* —— Legendary Tablet (behind cat, big golden glow) —— */
.decor-legendary {
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  z-index: 1; /* sits behind cat (z 2) */
  filter: drop-shadow(0 0 18px rgba(232, 191, 90, 0.55));
}
.d-legend-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(232, 191, 90, 0.65) 0%, rgba(232, 191, 90, 0) 65%);
  animation: legendGlow 2.8s ease-in-out infinite;
}
@keyframes legendGlow {
  0%, 100% { transform: scale(1);   opacity: 0.85; }
  50%      { transform: scale(1.18); opacity: 1; }
}
.d-legend-ring {
  position: absolute;
  inset: 20px;
  border: 2px dashed rgba(232, 191, 90, 0.6);
  border-radius: 50%;
  animation: legendSpin 14s linear infinite;
}
@keyframes legendSpin { to { transform: rotate(360deg); } }
.d-legend-trophy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c79b22;
  text-shadow: 0 0 12px rgba(199, 155, 34, 0.5);
}
.d-legend-spark {
  position: absolute;
  color: #e8c44a;
  animation: legendSpark 2s ease-in-out infinite;
}
.d-legend-spark.s1 { top: 8px;  left: 22px;  animation-delay: 0s; }
.d-legend-spark.s2 { top: 30px; right: 14px; animation-delay: 0.6s; }
.d-legend-spark.s3 { bottom: 18px; left: 38px; animation-delay: 1.2s; }
@keyframes legendSpark {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

/* —— First-purchase "New on stage" banner —— */
.decor-unlock-banner {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: var(--shadow-md);
  animation: bannerIn 4200ms ease;
  z-index: 5;
}
.decor-unlock-banner .dub-spark {
  color: var(--pink-deep);
  font-size: 14px;
  animation: bannerSpin 1.2s ease-in-out infinite;
}
.decor-unlock-banner .dub-name {
  color: var(--pink-deep);
  background: var(--pink-bg);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 12px;
}
@keyframes bannerIn {
  0%   { opacity: 0; transform: translate(-50%, -16px); }
  10%  { opacity: 1; transform: translate(-50%, 0); }
  85%  { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}
@keyframes bannerSpin {
  0%, 100% { transform: scale(1) rotate(0); }
  50%      { transform: scale(1.3) rotate(180deg); }
}

/* ===== Beatmap Collection tab ===== */
.collection-tab { padding: 18px 22px 40px; }
.collection-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.collection-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--pink-deep);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 4px;
}
.collection-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}
.collection-stats { display: flex; gap: 16px; }
.cs-cell {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 8px 14px;
  text-align: center;
  min-width: 70px;
}
.cs-val { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.cs-lbl {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-mute);
  margin-top: 2px;
}

.collection-filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 18px;
  align-items: center;
}
.coll-filter {
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease;
}
.coll-filter:hover { transform: translateY(-1px); filter: brightness(1.05); }
.coll-filter.active { color: #fff; }
.coll-sort {
  margin-left: auto;
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 2px;
}
.coll-sort-btn {
  padding: 4px 12px;
  background: transparent;
  border: none;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.coll-sort-btn.active {
  background: var(--pink-deep);
  color: #fff;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.coll-card {
  position: relative;
  background: var(--surface-2);
  border: 2px solid var(--pink);
  border-radius: var(--r-lg);
  padding: 14px 14px 12px;
  overflow: hidden;
  transition: transform .15s cubic-bezier(.34,1.4,.64,1), box-shadow .2s ease;
  cursor: default;
}
.coll-card:hover {
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 12px 28px var(--tier-glow), 0 0 0 1px var(--tier-color) inset;
}
.coll-card-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--tier-color) 16%, transparent),
    transparent 60%);
  pointer-events: none;
}
.coll-card-legendary {
  position: absolute;
  top: 8px; right: 10px;
  color: #ffd24a;
  font-size: 16px;
  text-shadow: 0 0 10px rgba(255, 210, 74, .8);
  z-index: 2;
  animation: collLegendaryGlow 2s ease-in-out infinite;
}
.coll-card.is-legendary {
  border-color: #ffd24a;
  box-shadow: 0 0 18px rgba(255, 138, 0, .25);
}
.coll-card-tier {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}
.coll-card-stars { font-size: 18px; letter-spacing: -1px; }
.coll-card-tname {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.coll-card-artist {
  position: relative;
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.coll-card-title {
  position: relative;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  margin: 2px 0;
}
.coll-card-title a { color: inherit; text-decoration: none; }
.coll-card-title a:hover { color: var(--tier-color); }
.coll-card-mapper {
  position: relative;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.coll-card-meta {
  position: relative;
  display: flex; gap: 6px; align-items: center;
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.coll-card-mod {
  background: var(--pink-bg);
  color: var(--pink-deep);
  padding: 1px 6px;
  border-radius: var(--r-pill);
  font-weight: 700;
  letter-spacing: .04em;
}
.coll-card-date {
  position: relative;
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.collection-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 80px 20px;
  text-align: center;
  color: var(--ink-soft);
}
.collection-empty-ico { color: var(--pink); opacity: .5; margin-bottom: 8px; }
.collection-empty-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.collection-empty-sub { font-size: 13px; }

@keyframes collLegendaryGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(255, 210, 74, .6); transform: scale(1); }
  50%      { text-shadow: 0 0 16px rgba(255, 210, 74, 1); transform: scale(1.15); }
}

/* ===== Daily Gacha ===== */
@property --gacha-ang {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.gacha-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  margin: 10px 0 14px;
  background:
    radial-gradient(circle at 18% 24%, rgba(228,74,131,.18) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 70%, rgba(192,116,255,.16) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 70% 18%, rgba(255,210,74,.22) 0 1px, transparent 2px),
    linear-gradient(135deg, var(--pink-bg), var(--lav-bg));
  border: 2px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, filter .2s ease;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}
.gacha-card:active { transform: translateY(0) scale(.97) !important; transition: transform .05s ease; }

.gacha-card.ready {
  background:
    radial-gradient(circle at 18% 24%, rgba(228,74,131,.18) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 70%, rgba(192,116,255,.16) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 70% 18%, rgba(255,210,74,.22) 0 1px, transparent 2px),
    linear-gradient(135deg, var(--pink-bg), #fff3f8, var(--lav-bg), var(--pink-bg)) padding-box,
    conic-gradient(from var(--gacha-ang),
      #ff7aa8, #c074ff, #66ccff, #7be4a3, #ffe066, #ffa86b, #ff7aa8) border-box;
  background-size: 100%, 100%, 100%, 280% 280%, 100%;
  box-shadow:
    0 6px 22px rgba(228,74,131,.28),
    0 0 0 1px rgba(255,255,255,.4) inset;
  animation:
    gachaIdle 6.5s ease-in-out infinite,
    gachaCardGradient 7s ease-in-out infinite,
    gachaBorderSpin 4s linear infinite;
}
.gacha-card.ready:hover {
  transform: translateY(-3px) scale(1.025) rotate(-.4deg);
  box-shadow:
    0 16px 38px rgba(228,74,131,.5),
    0 0 0 2px rgba(228,74,131,.25),
    0 0 24px rgba(192,116,255,.4);
  filter: saturate(1.15) brightness(1.04);
}
.gacha-card.ready::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 28%, rgba(255,255,255,.7) 50%, transparent 72%);
  animation: gachaShine 2.2s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: overlay;
}
.gacha-card.ready::after {
  content: "✦";
  position: absolute;
  bottom: 9px; right: 12px;
  color: #fff;
  font-size: 15px;
  opacity: .85;
  animation: gachaSparkleFloat 1.8s ease-in-out infinite;
  pointer-events: none;
  text-shadow:
    0 0 8px rgba(228,74,131,.9),
    0 0 16px rgba(192,116,255,.6);
}
.gacha-card.done {
  opacity: .68; cursor: default;
  border-color: var(--line);
  background: linear-gradient(135deg, var(--pink-bg), var(--lav-bg));
  animation: none;
}
.gacha-card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.gacha-card-eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--pink-deep); }
.gacha-card-streak {
  background: var(--butter); color: #8a6a14;
  padding: 1px 7px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; letter-spacing: 0;
  text-transform: none;
}
.gacha-card-title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  position: relative;
}
.gacha-card.ready .gacha-card-title {
  background: linear-gradient(90deg, #d62674, #c074ff, #66ccff, #ffe066, #d62674);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gachaTitleShimmer 5s linear infinite;
}
[data-theme="dark"] .gacha-card.ready .gacha-card-title {
  background: none;
  -webkit-text-fill-color: #fff;
  color: #fff;
  text-shadow:
    0 0 1px rgba(0,0,0,.8),
    0 1px 3px rgba(0,0,0,.7),
    0 0 12px rgba(228,74,131,.55);
  font-weight: 800;
}
[data-theme="dark"] .gacha-card.ready {
  background:
    radial-gradient(circle at 18% 24%, rgba(255,180,210,.22) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 70%, rgba(200,160,255,.2) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 70% 18%, rgba(255,230,140,.25) 0 1px, transparent 2px),
    linear-gradient(135deg, #3a2535, #2c2440, #4a2c4a, #3a2535) padding-box,
    conic-gradient(from var(--gacha-ang),
      #ff7aa8, #c074ff, #66ccff, #7be4a3, #ffe066, #ffa86b, #ff7aa8) border-box;
  background-size: 100%, 100%, 100%, 280% 280%, 100%;
}
[data-theme="dark"] .gacha-card.ready .gacha-card-sub {
  color: #d8c0d0;
}
[data-theme="dark"] .gacha-card.ready .gacha-card-cta {
  color: #ff9ec0;
}
[data-theme="dark"] .gacha-card.ready .gacha-card-dot {
  background: #ff9ec0;
}
.gacha-card-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.gacha-card-foot { margin-top: 8px; font-size: 11px; }
.gacha-card-cta {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--pink-deep); font-weight: 700; letter-spacing: .12em;
  animation: gachaCtaShift 2.2s ease-in-out infinite;
}
.gacha-card-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pink-deep);
  box-shadow: 0 0 0 0 rgba(228,74,131,.7);
  animation: gachaPulse 1.2s ease-in-out infinite;
}
.gacha-card-timer { color: var(--ink-mute); }

@keyframes gachaShine {
  0% { transform: translateX(-120%); }
  60%, 100% { transform: translateX(120%); }
}
@keyframes gachaPulse {
  0%   { box-shadow: 0 0 0 0 rgba(228,74,131,.75); transform: scale(1); }
  60%  { box-shadow: 0 0 0 10px rgba(228,74,131,0); transform: scale(1.25); }
  100% { box-shadow: 0 0 0 0 rgba(228,74,131,0); transform: scale(1); }
}
@keyframes gachaBreath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.012); }
}
@keyframes gachaIdle {
  0%, 84%, 100% { transform: scale(1) rotate(0deg); }
  46%           { transform: scale(1.018) rotate(0deg); }
  88%           { transform: scale(1.03) rotate(-2deg); }
  91%           { transform: scale(1.03) rotate(2.2deg); }
  94%           { transform: scale(1.03) rotate(-1.4deg); }
  97%           { transform: scale(1.02) rotate(.8deg); }
}
@keyframes gachaBorderSpin {
  to { --gacha-ang: 360deg; }
}
@keyframes gachaTitleShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
@keyframes gachaCardGradient {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes gachaSparkleFloat {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); opacity: .55; }
  50%      { transform: translateY(-3px) rotate(20deg) scale(1.25); opacity: 1; }
}
@keyframes gachaCtaShift {
  0%, 100% { color: var(--pink-deep); text-shadow: none; }
  50%      { color: #e44a83; text-shadow: 0 0 8px rgba(228,74,131,.4); }
}

/* Modal */
.gacha-veil {
  position: fixed; inset: 0;
  background: rgba(20, 14, 22, .55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
  padding: 20px;
}
.gacha-modal {
  --tier-color: var(--pink-deep);
  --tier-glow: var(--pink);
  position: relative;
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px 22px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  text-align: center;
}
.gacha-close {
  position: absolute; top: 10px; right: 12px;
  background: transparent; border: none;
  font-size: 22px; line-height: 1;
  color: var(--ink-soft); cursor: pointer;
}
.gacha-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--pink-deep);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 6px;
}
.gacha-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.gacha-body { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 14px; }

.gacha-odds {
  display: grid; grid-template-columns: 1fr; gap: 4px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-bottom: 14px;
  text-align: left;
}
.gacha-odd-row {
  display: grid; grid-template-columns: 80px 1fr auto;
  align-items: center; gap: 8px;
  font-size: 12px;
}
.gacha-odd-stars { font-weight: 700; letter-spacing: -1px; }
.gacha-odd-name { color: var(--ink); }
.gacha-odd-weight { color: var(--ink-mute); font-variant-numeric: tabular-nums; }

.gacha-streak-banner {
  background: var(--butter); color: #6a4f12;
  padding: 8px 12px; border-radius: var(--r-md);
  font-size: 12px; margin-bottom: 12px;
}

.gacha-pull-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border: none; border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--pink-deep), var(--lav), var(--pink-deep));
  background-size: 200% 100%;
  color: #fff;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(168,117,132,.35);
  transition: transform .12s ease, box-shadow .2s ease;
  overflow: hidden;
  animation: gachaBtnGradient 4s ease-in-out infinite;
}
.gacha-pull-btn::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: gachaShine 2.8s ease-in-out infinite 1s;
  pointer-events: none;
}
.gacha-pull-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(228,74,131,.55);
}
.gacha-pull-btn:active { transform: translateY(0) scale(.98); transition: transform .05s ease; }
.gacha-claim-btn {
  background: linear-gradient(135deg, var(--tier-color), var(--tier-glow), var(--tier-color));
  background-size: 200% 100%;
}
@keyframes gachaBtnGradient {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ===== Spin phase — orb crescendo (anticipation → peak → burst) =====
   Pattern: slow charge builds dopamine, single peak shake locks tier color,
   one bright flash reveals card. No strobing, no constant tier flicker. */
.gacha-orb-stage {
  --final-color: #ff7aa8;
  --final-glow: #d62674;
  --neutral-color: #c8b6d4;
  --neutral-glow: #a875d4;
  position: relative;
  height: 260px;
  display: flex; align-items: center; justify-content: center;
  margin: 14px 0 10px;
  overflow: hidden;
  border-radius: var(--r-md);
}

/* Dimming veil — quiet the surroundings during charge */
.gacha-orb-veil {
  position: absolute; inset: -20px;
  background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(20,14,22,.55) 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .8s ease;
}
.sub-charge .gacha-orb-veil { opacity: .9; transition-duration: 1.4s; }
.sub-peak   .gacha-orb-veil { opacity: 1; }
.sub-burst  .gacha-orb-veil { opacity: 0; transition-duration: .15s; }

/* Core orb — single element, no swap, breathes during charge */
.gacha-orb-core {
  position: absolute;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%,
    #fff 0%,
    color-mix(in srgb, var(--orb-color, var(--neutral-color)) 60%, #fff) 18%,
    var(--orb-color, var(--neutral-color)) 55%,
    color-mix(in srgb, var(--orb-color, var(--neutral-color)) 60%, #000) 100%);
  box-shadow:
    0 0 30px var(--orb-glow, var(--neutral-glow)),
    0 0 0 1px rgba(255,255,255,.4) inset;
  transform: scale(0);
  opacity: 0;
  transition: background 1s ease, box-shadow .8s ease;
}
.sub-charge .gacha-orb-core {
  --orb-color: var(--neutral-color);
  --orb-glow: var(--neutral-glow);
  animation: orbCharge 3s cubic-bezier(.34,1.05,.64,1) forwards;
}
.sub-peak .gacha-orb-core {
  --orb-color: var(--final-color);
  --orb-glow: var(--final-glow);
  transform: scale(1.05);
  opacity: 1;
  animation: orbPeakShake .12s ease-in-out infinite;
  box-shadow:
    0 0 60px var(--final-glow),
    0 0 120px var(--final-glow),
    0 0 0 2px rgba(255,255,255,.5) inset;
}
.sub-burst .gacha-orb-core {
  --orb-color: var(--final-color);
  --orb-glow: var(--final-glow);
  animation: orbBurst .4s cubic-bezier(.55,0,.8,1) forwards;
}

/* Halo — soft glow behind orb, grows with charge */
.gacha-orb-halo {
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--halo-color, var(--neutral-glow)) 0%, transparent 65%);
  opacity: 0;
  transition: background .8s ease;
  filter: blur(8px);
  pointer-events: none;
}
.sub-charge .gacha-orb-halo {
  --halo-color: var(--neutral-glow);
  animation: orbHaloCharge 3s ease-out forwards;
}
.sub-peak .gacha-orb-halo {
  --halo-color: var(--final-glow);
  opacity: .55;
  animation: orbHaloPulse 1.4s ease-in-out infinite;
}
.sub-burst .gacha-orb-halo {
  --halo-color: var(--final-glow);
  animation: orbHaloBurst .4s ease-out forwards;
}

/* Ring — thin concentric circle, slowly tightens during charge */
.gacha-orb-ring {
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 1px solid var(--ring-color, var(--neutral-glow));
  opacity: 0;
  transition: border-color .8s ease;
  pointer-events: none;
}
.sub-charge .gacha-orb-ring {
  --ring-color: var(--neutral-glow);
  animation: orbRingTighten 3s ease-out forwards;
}
.sub-peak .gacha-orb-ring {
  --ring-color: var(--final-color);
  opacity: .7;
  width: 110px; height: 110px;
}
.sub-burst .gacha-orb-ring { opacity: 0; }

/* Inward-converging particles — energy gathering into orb */
.gacha-orb-particles {
  position: absolute; inset: 0;
  pointer-events: none;
}
.gacha-orb-particle {
  position: absolute; top: 50%; left: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--particle-color, var(--neutral-glow));
  margin: -2px 0 0 -2px;
  opacity: 0;
  box-shadow: 0 0 6px currentColor;
  color: var(--particle-color, var(--neutral-glow));
  transition: background .6s ease;
}
.sub-charge .gacha-orb-particle {
  --particle-color: var(--neutral-glow);
  animation: orbParticleConverge 2.7s ease-in forwards;
}
.sub-peak .gacha-orb-particle,
.sub-burst .gacha-orb-particle { opacity: 0; }

.p-0 { --pa: 0deg;   animation-delay: 0s; }
.p-1 { --pa: 45deg;  animation-delay: .2s; }
.p-2 { --pa: 90deg;  animation-delay: .4s; }
.p-3 { --pa: 135deg; animation-delay: .1s; }
.p-4 { --pa: 180deg; animation-delay: .5s; }
.p-5 { --pa: 225deg; animation-delay: .25s; }
.p-6 { --pa: 270deg; animation-delay: .35s; }
.p-7 { --pa: 315deg; animation-delay: .15s; }

/* White flash at burst — one frame, single moment of payoff */
.gacha-orb-flash {
  position: absolute; inset: -40px;
  background: radial-gradient(circle, #fff 0%, color-mix(in srgb, var(--final-color) 70%, #fff) 30%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.sub-burst .gacha-orb-flash {
  animation: orbFlash .4s ease-out forwards;
}

.gacha-spin-hint {
  color: var(--ink-mute); font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  min-height: 18px;
  transition: color .3s ease;
}

/* ===== Keyframes ===== */
@keyframes orbCharge {
  0%   { transform: scale(0);    opacity: 0; }
  20%  { transform: scale(.65);  opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}
@keyframes orbHaloCharge {
  0%   { transform: scale(.4); opacity: 0; }
  100% { transform: scale(1);  opacity: .55; }
}
@keyframes orbHaloPulse {
  0%, 100% { transform: scale(1);    opacity: .5; }
  50%      { transform: scale(1.12); opacity: .75; }
}
@keyframes orbHaloBurst {
  0%   { transform: scale(1);   opacity: .8; }
  100% { transform: scale(2.5); opacity: 0; }
}
@keyframes orbRingTighten {
  0%   { transform: scale(1.4); opacity: 0;   border-width: 2px; }
  60%  { opacity: .6; }
  100% { transform: scale(.7);  opacity: .7;  border-width: 1px; }
}
@keyframes orbPeakShake {
  0%, 100% { transform: scale(1.05) translate(0, 0); }
  25%      { transform: scale(1.06) translate(-1px, 1px); }
  50%      { transform: scale(1.07) translate(1px, -1px); }
  75%      { transform: scale(1.06) translate(-1px, -1px); }
}
@keyframes orbBurst {
  0%   { transform: scale(1.05); opacity: 1;   filter: brightness(1.5); }
  40%  { transform: scale(1.6);  opacity: 1;   filter: brightness(2.5); }
  100% { transform: scale(3.5);  opacity: 0;   filter: brightness(3); }
}
@keyframes orbFlash {
  0%   { opacity: 0;   transform: scale(.5); }
  20%  { opacity: .95; transform: scale(1.1); }
  100% { opacity: 0;   transform: scale(1.5); }
}
@keyframes orbParticleConverge {
  0% {
    transform: rotate(var(--pa)) translateX(140px) rotate(calc(var(--pa) * -1)) scale(1);
    opacity: 0;
  }
  20% { opacity: 1; }
  90% { opacity: 1; }
  100% {
    transform: rotate(var(--pa)) translateX(0) rotate(calc(var(--pa) * -1)) scale(.4);
    opacity: 0;
  }
}

/* Reveal */
.gacha-burst {
  position: absolute; inset: -20px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 38%, var(--tier-glow) 0%, transparent 55%);
  opacity: .35;
  animation: gachaBurst .9s ease-out;
}
.gacha-burst::before {
  content: "";
  position: absolute; inset: -10%;
  background: conic-gradient(from 0deg,
    transparent 0deg, var(--tier-color) 8deg, transparent 22deg,
    transparent 60deg, var(--tier-glow) 68deg, transparent 82deg,
    transparent 120deg, var(--tier-color) 128deg, transparent 142deg,
    transparent 180deg, var(--tier-glow) 188deg, transparent 202deg,
    transparent 240deg, var(--tier-color) 248deg, transparent 262deg,
    transparent 300deg, var(--tier-glow) 308deg, transparent 322deg);
  mask: radial-gradient(circle at 50% 38%, transparent 18%, #000 28%, #000 60%, transparent 75%);
  -webkit-mask: radial-gradient(circle at 50% 38%, transparent 18%, #000 28%, #000 60%, transparent 75%);
  opacity: .55;
  animation: gachaRays 1.6s ease-out, gachaSpin 8s linear infinite;
  filter: blur(2px);
}
@keyframes gachaBurst {
  from { transform: scale(.6); opacity: 0; }
  60%  { opacity: .55; }
  to   { transform: scale(1.0); opacity: .35; }
}
@keyframes gachaRays {
  0%   { transform: scale(.3) rotate(-30deg); opacity: 0; }
  30%  { opacity: .7; }
  100% { transform: scale(1) rotate(0deg); opacity: .55; }
}
.gacha-reveal-card {
  position: relative;
  border: 2px solid var(--tier-color);
  border-radius: var(--r-lg);
  padding: 18px 16px 14px;
  background: var(--surface-2);
  box-shadow: 0 0 30px var(--tier-glow);
  margin: 8px 0 14px;
  overflow: hidden;
}
.gacha-reveal-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tier-color) 18%, transparent), transparent 70%);
  pointer-events: none;
}
.gacha-reveal-tier {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700;
}
.gacha-reveal-stars { font-size: 22px; letter-spacing: -1px; }
.gacha-reveal-tname { font-family: var(--font-display); font-size: 15px; text-transform: uppercase; letter-spacing: .12em; }
.gacha-reveal-artist {
  position: relative;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 8px;
}
.gacha-reveal-title {
  position: relative;
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  margin: 2px 0 2px;
  line-height: 1.15;
}
.gacha-reveal-version {
  position: relative;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}
.gacha-reveal-mapper { position: relative; color: var(--ink-soft); font-size: 12px; margin: 2px 0 12px; }
.gacha-reveal-meta {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 10px;
}
.grm-cell {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 6px 4px;
}
.grm-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-mute); }
.grm-val { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-top: 2px; }
.grm-mod { color: var(--pink-deep); }
.gacha-reveal-flair {
  position: relative;
  font-style: italic; font-size: 12px;
}

.gacha-rewards {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 14px;
}
.gacha-reward {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 8px 12px;
  text-align: left;
}
.gacha-reward-hot {
  border-color: var(--tier-color);
  box-shadow: 0 0 14px var(--tier-glow);
}
.gr-ico { color: var(--pink-deep); display: flex; }
.gacha-reward-hot .gr-ico { color: var(--tier-color); }
.gr-val { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.gr-sub { font-size: 11px; color: var(--ink-soft); }

/* Legendary beatmap accents */
.gacha-reveal-card.is-legendary {
  box-shadow: 0 0 36px var(--tier-glow), 0 0 6px #ffd24a inset;
  animation: legendaryPulse 2.4s ease-in-out infinite;
}
.gacha-legendary-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: linear-gradient(135deg, #ffd24a, #ff8a00);
  color: #2a1a00;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .18em;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  box-shadow: 0 4px 14px rgba(255, 138, 0, .5);
  z-index: 3;
}
@keyframes legendaryPulse {
  0%, 100% { box-shadow: 0 0 30px var(--tier-glow), 0 0 4px #ffd24a inset; }
  50%      { box-shadow: 0 0 48px var(--tier-glow), 0 0 10px #ffd24a inset; }
}
