/* Stargaze — מדריך הצפייה בכוכבים
   © אופיר ברנס (Ofir Baranes) 2026
   Palette: midnight-pearl (deep cosmic blue + pearl cream + gold star accent)
*/

:root {
  --bg-0: #050717;
  --bg-1: #0a0e1f;
  --bg-2: #11162c;
  --surface: rgba(20, 27, 52, 0.55);
  --surface-hi: rgba(30, 39, 70, 0.68);
  --border: rgba(212, 166, 74, 0.16);
  --border-hi: rgba(243, 196, 95, 0.32);
  --border-cool: rgba(184, 196, 220, 0.12);

  --indigo-deep: #1a2050;
  --indigo: #3a4598;
  --indigo-hi: #5b6ac4;
  --nebula: #8b6dbb;
  --moonlight: #b8c4dc;
  --moonlight-soft: #d6dcee;

  --gold-deep: #8a6420;
  --gold: #d4a64a;
  --gold-hi: #f3c45f;
  --gold-bright: #fde4a8;

  --pearl: #f4ead0;
  --pearl-dim: #d6cba8;
  --cream: #f8efd9;

  --text: #ece8d6;
  --text-mute: #a8aec5;
  --text-dim: #6e7591;

  --warn: #e3a455;
  --danger: #d35b6a;
  --good: #6ed8a8;

  --shadow-1: 0 1px 0 rgba(244, 234, 208, 0.05) inset, 0 10px 30px rgba(0,0,0,0.6);
  --shadow-2: 0 1px 0 rgba(244, 234, 208, 0.06) inset, 0 24px 60px rgba(0,0,0,0.7), 0 4px 18px rgba(91, 106, 196, 0.10);
  --glow-gold: 0 0 40px rgba(212, 166, 74, 0.22), 0 0 8px rgba(243, 196, 95, 0.18);
  --glow-moon: 0 0 60px rgba(184, 196, 220, 0.16), 0 0 14px rgba(216, 224, 240, 0.18);

  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

[data-palette="aurora"] {
  --gold: #95d6b6;
  --gold-hi: #b8efd0;
  --gold-bright: #d9f9e8;
  --nebula: #4ab8c4;
}
[data-palette="crimson"] {
  --gold: #c46a5b;
  --gold-hi: #e89380;
  --gold-bright: #f6c4b2;
  --nebula: #b34b78;
}
[data-palette="cosmic"] {
  --gold: #b594d8;
  --gold-hi: #d7baef;
  --gold-bright: #ecdaff;
  --nebula: #6e54a8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg-0);
  color-scheme: dark;
}

body {
  font-family: 'Heebo', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(91, 106, 196, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(139, 109, 187, 0.10), transparent 70%),
    radial-gradient(ellipse 50% 30% at 10% 60%, rgba(212, 166, 74, 0.05), transparent 70%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 50%, var(--bg-0));
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
  padding-bottom: calc(24px + var(--safe-bottom));
}

/* AMBIENT BG */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb-blur {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: orbDrift 28s var(--ease) infinite alternate;
}
.orb-blur.o1 { top: -8%; left: -10%; width: 380px; height: 380px; background: radial-gradient(circle, #3a4598, transparent 70%); }
.orb-blur.o2 { bottom: 5%; right: -8%; width: 480px; height: 480px; background: radial-gradient(circle, #8b6dbb, transparent 70%); animation-delay: -8s; opacity: 0.30; }
.orb-blur.o3 { top: 35%; right: 30%; width: 280px; height: 280px; background: radial-gradient(circle, #d4a64a, transparent 70%); opacity: 0.14; animation-delay: -14s; }

@keyframes orbDrift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(60px, -40px) scale(1.18); }
}

.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(rgba(212,166,74,0.025) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 1px;
  mix-blend-mode: overlay;
  opacity: 0.55;
}

/* STAR FIELD */
.starfield { position: absolute; inset: 0; pointer-events: none; }
.star {
  position: absolute;
  width: var(--sz, 2px);
  height: var(--sz, 2px);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 0 var(--g, 6px) rgba(243, 196, 95, 0.55), 0 0 calc(var(--g, 6px) * 2) rgba(184, 196, 220, 0.20);
  opacity: var(--op, 0.7);
  animation: twinkle var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: var(--op, 0.7); transform: scale(1); }
  50% { opacity: calc(var(--op, 0.7) * 0.3); transform: scale(0.7); }
}

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 18px 12px;
  background: linear-gradient(180deg, rgba(5,7,23,0.88), rgba(5,7,23,0.55) 60%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.brand .mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212,166,74,0.22), rgba(91,106,196,0.10));
  color: var(--gold-hi);
  box-shadow: inset 0 0 0 1px rgba(243,196,95,0.28), 0 0 22px rgba(212,166,74,0.18);
}
.brand .mark svg { width: 22px; height: 22px; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: rgba(10, 14, 31, 0.55);
  color: var(--cream);
  border-radius: 12px;
  cursor: pointer;
  transition: transform .25s var(--spring), background .2s var(--ease), border-color .2s var(--ease);
  backdrop-filter: blur(8px);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(30,39,70,0.70); border-color: var(--border-hi); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.94); }

.install-btn {
  height: 38px;
  padding: 0 14px;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--bg-0);
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .25s var(--spring), box-shadow .2s var(--ease);
  box-shadow: 0 6px 20px rgba(212,166,74,0.32);
}
.install-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(212,166,74,0.42); }
.install-btn.hidden { display: none; }

/* MAIN */
main {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 4px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* HERO */
.hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url(hero_bg.png) center/cover no-repeat;
  filter: saturate(1.05) contrast(1.02);
  z-index: -2;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(5,7,23,0.85) 0%, rgba(5,7,23,0.4) 50%, rgba(5,7,23,0.65) 100%),
    radial-gradient(ellipse 70% 50% at 15% 90%, rgba(91,106,196,0.18), transparent 70%);
  z-index: -1;
}
.hero-content {
  padding: 26px 24px 24px;
  width: 100%;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: rgba(243,196,95,0.10);
  color: var(--gold-hi);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(243,196,95,0.22);
  backdrop-filter: blur(6px);
}
.hero-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-hi);
  box-shadow: 0 0 8px var(--gold-hi);
  animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.7); } }

.hero-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 900;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--cream);
  margin: 14px 0 10px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.6);
}
.hero-title em.italic {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--gold-hi);
  font-size: 1.05em;
  letter-spacing: 0;
}
.hero-sub {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-mute);
  max-width: 480px;
  margin: 0 0 18px;
}
.hero-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 20px;
  font-weight: 500;
  color: var(--cream);
  letter-spacing: -0.01em;
}
.meta-num small { font-size: 12px; color: var(--text-mute); margin-inline-start: 4px; }
.meta-lbl {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.meta-divider { width: 1px; height: 28px; background: rgba(244,234,208,0.14); }

/* GLASS CARDS */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-1);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.section-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--cream);
  margin: 0;
  letter-spacing: -0.01em;
}
.section-sub {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 2px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(243,196,95,0.10);
  color: var(--gold-hi);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(243,196,95,0.20);
}
.chip.moon { background: rgba(184,196,220,0.10); color: var(--moonlight); border-color: rgba(184,196,220,0.22); }
.chip.nebula { background: rgba(139,109,187,0.14); color: #cdb4ec; border-color: rgba(139,109,187,0.28); }

/* TONIGHT GRID */
.tonight-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .tonight-grid { grid-template-columns: 1fr; }
}

.moon-card {
  position: relative;
  padding: 22px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 280px;
}
.moon-vis {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 6px 0 4px;
  filter: drop-shadow(0 0 36px rgba(184,196,220,0.18));
}
.moon-vis svg { width: 100%; height: 100%; display: block; }
.moon-disc {
  fill: url(#moonGrad);
}
.moon-shadow {
  fill: rgba(5, 7, 23, 0.92);
  transition: transform 1s var(--ease);
}
.moon-craters {
  fill: rgba(5, 7, 23, 0.16);
}
.moon-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--moonlight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.moon-phase {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 21px;
  color: var(--cream);
  letter-spacing: -0.01em;
}
.moon-illum {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--gold-hi);
}

.window-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}
.window-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: rgba(10, 14, 31, 0.45);
  border: 1px solid var(--border-cool);
}
.window-stat .lbl {
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}
.window-stat .val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  color: var(--cream);
  font-weight: 500;
}
.window-stat .val.gold { color: var(--gold-hi); }
.window-stat .val.moon { color: var(--moonlight); }
.window-stat .val small { color: var(--text-mute); font-size: 11px; margin-inline-start: 4px; font-family: 'Heebo', sans-serif; }

.quality-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.quality-bar {
  flex: 1;
  height: 8px;
  border-radius: var(--r-pill);
  background: rgba(10,14,31,0.6);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-cool);
}
.quality-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-hi));
  transition: width 0.6s var(--spring);
  box-shadow: 0 0 8px rgba(243,196,95,0.4);
}
.quality-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--gold-hi);
  font-weight: 500;
  min-width: 38px;
  text-align: end;
}

/* FEATURED CONSTELLATION */
.featured-const {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 18px;
  align-items: center;
}
.const-map {
  width: 160px;
  height: 140px;
  flex-shrink: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(91,106,196,0.16), transparent 70%);
  border-radius: var(--r-md);
  border: 1px solid var(--border-cool);
  position: relative;
}
.const-map svg { width: 100%; height: 100%; }
.const-map .c-line { stroke: rgba(212,166,74,0.45); stroke-width: 1; fill: none; stroke-dasharray: 2 3; }
.const-map .c-star { fill: var(--cream); }
.const-map .c-star-bright { fill: var(--gold-hi); filter: drop-shadow(0 0 4px var(--gold-hi)); }

.const-info { display: flex; flex-direction: column; gap: 8px; }
.const-info .ttl {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 22px;
  color: var(--cream);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.const-info .ttl em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 14px;
  font-weight: 400;
  color: var(--gold-hi);
}
.const-info .desc {
  font-size: 13.5px;
  color: var(--text-mute);
  line-height: 1.55;
}
.const-info .stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.const-info .stats span { font-size: 12px; color: var(--text-mute); }
.const-info .stats b { color: var(--cream); font-family: 'IBM Plex Mono', monospace; font-weight: 500; margin-inline-start: 4px; }

@media (max-width: 540px) {
  .featured-const { grid-template-columns: 1fr; }
  .const-map { width: 100%; height: 160px; }
}

/* ACTION ROW */
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(10, 14, 31, 0.55);
  color: var(--cream);
  cursor: pointer;
  transition: transform .22s var(--spring), background .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: rgba(30,39,70,0.70); border-color: var(--border-hi); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  color: var(--bg-0);
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  border: none;
  box-shadow: 0 6px 20px rgba(212,166,74,0.32);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(212,166,74,0.42); }
.btn.ghost { background: transparent; }
.btn svg { width: 16px; height: 16px; }

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 540px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  padding: 14px;
  border-radius: var(--r-md);
  background: rgba(10, 14, 31, 0.45);
  border: 1px solid var(--border-cool);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: start;
  transition: transform .25s var(--spring);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-hi); }
.stat-card .lbl {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.stat-card .val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  color: var(--cream);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.stat-card .val small { font-size: 11px; color: var(--text-mute); margin-inline-start: 4px; font-family: 'Heebo', sans-serif; }
.stat-card .icon { color: var(--gold-hi); margin-bottom: 4px; }
.stat-card .icon svg { width: 20px; height: 20px; }

/* MONTH CHART */
.month-chart {
  width: 100%;
  height: 140px;
  margin-top: 6px;
}
.month-chart .bar { fill: url(#barGrad); transition: opacity .25s var(--ease); }
.month-chart .bar:hover { opacity: 0.85; }
.month-chart .axis { stroke: rgba(244,234,208,0.10); stroke-width: 1; }
.month-chart .label { fill: var(--text-mute); font-size: 9px; font-family: 'IBM Plex Mono', monospace; }
.month-chart .area { fill: url(#areaGrad); }
.month-chart .line { stroke: var(--gold-hi); stroke-width: 1.5; fill: none; }

/* LUNAR CALENDAR */
.lunar-cal {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 5px;
  margin-top: 6px;
}
@media (max-width: 540px) {
  .lunar-cal { grid-template-columns: repeat(10, 1fr); }
}
.lunar-day {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(10,14,31,0.6);
  border: 1px solid rgba(184,196,220,0.10);
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .2s var(--spring), border-color .2s var(--ease);
}
.lunar-day:hover { transform: scale(1.18); border-color: var(--border-hi); z-index: 2; }
.lunar-day.today { border-color: var(--gold-hi); box-shadow: 0 0 0 2px rgba(243,196,95,0.18), 0 0 12px rgba(243,196,95,0.25); }
.lunar-day .ld-moon {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pearl), var(--moonlight));
  box-shadow: inset -1px -1px 2px rgba(0,0,0,0.2);
}
.lunar-day .ld-shadow {
  position: absolute;
  border-radius: 50%;
  background: var(--bg-1);
  box-shadow: inset 0 0 2px rgba(0,0,0,0.4);
}
.lunar-day .ld-date {
  position: absolute;
  bottom: -16px;
  font-size: 9px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-dim);
}

/* ATLAS LIST */
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.atlas-card {
  position: relative;
  padding: 14px;
  border-radius: var(--r-md);
  background: rgba(10, 14, 31, 0.45);
  border: 1px solid var(--border-cool);
  cursor: pointer;
  transition: transform .25s var(--spring), border-color .2s var(--ease);
  overflow: hidden;
}
.atlas-card:hover { transform: translateY(-3px); border-color: var(--border-hi); }
.atlas-card .ac-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  gap: 8px;
}
.atlas-card .name {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 17px;
  color: var(--cream);
  letter-spacing: -0.01em;
}
.atlas-card .latin {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--gold-hi);
}
.atlas-card .desc { font-size: 12.5px; color: var(--text-mute); line-height: 1.5; }
.atlas-card .row {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-mute);
}
.atlas-card .row b { color: var(--cream); font-family: 'IBM Plex Mono', monospace; font-weight: 500; margin-inline-start: 4px; }
.atlas-card .mini-map {
  position: absolute;
  inset: auto 8px 8px auto;
  width: 60px;
  height: 50px;
  opacity: 0.65;
  pointer-events: none;
}
.atlas-card .mini-map circle { fill: var(--cream); }
.atlas-card .mini-map line { stroke: rgba(212,166,74,0.4); stroke-width: 0.6; stroke-dasharray: 1 1.5; fill: none; }
.atlas-card.visible-now::before {
  content: '';
  position: absolute;
  top: 8px; right: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold-hi);
  box-shadow: 0 0 6px var(--gold-hi);
  animation: pulse 2s var(--ease) infinite;
}

/* HEATMAP */
.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-width: 220px;
}
.hm-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgba(184,196,220,0.06);
  position: relative;
  transition: transform .15s var(--ease);
}
.hm-cell.l1 { background: rgba(212,166,74,0.18); }
.hm-cell.l2 { background: rgba(212,166,74,0.35); }
.hm-cell.l3 { background: rgba(243,196,95,0.55); box-shadow: 0 0 4px rgba(243,196,95,0.25); }
.hm-cell.l4 { background: var(--gold-hi); box-shadow: 0 0 8px rgba(243,196,95,0.5); }
.hm-cell:hover { transform: scale(1.4); z-index: 2; }

/* LIST */
.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(10, 14, 31, 0.45);
  border: 1px solid var(--border-cool);
  align-items: center;
  transition: transform .2s var(--spring), border-color .2s var(--ease);
  cursor: pointer;
}
.log-row:hover { transform: translateX(-3px); border-color: var(--border-hi); }
[dir="rtl"] .log-row:hover { transform: translateX(3px); }
.log-row .ico {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(212,166,74,0.16), rgba(91,106,196,0.10));
  color: var(--gold-hi);
}
.log-row .ico svg { width: 18px; height: 18px; }
.log-row .obj {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 15px;
  color: var(--cream);
}
.log-row .sub { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.log-row .when {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--gold-hi);
  text-align: end;
}
.log-row .when small { display: block; color: var(--text-mute); font-family: 'Heebo'; font-size: 10px; margin-top: 2px; }

/* WISHLIST */
.wish-list { display: flex; flex-direction: column; gap: 8px; }
.wish-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(10, 14, 31, 0.45);
  border: 1px solid var(--border-cool);
  align-items: center;
  transition: border-color .2s var(--ease);
}
.wish-row.caught { opacity: 0.55; }
.wish-row.caught .name { text-decoration: line-through; }
.wish-row .meta { display: flex; flex-direction: column; gap: 2px; }
.wish-row .name { font-family: 'Frank Ruhl Libre', serif; font-size: 15px; color: var(--cream); }
.wish-row .when { font-size: 11px; color: var(--text-mute); display: flex; gap: 8px; align-items: center; }
.wish-row .countdown {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--gold-hi);
  font-weight: 500;
}
.wish-row .ck-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border-hi);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--gold-hi);
  transition: all .2s var(--ease);
}
.wish-row.caught .ck-btn { background: var(--gold); color: var(--bg-0); border-color: var(--gold); }
.wish-row .ck-btn svg { width: 16px; height: 16px; }

/* FAB */
.fab {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  inset-inline-end: 22px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  color: var(--bg-0);
  font-size: 30px;
  font-weight: 300;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 60;
  box-shadow: 0 12px 28px rgba(212,166,74,0.4), 0 0 0 1px rgba(243,196,95,0.4);
  transition: transform .25s var(--spring);
}
.fab:hover { transform: translateY(-3px) rotate(90deg); }
.fab:active { transform: scale(0.93); }
.fab::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243,196,95,0.4), transparent 70%);
  z-index: -1;
  filter: blur(8px);
  animation: pulseFab 3s var(--ease) infinite;
}
@keyframes pulseFab { 0%,100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 0.9; transform: scale(1.15); } }

/* SHEET / MODAL */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 23, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  z-index: 101;
  inset-inline: 0;
  bottom: 0;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--border-hi);
  padding: 20px 22px calc(28px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform .35s var(--spring);
  box-shadow: 0 -30px 80px rgba(0,0,0,0.6);
}
.sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 44px; height: 4px;
  border-radius: 2px;
  background: rgba(244,234,208,0.18);
  margin: -8px auto 14px;
}
.sheet h2 {
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--cream);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.sheet h2 em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--gold-hi);
  font-size: 0.7em;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: rgba(10,14,31,0.55);
  border: 1px solid var(--border-cool);
  color: var(--text);
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
  outline: none;
}
.field textarea { min-height: 80px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold-hi); background: rgba(20,27,52,0.7); box-shadow: 0 0 0 3px rgba(243,196,95,0.10); }
.field .hint { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.btn-row { display: flex; gap: 10px; margin-top: 10px; }
.btn-row .btn { flex: 1; }

.seg {
  display: inline-flex;
  padding: 3px;
  background: rgba(10,14,31,0.55);
  border-radius: var(--r-pill);
  border: 1px solid var(--border-cool);
  gap: 2px;
}
.seg button {
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--text-mute);
  font-size: 12px;
  font-weight: 500;
  font-family: 'Heebo';
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.seg button.active {
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  color: var(--bg-0);
  box-shadow: 0 2px 8px rgba(212,166,74,0.3);
}

.palette-row { display: flex; gap: 8px; flex-wrap: wrap; }
.palette-row button {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: rgba(10,14,31,0.55);
  border: 1px solid var(--border-cool);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.palette-row button .swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold);
  border: 1px solid rgba(255,255,255,0.12);
}
.palette-row button.active {
  border-color: var(--gold-hi);
  background: rgba(243,196,95,0.10);
  color: var(--cream);
}

/* EMPTY */
.empty {
  text-align: center;
  padding: 32px 18px;
  color: var(--text-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty svg { width: 84px; height: 84px; color: var(--gold-hi); opacity: 0.7; margin-bottom: 4px; }
.empty .title { font-family: 'Frank Ruhl Libre', serif; font-size: 18px; color: var(--cream); }
.empty .sub { font-size: 13px; max-width: 280px; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 100px;
  inset-inline: 22px;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-1));
  color: var(--cream);
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-hi);
  box-shadow: var(--shadow-2);
  z-index: 110;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity .25s var(--ease), transform .25s var(--spring);
  max-width: 460px;
  margin: 0 auto;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* About */
.about-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-mute);
}
.about-body p { margin: 0 0 12px; }
.about-body strong { color: var(--cream); font-weight: 600; }
.about-body em { color: var(--gold-hi); font-style: normal; font-family: 'IBM Plex Mono', monospace; font-size: 0.92em; }
.about-feat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
.about-feat .feat {
  padding: 12px;
  border-radius: var(--r-md);
  background: rgba(10,14,31,0.45);
  border: 1px solid var(--border-cool);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.about-feat .feat .ico { color: var(--gold-hi); flex-shrink: 0; }
.about-feat .feat .ico svg { width: 18px; height: 18px; }
.about-feat .feat strong { display: block; color: var(--cream); font-size: 13px; margin-bottom: 2px; font-family: 'Heebo'; }
.about-feat .feat span { font-size: 12px; color: var(--text-mute); }
@media (max-width: 540px) { .about-feat { grid-template-columns: 1fr; } }

.foot {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-cool);
}

/* SPARKLINE */
.sparkline {
  width: 100%;
  height: 36px;
  margin-top: 4px;
}
.sparkline path { fill: none; stroke: var(--gold-hi); stroke-width: 1.5; }
.sparkline path.area { fill: url(#sparkArea); stroke: none; }

/* RESPONSIVE */
@media (max-width: 540px) {
  .hero { min-height: 280px; }
  .hero-content { padding: 20px 18px 18px; }
  .glass { padding: 16px; }
  main { padding: 4px 14px 0; gap: 14px; }
  .action-row { flex-direction: column; }
  .action-row .btn { flex: 1; }
  .fab { width: 56px; height: 56px; bottom: 18px; inset-inline-end: 18px; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 28px; }
  .stats-grid .stat-card .val { font-size: 18px; }
}

.hidden { display: none !important; }
