:root {
  --bg: #eef5e6;
  --card: #fff;
  --ink: #1f2b1d;
  --muted: #55634f;
  --green: #2d6a33;
  --green-soft: #d8edcc;
  --line: #c5d8b9;
  --danger: #a3293a;
  --focus: #1f6fd1;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 "Segoe UI", system-ui, sans-serif; min-height: 100vh; }
a { color: var(--green); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1 { font-size: 1.5em; margin: 0 0 12px; }
h2 { font-size: 1.15em; margin: 0 0 10px; }
h3 { font-size: 1em; margin: 14px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .88em; }

.top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 1.1em; }
.top nav { display: flex; gap: 14px; }
.top nav a { text-decoration: none; font-weight: 600; padding: 4px 2px; }
.top nav a.active { border-bottom: 3px solid var(--green); }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; outline: none; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.card + .card { margin-top: 16px; }
.narrow { max-width: 440px; margin: 30px auto; }

button, .btn {
  font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--green);
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover:not(:disabled) { background: var(--green-soft); }
button.primary, .btn.primary { background: var(--green); color: #fff; }
button.primary:hover:not(:disabled) { background: #245829; }
button.danger { border-color: var(--danger); color: var(--danger); }
button.link { border: none; background: none; text-decoration: underline; padding: 2px 4px; font-weight: 400; color: var(--muted); }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

form.stack { display: grid; gap: 12px; }
label.field { display: grid; gap: 4px; font-weight: 600; }
input[type="text"], input[type="password"], select, textarea {
  font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid #9fb494; background: #fff; color: var(--ink); width: 100%;
}
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: 18px; height: 18px; }
.error { color: var(--danger); font-weight: 600; min-height: 1.2em; margin: 0; }
.tabs-inline { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs-inline button[aria-pressed="true"] { background: var(--green); color: #fff; }

/* Scène */
.scene {
  position: relative; height: 360px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(#cfe9f7 0%, #e7f5ea 55%, #a9d68f 56%, #7fbf68 100%);
}
.pond { position: absolute; left: 8%; right: 8%; bottom: 6%; height: 28%; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #a8dcef, #6fb8d8); }
.scene .frog { position: absolute; left: 50%; bottom: 16%; width: 170px; height: 158px; margin-left: -85px; }
.scene .visitors { position: absolute; left: 0; right: 0; bottom: 8%; display: flex; justify-content: space-between; padding: 0 4%; pointer-events: none; }
.scene .visitor { width: 70px; text-align: center; font-size: .8em; font-weight: 600; }
.scene .visitor .avatar-svg { width: 56px; height: 66px; }
.scene .visitor span { background: rgba(255,255,255,.85); border-radius: 6px; padding: 0 4px; }
.scene .msg { position: absolute; top: 14px; left: 0; right: 0; text-align: center; min-height: 1.5em; }
.scene .msg span { background: rgba(255,255,255,.92); border: 2px solid var(--green); padding: 5px 12px; border-radius: 12px; font-weight: 600; }
.scene .badge { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.9); border-radius: 10px; padding: 3px 9px; font-size: .85em; font-weight: 600; }

.gauges { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gauge-head { display: flex; justify-content: space-between; font-weight: 600; font-size: .92em; }
.bar { height: 10px; border-radius: 5px; background: #e5ece0; border: 1px solid var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green); }
.bar.low > span { background: repeating-linear-gradient(45deg, #c46a1d, #c46a1d 6px, #d98a3f 6px, #d98a3f 12px); }
.cares { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 12px 0; }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list > li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar-svg { width: 38px; height: 44px; flex: none; }
.person strong { font-size: 1.02em; }
.rights { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pill { font-size: .8em; border-radius: 99px; padding: 1px 8px; background: var(--green-soft); }
.pill.off { background: #eee; color: var(--muted); }
.pill.warn { background: #fde4d2; color: #8a3f0a; }
.journal { list-style: none; padding: 0; margin: 0; max-height: 300px; overflow: auto; font-size: .9em; }
.journal li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.journal time { color: var(--muted); margin-right: 6px; }
.journal .refused { color: #8a4a12; }
.code { font-family: Consolas, monospace; font-size: 1.15em; letter-spacing: 1px; background: var(--green-soft); padding: 2px 8px; border-radius: 6px; }

.avatar-editor { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar-editor .preview .avatar-svg { width: 80px; height: 94px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches label { position: relative; }
.swatches input { position: absolute; opacity: 0; inset: 0; }
.swatches span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; }
.swatches input:checked + span { border-color: var(--ink); }
.swatches input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 10px; max-width: 90vw; }
