/* LumiJardin — jardin contemporain, clair, géométrique. Formes en SVG/CSS uniquement. */
:root { --bg: #f6faf8; --card: #fff; --ink: #203840; --muted: #5a7078; --line: #dbe8e3; --cell: #eef5f2; --cell2: #e7f1ed; --accent: #27a98c; --accent-ink: #fff;
  --coral: #ed6975; --blue: #398ce5; --mint: #27a98c; --violet: #8a70d2; --honey: #c99120; --pink: #d45ba8; --ocean: #2f7f9a; --orange: #e5752b;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color-scheme: light; }
:root.hc { --ink: #0c1f25; --muted: #2f4249; --line: #9fb8b0; --cell: #ffffff; --cell2: #f1f5f3; --coral: #c8364a; --blue: #1c63b8; --mint: #0d7d64; --violet: #6a4cc0; --honey: #8f6200; --pink: #a8307f; --ocean: #145a72; --orange: #b4500f; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg) radial-gradient(circle at 85% -10%, #dff3ec 0, transparent 45%) no-repeat; color: var(--ink); font: 17px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
main { max-width: 1040px; margin: 0 auto; padding: calc(8px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.c-coral { --c: var(--coral); } .c-blue { --c: var(--blue); } .c-mint { --c: var(--mint); } .c-violet { --c: var(--violet); } .c-honey { --c: var(--honey); } .c-pink { --c: var(--pink); } .c-ocean { --c: var(--ocean); } .c-orange { --c: var(--orange); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 18px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: #b8323f; border-color: #e7b8bd; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: .9rem; }
.btn.big { width: 100%; min-height: 64px; font-size: 1.25rem; border-radius: 20px; }
.icon-btn { width: 46px; height: 46px; flex: none; display: inline-grid; place-items: center; border: 0; border-radius: 14px; background: transparent; cursor: pointer; text-decoration: none; color: var(--ink); font-size: 1.3rem; }
.icon-btn:hover { background: var(--cell); } .icon-sp { width: 46px; flex: none; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card { background: var(--card); border-radius: 22px; padding: 16px; box-shadow: 0 6px 24px #20384012; border: 1px solid var(--line); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .row.center, .center { justify-content: center; text-align: center; }
.note { color: var(--muted); font-size: .9rem; }
.loading { text-align: center; padding-top: 28vh; color: var(--muted); }
.oops { max-width: 420px; margin: 0 auto; text-align: center; } .oops h2 { margin-top: 0; color: var(--coral); }
.warn { margin: 0; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: #fff4dc; color: var(--ink); text-align: center; font-size: .92rem; border-bottom: 1px solid #ecd9a8; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 24px); padding: 10px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 10px 30px #0003; }
/* Accueil */
#home { max-width: 560px; margin: 0 auto; }
.hero { text-align: center; margin: 18px 0 16px; }
.logo { width: 84px; height: 84px; filter: drop-shadow(0 8px 18px #27a98c33); }
.hero h1 { margin: 6px 0 0; font-size: clamp(2.3rem, 11vw, 3.2rem); letter-spacing: -.02em; line-height: 1; }
.hero h1 span { color: var(--accent); }
.tag { margin: 6px 0 0; color: var(--muted); font-weight: 600; }
.home-actions { display: grid; gap: 12px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px; min-height: 76px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.mode:hover { border-color: var(--accent); }
.mode b { grid-column: 2; } .mode small { grid-column: 2; color: var(--muted); font-size: .8rem; line-height: 1.25; }
.mode-ic { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px; background: var(--cell); position: relative; overflow: hidden; }
.mode-ic::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; }
.m-balade .mode-ic::before { background: radial-gradient(circle, var(--honey) 0 25%, #fff 26% 60%, transparent 61%); box-shadow: 0 0 0 3px #f3e7c8; }
.m-floraison .mode-ic::before { background: conic-gradient(var(--coral) 0 25%, var(--blue) 0 50%, var(--mint) 0 75%, var(--violet) 0); }
.m-jour .mode-ic::before { border-radius: 6px; background: linear-gradient(var(--coral) 0 30%, #fff 30%); box-shadow: inset 0 0 0 2px var(--coral); }
.m-atelier .mode-ic::before { border-radius: 4px; background: linear-gradient(90deg, transparent 45%, var(--violet) 45% 55%, transparent 55%), linear-gradient(transparent 45%, var(--violet) 45% 55%, transparent 55%); }
.progress { text-align: center; color: var(--muted); font-weight: 600; margin: 16px 0 6px; }
.foot { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 18px; }
/* Jardins */
.gbar { display: flex; align-items: center; gap: 6px; min-height: 52px; }
.gbar h1 { flex: 1; margin: 0; font-size: 1.1rem; text-align: center; line-height: 1.2; }
.garden { margin: 10px 0 20px; } .garden h2 { font-size: 1.05rem; margin: 0 0 8px; } .garden h2 small { color: var(--muted); font-weight: 600; }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.lv { display: grid; place-items: center; height: 52px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--line); color: var(--ink); font-weight: 800; text-decoration: none; position: relative; }
.lv.done { background: #e4f6ef; border-color: var(--mint); } .lv.done::after { content: "✿"; position: absolute; top: 1px; right: 5px; font-size: .7rem; color: var(--mint); }
.lv.cur { box-shadow: 0 0 0 3px var(--honey); }
/* Partie */
#game { display: flex; flex-direction: column; min-height: calc(100dvh - 26px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.board-wrap { position: relative; width: min(100%, calc(100dvh - 300px), 640px); min-width: min(100%, 300px); }
.board { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; border-radius: 22px; background: var(--card); box-shadow: 0 8px 30px #20384014; }
.board:focus-visible { outline: 3px solid var(--violet); }
.cell { fill: var(--cell); } .cell.alt { fill: var(--cell2); }
.line { fill: none; stroke: var(--c); stroke-width: .34; stroke-linecap: round; stroke-linejoin: round; }
.halo { fill: none; stroke: var(--c); stroke-width: .62; stroke-linecap: round; stroke-linejoin: round; opacity: .22; animation: glow .25s ease; }
@keyframes glow { from { opacity: .55; stroke-width: .8; } }
.source .dot { fill: var(--c); stroke: #fff; stroke-width: .05; } .source .sym { fill: #fff; }
:root.nosym .source .sym, :root.nosym .fsym, :root.nosym .relay .sym { display: none; }
.rock path { fill: #a9b8b3; } .rock .shine { fill: none; stroke: #d6e0dc; stroke-width: .05; stroke-linecap: round; }
.relay .ring { fill: #fff; stroke: var(--c); stroke-width: .07; stroke-dasharray: .12 .07; } .relay .sym { fill: var(--c); }
.relay.on .ring { fill: var(--c); stroke-dasharray: none; } .relay.on .sym { fill: #fff; }
.petal { fill: var(--c); opacity: .85; } .petal.pw { fill: #fff; stroke: #d8e4df; stroke-width: .02; opacity: 1; }
.petals { transform: scale(.74); transition: transform .26s cubic-bezier(.3, 1.6, .5, 1); }
.flower .heart { fill: #f3d36b; stroke: #e2b93b; stroke-width: .02; }
.flower:not(.lit) .petal { opacity: .32; } .flower:not(.lit) .petal.pw { fill: #d3dfda; opacity: 1; } .flower:not(.lit) .heart { fill: #dfe8e4; stroke: #c3d2cc; }
.flower.lit .petals { transform: scale(1); } .flower .fsym { fill: var(--c); }
.flower.f-white:not(.lit) .petal.pw { fill: #e9f0ed; }
.cursor { fill: none; stroke: var(--violet); stroke-width: .07; }
.nope path { stroke: #c33f4c; stroke-width: .08; stroke-linecap: round; }
.hint circle { fill: var(--c); opacity: .55; animation: blink .6s ease 3 alternate; }
@keyframes blink { to { opacity: .1; } }
.pulse { fill: none; stroke: var(--honey); stroke-width: .08; animation: blink .4s ease 4 alternate; }
.finger { fill: #20384055; stroke: #fff; stroke-width: .05; transition: cx .25s linear, cy .25s linear; }
.half { fill: none; stroke: var(--c); stroke-width: .08; stroke-dasharray: .1 .07; }
.side { width: min(100%, 640px); display: flex; flex-direction: column; gap: 8px; }
.objectives { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.obj { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.obj i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.o-pairs i { background: linear-gradient(90deg, var(--coral) 50%, var(--blue) 50%); }
.o-flowers i { background: radial-gradient(circle, #f3d36b 0 30%, #fff 31% 60%, transparent 61%); box-shadow: 0 0 0 1.5px var(--line); }
.o-relays i { border: 3px dotted var(--violet); } .o-cover i { border-radius: 4px; background: var(--mint); }
.obj.ok { background: #e4f6ef; border-color: var(--mint); }
.obj.ok::after { content: "✓"; color: var(--mint); }
.o-moves, .o-time { color: var(--muted); font-weight: 600; }
.info { min-height: 1.5em; margin: 0; text-align: center; color: var(--muted); font-weight: 600; }
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; font-size: .8rem; font-weight: 700; color: var(--ink); }
.tool:active { background: var(--cell); }
.victory { position: relative; text-align: center; animation: rise .3s ease both; border-color: var(--mint); }
.victory .row { justify-content: center; }
.victory h2 { margin: 0 0 4px; color: var(--accent); } .victory p { margin: 0 0 10px; color: var(--muted); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.won .board .line { filter: drop-shadow(0 0 .04px var(--c)); }
.petals-burst { position: absolute; inset: 0 0 auto; height: 0; pointer-events: none; }
.petals-burst i { position: absolute; left: calc(5% + var(--k) * 9%); top: 0; width: 10px; height: 14px; border-radius: 50% 50% 50% 0; background: var(--coral); animation: fall 1.3s ease-in forwards; animation-delay: calc(var(--k) * 40ms); opacity: 0; }
.petals-burst i:nth-child(3n) { background: var(--mint); } .petals-burst i:nth-child(3n+1) { background: var(--violet); }
@keyframes fall { 0% { opacity: 1; transform: translateY(-10px) rotate(0); } 100% { opacity: 0; transform: translateY(120px) rotate(200deg); } }
/* Dialogues */
dialog { border: 0; border-radius: 24px; padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 30px); background: var(--card); color: var(--ink); box-shadow: 0 24px 60px #20384040; }
dialog::backdrop { background: #20384066; }
dialog h2 { margin: 0 0 10px; font-size: 1.2rem; } .dlg .row { justify-content: flex-end; margin-top: 14px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; } .dlg-head h2 { margin: 0; }
.rules { padding-left: 18px; } .rules li { margin-bottom: 8px; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; font-weight: 600; }
.switch span { display: flex; flex-direction: column; } .switch small { color: var(--muted); font-weight: 500; font-size: .84rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; flex: none; margin: 0; border-radius: 99px; background: #c6d4cf; position: relative; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px #0003; }
.switch input:checked { background: var(--accent); } .switch input:checked::after { transform: translateX(20px); }
.colors { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.colorbtn { min-width: 120px; justify-content: flex-start; }
.chipsym { width: 26px; height: 26px; flex: none; } .chipsym circle { fill: var(--c); } .chipsym path { fill: #fff; }
.colorpick { width: 46px; height: 46px; border-radius: 50%; border: 3px solid transparent; background: none; padding: 2px; cursor: pointer; display: grid; place-items: center; }
.colorpick.on { border-color: var(--ink); } .colorpick .chipsym { width: 34px; height: 34px; }
/* Atelier */
h2.sub { font-size: 1.05rem; margin: 20px 0 8px; }
.mine { list-style: none; padding: 0; display: grid; gap: 8px; } .mine-i { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.mine-i small { color: var(--muted); }
.atelier { display: grid; gap: 12px; }
.atelier .card .row input[type=text] { flex: 1; min-width: 160px; }
.atelier input[type=text], .atelier select, .code-in, .fld input { font-size: 16px; min-height: 46px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; }
.code-in { width: 100%; font-family: ui-monospace, Menlo, monospace; margin-bottom: 8px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-weight: 600; margin: 8px 0; } .fld input { width: 100%; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.seg-b { min-height: 44px; padding: 6px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; }
.seg-b.on { border-color: var(--accent); background: #e4f6ef; }
.edit-board { position: relative; width: min(100%, 560px); margin: 0 auto; }
.tap-layer { position: absolute; inset: calc(100% * .1 / (var(--n) + .2)); display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.tap { border: 0; background: transparent; cursor: pointer; border-radius: 10px; }
.tap:hover { background: #27a98c1a; }
.preview-wrap { width: min(100%, 360px); margin: 0 auto 10px; }
.board.preview { pointer-events: none; }
.tools-row { justify-content: center; }
/* Grands écrans : grille à gauche, informations et commandes à droite */
@media (min-width: 900px) and (min-height: 560px) {
  .stage { flex-direction: row; align-items: flex-start; justify-content: center; gap: 24px; }
  .board-wrap { width: min(calc(100dvh - 120px), 640px); }
  .side { width: 300px; position: sticky; top: 20px; }
  .tools { grid-template-columns: 1fr 1fr; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .stage { flex-direction: row; align-items: center; justify-content: center; gap: 16px; }
  .board-wrap { width: calc(100dvh - 90px); min-width: 0; }
  .side { width: min(46vw, 360px); }
}
@media (max-width: 360px) { .tool span { font-size: .72rem; } .modes { grid-template-columns: 1fr; } }
:root.still *, :root.still *::before, :root.still *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Joueurs (« Qui joue ? ») */
#who { max-width: 480px; margin: 0 auto; }
#who .hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
.logo.small { width: 64px; height: 64px; }
.who { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.who-btn { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 6px 24px #20384012; cursor: pointer; text-align: left; }
.who-btn:hover { border-color: var(--accent); }
.who-btn span:last-child { display: flex; flex-direction: column; } .who-btn small { color: var(--muted); font-size: .85rem; }
.av { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: 1.15rem; }
.player-bar { display: flex; justify-content: center; margin: 0 0 14px; }
.player-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 14px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.player-chip:hover { border-color: var(--accent); }
.player-chip .av { width: 36px; height: 36px; font-size: 1rem; } .player-chip small { color: var(--muted); font-size: .8rem; }
.set-h { margin: 16px 0 8px; font-size: 1rem; } #settings-body > .row { margin-bottom: 8px; }
.err { color: #b8323f; margin: 0; min-height: 1.2em; }
/* Bonus « entièrement éclairé » et mode « Toujours tout éclairer » */
.lv.full { border-color: var(--honey); box-shadow: inset 0 0 0 1.5px var(--honey); } .lv.full::before { content: "✦"; position: absolute; top: 1px; left: 5px; font-size: .7rem; color: var(--honey); }
.lv.full.cur { box-shadow: 0 0 0 3px var(--honey); }
.garden h2 small.full-n { color: var(--honey); }
.progress small { display: block; font-size: .85rem; margin-top: 2px; } .full-count { color: var(--honey); } .fill-on { color: var(--accent); }
.obj.soft { opacity: .75; font-weight: 600; } .obj.soft i { background: transparent; border: 2px solid var(--mint); }
.obj.soft.ok { opacity: 1; border-color: var(--honey); background: #fbf3df; } .obj.soft.ok i { background: var(--honey); border-color: var(--honey); }
.victory p.full-win { color: var(--honey); font-weight: 800; } .victory p.full-tip { font-size: .88rem; }
