/* ============================================================
   Level Up Camp — système visuel
   Éditorial sportif d'automne : papier chaud, encre espresso,
   accent rouille. Lignes fines = lignes de court.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wdth,wght@0,75..125,400..900;1,75..125,400..900&family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..900,0..100;1,9..144,300..900,0..100&display=swap');

:root {
  --ink:        #17130F;
  --ink-2:      #3B332B;
  --ink-3:      #6B6055;
  --paper:      #F5F0E6;
  --paper-2:    #EDE5D6;
  --paper-3:    #E2D8C5;
  --rust:       #C4521A;
  --rust-deep:  #93380D;
  --moss:       #3F6B2C;
  --moss-soft:  #E3EBDA;
  --clay:       #A83A22;
  --clay-soft:  #F5E1DA;
  --slate:      #8A8175;
  --slate-soft: #EAE4D8;
  --line:       rgba(23, 19, 15, .13);
  --line-2:     rgba(23, 19, 15, .28);

  --shadow-lift: 0 1px 0 var(--line-2), 0 12px 28px -18px rgba(23, 19, 15, .55);

  --display: 'Fraunces', Georgia, serif;
  --ui:      'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --r-sm: 6px;
  --r:    12px;
  --r-lg: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain papier — texture, pas décor : reste sous 4 % d'opacité. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .34;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}

/* ── Typographie ───────────────────────────────────────────── */

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.02; letter-spacing: -.02em; }

.eyebrow {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--rust);
  font-variation-settings: 'wdth' 110;
}

.muted { color: var(--ink-3); }
.num   { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

/* ── Bandeau de tête ───────────────────────────────────────── */

.masthead {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding: clamp(20px, 5vw, 34px) clamp(18px, 5vw, 40px) clamp(22px, 5vw, 30px);
  overflow: hidden;
}
/* Lignes de court en fond.
   Les arrêts utilisent rgba(...,0) et non « transparent » : ce dernier vaut
   rgba(0,0,0,0) et l'interpolation passe par du noir, ce qui salit le dégradé. */
.masthead::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(245, 240, 230, 0) calc(26% - 1px), rgba(245, 240, 230, .05) calc(26% - 1px),
      rgba(245, 240, 230, .05) calc(26% + 1px), rgba(245, 240, 230, 0) calc(26% + 1px)),
    linear-gradient(180deg,
      rgba(245, 240, 230, 0) calc(72% - 1px), rgba(245, 240, 230, .045) calc(72% - 1px),
      rgba(245, 240, 230, .045) calc(72% + 1px), rgba(245, 240, 230, 0) calc(72% + 1px));
  pointer-events: none;
}
/* Lueur d'automne ancrée au coin — pas de boîte décalée, donc pas de couture. */
.masthead::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 150% at 100% 0%,
    rgba(196, 82, 26, .40) 0%, rgba(196, 82, 26, .12) 32%, rgba(196, 82, 26, 0) 62%);
  pointer-events: none;
}
.masthead > * { position: relative; z-index: 1; }

.masthead__logo {
  display: block;
  height: 46px;
  width: auto;
  margin-bottom: 12px;
}
.masthead .eyebrow { color: #E8965F; }
.masthead h1 {
  font-size: clamp(1.9rem, 6.5vw, 3.1rem);
  font-variation-settings: 'SOFT' 22, 'opsz' 120;
  margin-top: 8px;
}
.masthead .sub {
  margin-top: 10px;
  color: rgba(245, 240, 230, .72);
  font-size: .95rem;
}

/* ── Conteneur ─────────────────────────────────────────────── */

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 36px) clamp(16px, 5vw, 32px) 80px;
}
.wrap--narrow { max-width: 520px; }

/* ── Cartes / feuilles ─────────────────────────────────────── */

.sheet {
  background: #FBF8F2;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift);
  padding: clamp(18px, 4vw, 26px);
  margin-bottom: 20px;
}
.sheet__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}
.sheet__head h2 { font-size: clamp(1.25rem, 3.6vw, 1.6rem); font-variation-settings: 'SOFT' 18; }

/* ── Compteurs ─────────────────────────────────────────────── */

.tally {
  display: grid;
  /* 4 en ligne ; 2 × 2 sur téléphone. Jamais auto-fit : quatre compteurs sur
     3 + 1 laissent une case vide qui montre le fond de la grille. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.tally__cell { background: #FBF8F2; padding: 14px 10px; text-align: center; }
.tally__n {
  font-family: var(--display);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 900;
  font-variation-settings: 'SOFT' 10;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tally__l {
  margin-top: 5px;
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}
.tally__cell--yes .tally__n { color: var(--moss); }
.tally__cell--no  .tally__n { color: var(--clay); }
.tally__cell--pending .tally__n { color: var(--slate); }
@media (max-width: 480px) {
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tally__cell { padding: 16px 10px; }
}

/* ── Liste de présence ─────────────────────────────────────── */

.roll { list-style: none; }
.roll__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
}
.roll__item:last-child { border-bottom: 0; }
.roll__idx {
  width: 26px;
  flex: none;
  font-size: .78rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.roll__name { flex: 1; min-width: 0; font-weight: 600; }
.roll__name small { display: block; font-weight: 400; font-size: .78rem; color: var(--ink-3); }
.roll__item--no .roll__name { color: var(--ink-3); }

.tag {
  flex: none;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.tag--yes     { background: var(--moss-soft);  color: var(--moss); }
.tag--no      { background: var(--clay-soft);  color: var(--clay); }
.tag--pending { background: var(--slate-soft); color: var(--slate); }
.tag--dropin  { background: #F7E4D2; color: var(--rust-deep); }

.roll__group {
  margin: 22px 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--rust);
}

/* ── Contrôles ─────────────────────────────────────────────── */

.btn {
  font-family: var(--ui);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 var(--line-2); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover:not(:disabled) { background: var(--paper-2); }
.btn--rust  { background: var(--rust); border-color: var(--rust); }
.btn--sm    { padding: 7px 12px; font-size: .74rem; }
.btn--danger { background: transparent; border-color: var(--clay); color: var(--clay); }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
input[type=text], input[type=email], input[type=date], input[type=time],
input[type=password], input[type=number], select, textarea {
  width: 100%;
  font-family: var(--ui);
  font-size: .95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(196, 82, 26, .16);
}
textarea { resize: vertical; min-height: 96px; font-size: .88rem; line-height: 1.5; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 150px; margin-bottom: 0; }

/* ── Messages ──────────────────────────────────────────────── */

.note {
  border-left: 3px solid var(--rust);
  background: var(--paper-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 12px 14px;
  font-size: .86rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.note--warn { border-left-color: var(--clay); background: var(--clay-soft); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: 0 14px 34px -14px rgba(23, 19, 15, .7);
  z-index: 400;
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.2);
  max-width: min(92vw, 460px);
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast--err { background: var(--clay); }

.empty { text-align: center; padding: 34px 12px; color: var(--ink-3); font-size: .9rem; }

/* ── Apparition en cascade au chargement ───────────────────── */

.rise { animation: rise .55s cubic-bezier(.2, .8, .3, 1) both; }
.rise:nth-child(2) { animation-delay: .06s; }
.rise:nth-child(3) { animation-delay: .12s; }
.rise:nth-child(4) { animation-delay: .18s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Les dates arrivent en français (« samedi 14 novembre ») : on met une majuscule
   à la première lettre seulement — « capitalize » majusculerait aussi le mois. */
.cap-first::first-letter { text-transform: uppercase; }
