/* Foyer — système visuel
   Scène : un couple sur le canapé le dimanche soir, un jeu coopératif qu'on a hâte de lancer.
   Stratégie : surface neutre teintée mousse + vert mousse engagé sur la navigation,
   palette bonbon réservée aux données et aux récompenses. Une seule famille : Nunito. */

@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url('../vendor/fonts/nunito-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url('../vendor/fonts/nunito-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Neutres teintés vers la teinte de marque (145°) */
  --bg: oklch(0.968 0.011 150);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.948 0.016 150);
  --surface-3: oklch(0.92 0.022 150);
  --line: oklch(0.89 0.02 150);
  --line-strong: oklch(0.82 0.028 150);
  --ink: oklch(0.27 0.045 152);
  --ink-2: oklch(0.4 0.035 152);
  --ink-3: oklch(0.5 0.03 152);

  /* Marque : mousse */
  --moss-900: oklch(0.27 0.055 155);
  --moss-800: oklch(0.335 0.07 155);
  --moss-600: oklch(0.5 0.105 152);
  --moss-500: oklch(0.64 0.12 152);
  --moss-200: oklch(0.9 0.055 152);
  --moss-100: oklch(0.955 0.03 152);
  --on-moss: oklch(0.97 0.018 150);
  --on-moss-2: oklch(0.84 0.04 150);

  /* Récompenses (miel), alertes (corail), info (ciel) */
  --honey: oklch(0.85 0.15 85);
  --honey-deep: oklch(0.5 0.11 70);
  --honey-soft: oklch(0.96 0.05 90);
  --coral: oklch(0.63 0.17 28);
  --coral-deep: oklch(0.5 0.16 28);
  --coral-soft: oklch(0.95 0.035 28);
  --sky: oklch(0.7 0.11 235);
  --sky-soft: oklch(0.95 0.03 235);
  --lilac: oklch(0.72 0.11 300);
  --lilac-soft: oklch(0.95 0.03 300);

  --r-sm: 10px; --r: 16px; --r-lg: 22px; --r-xl: 28px;
  --press: 0 3px 0 var(--ink);
  --press-sm: 0 2px 0 var(--ink);
  --lift: 0 1px 0 oklch(0.85 0.02 150), 0 8px 24px -14px oklch(0.3 0.06 150 / 0.35);

  --ease: cubic-bezier(0.25, 1, 0.5, 1);     /* ease-out-quart */
  --ease-x: cubic-bezier(0.16, 1, 0.3, 1);   /* ease-out-expo */

  --z-sticky: 10; --z-dropdown: 20; --z-backdrop: 30; --z-modal: 40; --z-toast: 50; --z-tooltip: 60;

  --fs-xs: 0.78rem; --fs-sm: 0.875rem; --fs: 1rem; --fs-md: 1.125rem; --fs-lg: 1.35rem; --fs-xl: 1.65rem; --fs-2xl: 2.05rem;
  font-family: 'Nunito', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; font-weight: 850; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-md); }
p { margin: 0; text-wrap: pretty; }
a { color: var(--moss-600); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--moss-600); }
.neg { color: var(--coral-deep); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }

/* ---------- Coquille ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--moss-800); color: var(--on-moss);
  display: flex; flex-direction: column; gap: 18px; padding: 20px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-name { font-weight: 900; font-size: 1.45rem; letter-spacing: -0.02em; }
.brand-sub { font-size: var(--fs-xs); color: var(--on-moss-2); font-weight: 700; }
.players { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.player-btn {
  display: grid; justify-items: center; gap: 2px; padding: 8px 4px 8px; border-radius: var(--r);
  background: oklch(0.295 0.06 155); border: 2px solid transparent; cursor: pointer; color: var(--on-moss);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.player-btn:hover { background: oklch(0.39 0.07 155); }
.player-btn[aria-pressed="true"] { background: var(--on-moss); color: var(--ink); border-color: var(--honey); }
.player-btn .pname { font-weight: 850; font-size: var(--fs-sm); }
.player-btn .pxp { font-size: var(--fs-xs); opacity: 0.85; }
.side-hint { font-size: var(--fs-xs); color: var(--on-moss-2); text-align: center; margin-top: -10px; }

.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
  color: var(--on-moss-2); text-decoration: none; font-weight: 750;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: oklch(0.39 0.07 155); color: var(--on-moss); }
.nav a[aria-current="page"] { background: var(--on-moss); color: var(--moss-900); }
.nav .badge-dot { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--honey); color: var(--ink); font-size: 0.72rem; font-weight: 900; display: grid; place-items: center; }

.side-foot { margin-top: auto; display: grid; gap: 10px; }
.levelbox { background: oklch(0.295 0.06 155); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; }
.levelbox .lv { display: flex; align-items: baseline; gap: 8px; font-weight: 850; }
.levelbox .lv b { font-size: 1.3rem; color: var(--honey); }
.xpbar { height: 10px; border-radius: 6px; background: oklch(0.24 0.045 155); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--honey); border-radius: 6px; transition: width 0.6s var(--ease-x); }
.streak { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 800; }
.streak .flame { width: 22px; height: 22px; }

.main { min-width: 0; padding: 22px clamp(16px, 3vw, 36px) 64px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { font-size: var(--fs-xl); }
.topbar .sub { color: var(--ink-3); font-weight: 650; font-size: var(--fs-sm); }
.freshness { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); font-size: var(--fs-sm); font-weight: 750; color: var(--ink-2); }
.freshness .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--moss-500); }
.freshness.stale .dot { background: var(--coral); }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--lift); min-width: 0; }
.panel.tight { padding: 14px 16px; }
.panel.flat { box-shadow: none; }
.panel-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-h h2, .panel-h h3 { font-size: var(--fs-md); }
.panel-h .muted { font-weight: 650; }
.well { background: var(--surface-2); border-radius: var(--r); padding: 14px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.section { margin-top: 26px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.section-title h2 { font-size: var(--fs-lg); }
hr.soft { border: 0; border-top: 1.5px dashed var(--line); margin: 14px 0; }

/* ---------- Boutons ---------- */
.btn {
  --b: var(--moss-600); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 14px; border: 2px solid var(--ink);
  background: var(--b); color: var(--fg); font-weight: 850; cursor: pointer; text-decoration: none;
  box-shadow: var(--press); transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), background 0.15s var(--ease);
  white-space: nowrap; line-height: 1.2;
}
.btn:hover { background: color-mix(in oklch, var(--b) 88%, white); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: var(--press); }
.btn.honey { --b: var(--honey); --fg: var(--ink); }
.btn.light { --b: var(--surface); --fg: var(--ink); }
.btn.coral { --b: var(--coral); --fg: #fff; }
.btn.sm { padding: 6px 12px; font-size: var(--fs-sm); border-radius: 11px; box-shadow: var(--press-sm); }
.btn.lg { padding: 14px 24px; font-size: var(--fs-md); border-radius: 18px; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost:active { transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Champs ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-weight: 800; font-size: var(--fs-sm); color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line-strong); background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--moss-600); box-shadow: 0 0 0 4px var(--moss-100); }
.input.money { text-align: right; font-weight: 800; }
.input.inline { padding: 5px 8px; border-radius: 9px; width: 100px; }
textarea.input { min-height: 90px; resize: vertical; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-weight: 800; color: var(--ink-2); cursor: pointer; font-size: var(--fs-sm); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--line-strong); }
input[type="range"] { accent-color: var(--moss-600); width: 100%; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--moss-600); }

/* ---------- Pastilles & barres ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 850; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--moss-100); color: var(--moss-800); }
.pill.tight { background: var(--honey-soft); color: var(--honey-deep); }
.pill.risk { background: var(--coral-soft); color: var(--coral-deep); }
.pill.over { background: var(--coral); color: #fff; }
.pill.info { background: var(--sky-soft); color: oklch(0.42 0.1 240); }
.pill.gold { background: var(--honey); color: var(--ink); }
.bar { position: relative; height: 12px; border-radius: 8px; background: var(--surface-3); overflow: visible; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; background: var(--moss-500); transition: width 0.6s var(--ease-x); max-width: 100%; }
.bar > i.proj { background: repeating-linear-gradient(-45deg, oklch(0.6 0.14 145 / 0.28) 0 5px, transparent 5px 9px); }
.bar.tight > i:not(.proj) { background: var(--honey); }
.bar.risk > i:not(.proj) { background: var(--coral); }
.bar.over > i:not(.proj) { background: var(--coral-deep); }
.bar .today { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--ink); }
.bar.lg { height: 18px; border-radius: 10px; }
.bar.lg > i { border-radius: 10px; }

/* ---------- Héros : la maison ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, 1fr); gap: 18px; }
.stage {
  position: relative; min-height: 440px; border-radius: var(--r-xl); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 15%, oklch(0.96 0.035 210) 0%, oklch(0.93 0.05 175) 55%, oklch(0.9 0.06 150) 100%);
  border: 2px solid var(--ink); box-shadow: var(--press);
  transition: background 0.8s var(--ease);
}
.stage.is-night { background: radial-gradient(120% 90% at 50% 15%, oklch(0.42 0.08 275) 0%, oklch(0.3 0.07 265) 60%, oklch(0.24 0.05 250) 100%); }
.stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; cursor: grab; touch-action: none; }
.stage canvas:active { cursor: grabbing; }
.stage-ui { position: absolute; left: 16px; right: 16px; top: 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.stage-ui > * { pointer-events: auto; }
.stage-tag { background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; padding: 8px 12px; box-shadow: var(--press-sm); }
.stage-tag b { display: block; font-size: var(--fs-md); font-weight: 900; }
.stage-tag span { font-size: var(--fs-xs); font-weight: 750; color: var(--ink-2); }
.stage-next { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; pointer-events: none; }
.stage-next > * { pointer-events: auto; }
.jar-tag { background: var(--honey); border: 2px solid var(--ink); border-radius: 12px; padding: 5px 10px; font-weight: 900; box-shadow: var(--press-sm); }
.stage-hint { font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); background: oklch(1 0 0 / 0.75); padding: 4px 10px; border-radius: 999px; }
.is-night .stage-hint { color: var(--on-moss); background: oklch(0.2 0.03 260 / 0.6); }
.stage-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; gap: 10px; }

/* Quête */
.quest { display: grid; gap: 16px; align-content: start; }
.quest-head { display: flex; gap: 14px; align-items: center; }
.quest-emoji { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; background: var(--honey-soft); border: 2px solid var(--ink); flex: none; }
.quest-amount { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -0.02em; line-height: 1; }
.quest-amount small { font-size: var(--fs-md); color: var(--ink-3); font-weight: 800; }
.milestones { position: relative; padding-top: 30px; }
.milestones .bar { height: 20px; border-radius: 12px; border: 2px solid var(--ink); background: var(--surface-2); }
.milestones .bar > i { border-radius: 10px; background: linear-gradient(90deg, var(--moss-500), oklch(0.72 0.15 120)); }
.ms { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; }
.ms .gift { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--ink); font-size: 15px; transition: transform 0.2s var(--ease); cursor: default; }
.ms.won .gift { background: var(--honey); }
.ms .pct { font-size: 0.68rem; font-weight: 900; color: var(--ink-3); position: absolute; top: 56px; }
.quest-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.fact .k { font-size: var(--fs-xs); font-weight: 800; color: var(--ink-3); }
.fact .v { font-weight: 900; font-size: var(--fs-md); }
.fact.good { background: var(--moss-100); }
.fact.bad { background: var(--coral-soft); }

/* Bulle de Pépite + verset */
.whisper { display: flex; gap: 14px; align-items: flex-start; }
.whisper .pepite { flex: none; }
.bubble { position: relative; background: var(--surface); border: 2px solid var(--ink); border-radius: 18px; padding: 12px 16px; box-shadow: var(--press-sm); }
.bubble::before { content: ''; position: absolute; left: -9px; top: 18px; width: 14px; height: 14px; background: var(--surface); border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.bubble p { font-weight: 750; }
.verse { display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--moss-800); color: var(--on-moss); }
.verse q { font-size: var(--fs-md); font-weight: 650; line-height: 1.45; quotes: '« ' ' »'; max-width: 70ch; }
.verse cite { font-style: normal; font-weight: 900; color: var(--honey); font-size: var(--fs-sm); }
.verse.light { background: var(--moss-100); color: var(--ink); }
.verse.light cite { color: var(--moss-800); }

/* Mission & coffre */
.mission { display: grid; gap: 10px; }
.task { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.task .tick { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--ink); display: grid; place-items: center; background: var(--surface); flex: none; font-weight: 900; }
.task.done .tick { background: var(--moss-500); color: #fff; }
.task.done .t { text-decoration: line-through; color: var(--ink-3); }
.task .xp { margin-left: auto; font-weight: 900; font-size: var(--fs-xs); color: var(--honey-deep); background: var(--honey-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chest-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--ink); background: var(--honey); cursor: pointer; box-shadow: var(--press); font-weight: 850; }
.chest-btn:hover .chest { transform: rotate(-6deg) scale(1.06); }
.chest-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.chest { font-size: 30px; transition: transform 0.2s var(--ease); }

/* Ce mois-ci */
.month-line { font-size: var(--fs-lg); font-weight: 800; line-height: 1.35; }
.month-line b { font-weight: 900; }
.pace { display: grid; gap: 6px; }
.pace-legend { display: flex; justify-content: space-between; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-3); }

/* Recommandations */
.moves { display: grid; gap: 10px; }
.move { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.move .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--surface); }
.move.alert { background: var(--coral-soft); }
.move.warn { background: var(--honey-soft); }
.move.win { background: var(--moss-100); }
.move h4 { font-size: var(--fs); font-weight: 850; margin-bottom: 2px; }
.move p { font-size: var(--fs-sm); color: var(--ink-2); }
.move .impact { font-weight: 900; font-size: var(--fs-sm); white-space: nowrap; color: var(--moss-800); }

/* Score */
.score-wrap { display: flex; gap: 18px; align-items: center; }
.ring .ring-bg { stroke: var(--surface-3); }
.ring .ring-fg { stroke: var(--moss-500); transition: stroke-dasharray 0.8s var(--ease-x); }
.ring.gold .ring-fg { stroke: var(--honey); }
.ring.coral .ring-fg { stroke: var(--coral); }
.ring-t { font-weight: 900; font-size: 26px; fill: var(--ink); }
.ring-s { font-weight: 800; font-size: 11px; fill: var(--ink-3); }
.score-parts { display: grid; gap: 7px; flex: 1; min-width: 0; }
.score-part { display: grid; grid-template-columns: 1fr 70px; gap: 10px; align-items: center; font-size: var(--fs-sm); font-weight: 750; }
.score-part .bar { height: 8px; }

/* ---------- Graphiques ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--ink-3); stroke-width: 1.5; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-weight: 750; }
.chart .axis.strong { fill: var(--ink-2); font-weight: 900; }
.chart .bx { transition: opacity 0.15s; }
.chart .bx:hover { opacity: 0.8; }
.chart .bx.inc { fill: oklch(0.72 0.13 155); }
.chart .bx.exp { fill: oklch(0.76 0.12 35); }
.chart .bx.var { fill: oklch(0.74 0.11 300); }
.chart .bx.sav { fill: var(--honey); }
.chart .hl { fill: var(--surface-2); }
.chart .line { stroke: var(--moss-800); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.proj { stroke: var(--honey-deep); stroke-dasharray: 6 6; }
.chart .line.coral { stroke: var(--coral-deep); }
.chart .area { fill: oklch(0.6 0.14 145 / 0.12); }
.chart .dot { fill: var(--surface); stroke: var(--moss-800); stroke-width: 2.5; }
.chart .budgetline { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 5; }
.chart .marker { fill: var(--honey); stroke: var(--ink); stroke-width: 2; }
.chart .marker-t { font-size: 9px; font-weight: 900; fill: var(--ink); }
.donut .seg { transition: opacity 0.15s; }
.donut .seg:hover { opacity: 0.78; }
.donut-c { font-weight: 900; font-size: 20px; fill: var(--ink); }
.donut-s { font-weight: 800; font-size: 11px; fill: var(--ink-3); }
.heat .hm0 { fill: var(--surface-3); }
.heat .hm1 { fill: oklch(0.9 0.06 145); }
.heat .hm2 { fill: oklch(0.8 0.1 145); }
.heat .hm3 { fill: oklch(0.66 0.13 145); }
.heat .hm4 { fill: oklch(0.48 0.12 145); }
.heat .axis { fill: var(--ink-3); font-size: 10px; font-weight: 800; }
.spark polyline { stroke: var(--moss-600); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tooltip { position: fixed; left: 0; top: 0; z-index: var(--z-tooltip); pointer-events: none; background: var(--ink); color: #fff; font-size: var(--fs-xs); font-weight: 800; padding: 6px 10px; border-radius: 9px; opacity: 0; transition: opacity 0.12s; max-width: 280px; }
.tooltip.on { opacity: 1; }

/* ---------- Listes & tables ---------- */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1.5px solid var(--surface-2); }
.li:last-child { border-bottom: 0; }
.cat-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; flex: none; }
.table-wrap { overflow-x: auto; border-radius: var(--r); }
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.t th { text-align: left; font-weight: 850; color: var(--ink-3); font-size: var(--fs-xs); padding: 8px 10px; border-bottom: 2px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
table.t td { padding: 8px 10px; border-bottom: 1.5px solid var(--surface-2); vertical-align: middle; }
table.t tr:hover td { background: oklch(0.98 0.008 150); }
table.t .amt { text-align: right; font-weight: 850; }
.cat-select { appearance: none; border: 1.5px solid transparent; background: var(--surface-2); padding: 4px 26px 4px 10px; border-radius: 9px; font-weight: 750; font-size: var(--fs-sm); cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2324372B' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; max-width: 190px; }
.cat-select:hover { border-color: var(--line-strong); }
.cat-select.unsorted { background-color: var(--honey-soft); }
.lbl { max-width: 360px; }
.lbl .m { font-weight: 850; }
.lbl .raw { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.tag { font-size: 0.68rem; font-weight: 900; padding: 1px 7px; border-radius: 6px; background: var(--lilac-soft); color: oklch(0.42 0.11 300); }

/* ---------- Budgets ---------- */
.env { display: grid; grid-template-columns: 40px minmax(130px, 0.9fr) minmax(220px, 2.2fr) 96px; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1.5px solid var(--surface-2); }
.env:last-child { border-bottom: 0; }
.env .nm { font-weight: 850; }
.env .meta { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 750; }
.env .nums { display: flex; justify-content: space-between; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); margin-top: 6px; }
.rule532 { display: grid; gap: 10px; }
.rule532 .r { display: grid; grid-template-columns: 110px 1fr 60px; gap: 10px; align-items: center; font-size: var(--fs-sm); font-weight: 800; }
.rule532 .bar .target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }

/* ---------- Import / dépôt ---------- */
.drop {
  border: 2.5px dashed var(--moss-600); border-radius: var(--r-xl); background: var(--moss-100);
  padding: 34px 22px; text-align: center; display: grid; justify-items: center; gap: 12px; cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.drop:hover, .drop.over { background: var(--moss-200); }
.drop.over { transform: scale(1.01); }
.drop h3 { font-size: var(--fs-lg); }
.weeks { display: flex; gap: 6px; flex-wrap: wrap; }
.wk { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-size: 14px; }
.wk.done { background: var(--honey); border: 2px solid var(--ink); }
.wk.now { outline: 2px dashed var(--ink-3); outline-offset: 2px; }

/* ---------- Objectif ---------- */
.prize-list { display: grid; gap: 10px; }
.prize { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); }
.prize .pc { font-weight: 900; font-size: var(--fs-md); text-align: center; }
.prize.won { border-color: var(--ink); background: var(--honey-soft); box-shadow: var(--press-sm); }
.prize.claimed { background: var(--moss-100); border-color: var(--moss-500); box-shadow: none; }
.sim-row { display: grid; grid-template-columns: 34px minmax(120px, 1fr) minmax(140px, 1.5fr) 60px; gap: 10px; align-items: center; font-size: var(--fs-sm); font-weight: 800; }
.sim-out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--line-strong); background: var(--surface); padding: 6px 12px; border-radius: 999px; font-weight: 800; cursor: pointer; font-size: var(--fs-sm); transition: border-color 0.15s, background 0.15s; }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--honey-soft); }

/* ---------- Trophées ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px; }
.sticker { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 14px 8px 12px; border-radius: 20px; background: var(--surface-2); }
.sticker .disc { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; background: var(--surface); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.sticker.on .disc { background: var(--honey); transform: rotate(-4deg); }
.sticker:not(.on) .disc { filter: grayscale(1); opacity: 0.45; border-style: dashed; box-shadow: none; }
.sticker b { font-size: var(--fs-sm); font-weight: 900; line-height: 1.2; }
.sticker span { font-size: 0.72rem; color: var(--ink-3); font-weight: 750; line-height: 1.3; }
.journal .li { font-size: var(--fs-sm); }
.journal .li .xp { margin-left: auto; font-weight: 900; color: var(--honey-deep); }

/* ---------- Défis ---------- */
.challenge { display: grid; gap: 8px; padding: 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); }
.challenge.active { border-color: var(--ink); box-shadow: var(--press-sm); }
.challenge.won { background: var(--moss-100); border-color: var(--moss-600); }
.challenge.lost { background: var(--surface-2); }
.challenge h4 { font-size: var(--fs); font-weight: 850; }

/* ---------- Point à deux (présentation) ---------- */
.deck { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--bg); display: grid; grid-template-rows: auto 1fr auto; }
.deck-top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1.5px solid var(--line); background: var(--surface); }
.deck-steps { display: flex; gap: 6px; }
.deck-steps i { width: 26px; height: 6px; border-radius: 4px; background: var(--surface-3); }
.deck-steps i.on { background: var(--moss-600); }
.deck-body { overflow-y: auto; padding: 32px clamp(18px, 5vw, 72px); }
.slide { max-width: 1060px; margin: 0 auto; display: grid; gap: 22px; animation: slideIn 0.35s var(--ease-x); }
.slide h2 { font-size: var(--fs-2xl); }
.slide .lead { font-size: var(--fs-lg); font-weight: 700; color: var(--ink-2); max-width: 60ch; }
.deck-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-top: 1.5px solid var(--line); background: var(--surface); }
.big-stat { display: grid; gap: 2px; }
.big-stat .v { font-size: 2.2rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; }
.big-stat .k { font-weight: 800; color: var(--ink-3); font-size: var(--fs-sm); }
.decision { display: grid; grid-template-columns: 28px 1fr 150px 34px; gap: 10px; align-items: center; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------- Modale de célébration ---------- */
.backdrop { position: fixed; inset: 0; z-index: var(--z-backdrop); background: oklch(0.25 0.05 150 / 0.45); display: grid; place-items: center; padding: 20px; animation: fade 0.2s var(--ease); }
.modal { position: relative; z-index: var(--z-modal); width: min(520px, 100%); background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--r-xl); box-shadow: 0 6px 0 var(--ink); padding: 28px 26px 22px; text-align: center; display: grid; gap: 14px; justify-items: center; animation: pop 0.45s var(--ease-x); }
.modal.wide { width: min(760px, 100%); text-align: left; justify-items: stretch; max-height: 90vh; overflow-y: auto; }
.modal h2 { font-size: var(--fs-xl); }
.modal .big-emoji { font-size: 64px; line-height: 1; }
.modal .reward { background: var(--honey-soft); border: 2px dashed var(--honey-deep); border-radius: 16px; padding: 12px 16px; font-weight: 900; font-size: var(--fs-md); }
.modal .close { position: absolute; top: 10px; right: 10px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: var(--z-toast); }

/* Coffre */
.chest-open { font-size: 86px; line-height: 1; display: inline-block; animation: chest 0.9s var(--ease-x); }
@keyframes chest { 0% { transform: scale(0.6) rotate(-8deg); } 40% { transform: scale(1.12) rotate(6deg); } 70% { transform: scale(0.98) rotate(-2deg); } 100% { transform: none; } }
.loot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.loot > div { background: var(--surface-2); border-radius: 14px; padding: 10px 14px; font-weight: 900; display: grid; justify-items: center; gap: 2px; min-width: 120px; }
.loot .ico { font-size: 28px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: var(--z-toast); display: grid; gap: 10px; justify-items: end; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 14px; font-weight: 800; font-size: var(--fs-sm); box-shadow: 0 10px 30px -10px oklch(0.2 0.05 150 / 0.5); animation: toastIn 0.3s var(--ease-x); max-width: 380px; }
.toast.xp { background: var(--honey); color: var(--ink); border: 2px solid var(--ink); }
.toast.bad { background: var(--coral-deep); }
.toast .act { margin-left: 6px; background: oklch(1 0 0 / 0.16); border: 0; color: inherit; font-weight: 900; padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Assistant de configuration ---------- */
.setup { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.2fr); }
.setup-art { background: var(--moss-800); color: var(--on-moss); padding: 40px clamp(24px, 4vw, 56px); display: grid; align-content: space-between; gap: 30px; }
.setup-art h1 { font-size: 2.4rem; letter-spacing: -0.02em; }
.setup-art .duo { display: flex; gap: 4px; align-items: flex-end; }
.setup-art .verse { background: oklch(0.295 0.06 155); }
.setup-main { padding: 40px clamp(20px, 5vw, 72px); display: grid; align-content: start; gap: 22px; max-width: 760px; }
.setup-steps { display: flex; gap: 8px; }
.setup-steps i { flex: 1; height: 8px; border-radius: 6px; background: var(--surface-3); }
.setup-steps i.on { background: var(--moss-600); }
.player-card { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--surface); }
.species { display: flex; gap: 6px; flex-wrap: wrap; }
.species button, .swatches button { border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 2px; cursor: pointer; transition: border-color 0.15s, transform 0.15s var(--ease); }
.species button[aria-pressed="true"], .swatches button[aria-pressed="true"] { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--press-sm); }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; padding: 0; }
.goal-presets { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Vide ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 40px 20px; }
.empty p { max-width: 46ch; color: var(--ink-2); font-weight: 650; }

/* ---------- Réactivité ---------- */
@media (max-width: 1180px) {
  .home-hero, .split { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 10px; }
  .side .players, .side-hint, .side-foot .streak { display: none; }
  .nav { grid-auto-flow: column; overflow-x: auto; width: 100%; }
  .nav a span { display: none; }
  .side-foot { margin: 0 0 0 auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .env { grid-template-columns: 34px 1fr; }
  .env > :nth-child(3), .env > :nth-child(4) { grid-column: 1 / -1; }
  .setup { grid-template-columns: 1fr; }
  .stage { min-height: 360px; }
  .decision { grid-template-columns: 28px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media print {
  .side, .topbar .btn, .deck-top, .deck-foot, .toasts { display: none !important; }
  .app { display: block; }
  .deck { position: static; }
  .panel { box-shadow: none; break-inside: avoid; }
}

/* Équation revenus − dépenses = capacité */
.equation { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.equation .eq { display: grid; gap: 2px; padding: 4px 6px; }
.equation .eq.hl { background: var(--moss-100); border-radius: var(--r); padding: 10px 16px; }
.equation .k { font-size: var(--fs-xs); font-weight: 850; color: var(--ink-3); }
.equation .v { font-size: var(--fs-xl); font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.equation .v small { font-size: var(--fs-sm); color: var(--ink-3); }
.equation .op { font-size: var(--fs-xl); font-weight: 900; color: var(--ink-3); }

/* Chemin de la maison */
.journey { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; position: relative; }
.journey .step { display: grid; justify-items: center; text-align: center; gap: 4px; position: relative; }
.journey .step::before { content: ''; position: absolute; top: 17px; left: -50%; right: 50%; height: 4px; background: var(--surface-3); z-index: 0; }
.journey .step:first-child::before { display: none; }
.journey .step.past::before, .journey .step.now::before { background: var(--moss-500); }
.journey .dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink-3); }
.journey .past .dot { background: var(--moss-500); border-color: var(--ink); color: #fff; }
.journey .now .dot { background: var(--honey); border-color: var(--ink); color: var(--ink); box-shadow: var(--press-sm); }
.journey .nm { font-size: 0.72rem; font-weight: 850; line-height: 1.2; }
.journey .now .nm { color: var(--ink); }
.journey .step:not(.past):not(.now) .nm { color: var(--ink-3); }
.duo-bar { height: 14px; border-radius: 8px; background: color-mix(in oklch, var(--honey) 70%, white); overflow: hidden; border: 2px solid var(--ink); }
.duo-bar i { display: block; height: 100%; background: var(--moss-500); }
.agenda { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-weight: 750; color: var(--ink-2); }
@media (max-width: 860px) { .journey { grid-template-columns: repeat(3, 1fr); row-gap: 14px; } .journey .step::before { display: none; } }

/* Correctifs de mise en page des listes */
.li .lbl { min-width: 0; max-width: none; }
.li .lbl .raw { max-width: 100%; }
.li .cat-select { max-width: 150px; flex: none; }
.wk { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.weeks { gap: 5px; }
.modal .stack-sm { text-align: left; }
.jar-tag { white-space: nowrap; }
@media (max-width: 860px) {
  .stage-ui .stage-tag + .stage-tag, .stage-hint { display: none; }
  .stage-tag b { font-size: var(--fs); }
}
.env .nums { gap: 8px; align-items: center; }
.env .nums > span { white-space: nowrap; }

/* ---------- Connexion au serveur de la maison ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.auth-form { display: grid; gap: 20px; max-width: 560px; }
.who { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.who legend { font-weight: 800; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.who button { display: grid; justify-items: center; gap: 4px; padding: 14px 10px 12px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); font: inherit; font-weight: 850; font-size: var(--fs-md); color: var(--ink); cursor: pointer; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.2s var(--ease); }
.who button:hover { border-color: var(--ink-3); }
.who button:active { transform: translateY(2px); }
.who button[aria-pressed="true"] { border-color: var(--moss-600); box-shadow: 0 0 0 4px var(--moss-100); }
.who button:focus-visible { outline: 3px solid var(--moss-600); outline-offset: 2px; }
.auth-error { color: var(--coral-deep); font-weight: 800; font-size: var(--fs-sm); min-height: 1.3em; margin: -6px 0 -8px; }
.auth-down { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.srv-list .li { gap: 10px; }
@media (max-width: 860px) {
  .setup { grid-template-columns: 1fr; }
  .setup-art { padding: 24px 20px; gap: 18px; }
  .setup-art h1 { font-size: 1.8rem; }
  .setup-art .duo svg { width: 76px; height: 76px; }
  .setup-art .verse { display: none; }
  .auth-form .grid-2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .who button { transition: none; } }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 20px; background: #fff; color: #1f1f1f; border: 1.5px solid #747775; border-radius: 999px; font-weight: 800; font-size: var(--fs-md); text-decoration: none; transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.btn-google:hover { background: #f4f6f5; box-shadow: 0 1px 3px oklch(0.3 0.02 150 / 0.25); }
.btn-google:focus-visible { outline: 3px solid var(--moss-600); outline-offset: 2px; }
.srv-list + p + .row .btn-google, .panel .btn-google { padding: 8px 14px; font-size: var(--fs-sm); }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-weight: 800; font-size: var(--fs-sm); }
.or::before, .or::after { content: ""; flex: 1; height: 1.5px; background: var(--line); }
.invite-link { display: grid; gap: 8px; padding: 14px; border-radius: var(--r-lg); background: var(--moss-100); border: 1.5px dashed var(--moss-600); }
.invite-link .row { flex-wrap: nowrap; }
.invite-link .input { flex: 1; min-width: 0; font-size: var(--fs-sm); }

/* Écran d'ouverture (le temps de joindre le serveur) */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--moss-800); }
.boot-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--honey); animation: boot 1s var(--ease) infinite; }
.boot-dot:nth-child(2) { animation-delay: 0.15s; }
.boot-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes boot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-10px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .boot-dot { animation: none; opacity: 0.8; } }
