/* ============================================================================
   Hatchdex — « L'Heure Aurore ». Design system v2.
   Cozy · magique · game-feel premium. Mobile-first. Sprites pixel inchangés.
   ============================================================================ */

:root {
  /* — Fonds (profond → proche) — */
  --bg-void: #0C0A17; --bg: #120F20; --bg-sky: #233056; --bg-aurora: #16213A; --bg-ground: #0F0B18;
  /* — Surfaces — */
  --surface: #1E1838; --surface-2: #271F48; --surface-3: #322752;
  --glass: rgba(34,27,64,0.55); --glass-border: rgba(180,160,255,0.14); --glass-hi: rgba(255,255,255,0.06);
  --line: #352C5E; --line-soft: rgba(255,255,255,0.06); --line-lit: rgba(255,217,138,0.14);
  /* — Encre — */
  --ink: #F3EFFF; --ink-dim: #C3BBE6; --muted: #928AB8; --ink-faint: #5C557E;
  /* — Accents (ambre = chaleur/action) — */
  --amber: #FFD486; --amber-bright: #FFE6AD; --amber-deep: #F4A73C; --amber-shadow: #B9742A; --amber-ink: #3A2208;
  --warm-glow: #FFC56B; --blush: #FF9BB0; --blush-deep: #C25C78; --leaf: #7EE0A0;
  /* — Aurore (magie) — */
  --aurora-teal: #7AF2D0; --aurora-blue: #6CA8FF; --aurora-violet: #9B8CFF; --aurora-rose: #FF8AD8; --cosmos: #5B8CFF;
  /* — États — */
  --ok: #7EE0A0; --warn: #FFC06B; --danger: #FF8FA3; --focus: #7AF2D0;
  /* — Gradients signature — */
  --sky: radial-gradient(1400px 760px at 50% -12%, var(--bg-sky) 0%, var(--bg-aurora) 28%, var(--bg) 62%, var(--bg-void) 100%);
  --halo-warm: radial-gradient(60% 60% at 50% 44%, rgba(255,197,107,0.32), rgba(255,197,107,0) 70%);
  --aurora-ribbon: linear-gradient(100deg, #7AF2D0 0%, #9B8CFF 45%, #FF8AD8 100%);
  --grad-feed: linear-gradient(180deg, #FFE6AD 0%, #FFD486 42%, #F4A73C 100%);
  --grad-step-on: linear-gradient(90deg, #FF9BB0, #FFD486);
  --grad-vita: linear-gradient(90deg, #7EE0A0, #B6F0A0);
  --grad-gold: linear-gradient(135deg, #FFE9B8, #FFD486 45%, #E0A93B);
  /* — Raretés (--rc clé, --rc-glow lueur, --rc-ink texte, --rc-aura fond) — */
  --r-commune: #A8B4BF; --r-peu_commune: #74C98A; --r-rare: #5AA0E6; --r-epique: #B884E6; --r-legendaire: #F0C24A;
  /* — Rayons / ombres — */
  --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(0,0,0,.4); --sh-2: 0 6px 20px rgba(0,0,0,.44); --sh-float: 0 14px 40px rgba(0,0,0,.56);
  /* — Easings & durées — */
  --ease-soft: cubic-bezier(.4,0,.2,1); --ease-out-cozy: cubic-bezier(.22,1,.36,1);
  --ease-back: cubic-bezier(.34,1.56,.64,1); --ease-spring: cubic-bezier(.2,1.3,.4,1); --ease-elastic: cubic-bezier(.5,1.8,.4,.9);
  --t-fast: 100ms; --t-base: 220ms; --t-mid: 480ms; --t-slow: 700ms;
  /* — Échelle typo (fluide) — */
  --fs-300: .8125rem; --fs-400: 1rem; --fs-500: clamp(1.06rem,1rem + .4vw,1.2rem);
  --fs-600: clamp(1.3rem,1.15rem + .7vw,1.6rem); --fs-700: clamp(1.6rem,1.25rem + 1.6vw,2.2rem);
  --fs-display: clamp(1.85rem,1.3rem + 2.6vw,2.6rem); --fs-hero: clamp(2.6rem,1.8rem + 4vw,3.8rem);
  --maxw: 760px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Nunito', -apple-system, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); font-size: var(--fs-400); line-height: 1.6;
  color: var(--ink); background: var(--bg); background-image: var(--sky); background-repeat: no-repeat;
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-optical-sizing: auto; letter-spacing: -0.01em; line-height: 1.16; margin: 0 0 .4em; }
h1 { font-size: var(--fs-700); font-weight: 700; }
h2 { font-size: var(--fs-600); font-weight: 600; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(122,242,208,.28); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sprite, svg.sprite { image-rendering: pixelated; image-rendering: crisp-edges; }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums lining-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 8px; top: 8px; background: var(--amber); color: var(--amber-ink); padding: 6px 10px; border-radius: 8px; z-index: 80; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Verre & panneaux ---------- */
.glass { background: var(--glass); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-1); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { -webkit-backdrop-filter: blur(14px) saturate(130%); backdrop-filter: blur(14px) saturate(130%); }
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.panel--lit { box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-1); border-color: var(--line-lit); }
.kicker, .hk { font: 700 .72rem/1 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--amber); }

/* ---------- Header / footer ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 16px; position: sticky; top: 0; z-index: 40;
  background: var(--glass); border-bottom: 1px solid var(--glass-border);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header { -webkit-backdrop-filter: blur(14px) saturate(130%); backdrop-filter: blur(14px) saturate(130%); }
}
.brand { font-family: var(--serif); font-weight: 700; font-style: italic; font-size: 1.3rem; color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.brand-egg { font-style: normal; filter: drop-shadow(0 0 6px var(--warm-glow)); animation: bob 6s var(--ease-soft) infinite; }
.site-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.site-nav a { color: var(--ink-dim); padding: 7px 11px; border-radius: var(--r-pill); font: 600 .92rem var(--sans); transition: background var(--t-base), color var(--t-base); }
.site-nav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--amber); }
.site-nav .lang-toggle { color: var(--amber); border: 1px solid var(--line); font-weight: 800; }
.site-nav .lang-toggle:hover { border-color: var(--amber); }

main { max-width: var(--maxw); margin: 0 auto; padding: 16px 16px 56px; animation: pagein .4s var(--ease-out-cozy); }
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } }

.site-footer { max-width: var(--maxw); margin: 0 auto; padding: 30px 16px 56px; color: var(--muted); border-top: 1px solid var(--line); font-size: var(--fs-300); }
.site-footer a { color: var(--ink-dim); }
.foot-tag { color: var(--ink-dim); font-family: var(--serif); font-style: italic; font-size: 1rem; }
.foot-links { margin: 6px 0; }

/* ============================================================================
   ÉCRAN DE L'ŒUF (la star)
   ============================================================================ */
.egg-screen { display: flex; flex-direction: column; gap: 16px; --growth: 0; }

.live-strip { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; border-radius: var(--r-pill); padding: 7px 14px; font-size: .86rem; color: var(--ink-dim);
  background: var(--glass); border: 1px solid var(--glass-border); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .chip { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); } }
.chip b { color: var(--ink); font-weight: 800; }
.chip-ico { flex: 0 0 auto; display: block; }
.online-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 10px var(--leaf); animation: pulse 2.4s infinite; }

/* — La scène en profondeur — */
.egg-stage { position: relative; height: clamp(300px, 52vh, 440px); margin: 2px 0; display: grid; place-items: center; isolation: isolate; }
.scene-sky { position: absolute; inset: -16px -16px 0; border-radius: var(--r-xl); overflow: hidden; z-index: 0;
  background: radial-gradient(120% 90% at 50% 12%, var(--bg-sky) 0%, var(--bg-aurora) 34%, var(--bg) 72%, var(--bg-void) 100%); }
.scene-sky .stars { position: absolute; inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, #fff8 50%, transparent),
    radial-gradient(1.4px 1.4px at 75% 22%, #fff6 50%, transparent),
    radial-gradient(1px 1px at 40% 60%, #fff5 50%, transparent),
    radial-gradient(1.6px 1.6px at 88% 50%, #fff7 50%, transparent),
    radial-gradient(1px 1px at 60% 18%, #cfe6ff8c 50%, transparent),
    radial-gradient(1.2px 1.2px at 10% 70%, #fff5 50%, transparent),
    radial-gradient(1px 1px at 30% 12%, #fff6 50%, transparent),
    radial-gradient(1.3px 1.3px at 92% 78%, #ffe7c08c 50%, transparent);
  animation: twinkle 6s ease-in-out infinite; }
.scene-sky .aurora { position: absolute; inset: -30% -20% auto; height: 70%; background: var(--aurora-ribbon);
  filter: blur(46px); opacity: calc(.12 + var(--growth) * .12); transform: skewY(-8deg); animation: auroraDrift 28s ease-in-out infinite; mix-blend-mode: screen; }

.egg-halo { position: absolute; z-index: 1; width: min(78vw, 360px); aspect-ratio: 1; border-radius: 50%;
  background: var(--halo-warm); opacity: calc(.7 + var(--growth) * .3); animation: haloPulse 5s var(--ease-soft) infinite; transform: translateY(-2%); }
.egg-heart { position: absolute; z-index: 1; width: 120px; height: 120px; border-radius: 50%; transform: translateY(-4%);
  background: radial-gradient(circle, rgba(255,197,107,.55), transparent 65%); mix-blend-mode: screen; animation: heartbeat 4s ease-in-out infinite; }
.egg-nest { position: absolute; z-index: 1; bottom: 11%; width: min(56vw, 220px); height: 46px;
  background: radial-gradient(60% 100% at 50% 0%, rgba(255,197,107,.16), transparent 72%); }
.egg-nest::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 64%; height: 16px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); filter: blur(5px); animation: nestShadow 5s var(--ease-soft) infinite; }

.egg { position: relative; z-index: 2; line-height: 0; animation: breath 5s var(--ease-soft) infinite;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.45)) drop-shadow(0 0 14px var(--warm-glow)); }
.egg svg { width: min(60vw, 248px); height: auto; }
.egg.fed { animation: eggFed .55s var(--ease-back); }
.egg-screen.egg-fragile .scene-sky, .egg-screen.egg-hibernation .scene-sky { filter: saturate(.5) brightness(.82); }
.egg-screen.egg-fragile .egg-halo, .egg-screen.egg-hibernation .egg-halo { background: radial-gradient(60% 60% at 50% 44%, rgba(120,160,220,.3), transparent 70%); }
.egg-screen.egg-fragile .egg-heart, .egg-screen.egg-hibernation .egg-heart { opacity: .4; }

/* lucioles ambiantes + cœurs communautaires */
.fireflies { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fireflies i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--amber-bright);
  box-shadow: 0 0 8px var(--amber-bright); opacity: .0; animation: firefly 9s ease-in-out infinite; }
.fireflies i:nth-child(1){ left: 18%; top: 60%; animation-delay: 0s; }
.fireflies i:nth-child(2){ left: 76%; top: 40%; animation-delay: 1.6s; background: var(--aurora-teal); box-shadow: 0 0 8px var(--aurora-teal); }
.fireflies i:nth-child(3){ left: 50%; top: 72%; animation-delay: 3.1s; }
.fireflies i:nth-child(4){ left: 30%; top: 32%; animation-delay: 4.4s; background: var(--blush); box-shadow: 0 0 8px var(--blush); }
.fireflies i:nth-child(5){ left: 84%; top: 66%; animation-delay: 5.8s; }
.fireflies i:nth-child(6){ left: 62%; top: 24%; animation-delay: 7s; background: var(--aurora-teal); box-shadow: 0 0 8px var(--aurora-teal); }
.float-plus { position: absolute; z-index: 5; left: 50%; top: 46%; transform: translateX(-50%); font-weight: 800; color: var(--amber-bright);
  text-shadow: 0 0 8px var(--warm-glow); pointer-events: none; animation: floatPlus .95s var(--ease-out-cozy) forwards; font-size: .95rem; }
.ripple { position: absolute; z-index: 4; left: 50%; top: 46%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  border: 2px solid var(--amber); pointer-events: none; animation: ripple .6s var(--ease-out-cozy) forwards; }

/* — Lecture étape / indices — */
.egg-readout { padding: 14px 16px; border-radius: var(--r-lg); text-align: center; }
.stage-line { font-size: 1rem; color: var(--ink-dim); }
.stage-line b { color: var(--amber); font-weight: 800; }
.stage-line .stage-word { font-family: var(--serif); font-style: italic; color: var(--ink); }
.stage-steps { display: flex; gap: 8px; justify-content: center; margin: 12px auto 8px; max-width: 340px; }
.stage-steps .step { position: relative; flex: 1; height: 11px; border-radius: var(--r-pill); background: rgba(0,0,0,.28); border: 1px solid var(--line); transition: background var(--t-mid), box-shadow var(--t-mid); }
.stage-steps .step.on { background: var(--grad-step-on); border-color: transparent; box-shadow: 0 0 10px var(--amber); }
.stage-steps .step.on:last-of-type, .stage-steps .step.cur { animation: stepPulse 2.5s ease-in-out infinite; }
.stage-steps .step.cur::after { content: ''; position: absolute; right: -3px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--amber-bright); }
.stage-hint { color: var(--ink-dim); font-family: var(--serif); font-style: italic; margin: 8px 0 0; }
.hints { list-style: none; padding: 0; margin: 12px auto 0; max-width: 440px; display: grid; gap: 7px; text-align: left; }
.hints li { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-md); padding: 9px 13px; font-size: .9rem; color: var(--ink-dim); }

/* — Bouton Nourrir — */
.feed-form { display: flex; justify-content: center; }
.feed-btn { position: relative; overflow: hidden; font: 800 1.25rem var(--sans); color: var(--amber-ink);
  background: var(--grad-feed); border: none; border-radius: 20px; padding: 16px 30px; width: 100%; max-width: 360px; cursor: pointer;
  box-shadow: 0 6px 0 var(--amber-shadow), 0 14px 28px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform var(--t-fast) var(--ease-soft), box-shadow var(--t-fast), filter var(--t-fast); }
.feed-btn .fb-label { display: inline-flex; align-items: center; gap: 9px; }
.feed-btn .fb-heart { display: inline-block; animation: heartTick 2.4s ease-in-out infinite; }
.feed-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  transform: translateX(-120%); animation: shimmer 5s ease-in-out infinite; pointer-events: none; }
.feed-btn:hover { filter: brightness(1.04); }
.feed-btn:active { transform: translateY(4px) scale(1.02, .96); box-shadow: 0 2px 0 var(--amber-shadow), 0 6px 12px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.5); }
.feed-btn.pop { animation: pop .42s var(--ease-back); }
.feed-btn.wobble { animation: wobble .3s ease; }
.feed-btn:disabled { background: var(--surface-2); color: var(--ink-dim); box-shadow: 0 4px 0 #1c1838, inset 0 1px 0 var(--glass-hi); cursor: default; filter: none; }
.feed-btn:disabled::after { display: none; }
.feed-btn.small { font-size: 1rem; padding: 10px 18px; width: auto; box-shadow: 0 4px 0 var(--amber-shadow), var(--sh-1); }
.feed-note { text-align: center; color: var(--muted); font-size: .85rem; margin: 0; }
.feed-note b { color: var(--ink-dim); }

/* Série quotidienne (streak) */
.streak-banner { display: flex; align-items: center; gap: 12px; justify-content: center; text-align: left;
  background: linear-gradient(180deg, #2a1d33, #241a2e); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; }
.streak-banner.lit { border-color: rgba(255,150,90,.38); background: linear-gradient(180deg, #3a2238, #2a1a2c); box-shadow: 0 0 18px rgba(255,140,60,.13); }
.streak-fire { font-size: 1.8rem; line-height: 1; filter: drop-shadow(0 0 8px #ff8a3a); }
.streak-banner.lit .streak-fire { animation: flicker 2.2s ease-in-out infinite; }
.streak-text { display: flex; flex-direction: column; }
.streak-main { font-weight: 800; color: var(--ink); }
.streak-main .streak-n { font-family: var(--serif); font-size: 1.35rem; color: var(--amber); }
.streak-rec { color: var(--muted); font-weight: 600; font-size: .85rem; }
.streak-sub { font-size: .82rem; color: var(--ink-dim); }
.streak-banner.cheer { animation: cheer .5s var(--ease-back); }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.1) rotate(2deg); } }
@keyframes cheer { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.streak-banner.danger { border-color: var(--warn); background: linear-gradient(180deg, #3a2a1a, #2a1e14); animation: dangerPulse 1.9s ease-in-out infinite; }
.streak-banner.danger .streak-sub { color: var(--warn); font-weight: 700; }
@keyframes dangerPulse { 0%,100% { box-shadow: 0 0 0 rgba(255,192,107,0); } 50% { box-shadow: 0 0 16px rgba(255,192,107,.3); } }

/* Recap d'éclosion (rattrapage du moment magique) */
.recap-banner { display: flex; align-items: center; gap: 10px; background: linear-gradient(180deg, #2a2348, #221b40); border: 1px solid var(--glass-border); border-radius: var(--r-md); padding: 11px 15px; color: var(--ink); text-decoration: none; animation: slidein .5s var(--ease-out-cozy); }
.recap-banner:hover { text-decoration: none; border-color: var(--amber); }
.recap-spark { font-size: 1.2rem; }
.recap-text b { color: var(--amber); }
.recap-text .badge { vertical-align: middle; }

/* Éclosion imminente (anticipation / FOMO) */
.imminent-banner { text-align: center; background: linear-gradient(180deg, #3a2a16, #2c2012); border: 1px solid var(--amber); border-radius: var(--r-md); padding: 11px 15px; color: var(--amber-bright); animation: imminentPulse 1.5s ease-in-out infinite; }
.imminent-banner b { color: #fff; }
@keyframes imminentPulse { 0%,100% { box-shadow: 0 0 0 rgba(255,212,134,0); } 50% { box-shadow: 0 0 18px rgba(255,212,134,.42); } }
.egg-screen.egg-imminent .egg { animation: breath 5s var(--ease-soft) infinite, tremor .36s ease-in-out infinite; }
.egg-screen.egg-imminent .egg-halo { opacity: 1; animation: haloPulse 2.2s var(--ease-soft) infinite; }
@keyframes tremor { 0%,100% { translate: 0 0; } 25% { translate: -1.5px 0; } 75% { translate: 1.5px 0; } }

/* Opt-in notifications */
.notify-row { display: flex; justify-content: center; }
.notify-btn { font: 700 .9rem var(--sans); cursor: pointer; background: var(--surface-2); color: var(--ink-dim); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 8px 16px; transition: color var(--t-base), border-color var(--t-base); }
.notify-btn:hover { color: var(--ink); border-color: var(--amber); }
.notify-btn.on { color: var(--leaf); border-color: rgba(126,224,160,.4); cursor: default; }
.notify-btn:disabled { cursor: default; opacity: .85; }

/* — Vitalité / objectif — */
.vitality { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.vita-head { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ink-dim); }
.vita-head .kicker { color: var(--amber); }
.vita-bar { position: relative; height: 11px; background: rgba(0,0,0,.3); border-radius: var(--r-pill); overflow: hidden; margin: 9px 0 4px; }
.vita-fill { height: 100%; background: var(--grad-vita); width: 0; transition: width var(--t-slow) var(--ease-out-cozy); position: relative; }
.vita-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent); transform: translateX(-100%); animation: shimmer 3.2s linear infinite; }
.vitality[data-state="fragile"] .vita-fill { background: linear-gradient(90deg, var(--warn), #ffd9a0); }
.vitality[data-state="hibernation"] .vita-fill { background: linear-gradient(90deg, var(--danger), #ffb0bb); }
.vita-state { font-size: .82rem; color: var(--muted); margin: 4px 0 0; }

.alert { background: linear-gradient(180deg, #3a2540, #2a1c33); border: 1px solid var(--blush); border-radius: var(--r-md); padding: 14px 16px; text-align: center; }
.alert p { margin: 0 0 10px; color: #ffd0da; font-weight: 700; }

/* — En direct / comment — */
.live-feed, .how { content-visibility: auto; contain-intrinsic-size: auto 240px; }
.live-feed h2, .how h2 { font-size: 1.05rem; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 7px; }
.feed-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.feed-list li { padding: 9px 13px; background: var(--glass); border: 1px solid var(--line-soft); border-radius: var(--r-md); font-size: .9rem; color: var(--ink-dim); }
.feed-list li b { color: var(--ink); }
.feed-list time { color: var(--muted); font-size: .78rem; }
.feed-list li.new { animation: slidein .45s var(--ease-out-cozy); }
.feed-empty { color: var(--muted); }
.how ol { padding-left: 1.2em; color: var(--ink-dim); } .how li { margin: 6px 0; }

/* ---------- Boutons partage ---------- */
.share-btn, .btn--blush { font: 800 1rem var(--sans); cursor: pointer; background: var(--blush); color: #2a1430; border: none; border-radius: var(--r-md); padding: 9px 18px; transition: transform var(--t-fast), filter var(--t-fast); }
.share-btn:hover { filter: brightness(1.06); } .share-btn:active { transform: scale(.97); }

/* ============================================================================
   OVERLAY D'ÉCLOSION (cérémonie)
   ============================================================================ */
.overlay { position: fixed; inset: 0; background: rgba(10,8,18,.92); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; animation: fadein .3s; }
.overlay[hidden] { display: none; }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .overlay { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); } }
.overlay-card { background: var(--surface-3); border: 1px solid var(--rc-glow, var(--line)); border-radius: var(--r-lg); padding: 22px 20px; max-width: 460px; width: 100%; text-align: center; box-shadow: var(--sh-float), 0 0 40px var(--rc-glow, transparent); animation: cardin .6s var(--ease-spring); position: relative; overflow: hidden; }
.overlay-card .reveal-sprite { display: inline-block; line-height: 0; animation: revealSpring .7s var(--ease-spring); }
.overlay-card .reveal-sprite svg { width: 150px; height: 150px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)) drop-shadow(0 0 16px var(--rc-glow, var(--warm-glow))); }
.overlay-card h2 { font-size: var(--fs-hero); margin: 8px 0 6px; animation: stamp .5s var(--ease-back) .15s both; }
.overlay-card .ov-lore { color: var(--ink-dim); font-style: italic; }
.overlay-card .ov-stat { color: var(--ink); margin: 8px 0; }
.overlay-card .ov-foot { color: var(--muted); font-style: italic; font-size: .85rem; margin-top: 8px; }
.overlay-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.overlay-close { position: fixed; top: 14px; right: 16px; font-size: 2rem; background: none; border: none; color: #fff; cursor: pointer; z-index: 101; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 8px; border-radius: 2px; background: var(--rc, var(--amber)); animation: confetti 2.4s linear forwards; }

/* ============================================================================
   BADGES, CARTES, GRILLE
   ============================================================================ */
.badge { display: inline-block; font: 700 .74rem var(--sans); padding: 3px 10px; border-radius: var(--r-pill); }
.badge-rarity { color: #14101F; background: var(--rc, var(--r-commune)); }
.badge-rarity.rarity-epique, .badge-rarity.rarity-legendaire { box-shadow: 0 0 10px var(--rc-glow); }
.badge-family { background: var(--surface-2); color: var(--ink-dim); border: 1px solid var(--line); }
.rarity-commune { --rc: var(--r-commune); --rc-glow: rgba(168,180,191,.18); --rc-ink: #C4CDD4; --rc-aura: radial-gradient(closest-side, rgba(168,180,191,.10), transparent 70%); }
.rarity-peu_commune { --rc: var(--r-peu_commune); --rc-glow: rgba(116,201,138,.22); --rc-ink: #9BE0AC; --rc-aura: radial-gradient(closest-side, rgba(116,201,138,.16), transparent 70%); }
.rarity-rare { --rc: var(--r-rare); --rc-glow: rgba(90,160,230,.32); --rc-ink: #9FCBF2; --rc-aura: radial-gradient(closest-side, rgba(90,160,230,.22), transparent 72%); }
.rarity-epique { --rc: var(--r-epique); --rc-glow: rgba(184,132,230,.45); --rc-ink: #D6B6F0; --rc-aura: radial-gradient(closest-side, rgba(184,132,230,.26), transparent 72%); }
.rarity-legendaire { --rc: var(--r-legendaire); --rc-glow: rgba(240,194,74,.6); --rc-ink: #FBE08A; --rc-aura: radial-gradient(closest-side, rgba(240,194,74,.3), transparent 72%); }

.page-head { margin-bottom: 14px; }
.page-head h1 { margin: 0 0 4px; }
.lead { color: var(--ink-dim); margin: 0; font-size: var(--fs-500); }

.filters { display: grid; gap: 8px; margin: 14px 0 18px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-key { font: 700 .72rem var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 4px; }
.filter { background: var(--glass); border: 1px solid var(--glass-border); color: var(--ink-dim); padding: 6px 12px; border-radius: var(--r-pill); font-size: .84rem; transition: background var(--t-base), color var(--t-base); }
.filter:hover { background: var(--surface-2); text-decoration: none; }
.filter.active { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; content-visibility: auto; contain-intrinsic-size: auto 600px; }
.grid-sm { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.creature-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 10px; text-align: center; color: var(--ink); display: block; position: relative; overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.3); transition: transform var(--t-base) var(--ease-back), box-shadow var(--t-base), border-color var(--t-base); }
.creature-card::before { content: ''; position: absolute; inset: 0; background: var(--rc-aura); opacity: .5; pointer-events: none; }
.creature-card:hover { transform: translateY(-4px); border-color: var(--rc); box-shadow: 0 12px 26px rgba(0,0,0,.4), 0 0 18px var(--rc-glow); text-decoration: none; }
.creature-card.rarity-legendaire { border-color: var(--r-legendaire); }
.cc-sprite { position: relative; line-height: 0; margin-bottom: 8px; }
.cc-sprite svg { width: 84px; height: 84px; }
.cc-name { font-weight: 800; }
.cc-meta { margin-top: 6px; font-size: .8rem; color: var(--muted); display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; }
.cc-sub { position: relative; margin-top: 8px; font-size: .74rem; color: var(--muted); }
.creature-card.mystery { opacity: .8; } .mystery-egg { font-size: 3rem; }
.empty { color: var(--muted); text-align: center; padding: 34px 12px; font-size: var(--fs-500); }

/* ============================================================================
   LA PROMENADE (diorama)
   ============================================================================ */
.plaza { position: relative; height: 280px; margin: 8px 0 22px; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); isolation: isolate;
  background: linear-gradient(180deg, var(--bg-sky) 0%, #2a2348 30%, #241d3f 58%, #1b1630 100%); }
.plaza .p-stars { position: absolute; inset: 0; background-image:
  radial-gradient(1.3px 1.3px at 15% 20%, #fff7 50%, transparent), radial-gradient(1.2px 1.2px at 65% 14%, #fff6 50%, transparent),
  radial-gradient(1px 1px at 85% 28%, #fff5 50%, transparent), radial-gradient(1.4px 1.4px at 40% 24%, #ffe7c08c 50%, transparent),
  radial-gradient(1px 1px at 28% 10%, #fff6 50%, transparent); animation: twinkle 7s ease-in-out infinite; }
.plaza .p-aurora { position: absolute; top: -20%; left: -10%; right: -10%; height: 55%; background: var(--aurora-ribbon); filter: blur(44px); opacity: .14; mix-blend-mode: screen; animation: auroraDrift 40s ease-in-out infinite; }
.plaza .p-moon { position: absolute; right: 14%; top: 16%; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,197,107,.5), transparent 62%); }
.plaza .p-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(180deg, #27314A, #1A2236); box-shadow: inset 0 1px 0 var(--line-lit); -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%); mask-image: linear-gradient(180deg, transparent, #000 18%); }
.plaza .p-fireflies i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--amber-bright); box-shadow: 0 0 8px var(--amber-bright); animation: firefly 11s ease-in-out infinite; }
.plaza .p-fireflies i:nth-child(1){ left: 22%; bottom: 24%; } .plaza .p-fireflies i:nth-child(2){ left: 58%; bottom: 30%; animation-delay: 3s; background: var(--aurora-teal); box-shadow: 0 0 8px var(--aurora-teal); }
.plaza .p-fireflies i:nth-child(3){ left: 80%; bottom: 20%; animation-delay: 6s; } .plaza .p-fireflies i:nth-child(4){ left: 40%; bottom: 16%; animation-delay: 8s; background: var(--blush); box-shadow: 0 0 8px var(--blush); }
.walker { position: absolute; top: 0; left: 0; line-height: 0; will-change: transform; text-decoration: none; z-index: 2; --depth: .6; --shadow-scale: 1; opacity: calc(.74 + var(--depth) * .26); }
.walker svg { width: 52px; height: 52px; display: block; filter: drop-shadow(0 4px 3px rgba(0,0,0,.5)); transition: filter var(--t-base); }
.walker::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 60%; height: 11px; transform: translateX(-50%) scale(var(--shadow-scale)); background: radial-gradient(closest-side, rgba(0,0,0,.5), transparent); filter: blur(2px); }
.walker .wname { position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); background: var(--glass); border: 1px solid var(--glass-border); color: var(--ink); font-size: 11px; padding: 3px 8px; border-radius: var(--r-pill); white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .walker .wname { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); } }
.walker:hover .wname, .walker:focus .wname { opacity: 1; }
.walker.rarity-legendaire svg { filter: drop-shadow(0 0 7px var(--r-legendaire)) drop-shadow(0 4px 3px rgba(0,0,0,.5)); }

/* ============================================================================
   PAGE CRÉATURE
   ============================================================================ */
.breadcrumb { font-size: .84rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--ink-dim); }
.creature-hero { position: relative; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--sh-2), 0 0 30px var(--rc-glow); }
.creature-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 120% at 18% 30%, color-mix(in srgb, var(--rc) 12%, transparent), transparent 60%); pointer-events: none; }
.ch-sprite { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 188px; height: 188px; }
.ch-sprite .ch-aura { position: absolute; inset: 0; border-radius: 50%; background: var(--rc-aura); animation: haloPulse 5s var(--ease-soft) infinite; }
.ch-sprite svg { position: relative; width: 156px; height: 156px; filter: drop-shadow(0 8px 8px rgba(0,0,0,.5)) drop-shadow(0 0 14px var(--rc-glow)); animation: breath 4.5s var(--ease-soft) infinite; }
.ch-sprite .ch-pedestal { position: absolute; bottom: 6px; width: 64%; height: 16px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 40%, #0008), transparent); filter: blur(3px); }
.creature-page.rarity-legendaire .creature-hero { border-color: var(--r-legendaire); }
.ch-info { position: relative; flex: 1 1 220px; }
.ch-info h1 { margin: 0 0 8px; }
.ch-badges { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.ch-lore { color: var(--ink-dim); font-family: var(--serif); font-style: italic; font-size: var(--fs-500); }
.birth-stats, .lore-block, .related { margin-top: 24px; content-visibility: auto; contain-intrinsic-size: auto 200px; }
.birth-stats h2, .lore-block h2, .related h2 { font-size: 1.1rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0; }
.stats-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px; box-shadow: inset 0 1px 0 var(--glass-hi); }
.stats-grid dt { font: 700 .72rem var(--sans); text-transform: uppercase; letter-spacing: .04em; color: var(--amber); }
.stats-grid dd { margin: 5px 0 0; font-family: var(--serif); font-weight: 700; font-size: 1.4rem; }
.lore-block p { max-width: 64ch; color: var(--ink-dim); } .lore-block .muted { color: var(--muted); }

/* Dex / about / divers */
.dex-progress { font-size: var(--fs-500); color: var(--ink-dim); }
.notice { background: var(--glass); border: 1px dashed var(--glass-border); border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 16px; color: var(--ink-dim); font-size: .9rem; }
.prose { color: var(--ink-dim); } .prose h2 { color: var(--ink); margin-top: 26px; } .prose .cols { columns: 2; list-style: none; padding: 0; }
.error-page { text-align: center; padding: 50px 10px; }

/* Toasts */
.toast-wrap { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; width: max-content; max-width: 90vw; }
.toast { background: var(--glass); border: 1px solid var(--glass-border); color: var(--ink); padding: 10px 16px; border-radius: var(--r-md); box-shadow: var(--sh-float); font-size: .9rem; animation: toastin .35s var(--ease-out-cozy); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .toast { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); } }

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes breath { 0%,100% { transform: translateY(0) scale(1) rotate(-1deg); } 50% { transform: translateY(-6px) scale(1.015) rotate(1deg); } }
@keyframes eggFed { 0% { transform: scaleY(1); } 30% { transform: scaleY(.88) scaleX(1.06); } 60% { transform: scaleY(1.06) scaleX(.97); } 100% { transform: scale(1); } }
@keyframes haloPulse { 0%,100% { transform: scale(1); opacity: .82; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes heartbeat { 0%,18%,100% { transform: translateY(-4%) scale(1); opacity: .65; } 9% { transform: translateY(-4%) scale(1.14); opacity: 1; } 13% { transform: translateY(-4%) scale(1.04); opacity: .8; } }
@keyframes nestShadow { 0%,100% { transform: translateX(-50%) scale(1); opacity: .8; } 50% { transform: translateX(-50%) scale(.82); opacity: .55; } }
@keyframes twinkle { 0%,100% { opacity: .8; } 50% { opacity: .45; } }
@keyframes auroraDrift { 0%,100% { transform: skewY(-8deg) translateX(-6%); } 50% { transform: skewY(-5deg) translateX(6%); } }
@keyframes firefly { 0%,100% { opacity: 0; transform: translate(0,0); } 20% { opacity: .9; } 50% { opacity: .5; transform: translate(14px,-18px); } 80% { opacity: .8; transform: translate(-10px,-8px); } }
@keyframes shimmer { 0%,72% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes stepPulse { 0%,100% { box-shadow: 0 0 8px var(--amber); } 50% { box-shadow: 0 0 16px var(--amber-bright); } }
@keyframes pop { 0% { transform: scale(.94); } 48% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes wobble { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes heartTick { 0%,100% { transform: scale(1); } 14% { transform: scale(1.18); } 28% { transform: scale(1.02); } }
@keyframes floatPlus { 0% { opacity: 0; transform: translate(-50%, 0) scale(.8); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -64px) scale(1.05); } }
@keyframes ripple { 0% { opacity: .5; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes cardin { from { opacity: 0; transform: translateY(28px); } }
@keyframes revealSpring { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes stamp { 0% { transform: scale(1.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes confetti { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(460px) rotate(540deg); opacity: 0; } }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }
@keyframes countflash { 0% { color: var(--amber-bright); } 100% { color: var(--ink); } }
.count-flash { animation: countflash .4s var(--ease-soft); }

/* ============================================================================
   RESPONSIVE + REDUCED MOTION
   ============================================================================ */
@media (max-width: 480px) {
  .plaza { height: 220px; } .plaza .walker svg, .walker svg { width: 44px; height: 44px; }
  .cc-sprite svg { width: 74px; height: 74px; } .ch-sprite { width: 150px; height: 150px; } .ch-sprite svg { width: 124px; height: 124px; }
  .feed-btn { font-size: 1.15rem; } .prose .cols { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .egg, .egg-halo, .egg-heart, .scene-sky .stars, .scene-sky .aurora, .fireflies i, .feed-btn::after, .brand-egg { animation: none !important; }
  main { animation: none; }
}
