/* Planes Fighter — interface : tableau de bord sombre, accents ambre et cyan */
:root {
  --ink: #e9f1f8;
  --dim: rgba(233, 241, 248, .66);
  --panel: rgba(10, 18, 30, .86);
  --line: rgba(233, 241, 248, .16);
  --amber: #ffb52e;
  --cyan: #4fe3ff;
  --red: #ff4d43;
  --green: #54e36a;
  --f: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0c1420; color: var(--ink); font: 500 16px/1.4 var(--f); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
[hidden] { display: none !important; }
#stage { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
/* vignette : assombrit les bords, comme un objectif */
#stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, rgba(0, 0, 0, 0) 55%, rgba(4, 10, 20, .34) 100%); }
.hud, .sound, .caption, .menu, .veil, .fatal { z-index: 2; }
/* ordinateur : un peu plus de contraste et de couleur (évité sur mobile, où ce filtre coûte) */
@media (hover: hover) and (pointer: fine) { #gl { filter: contrast(1.07) saturate(1.12); } }
.hurt { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px 30px rgba(255, 40, 30, 0); transition: box-shadow .25s; }
.hurt.on { box-shadow: inset 0 0 90px 30px rgba(255, 40, 30, .55); transition: none; }

/* ── HUD ─────────────────────────────────────────────────────── */
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 12px 0; pointer-events: none; }
.hud-left { display: grid; gap: 6px; min-width: 150px; }
.score { display: flex; align-items: baseline; gap: 8px; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.score small { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.score b { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.armor { width: min(46vw, 200px); height: 12px; background: rgba(10, 18, 30, .7); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; transform: skewX(-18deg); }
.armor i { display: block; height: 100%; background: linear-gradient(90deg, #2fd27a, var(--green)); transform-origin: left; transition: transform .15s; }
.armor i[data-low="true"] { background: var(--red); animation: blink .5s steps(2) infinite; }
.pow { display: flex; gap: 4px; }
.pow i { width: 22px; height: 6px; background: rgba(233, 241, 248, .2); transform: skewX(-18deg); }
.pow[data-lvl="1"] i:nth-child(-n+1), .pow[data-lvl="2"] i:nth-child(-n+2), .pow[data-lvl="3"] i { background: var(--amber); }
.boss { flex: 1; max-width: 420px; text-align: center; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.boss small { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--red); font-weight: 700; }
.boss-bar { height: 9px; margin-top: 3px; background: rgba(10, 18, 30, .7); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.boss-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff7a3a, var(--red)); transform-origin: left; }
.hud-right { display: flex; gap: 8px; margin-right: 52px; pointer-events: auto; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { background: rgba(60, 80, 110, .9); }
.sound { position: absolute; right: 12px; top: max(10px, env(safe-area-inset-top)); z-index: 3; }
.sound .off, .sound[aria-pressed="true"] .on { display: none; }
.sound[aria-pressed="true"] .off { display: block; }
.caption { position: absolute; left: 50%; top: 112px; transform: translateX(-50%); width: max-content; max-width: min(90%, 460px); padding: 8px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 6px; font-weight: 600; font-size: .95rem; text-align: center; pointer-events: none; }

/* ── Menu / hangar ───────────────────────────────────────────── */
.menu { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.title { padding: max(16px, env(safe-area-inset-top)) 18px 0; text-shadow: 0 2px 14px rgba(0, 0, 0, .55); }
.title h1 { margin: 0; font-size: clamp(2.4rem, 9vw, 4.2rem); line-height: .92; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; font-style: italic; }
.title h1::first-line { color: var(--amber); }
.link { pointer-events: auto; margin-top: 8px; padding: 5px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; font-weight: 600; }
.link:active { background: rgba(60, 80, 110, .9); }
.credits dl { margin: 0; display: grid; gap: 4px; }
.credits dt { margin-top: 8px; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.credits dd { margin: 0; font-weight: 600; line-height: 1.35; }
.credits small { font-weight: 500; color: var(--dim); }
.ver { margin-top: 6px; font-size: .72rem; color: var(--dim); }
.panel { pointer-events: auto; width: min(560px, 100% - 20px); margin: 0 auto max(12px, env(safe-area-inset-bottom)); padding: 12px; display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); position: relative; }
.purse { position: absolute; right: 12px; top: -34px; display: flex; align-items: center; gap: 6px; padding: 4px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe08a, var(--amber) 60%, #a86a00); }
.hangar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: stretch; }
.arrow { background: rgba(233, 241, 248, .07); border: 1px solid var(--line); border-radius: 10px; font-size: 1.8rem; line-height: 1; font-weight: 700; }
.arrow:active { background: rgba(233, 241, 248, .2); }
.plane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.plane-head b { font-size: 1.2rem; font-weight: 700; }
.plane-head small { color: var(--dim); font-size: .78rem; white-space: nowrap; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; margin: 8px 0 6px; align-items: center; }
.stats dt { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.stats dd { margin: 0; height: 7px; background: rgba(233, 241, 248, .13); border-radius: 2px; overflow: hidden; }
.stats dd i { display: block; height: 100%; background: linear-gradient(90deg, #2aa8d8, var(--cyan)); transform-origin: left; transition: transform .25s; }
.plane-state { font-size: .86rem; color: var(--amber); font-weight: 600; }
.worlds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.world { display: grid; gap: 2px; padding: 7px 8px; text-align: left; background: rgba(233, 241, 248, .06); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.world b { font-weight: 700; font-size: .95rem; }
.world small { font-size: .7rem; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.world[data-state="on"] { border-color: var(--amber); background: rgba(255, 181, 46, .16); }
.world[data-state="locked"] { opacity: .45; }
.world[hidden] { display: none; }
.cta { width: 100%; min-height: 54px; padding: 12px 16px; border: 0; border-radius: 12px; background: linear-gradient(180deg, #ffc655, var(--amber)); color: #1a1205; font-size: 1.18rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.cta:active { filter: brightness(.92); transform: translateY(1px); }
.cta[data-state="buy"] { background: linear-gradient(180deg, #7cf0ff, var(--cyan)); color: #04222b; }
.cta[data-state="short"] { background: rgba(233, 241, 248, .14); color: var(--dim); }
.cta.nope { animation: nope .28s; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── Feuilles (résultat, pause) ──────────────────────────────── */
.veil { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(6, 12, 22, .55); }
.sheet { width: min(420px, 100%); padding: 20px; display: grid; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; text-align: center; }
.sheet h2 { margin: 0; font-size: 1.7rem; font-weight: 700; text-transform: uppercase; font-style: italic; }
.sheet p { margin: 0; color: var(--dim); }
.gain { font-size: 1.5rem; font-weight: 700; color: var(--amber); }
.quiet { padding: 10px; background: none; border: 1px solid var(--line); border-radius: 12px; font-weight: 600; }
.fatal { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; padding: 28px; background: #0c1420; text-align: center; }

@keyframes blink { 50% { opacity: .35; } }
@keyframes nope { 25% { translate: -5px 0; } 75% { translate: 5px 0; } }

/* Écran large : le hangar se range en bas à droite, l'avion reste visible au centre */
@media (min-width: 900px) and (min-height: 520px) {
  .panel { margin-right: 24px; margin-bottom: 24px; width: 460px; }
  .title { padding: 28px 32px 0; }
}
/* Téléphone couché : panneau compact */
@media (max-height: 480px) {
  .title h1 { font-size: 1.9rem; }
  .title h1 br { display: none; }
  .panel { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); width: min(760px, 100% - 20px); padding: 8px; gap: 8px; }
  .hangar { grid-row: span 2; }
  .stats { margin: 4px 0; gap: 3px 8px; }
  .cta { min-height: 44px; padding: 8px; font-size: 1rem; }
  .world small { display: none; }
  .caption { top: 64px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Hall of fame (classes mbh-*, voir /css/hall.css) : dans le hangar, sous le titre */
.mbh, .mbh-board, .mbh-toast { --mbh-accent: var(--amber); --mbh-radius: 10px; --mbh-row: rgba(10, 18, 30, .72); --mbh-me: rgba(79, 227, 255, .18); }
.title .mbh { max-width: 340px; margin-top: 10px; text-shadow: none; }
.title .mbh-row { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid var(--line); }
.mbh-board-head h2 { font-style: italic; text-transform: uppercase; }
@media (max-height: 560px) { .title .mbh-podium, .title .mbh-me { display: none; } }
