/* ============ Tokens ============ */
:root {
  --bg: #0d1030;
  --bg-2: #161a44;
  --ink: #f6f1ea;
  --ink-soft: #c9c3d8;
  --gold: #e9c98f;
  --gold-deep: #c99a55;
  --rose: #f1a7bb;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  --glow-1: #2a2466;
  --glow-2: #3a1e4d;
  --orb-a: #6b4fd1;
  --orb-b: #d96a92;
  --orb-c: #c99a55;
  --num: #fffaf1;
  --name-mid: #fff3dc;
  --tile: rgba(255, 255, 255, 0.045);
  --tile-edge: rgba(255, 255, 255, 0.08);
  --chip: rgba(13, 16, 48, 0.55);
  --radius: 28px;
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 15% -10%, var(--glow-1) 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 20%, var(--glow-2) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-color: var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: color .4s ease;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============ Ambient layer ============ */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; will-change: transform; }
.orb-a { width: 420px; height: 420px; background: var(--orb-a); top: -120px; left: -80px; animation: drift 22s ease-in-out infinite alternate; }
.orb-b { width: 360px; height: 360px; background: var(--orb-b); bottom: -140px; right: -60px; animation: drift 26s ease-in-out infinite alternate-reverse; }
.orb-c { width: 260px; height: 260px; background: var(--orb-c); top: 40%; left: 55%; opacity: .22; animation: drift 30s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(60px, 40px, 0) scale(1.1); } }

.particles span {
  position: absolute; bottom: -20px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 200, .95), rgba(233, 201, 143, 0));
  animation: rise linear infinite; will-change: transform, opacity;
}
@keyframes rise {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  12% { opacity: var(--o, .7); }
  100% { transform: translate3d(var(--x, 30px), -110vh, 0); opacity: 0; }
}

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }

/* ============ Layout ============ */
.page {
  position: relative; z-index: 1;
  max-width: 1160px; margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) 16px 48px;
  overflow-x: clip;
}
.hero { text-align: center; margin-bottom: clamp(36px, 6vw, 64px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  margin: 0 0 18px; font-size: 12px; font-weight: 600;
  letter-spacing: .32em; text-transform: uppercase; color: var(--gold);
}
.rule { width: 36px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.rule:last-child { transform: scaleX(-1); }
h1 {
  margin: 0; font-family: var(--display); font-weight: 500;
  font-size: clamp(42px, 8vw, 92px);
}
h1.only-normal { font-size: clamp(60px, 15vw, 110px); line-height: 1; }
h1 { line-height: 1.02; letter-spacing: -.01em;
}
.name {
  font-style: italic; font-weight: 600;
  background: linear-gradient(100deg, var(--gold) 10%, var(--name-mid) 45%, var(--rose) 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 6s ease-in-out infinite;
}
@keyframes sheen { 50% { background-position: 100% 0; } }
.cake { font-size: .7em; display: inline-block; transform-origin: 50% 90%; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.nickname {
  margin: 10px 0 0; font-size: clamp(12px, 1.6vw, 15px); font-weight: 700; letter-spacing: .42em; text-indent: .42em;
  color: var(--gold); opacity: .9;
}
.nickname span { letter-spacing: 0; }
.greeting {
  max-width: 560px; margin: 20px auto 0;
  font-size: clamp(15px, 2vw, 18px); line-height: 1.65; color: var(--ink-soft);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.panel { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* ============ Portrait ============ */
.portrait { position: relative; margin: 0; justify-self: center; width: 100%; max-width: 400px; }
.frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  padding: 10px; background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,.04));
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), 0 0 60px -10px rgba(233, 201, 143, .35);
}
/* Gallery: swipe, arrows, dots, keyboard. Add more <img class="slide"> to extend. */
.slides {
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  border-radius: calc(var(--radius) - 10px);
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  outline: none;
}
.slides::-webkit-scrollbar { display: none; }
.slides:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
.slide {
  flex: 0 0 100%; width: 100%; height: auto; aspect-ratio: 665 / 1182;
  object-fit: cover; object-position: var(--pos, 50% 50%);
  scroll-snap-align: center; scroll-snap-stop: always;
  user-select: none; -webkit-user-drag: none;
}
.nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--glass-edge); background: var(--chip); color: #fff;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer; opacity: .85; transition: opacity .25s ease, transform .25s ease;
}
.nav:hover { opacity: 1; transform: translateY(-50%) scale(1.06); }
.nav:disabled { opacity: 0; pointer-events: none; }
.nav.prev { left: 20px; } .nav.next { right: 20px; }
.nav svg { width: 18px; height: 18px; }
.dots { position: absolute; top: 24px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.dot {
  width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.dot::after { content: ""; width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.55); transition: width .3s ease, background .3s ease; }
.dot[aria-current="true"]::after { width: 22px; background: #fff; }
.single .nav, .single .dots { display: none; }
.ring {
  position: absolute; inset: -18px; border-radius: calc(var(--radius) + 18px);
  background: conic-gradient(from 0deg, transparent 0 20%, rgba(233,201,143,.55) 30%, transparent 42% 70%, rgba(241,167,187,.5) 80%, transparent 92%);
  filter: blur(14px); opacity: .7; z-index: -1;
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.portrait figcaption {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  padding: 8px 20px; border-radius: 999px;
  font-family: var(--display); font-style: italic; font-size: 22px; letter-spacing: .08em;
  background: var(--chip); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-edge); color: #fff; pointer-events: none;
}

/* ============ Cards ============ */
.card {
  position: relative; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--glass-edge);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
  padding: clamp(22px, 3.2vw, 34px);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 40%);
}
.card-title {
  margin: 0 0 20px; font-size: 12px; font-weight: 700;
  letter-spacing: .26em; text-transform: uppercase; color: var(--gold);
}

.units { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.unit {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 8px 14px; border-radius: 20px;
  background: var(--tile); border: 1px solid var(--tile-edge);
  transition: transform .3s ease, border-color .3s ease;
}
.unit:hover { transform: translateY(-3px); border-color: rgba(233, 201, 143, .35); }
.num {
  font-family: var(--display); font-weight: 600; line-height: 1;
  font-size: clamp(40px, 5.4vw, 60px); font-variant-numeric: lining-nums tabular-nums;
  color: var(--num); text-shadow: 0 0 24px rgba(233, 201, 143, .35);
  display: inline-block;
}
.lbl { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }
.num.tick { animation: tick .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes tick {
  0% { transform: translateY(-40%); opacity: 0; filter: blur(3px); }
  100% { transform: none; opacity: 1; filter: none; }
}

.message {
  margin: 0; padding: 4px 0 4px 0; text-align: center;
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: clamp(20px, 2.4vw, 26px); line-height: 1.5; color: var(--ink);
}
.message p { margin: 0 auto; max-width: 560px; }

.next-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.next-head .card-title { margin: 0; }
.next-date { margin: 0; font-size: 13px; color: var(--ink-soft); }
.mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.m { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.m .num { font-size: clamp(28px, 3.6vw, 38px); color: var(--rose); text-shadow: 0 0 20px rgba(241, 167, 187, .35); }
.today {
  margin: 16px 0 0; text-align: center; font-family: var(--display); font-style: italic;
  font-size: 22px; color: var(--gold);
}

[hidden] { display: none !important; }

/* ============ Entrance ============ */
.reveal { opacity: 0; transform: translateY(24px); }
.loaded .reveal { animation: reveal 1s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms) forwards; }
.loaded .portrait.reveal { animation-name: reveal-photo; animation-duration: 1.3s; }
@keyframes reveal { to { opacity: 1; transform: none; } }
@keyframes reveal-photo {
  0% { opacity: 0; transform: translateY(30px) scale(.94); filter: blur(8px); }
  100% { opacity: 1; transform: none; filter: none; }
}

/* ============ Life in little moments ============ */
.facts { margin-top: clamp(56px, 8vw, 96px); text-align: center; }
.facts-title {
  margin: 0 0 clamp(24px, 4vw, 40px); font-family: var(--display); font-weight: 500;
  font-size: clamp(34px, 5.4vw, 56px); line-height: 1.08; letter-spacing: -.01em;
}
.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2vw, 18px); text-align: center; }
.fact {
  position: relative; overflow: hidden; min-width: 0;
  padding: clamp(18px, 3vw, 30px) 12px clamp(16px, 2.6vw, 26px); border-radius: 24px;
  background: var(--glass); border: 1px solid var(--glass-edge);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform .35s ease, border-color .35s ease;
}
.fact::before {
  content: ""; position: absolute; left: 50%; top: -60%; width: 140%; aspect-ratio: 1; transform: translateX(-50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 18%, transparent), transparent 60%);
  pointer-events: none;
}
.fact:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.fact-icon {
  position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  color: var(--gold); background: var(--tile); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  box-shadow: 0 0 24px -6px color-mix(in srgb, var(--gold) 50%, transparent);
}
.fact-icon svg { width: 20px; height: 20px; }
.fact-num {
  position: relative; font-family: var(--display); font-weight: 600; line-height: 1;
  font-size: clamp(34px, 5vw, 56px); font-variant-numeric: lining-nums tabular-nums;
  background: linear-gradient(120deg, var(--num) 20%, var(--gold) 60%, var(--rose));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-top: 6px;
}
.fact-num.long { font-size: clamp(24px, 3.6vw, 46px); padding-top: .2em; }
.fact-lbl { position: relative; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); line-height: 1.5; }

/* ============ Floating controls: music + themes ============ */
.controls {
  position: fixed; right: 16px; bottom: 16px; z-index: 20;
  display: flex; gap: 8px; padding: 6px; border-radius: 999px;
  background: var(--chip); border: 1px solid var(--glass-edge);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px -12px rgba(0,0,0,.5);
}
.ctl {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08);
  transition: background .25s ease, transform .25s ease;
}
.ctl:hover { background: rgba(255,255,255,.16); transform: scale(1.05); }
.ctl:focus-visible, .theme-opt:focus-visible, .nav:focus-visible, .dot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ctl svg { width: 20px; height: 20px; }
.ctl.on { background: var(--gold); color: #1b1530; }
.ctl .eq { display: none; gap: 3px; align-items: flex-end; height: 16px; }
.ctl.on .eq { display: flex; }
.ctl.on .i-note { display: none; }
.eq i { width: 3px; border-radius: 2px; background: currentColor; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(1) { height: 60%; } .eq i:nth-child(2) { height: 100%; animation-delay: -.4s; } .eq i:nth-child(3) { height: 40%; animation-delay: -.7s; }
@keyframes eq { 50% { transform: scaleY(.35); } }
.ctl.hint { animation: hint 2.4s ease-in-out 3; }
@keyframes hint { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--gold) 30%, transparent); } }
.menu {
  position: fixed; right: 16px; bottom: 80px; z-index: 21; width: 250px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px; border-radius: 20px; background: rgba(20, 18, 40, .92); color: #fff;
  border: 1px solid rgba(255,255,255,.14); box-shadow: 0 20px 60px -20px rgba(0,0,0,.7);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.menu h3 { margin: 6px 10px 8px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: #cfc7e6; font-weight: 700; }
.theme-opt {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; min-height: 44px;
  border: 0; border-radius: 12px; background: none; color: #fff; font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.theme-opt:hover { background: rgba(255,255,255,.08); }
.theme-opt[aria-checked="true"] { background: rgba(255,255,255,.12); }
.theme-opt[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: #f0d9a8; }
.menu-head { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.play-toggle {
  min-height: 36px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; background: #f0d9a8; color: #1b1530;
}
.play-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.track-sw { display: grid; place-items: center; background: rgba(255,255,255,.08); }
.track-sw::before { content: "♪"; font-size: 13px; color: #f0d9a8; }
.track-opt.now .track-sw { background: #f0d9a8; }
.track-opt.now .track-sw::before { color: #1b1530; }
.sw { width: 26px; height: 26px; border-radius: 50%; flex: none; border: 1px solid rgba(255,255,255,.3); }

/* Gentle refresh: content fades softly, then replays its entrance */
.page { transition: opacity .6s ease, filter .6s ease, transform .6s ease; }
.page.resting { opacity: 0; filter: blur(6px); transform: scale(.985); }
#refresh-btn svg { transition: transform .9s cubic-bezier(.3, .7, .2, 1); }
#refresh-btn.spin svg { transform: rotate(360deg); }

/* Shuffle quote button + quote swap */
.shuffle {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--glass-edge); background: var(--tile); color: var(--gold);
  font-family: var(--body); font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  cursor: pointer; transition: background .25s ease, transform .25s ease;
}
.shuffle:hover { background: var(--glass); transform: translateY(-1px); }
.shuffle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.shuffle svg { width: 16px; height: 16px; }
.shuffle.turn svg { animation: turn .5s ease; }
@keyframes turn { 50% { transform: rotate(180deg) scale(.85); } 100% { transform: rotate(360deg); } }
#quote { transition: opacity .3s ease, transform .3s ease, filter .3s ease; }
#quote.swap { opacity: 0; transform: translateY(8px); filter: blur(4px); }

/* Share modal */
.share-modal {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 5, 20, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fadein .25s ease;
}
.share-modal[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } }
.share-box {
  width: min(420px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; gap: 12px;
  padding: 16px; border-radius: 24px; background: rgba(20, 18, 40, .95); color: #fff;
  border: 1px solid rgba(255,255,255,.14); box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
}
.share-top { display: flex; align-items: center; justify-content: space-between; }
.share-top h3 { margin: 0 0 0 6px; font-family: var(--display); font-style: italic; font-weight: 600; font-size: 24px; }
.share-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; place-items: center; }
.share-x svg { width: 18px; height: 18px; }
.share-frame { min-height: 0; flex: 1 1 auto; display: grid; place-items: center; border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.04); aspect-ratio: 4 / 5; }
.share-frame img { width: 100%; height: 100%; object-fit: contain; }
.share-status { margin: 0; min-height: 18px; text-align: center; font-size: 13px; color: #cfc7e6; }
.share-actions { display: flex; gap: 10px; }
.share-act { flex: 1; min-height: 48px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.share-act.primary { background: #f0d9a8; color: #1b1530; border-color: transparent; }
.share-act:focus-visible, .share-x:focus-visible { outline: 2px solid #f0d9a8; outline-offset: 2px; }

/* Progress ring: how much of the year to the next birthday has passed */
.next-body { display: flex; align-items: center; gap: clamp(16px, 3vw, 28px); }
.next-body .mini { flex: 1; min-width: 0; }
.yr-ring { position: relative; flex: none; width: 112px; height: 112px; }
.yr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--tile-edge); stroke-width: 9; }
.ring-fill {
  fill: none; stroke: url(#ring-grad); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 326.73; stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.6s cubic-bezier(.2, .8, .2, 1);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--rose) 50%, transparent));
}
.ring-stop-a { stop-color: var(--gold); }
.ring-stop-b { stop-color: var(--rose); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-pct { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1; color: var(--num); font-variant-numeric: lining-nums tabular-nums; }
.ring-sub { margin-top: 4px; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }

/* Petal rain on open: tap a petal to pop it */
.petals { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -40px; left: var(--x); font-size: var(--s); line-height: 1;
  pointer-events: auto; cursor: pointer; user-select: none; -webkit-user-select: none;
  animation: petal-fall var(--t) linear var(--d) forwards;
  will-change: transform; opacity: 0;
}
.petal > span { display: block; animation: petal-sway var(--w) ease-in-out infinite alternate; }
@keyframes petal-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: .95; }
  85% { opacity: .9; }
  100% { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--r)); opacity: 0; }
}
@keyframes petal-sway { from { transform: translateX(-14px) rotate(-12deg); } to { transform: translateX(14px) rotate(12deg); } }
.petal.pop { animation: none; pointer-events: none; }
.petal.pop > span { animation: petal-pop .45s ease-out forwards; }
@keyframes petal-pop { to { transform: scale(2.2); opacity: 0; filter: blur(2px); } }
.spark { position: fixed; z-index: 16; width: 6px; height: 6px; border-radius: 50%; pointer-events: none; background: var(--rose); animation: spark .6s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--sx), var(--sy)) scale(.2); opacity: 0; } }

/* ============ Themes ============ */
:root[data-theme="rose"] {
  --bg: #1d0f18; --bg-2: #2b1522; --glow-1: #5a2338; --glow-2: #3e1a2e;
  --orb-a: #b8566f; --orb-b: #e08a6a; --orb-c: #f0c4a0;
  --gold: #f0c4a0; --rose: #f6a9bc; --name-mid: #fff0e6;
}
:root[data-theme="lilac"] {
  --bg: #16112e; --bg-2: #231a42; --glow-1: #4b3490; --glow-2: #5a2a6e;
  --orb-a: #8d6be0; --orb-b: #d88ac0; --orb-c: #b7a2f0;
  --gold: #d9c6ff; --rose: #f7b8d8; --name-mid: #ffffff;
}
:root[data-theme="garden"] {
  --bg: #0b1a15; --bg-2: #11261e; --glow-1: #1f4a3a; --glow-2: #34401c;
  --orb-a: #2f8f6a; --orb-b: #c9b35a; --orb-c: #6fcf9f;
  --gold: #e6d59a; --rose: #9fe3c2; --name-mid: #f6fff6;
}
:root[data-theme="ocean"] {
  --bg: #08171f; --bg-2: #0e2530; --glow-1: #134a5a; --glow-2: #1f3a60;
  --orb-a: #1f8fa0; --orb-b: #3a6ad0; --orb-c: #7fe0dc;
  --gold: #f2d7a0; --rose: #85e3de; --name-mid: #effffe;
}
:root[data-theme="pearl"] {
  --bg: #faf6f0; --bg-2: #f1e9e0; --glow-1: #eadcf7; --glow-2: #fbe1d4;
  --orb-a: #d9c4f5; --orb-b: #f6c6d4; --orb-c: #f3dfb5;
  --ink: #2a2233; --ink-soft: #5b5266; --gold: #8a5a1c; --gold-deep: #6e4610; --rose: #a8385f;
  --num: #2a2233; --name-mid: #b5536f;
  --glass: rgba(255,255,255,.55); --glass-edge: rgba(60,40,80,.12);
  --tile: rgba(255,255,255,.65); --tile-edge: rgba(60,40,80,.08);
  --shadow: 0 30px 70px -30px rgba(80,50,90,.35);
}
:root[data-theme="pearl"] .num, :root[data-theme="pearl"] .m .num { text-shadow: none; }
:root[data-theme="pearl"] .orb { opacity: .6; }
:root[data-theme="pearl"] .particles span { background: radial-gradient(circle, rgba(201,154,85,.7), rgba(201,154,85,0)); }

:root[data-theme="coral"] {
  --bg: #1f0d18; --bg-2: #2e1320; --glow-1: #6a2235; --glow-2: #5a2a1a;
  --orb-a: #e0645a; --orb-b: #ff9f7f; --orb-c: #f5c26b;
  --gold: #ffc59a; --rose: #ff9f8f; --name-mid: #fff1e8;
}
:root[data-theme="sapphire"] {
  --bg: #06112b; --bg-2: #0b1d45; --glow-1: #16357a; --glow-2: #1f2a6b;
  --orb-a: #2f5fd0; --orb-b: #6b8cff; --orb-c: #b9cdf5;
  --gold: #d6e2ff; --rose: #9fc0ff; --name-mid: #ffffff;
}
:root[data-theme="blush"] {
  --bg: #fff3f5; --bg-2: #fde6ec; --glow-1: #ffd6e0; --glow-2: #ffe6d9;
  --orb-a: #f7b3c6; --orb-b: #ffc9b5; --orb-c: #f3d1f0;
  --ink: #3a2230; --ink-soft: #6b4d5c; --gold: #b0406a; --gold-deep: #8e2f54; --rose: #c05a3d;
  --num: #3a2230; --name-mid: #e07a96;
  --glass: rgba(255,255,255,.6); --glass-edge: rgba(120,40,70,.12);
  --tile: rgba(255,255,255,.7); --tile-edge: rgba(120,40,70,.08);
  --shadow: 0 30px 70px -30px rgba(150,60,90,.3);
}
:root[data-theme="blush"] .num, :root[data-theme="blush"] .m .num { text-shadow: none; }
:root[data-theme="blush"] .orb { opacity: .6; }
:root[data-theme="blush"] .particles span { background: radial-gradient(circle, rgba(224,122,150,.7), rgba(224,122,150,0)); }

/* ============ Space themes: Galaxy, Solar System, Nebula, Aurora ============ */
.space, .space > * { display: none; }
.space { position: absolute; inset: 0; }
.stars { position: absolute; top: 0; left: 0; width: 1px; height: 1px; border-radius: 50%; background: transparent; }
.stars-b { width: 2px; height: 2px; animation: twinkle 4s ease-in-out infinite alternate; }
.stars-a { animation: twinkle 6s ease-in-out infinite alternate-reverse; }
@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }
:root[data-theme="galaxy"] .space, :root[data-theme="solar"] .space, :root[data-theme="nebula"] .space, :root[data-theme="aurora"] .space, :root[data-theme="moon"] .space,
:root[data-theme="galaxy"] .stars, :root[data-theme="solar"] .stars, :root[data-theme="nebula"] .stars, :root[data-theme="aurora"] .stars, :root[data-theme="moon"] .stars { display: block; }
:root[data-theme="moon"] .moon-wrap { display: block; }
:root[data-theme="galaxy"] .milky { display: block; }
:root[data-theme="aurora"] .aurora { display: block; }
:root[data-theme="solar"] .solar { display: block; }

.milky {
  position: absolute; left: -40vmax; top: 10%; width: 180vmax; height: 34vmax;
  transform: rotate(-24deg);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 240, 255, .28), transparent 45%),
    radial-gradient(ellipse at 35% 55%, rgba(170, 130, 255, .35), transparent 55%),
    radial-gradient(ellipse at 65% 45%, rgba(255, 140, 200, .25), transparent 55%);
  filter: blur(28px);
}

.aurora { position: absolute; inset: 0 0 auto 0; height: 70vh; filter: blur(38px); opacity: .75; }
.aurora i {
  position: absolute; left: -20%; width: 140%; height: 45%; border-radius: 50%;
  background: linear-gradient(90deg, transparent, #1fbf8f 25%, #46e0b0 45%, #3a7bd5 65%, #7b5cd6 80%, transparent);
  animation: sway 16s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { top: 2%; }
.aurora i:nth-child(2) { top: 18%; opacity: .7; animation-duration: 22s; animation-direction: alternate-reverse; }
.aurora i:nth-child(3) { top: 32%; opacity: .45; animation-duration: 28s; }
@keyframes sway { 0% { transform: translateX(-6%) skewY(-4deg) scaleY(.8); } 100% { transform: translateX(6%) skewY(4deg) scaleY(1.2); } }

.solar { position: absolute; top: 12vmin; right: 12vmin; width: 0; height: 0; }
.sun {
  position: absolute; width: 22vmin; height: 22vmin; left: -11vmin; top: -11vmin; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fffbe6 0%, #ffd36b 35%, #ff9a2e 70%, #ff6a1a 100%);
  box-shadow: 0 0 60px 20px rgba(255, 170, 60, .45), 0 0 160px 60px rgba(255, 120, 40, .25);
  display: block;
}
.orbit {
  position: absolute; display: block; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .09);
  width: var(--d); height: var(--d); left: calc(var(--d) / -2); top: calc(var(--d) / -2);
  animation: spin var(--t) linear infinite;
}
.orbit::after {
  content: ""; position: absolute; top: 50%; left: calc(var(--p) / -2); width: var(--p); height: var(--p);
  margin-top: calc(var(--p) / -2); border-radius: 50%; background: var(--c);
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent);
}
.o1 { --d: 40vmin; --t: 18s; --p: 8px;  --c: #c9b8a6; }
.o2 { --d: 70vmin; --t: 30s; --p: 12px; --c: #f2c77a; }
.o3 { --d: 96vmin; --t: 46s; --p: 13px; --c: #5aa7ff; }
.o4 { --d: 124vmin; --t: 70s; --p: 10px; --c: #ff7a5c; }
.o5 { --d: 160vmin; --t: 110s; --p: 22px; --c: #e8b98a; }
.o2 { animation-delay: -9s; } .o3 { animation-delay: -30s; } .o4 { animation-delay: -12s; } .o5 { animation-delay: -60s; }

:root[data-theme="galaxy"] {
  --bg: #05030f; --bg-2: #0b0720; --glow-1: #2a1460; --glow-2: #401a55;
  --orb-a: #5b3cc4; --orb-b: #c0508a; --orb-c: #3a6fd8;
  --gold: #f0dcff; --rose: #ff9fd6; --name-mid: #ffffff;
}
:root[data-theme="solar"] {
  --bg: #04060d; --bg-2: #0a0d1c; --glow-1: #2a1606; --glow-2: #0e1636;
  --orb-a: #1c2a6a; --orb-b: #5a2a10; --orb-c: #ff9a3c;
  --gold: #ffc36b; --rose: #ff8a5c; --name-mid: #fff4d6;
}
:root[data-theme="solar"] .orb { opacity: .18; }
:root[data-theme="nebula"] {
  --bg: #070312; --bg-2: #120726; --glow-1: #5a1060; --glow-2: #0f3a5a;
  --orb-a: #d0368a; --orb-b: #2bb3c0; --orb-c: #7b3fe0;
  --gold: #a8f2ff; --rose: #ff8ad0; --name-mid: #ffffff;
}
:root[data-theme="nebula"] .orb { opacity: .6; filter: blur(90px); }
:root[data-theme="nebula"] .orb-a { width: 620px; height: 620px; }
:root[data-theme="nebula"] .orb-b { width: 560px; height: 560px; }
:root[data-theme="aurora"] {
  --bg: #03101a; --bg-2: #061a26; --glow-1: #0a3a3a; --glow-2: #1a1a4a;
  --orb-a: #0f5a50; --orb-b: #2a3a8a; --orb-c: #1fbf8f;
  --gold: #a6ffd9; --rose: #9fc9ff; --name-mid: #ffffff;
}
:root[data-theme="aurora"] .orb { opacity: .25; }

/* ============ Birthdays on other planets ============ */
.planets { margin-top: clamp(56px, 8vw, 96px); text-align: center; }
.planet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 2vw, 18px); }
.planet-card {
  position: relative; min-width: 0; padding: clamp(18px, 2.6vw, 26px) 10px 18px; border-radius: 24px;
  background: var(--glass); border: 1px solid var(--glass-edge);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform .35s ease, border-color .35s ease;
}
.planet-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.planet-card[data-planet="earth"] { border-color: color-mix(in srgb, var(--gold) 55%, transparent); box-shadow: 0 0 40px -12px color-mix(in srgb, var(--gold) 60%, transparent); }
.ball {
  position: relative; width: var(--s, 44px); height: var(--s, 44px); border-radius: 50%;
  margin: calc((60px - var(--s, 44px)) / 2) 0 calc((60px - var(--s, 44px)) / 2 + 10px);
  background: var(--g); box-shadow: inset -6px -6px 14px rgba(0,0,0,.45), 0 0 26px -4px var(--glow, rgba(255,255,255,.3));
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty { 50% { transform: translateY(-4px); } }
.ball.mercury { --s: 30px; --g: radial-gradient(circle at 35% 35%, #d9d2c8, #8f877d 60%, #5d564e); --glow: rgba(200,190,180,.35); }
.ball.venus   { --s: 40px; --g: radial-gradient(circle at 35% 35%, #fff1c9, #e8c27a 55%, #b8873f); --glow: rgba(240,200,120,.45); }
.ball.earth   { --s: 42px; --g: radial-gradient(circle at 30% 30%, #bfe6ff 0 8%, transparent 9%), radial-gradient(circle at 60% 55%, #5fb86b 0 18%, transparent 19%), radial-gradient(circle at 35% 65%, #5fb86b 0 10%, transparent 11%), radial-gradient(circle at 35% 35%, #7cc4ff, #2f6fd6 60%, #173c86); --glow: rgba(90,160,255,.5); }
.ball.mars    { --s: 34px; --g: radial-gradient(circle at 35% 35%, #ffb08a, #d9573a 55%, #8f2e1c); --glow: rgba(230,100,70,.45); }
.ball.jupiter { --s: 56px; --g: linear-gradient(170deg, #f3dcc0 0 14%, #c99a6b 14% 24%, #f0d6b4 24% 38%, #b9825a 38% 48%, #e9cba6 48% 64%, #c28f64 64% 74%, #efd8bc 74%); --glow: rgba(230,180,130,.4); }
.ball.saturn  { --s: 46px; --g: linear-gradient(170deg, #f5e6c4 0 30%, #e0c48f 30% 50%, #f2dfb5 50% 75%, #d6b67c 75%); --glow: rgba(240,210,150,.4); }
.ball.saturn::after {
  content: ""; position: absolute; left: -40%; top: 38%; width: 180%; height: 24%; border-radius: 50%;
  border: 3px solid rgba(235, 215, 170, .8); transform: rotate(-18deg); box-sizing: border-box;
}
.ball.uranus  { --s: 40px; --g: radial-gradient(circle at 35% 35%, #e6ffff, #8fe3e8 55%, #4aa6b8); --glow: rgba(140,230,235,.45); }
.ball.neptune { --s: 40px; --g: radial-gradient(circle at 35% 35%, #b8ccff, #4a6ee0 55%, #22358f); --glow: rgba(90,120,240,.5); }
.p-name { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.p-age {
  font-family: var(--display); font-weight: 600; line-height: 1.05; font-size: clamp(32px, 4.4vw, 50px);
  font-variant-numeric: lining-nums tabular-nums; color: var(--num);
}
.p-unit { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.p-next { margin-top: 8px; font-size: 12px; line-height: 1.4; color: var(--ink-soft); opacity: .85; }

/* ============ Her year in seasons ============ */
.seasons, .hijri, .stars-section { margin-top: clamp(56px, 8vw, 96px); text-align: center; }
.season-card, .hijri-card, .const-card {
  position: relative; border-radius: 24px; background: var(--glass); border: 1px solid var(--glass-edge);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.season-card { padding: clamp(20px, 3.4vw, 34px); text-align: left; }
.season-lead { margin: 0 0 clamp(36px, 5vw, 44px); text-align: center; font-family: var(--display); font-style: italic; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.45; color: var(--ink); }
.season-lead b { font-style: normal; font-weight: 600; color: var(--gold); }
.season-bar { margin-top: 30px; position: relative; display: flex; height: 22px; border-radius: 999px; overflow: visible; background: var(--tile); }
.seg { position: relative; height: 100%; min-width: 2px; }
.seg:first-of-type { border-radius: 999px 0 0 999px; } .seg:last-of-type { border-radius: 0 999px 999px 0; }
.seg::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--c); opacity: .3; }
.seg .fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--f, 0%); border-radius: inherit; background: var(--c); z-index: 1; }
.seg + .seg { box-shadow: -2px 0 0 var(--bg); }
.season-marker { position: absolute; top: -8px; bottom: -8px; width: 3px; left: var(--p, 0%); margin-left: -1.5px; border-radius: 3px; background: var(--num); z-index: 3; box-shadow: 0 0 12px var(--num); }
.season-marker-tag {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  background: var(--num); color: var(--bg);
}
.season-ends { display: flex; justify-content: space-between; margin-top: 12px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.season-list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.season-list li {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border-radius: 16px; text-align: center;
  background: var(--tile); border: 1px solid var(--tile-edge); min-width: 0;
}
.season-list li.now { border-color: var(--c); box-shadow: 0 0 24px -8px var(--c); }
.season-list li.ahead { opacity: .62; }
.s-ico { font-size: 22px; line-height: 1; }
.s-name { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.s-dates { font-size: 11px; color: var(--ink-soft); }
.s-state { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

/* ============ Hijri birthday ============ */
.hijri-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: clamp(10px, 2vw, 18px); }
.hijri-card { padding: clamp(20px, 3vw, 30px) 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.hijri-main { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.hijri-moon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); background: var(--tile); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); box-shadow: 0 0 24px -6px color-mix(in srgb, var(--gold) 50%, transparent); }
.hijri-moon svg { width: 22px; height: 22px; }
.hijri-label { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.hijri-date { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.1; color: var(--num); font-variant-numeric: lining-nums; }
.hijri-big { font-family: var(--display); font-weight: 600; font-size: clamp(38px, 4.6vw, 54px); line-height: 1; color: var(--rose); font-variant-numeric: lining-nums tabular-nums; }
.hijri-sub { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.hijri-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.hijri-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--tile); font-size: 13px; color: var(--ink); }
.hijri-list li span:last-child { color: var(--ink-soft); }

/* ============ ZARA constellation (space themes only) ============ */
.stars-section { display: none; }
:root[data-theme="galaxy"] .stars-section, :root[data-theme="solar"] .stars-section,
:root[data-theme="nebula"] .stars-section, :root[data-theme="aurora"] .stars-section, :root[data-theme="moon"] .stars-section { display: block; }
.const-card { padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 48px) clamp(18px, 3vw, 28px); overflow: hidden; }
.constellation { display: block; width: 100%; max-width: 760px; height: auto; margin: 0 auto; overflow: visible; }
.c-dust { fill: #fff; opacity: .35; }
.c-line { stroke: var(--gold); stroke-width: .9; stroke-linecap: round; opacity: .7; stroke-dasharray: 1; stroke-dashoffset: 1; }
.c-star { fill: #fff; filter: drop-shadow(0 0 3px #fff); animation: c-twinkle 3s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.37s); }
.c-glow { fill: color-mix(in srgb, var(--gold) 35%, transparent); opacity: .5; }
.const-card.drawn .c-line { animation: c-loop 11s ease-in-out infinite; animation-delay: calc(var(--i) * .2s); }
.const-card.drawn .c-glow { transform-box: fill-box; transform-origin: center; animation: c-pulse 11s ease-in-out infinite; animation-delay: calc(var(--i) * .14s); }
@keyframes c-loop {
  0% { stroke-dashoffset: 1; opacity: .75; }
  22% { stroke-dashoffset: 0; opacity: .75; }
  72% { stroke-dashoffset: 0; opacity: .75; }
  86% { stroke-dashoffset: 0; opacity: 0; }
  87% { stroke-dashoffset: 1; opacity: 0; }
  100% { stroke-dashoffset: 1; opacity: .75; }
}
@keyframes c-pulse { 0%, 100% { transform: scale(1); opacity: .5; } 12% { transform: scale(1.8); opacity: .9; } 30% { transform: scale(1); opacity: .5; } }
@keyframes c-twinkle { from { opacity: .55; } to { opacity: 1; } }
.const-note { margin: 18px 0 0; font-family: var(--display); font-style: italic; font-size: clamp(18px, 2.2vw, 22px); color: var(--ink-soft); }

/* ============ Flower of the day ============ */
.flower { margin-top: clamp(40px, 6vw, 72px); }
.flower-card {
  display: flex; align-items: center; gap: clamp(18px, 4vw, 40px); max-width: 760px; margin: 0 auto;
  padding: clamp(20px, 3.4vw, 32px) clamp(20px, 4vw, 40px); border-radius: 28px;
  background: var(--glass); border: 1px solid var(--glass-edge);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.flower-art { flex: none; width: clamp(120px, 18vw, 170px); aspect-ratio: 1; filter: drop-shadow(0 10px 24px rgba(0,0,0,.3)); }
.flower-art svg { width: 100%; height: 100%; overflow: visible; }
.flower-art svg .bloom { transform-origin: 50% 50%; transform-box: view-box; animation: bloom-in 1.6s cubic-bezier(.2,.8,.2,1) both, sway 7s ease-in-out 1.6s infinite alternate; }
@keyframes bloom-in { from { transform: scale(.35) rotate(-25deg); opacity: 0; } }
@keyframes sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
.flower-text { min-width: 0; text-align: left; }
.flower-text p { margin: 0; }
.flower-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.flower-name { margin-top: 6px !important; font-family: var(--display); font-weight: 600; font-size: clamp(34px, 4.6vw, 50px); line-height: 1.05; color: var(--num); }
.flower-meaning { margin-top: 6px !important; font-family: var(--display); font-style: italic; font-size: clamp(19px, 2.2vw, 24px); line-height: 1.35; color: var(--ink); }
.flower-next { margin-top: 12px !important; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }

/* ============ Birthday through the years ============ */
.years { margin-top: clamp(56px, 8vw, 96px); text-align: center; }
.year-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 14px); }
.year-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 4px 12px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--glass-edge); min-width: 0;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.year-tile .y { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--ink-soft); }
.year-tile .wd { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.1; color: var(--num); }
.year-tile .ag { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); opacity: .8; }
.year-tile.weekend { background: color-mix(in srgb, var(--rose) 18%, var(--glass)); border-color: color-mix(in srgb, var(--rose) 55%, transparent); }
.year-tile.weekend .wd { color: var(--rose); }
.year-tile.next { border: 1.5px dashed var(--gold); }
.year-tile.next .ag { color: var(--gold); opacity: 1; }
.year-tile.born .ag { color: var(--gold); opacity: 1; }
.year-legend { display: flex; justify-content: center; gap: 22px; margin-top: 16px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.year-legend span { display: inline-flex; align-items: center; gap: 8px; }
.year-legend i { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.lg-weekend { background: color-mix(in srgb, var(--rose) 35%, transparent); border: 1px solid var(--rose); }
.lg-next { border: 1.5px dashed var(--gold); }

/* ============ Shooting stars (space themes) ============ */
.sky { position: fixed; inset: 0; z-index: 14; pointer-events: none; overflow: hidden; }
.shoot {
  position: absolute; left: var(--x); top: var(--y); width: 180px; height: 44px; margin: -22px 0 0 -22px; padding: 0;
  border: 0; background: none; cursor: pointer; pointer-events: auto; transform-origin: 22px 22px;
  animation: shoot var(--t) cubic-bezier(.3, .1, .6, 1) forwards;
  -webkit-tap-highlight-color: transparent;
}
.shoot .head { position: absolute; left: 16px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px 4px rgba(255,255,255,.9), 0 0 30px 8px color-mix(in srgb, var(--gold) 70%, transparent); }
.shoot .tail { position: absolute; left: 22px; top: 20px; width: 150px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, rgba(255,255,255,.95), rgba(255,255,255,0)); }
@keyframes shoot {
  0% { transform: translate(0, 0) rotate(var(--a)); opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--a)); opacity: 0; }
}
.shoot.caught { animation-play-state: paused; pointer-events: none; }
.shoot.caught .head { animation: catch .6s ease-out forwards; }
.shoot.caught .tail { opacity: 0; transition: opacity .3s; }
@keyframes catch { to { transform: scale(6); opacity: 0; } }
.toast {
  position: fixed; left: 50%; top: 18px; z-index: 30; transform: translateX(-50%); max-width: calc(100vw - 32px);
  padding: 12px 20px; border-radius: 999px; text-align: center;
  background: rgba(20, 18, 40, .92); color: #fff; border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.6); font-size: 14px; font-weight: 600;
  animation: toast-in .35s ease;
}
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } }


/* Moonlight: a realistic moon showing tonight's real phase */
.moon-wrap {
  position: absolute; top: clamp(18px, 5vmin, 60px); right: clamp(10px, 6vmin, 90px);
  width: clamp(150px, 30vmin, 340px); aspect-ratio: 1;
  animation: moon-float 18s ease-in-out infinite alternate;
}
.moon-wrap svg { width: 100%; height: 100%; display: block; }
.moon-label { margin: -6% 0 0 -50%; width: 200%; white-space: nowrap; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: rgba(220,228,255,.6); }
@keyframes moon-float { to { transform: translateY(10px) rotate(2deg); } }
:root[data-theme="moon"] {
  --bg: #03050b; --bg-2: #0a1020; --glow-1: #101a33; --glow-2: #121a30;
  --orb-a: #243a6a; --orb-b: #2a2f55; --orb-c: #6d7fa8;
  --gold: #e6e9f2; --rose: #a9c4ff; --name-mid: #ffffff;
}
:root[data-theme="moon"] .orb { opacity: .22; }
:root[data-theme="moon"] .particles span { background: radial-gradient(circle, rgba(220,230,255,.9), rgba(220,230,255,0)); }

/* ============ Mini ZARA (avatar) ============ */
.avatar-sec { margin-top: clamp(56px, 8vw, 96px); text-align: center; }
.mini-card {
  position: relative; max-width: 760px; margin: 0 auto; padding: clamp(28px, 4vw, 44px) 16px 22px;
  border-radius: 28px; background: var(--glass); border: 1px solid var(--glass-edge);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; overflow: hidden;
}
.mini-card::before {
  content: ""; position: absolute; left: 50%; top: 8%; width: 70%; aspect-ratio: 1; transform: translateX(-50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--rose) 22%, transparent), transparent 62%); pointer-events: none;
}
.mini-avatar {
  grid-column: 2; position: relative; border: 0; padding: 0; background: none; cursor: pointer;
  height: clamp(300px, 46vw, 420px); aspect-ratio: 420 / 1464; -webkit-tap-highlight-color: transparent;
}
.mini-avatar img {
  position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block;
  transform-origin: 50% 100%; filter: drop-shadow(0 14px 18px rgba(0,0,0,.35));
  animation: idle 4.5s ease-in-out infinite;
}
.mini-avatar:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; border-radius: 16px; }
.mini-stage {
  position: absolute; left: 50%; bottom: -10px; width: 230%; height: 34px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(ellipse at center, color-mix(in srgb, var(--gold) 55%, transparent), transparent 70%);
  filter: blur(4px); opacity: .8;
}
@keyframes idle { 0%, 100% { transform: scale(1, 1) rotate(0deg); } 50% { transform: scale(1.012, .992) rotate(-.8deg); } }
.mini-avatar.hop img { animation: hop .7s cubic-bezier(.3, .7, .3, 1); }
@keyframes hop { 0% { transform: scale(1, 1); } 20% { transform: scale(1.05, .93); } 50% { transform: translateY(-26px) scale(.97, 1.04) rotate(2deg); } 80% { transform: translateY(0) scale(1.04, .96); } 100% { transform: scale(1, 1); } }
body.music-on .mini-avatar:not(.hop) img { animation: groove .9s ease-in-out infinite; }
@keyframes groove { 0%, 100% { transform: rotate(-2.2deg) translateY(0); } 50% { transform: rotate(2.2deg) translateY(-4px); } }
.bubble {
  grid-column: 1; justify-self: end; align-self: start; margin-top: 18%; position: relative; z-index: 2;
  max-width: 230px; padding: 14px 18px; border-radius: 22px 22px 6px 22px; text-align: left;
  background: var(--num); color: var(--bg); font-weight: 600; font-size: 15px; line-height: 1.4;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.45); transition: transform .35s cubic-bezier(.3,.7,.3,1.4), opacity .25s ease;
}
.bubble.swap { transform: scale(.85) translateY(6px); opacity: 0; }
.mini-hint { grid-column: 1 / -1; margin: 18px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }

/* ============ Responsive ============ */
@media (max-width: 880px) {
  .stage { grid-template-columns: 1fr; }
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .season-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .year-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hijri-grid { grid-template-columns: 1fr; }
  .page { padding-bottom: 104px; }
  .portrait { max-width: 340px; }
}
@media (max-width: 480px) {
  .units { gap: 10px; }
  .unit { padding: 14px 4px 12px; border-radius: 16px; }
  .lbl { font-size: 10px; letter-spacing: .14em; }
  .mini { gap: 6px; }
  .portrait { max-width: 280px; }
  .portrait figcaption { font-size: 18px; bottom: 20px; }
  .ring { inset: -10px; }
  .fact { border-radius: 20px; }
  .mini-card { grid-template-columns: 1fr; }
  .mini-avatar { grid-column: 1; justify-self: center; height: 330px; }
  .bubble { grid-column: 1; justify-self: center; margin: 0 0 14px; border-radius: 22px 22px 22px 6px; text-align: center; max-width: 260px; }
  .moon-label { font-size: 8px; letter-spacing: .12em; }
  .flower-card { gap: 16px; padding: 18px; }
  .flower-art { width: 96px; }
  .next-body { flex-direction: column; gap: 18px; }
  .next-body .mini { width: 100%; }
  .yr-ring { width: 104px; height: 104px; }
  .fact-lbl { font-size: 10px; letter-spacing: .12em; }
  .fact-icon { width: 36px; height: 36px; }
  .menu { right: 12px; left: 12px; width: auto; bottom: 76px; }
  .controls { right: 12px; bottom: 12px; }
  .nav { width: 40px; height: 40px; }
  .nav.prev { left: 14px; } .nav.next { right: 14px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .particles, .confetti, .petals, .sky { display: none; }
  .c-line { stroke-dashoffset: 0; }
  .ring-fill { transition: none; }
  .space .orbit, .ball, .moon-wrap { animation: none !important; }
  .bubble { transition: none; }
  .page.resting { filter: none; transform: none; }
  .slides { scroll-behavior: auto; }
}
