:root {
  --sky-top: #0b1f3a;
  --sky-mid: #163a5f;
  --sky-low: #2b5a7a;
  --ink: #eaf3fb;
  --muted: #9fb6cc;
  --card: rgba(10, 24, 41, 0.82);
  --line: rgba(150, 190, 225, 0.25);
  --ok: #34d17a;
  --ko: #e0655b;
  --accent: #ffd45e;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
}

/* ---------- Ciel & décor animé ---------- */
.sky {
  background: radial-gradient(120% 90% at 70% -10%, var(--sky-low), var(--sky-mid) 45%, var(--sky-top) 100%);
  min-height: 100vh;
  position: relative;
}
.scenery { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }

/* Couche interactive : au-dessus du quizz, seuls les eggs captent le clic */
.eggs { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
.eggs .egg { pointer-events: auto; cursor: pointer; transition: filter .2s, transform .2s; }
.eggs .egg:hover { filter: brightness(1.25) drop-shadow(0 0 8px rgba(255,212,94,.6)); transform: scale(1.08); }

.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 60% 20%, #fff, transparent),
    radial-gradient(1px 1px at 80% 40%, #fff, transparent),
    radial-gradient(1px 1px at 35% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 90% 60%, #fff, transparent),
    radial-gradient(1px 1px at 15% 85%, #fff, transparent);
  opacity: .55; animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .35 } to { opacity: .7 } }

.cloud {
  position: absolute; width: 120px; height: 40px; border-radius: 40px;
  background: rgba(220, 235, 250, 0.16); filter: blur(1px);
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: inherit; border-radius: 50%;
}
.cloud::before { width: 55px; height: 55px; top: -22px; left: 18px; }
.cloud::after { width: 40px; height: 40px; top: -14px; left: 60px; }
.c1 { top: 14%; left: -160px; animation: drift 46s linear infinite; }
.c2 { top: 32%; left: -160px; transform: scale(.7); animation: drift 66s linear infinite 8s; }
.c3 { top: 58%; left: -160px; transform: scale(1.2); animation: drift 80s linear infinite 20s; }
@keyframes drift { to { left: 115vw; } }

.beacon {
  position: absolute; right: 8%; top: 20%; width: 16px; height: 16px; border-radius: 50%;
  background: #ff5b5b; box-shadow: 0 0 12px 4px rgba(255,91,91,.6);
  animation: pulse 1.6s ease-in-out infinite;
}
/* zone de clic élargie autour des petits eggs */
.beacon::after { content: ""; position: absolute; inset: -18px; border-radius: 50%; }
@keyframes pulse { 0%,100% { opacity: .35; transform: scale(.8) } 50% { opacity: 1; transform: scale(1.2) } }

.windsock { position: absolute; left: 6%; bottom: 12%; font-size: 34px; animation: sway 3s ease-in-out infinite alternate; }
.windsock::after { content: ""; position: absolute; inset: -16px; }
@keyframes sway { from { transform: rotate(-12deg) } to { transform: rotate(12deg) } }

.radar {
  position: absolute; right: 6%; bottom: 10%; width: 92px; height: 92px; border-radius: 50%;
  border: 2px solid var(--line);
  background: repeating-radial-gradient(circle, transparent 0 14px, rgba(150,190,225,.12) 15px 16px);
  overflow: hidden;
}
.radar .sweep {
  position: absolute; inset: 0;
  background: conic-gradient(from 0deg, rgba(52,209,122,.55), transparent 70deg);
  animation: spin 3.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.moon {
  position: absolute; left: 8%; top: 12%; width: 62px; height: 62px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fdf6d8, #e7dfa8);
  box-shadow: 0 0 40px 8px rgba(253,246,216,.35), inset -10px -6px 0 rgba(0,0,0,.08);
}
.shooting-star {
  position: absolute; top: 16%; left: 60%; width: 120px; height: 2px;
  background: linear-gradient(90deg, transparent, #fff); border-radius: 2px;
  transform: rotate(-20deg); opacity: 0;
  animation: shoot 9s ease-in infinite; animation-delay: 4s;
}
@keyframes shoot {
  0%, 92% { opacity: 0; transform: translate(0,0) rotate(-20deg); }
  93% { opacity: 1; }
  100% { opacity: 0; transform: translate(-320px, 120px) rotate(-20deg); }
}

/* --- Sol : horizon, skyline, piste --- */
.ground { position: absolute; left: 0; right: 0; bottom: 0; height: 46vh; }
.skyline {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 220px;
  fill: #081524; opacity: .92;
}
.skyline .beacon-dot { fill: #ff5b5b; animation: pulse 1.6s ease-in-out infinite; }

.runway {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 62vw; max-width: 720px; height: 42vh;
  background: linear-gradient(to top, #33465a, #1c2836 78%, transparent);
  clip-path: polygon(16% 100%, 84% 100%, 55% 0, 45% 0);
  opacity: .8; transition: filter .5s;
}
.runway.cleared { filter: drop-shadow(0 0 26px rgba(52,209,122,.55)); }
.rwy-center {
  position: absolute; left: 50%; top: 4%; bottom: 0; width: 6px; transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, #f4e6b0 0 6%, transparent 6% 12%);
  opacity: .8;
}

.approach {
  position: absolute; left: 50%; bottom: 3vh; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 9px;
}
.approach .bar {
  width: 46px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25);
  transition: background .35s, box-shadow .35s;
}
.approach .bar:nth-child(2) { width: 40px; }
.approach .bar:nth-child(3) { width: 34px; }
.approach .bar:nth-child(4) { width: 28px; }
.approach .bar:nth-child(5) { width: 22px; }
.approach .bar.lit { background: #34d17a; box-shadow: 0 0 12px 2px rgba(52,209,122,.7); }

/* --- Horloge Zulu --- */
.zulu {
  position: fixed; top: 14px; right: 16px; z-index: 3; pointer-events: none;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 15px; letter-spacing: 2px; color: #9fe3c0;
  background: rgba(6,16,28,.6); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 10px; text-shadow: 0 0 8px rgba(52,209,122,.5);
}

/* --- Bandeau ATIS --- */
.atis {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; pointer-events: none;
  background: rgba(4,11,20,.9); border-top: 1px solid var(--line); overflow: hidden;
  height: 30px; display: flex; align-items: center;
}
.atis-track {
  white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; letter-spacing: 1px; color: #ffd45e;
  padding-left: 100%; animation: ticker 34s linear infinite;
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* --- Carte boarding-pass --- */
.pass { position: relative; overflow: hidden; }
.pass-strip {
  display: flex; justify-content: space-between; align-items: center;
  margin: -28px -26px 18px; padding: 12px 22px;
  background: linear-gradient(90deg, #1c4c6e, #245a7a);
  border-bottom: 2px dashed rgba(255,255,255,.25);
}
.pass-code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; letter-spacing: 2px; color: #cfeaff; }
.pass-tag { font-size: 11px; letter-spacing: 2px; font-weight: 700; color: #0b1f3a; background: var(--accent); padding: 3px 8px; border-radius: 4px; }
.pass::before, .pass::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: #0b1f3a; left: -11px; top: 48px;
}
.pass::after { left: auto; right: -11px; }
.barcode {
  height: 34px; margin: 18px -26px -28px; margin-top: 20px;
  background: repeating-linear-gradient(90deg, #dfe9f2 0 2px, transparent 2px 4px, #dfe9f2 4px 7px, transparent 7px 9px, #dfe9f2 9px 14px, transparent 14px 16px);
  opacity: .8;
}

.plane-track { position: absolute; top: 32%; left: 0; width: 100%; animation: cross 24s linear infinite; }
@keyframes cross { from { transform: translateX(-30vw) } to { transform: translateX(130vw) } }
.plane { font-size: 34px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.banner {
  font-size: 12px; letter-spacing: 1px; color: #0b1f3a; background: var(--accent);
  padding: 3px 10px; border-radius: 3px; transform: skewX(-8deg);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* ---------- Carte quizz ---------- */
/* pointer-events:none => les clics "à côté" de la carte atteignent les eggs derrière */
.quiz-wrap { position: relative; z-index: 2; display: grid; place-items: center; min-height: 100vh; padding: 24px; pointer-events: none; }
.quiz-card {
  width: 100%; max-width: 460px; background: var(--card); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 18px; padding: 28px 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45); pointer-events: auto;
}
.hello { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.quiz-card h1 { margin: 0 0 6px; font-size: 22px; }
.sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

.field { display: block; margin-bottom: 18px; }
.field .q { display: block; font-size: 14px; margin-bottom: 8px; }
.field .row { display: flex; align-items: center; gap: 10px; }
.field input {
  flex: 1; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: var(--ink); font-size: 16px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,212,94,.2); }
.field .status { width: 22px; font-weight: 700; font-size: 18px; text-align: center; }
.field.ok input { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(52,209,122,.18); }
.field.ok .status { color: var(--ok); }
.field.ko input { border-color: #e0655b; }
.field.ko .status { color: #e0655b; }
.hint-line { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: rgba(8,18,32,.95); border: 1px solid var(--line); color: var(--ink);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Overlay "autorisation accordée" ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(5,12,22,.7); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .35s;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.cleared-card { text-align: center; }
.cleared-card .big { font-size: 72px; animation: takeoff 1.4s ease forwards; }
.cleared-card p { font-size: 20px; margin-top: 10px; }
@keyframes takeoff { 0% { transform: translate(0,20px) rotate(0) } 100% { transform: translate(60px,-40px) rotate(-18deg) } }

/* ---------- Séquence de boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, #0d2748, #050d1a 70%);
  transition: opacity .6s; text-align: center;
}
.boot.done { opacity: 0; pointer-events: none; }
.boot-inner { max-width: 440px; padding: 24px; }
.boot-logo { font-size: 58px; animation: float 2.2s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-9px) } }
.boot-text { margin: 20px 0; font-size: 16px; letter-spacing: .4px; color: var(--ink); line-height: 1.5; }
.boot-bar { width: 220px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.14); margin: 0 auto; overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 0; background: var(--accent); animation: load 2.3s ease forwards; }
@keyframes load { to { width: 100% } }
.dots::after { content: ""; animation: dots 1.1s steps(1) infinite; }
@keyframes dots { 0% { content: "" } 25% { content: "." } 50% { content: ".." } 75% { content: "..." } }

/* ---------- Quizz bonus ---------- */
.fun { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.fun-label { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.fun-q { font-size: 14px; margin: 0 0 12px; }
.fun-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fun-opt {
  padding: 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05);
  color: var(--ink); font-size: 14px; cursor: pointer; transition: border-color .2s, background .2s, transform .1s;
}
.fun-opt:hover { border-color: var(--accent); }
.fun-opt:active { transform: scale(.97); }
.fun-opt.ok { border-color: var(--ok); background: rgba(52,209,122,.18); }
.fun-opt.ko { border-color: #e0655b; background: rgba(224,101,91,.15); }
.fun-feedback { min-height: 20px; margin: 12px 0 0; font-size: 14px; opacity: 0; transition: opacity .2s; }
.fun-feedback.show { opacity: 1; }
.fun-feedback.good { color: var(--ok); }
.fun-feedback.bad { color: #e6a15b; }

/* ---------- Score d'amour ---------- */
.love { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); text-align: center; }
.love-score { font-size: 14px; margin: 0 0 12px; color: var(--ink); }
.love-score b { color: var(--accent); font-size: 17px; }
.love-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.btn-love {
  padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line);
  font-size: 14px; cursor: pointer; transition: transform .1s, filter .2s; max-width: 320px;
}
.btn-love.plus { background: rgba(52,209,122,.16); border-color: var(--ok); color: #d7ffe9; }
.btn-love.plus:hover { filter: brightness(1.1); }
.btn-love.plus:active { transform: scale(.96); }
.btn-love.minus { background: rgba(224,101,91,.12); border-color: #e0655b; color: #ffd9d4; }
.btn-love.minus.loose {
  position: fixed; z-index: 40; margin: 0; width: 240px; max-width: none; right: auto;
  white-space: nowrap; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

/* Boutons "libres" flottant dans le fond de la page activités */
.love-hud {
  position: fixed; top: 12px; left: 14px; z-index: 4;
  background: rgba(6,16,28,.6); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 12px; font-size: 13px; color: var(--ink);
}
.love-hud b { color: var(--accent); font-size: 15px; }
.btn-love.float-up { position: fixed; left: 4%; top: 44%; z-index: 4; animation: bob 4.5s ease-in-out infinite; }
.btn-love.float-down { position: fixed; right: 4%; top: 56%; z-index: 4; }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }

.heart-pop {
  position: fixed; z-index: 70; font-size: 22px; pointer-events: none;
  transform: translate(-50%, 0); animation: heartUp .9s ease-out forwards;
}
@keyframes heartUp { to { transform: translate(-50%, -70px) scale(1.5); opacity: 0; } }

/* ---------- Page activités ---------- */
.app-wrap { position: relative; z-index: 2; max-width: 720px; margin: 0 auto; padding: 28px 20px 120px; }
.app-head { text-align: center; margin-bottom: 24px; }
.app-head h1 { margin: 0 0 6px; font-size: 24px; }
.app-head p { margin: 0; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.act {
  position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  background: var(--card); cursor: pointer; transition: transform .12s, border-color .2s, box-shadow .2s;
}
.act:hover { transform: translateY(-2px); }
.act.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,212,94,.25); }
.act .emoji { font-size: 26px; }
.act .title { font-weight: 600; margin: 6px 0 2px; }
.act .desc { color: var(--muted); font-size: 13px; }
.act .check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; color: #0b1f3a; }
.act.on .check { background: var(--accent); border-color: var(--accent); }
.act input.note {
  margin-top: 10px; width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: var(--ink); font-size: 14px; outline: none;
}
.act input.note:focus { border-color: var(--accent); }
.act .note[hidden] { display: none; }

/* ---------- Récap ---------- */
.recap {
  margin-top: 28px; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  background: rgba(10,24,41,.6);
}
.recap h2 { margin: 0 0 12px; font-size: 16px; letter-spacing: .5px; color: var(--accent); }
.recap ul { margin: 0; padding-left: 18px; }
.recap li { margin: 6px 0; }
.recap .empty { color: var(--muted); font-size: 14px; }
.recap .deposit { margin-top: 12px; color: var(--muted); font-size: 13px; }

.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; gap: 12px; justify-content: center; padding: 16px;
  background: linear-gradient(transparent, rgba(6,14,26,.95) 40%); }
.btn { border: none; border-radius: 12px; padding: 13px 20px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn.go { background: var(--accent); color: #0b1f3a; }
.btn.go:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

@media (max-width: 480px) {
  .windsock { display: none; }         /* on garde radar + balise : ce sont des indices */
  .radar { right: 4%; bottom: 6%; }
  .grid { grid-template-columns: 1fr; }
}
