/*
 * Tac au tac — styles de l'app (repris du prototype validé).
 * Les couleurs et les polices viennent de apps/tacautac/app.json,
 * injectées par noyau/identite.php sur :root (--fond, --accent...).
 * Ici, on ne fait que donner aux jetons de l'identité les noms
 * qu'utilise le prototype : cobalt pour ta réplique, munition pour
 * le surligneur.
 */
:root {
  --cobalt: var(--accent);
  --sur-cobalt: var(--sur-accent);
  --cobalt-doux: color-mix(in srgb, var(--accent) 9%, transparent);
  --munition: var(--accent2);
  --sur-munition: var(--sur-accent2);
  --titre: var(--police-titre);
  --texte: var(--police-texte);
  /* Couleurs des trois courbes du graphique d'entraînement */
  --s1: #3448D8; --s2: #B8740F; --s3: #13866C;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) { --s1: #6F7DEB; --s2: #C0862A; --s3: #2F9E83; }
}
:root[data-theme="sombre"] { --s1: #6F7DEB; --s2: #C0862A; --s3: #2F9E83; }
html, body { height: 100%; }
body { background: var(--fond); color: var(--encre); font: 400 16px/1.55 var(--texte); -webkit-font-smoothing: antialiased; margin: 0; }
* { box-sizing: border-box; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }

.app { max-width: 480px; margin: 0 auto; padding-inline: 18px; padding-block: 16px 110px; min-height: 100%; display: flex; flex-direction: column; gap: 22px; }
.app.plein { padding-block-end: 32px; }
.marque { font-family: var(--titre); font-weight: 900; font-stretch: 72%; font-size: 27px; letter-spacing: -0.01em; text-transform: uppercase; line-height: 1; }
.marque span { color: var(--cobalt); }
.surtitre { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gris); font-weight: 700; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--titre); font-weight: 850; font-stretch: 80%; font-size: clamp(30px, 8.6vw, 40px); line-height: 1.02; letter-spacing: -0.01em; }
h2 { font-family: var(--titre); font-weight: 800; font-stretch: 85%; font-size: 24px; line-height: 1.1; }
p { margin: 0; }
.t2 { font-family: var(--titre); font-weight: 800; font-stretch: 85%; font-size: 24px; line-height: 1.1; display: block; text-wrap: balance; }
.scene { font-style: italic; font-size: clamp(19px, 5.2vw, 22px); line-height: 1.45; }
.truc { font-family: var(--titre); font-weight: 700; font-stretch: 90%; font-size: 23px; line-height: 1.2; }
.discret { color: var(--gris); font-size: 15px; }
.petit { font-size: 13px; color: var(--gris); }
.pile { display: flex; flex-direction: column; gap: 12px; }
.pile-l { display: flex; flex-direction: column; gap: 22px; }
.rangee { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.entre { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 12px; border: 2px solid transparent; font-weight: 700; font-size: 16px; background: var(--cobalt); color: var(--sur-cobalt); width: 100%; transition: transform .12s ease; text-align: center; }
.btn:active { transform: scale(.985); }
.btn.fantome { background: transparent; color: var(--encre); border-color: var(--encre); }
.btn.lien { background: none; border: 0; color: var(--gris); min-height: 40px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; width: auto; padding: 0 4px; }
.btn.court { width: auto; min-height: 44px; padding: 0 18px; font-size: 15px; }
.mini { border: 1.5px solid var(--trait); background: var(--surface); border-radius: 8px; min-height: 36px; padding: 0 12px; font-size: 14px; font-weight: 600; }
.mini[aria-pressed="true"] { background: var(--encre); color: var(--fond); border-color: var(--encre); }

.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.carte.sobre { background: transparent; }
.hack { background: var(--encre); color: var(--fond); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.hack .surtitre { color: inherit; opacity: .7; }
.hack strong { font-family: var(--titre); font-weight: 800; font-stretch: 85%; font-size: 23px; line-height: 1.12; }

/* La pique : une bulle à angles vifs avec sa queue, la munition au surligneur */
.bulle { position: relative; background: var(--surface); border: 2px solid var(--encre); border-radius: 4px 18px 18px 18px; padding: 16px 18px 18px; margin-bottom: 14px; }
.bulle::after { content: ""; position: absolute; left: 22px; bottom: -14px; width: 22px; height: 14px; background: var(--encre); clip-path: polygon(0 0, 100% 0, 0 100%); }
.bulle::before { content: ""; position: absolute; left: 24px; bottom: -9px; width: 16px; height: 9px; background: var(--surface); clip-path: polygon(0 0, 100% 0, 0 100%); z-index: 1; }
.pique { font-family: var(--titre); font-weight: 800; font-stretch: 78%; font-size: clamp(28px, 8vw, 36px); line-height: 1.08; letter-spacing: -0.005em; }
.bulle.moyenne .pique { font-size: 24px; }
mark { background: linear-gradient(transparent 12%, var(--munition) 12%, var(--munition) 88%, transparent 88%); color: var(--sur-munition); padding: 0 .08em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.terrain { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border: 1.5px solid currentColor; border-radius: 4px; padding: 1px 6px; }

.repliques { display: flex; flex-direction: column; padding-left: 26px; }
.replique { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--trait); }
.replique:first-child { border-top: 0; padding-top: 4px; }
.replique .dit { font-weight: 600; font-size: 17px; line-height: 1.38; }
.replique .dit::before { content: "↩ "; color: var(--cobalt); font-weight: 700; }
.replique.mien .dit { color: var(--cobalt); }
.tag { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--gris); }
.replique.mien .tag { color: var(--cobalt); }

.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { border: 1.5px solid var(--trait); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 15px; line-height: 1.25; text-align: left; }
.puce[aria-pressed="true"] { background: var(--cobalt); color: var(--sur-cobalt); border-color: var(--cobalt); font-weight: 700; }
.puce.coche::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.puce.coche[aria-pressed="true"]::before { background: currentColor; }

label.titre-champ, .titre-champ { font-size: 14px; color: var(--gris); font-weight: 700; display: block; }
textarea, input[type="text"], input[type="email"], input[type="time"] { width: 100%; background: var(--surface); border: 1.5px solid var(--trait); border-radius: 12px; padding: 12px 14px; line-height: 1.45; resize: vertical; font-size: 16px; }
textarea::placeholder, input::placeholder { color: var(--gris); opacity: .75; }
textarea:focus, input:focus { border-color: var(--cobalt); outline: none; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option { text-align: left; border: 1.5px solid var(--trait); background: var(--surface); border-radius: 12px; padding: 14px 16px; line-height: 1.4; }
.option.choisi, .option.bonne { border-color: var(--cobalt); background: var(--cobalt-doux); }
.option.choisi { border-width: 2px; }
.option.ratee { opacity: .6; }
.option .tag { display: block; margin-bottom: 2px; }
.retour { color: var(--cobalt); font-weight: 600; }

/* Séance */
.barre-seance { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: env(safe-area-inset-top, 0px); padding-block: 10px; background: var(--fond); z-index: 5; }
.fermer { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--trait); background: var(--surface); font-size: 20px; line-height: 1; }
.temps { display: flex; gap: 6px; }
.temps span { width: 26px; height: 5px; border-radius: 1px; background: var(--trait); }
.temps span.fait { background: var(--encre); }
.temps span.en-cours { background: var(--cobalt); }
.etiquette-temps { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--cobalt); font-weight: 700; }
details.source { border-top: 1px solid var(--trait); padding-top: 12px; }
details.source summary { cursor: pointer; color: var(--gris); font-size: 14px; }
details.source p { margin-top: 8px; font-size: 14px; color: var(--gris); line-height: 1.5; }
.reduit { border-left: 3px solid var(--munition); padding: 4px 0 4px 14px; }

/* Chrono de 10 secondes */
.chrono-bloc { display: flex; align-items: center; gap: 14px; }
.chrono { font-family: var(--titre); font-weight: 900; font-stretch: 70%; font-size: 58px; line-height: .9; font-variant-numeric: tabular-nums; min-width: 1.3ch; color: var(--cobalt); }
.chrono.urgent { color: var(--s2); }
.jauge { flex: 1; height: 10px; border-radius: 2px; background: var(--relief); overflow: hidden; }
.jauge i { display: block; height: 100%; width: 100%; background: var(--cobalt); transform-origin: left; }

.notes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.note-tuile { background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.note-tuile b { font-family: var(--titre); font-weight: 900; font-stretch: 75%; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.note-tuile b small { font-size: 15px; color: var(--gris); font-weight: 600; }
.note-tuile .petit { line-height: 1.35; }

.lunes { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.lune { aspect-ratio: 1; max-width: 100%; border-radius: 6px; border: 1.5px solid var(--trait); background: var(--surface); padding: 0; display: grid; place-items: center; font-size: 11px; color: var(--gris); font-variant-numeric: tabular-nums; }
.lune.faite { background: var(--encre); border-color: var(--encre); color: var(--fond); font-weight: 700; }
.lune.prochaine { border: 2px solid var(--cobalt); color: var(--cobalt); font-weight: 700; }
.lune.bilan { border-radius: 50%; }
.lune[disabled] { cursor: default; opacity: .55; }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--gris); align-items: center; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid var(--trait); margin-right: 6px; vertical-align: -1px; }
.legende i.f { background: var(--encre); border-color: var(--encre); }
.legende i.p { border-color: var(--cobalt); }
.legende i.b { border-radius: 50%; }
.legende i.l { width: 16px; height: 3px; border: 0; border-radius: 2px; vertical-align: 3px; }

.liste { display: flex; flex-direction: column; }
.ligne { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 14px 0; border: 0; border-bottom: 1px solid var(--trait); background: none; text-align: left; width: 100%; }
.ligne:last-child { border-bottom: 0; }
.ligne .corps { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ligne .fl { color: var(--gris); }
.jour-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--munition); color: var(--sur-munition); border-radius: 3px; padding: 1px 6px; }
.note-texte { white-space: pre-wrap; }
table.compare { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
table.compare th, table.compare td { text-align: right; padding: 8px 0; border-bottom: 1px solid var(--trait); }
table.compare th:first-child, table.compare td:first-child { text-align: left; }
table.compare th { font-size: 12px; color: var(--gris); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.graph { width: 100%; height: auto; display: block; overflow: visible; }
.graph text { fill: var(--gris); font-size: 11px; font-family: var(--texte); }
.graph text.val { fill: var(--encre); font-weight: 700; }

nav.onglets { position: fixed; left: 0; right: 0; bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--trait); z-index: 10; }
nav.onglets .in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
nav.onglets button { background: none; border: 0; min-height: 62px; font-size: 13px; color: var(--gris); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 2px; }
nav.onglets button::before { content: ""; width: 20px; height: 3px; border-radius: 1px; background: transparent; }
nav.onglets button[aria-current="page"] { color: var(--encre); font-weight: 700; }
nav.onglets button[aria-current="page"]::before { background: var(--cobalt); }

.toast { width: max-content; position: fixed; left: 50%; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--encre); color: var(--fond); padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); text-align: center; }
.orientation { font-size: 13px; color: var(--gris); border-top: 1px solid var(--trait); padding-top: 14px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Inscription, installation, rappels */
a.btn { text-decoration: none; }
input[type="time"] { width: auto; }

/* Explication de l'arrivée et carte « Comment ça marche » */
.intro { font-size: 17px; line-height: 1.5; }
.etapes { list-style: none; counter-reset: etape; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.etapes li { counter-increment: etape; display: flex; gap: 12px; align-items: flex-start; line-height: 1.4; }
.etapes li::before { content: counter(etape); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--cobalt); color: var(--sur-cobalt); font-weight: 800; font-size: 14px; display: grid; place-items: center; margin-top: -1px; }
.guide .btn { align-self: flex-start; }
.intro-carte { gap: 18px; }
.intro-carte > .pile + .pile { border-top: 1px solid var(--trait); padding-top: 16px; }
/* Les « pourquoi » : du problème de base à ce qui fait vraiment mal */
.pourquoi { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--trait); display: flex; flex-direction: column; gap: 10px; }
.pourquoi li { font-size: 17px; line-height: 1.45; color: var(--gris); }
.pourquoi li:last-child { color: var(--encre); font-weight: 700; }
.objectif { font-family: var(--titre); font-weight: 850; font-stretch: 80%; font-size: clamp(28px, 7.6vw, 36px); line-height: 1.04; color: var(--cobalt); text-wrap: balance; }
