:root {
  --deep:#0a1628; --deep-2:#102744; --navy:#16345e; --blue:#1f6fd6; --blue-bright:#2e90ff; --blue-pale:#6fb8ff;
  --aqua:#5fd4ff; --foam:#c6ecff; --coral:#ff6b5b; --gold:#ffc73a; --gold-deep:#c89010; --green:#4cc3a3;
  --ink:#fff; --shadow:#061222;
  --font-display:'Luckiest Guy',sans-serif; --font-title:'Bangers',sans-serif; --font-body:'Fredoka',sans-serif;
}
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html,body { background:var(--deep); color:var(--ink); font-family:var(--font-body); -webkit-tap-highlight-color:transparent; }
body { min-height:100vh; background:radial-gradient(900px 600px at 70% 0,#1a3a6e,transparent 60%),linear-gradient(180deg,#0e1f3a 0%,#061224 100%) fixed; }
button { font:inherit; color:inherit; background:none; border:0; cursor:pointer; }
a { color:inherit; text-decoration:none; }
img { max-width:100%; display:block; }
.ap-sprite { position:absolute; width:0; height:0; overflow:hidden; }
.ico { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
:focus-visible { outline:3px solid var(--aqua); outline-offset:3px; }

/* en-tête */
.ap-top { position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:calc(10px + env(safe-area-inset-top)) 16px 10px; background:rgba(10,22,40,.9); backdrop-filter:blur(12px); border-bottom:2px solid var(--blue); }
.ap-brand { display:flex; align-items:center; gap:10px; font-family:var(--font-display); font-size:19px; letter-spacing:.04em; text-shadow:0 2px 0 var(--shadow); }
.ap-brand i { font-style:normal; color:var(--blue-bright); }
.ap-chip { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border:2.5px solid var(--ink); border-radius:16px; background:rgba(16,39,68,.8); font-weight:700; font-size:14px; box-shadow:0 3px 0 var(--shadow); }
.ap-chip b { font-family:var(--font-display); font-weight:400; font-size:20px; color:var(--gold); }
.ap-chip .ico { color:var(--gold); width:18px; height:18px; fill:currentColor; }

/* contenu */
.ap-main { max-width:560px; margin:0 auto; padding:18px 16px calc(96px + env(safe-area-inset-bottom)); }
.ap-view { display:none; }
.ap-view.on { display:block; animation:apin .25s ease; }
@keyframes apin { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.ap-view h1 { font-family:var(--font-display); font-weight:400; font-size:36px; line-height:1; color:var(--gold); text-shadow:0 3px 0 var(--shadow); margin-bottom:8px; }
.ap-view h2 { font-family:var(--font-display); font-weight:400; font-size:20px; color:var(--aqua); margin:22px 0 10px; letter-spacing:.03em; }
.ap-lead { color:var(--foam); line-height:1.55; margin-bottom:18px; }
.ap-note { color:var(--blue-pale); font-size:13px; margin-top:18px; line-height:1.5; }

/* carte des îles */
.ap-map { display:grid; gap:14px; }
.ap-island { display:flex; align-items:center; gap:16px; width:100%; text-align:left; padding:14px 16px; border:3px solid var(--ink); border-radius:22px; background:rgba(16,39,68,.8); box-shadow:0 5px 0 var(--shadow); transition:transform .12s; }
.ap-island:nth-child(even) { flex-direction:row-reverse; text-align:right; }
.ap-island:active { transform:translateY(3px); box-shadow:0 2px 0 var(--shadow); }
.ap-disk { position:relative; width:64px; height:64px; border-radius:50%; border:3px solid var(--ink); display:grid; place-items:center; background:var(--g,var(--blue-bright)); box-shadow:0 5px 0 rgba(0,0,0,.35); flex-shrink:0; color:var(--shadow); }
.ap-disk .ico { width:30px; height:30px; }
.ap-disk .n { position:absolute; top:-8px; left:-8px; width:26px; height:26px; border-radius:50%; background:var(--shadow); border:2px solid var(--ink); color:var(--ink); font-size:13px; font-weight:700; display:grid; place-items:center; }
.ap-disk .ok { position:absolute; bottom:-6px; right:-6px; width:26px; height:26px; border-radius:50%; background:var(--gold); border:2px solid var(--ink); color:var(--shadow); display:none; place-items:center; }
.ap-disk .ok .ico { width:14px; height:14px; fill:currentColor; }
.ap-island.done .ap-disk .ok { display:grid; }
.ap-info { flex:1; min-width:0; }
.ap-info b { display:block; font-family:var(--font-display); font-weight:400; font-size:20px; letter-spacing:.03em; }
.ap-info span { color:var(--foam); font-size:13px; }

/* profil */
.ap-card { background:rgba(16,39,68,.8); border:2.5px solid rgba(255,255,255,.55); border-radius:20px; padding:16px; }
.ap-card .ap-sub { color:var(--foam); font-size:14px; line-height:1.55; margin-bottom:10px; }
.ap-card .ap-sub:last-child { margin-bottom:0; }
.ap-xpcard { display:flex; justify-content:space-between; align-items:center; }
.ap-big { font-family:var(--font-display); font-size:48px; color:var(--gold); text-shadow:0 3px 0 var(--shadow); }
.ap-unit { color:var(--blue-pale); font-weight:700; }
.ap-badges { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.ap-badge { display:flex; align-items:center; gap:10px; padding:12px; border:2px dashed rgba(255,255,255,.3); border-radius:16px; color:var(--blue-pale); font-size:13px; font-weight:600; }
.ap-badge .ico { width:26px; height:26px; }
.ap-badge.on { border:2px solid var(--gold); color:var(--gold); background:rgba(255,199,58,.1); }
.ap-btn { padding:12px 20px; font-size:15px; margin-top:6px; }

/* barre de navigation (icônes cliquables) */
.ap-nav { position:fixed; left:0; right:0; bottom:0; z-index:30; display:flex; justify-content:center; gap:6px;
  padding:8px 12px calc(8px + env(safe-area-inset-bottom)); background:rgba(10,22,40,.95); backdrop-filter:blur(12px); border-top:2px solid var(--blue); }
.ap-nav button { flex:1; max-width:180px; display:flex; flex-direction:column; align-items:center; gap:3px; padding:8px 6px; border-radius:16px; color:var(--blue-pale); font-size:12px; font-weight:700; }
.ap-nav button .ico { width:26px; height:26px; }
.ap-nav button.on { background:var(--gold); color:var(--shadow); }

/* boutons cartoon (mêmes que le site) */
.toon-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:12px 22px; font-family:var(--font-display); letter-spacing:.04em; border:3px solid var(--ink); border-radius:18px; color:var(--ink); text-shadow:0 2px 0 var(--shadow); }
.toon-btn.primary { background:var(--coral); box-shadow:0 5px 0 #b13a2d; }
.toon-btn.gold { background:var(--gold); color:var(--shadow); text-shadow:none; box-shadow:0 5px 0 var(--gold-deep); }
.toon-btn.ghost { background:rgba(255,255,255,.08); box-shadow:0 5px 0 var(--shadow); }
.toon-btn:active { transform:translateY(2px); }

/* jeux : ajustements mobiles */
.pl-tabs { flex-wrap:nowrap; overflow-x:auto; padding-bottom:8px; scrollbar-width:thin; scrollbar-color:var(--blue) transparent; }
.pl-tab { white-space:nowrap; }
.pl-stage { min-height:340px; }
/* bandeau d'installation */
.ap-banner { display:flex; align-items:center; gap:12px; padding:12px 14px; margin-bottom:16px; border:3px solid var(--gold); border-radius:20px; background:rgba(255,199,58,.1); }
.ap-banner > .ico { width:30px; height:30px; color:var(--gold); }
.ap-banner-tx { flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.3; }
.ap-banner-tx b { font-family:var(--font-display); font-weight:400; font-size:17px; color:var(--gold); }
.ap-banner-tx span { font-size:12.5px; color:var(--foam); }
.ap-banner-btn { padding:9px 14px; font-size:14px; }
.ap-banner-x { padding:6px; border-radius:10px; color:var(--blue-pale); }
.ap-banner-x .ico { width:18px; height:18px; }

/* fenêtre guide d'installation */
.ap-modal { position:fixed; inset:0; z-index:100; display:flex; align-items:flex-end; justify-content:center; background:rgba(3,9,20,.72); backdrop-filter:blur(4px); }
.ap-sheet { position:relative; width:100%; max-width:560px; max-height:88vh; overflow-y:auto; padding:22px 18px calc(22px + env(safe-area-inset-bottom));
  background:var(--deep-2); border:3px solid var(--ink); border-bottom:0; border-radius:26px 26px 0 0; animation:apin .22s ease; }
.ap-sheet h2 { font-family:var(--font-display); font-weight:400; font-size:26px; color:var(--gold); margin:0 0 10px; padding-right:40px; }
.ap-sheet .ap-sub { color:var(--foam); line-height:1.55; margin-bottom:14px; font-size:15px; }
.ap-sheet-x { position:absolute; top:14px; right:14px; padding:8px; border-radius:12px; color:var(--blue-pale); }
.ap-steps { list-style:none; display:grid; gap:12px; margin:0 0 16px; padding:0; counter-reset:st; }
.ap-steps li { display:flex; align-items:flex-start; gap:12px; font-size:15px; line-height:1.5; }
.ap-step-ico { width:38px; height:38px; border-radius:12px; background:var(--gold); color:var(--shadow); display:grid; place-items:center; flex-shrink:0; }
.ap-step-ico .ico { width:22px; height:22px; }
@media (min-width:600px) { .ap-modal { align-items:center; } .ap-sheet { border-radius:26px; border-bottom:3px solid var(--ink); } }

/* test de niveau */
.ap-onboard { position:fixed; inset:0; z-index:200; overflow-y:auto; display:flex; background:radial-gradient(900px 600px at 70% 0,#1a3a6e,transparent 60%),linear-gradient(180deg,#0e1f3a 0%,#061224 100%); }
body.ob-open { overflow:hidden; }
.ap-ob-inner { width:100%; max-width:560px; margin:auto; padding:calc(28px + env(safe-area-inset-top)) 18px calc(32px + env(safe-area-inset-bottom)); }
.ob-h { font-family:var(--font-display); font-weight:400; font-size:34px; line-height:1.05; color:var(--gold); text-shadow:0 3px 0 var(--shadow); margin-bottom:14px; }
.ob-q { font-size:21px; font-weight:600; line-height:1.4; margin:4px 0 18px; }
.ob-p { color:var(--foam); line-height:1.6; margin-bottom:12px; }
.ob-small { font-size:13px; color:var(--blue-pale); }
.ob-strong { font-weight:700; color:var(--ink); margin-top:14px; }
.ob-row { display:flex; gap:12px; flex-wrap:wrap; margin-top:20px; }
.ob-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; font-weight:700; color:var(--blue-pale); font-size:14px; letter-spacing:.06em; text-transform:uppercase; }
.ob-quit { color:var(--blue-pale); text-decoration:underline; font-size:13px; padding:6px; }
.ob-score { margin:6px 0 12px; }
.ob-big { font-family:var(--font-display); font-size:64px; color:var(--gold); text-shadow:0 4px 0 var(--shadow); line-height:1; }
.ob-unit { color:var(--blue-pale); font-weight:700; }
.ob-list { margin:6px 0 10px 22px; color:var(--foam); line-height:1.8; font-weight:600; }
.ap-lvl-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:6px; }
.ap-lvl { font-family:var(--font-display); font-size:26px; color:var(--gold); text-shadow:0 2px 0 var(--shadow); }
.ap-island.rec { border-color:var(--gold); }
.ap-rec { display:inline-block; font-style:normal; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; background:var(--gold); color:var(--shadow); border-radius:8px; padding:2px 8px; margin-bottom:4px; }

[hidden] { display:none !important; }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; } }
