/* Prompteur — thème « scène » : sombre, contrasté, gros boutons.
   Couleurs : ambre (#ffb000) et cyan (#4cc3ff), lisibles par les daltoniens ;
   un état n'est jamais porté par la couleur seule (✓ ▲ ▼ ◆ ▶ ⏸ ⚠). */
:root {
  --fond: #0b0b0f; --fond2: #16161d; --fond3: #22222c; --ligne: #34343f;
  --texte: #f4f4f6; --doux: #a3a3b2; --ambre: #ffb000; --cyan: #4cc3ff; --danger: #ff8a65;
  --rayon: 14px; --pied: calc(64px + env(safe-area-inset-bottom));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: var(--pied); }
a { color: var(--cyan); }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; }
h2 { font-size: 1.15rem; margin: 1.6em 0 .5em; color: var(--ambre); }
h3 { font-size: 1rem; margin: 1.4em 0 .4em; }
.ic { display: inline-block; vertical-align: middle; flex: none; }
[hidden] { display: none !important; }

.entete { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: rgba(11, 11, 15, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--fond3); }
.marque { display: flex; align-items: center; gap: 10px; color: var(--texte); text-decoration: none; font-weight: 800; letter-spacing: .02em; font-size: 1.1rem; }
.page { max-width: 920px; margin: 0 auto; padding: 16px; }
.titre-page { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.titre-page h1 { flex: 1; margin: .2em 0; }
.titre-champ { flex: 1; min-width: 180px; font-size: 1.4rem !important; font-weight: 700; }

/* onglets du bas */
.onglets-app { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: rgba(16, 16, 22, .97); border-top: 1px solid var(--ligne); padding-bottom: env(safe-area-inset-bottom); }
.onglets-app a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 2px 8px; color: var(--doux); text-decoration: none; font-size: .72rem; font-weight: 600; border-top: 3px solid transparent; }
.onglets-app a .ic { width: 24px; height: 24px; }
.onglets-app a.actif { color: var(--ambre); border-top-color: var(--ambre); }
body.en-scene .onglets-app, body.en-scene .entete { display: none; }

/* boutons, champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--ligne); background: var(--fond3); color: var(--texte); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; user-select: none; }
.btn:hover { border-color: var(--doux); }
.btn:active { transform: translateY(1px); }
.btn.primaire { background: var(--ambre); border-color: var(--ambre); color: #141414; }
.btn.danger { color: var(--danger); border-color: #5a3329; background: transparent; }
.btn.petit { min-height: 36px; min-width: 36px; padding: 4px 8px; border-radius: 10px; }
.btn.gros { min-height: 58px; padding: 10px 26px; font-size: 1.15rem; border-radius: 16px; }
.btn.rond { min-width: 46px; padding: 8px; border-radius: 50%; }
.btn.large { width: 100%; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--texte); background: var(--fond2); border: 1px solid var(--ligne); border-radius: 10px; padding: 9px 11px; min-height: 44px; max-width: 100%; }
input[type=range] { padding: 0; accent-color: var(--ambre); width: 100%; min-height: 32px; background: none; border: 0; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--ambre); flex: none; }
textarea { width: 100%; min-height: 50vh; font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: 15px; line-height: 1.5; resize: vertical; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--doux); font-weight: 600; }
label.case { flex-direction: row; align-items: center; gap: 10px; color: var(--texte); font-weight: 500; font-size: .95rem; }
label.large, .large { grid-column: 1 / -1; }
.rang { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.rang.serre { gap: 4px; margin: 0; flex-wrap: nowrap; }
.rang.centre { justify-content: center; }
.rang.pied { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--fond3); }
.grandit { flex: 1; min-width: 0; }
.aide { color: var(--doux); font-size: .92rem; }
.centre { text-align: center; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.grille-reglages { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 20px; margin: 16px 0; }
output { color: var(--ambre); font-weight: 700; }
.transpo { min-width: 4.5em; text-align: center; display: inline-block; white-space: nowrap; }

/* listes */
.liste-morceaux, .setlist { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.liste-morceaux li, .setlist li { display: flex; align-items: center; gap: 10px; background: var(--fond2); border: 1px solid var(--fond3); border-radius: var(--rayon); padding: 8px 8px 8px 14px; }
.liste-morceaux li.vide, .setlist li.vide { color: var(--doux); padding: 18px; justify-content: center; }
.morceau-lien { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--texte); text-decoration: none; padding: 4px 0; }
.morceau-lien b { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.morceau-lien small { color: var(--doux); }
.setlist .num { font-size: 1.3rem; font-weight: 800; color: var(--ambre); min-width: 1.6em; text-align: center; }
.alerte { color: var(--ambre); font-weight: 700; white-space: nowrap; }
.total { color: var(--doux); font-weight: 600; margin: 8px 0; }

/* éditeur */
.onglets { display: flex; gap: 4px; margin: 18px 0 0; border-bottom: 1px solid var(--ligne); }
.onglet { background: none; border: 0; color: var(--doux); font: inherit; font-weight: 700; padding: 10px 16px; border-bottom: 3px solid transparent; cursor: pointer; min-height: 44px; }
.onglet.actif { color: var(--texte); border-bottom-color: var(--ambre); }
.vue-o { padding-top: 12px; }
.apercu { background: #000; border-radius: var(--rayon); padding: 20px; font-size: 22px; line-height: 1.35; }
.aide-syntaxe { margin-top: 10px; color: var(--doux); }
.aide-syntaxe summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.aide-syntaxe td { padding: 4px 14px 4px 0; vertical-align: top; }
code, kbd { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--fond3); border-radius: 6px; padding: 1px 6px; color: var(--texte); font-size: .9em; }
kbd { border: 1px solid var(--ligne); border-bottom-width: 2px; }
.enregistre { color: var(--doux); font-size: .85rem; }
.enregistre.pulse { animation: pulse .8s; }
@keyframes pulse { 0% { color: var(--ambre); } 100% { color: var(--doux); } }

/* paroles (prompteur, aperçu, impression) */
.b-vide { height: .55em; }
.b-section { margin: .5em 0 .15em; }
.b-section span { display: inline-block; font-size: .55em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border: 2px solid currentColor; border-radius: 8px; padding: .05em .5em; color: var(--cyan); }
.b-note { font-size: .62em; font-style: italic; color: var(--doux); border-left: 4px dashed var(--doux); padding: .1em .6em; margin: .25em 0; }
.b-arret { font-size: .6em; font-weight: 800; letter-spacing: .06em; color: #141414; background: var(--ambre); border-radius: 8px; padding: .2em .6em; margin: .4em 0; display: inline-block; }
.b-accords { display: flex; flex-wrap: wrap; gap: .3em .9em; }
.b-ligne.avec-accords { margin-top: .15em; }
/* l'accord au-dessus de son mot : bloc en ligne dont la ligne de base est celle du mot */
.seg { display: inline-block; }
.seg .ac { display: block; white-space: nowrap; padding-right: .35em; }
.seg .ly { display: block; white-space: pre; }
.ac { color: var(--ambre); font-weight: 800; font-size: .62em; font-family: ui-monospace, Menlo, Consolas, monospace; line-height: 1.1; text-transform: none !important; letter-spacing: 0; }
.b-accords .ac { font-size: .7em; }
.majuscules .b-ligne { text-transform: uppercase; }

/* ——— la scène */
.scene { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; overflow: hidden; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.scene.theme-ambre { color: #ffc24a; }
.scene.theme-blanc { background: #fff; color: #000; }
.scene.theme-blanc .ac { color: #9a4d00; }
.scene.theme-blanc .b-section span { color: #00589c; }
.scene.theme-blanc .b-note { color: #444; border-color: #444; }
.scene.theme-ambre .ac { color: #fff; }
.sc-fenetre { position: absolute; inset: 0; overflow: hidden; cursor: grab; }
.sc-fenetre.miroir-h { transform: scaleX(-1); }
.sc-fenetre.miroir-v { transform: scaleY(-1); }
.sc-fenetre.miroir-h.miroir-v { transform: scale(-1, -1); }
.sc-texte { will-change: transform; }
.sc-contenu { position: relative; font-weight: 600; overflow-wrap: break-word; }
.sc-guide { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed rgba(255, 176, 0, .35); pointer-events: none; }
.sc-guide span { position: absolute; left: 4px; top: -.75em; color: var(--ambre); font-size: 22px; }
.theme-blanc .sc-guide { border-top-color: rgba(154, 77, 0, .4); }
.sc-ctl { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(12, 12, 16, .82); backdrop-filter: blur(6px); color: #fff; transition: opacity .35s, transform .35s; z-index: 3; }
.sc-haut { top: 0; padding-top: calc(10px + env(safe-area-inset-top)); }
.sc-bas { bottom: 0; justify-content: center; flex-wrap: wrap; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.ctl-caches .sc-ctl { opacity: 0; pointer-events: none; }
.ctl-caches .sc-haut { transform: translateY(-100%); }
.ctl-caches .sc-bas { transform: translateY(100%); }
.sc-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc-titre b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.05rem; }
.sc-titre small { color: var(--doux); }
.sc-horloge { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.2rem; color: var(--doux); }
.sc-b { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border-radius: 12px; border: 1px solid #3a3a46; background: #1d1d26; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.sc-lecture { min-width: 66px; min-height: 58px; background: var(--ambre); color: #141414; border-color: var(--ambre); border-radius: 18px; }
.sc-grp { display: inline-flex; align-items: center; gap: 4px; }
.sc-vitesse { min-width: 3.4em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--ambre); font-size: .95rem; }
.sc-progres { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .08); z-index: 2; }
.sc-progres i { display: block; height: 100%; background: var(--ambre); width: 0; }
.sc-temps { position: absolute; right: 12px; bottom: 10px; z-index: 2; font-variant-numeric: tabular-nums; font-size: .95rem; color: var(--doux); background: rgba(0, 0, 0, .55); padding: 2px 8px; border-radius: 8px; }
.ctl-caches .sc-temps { opacity: .8; }
:not(.ctl-caches) > .sc-temps { bottom: 96px; }
.sc-bandeau { position: absolute; left: 50%; transform: translateX(-50%); z-index: 2; background: var(--ambre); color: #141414; font-weight: 800; font-size: 1.3rem; padding: 8px 18px; border-radius: 14px; box-shadow: 0 6px 30px rgba(0, 0, 0, .6); white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.sc-bandeau small { font-weight: 600; font-size: .75em; }
.sc-carte { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .78); padding: 20px; }
.carte-in { background: #15151c; border: 1px solid #33333f; border-radius: 22px; padding: 26px 30px; max-width: 560px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; color: #fff; }
.carte-in h2 { margin: 0; color: #fff; font-size: 2rem; line-height: 1.15; }
.carte-num { color: var(--ambre); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
.carte-artiste { color: var(--doux); font-size: 1.1rem; }
.carte-infos { font-size: 1.15rem; }
.carte-infos b { color: var(--ambre); }
.carte-alerte { background: rgba(255, 176, 0, .12); border: 2px solid var(--ambre); border-radius: 12px; padding: 6px 12px; font-weight: 600; }
.carte-notes { color: #ddd; font-style: italic; border-left: 4px dashed var(--doux); padding-left: 10px; text-align: left; align-self: stretch; }
.carte-aide { color: var(--doux); font-size: .85rem; }
.decompte { font-size: min(40vh, 60vw); font-weight: 900; color: var(--ambre); line-height: 1; font-variant-numeric: tabular-nums; }

/* ——— accordeur */
.acc-ecran { background: var(--fond2); border: 1px solid var(--fond3); border-radius: 22px; padding: 18px; text-align: center; margin: 12px 0; }
.acc-note { font-size: 5.5rem; font-weight: 900; line-height: 1; }
.acc-octave { font-size: 1.6rem; color: var(--doux); margin-left: 4px; }
.acc-jauge { width: 100%; max-width: 420px; display: block; margin: 6px auto 0; }
.j-arc { fill: none; stroke: var(--ligne); stroke-width: 3; }
.j-trait { stroke: var(--doux); stroke-width: 2; }
.j-centre { stroke: var(--texte); stroke-width: 4; }
.j-lbl { fill: var(--doux); font-size: 12px; }
.j-aiguille { transform-origin: 150px 130px; transform-box: view-box; transition: transform .12s linear; }
.j-aiguille line { stroke: var(--ambre); stroke-width: 4; stroke-linecap: round; }
.j-aiguille circle { fill: var(--ambre); }
[data-etat=juste] .j-aiguille line { stroke: var(--cyan); stroke-width: 6; }
[data-etat=juste] .j-aiguille circle { fill: var(--cyan); }
.acc-verdict { font-size: 1.35rem; min-height: 2em; margin-top: 6px; }
[data-etat=juste] .acc-verdict b { color: var(--cyan); font-size: 1.15em; }
[data-etat=bas] .acc-verdict b, [data-etat=haut] .acc-verdict b { color: var(--ambre); }
.acc-details { color: var(--doux); font-variant-numeric: tabular-nums; min-height: 1.4em; }
.muet .acc-note, .muet .j-aiguille, .muet .acc-verdict, .muet .acc-details { opacity: .35; }
.acc-la { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--doux); font-weight: 600; align-self: flex-end; }
.acc-la b { color: var(--texte); }
.acc-cordes { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.corde { display: flex; flex-direction: column; align-items: center; min-width: 50px; padding: 8px 6px; border-radius: 14px; border: 2px solid var(--ligne); background: var(--fond3); color: var(--texte); font: inherit; font-weight: 800; font-size: 1.15rem; cursor: pointer; }
.corde small { font-size: .7rem; color: var(--doux); font-weight: 600; }
.corde.jouee { border-color: var(--texte); }
.corde.visee { border-color: var(--ambre); border-style: double; border-width: 4px; }
.corde.visee::after { content: '◎ visée'; font-size: .6rem; color: var(--ambre); }

/* ——— métronome */
.metro-zone { background: var(--fond2); border: 1px solid var(--fond3); border-radius: 22px; padding: 22px; text-align: center; transition: background .05s; }
.metro-zone.flash { animation: flash .18s; }
.metro-zone.flash-un { animation: flash-un .22s; }
@keyframes flash { from { background: #3a3a48; } }
@keyframes flash-un { from { background: var(--ambre); } }
.metro-temps { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; min-height: 40px; align-items: center; }
.metro-temps i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--doux); }
.metro-temps i.un { border-radius: 6px; width: 32px; height: 32px; }
.metro-temps i.on { background: var(--texte); border-color: var(--texte); transform: scale(1.25); }
.metro-temps i.un.on { background: var(--ambre); border-color: var(--ambre); }
.metro-bpm output { display: block; font-size: 5.5rem; font-weight: 900; line-height: 1; color: var(--texte); font-variant-numeric: tabular-nums; }
.metro-bpm small { color: var(--doux); font-size: 1rem; }
.metro-zone .rang { margin: 16px 0; }
.metro-tap { margin-top: 12px; min-height: 64px; font-size: 1.15rem; }

/* ——— échauffement */
.ech-ecran { background: var(--fond2); border: 1px solid var(--fond3); border-radius: 22px; padding: 22px; text-align: center; margin: 12px 0; }
.ech-conseil { color: var(--doux); font-size: 1.05rem; }
.ech-note { font-size: 2.6rem; font-weight: 900; margin: 10px 0; }
.ech-progres { height: 8px; border-radius: 4px; background: var(--fond3); overflow: hidden; }
.ech-progres i { display: block; height: 100%; width: 0; background: var(--ambre); }

/* ——— accords */
.grille-diagrammes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin: 14px 0; }
.grille-diagrammes.un { grid-template-columns: minmax(140px, 200px); }
.grille-diagrammes figure { margin: 0; text-align: center; }
.grille-diagrammes figcaption { color: var(--doux); font-size: .8rem; }
.diagramme { width: 100%; background: var(--fond2); border-radius: 12px; }
.dg-nom { fill: var(--ambre); font-weight: 800; font-size: 15px; font-family: ui-monospace, Menlo, monospace; }
.dg-petit { fill: var(--doux); font-size: 11px; }
.dg-corde, .dg-frette { stroke: var(--doux); stroke-width: 1; }
.dg-sillet { stroke: var(--texte); stroke-width: 4; }
.dg-doigt { fill: var(--texte); }
.dg-vide { fill: none; stroke: var(--texte); stroke-width: 1.5; }
.notes-racines { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }

/* ——— Plus */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tuile { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 18px; background: var(--fond2); border: 1px solid var(--fond3); color: var(--texte); text-decoration: none; }
.tuile span { font-size: 2rem; }
.tuile small { color: var(--doux); }
.tuile:hover { border-color: var(--ambre); }
.sac fieldset { border: 1px solid var(--fond3); border-radius: var(--rayon); margin: 12px 0; padding: 8px 14px 12px; background: var(--fond2); }
.sac legend { color: var(--ambre); font-weight: 800; padding: 0 6px; }
.coche { flex-direction: row; align-items: center; gap: 12px; padding: 8px 0; color: var(--texte); font-size: 1rem; font-weight: 500; border-bottom: 1px solid var(--fond3); cursor: pointer; }
.coche:last-of-type { border-bottom: 0; }
.coche > input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.coche .boite { width: 28px; height: 28px; border: 2px solid var(--doux); border-radius: 8px; display: grid; place-items: center; font-weight: 900; flex: none; }
.coche.ok .boite { background: var(--ambre); border-color: var(--ambre); color: #141414; }
.coche.ok > span:last-child { color: var(--doux); text-decoration: line-through; }
.coche:focus-within .boite { outline: 3px solid var(--cyan); outline-offset: 2px; }
.compteur { font-weight: 800; font-size: 1.1rem; }
.prose li { margin: .5em 0; }
.test-pedale { border: 2px dashed var(--ligne); border-radius: var(--rayon); padding: 20px; text-align: center; color: var(--doux); cursor: pointer; }
.test-pedale:focus { border-color: var(--ambre); color: var(--texte); }
.raccourcis td { padding: 5px 16px 5px 0; }

/* dialogues, messages */
.dlg { background: var(--fond2); color: var(--texte); border: 1px solid var(--ligne); border-radius: 18px; padding: 22px; max-width: 420px; }
.dlg::backdrop { background: rgba(0, 0, 0, .6); }
.dlg .rang { justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: calc(var(--pied) + 14px); transform: translate(-50%, 20px); opacity: 0; background: var(--texte); color: #111; padding: 10px 18px; border-radius: 12px; font-weight: 600; z-index: 200; transition: .25s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .sc-bas { gap: 6px; padding-left: 6px; padding-right: 6px; }
  .sc-b { min-width: 42px; min-height: 44px; }
  .sc-bas [data-a=miroir], .sc-bas [data-a=plein] { display: none; }
  .carte-in h2 { font-size: 1.5rem; }
  .acc-note, .metro-bpm output { font-size: 4.2rem; }
}

/* impression : la copie de secours et la setlist géante */
#impression { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; padding: 0; }
  body > *:not(#impression) { display: none !important; }
  #impression { display: block; }
  .feuille { break-after: page; font-size: 13pt; color: #000; }
  .feuille h1 { font-size: 20pt; margin: 0; }
  .feuille .infos { color: #444; margin: 2pt 0 10pt; }
  .feuille .paroles { columns: 2; column-gap: 12mm; line-height: 1.3; }
  .feuille .b-ligne { break-inside: avoid; }
  .feuille .ac { color: #000; text-decoration: underline; }
  .feuille .b-section span { color: #000; }
  .feuille .b-note { color: #333; border-color: #333; }
  .setlist-geante h1 { font-size: 26pt; text-align: center; margin-bottom: 8mm; }
  .setlist-geante ol { list-style: none; padding: 0; margin: 0; }
  .setlist-geante li { font-size: 36pt; font-weight: 900; line-height: 1.15; margin: 0 0 5mm; }
  .setlist-geante .n { display: inline-block; min-width: 1.5em; }
  .setlist-geante small { font-size: 18pt; font-weight: 600; color: #333; }
}
