:root { --encre: #10151c; --jaune: #ffd23f; }
* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #0e1319; color: #fff;
  font-family: 'Segoe UI', system-ui, sans-serif;
  user-select: none;
}

#jeu { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

/* ---------- Affichage en jeu ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

#argent {
  position: absolute; top: 18px; right: 24px;
  font-size: 30px; font-weight: 700; color: #8fe38a;
  font-variant-numeric: tabular-nums;
}
#bilan { position: absolute; top: 56px; right: 24px; font-size: 13px; opacity: .9; white-space: nowrap; }
#bilan b { color: #7cd4ff; font-weight: 600; }

/* Panneau des courses : demande à accepter, ou course en cours */
#courses {
  position: absolute; top: 84px; right: 24px; width: 290px;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(16, 21, 28, .78); border: 1px solid rgba(255, 255, 255, .12);
  font-size: 14px; line-height: 1.45; text-shadow: none;
}
#courses h2 { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
#courses h2 i { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; }
#courses p { margin: 0 0 8px; }
#courses .objet { font-size: 19px; font-weight: 700; }
#courses .calme { margin: 0; color: rgba(255, 255, 255, .65); }
#courses dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0 0 10px; }
#courses dt { color: rgba(255, 255, 255, .55); }
#courses dd { margin: 0; }
#courses .prix { font-size: 28px; font-weight: 800; color: #8fe38a; font-variant-numeric: tabular-nums; }
#courses .choix { margin: 0; display: flex; align-items: center; }
#courses .choix kbd + kbd, #courses .choix kbd:not(:first-child) { margin-left: 14px; }
#courses .temps { height: 4px; margin-top: 12px; border-radius: 2px; background: rgba(255, 255, 255, .15); overflow: hidden; }
#courses .temps i { display: block; height: 100%; background: var(--jaune); transition: width .8s linear; }

#carte {
  position: absolute; left: 24px; bottom: 24px;
  width: 190px; height: 190px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .85);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
  background: #50545b;
}

#compteur {
  position: absolute; right: 28px; bottom: 22px;
  text-align: right; font-style: italic;
  opacity: 0; transition: opacity .25s;
}
#compteur.visible { opacity: 1; }
#vitesse { font-size: 64px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
#compteur small { display: block; font-size: 14px; letter-spacing: .14em; opacity: .85; }
/* Jauge à carburant : E (vide) à gauche, F (plein) à droite */
.reservoir { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin: 12px 0 4px; font-style: normal; font-size: 13px; }
#jauge {
  width: 170px; height: 14px; border-radius: 7px;
  background: rgba(16, 21, 28, .65); border: 2px solid rgba(255, 255, 255, .85); overflow: hidden;
}
#jauge i { display: block; height: 100%; background: #8fe38a; }
#jauge.reserve { border-color: #ff5a47; animation: alerte 1s steps(2) infinite; }
#jauge.reserve i { background: #ff5a47; }
#compteur #litres { font-size: 13px; font-style: normal; letter-spacing: 0; }
@keyframes alerte { 50% { opacity: .45; } }

/* Barre de progression : chargement, déchargement, plein */
#barre {
  position: absolute; left: 50%; bottom: 136px; transform: translateX(-50%); width: min(470px, 92vw);
  padding: 9px 14px 11px; border-radius: 10px;
  background: rgba(16, 21, 28, .78); font-size: 14px; text-align: center; text-shadow: none;
  opacity: 0; transition: opacity .15s;
}
#barre.visible { opacity: 1; }
#barre div { height: 6px; margin-top: 7px; border-radius: 3px; background: rgba(255, 255, 255, .18); overflow: hidden; }
#barre i { display: block; height: 100%; background: var(--jaune); }

#invite {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%);
  padding: 9px 16px; border-radius: 10px;
  background: rgba(16, 21, 28, .72); font-size: 16px; text-shadow: none; white-space: nowrap;
  opacity: 0; transition: opacity .15s;
}
#invite.visible { opacity: 1; }

#annonce {
  position: absolute; left: 50%; top: 17%; transform: translateX(-50%);
  font-size: 26px; font-weight: 700; color: var(--jaune); white-space: nowrap;
  opacity: 0; transition: opacity .3s;
}
#annonce.visible { opacity: 1; }

kbd {
  display: inline-block; min-width: 28px; padding: 2px 8px; margin-right: 6px;
  border-radius: 6px; background: #fff; color: var(--encre);
  font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.5;
  text-align: center; text-shadow: none;
}

/* Rappel discret sur la souris, en bas au centre */
#souris {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  font-size: 13px; white-space: nowrap; opacity: 0; transition: opacity .3s;
}
#souris.visible { opacity: .78; }
#souris kbd { min-width: 0; padding: 1px 6px; margin: 0 3px; font-size: 12px; }

/* Police : indicateur de recherche, procès-verbal */
#avis {
  position: absolute; top: 18px; left: 24px; padding: 8px 14px; border-radius: 10px;
  background: rgba(165, 22, 22, .9); font-size: 14px; text-shadow: none; white-space: nowrap;
  opacity: 0; transition: opacity .2s; animation: gyrophare .9s steps(2) infinite;
}
#avis.visible { opacity: 1; }
#avis b { margin-right: 10px; letter-spacing: .12em; }
#avis span { margin-right: 10px; color: var(--jaune); letter-spacing: .1em; }
@keyframes gyrophare { 50% { background: rgba(25, 62, 175, .92); } }

#proces {
  position: absolute; left: 50%; top: 24%; transform: translateX(-50%); width: min(430px, 92vw);
  padding: 18px 22px; border-radius: 14px; background: rgba(16, 21, 28, .93); border: 2px solid #2a6bff;
  font-size: 15px; text-shadow: none; opacity: 0; transition: opacity .3s;
}
#proces.visible { opacity: 1; }
#proces h2 { margin: 0 0 10px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #8fb4ff; }
#proces ul { list-style: none; margin: 0 0 10px; padding: 0; }
#proces li { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
#proces p { margin: 8px 0 0; }
#proces .total { font-size: 22px; font-weight: 800; color: #ff7a6b; }

/* Écran noir de l'hôpital */
#fondu {
  position: fixed; inset: 0; display: grid; place-content: center; padding: 20px; text-align: center;
  background: #05070a; font-size: 19px; opacity: 0; pointer-events: none; transition: opacity .5s;
}
#fondu.visible { opacity: 1; }
#fondu b { display: block; margin-bottom: 10px; font-size: 30px; }

/* ---------- Écran d'accueil ---------- */
#accueil {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: linear-gradient(rgba(10, 14, 20, .45), rgba(10, 14, 20, .78));
}
#accueil.cache { display: none; }

.panneau {
  width: min(460px, 100%); padding: 30px 34px 26px;
  background: rgba(16, 21, 28, .86); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.sur { margin: 0 0 6px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--jaune); }
h1 { margin: 0 0 14px; font-size: 46px; line-height: 1; font-weight: 800; letter-spacing: -.01em; }
.but { margin: 0 0 20px; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .85); }

.touches { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.touches li { display: grid; grid-template-columns: 170px 1fr; align-items: center; }

#jouer {
  width: 100%; padding: 14px; border: 0; border-radius: 12px;
  background: var(--jaune); color: var(--encre);
  font-family: inherit; font-size: 18px; font-weight: 800; cursor: pointer;
}
#jouer:hover { filter: brightness(1.08); }
#reprise { margin: 0 0 10px; font-size: 14px; color: #8fe38a; text-align: center; }
#reprise:empty { display: none; }
#nouvelle {
  width: 100%; margin-top: 8px; padding: 10px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 12px;
  background: none; color: #fff; font-family: inherit; font-size: 15px; cursor: pointer;
}
#nouvelle:hover { background: rgba(255, 255, 255, .08); }
#invite small { display: block; margin-top: 4px; font-size: 13px; opacity: .8; white-space: normal; text-align: center; }
.note { margin: 14px 0 0; font-size: 13px; color: rgba(255, 255, 255, .6); text-align: center; }
.note a { color: inherit; }
