/* © 2026 Alexandre Authier · Icarus · code propriétaire. */
:root {
  --encre: #2A1E3A;
  --creme: #FFF6E8;
  --terre: #C8553D;
  --or: #FFC94A;
  --voile: rgba(42, 30, 58, 0.55);
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #FFD9BE;
  overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none;
  font-family: "Trebuchet MS", system-ui, sans-serif; color: var(--encre);
}
.jeu { position: fixed; inset: 0; }
.jeu canvas { display: block; width: 100%; height: 100%; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; }

.hud {
  position: fixed; left: 0; right: 0; top: calc(var(--haut) + 12px);
  display: flex; justify-content: space-between; align-items: flex-start; padding: 0 16px;
  pointer-events: none;
}
.hud button { pointer-events: auto; }
.altitude { font-size: 34px; font-weight: 800; color: var(--creme); text-shadow: 0 2px 0 rgba(42, 30, 58, .35); line-height: 1; }
.etape { font-size: 14px; font-weight: 800; color: var(--creme); opacity: .95; text-shadow: 0 1px 0 rgba(42, 30, 58, .35); margin-top: 4px; }
.rond {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 246, 232, .85); box-shadow: 0 3px 0 rgba(42, 30, 58, .25);
}
.rond svg { width: 20px; height: 20px; fill: var(--encre); }
.fps { position: fixed; left: 16px; bottom: calc(var(--bas) + 8px); font: 12px monospace; color: var(--creme); }

.annonce {
  position: fixed; left: 16px; right: 16px; top: 26%; text-align: center; pointer-events: none;
  color: var(--creme); text-shadow: 0 3px 0 rgba(42, 30, 58, .35); opacity: 0;
}
.annonce-titre { font-size: 32px; font-weight: 800; letter-spacing: .02em; }
.annonce-sous { font-size: 18px; font-weight: 700; margin-top: 6px; }
.annonce.visible { animation: annonce 2.8s ease-out; }
@keyframes annonce { 0% { opacity: 0; transform: scale(.85); } 12% { opacity: 1; transform: scale(1.06); } 20%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* La barre vers le soleil, sur le bord droit : un trait par étape, Icare, le record. */
.barre {
  position: fixed; right: 12px; top: calc(var(--haut) + 76px); bottom: calc(var(--bas) + 70px); width: 6px;
  border-radius: 3px; background: rgba(255, 246, 232, .35); pointer-events: none;
}
.barre i { position: absolute; left: -3px; width: 12px; height: 2px; margin-bottom: -1px; background: rgba(255, 246, 232, .8); }
.barre-soleil { position: absolute; top: -18px; left: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--or); box-shadow: 0 0 10px var(--or); }
.barre-record { position: absolute; left: -5px; width: 16px; height: 3px; margin-bottom: -1px; background: var(--terre); }
.barre-joueur { position: absolute; left: -5px; width: 16px; height: 16px; margin-bottom: -8px; border-radius: 50%; background: var(--creme); border: 3px solid var(--terre); transition: bottom .1s linear; }

.message {
  position: fixed; left: 0; right: 0; top: 40%; text-align: center; pointer-events: none;
  font-size: 22px; font-weight: 800; color: var(--creme); text-shadow: 0 2px 0 rgba(42, 30, 58, .4);
  opacity: 0; transition: opacity .25s;
}
.message.visible { opacity: 1; }
.message.chute { font-size: 40px; color: #FFE1D6; }

/* Le curseur du mode « doigt » : une glissière sous le pouce. */
.curseur {
  position: fixed; width: 110px; height: 34px; margin: -17px 0 0 -55px; border-radius: 17px;
  background: rgba(255, 246, 232, .22); border: 2px solid rgba(255, 246, 232, .5); pointer-events: none;
}
.curseur-point {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; background: rgba(255, 246, 232, .9);
}

.plumes { position: fixed; left: 0; right: 0; bottom: calc(var(--bas) + 22px); display: flex; justify-content: center; gap: 10px; pointer-events: none; }
.plumes i { width: 14px; height: 22px; border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; background: var(--creme); box-shadow: 0 2px 0 rgba(42, 30, 58, .3); transition: opacity .2s, transform .2s; }
.plumes i.vide { opacity: .25; transform: scale(.8); }

.voile { position: fixed; inset: 0; background: var(--voile); display: grid; place-items: center; padding: 16px; }
.accueil { place-items: center; align-content: space-between; padding: calc(var(--haut) + 18vh) 24px calc(var(--bas) + 12vh); background: linear-gradient(rgba(42, 30, 58, .1), rgba(42, 30, 58, .5)); cursor: pointer; }
.titre { font-size: 58px; font-weight: 800; letter-spacing: .14em; color: var(--creme); text-shadow: 0 4px 0 var(--terre); }
.regles { max-width: 320px; text-align: center; color: var(--creme); font-size: 17px; line-height: 1.45; text-shadow: 0 1px 2px rgba(42, 30, 58, .6); }
.regles .petit { opacity: .9; }
.accueil-action { font-size: 20px; font-weight: 800; color: var(--creme); animation: respire 1.6s ease-in-out infinite; }
@keyframes respire { 50% { opacity: .55; transform: scale(.97); } }

.carte {
  width: min(360px, 100%); background: var(--creme); border-radius: 22px; padding: 22px 20px;
  box-shadow: 0 6px 0 rgba(42, 30, 58, .3); text-align: center;
}
.carte h1 { margin: 0 0 8px; font-size: 38px; color: var(--terre); letter-spacing: .06em; }
.carte h2 { margin: 0 0 8px; font-size: 24px; }
.carte p { margin: 8px 0; line-height: 1.4; }
.carte ul { text-align: left; padding-left: 20px; line-height: 1.7; }
.petit { font-size: 13px; opacity: .75; }
.large {
  display: block; width: 100%; margin-top: 10px; padding: 14px; border-radius: 14px;
  background: var(--terre); color: var(--creme); font-weight: 800; box-shadow: 0 3px 0 rgba(42, 30, 58, .25);
}
.large.secondaire { background: #E9DCC5; color: var(--encre); }
.large.danger { background: transparent; color: var(--terre); box-shadow: none; text-decoration: underline; }
