/* Bientôt trois — styles. Polices servies depuis ce domaine, aucune requête externe. */
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/spectral-500.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 500; font-display: swap; src: url("/fonts/spectral-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/instrument-sans.woff2") format("woff2"); }

:root { color-scheme: light; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Layout: one narrow column, a deck card with stacked cards behind it, fixed bottom tabs.
   Each card type has its own shape, color and word, so the intended outcome reads at a glance. */
:root {
  --bg: #EDF0F5;
  --surface: #FFFFFF;
  --ink: #19202E;
  --muted: #566074;
  --line: #D3D9E3;
  --soft: #E2E7F0;
  --on-accent: #FFFFFF;
  --decide: #2C57C9;
  --decide-bg: #E3EAFB;
  --write: #8A3A9E;
  --write-bg: #F1E4F5;
  --talk: #0B7C70;
  --talk-bg: #DAF1EC;
  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121722;
    --surface: #1B2231;
    --ink: #EAEEF6;
    --muted: #A2ACC0;
    --line: #2C3548;
    --soft: #232B3C;
    --on-accent: #10141F;
    --decide: #8FAEFF;
    --decide-bg: #1F2B4F;
    --write: #DBA2EA;
    --write-bg: #3A2445;
    --talk: #62D3C2;
    --talk-bg: #143A3A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121722;
  --surface: #1B2231;
  --ink: #EAEEF6;
  --muted: #A2ACC0;
  --line: #2C3548;
  --soft: #232B3C;
  --on-accent: #10141F;
  --decide: #8FAEFF;
  --decide-bg: #1F2B4F;
  --write: #DBA2EA;
  --write-bg: #3A2445;
  --talk: #62D3C2;
  --talk-bg: #143A3A;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 12px 0;
  -webkit-text-size-adjust: 100%;
}
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--c, var(--ink)); outline-offset: 2px; }
.wrap { max-width: 560px; margin: 0 auto; min-width: 0; padding-bottom: 92px; }

.t-D { --c: var(--decide); --cbg: var(--decide-bg); }
.t-E { --c: var(--write); --cbg: var(--write-bg); }
.t-C { --c: var(--talk); --cbg: var(--talk-bg); }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 14px; }
.mark { font: italic 500 1.4rem/1.1 var(--font-display); letter-spacing: -0.01em; margin: 0; }
.btn {
  min-height: 46px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 0.95rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.small { min-height: 40px; padding: 0 12px; font-size: 0.9rem; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Progress and filters */
.prog { margin-bottom: 14px; }
.prog-text { display: flex; justify-content: space-between; gap: 12px; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.track { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.fill { height: 100%; background: var(--ink); border-radius: 99px; transition: width .3s ease; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; min-height: 38px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  font-size: 0.85rem; font-weight: 500; color: var(--muted);
}
.chip .ic { width: 16px; height: 16px; }
.chip .n { font-variant-numeric: tabular-nums; opacity: .8; }
.chip[aria-pressed="true"] { background: var(--cbg, var(--soft)); border-color: var(--c, var(--ink)); color: var(--c, var(--ink)); font-weight: 600; }

/* The card */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 18px 18px 20px; margin-bottom: 30px;
  box-shadow: 0 7px 0 -3px var(--soft), 0 7px 0 -2px var(--line), 0 14px 0 -7px var(--soft), 0 14px 0 -6px var(--line);
}
@media (prefers-reduced-motion: no-preference) {
  .card.enter { animation: draw .22s ease-out; }
  @keyframes draw { from { opacity: .55; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
.card-top { display: flex; align-items: center; gap: 10px; }
.badge { width: 40px; height: 40px; border-radius: 50%; background: var(--cbg); color: var(--c); display: grid; place-items: center; flex: none; }
.badge .ic { width: 22px; height: 22px; }
.kind { font-weight: 600; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c); }
.num { margin-left: auto; font: 500 1.05rem var(--font-display); font-variant-numeric: tabular-nums; }
.num span { color: var(--muted); font-size: 0.85rem; }
.sec { margin: 16px 0 0; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.q { font: 500 clamp(1.35rem, 5.6vw, 1.7rem)/1.3 var(--font-display); margin: 8px 0 16px; text-wrap: pretty; letter-spacing: -0.005em; }
.hint { margin: 0; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 0.9rem; color: var(--muted); }
.hint b { color: var(--c); font-weight: 600; }
.note { margin: 12px 0 0; font-size: 0.85rem; color: var(--muted); background: var(--soft); border-radius: 12px; padding: 10px 12px; }

.fields { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.lab { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
textarea {
  width: 100%; min-height: 92px; resize: vertical; padding: 12px 14px; font-size: 16px; line-height: 1.45;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; display: block;
}
textarea::placeholder, input::placeholder { color: var(--muted); opacity: .8; }
.done {
  align-self: flex-start; min-height: 44px; padding: 0 16px 0 12px; border-radius: 99px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--c); color: var(--c); font-weight: 600; font-size: 0.92rem;
}
.done .ic { opacity: .45; }
.done[aria-pressed="true"] { background: var(--c); color: var(--on-accent); }
.done[aria-pressed="true"] .ic { opacity: 1; }

/* Deck navigation */
.nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; }
.nav .btn { padding: 0 10px; min-width: 0; }
@media (max-width: 430px) { .nav [data-act="random"] span { display: none; } .nav [data-act="random"] { padding: 0 14px; } }
.foot { margin: 22px 0 0; font-size: 0.85rem; color: var(--muted); text-align: center; }
.linkbtn { background: none; border: 0; padding: 6px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: 0.85rem; }

/* Bottom tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.tabs-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tab { border: 0; background: none; border-radius: 12px; min-height: 52px; padding: 4px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; color: var(--muted); font-weight: 500; font-size: 0.9rem; }
.tab small { font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.tab[aria-current="page"] { background: var(--soft); color: var(--ink); font-weight: 600; }

/* Lists (Accords, Écrits) */
.h2 { font: 500 1.6rem/1.2 var(--font-display); margin: 4px 0 6px; }
.lede { margin: 0 0 18px; color: var(--muted); font-size: 0.95rem; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 18px; padding: 22px 18px; color: var(--muted); margin-bottom: 18px; }
.empty b { color: var(--ink); }
.list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item { width: 100%; text-align: left; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.inum { width: 34px; height: 34px; border-radius: 50%; background: var(--cbg); color: var(--c); display: grid; place-items: center; font: 600 0.85rem var(--font-ui); font-variant-numeric: tabular-nums; }
.ibody { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.iq { font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; }
.ia { font: 500 1.08rem/1.4 var(--font-display); white-space: pre-wrap; overflow-wrap: anywhere; }
.ia b { font: 600 0.78rem var(--font-ui); letter-spacing: 0.05em; text-transform: uppercase; color: var(--c); display: block; }
.ia.none { color: var(--muted); font-style: italic; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0 14px; margin-bottom: 18px; }
summary { min-height: 50px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
details .list { margin: 0 0 14px; }
details .item { background: var(--bg); }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.copybox { margin-bottom: 18px; min-height: 160px; }

/* Intro */
.eyebrow { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 8px 0 6px; font-weight: 600; }
.hero { font: 500 clamp(1.8rem, 7.4vw, 2.3rem)/1.15 var(--font-display); margin: 0 0 14px; text-wrap: balance; letter-spacing: -0.01em; }
.legend { list-style: none; padding: 0; margin: 22px 0; display: flex; flex-direction: column; gap: 10px; }
.legend li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.legend strong { display: block; color: var(--c); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.legend span.t { font-size: 0.95rem; }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 22px; }
.names label { font-size: 0.85rem; font-weight: 600; display: block; margin-bottom: 4px; }
.names input { width: 100%; min-height: 46px; padding: 0 12px; font-size: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.fine { font-size: 0.82rem; color: var(--muted); margin: 16px 0 0; }

/* Sommaire */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 22, 0.55); display: flex; align-items: flex-end; justify-content: center; }
.panel {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 88%; overflow: auto; border-radius: 22px 22px 0 0;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.panel-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sec-row { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 14px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.sec-t { font-weight: 600; }
.sec-n { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.dots { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; }
.dot { width: 11px; height: 11px; border: 2px solid var(--c); border-radius: 50%; display: block; }
.dot.on { background: var(--c); }
.dot.t-D { border-radius: 3px; }
.dot.t-E { border-radius: 2px; transform: rotate(45deg); }
.keyline { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.8rem; color: var(--muted); margin: 4px 0 14px; }
.keyline span { display: inline-flex; align-items: center; gap: 6px; }

/* Pages de texte (mentions légales) */
.prose { padding-bottom: 40px; }
.prose h2 { font: 500 1.2rem/1.3 var(--font-display); margin: 26px 0 6px; }
.prose p, .prose li { color: var(--ink); font-size: 0.98rem; max-width: 62ch; }
.prose ul { padding-left: 20px; }
.back { display: inline-flex; margin-bottom: 8px; }
.foot a { font-size: 0.85rem; }

.sprite { position: absolute; }
.panel-top .h2 { margin: 0; }
