@font-face { font-family: "Gloock"; src: url("/static/gloock.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/static/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/static/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/static/atkinson-400i.woff2") format("woff2"); font-style: italic; font-display: swap; }

:root {
  --fond: #EDF0EA; --surface: #F8FAF6; --encre: #16211B; --encre-2: #4E5D54; --trait: #D3DBD2;
  --accent: #0B6E5B; --accent-doux: #D3E9E0; --sur-accent: #F8FAF6; --contre: #B23A2B; --contre-doux: #F5DDD8;
  --ombre: 0 1px 0 rgba(22, 33, 27, .06), 0 10px 30px -18px rgba(22, 33, 27, .35);
  --titre: "Gloock", "Iowan Old Style", Georgia, serif;
  --texte: "Atkinson", "Segoe UI", -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0E1512; --surface: #16201B; --encre: #E5ECE7; --encre-2: #9DB0A5; --trait: #27352E;
    --accent: #52C7A9; --accent-doux: #173A31; --sur-accent: #0E1512; --contre: #F07A66; --contre-doux: #3B201B;
    --ombre: 0 1px 0 rgba(0, 0, 0, .4), 0 12px 30px -18px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  --fond: #0E1512; --surface: #16201B; --encre: #E5ECE7; --encre-2: #9DB0A5; --trait: #27352E;
  --accent: #52C7A9; --accent-doux: #173A31; --sur-accent: #0E1512; --contre: #F07A66; --contre-doux: #3B201B;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre); font: 400 1rem/1.5 var(--texte);
  padding: 0 16px calc(96px + env(safe-area-inset-bottom));
}
.entete, main { max-width: 40rem; margin: 0 auto; }
.entete { padding: 28px 0 8px; }
.surtitre { margin: 0; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
h1 { font: 400 clamp(2.4rem, 11vw, 3.4rem)/1 var(--titre); margin: 6px 0 10px; letter-spacing: -.01em; }
h2 { font: 400 1.6rem/1.15 var(--titre); margin: 0 0 8px; text-wrap: balance; }
.regle { margin: 0; color: var(--encre-2); max-width: 34em; }

.equipe { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 16px 0 0; }
.equipe li {
  display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--trait); font-size: .875rem;
}
.equipe li.moi { border-color: var(--accent); }
.initiale {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700;
  background: var(--accent-doux); color: var(--accent);
}

.ordre { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.demande {
  display: grid; grid-template-columns: 3.2rem 1fr; gap: 4px 12px; padding: 16px 16px 14px 12px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: 14px; box-shadow: var(--ombre);
}
.demande.arrivee { animation: entree .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
.rang { grid-row: span 3; font: 400 2.9rem/.9 var(--titre); color: var(--encre-2); opacity: .55; text-align: right;
  font-variant-numeric: lining-nums tabular-nums; padding-top: 2px; }
.demande:first-child .rang { color: var(--accent); opacity: 1; }
.titre-demande { margin: 0; font: 700 1.0625rem/1.3 var(--texte); overflow-wrap: anywhere; text-wrap: pretty; }
.meta { margin: 0; font-size: .8125rem; color: var(--encre-2); }
.detail { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--encre); font-size: .9375rem; }
.actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.bouton {
  font: 700 .875rem/1 var(--texte); padding: 10px 14px; border-radius: 10px; cursor: pointer; min-height: 40px;
  border: 1px solid var(--trait); background: transparent; color: var(--encre);
}
.bouton.plein { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.bouton.discret { color: var(--encre-2); }
.bouton[aria-pressed="true"].pour { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.bouton[aria-pressed="true"].contre { background: var(--contre); border-color: var(--contre); color: var(--sur-accent); }
.bouton:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, .rang-choix:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

.choix-rang { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.choix-rang p { margin: 0 4px 0 0; font-size: .875rem; color: var(--encre-2); width: 100%; }
.rang-choix {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--trait); background: var(--fond);
  font: 400 1.25rem/1 var(--titre); color: var(--encre); cursor: pointer;
}

.motion { grid-column: 1 / -1; margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--accent-doux); }
.motion p { margin: 0; font-size: .9375rem; }
.motion strong { font-weight: 700; }
.sieges { display: flex; align-items: center; gap: 6px; margin: 10px 0 8px; flex-wrap: wrap; }
.siege {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .6875rem; font-weight: 700;
  border: 2px dashed var(--encre-2); color: var(--encre-2); background: transparent; opacity: .7;
}
.siege.pour { border: 2px solid var(--accent); background: var(--accent); color: var(--sur-accent); opacity: 1; }
.siege.contre { border: 2px solid var(--contre); background: var(--contre-doux); color: var(--contre); opacity: 1; }
.seuil { width: 2px; height: 30px; background: var(--encre); border-radius: 2px; margin: 0 2px; }
.compte { font-size: .8125rem; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.motion .ligne { display: flex; gap: 8px; margin-top: 8px; }

.vide, .porte { margin-top: 24px; padding: 20px; border: 1px dashed var(--trait); border-radius: 14px; color: var(--encre-2); }
.porte h2 { color: var(--encre); }

.tiroir { margin-top: 20px; border-top: 1px solid var(--trait); padding-top: 12px; }
.tiroir summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.closes, .fil { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: .9375rem; }
.closes li { color: var(--encre-2); }
.closes .etiquette { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; margin-right: 6px; }
.closes .realisee { color: var(--accent); }
.fil li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 8px; color: var(--encre-2); }
.fil time { font-variant-numeric: tabular-nums; font-size: .8125rem; padding-top: 1px; }
.fil span { color: var(--encre); overflow-wrap: anywhere; }

label { display: block; font-weight: 700; font-size: .875rem; margin: 12px 0 4px; }
.facultatif { font-weight: 400; color: var(--encre-2); }
input, textarea {
  width: 100%; font: 400 1rem/1.4 var(--texte); padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--trait); background: var(--fond); color: var(--encre);
}
.ligne { display: flex; gap: 8px; align-items: center; }
.ligne input { flex: 1; min-width: 0; }
.fin { justify-content: flex-end; margin-top: 16px; }
.note { font-size: .8125rem; color: var(--encre-2); margin: 4px 0 0; }
.liens { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.liens li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lien-cree { margin-top: 12px; display: grid; gap: 8px; }
.lien-cree p { margin: 0; }
.lien-cree code { font-size: .75rem; overflow-wrap: anywhere; padding: 8px; border-radius: 8px; background: var(--accent-doux); }

.nouvelle {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  font: 700 1rem/1 var(--texte); padding: 16px 24px; border-radius: 99px; border: 0; cursor: pointer; white-space: nowrap;
  background: var(--encre); color: var(--fond); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .45);
}
.nouvelle::before { content: "+"; font: 400 1.35rem/0 var(--titre); margin-right: 10px; position: relative; top: 2px; }

.feuille {
  width: 100%; max-width: min(40rem, 100%); max-height: calc(100% - 24px); margin: auto auto 0; border: 0; border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface); color: var(--encre);
}
.feuille::backdrop { background: rgba(10, 16, 13, .45); }
.feuille[open] { animation: monte .28s cubic-bezier(.2, .7, .2, 1); }

.annonce {
  position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 30rem;
  padding: 12px 16px; border-radius: 12px; background: var(--encre); color: var(--fond); font-size: .9375rem; text-align: center;
}

@keyframes entree { from { opacity: .001; transform: translateY(8px); } }
@keyframes monte { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
