:root {
  --bg: #f7f5f0; --card: #ffffff; --ink: #1f2937; --muted: #6b7280; --line: #e7e3da;
  --brand: #0f766e; --brand-2: #14b8a6; --soft: #e6f4f1; --accent: #ea7a2f; --accent-soft: #fdeee3;
  --ok: #15803d; --warn: #b45309; --bad: #b91c1c; --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161a; --card: #1b2127; --ink: #e5e7eb; --muted: #9ca3af; --line: #2a323a;
    --brand: #2dd4bf; --brand-2: #14b8a6; --soft: #12302c; --accent: #f59e57; --accent-soft: #3a2616;
    --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #12161a; --card: #1b2127; --ink: #e5e7eb; --muted: #9ca3af; --line: #2a323a;
  --brand: #2dd4bf; --brand-2: #14b8a6; --soft: #12302c; --accent: #f59e57; --accent-soft: #3a2616;
  --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
a { color: var(--brand); }
header#top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; color: var(--brand); }
#who { color: var(--muted); font-size: 14px; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 24px; }
h1 { font-size: 22px; margin: 8px 0 4px; }
h2 { font-size: 18px; margin: 22px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h3 { font-size: 16px; margin: 0 0 4px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .center { text-align: center; } .pad { padding: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; box-shadow: var(--shadow); }
.card.soft { background: var(--soft); border-color: transparent; }
.card.accent { background: var(--accent-soft); border-color: transparent; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.meta { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.scroller { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.scroller .card { flex: 0 0 82%; max-width: 330px; scroll-snap-align: start; margin: 4px 0; display: flex; flex-direction: column; }
.scroller .card .acts { margin-top: auto; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
button, .btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 15px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
button.primary, .btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
:root[data-theme="dark"] button.primary { color: #062a26; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button.primary { color: #062a26; } }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 6px 8px; }
button.small, .btn.small { padding: 5px 9px; font-size: 14px; min-height: 34px; }
button:disabled { opacity: .5; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; user-select: none; min-height: 36px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tag { display: inline-block; background: var(--soft); color: var(--brand); border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-right: 4px; }
.meteo { display: flex; gap: 8px; overflow-x: auto; }
.meteo div { text-align: center; min-width: 52px; font-size: 13px; }
.meteo .ic { font-size: 22px; }
.meteo .we { background: var(--accent-soft); border-radius: 10px; padding: 2px 0; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.bar > i { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.day { display: flex; gap: 12px; align-items: center; }
.day .d { width: 46px; text-align: center; font-size: 13px; color: var(--muted); }
.day .d b { display: block; font-size: 18px; color: var(--ink); }
.day.today { border-color: var(--brand); border-width: 2px; }
.day.done { opacity: .7; }
.check { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); flex: 0 0 26px; display: grid; place-items: center; font-size: 15px; }
.check.on .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.alert { border-left: 4px solid var(--warn); }
.alert.rouge { border-left-color: var(--bad); }
.alert.info { border-left-color: var(--brand-2); }
.st-a-faire { color: var(--bad); font-weight: 600; } .st-bientot { color: var(--warn); font-weight: 600; } .st-ok, .st-fait { color: var(--ok); }
svg.spark { width: 100%; height: 70px; display: block; }
svg.spark .l1 { stroke: var(--brand); } svg.spark .l2 { stroke: var(--accent); } svg.spark text { fill: var(--muted); font-size: 10px; }
nav#nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav#nav a { flex: 1; text-align: center; padding: 8px 0 7px; color: var(--muted); text-decoration: none; font-size: 12px; }
nav#nav a span { display: block; font-size: 21px; }
nav#nav a.on { color: var(--brand); font-weight: 600; }
#modal { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
#modal[hidden] { display: none; }
#modal .sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); position: relative; }
@media (min-width: 700px) { #modal { align-items: center; } #modal .sheet { border-radius: 18px; } }
#modal .x { position: absolute; top: 10px; right: 10px; border: 0; background: transparent; font-size: 20px; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 20; max-width: 520px; margin: auto; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 12px; text-align: center; }
.login { max-width: 380px; margin: 8vh auto 0; text-align: center; }
.who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.who-pick button { flex-direction: column; padding: 18px 8px; font-size: 17px; justify-content: center; }
.who-pick button.on { border-color: var(--brand); border-width: 2px; background: var(--soft); }
.big { font-size: 48px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; margin: 10px 0; }
.player h3 { font-size: 22px; }
.lock { font-size: 13px; color: var(--muted); }
.ex { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ex:last-child { border-bottom: 0; }
.answer { white-space: pre-line; }
details summary { cursor: pointer; color: var(--brand); padding: 6px 0; }
.hist { font-size: 14px; }
.hist div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }

.gbtn { display: flex; justify-content: center; margin: 18px 0 6px; min-height: 44px; }
