/* radio.css — Page, mise à l'échelle de la radio et écran LCD. */
:root {
  --fond: #f4f2ee;
  --texte: #1d1d1f;
  --discret: #5d5a55;
  --panneau: #ffffff;
  --bord: #d9d4cc;
  --accent: #1f6fb2;
  --scene: #4a4a4c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #161618; --texte: #ececec; --discret: #a8a6a2; --panneau: #222225; --bord: #3a3a3e; --accent: #6fb1ea; --scene: #2b2b2e;
  }
}
:root[data-theme="dark"] {
  --fond: #161618; --texte: #ececec; --discret: #a8a6a2; --panneau: #222225; --bord: #3a3a3e; --accent: #6fb1ea; --scene: #2b2b2e;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { max-width: 1000px; margin: 0 auto; padding: 20px 16px 8px; }
h1 { font-size: 22px; margin: 0 0 4px; }
header p { margin: 0; color: var(--discret); }
main { max-width: 1000px; margin: 0 auto; padding: 8px 16px 40px; }

/* La radio : le SVG occupe toute la largeur, l'écran HTML se pose dessus. */
.radio-cadre { position: relative; background: var(--scene); border-radius: 14px; padding: 0; overflow: hidden; }
.radio-svg { display: block; width: 100%; height: auto; font-family: Cantarell, sans-serif; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.radio-svg .ctl { cursor: pointer; }
.radio-svg .ctl:focus { outline: none; }
.radio-svg .ctl:focus-visible { filter: drop-shadow(0 0 1.2px #7fd3ff) drop-shadow(0 0 1.2px #7fd3ff); }
.radio-svg [aria-disabled="true"] { cursor: default; }
.radio-svg .capuchon { transform-box: fill-box; transform-origin: center; transition: transform .06s, filter .06s; }
.radio-svg .capuchon.enfoncee { transform: scale(.94); filter: brightness(.8); }

/* ---------- Écran LCD ---------- */
.zone-lcd { position: absolute; overflow: hidden; pointer-events: none; }
.lcd { --encre: rgba(28, 18, 6, .8); position: absolute; left: 0; top: 0; width: 200px; height: 100px; transform-origin: 0 0;
  font-family: VT323, "Courier New", monospace; color: var(--encre); line-height: 1; }
.lcd-ombre { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.lcd-contenu { position: absolute; inset: 0; }
.lcd .inv { background: var(--encre); color: #d6923a; padding: 0 2px; }
.lcd .vide { visibility: hidden; padding: 0 2px; }
.lcd .ico { width: 9px; height: 9px; vertical-align: -1px; }

.ligne-haut { position: absolute; left: 3px; top: 3px; right: 3px; display: flex; gap: 5px; font-size: 12px; align-items: center; }
.gauche { position: absolute; left: 3px; top: 18px; width: 82px; font-size: 13px; }
.ligne-veille { display: flex; gap: 3px; align-items: center; height: 13px; margin-bottom: 6px; font-size: 12px; }
.ligne-veille .cadre { border: 1px solid var(--encre); display: inline-flex; gap: 4px; padding-right: 2px; }
.ligne-veille .stby { margin-left: auto; }
.pos { font-size: 14px; letter-spacing: .3px; margin: 1px 0 1px 6px; }
.pos.heure { margin-left: 16px; }
.canal { position: absolute; left: 84px; right: 28px; top: 14px; height: 70px; display: flex; align-items: center; justify-content: flex-end;
  font-weight: normal; letter-spacing: -1px; }
.droite { position: absolute; right: 3px; top: 18px; width: 24px; font-size: 12px; text-align: right; line-height: 15px; }

.touches { position: absolute; left: 1px; right: 1px; bottom: 1px; height: 12px; display: grid; grid-template-columns: 7px repeat(4, 1fr) 7px; gap: 1px;
  font-size: 11px; text-align: center; align-items: center; }
.touches b { font-weight: normal; font-size: 10px; }
.touches span { height: 12px; line-height: 12px; overflow: hidden; white-space: nowrap; }

.fenetre { position: absolute; left: 8px; right: 8px; top: 16px; height: 62px; background: #d6923a; border: 1px solid var(--encre); box-shadow: 0 0 0 1px #d6923a; padding: 4px 6px; }
.fen-titre { display: flex; justify-content: space-between; font-size: 16px; }
.barre { display: flex; align-items: center; gap: 4px; margin-top: 7px; }
.barre .ico { width: 12px; height: 12px; }
.jauge { flex: 1; height: 10px; border: 1px solid var(--encre); border-radius: 5px; overflow: hidden; }
.jauge div { height: 100%; background: var(--encre); }
.grad { display: flex; justify-content: space-between; margin: 4px 4px 0 18px; }
.grad i { width: 1px; height: 2px; background: var(--encre); }

.titre-menu { position: absolute; left: 1px; right: 1px; top: 1px; height: 13px; background: var(--encre); color: #d6923a; display: flex; justify-content: space-between;
  font-size: 13px; padding: 0 3px; }
.liste-menu { position: absolute; left: 2px; right: 2px; top: 16px; }
.ligne-menu { height: 13px; font-size: 13px; display: flex; gap: 2px; padding: 0 3px; white-space: nowrap; }
.ligne-menu.sel { background: var(--encre); color: #d6923a; }
.ligne-menu .lib { flex: 1; overflow: hidden; }
.ligne-menu .coche { width: 9px; }
.canal-menu { font-size: 38px; text-align: center; margin-top: 4px; }
.canal-menu .fleches { display: inline-block; font-size: 10px; line-height: 10px; vertical-align: middle; margin-left: 4px; }

/* Écrans ASN */
.ligne-menu.centre { justify-content: center; }
.ligne-menu.petit { font-size: 11px; }
.ligne-menu .val { white-space: nowrap; }
.titre-menu.alerte { letter-spacing: .5px; }
.asn-statut { display: flex; justify-content: space-between; align-items: center; height: 26px; padding: 0 3px; font-size: 12px; }
.asn-canal { font-size: 30px; letter-spacing: -1px; }
.decompte { font-size: 34px; text-align: center; line-height: 1; margin-top: 2px; }
.mmsi { display: flex; justify-content: center; gap: 2px; font-size: 22px; margin-top: 6px; }
.mmsi span { padding: 0 1px; }
.asn-flash { position: absolute; inset: 0; animation: flash-retro .5s steps(2, start) infinite; }
@keyframes flash-retro { to { background: rgba(255, 240, 200, .55); } }

.clignote { animation: clignote 1s steps(2, start) infinite; }
@keyframes clignote { to { visibility: hidden; } }

/* ---------- Page ---------- */
.lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.message { min-height: 24px; margin: 10px 0 0; color: var(--accent); font-weight: 600; opacity: 0; transition: opacity .2s; }
.message.visible { opacity: 1; }
.erreur { margin-top: 16px; padding: 14px 16px; border: 1px solid #c0392b; border-radius: 10px; background: var(--panneau); }
.panneaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 10px; }
details { background: var(--panneau); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 14px; }
summary { cursor: pointer; font-weight: 600; }
table { border-collapse: collapse; margin-top: 8px; font-size: 14px; }
td { padding: 3px 10px 3px 0; vertical-align: top; }
td:first-child { white-space: nowrap; }
kbd { font: 12px ui-monospace, monospace; border: 1px solid var(--bord); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--fond); }
.test { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 8px; align-items: center; }
.note { color: var(--discret); font-size: 13px; margin: 8px 0 0; }

/* ---------- Exercice (étape 4) ---------- */
button { font: inherit; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button.secondaire { background: transparent; color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
select, input, textarea { font: inherit; color: var(--texte); background: var(--panneau); border: 1px solid var(--bord); border-radius: 6px; padding: 4px 6px; }
/* Pas de zoom au double appui sur les commandes (téléphone). */
button, select, label, .molette-tactile, .radio-cadre { touch-action: manipulation; }
.molette-tactile { display: none; align-items: center; gap: 10px; margin-top: 8px; }
.molette-tactile button { min-width: 48px; min-height: 44px; font-size: 22px; padding: 0 12px; }
@media (pointer: coarse) { .molette-tactile { display: flex; } }
.ex-histoire { border-left: 4px solid var(--accent, #1f5f8b); display: grid; gap: 8px; }
.hi-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.hi-perso { font-weight: 700; }
.hi-pastilles { display: flex; flex-wrap: wrap; gap: 6px; }
.hi-pastille { min-width: 34px; min-height: 34px; padding: 0 8px; border-radius: 99px; background: transparent; color: inherit; border: 1px solid currentColor; opacity: .7; }
.hi-pastille.faite { opacity: 1; background: #2e8b57; border-color: #2e8b57; color: #fff; }
.hi-pastille.actuelle { opacity: 1; outline: 3px solid #e5a43b; outline-offset: 1px; }
.hi-recit { font-size: 17px; line-height: 1.6; max-width: 68ch; margin: 0; }
.hi-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ex-histoire h4 { margin: 6px 0 2px; }
.ex-modele summary { cursor: pointer; color: var(--discret, #5b6c76); }
.ex-modele p { font-family: ui-monospace, "Courier New", monospace; margin: 4px 0; }
.exercice { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ex-barre { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.ex-barre label { max-width: 100%; }
.ex-barre select { max-width: 100%; }
.ex-carte { background: var(--panneau); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 14px; }
.ex-carte h3 { margin: 0 0 6px; font-size: 17px; }
.ex-carte p { margin: 4px 0; }
.ex-progres { color: var(--discret); font-size: 13px; }
.ex-consigne { font-weight: 600; }
.ex-info { color: var(--accent); }
.ex-options { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin: 6px 0; }
.ex-options button { text-align: left; }
.ex-saisie { display: grid; gap: 6px; margin: 6px 0; }
.ex-saisie label { display: grid; grid-template-columns: minmax(90px, 140px) 1fr; gap: 8px; align-items: center; }
.ex-saisie button { justify-self: start; }
.ex-reception:empty { display: none; }
.bulle { background: #0f2a3d; color: #e8f4ff; border-radius: 12px 12px 12px 2px; padding: 10px 14px; max-width: 760px; }
.bulle-tete { font-size: 13px; opacity: .8; margin-bottom: 4px; }
.bulle-texte { font: 15px/1.5 ui-monospace, "Courier New", monospace; }
.bulle-trad { font-size: 14px; margin-top: 6px; opacity: .85; font-style: italic; }
.bulle-asn { background: #3a2f0b; }
.ecoute { margin-top: 22px; border-top: 1px solid var(--bord); padding-top: 12px; }
.ecoute h2 { margin: 0; font-size: 18px; }
.ec-q { margin: 8px 0; }
.ec-q p { margin: 4px 0; }
.ec-choix.juste { outline: 3px solid #2e8b57; }
.ec-choix.fausse { outline: 3px solid #c0392b; }
.ex-rien { color: var(--discret); font-style: italic; margin: 0; }
.ex-emission label { font-weight: 600; }
.ex-ligne { display: flex; gap: 10px; align-items: stretch; margin-top: 4px; }
.ex-ligne textarea { flex: 1; min-width: 0; resize: vertical; font-family: ui-monospace, "Courier New", monospace; }
.ptt { min-width: 110px; background: #8a1c1c; border-color: #8a1c1c; touch-action: none; user-select: none; -webkit-user-select: none; }
.ptt.actif { background: #d23b3b; box-shadow: 0 0 0 3px rgba(210, 59, 59, .35); }
.ex-bilan h4 { margin: 12px 0 4px; }
.ex-criteres, .ex-fautes, .ex-elements { margin: 4px 0; padding-left: 18px; }
.ex-elements { columns: 2 220px; font-size: 13px; }
.ok { color: #1e7d32; } .faux { color: #b3261e; } .manque { color: var(--discret); }
.ex-table { width: 100%; }
.ex-table td:first-child { width: 22px; font-weight: 700; }
.e-ok td:first-child { color: #1e7d32; } .e-faux td:first-child { color: #b3261e; } .e-tard td:first-child { color: #b26a00; }
.ex-table tr { border-top: 1px solid var(--bord); }
.ex-detail { color: var(--texte); font-size: 13px; margin-top: 4px; }
.ex-corrige { font-family: ui-monospace, "Courier New", monospace; font-size: 13px; background: var(--fond); padding: 8px; border-radius: 6px; }
.journal-radio { margin-top: 16px; }
.journal-tete { display: flex; justify-content: space-between; align-items: center; }
.journal-tete h2 { font-size: 18px; margin: 0; }
.journal-defile { max-height: 320px; overflow: auto; border: 1px solid var(--bord); border-radius: 8px; margin-top: 6px; }
.journal { width: 100%; font-size: 13px; margin: 0; }
.journal th { text-align: left; position: sticky; top: 0; background: var(--panneau); padding: 4px 8px; }
.journal td { padding: 3px 8px; border-top: 1px solid var(--bord); }
.journal td:first-child { white-space: nowrap; }
.journal tr.emis td:nth-child(2) { color: var(--accent); }
.journal tr.non-entendu { opacity: .6; }
.journal tr.note-j td { font-style: italic; color: var(--discret); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ok { color: #7bd88f; } :root:not([data-theme="light"]) .faux { color: #ff8a80; } }
:root[data-theme="dark"] .ok { color: #7bd88f; } :root[data-theme="dark"] .faux { color: #ff8a80; }

@media (max-width: 600px) {
  .ex-ligne { flex-direction: column; }
  .ex-barre label:first-child { display: flex; flex-direction: column; gap: 4px; width: 100%; }
  #ex-choix { width: 100%; }
  .ptt { min-height: 56px; }
  h1 { font-size: 18px; }
  .radio-cadre { border-radius: 8px; }
}

/* Lien vers la page d'accueil (version en ligne) */
.retour-accueil{margin:0 0 4px;font-size:.95em}
.retour-accueil a{color:inherit}
