/* Rubrique Piloter : sommaire des missions et lecteur de mission guidée (préfixe ms-) */
#view-fly kbd { display: inline-block; min-width: 1.6em; padding: 0 5px; margin: 0 1px; text-align: center; font-family: var(--mono); font-size: 18px; line-height: 1.15; color: var(--accent); background: #0b0d14; border: 2px solid var(--line); border-bottom-width: 3px; }

/* ---------------------------------------------------------------- sommaire */
.ms-intro .ms-lead { max-width: 820px; margin: 0 0 12px; font-size: 21px; color: #dfe3f2; }
.ms-note { margin: 0 0 10px; padding: 6px 10px; border: 2px dashed var(--accent); color: var(--accent); max-width: 820px; }
.ms-best { color: var(--accent); font-size: 18px; letter-spacing: 2px; }
.ms-cheat { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.ms-cheat-col { background: var(--panel); border: 2px solid var(--line); padding: 4px 14px 12px; }
.ms-cheat-col h3 { margin: 10px 0 6px; font-size: 19px; }
.ms-cheat-col p { margin: 0 0 8px; color: #cfd4e6; }
.ms-cheat dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; margin: 0 0 10px; align-items: center; }
.ms-cheat dt { margin: 0; white-space: nowrap; }
.ms-cheat dd { margin: 0; color: #cfd4e6; }
.ms-check-inline { display: flex; gap: 8px; align-items: center; color: var(--muted); cursor: pointer; }

/* ---------------------------------------------------------------- lecteur */
.ms-player { max-width: 1280px; margin: 0 auto; padding: 8px 12px 24px; }
.ms-top { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 8px; }
.ms-back { color: var(--accent2); text-decoration: none; font-size: 20px; }
.ms-back:hover { color: var(--accent); }
.ms-name { font-size: 24px; color: #fff; }
.ms-n { font-family: var(--px); font-size: 10px; color: var(--accent2); letter-spacing: 1px; margin-right: 6px; }
.ms-top .lvl { color: var(--accent); font-size: 13px; letter-spacing: 2px; }

.ms-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.ms-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.ms-stagewrap { position: relative; }
/* l'image se réduit sur les écrans peu hauts, pour que la consigne de l'instructeur reste visible dessous */
.ms-stage { position: relative; border: 2px solid var(--line); background: #000; aspect-ratio: 16 / 9; overflow: hidden; width: 100%; max-width: max(420px, calc((100vh - 340px) * 16 / 9)); max-width: max(420px, calc((100svh - 340px) * 16 / 9)); margin: 0 auto; }
.ms-cv { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.ms-alarms { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; pointer-events: none; }
.ms-alarms .al.green.on { animation: blink .5s steps(1) infinite; }
.ms-pause { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(8, 10, 18, .45); font-family: var(--px); font-size: 16px; color: #fff; text-shadow: 2px 2px 0 #000; pointer-events: none; }
.ms-pause small { font-family: var(--mono); font-size: 20px; color: var(--accent); text-shadow: none; }

/* indicateur de pente façon PAPI */
.ms-papi { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 5px 8px; background: rgba(5, 7, 12, .72); border: 2px solid var(--line); pointer-events: none; }
.ms-lights { display: flex; gap: 5px; }
.ms-lights i { width: 14px; height: 14px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 6px #ff3b3b; }
.ms-lights i.w { background: #fff; box-shadow: 0 0 6px #fff; }
.ms-papi b { font-weight: normal; font-size: 19px; letter-spacing: 1px; }
.ms-papi[data-s=ok] { border-color: var(--green); } .ms-papi[data-s=ok] b { color: var(--green); }
.ms-papi[data-s=near] { border-color: var(--amber); } .ms-papi[data-s=near] b { color: var(--amber); }
.ms-papi[data-s=far] { border-color: var(--red); } .ms-papi[data-s=far] b { color: var(--red); }

/* cartes : briefing (sur l'image) et bilan (sous l'image) */
.ms-card, .ms-debrief { background: var(--panel); border: 2px solid var(--accent2); border-bottom-width: 4px; padding: 10px 16px 14px; }
.ms-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 24px)); max-height: calc(100% - 16px); overflow: auto; background: rgba(21, 25, 38, .96); }
.ms-card-h { font-family: var(--px); font-size: 10px; letter-spacing: 1px; color: var(--accent2); margin-bottom: 4px; }
.ms-card h2, .ms-debrief h2 { margin: 0 0 6px; font-weight: normal; font-size: 28px; color: #fff; }
.ms-card p, .ms-debrief p { margin: 0 0 8px; }
.ms-goal { color: var(--accent); font-size: 21px; }
.ms-mini { color: var(--muted); }
.ms-card-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ms-card-btns button { font-size: 20px; }
#view-fly button.primary { border-color: var(--accent); color: var(--accent); background: #3a2f10; }
.ms-debrief.ok { border-color: var(--green); }
.ms-debrief.ko { border-color: var(--amber); }
.ms-debrief.ok .ms-card-h { color: var(--green); }
.ms-debrief.ko .ms-card-h { color: var(--amber); }
.ms-stars { color: var(--accent); letter-spacing: 3px; white-space: nowrap; }
.ms-tips { margin: 0 0 10px; padding-left: 22px; color: #cfd4e6; }
.ms-tips li { margin-bottom: 3px; }
.ms-chart { display: block; width: 100%; max-width: 560px; height: auto; image-rendering: pixelated; border: 2px solid var(--line); }
.ms-chart-cap { color: var(--muted); font-size: 17px; margin-top: 4px !important; }
.ms-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.ms-links a { color: var(--accent2); }
.ms-links a:hover { color: var(--accent); }

/* consigne de l'instructeur */
.ms-now { background: var(--panel); border: 2px solid var(--line); border-left: 6px solid var(--accent); padding: 6px 12px 8px; }
.ms-stepn { font-family: var(--px); font-size: 9px; color: var(--accent2); letter-spacing: 1px; margin: 2px 0 4px; }
.ms-say { font-size: 27px; line-height: 1.1; color: #fff; }
.ms-say.flash { animation: ms-flash .9s ease-out; }
@keyframes ms-flash { 0% { color: var(--accent); transform: translateX(6px); } 100% { color: #fff; transform: none; } }
.ms-keys { margin-top: 4px; min-height: 0; }
.ms-keys:empty { display: none; }
.ms-touchhint { color: var(--muted); margin-left: 8px; }
.ms-hint { color: var(--accent2); font-size: 20px; margin-top: 4px; }
.ms-hint:empty { display: none; }
.ms-alert { margin-top: 6px; padding: 4px 8px; background: #3a1414; border: 2px solid var(--red); color: #ffd0d0; font-size: 20px; }
.ms-why { margin-top: 6px; color: var(--muted); font-size: 18px; }
.ms-why:empty { display: none; }
.ms-ended .ms-now, .ms-ended .ms-touch { display: none; }

/* instruments */
.ms-inst { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.ms-i { position: relative; background: var(--panel); border: 2px solid var(--line); padding: 2px 7px 5px; min-width: 0; overflow: hidden; }
.ms-i .k { display: block; font-size: 14px; color: var(--muted); letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-i .v { font-size: 26px; color: var(--text); }
.ms-i .u { font-size: 15px; color: var(--muted); margin-left: 2px; }
.ms-i .ms-cmd { display: block; font-size: 14px; color: var(--accent); white-space: nowrap; }
.ms-i .ms-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #0b0d14; }
.ms-i .ms-bar > i { display: block; height: 100%; width: 0; background: var(--accent2); }
.ms-i[data-k=aoa] .ms-bar > i { background: #ffd36b; }
.ms-i.good { border-color: var(--green); } .ms-i.good .v { color: var(--green); }
.ms-i.caut { border-color: var(--amber); } .ms-i.caut .v { color: var(--amber); }
.ms-i.warn { border-color: var(--red); } .ms-i.warn .v { color: var(--red); }
.ms-i.warn .ms-bar > i { background: var(--red); }

/* barre de boutons */
.ms-ctl { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-ctl button { font-size: 17px; padding: 2px 9px; }
.ms-ctl button.on { border-color: var(--accent); color: var(--accent); }
.ms-kbd { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.ms-kbd kbd { font-size: 15px; }

/* commandes tactiles */
.ms-touch { display: none; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ms-touchon .ms-touch { display: grid; }
.ms-touchon .ms-kbd { display: none; }
.ms-tp { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ms-touch button { font-size: 18px; padding: 6px 4px; touch-action: none; user-select: none; -webkit-user-select: none; }
.ms-tbtn { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ms-tbtn small { font-size: 14px; color: var(--muted); margin-top: 2px; }
.ms-tbtn.on, .ms-touch button:active { border-color: var(--accent); color: var(--accent); background: #3a2f10; }
.ms-tp-thr { background: var(--panel); border: 2px solid var(--line); padding: 4px 8px 6px; justify-content: space-between; }
.ms-tp-thr label { font-size: 17px; color: var(--muted); }
.ms-tp-thr label b { color: var(--accent2); font-weight: normal; }
.ms-thr { width: 100%; height: 34px; margin: 0; touch-action: none; }
.ms-tp-row { display: flex; gap: 6px; }
.ms-tp-row button { flex: 1; font-size: 15px; padding: 4px 2px; }
.ms-tp-sys button { min-height: 0; }

/* panneau instructeur */
.ms-coach { background: var(--panel); border: 2px solid var(--line); padding: 6px 10px 10px; }
.ms-coach-h { font-family: var(--px); font-size: 9px; letter-spacing: 1px; color: var(--accent2); margin: 2px 0 6px; }
.ms-steps { list-style: none; margin: 0 0 8px; padding: 0; }
.ms-steps li { display: flex; gap: 8px; padding: 3px 0; color: var(--muted); border-bottom: 1px dashed var(--line); font-size: 18px; }
.ms-steps li.done { color: var(--green); }
.ms-steps li.cur { color: #fff; }
.ms-tick { flex: 0 0 1.1em; text-align: center; }
.ms-steps li.cur .ms-tick { color: var(--accent); }
.ms-pfdwrap canvas { display: block; width: 100%; image-rendering: pixelated; border: 2px solid #000; }
.ms-legend { margin: 8px 0 0; font-size: 16px; color: var(--muted); }

@media (max-width: 1100px) {
  .ms-inst { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .ms-main { grid-template-columns: minmax(0, 1fr); }
  .ms-card { position: static; transform: none; width: auto; max-height: none; margin-top: 8px; background: var(--panel); }
}
@media (max-width: 640px) {
  .ms-player { padding: 6px 8px 20px; }
  /* téléphone : les instruments juste sous l'image, puis la consigne, puis les boutons à portée de pouce */
  .ms-stagewrap { order: 1; } .ms-debrief { order: 2; } .ms-inst { order: 3; } .ms-now { order: 4; } .ms-touch { order: 5; } .ms-ctl { order: 6; } .ms-kbd { order: 7; }
  .ms-col { gap: 6px; }
  .ms-why { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 16px; cursor: pointer; }
  .ms-why.open { display: block; }
  .ms-hint { font-size: 18px; }
  .ms-inst { gap: 4px; }
  .ms-say { font-size: 23px; }
  .ms-i { padding: 0 4px 3px; }
  .ms-i .v { font-size: 21px; line-height: 1; }
  .ms-i .u { font-size: 13px; }
  .ms-i .k { font-size: 12px; letter-spacing: 0; }
  .ms-i .ms-cmd { font-size: 12px; }
  .ms-papi { padding: 3px 5px; }
  .ms-lights i { width: 10px; height: 10px; }
  .ms-papi b { font-size: 16px; }
  .ms-card h2, .ms-debrief h2 { font-size: 24px; }
  .ms-touch { gap: 6px; }
  .ms-ctl button { font-size: 16px; padding: 2px 6px; }
}
