/* polices hébergées avec le site (sous-ensemble latin, licence SIL OFL : assets/fonts/OFL-*.txt) */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(assets/fonts/bricolage-grotesque-latin.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(assets/fonts/dm-sans-latin.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url(assets/fonts/dm-sans-italic-latin.woff2) format("woff2"); }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 700; font-display: swap; src: url(assets/fonts/caveat-latin.woff2) format("woff2"); }
:root {
  --ink: #1a1a1a;
  --cream: #fff6e9;
  --paper: #fffdf8;
  --coral: #ff6b4a;
  --sun: #ffd23f;
  --teal: #06d6a0;
  --muted: #6b6580;
  --line: 3px;
  --shadow: 5px 5px 0 var(--ink);
  --r: 18px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a2a5e; color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
/* avant la première image 3D : ciel de couchant (mêmes teintes que l'île), jamais d'écran vide */
body { background: linear-gradient(180deg, #efa04f 0%, #e7a071 34%, #b48ea6 50%, #6f68a0 60%, #3c3a78 70%, #2a2a5e 100%) fixed; }
body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
[hidden] { display: none !important; }
/* focus clavier visible (trait d'encre + halo jaune), jamais à la souris */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--sun); }
.sheet:focus-visible { outline: none; box-shadow: none; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: var(--line) solid var(--ink); border-radius: 14px; padding: 12px 18px;
  font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: .01em;
  background: var(--paper); box-shadow: 4px 4px 0 var(--ink); text-decoration: none; color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .2s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--coral); color: var(--ink); } /* encre sur corail : 6,2:1 (blanc : 2,8:1) */
.btn.dark { background: var(--ink); color: var(--cream); }
.btn.ghost { background: var(--cream); }
.btn.big { font-size: 22px; padding: 16px 28px; border-radius: 18px; }
.btn svg { width: 20px; height: 20px; }
.btn[disabled] { opacity: .85; cursor: progress; }
.btn .arrow { transition: transform .2s; display: inline-block; }
.btn:hover .arrow { transform: translateX(4px); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: var(--line) solid var(--ink);
  background: var(--paper); box-shadow: 3px 3px 0 var(--ink); display: grid; place-items: center; padding: 0;
  font-family: var(--display); font-weight: 800; font-size: 14px; transition: transform .12s, box-shadow .12s;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.text { width: auto; min-width: 44px; padding: 0 12px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(26,26,26,.25); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- intro ---------- */
#intro {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: flex-start;
  padding: calc(24px + var(--sat)) calc(24px + var(--sar)) calc(28px + var(--sab)) calc(24px + var(--sal));
  background: radial-gradient(120% 90% at 0% 100%, rgba(29,22,51,.55), rgba(29,22,51,0) 60%);
  transition: opacity .8s ease, transform .8s ease;
}
#intro.gone { opacity: 0; transform: scale(1.04); pointer-events: none; }
.lang-top { position: absolute; top: calc(20px + var(--sat)); right: calc(20px + var(--sar)); }
.intro-card { max-width: 620px; animation: rise .9s cubic-bezier(.2,.9,.2,1.1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }
#intro h1 {
  font-family: var(--display); font-weight: 800; margin: 14px 0 10px; line-height: .82; letter-spacing: -.03em;
  font-size: clamp(64px, min(13vw, 19vh), 168px); color: var(--cream);
  text-shadow: 5px 5px 0 var(--ink);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
}
#intro h1 span { display: block; color: var(--sun); margin-left: .35em; }
.intro-lead { font-size: 19px; line-height: 1.45; margin: 0 0 22px; max-width: 520px; background: var(--paper); border: var(--line) solid var(--ink); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.intro-lead p { margin: 0; }
.intro-list { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 2.5px dashed rgba(26,26,26,.28); display: grid; gap: 7px; font-size: 16px; line-height: 1.3; }
.intro-list li { display: flex; align-items: center; gap: 10px; }
.intro-list b { font-family: var(--display); font-weight: 800; }
.il-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; border: 2.5px solid var(--ink); background: var(--cream); display: grid; place-items: center; font-size: 17px; }
.intro-list li:nth-child(1) .il-ic { background: #fcd894; }
.intro-list li:nth-child(2) .il-ic { background: #b8f0dd; }
.intro-list li:nth-child(3) .il-ic { background: #ffc9b8; }
.bp-l { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.load-slow { margin: 10px 0 0; font-size: 14px; font-weight: 700; color: var(--cream); text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.btn.retry { background: var(--sun); color: var(--ink); }
.btn[disabled] .bp-l small { font-variant-numeric: tabular-nums; }
.bp-l small { font-family: var(--body); font-weight: 700; font-size: 13px; opacity: .9; margin-top: 3px; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.controls { margin: 18px 0 0; font-size: 14px; line-height: 1.5; color: var(--cream); text-shadow: 0 1px 2px rgba(0,0,0,.4); max-width: 560px; }
.controls b { color: var(--sun); font-weight: 700; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; opacity: 0; transition: opacity .8s .6s; }
#hud.on { opacity: 1; }
#hud button, #hud canvas, #hud .toast { pointer-events: auto; }
/* carte unique en haut à gauche : trouvailles + prochain chapitre (clic → journal) */
.plate {
  position: absolute; top: calc(16px + var(--sat)); left: calc(16px + var(--sal));
  display: flex; flex-direction: column; align-items: stretch; gap: 0; text-align: left; font: inherit; color: inherit;
  background: var(--paper); border: var(--line) solid var(--ink); border-radius: 16px;
  padding: 9px 12px 10px; box-shadow: 3px 3px 0 var(--ink); width: 236px; cursor: pointer;
}
.avatar { width: 52px; height: 52px; border-radius: 16px; background: var(--coral); border: var(--line) solid var(--ink); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 28px; color: #fff; flex: none; }
.avatar.big { width: 72px; height: 72px; font-size: 40px; border-radius: 20px; }
.plate-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-family: var(--display); font-size: 16px; line-height: 1.1; }
/* trouvailles : part de l'île découverte (chapitres, secrets, étincelles, trophées, lieux) */
.pct { font-family: var(--display); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.pct.bump { animation: fbump .6s cubic-bezier(.2,.9,.2,1.4); display: inline-block; }
@keyframes fbump { 35% { transform: scale(1.3) rotate(-4deg); } }
.fbar { display: block; height: 8px; border: 2px solid var(--ink); border-radius: 999px; margin: 6px 0 0; overflow: hidden; background: #efe6d6; }
.fbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--coral)); transform-origin: left; transition: transform .6s cubic-bezier(.2,.9,.2,1.2); }
/* compteurs repliés au repos, dépliés à chaque trouvaille (.open), au survol et au focus */
.counters { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .35s, opacity .35s, margin .35s; }
.plate.open .counters, .plate:hover .counters, .plate:focus-visible .counters { max-height: 22px; opacity: 1; margin-top: 6px; }

/* quête principale : prochain chapitre, dans la carte sous la barre */
#quest { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; padding-top: 7px; border-top: 2px dashed #e4dccd; }
#quest:not(.on) { display: none; }
#quest small { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q-row { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 14.5px; line-height: 1.15; }
.q-row b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-n { flex: none; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 7px; background: var(--c, var(--sun)); border: 2px solid var(--ink); color: var(--ink); font-size: 12.5px; font-weight: 800; }
.q-arr { font-style: normal; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); line-height: 1; transition: transform .25s; }
.q-arr svg { width: 72%; height: 72%; }
body.ingame #quest, body.panorama #quest, body.flying #quest { display: none; }
.topright { position: absolute; top: calc(16px + var(--sat)); right: calc(16px + var(--sar)); display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.btns { display: flex; gap: 8px; }
#minimap { width: 120px; height: 120px; border-radius: 50%; border: var(--line) solid var(--ink); box-shadow: 3px 3px 0 var(--ink); background: #2a96b9; cursor: pointer; }

#banner {
  position: absolute; top: calc(92px + var(--sat)); left: 50%; transform: translate(-50%, -20px); opacity: 0;
  text-align: center; transition: opacity .5s, transform .6s cubic-bezier(.2,.9,.2,1.2);
}
#banner.on { opacity: 1; transform: translate(-50%, 0); }
#banner small { display: inline-block; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; background: var(--ink); color: var(--cream); padding: 5px 12px; border-radius: 999px; }
#banner strong { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(38px, 6vw, 64px); line-height: 1; margin-top: 8px; color: var(--c, var(--sun)); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); white-space: nowrap; }

#flash { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) scale(.5); opacity: 0; font-family: var(--display); font-weight: 800; font-size: clamp(40px, 8vw, 100px); line-height: .95; color: var(--c); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 6px 6px 0 var(--ink); width: max-content; max-width: 92vw; text-align: center; }
#flash.on { animation: flash 1.5s cubic-bezier(.2,.9,.2,1.3) forwards; }
@keyframes flash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-6deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(2deg); } 30% { transform: translate(-50%, -50%) scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1); } }

#gamehud { position: absolute; top: calc(170px + var(--sat)); left: 50%; transform: translate(-50%, -10px); opacity: 0; transition: .3s; text-align: center; width: min(640px, calc(100vw - 32px)); }
#gamehud.on { opacity: 1; transform: translate(-50%, 0); }
.gh-q { background: var(--ink); color: var(--cream); font-family: var(--display); font-weight: 800; font-size: 22px; padding: 12px 18px; border-radius: 16px; border: var(--line) solid var(--ink); }
.gh-q small { display: block; color: var(--sun); font-size: 12px; letter-spacing: .1em; }
.gh-ans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.gh-ans span { background: var(--c); border: var(--line) solid var(--ink); border-radius: 12px; padding: 8px 6px; font-weight: 700; font-size: 14px; box-shadow: 3px 3px 0 var(--ink); transition: transform .15s; }
.gh-ans span.on { transform: translateY(-4px) scale(1.05); }
.gh-ans b { display: block; font-family: var(--display); font-size: 18px; }
.gh-ans.locked span { background: #c9c9d1; color: #5c5c68; box-shadow: 2px 2px 0 var(--ink); }
.gh-hint.warn { background: var(--sun); border: 2px solid var(--ink); animation: bob 1.2s ease-in-out infinite; }
/* bulle de BD au-dessus du perso (feu de camp) */
#bubble { position: fixed; left: 0; top: 0; z-index: 6; pointer-events: none; transform: translate(-50%, -100%) scale(.6); opacity: 0; transition: opacity .25s, transform .3s cubic-bezier(.2,.9,.2,1.4);
  background: #fff; border: var(--line) solid var(--ink); border-radius: 18px; padding: 10px 16px; font-family: var(--display); font-weight: 800; font-size: 18px; white-space: nowrap; box-shadow: 4px 4px 0 var(--ink); }
#bubble::after { content: ""; position: absolute; left: 50%; bottom: -14px; width: 18px; height: 18px; background: #fff; border-right: var(--line) solid var(--ink); border-bottom: var(--line) solid var(--ink); transform: translateX(-50%) rotate(45deg) skew(8deg, 8deg); }
#bubble.on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.gh-hint { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--ink); background: rgba(255,253,248,.85); display: inline-block; padding: 4px 10px; border-radius: 999px; }
.gh-big { font-family: var(--display); font-weight: 800; font-size: 56px; color: var(--sun); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); }
.gh-big.ok { color: var(--teal); }
.gh-big.ko { color: #ff4f6d; }
.gh-timer { display: inline-block; background: var(--paper); border: var(--line) solid var(--ink); border-radius: 16px; padding: 10px 18px; font-family: var(--display); font-weight: 800; font-size: 26px; box-shadow: var(--shadow); }
.gh-timer small { display: block; font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.gh-series { display: inline-flex; align-items: center; gap: 10px; background: var(--paper); border: var(--line) solid var(--ink); border-radius: 999px; padding: 6px 16px; box-shadow: 3px 3px 0 var(--ink); font-family: var(--display); font-weight: 800; margin-bottom: 8px; }
.gh-series span { font-size: 15px; color: var(--muted); }
.gh-series b { font-size: 26px; }
.gh-series em { font-style: normal; font-size: 20px; letter-spacing: 2px; }
.gh-series em i { font-style: normal; color: var(--muted); }
/* Course aux post-its : mot à taper, saisie, champ invisible */
#typein { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; font-size: 16px; border: 0; padding: 0; pointer-events: none; }
.pi { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pi-word { background: #fff5a8; border: var(--line) solid var(--ink); border-radius: 10px 10px 18px 10px; padding: 6px 22px 8px; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-1.5deg); }
.pi-word small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pi-word b { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1.1; }
.pi-typed { min-width: 180px; font-family: "Caveat", var(--display); font-weight: 700; font-size: 30px; background: rgba(255,253,248,.95); border: 2.5px solid var(--ink); border-radius: 12px; padding: 0 14px; line-height: 1.3; }
.pi-typed .ok { color: #0a8f6a; } .pi-typed .ko { color: #e2412f; text-decoration: underline wavy; } .pi-typed .ph { color: var(--muted); font-size: 22px; }
.pi-typed i { display: inline-block; width: 2px; height: .9em; background: var(--ink); vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pi-hint { font-weight: 700; font-size: 13px; background: rgba(255,253,248,.9); border: 2px solid var(--ink); border-radius: 12px; padding: 3px 10px; }
.pi-kb { pointer-events: auto; font-family: var(--display); font-weight: 800; font-size: 18px; background: var(--sun); border: var(--line) solid var(--ink); border-radius: 14px; padding: 8px 18px; box-shadow: 3px 3px 0 var(--ink); }
/* Sors du feu ! : cadre du boss (façon raid), alerte feu */
.rd { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rd-boss { width: min(420px, 100%); background: var(--paper); border: var(--line) solid var(--ink); border-radius: 14px; padding: 6px 10px 8px; box-shadow: 3px 3px 0 var(--ink); font-family: var(--display); font-weight: 800; }
.rd-boss > span { font-size: 16px; }
.rd-boss small { display: block; font-size: 12px; color: #c0392b; }
.rd-bar { position: relative; height: 20px; margin-top: 4px; background: #3a2230; border: 2.5px solid var(--ink); border-radius: 8px; overflow: hidden; }
.rd-bar i { position: absolute; inset: 0; background: #e2412f; transform-origin: left; transition: transform .25s; }
.rd-bar b { position: relative; font-size: 13px; color: #fff; line-height: 15px; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.rd-warn { font-family: var(--display); font-weight: 800; font-size: 24px; color: #fff; background: #e2412f; border: var(--line) solid var(--ink); border-radius: 12px; padding: 4px 14px; box-shadow: 3px 3px 0 var(--ink); animation: hop .35s ease-in-out infinite; }
.gscore .epic, .epic { color: #a335ee; }
/* La bonne notif : profil ciblé + dernier événement */
.nf { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nf-prof { display: flex; align-items: center; gap: 10px; background: var(--paper); border: var(--line) solid var(--ink); border-radius: 999px; padding: 4px 16px 4px 5px; box-shadow: 3px 3px 0 var(--ink); font-family: var(--display); font-weight: 700; font-size: 17px; }
.nf-prof i { font-style: normal; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: var(--ink); border: 2.5px solid var(--ink); font-weight: 800; }
.nf-rule { font-weight: 700; font-size: 13px; background: rgba(255,253,248,.9); border: 2px solid var(--ink); border-radius: 12px; padding: 3px 10px; }
.nf-evt { font-family: var(--display); font-weight: 800; font-size: 18px; border: 2.5px solid var(--ink); border-radius: 12px; padding: 4px 12px; animation: hop .5s ease-out; }
.nf-evt.ok { background: #c8f5e6; }
.nf-evt.ko { background: #ffd0d8; }

/* ---------- mini-jeux : barre du haut, décompte, cartes (src/games/) ---------- */
#gtop { position: absolute; top: calc(16px + var(--sat)); left: 50%; transform: translate(-50%, -30px); opacity: 0; transition: .35s cubic-bezier(.2,.9,.2,1.2);
  display: flex; align-items: center; gap: 10px; background: var(--paper); border: var(--line) solid var(--ink); border-radius: 18px; padding: 7px 8px 7px 8px; box-shadow: var(--shadow);
  font-family: var(--display); font-weight: 800; max-width: calc(100vw - 580px); min-width: 330px; }
#gtop.on { opacity: 1; transform: translate(-50%, 0); }
.gt-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--c); border: 2.5px solid var(--ink); display: grid; place-items: center; font-size: 20px; flex: none; }
.gt-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.gt-time { position: relative; flex: 1 0 120px; height: 26px; border: 2.5px solid var(--ink); border-radius: 999px; background: #efe6d6; overflow: hidden; display: grid; place-items: center; }
.gt-time i { position: absolute; inset: 0; background: var(--c); transform-origin: left; transition: transform .12s linear; }
.gt-time i.low { background: #ff4f6d; animation: blink .5s steps(2) infinite; }
.gt-time em { position: relative; font-style: normal; font-size: 14px; -webkit-text-stroke: 3px var(--paper); paint-order: stroke fill; }
.gt-score { font-size: 17px; background: var(--ink); color: var(--sun); padding: 5px 11px; border-radius: 12px; white-space: nowrap; }
.gt-x { width: 34px; height: 34px; border-radius: 10px; border: 2.5px solid var(--ink); background: var(--cream); font-size: 16px; font-weight: 800; padding: 0; flex: none; display: grid; place-items: center; }
@keyframes blink { 50% { opacity: .55; } }
#gcount { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%) scale(.5); opacity: 0; font-family: var(--display); font-weight: 800; font-size: clamp(90px, 16vw, 180px); line-height: 1; color: var(--sun); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 7px 7px 0 var(--ink); white-space: nowrap; }
#gcount.on { animation: count 1s cubic-bezier(.2,.9,.2,1.3) forwards; }
@keyframes count { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-8deg); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(3deg); } 35% { transform: translate(-50%, -50%) scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.9); } }
.gcard { width: min(560px, 100%); }
.gcard header { display: flex; gap: 16px; align-items: center; padding-right: 44px; }
.gcard h2 { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 4vw, 34px); line-height: 1.05; margin: 4px 0 0; letter-spacing: -.01em; }
.grule { font-size: 19px; line-height: 1.45; font-weight: 700; margin: 18px 0 14px; padding: 12px 16px; background: #fff3c4; border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 3px 3px 0 var(--ink); }
.gchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.gchips span { font-family: var(--display); font-weight: 800; font-size: 14px; background: var(--cream); border: 2.5px solid var(--ink); border-radius: 999px; padding: 5px 12px; }
.gchips span.hot { background: var(--sun); animation: hop 1.4s ease-in-out infinite; }
@keyframes hop { 50% { transform: translateY(-3px); } }
.gctrl { margin: 0; font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.gctrl b { color: var(--ink); }
.gcard .btn kbd { background: rgba(0,0,0,.28); border-radius: 7px; padding: 2px 7px; font-family: var(--display); font-size: 13px; margin-right: 4px; }
.touch .gcard .btn kbd { display: none; }
.gscore { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 18px 0 14px; padding: 14px; border: var(--line) solid var(--ink); border-radius: 18px; background: var(--c); box-shadow: 4px 4px 0 var(--ink); }
.gscore b { font-family: var(--display); font-weight: 800; font-size: 52px; line-height: 1; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
.gscore span { font-weight: 700; font-size: 15px; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 12px; text-align: center; }
.gcard.lost .gscore { background: #c9c9d1; }
/* jeu de rythme : zones tactiles / touches alignées sur les couloirs, combo et jugement */
#lanes { position: absolute; left: 50%; bottom: calc(14px + var(--sab)); transform: translate(-50%, 30px); opacity: 0; transition: .3s; display: flex; gap: 0; pointer-events: none; }
#lanes.on { opacity: 1; transform: translate(-50%, 0); }
#lanes.on button { pointer-events: auto; }
#lanes button { width: var(--lw, 120px); height: 62px; margin: 0 2px; border: var(--line) solid var(--ink); border-radius: 16px; background: var(--c); box-shadow: 3px 3px 0 var(--ink); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
#lanes button b { font-family: var(--display); font-weight: 800; font-size: 28px; color: #fff; -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; }
#lanes button kbd { background: var(--ink); color: var(--cream); border-radius: 7px; padding: 2px 7px; font-family: var(--display); font-size: 13px; }
#lanes button.down { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); filter: brightness(1.15); }
.touch #lanes { left: 0; right: 0; transform: translateY(30px); justify-content: center; }
.touch #lanes.on { transform: none; }
.touch #lanes button { width: calc((100vw - 28px) / 3); height: 22vh; max-height: 170px; border-radius: 20px; }
.touch #lanes button kbd { display: none; }
body.rhythm #prompt, body.rhythm #b-jump, body.rhythm #hint { display: none !important; }
body.typing #gamehud { top: calc(96px + var(--sat)); } /* mot à taper au-dessus du chevalet */
body.rhythm #gamehud { top: 50%; } /* entre le perso (haut) et la piste (bas) */
.rh { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rh-combo { font-family: var(--display); font-weight: 800; font-size: 18px; background: var(--ink); color: var(--sun); border-radius: 999px; padding: 4px 14px; text-transform: uppercase; letter-spacing: .06em; }
.rh-combo b { font-size: 30px; margin-right: 4px; color: #fff; }
.rh-j { font-family: var(--display); font-weight: 800; font-size: 40px; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); animation: jpop .35s cubic-bezier(.2,.9,.2,1.4); }
.rh-j.ok { color: var(--teal); } .rh-j.good { color: var(--sun); } .rh-j.ko { color: #ff4f6d; }
@keyframes jpop { from { transform: scale(.5) rotate(-6deg); } }
.gt-score small { color: var(--cream); font-size: 12px; }
.gt-score .off { opacity: .3; filter: grayscale(1); }
/* bus : flèche vers l'arrêt, liste des arrêts, conduite à gauche */
.bh { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bh-arrow { display: flex; align-items: center; gap: 10px; background: var(--paper); border: var(--line) solid var(--ink); border-radius: 999px; padding: 4px 16px 4px 6px; box-shadow: 3px 3px 0 var(--ink); font-family: var(--display); font-weight: 800; font-size: 16px; }
.bh-arrow i { font-style: normal; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sun); border: 2.5px solid var(--ink); font-size: 18px; line-height: 1; }
.bh-stops { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.bh-stops span { font-family: var(--display); font-weight: 800; font-size: 13px; background: rgba(255,253,248,.9); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px; }
.bh-stops span.cur { background: var(--sun); }
.bh-stops span.done { background: var(--teal); }
.bh-stops small { font-size: 11px; }
.bh-side { font-weight: 700; font-size: 14px; background: rgba(255,253,248,.9); border: 2px solid var(--ink); border-radius: 12px; padding: 3px 10px; }
.bh-side.ok { background: #c8f5e6; }
.bh-side.ko { background: #ffd0d8; animation: hop .6s ease-in-out infinite; }
body.ingame .plate, body.ingame #b-journal, body.ingame #b-cv { opacity: .35; pointer-events: none; }
body.ingame #minimap { pointer-events: none !important; }

#toasts { position: absolute; right: calc(16px + var(--sar)); top: calc(250px + var(--sat)); display: flex; flex-direction: column; gap: 10px; width: 330px; align-items: flex-end; }
.toast { display: flex; gap: 12px; align-items: flex-start; background: var(--paper); border: var(--line) solid var(--ink); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); transform: translateX(30px); opacity: 0; transition: .35s cubic-bezier(.2,.9,.2,1.2); border-left: 10px solid var(--c); }
.toast.on { transform: none; opacity: 1; }
.toast b { font-family: var(--display); font-weight: 800; font-size: 15px; display: block; }
.toast p { margin: 4px 0 0; font-size: 14px; line-height: 1.4; }
.t-icon { font-size: 24px; line-height: 1; }

#hint { position: absolute; bottom: calc(96px + var(--sab)); left: 50%; transform: translate(-50%, 10px); opacity: 0; transition: .6s; background: rgba(29,22,51,.82); color: var(--cream); font-size: 14px; padding: 10px 16px; border-radius: 14px; width: max-content; max-width: calc(100vw - 32px); text-align: center; line-height: 1.5; }
#hint.on { opacity: 1; transform: translate(-50%, 0); }
#hint b { color: var(--sun); }

#prompt {
  position: absolute; bottom: calc(26px + var(--sab)); left: 50%; transform: translate(-50%, 30px) scale(.9); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; background: var(--sun); border: var(--line) solid var(--ink); border-radius: 18px;
  padding: 12px 20px 12px 12px; box-shadow: var(--shadow); font-family: var(--display); font-weight: 800; font-size: 18px; max-width: calc(100vw - 32px);
  transition: .3s cubic-bezier(.2,.9,.2,1.3);
}
#prompt.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto !important; animation: bob 1.6s ease-in-out infinite .4s; }
@keyframes bob { 50% { transform: translate(-50%, -4px); } }
#prompt:active { box-shadow: 1px 1px 0 var(--ink); }
#prompt kbd { background: var(--ink); color: var(--cream); border-radius: 9px; padding: 5px 10px; font-family: var(--display); font-size: 15px; }
#prompt .pl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.touch #prompt kbd { display: none; }
.touch #prompt { padding-left: 16px; }

#joy { position: absolute; left: 0; top: 0; width: 120px; height: 120px; border-radius: 50%; border: 3px solid rgba(255,253,248,.9); background: rgba(29,22,51,.25); opacity: 0; transition: opacity .15s; pointer-events: none !important; }
#joy.on { opacity: 1; }
#joy-knob { position: absolute; left: 32px; top: 32px; width: 50px; height: 50px; border-radius: 50%; background: var(--paper); border: var(--line) solid var(--ink); box-shadow: 2px 3px 0 var(--ink); }
#b-jump { display: none; position: absolute; right: calc(22px + var(--sar)); bottom: calc(26px + var(--sab)); width: 66px; height: 66px; border-radius: 50%; background: var(--paper); border: var(--line) solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 0; place-items: center; }
#b-jump svg { width: 28px; height: 28px; }
.touch #b-jump { display: grid; }
/* conduite : klaxon (le saut n'a plus de sens au volant) */
#vhud { display: none; position: absolute; right: calc(22px + var(--sar)); bottom: calc(26px + var(--sab)); flex-direction: column; gap: 12px; align-items: center; }
body.driving #vhud { display: flex; }
body.driving #b-jump { display: none; }
body.boat #vhud { display: none; } /* kayak : pas de klaxon */
#vhud button { width: 58px; height: 58px; border-radius: 50%; background: var(--paper); border: var(--line) solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 0; font-size: 26px; line-height: 1; display: grid; place-items: center; pointer-events: auto; }
#vhud button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.touch #vhud button { width: 66px; height: 66px; font-size: 30px; }

/* ---------- modales ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(29,22,51,.35); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.modal.on { opacity: 1; }
.sheet {
  position: relative; width: min(680px, 100%); max-height: min(86vh, 900px); overflow: auto; background: var(--paper);
  border: var(--line) solid var(--ink); border-radius: 26px; box-shadow: 9px 9px 0 var(--ink); padding: 26px 28px 22px;
  transform: translateY(24px) scale(.97); transition: transform .35s cubic-bezier(.2,.9,.2,1.15); outline: none; user-select: text; -webkit-user-select: text;
  overscroll-behavior: contain;
}
.modal.on .sheet { transform: none; }
.x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 12px; border: var(--line) solid var(--ink); background: var(--cream); font-size: 24px; line-height: 1; font-weight: 700; display: grid; place-items: center; padding: 0; }
.card header { display: flex; gap: 16px; align-items: flex-start; padding-right: 44px; }
.card-icon { flex: none; width: 70px; height: 70px; border-radius: 20px; background: var(--c); border: var(--line) solid var(--ink); display: grid; place-items: center; font-size: 36px; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-4deg); }
.kicker { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card h2, .journal h2 { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 4vw, 34px); line-height: 1.05; margin: 4px 0 6px; letter-spacing: -.01em; }
.role { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.35; }
.lead { font-size: 18px; line-height: 1.5; margin: 18px 0 12px; padding-left: 14px; border-left: 5px solid var(--c); }
.bullets { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
.bullets li { position: relative; padding-left: 26px; font-size: 15.5px; line-height: 1.45; }
.bullets li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 10px; height: 10px; border-radius: 3px; background: var(--c); border: 2px solid var(--ink); transform: rotate(45deg); }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.stats div { flex: 1 1 110px; background: var(--cream); border: var(--line) solid var(--ink); border-radius: 14px; padding: 10px 12px; }
.stats b { display: block; font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.05; }
.stats span { font-size: 13px; color: var(--muted); font-weight: 700; }
.gained { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
.gained span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-right: 4px; }
.gained em { font-style: normal; font-weight: 700; font-size: 13px; background: var(--ink); color: var(--sun); padding: 4px 10px; border-radius: 999px; }
.tip { display: flex; gap: 10px; background: #fff3c4; border: 2.5px dashed var(--ink); border-radius: 14px; padding: 10px 14px; font-size: 14.5px; line-height: 1.4; margin: 6px 0 12px; font-weight: 500; }
.contact { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 6px; }
.copy { border: 2px dashed var(--muted); background: transparent; border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 700; color: var(--muted); }
.copy.copied { border-color: var(--teal); color: #049c75; }
.copy.copied::after { content: " ✓"; }
.sheet footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; padding-top: 14px; border-top: 2px dashed #e4dccd; }
.nx { opacity: .95; font-weight: 700; }

.jhead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-right: 48px; }
.jfound { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; background: var(--ink); color: var(--sun); padding: 4px 6px 4px 12px; border-radius: 999px; font-size: 14px; }
.jfound .fbar { width: 96px; height: 10px; margin: 0; border-width: 2px; border-color: var(--cream); }
.jsub { font-family: var(--display); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.tabs { display: flex; gap: 6px; margin: 14px 0 16px; background: var(--cream); padding: 5px; border: var(--line) solid var(--ink); border-radius: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 8px; border-radius: 11px; font-family: var(--display); font-weight: 800; font-size: 15px; }
.tabs button.on { background: var(--ink); color: var(--cream); }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.chapters button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 14px; padding: 9px 12px; transition: transform .12s, box-shadow .12s; }
.chapters button:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.chapters .n { font-family: var(--display); font-weight: 800; color: var(--muted); font-size: 14px; width: 22px; }
.chapters .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--c); border: 2.5px solid var(--ink); display: grid; place-items: center; font-size: 19px; flex: none; }
.chapters .tx { flex: 1; min-width: 0; }
.chapters .tx b { font-family: var(--display); font-size: 16px; display: block; }
.chapters .tx small { color: var(--muted); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapters .st { font-family: var(--display); font-weight: 800; font-size: 13px; white-space: nowrap; }
.chapters .read .st { color: #049c75; font-size: 20px; }
.chapters .new button { background: #fff8e1; }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tr { border: 2.5px solid var(--ink); border-radius: 14px; padding: 12px; background: #f1ece3; opacity: .7; }
.tr.has { background: #fff3c4; opacity: 1; box-shadow: 3px 3px 0 var(--ink); }
.tr span { font-size: 28px; display: block; }
.tr b { font-family: var(--display); display: block; margin-top: 4px; }
.tr small { color: var(--muted); font-size: 12.5px; }
.secrets-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 14px; }
.jsub + .secrets-row, .jsub + .trophies { margin-top: 0; }
.sec { border: 2px dashed var(--muted); border-radius: 12px; padding: 10px; font-size: 13px; color: var(--muted); }
.sec.has { border: 2.5px solid var(--ink); color: var(--ink); background: var(--cream); }
.sec small { display: block; margin-top: 4px; line-height: 1.35; }
.muted { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.skills { display: grid; gap: 10px; }
.sk { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; }
.pips { display: flex; gap: 5px; }
.pips i { width: 26px; height: 14px; border-radius: 5px; border: 2.5px solid var(--ink); background: #efe6d6; }
.pips i.on { background: linear-gradient(90deg, var(--sun), var(--coral)); }
.jfoot { justify-content: space-between !important; align-items: center; }
.jfoot .contact { margin: 0; }
.linkish { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 13px; padding: 4px; }
.jopts { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.jopts [data-lang] { color: var(--ink); font-weight: 700; }

/* ---------- version express ---------- */
#classic { position: fixed; inset: 0; z-index: 50; overflow: auto; background: var(--cream); user-select: text; -webkit-user-select: text; overscroll-behavior: contain; }
.cv { max-width: 860px; margin: 0 auto; padding: calc(28px + var(--sat)) 20px calc(60px + var(--sab)); }
.cv .back { position: sticky; top: 12px; z-index: 2; margin-bottom: 18px; }
.cv .warn { background: #fff3c4; border: 2.5px dashed var(--ink); padding: 12px 16px; border-radius: 14px; }
.cv-head { display: flex; gap: 18px; align-items: center; margin-bottom: 10px; }
.cv-head h1 { font-family: var(--display); font-weight: 800; font-size: clamp(36px, 6vw, 56px); margin: 0; line-height: 1; letter-spacing: -.02em; }
.cv-head p { margin: 6px 0 0; font-weight: 700; color: var(--muted); }
.cv-head .lang { margin-left: auto; align-self: flex-start; }
.cv section { display: grid; grid-template-columns: 110px 1fr; gap: 18px; background: var(--paper); border: var(--line) solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); padding: 22px; margin-top: 18px; }
.cv-meta { display: flex; flex-direction: column; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 14px; color: var(--muted); }
.cv-meta .ic { width: 58px; height: 58px; border-radius: 16px; background: var(--c); border: var(--line) solid var(--ink); display: grid; place-items: center; font-size: 28px; }
.cv section h2 { font-family: var(--display); font-weight: 800; margin: 4px 0 4px; font-size: 26px; }
.cv section p { line-height: 1.55; }
.cv section ul { padding-left: 20px; line-height: 1.55; }

/* bulle de BD des promeneurs (lot 4) : texte sur plusieurs lignes, nom en petit, compteur d'indices */
#npcbubble { position: fixed; left: 0; top: 0; z-index: 6; pointer-events: none; transform: translate(-50%, -100%) scale(.6); opacity: 0; transition: opacity .25s, transform .3s cubic-bezier(.2,.9,.2,1.4);
  width: max-content; max-width: min(300px, calc(100vw - 32px)); background: #fff; border: var(--line) solid var(--ink); border-radius: 18px; padding: 8px 14px 10px; box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 15.5px; line-height: 1.25; }
#npcbubble small { display: block; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .02em; margin-bottom: 2px; }
#npcbubble i { position: absolute; right: 10px; bottom: -2px; transform: translateY(50%); font-style: normal; font-size: 11px; font-weight: 800; background: var(--sun); border: 2px solid var(--ink); border-radius: 999px; padding: 0 6px; }
#npcbubble::after { content: ""; position: absolute; left: 50%; bottom: -14px; width: 18px; height: 18px; background: #fff; border-right: var(--line) solid var(--ink); border-bottom: var(--line) solid var(--ink); transform: translateX(-50%) rotate(45deg) skew(8deg, 8deg); }
#npcbubble.on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
body.panorama #npcbubble, body.flying #npcbubble, body.ingame #npcbubble { display: none; }
@media (max-width: 720px) { #npcbubble { font-size: 14px; } }

/* ---------- lot 4 : vue panoramique du belvédère (étiquettes des zones, dans la DA des panneaux) ---------- */
#plabels { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; transition: opacity .35s; }
#plabels.on { opacity: 1; }
.plabel { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; will-change: transform;
  background: var(--paper); border: var(--line) solid var(--ink); border-left: 9px solid var(--c); border-radius: 10px; padding: 4px 10px 4px 7px;
  font-family: var(--display); font-weight: 800; font-size: 16px; line-height: 1.1; box-shadow: 3px 3px 0 var(--ink); }
.plabel .pi { font-size: 15px; }
/* pointe de BD vers l'endroit nommé (--ax : abscisse du point visé dans l'étiquette) */
.plabel::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -8px; width: 11px; height: 11px; background: var(--paper);
  border-right: var(--line) solid var(--ink); border-bottom: var(--line) solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.plabel.poi { background: var(--cream); border-left-width: 3px; font-size: 14px; }
#pcap { position: fixed; left: 50%; top: calc(16px + var(--sat)); z-index: 5; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; max-width: calc(100vw - 24px);
  background: var(--ink); color: var(--cream); border-radius: 14px; padding: 8px 16px; font-size: 13px; box-shadow: 3px 3px 0 rgba(0,0,0,.25); }
#pcap b { font-family: var(--display); font-size: 17px; color: var(--sun); }
#pcap span b { font-size: 13px; color: var(--cream); }
#pcap.on { opacity: 1; transform: translate(-50%, 0); }
.touch #pcap span { font-size: 12px; }
body.panorama .plate, body.panorama .topright, body.panorama #banner, body.panorama #b-jump, body.panorama #hint { display: none !important; }
body.flying #b-jump, body.flying #hint { display: none !important; }
.touch .balloon kbd { display: none; }
.balloon .st kbd { background: var(--ink); color: var(--cream); border-radius: 6px; padding: 1px 6px; font-family: var(--display); font-size: 12px; }
@media (max-width: 720px) { .plabel { font-size: 13.5px; padding: 3px 8px 3px 6px; border-left-width: 7px; } .plabel .pi { font-size: 13px; } .plabel.poi { font-size: 12.5px; } }

#gllost { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 60; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
  background: var(--paper); border: var(--line) solid var(--ink); border-radius: var(--r); padding: 14px 18px; box-shadow: var(--shadow); font-size: 17px; max-width: calc(100vw - 32px); }
#fade { position: fixed; inset: 0; background: var(--cream); opacity: 0; pointer-events: none; z-index: 35; transition: opacity .3s; }
#fade.on { opacity: 1; }

@media (max-width: 1000px) { #gamehud { top: calc(248px + var(--sat)); } }
/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .plate { top: calc(10px + var(--sat)); left: calc(10px + var(--sal)); width: min(224px, calc(100vw - 160px)); padding: 7px 10px 8px; border-radius: 14px; }
  .plate-top { font-size: 15px; }
  #quest small { font-size: 10px; }
  .q-row { font-size: 13px; gap: 5px; }
  .intro-list { font-size: 14px; gap: 6px; margin-top: 10px; padding-top: 10px; }
  .il-ic { width: 28px; height: 28px; font-size: 15px; border-radius: 9px; }
  .counters { gap: 4px; font-size: 11px; }
  .topright { top: calc(10px + var(--sat)); right: calc(10px + var(--sar)); gap: 8px; }
  .btns { gap: 6px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); }
  .icon-btn.text { min-width: 38px; padding: 0 8px; font-size: 12px; }
  .icon-btn svg { width: 19px; height: 19px; }
  #minimap { width: 96px; height: 96px; box-shadow: 3px 3px 0 var(--ink); }
  #banner { top: calc(210px + var(--sat)); width: calc(100vw - 20px); }
  #banner strong { font-size: 34px; }
  #gamehud { top: calc(210px + var(--sat)); }
  #gtop { top: calc(10px + var(--sat)); left: 10px; right: 10px; transform: translateY(-20px); max-width: none; min-width: 0; padding: 5px 6px; gap: 7px; border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); }
  #gtop.on { transform: none; }
  .gt-ic { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
  .gt-title { display: none; }
  .gt-score { font-size: 15px; padding: 4px 9px; }
  body.ingame .plate, body.ingame .topright { display: none; }
  body.ingame #gamehud { top: calc(64px + var(--sat)); }
  body.rhythm #gamehud { top: calc(64px + var(--sat)); }
  body.typing #gamehud { top: calc(60px + var(--sat)); }
  .grule { font-size: 16.5px; }
  .gscore b { font-size: 42px; }
  .gh-q { font-size: 17px; padding: 10px 12px; }
  .gh-ans span { font-size: 12px; padding: 6px 4px; }
  .gh-big { font-size: 44px; }
  .gh-timer { font-size: 20px; }
  #toasts { left: 10px; right: 10px; width: auto; top: auto; bottom: calc(172px + var(--sab)); align-items: stretch; }
  .toast { transform: translateY(20px); }
  .toast p { font-size: 13px; }
  #prompt { font-size: 16px; bottom: calc(104px + var(--sab)); max-width: calc(100vw - 24px); padding: 12px 16px; }
  #hint { bottom: calc(172px + var(--sab)); font-size: 13px; }
  .modal { padding: 0; align-items: flex-end; }
  .sheet { width: 100%; max-height: 90vh; border-radius: 24px 24px 0 0; box-shadow: none; border-bottom: 0; padding: 20px 18px calc(18px + var(--sab)); transform: translateY(60px); }
  .card-icon { width: 54px; height: 54px; font-size: 28px; border-radius: 16px; }
  .lead { font-size: 16px; }
  .bullets li { font-size: 14.5px; }
  .stats b { font-size: 21px; }
  .sheet footer .btn { flex: 1 1 auto; }
  #intro { padding: calc(16px + var(--sat)) 16px calc(20px + var(--sab)); background: linear-gradient(0deg, rgba(29,22,51,.6), rgba(29,22,51,0) 70%); }
  .intro-lead { font-size: 16px; padding: 12px 14px; }
  .btn.big { font-size: 19px; padding: 14px 22px; }
  .controls { font-size: 13px; }
  .cv section { grid-template-columns: 1fr; gap: 8px; padding: 18px; }
  .cv-meta { flex-direction: row; align-items: center; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #intro h1 { font-size: 64px; }
  .intro-lead { font-size: 14px; margin-bottom: 12px; }
  .intro-list { display: none; }
  #banner { top: calc(70px + var(--sat)); }
  #banner strong { font-size: 30px; }
  #gamehud { top: 60px; }
  .sheet { max-height: 96vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
