:root {
  --bg: #0e1116;
  --panel: #161b22;
  --line: #262d36;
  --text: #e6edf3;
  --muted: #8b96a3;
  --good: #4ade80;
  --bad: #ff5d6c;
  --warn: #ffb547;
  --accent: #7be0a8;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
h1, h2, h3 { margin: 0; font-weight: 700; }
h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }
h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 18px 0 8px; }
.label { margin: 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.mono { font-family: var(--mono); }

/* ---------- blob ---------- */
.blob-wrap { width: 64px; height: 64px; flex: none; }
.blob-wrap.big { width: 140px; height: 140px; }
.blob-wrap svg { width: 100%; height: 100%; overflow: visible; }
.blob-body { transform-origin: 50% 90%; animation: wobble 3.2s ease-in-out infinite; }
.mood-panic .blob-body { animation-duration: 0.5s; }
.mood-worried .blob-body { animation-duration: 1.6s; }
.mood-dead .blob-body { animation: none; }
@keyframes wobble {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.04, 0.95); }
}

/* ---------- site ---------- */
.site { min-height: 100vh; }
.banner { background: var(--bad); color: #fff; text-align: center; padding: 10px 16px; font-weight: 600; }
.banner.sim { background: var(--panel); color: var(--warn); border-bottom: 1px solid var(--line); }
.top { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
  max-width: 1200px; margin: 0 auto; padding: 24px 16px 0; }
.id { display: flex; gap: 14px; align-items: center; }
.top h1 { font-size: 1.8rem; }
.tag { margin: 2px 0 0; color: var(--muted); }
.brain-line { font-family: var(--mono); font-size: 0.9rem; color: var(--muted); }

main { max-width: 1200px; margin: 0 auto; padding: 0 16px 48px; }
.hero { text-align: center; padding: 40px 0 32px; }
.countdown { font-family: var(--mono); font-size: clamp(2.6rem, 9vw, 5.5rem); font-weight: 700; margin: 8px 0;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.countdown.low { color: var(--warn); }
.countdown.critical { color: var(--bad); }
.sub { margin: 0; color: var(--muted); }
.warn { color: var(--warn); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.thought-card { grid-row: span 2; }
.thought { white-space: pre-wrap; line-height: 1.55; margin: 0; overflow-wrap: anywhere; }
.big { font-family: var(--mono); font-size: 2.2rem; font-weight: 700; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px;
  font-size: 0.9rem; max-height: 320px; overflow-y: auto; }
.list li { border-bottom: 1px solid var(--line); padding-bottom: 6px; overflow-wrap: anywhere; }
.list li:last-child { border-bottom: 0; }
.list .when { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; margin-right: 8px; }
.list.mono { font-size: 0.82rem; }
.list .refused { color: var(--bad); }
.journal li { white-space: pre-wrap; line-height: 1.5; }
canvas { width: 100%; display: block; }

footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 24px 16px 40px; }

/* ---------- mort ---------- */
.death { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.94); display: grid; place-items: center;
  z-index: 10; padding: 16px; overflow-y: auto; }
.death-inner { max-width: 640px; text-align: center; }
.death-inner .blob-wrap { margin: 0 auto 16px; }
.death h2 { font-size: 2.4rem; color: var(--text); text-transform: none; letter-spacing: 0; }
.death blockquote { font-style: italic; color: var(--muted); border-left: 3px solid var(--line); text-align: left;
  margin: 20px 0; padding: 4px 16px; white-space: pre-wrap; }
.death .kv { max-width: 360px; margin: 0 auto; }

/* ---------- scène Twitch 1920×1080 ---------- */
.stage { width: 1920px; height: 1080px; overflow: hidden; position: relative; }
.stage-grid { display: grid; grid-template-columns: 1fr 560px; gap: 32px; padding: 48px 48px 120px; height: 100%; }
.stage-left { display: flex; flex-direction: column; gap: 36px; min-height: 0; }
.stage-head { display: flex; gap: 36px; align-items: center; }
.countdown.huge { font-size: 132px; margin: 4px 0; }
.stage .sub { font-size: 1.5rem; font-family: var(--mono); }
.stage-thought { flex: 1; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 32px; overflow: hidden; display: flex; flex-direction: column; }
.stage-thought .thought { font-size: 2rem; line-height: 1.45; margin-top: 16px; overflow: hidden; flex: 1; }
.typed::after { content: "▍"; color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.stage-right { display: flex; flex-direction: column; gap: 20px; }
.stage .big { font-size: 3.2rem; }
.stage .kv { font-size: 1.15rem; }
.stage .list { font-size: 1.15rem; max-height: none; }
.ticker { position: absolute; left: 0; right: 0; bottom: 0; height: 72px; display: flex; align-items: center; gap: 16px;
  padding: 0 48px; background: var(--panel); border-top: 1px solid var(--line); font-size: 1.6rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-badge { position: absolute; top: 16px; right: 48px; font-size: 1rem; color: var(--muted); }
.toast { position: absolute; top: 48px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #0e1116;
  font-size: 2.2rem; font-weight: 700; padding: 18px 36px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: pop 0.3s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes pop { from { transform: translateX(-50%) scale(0.8); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .blob-body, .typed::after, .toast { animation: none; }
}
