:root {
  --vert: #3f6b35;
  --vert-fonce: #1f3a1b;
  --vert-clair: #e4eedb;
  --bois: #6b3e26;
  --bois-clair: #a8744f;
  --creme: #faf6ec;
  --papier: #ffffff;
  --encre: #22281f;
  --gris: #5d6558;
  --tomate: #c8472a;
  --soleil: #f2b632;
  --ciel: #3d7fa6;
  --radius: 14px;
  --ombre: 0 6px 20px rgba(31, 58, 27, .10);
  --titre: "Uncial Antiqua", Georgia, serif;
  --texte: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--texte);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--encre);
  background: var(--creme);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--vert); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--bois); }
h1, h2, h3 { line-height: 1.2; color: var(--vert-fonce); }
h1, h2 { font-family: var(--titre); font-weight: 400; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 2.5rem 0 1rem; }
h3 { font-size: 1.15rem; margin: .2rem 0 .4rem; }
.wrap { width: min(1150px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }
.note { font-size: .92rem; color: var(--gris); font-style: italic; }
ul.plain { list-style: none; padding: 0; margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--soleil); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--vert-fonce);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-family: var(--titre); font-size: 1.3rem; }
.brand img { width: 44px; height: 44px; border-radius: 50%; background: #fff; object-fit: cover; border: 2px solid var(--soleil); }
.brand:hover { color: var(--soleil); }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .2rem; margin: 0; padding: 0; }
.site-nav a { display: block; padding: .45rem .7rem; color: #f1efe4; text-decoration: none; font-weight: 700; font-size: .95rem; border-radius: 999px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: var(--soleil); }
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 3px; margin: 5px 0; background: #fff; border-radius: 2px; transition: .2s; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--vert-fonce); max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  .site-nav.open { max-height: 480px; }
  .site-nav ul { flex-direction: column; padding: .5rem 16px 1rem; }
  .site-nav a { border-radius: 8px; padding: .7rem; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ---------- Boutons ---------- */
.btn { display: inline-block; padding: .75rem 1.3rem; border-radius: 999px; font-weight: 800; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit; font-size: 1rem; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--soleil); color: var(--vert-fonce); }
.btn-primary:hover { background: #ffc94d; color: var(--vert-fonce); }
.btn-ghost { border-color: #fff; color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--vert-fonce); }
.btn-ghost-dark { border-color: var(--vert); color: var(--vert); background: transparent; }
.btn-ghost-dark:hover { background: var(--vert); color: #fff; }

/* ---------- Accueil ---------- */
.hero {
  position: relative; min-height: 78vh; display: flex; align-items: flex-end;
  background: var(--hero) center 35% / cover no-repeat, var(--vert-fonce);
  color: #fff;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,35,15,.15) 0%, rgba(20,35,15,.35) 45%, rgba(20,35,15,.85) 100%); }
.hero-inner { position: relative; padding: 4rem 0 3.5rem; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 7vw, 4.6rem); margin: .2rem 0 .6rem; text-shadow: 0 3px 12px rgba(0,0,0,.4); }
.hero-kicker { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: .85rem; color: var(--soleil); margin: 0; }
.hero-lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); max-width: 640px; margin: 0 0 1.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.open-strip { background: var(--bois); color: #fff; }
.open-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; padding: .9rem 0; font-weight: 700; }
.open-badge { background: var(--soleil); color: var(--vert-fonce); padding: .25rem .8rem; border-radius: 999px; }

.section { padding: 1rem 0 3rem; }
.intro-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; align-items: center; }
.intro-grid p { font-size: 1.12rem; }
.troll-card { margin: 0; background: var(--papier); padding: 1.2rem; border-radius: var(--radius); box-shadow: var(--ombre); transform: rotate(2deg); }
.troll-card figcaption { text-align: center; font-size: .9rem; color: var(--gris); margin-top: .5rem; }

.stats { background: var(--vert); color: #fff; padding: 2.2rem 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; text-align: center; }
.stat strong { display: block; font-family: var(--titre); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--soleil); }
.stat span { font-weight: 700; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.2rem; }
.card { background: var(--papier); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--ombre); text-decoration: none; color: var(--encre); border-top: 5px solid var(--vert); transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.card:nth-child(2) { border-color: var(--soleil); }
.card:nth-child(3) { border-color: var(--tomate); }
.card:nth-child(4) { border-color: var(--bois-clair); }
.card:nth-child(5) { border-color: var(--ciel); }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(31,58,27,.16); color: var(--encre); }
.card-emoji { font-size: 2.2rem; }
.card p { margin: .2rem 0 0; color: var(--gris); }
.card-now { margin-top: .8rem; font-size: .9rem; font-weight: 700; color: var(--vert); }

.drone { background: var(--vert-clair); padding: 3rem 0; }
.drone-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: center; }
.drone figure { margin: 0; }
.drone img { border-radius: var(--radius); box-shadow: var(--ombre); }
.drone h2 { margin-top: 0; }

.video-feature { max-width: 760px; margin: 0 auto 1.5rem; }

/* ---------- Pages ---------- */
.page-hero { background: linear-gradient(135deg, var(--vert-fonce), var(--vert)); color: #fff; padding: 3rem 0 2.6rem; text-align: center; }
.page-hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); margin: .3rem 0; }
.page-hero .lead { max-width: 760px; margin: .6rem auto 0; font-size: 1.15rem; }
.page-hero .lead a { color: var(--soleil); }
.page-emoji { font-size: 2.8rem; display: block; }
.content { padding: 2rem 0 4rem; }
.content > p, .content > ul, .content > ol { max-width: 820px; }
.content > p > img, .content p img { border-radius: var(--radius); box-shadow: var(--ombre); margin: 1.5rem 0; }

.spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.space { background: var(--papier); padding: 1.2rem; border-radius: var(--radius); box-shadow: var(--ombre); }
.space span { font-size: 2rem; }
.space p { margin: 0; color: var(--gris); font-size: .96rem; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.info-card { background: var(--papier); padding: 1.2rem 1.5rem; border-radius: var(--radius); box-shadow: var(--ombre); border-left: 5px solid var(--vert); }
.info-card h3 { margin-top: .4rem; }
.info-card { min-width: 0; overflow-wrap: anywhere; }
.map iframe { width: 100%; height: 400px; border: 0; border-radius: var(--radius); box-shadow: var(--ombre); }

/* ---------- Agenda ---------- */
.month-picker { display: grid; grid-template-columns: repeat(12, 1fr); gap: .35rem; margin-bottom: 1.2rem; }
.month-btn { padding: .6rem 0; border: 2px solid var(--vert); background: var(--papier); color: var(--vert-fonce); font-weight: 800; border-radius: 10px; cursor: pointer; font-family: inherit; font-size: .9rem; }
.month-btn:hover { background: var(--vert-clair); }
.month-btn.active { background: var(--vert); color: #fff; }
.month-btn.today { box-shadow: 0 0 0 3px var(--soleil); }
@media (max-width: 700px) { .month-picker { grid-template-columns: repeat(6, 1fr); } }

.month-panel { background: var(--papier); border-radius: var(--radius); box-shadow: var(--ombre); padding: 1.2rem 1.5rem 1.5rem; }
.month-title { margin: .3rem 0 1rem; }
.month-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.month-col { border-radius: 10px; padding: .8rem 1rem; }
.month-col h3 { font-size: 1rem; }
.month-col ul { list-style: none; padding: 0; margin: 0; }
.month-col li { padding: .15rem 0; }
.month-col li.empty { color: var(--gris); font-style: italic; }
.col-abri { background: #f3e9ff; }
.col-terre { background: #e5f2dc; }
.col-plant { background: #fff2cf; }
.col-recolte { background: #fde3dc; }
@media (max-width: 900px) { .month-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .month-cols { grid-template-columns: 1fr; } }

.legend { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-bottom: 1rem; font-weight: 700; font-size: .95rem; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin: 1px; }
.dot.abri { background: #8a5cc7; }
.dot.terre { background: #4f9a3b; }
.dot.plant { background: #e0a100; }
.dot.recolte { background: var(--tomate); }
.agenda-filter { margin-bottom: 1rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.agenda-filter label { font-weight: 700; }
.agenda-filter input, .stepper input { font-family: inherit; font-size: 1rem; padding: .5rem .8rem; border: 2px solid #cfd8c7; border-radius: 10px; }
.agenda-filter input { min-width: 240px; }

.table-scroll { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--ombre); background: var(--papier); }
.agenda-table, .voisin-table { width: 100%; border-collapse: collapse; }
.agenda-table th, .agenda-table td { border-bottom: 1px solid #ecefe7; padding: .45rem .3rem; text-align: center; }
.agenda-table thead th { background: var(--vert-fonce); color: #fff; position: sticky; top: 0; font-size: .9rem; }
.agenda-table tbody th { text-align: left; min-width: 190px; font-weight: 700; padding-left: .8rem; }
.agenda-table td { min-width: 34px; line-height: 1; }
.agenda-table .current-col { background: #fff7dc; }
.agenda-table thead .current-col { background: var(--soleil); color: var(--vert-fonce); }
.agenda-table summary { cursor: pointer; }
.agenda-table details p { font-weight: 400; font-size: .88rem; color: var(--gris); margin: .3rem 0 .2rem; max-width: 280px; }

/* ---------- Compagnonnage ---------- */
.chip-picker { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { border: 2px solid #cfd8c7; background: var(--papier); border-radius: 999px; padding: .4rem .9rem; font-family: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; color: var(--encre); }
.chip:hover { border-color: var(--vert); }
.chip.active { background: var(--vert); border-color: var(--vert); color: #fff; }
.chip.is-friend { border-color: #4f9a3b; background: #e5f2dc; }
.chip.is-foe { border-color: var(--tomate); background: #fde3dc; }
.compagnon-result { margin-top: 1.4rem; background: var(--papier); border-radius: var(--radius); box-shadow: var(--ombre); padding: 1.3rem 1.5rem; }
.compagnon-title { font-family: var(--titre); font-weight: 400; font-size: 1.6rem; margin: 0; }
.compagnon-note { color: var(--gris); margin: .3rem 0 1rem; }
.compagnon-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.compagnon-cols > div { border-radius: 10px; padding: .8rem 1rem; }
.compagnon-cols .friends { background: #e5f2dc; }
.compagnon-cols .foes { background: #fde3dc; }
.compagnon-cols h4 { margin: 0 0 .4rem; }
.compagnon-cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.compagnon-cols li { background: rgba(255,255,255,.8); padding: .2rem .7rem; border-radius: 999px; font-weight: 700; font-size: .95rem; }
@media (max-width: 600px) { .compagnon-cols { grid-template-columns: 1fr; } }
.stars { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.star { background: var(--papier); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--ombre); border-top: 5px solid var(--soleil); }
.star-plants { font-weight: 800; color: var(--vert); margin: .2rem 0; }
.star p:last-child { margin-bottom: 0; color: var(--gris); font-size: .96rem; }
.voisin-table th, .voisin-table td { padding: .6rem .9rem; border-bottom: 1px solid #ecefe7; text-align: left; vertical-align: top; }
.voisin-table thead th { background: var(--vert-fonce); color: #fff; }
.voisin-table td:nth-child(2) { color: #2f6b22; }
.voisin-table td:nth-child(3) { color: #a23a20; }

/* ---------- Amis / ennemis ---------- */
.tab-list { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tab { flex: 1 1 240px; padding: 1rem; font-family: var(--titre); font-size: 1.2rem; border: 3px solid transparent; border-radius: var(--radius); cursor: pointer; background: var(--papier); box-shadow: var(--ombre); color: var(--encre); }
.tab-amis[aria-selected="true"] { background: #e5f2dc; border-color: #4f9a3b; }
.tab-ennemis[aria-selected="true"] { background: #fde3dc; border-color: var(--tomate); }
.panel-intro { max-width: 820px; font-size: 1.08rem; }
.fauna-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.fauna { background: var(--papier); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--ombre); }
.fauna.ami { border-left: 5px solid #4f9a3b; }
.fauna.ennemi { border-left: 5px solid var(--tomate); }
.fauna-head { display: flex; gap: .8rem; align-items: center; }
.fauna-emoji { font-size: 2.6rem; line-height: 1; }
.fauna-head h3 { margin: 0; }
.fauna-role { margin: 0; font-size: .9rem; font-weight: 700; color: var(--gris); }
.fauna-tip { background: var(--vert-clair); padding: .6rem .8rem; border-radius: 10px; font-size: .95rem; margin-bottom: 0; }
.fauna-sol-title { font-weight: 800; margin: .8rem 0 .2rem; }
.fauna ul { margin: 0; padding-left: 1.2rem; font-size: .96rem; }

/* ---------- Panier ---------- */
.panier-toolbar { margin-bottom: 1rem; }
.toggle { font-weight: 700; display: inline-flex; gap: .5rem; align-items: center; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--vert); }
.panier-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.5rem; align-items: start; }
.produits { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.produit { display: flex; align-items: center; gap: .9rem; background: var(--papier); border-radius: var(--radius); padding: .7rem 1rem; box-shadow: var(--ombre); border: 2px solid transparent; }
.produit.selected { border-color: var(--vert); background: #f6fbf2; }
.produit-emoji { font-size: 2rem; }
.produit-info { flex: 1; display: flex; flex-direction: column; }
.produit-prix { color: var(--gris); font-size: .95rem; }
.badge-saison { display: none; align-self: flex-start; font-size: .75rem; font-weight: 800; background: var(--soleil); color: var(--vert-fonce); padding: .05rem .5rem; border-radius: 999px; margin-top: .15rem; }
.produit.in-season .badge-saison { display: inline-block; }
.panier.season-only .produit:not(.in-season):not(.selected) { display: none; }
.stepper { display: flex; align-items: center; gap: .3rem; }
.stepper input { width: 4.2rem; text-align: center; padding: .4rem; }
.step { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--vert); color: #fff; font-size: 1.3rem; font-weight: 800; cursor: pointer; line-height: 1; }
.step.minus { background: var(--bois-clair); }
.recap { position: sticky; top: 84px; background: var(--papier); border-radius: var(--radius); box-shadow: var(--ombre); padding: 1.3rem 1.5rem; border-top: 6px solid var(--soleil); }
.recap h2 { margin: 0 0 .8rem; font-size: 1.6rem; }
.recap-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.recap-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed #dfe5d8; }
.recap-list li.empty { color: var(--gris); font-style: italic; border: 0; }
.recap-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.2rem; font-weight: 800; padding: .6rem 0; border-top: 3px solid var(--vert-fonce); }
.recap-total strong { font-size: 1.7rem; color: var(--vert); }
.adhesion { display: flex; gap: 1rem; align-items: flex-start; background: #fff5d6; border-left: 6px solid var(--soleil); border-radius: var(--radius); padding: 1rem 1.3rem; margin-bottom: 1.2rem; box-shadow: var(--ombre); }
.adhesion-emoji { font-size: 2rem; line-height: 1; }
.adhesion p { margin: .3rem 0 0; }
.recap-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.recap-msg { color: var(--vert); font-weight: 700; min-height: 1.4em; margin: .5rem 0 0; }
@media (max-width: 860px) { .panier-layout { grid-template-columns: 1fr; } .recap { position: static; } }

/* ---------- Vidéos ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.4rem; }
.video { margin: 0; background: var(--papier); border-radius: var(--radius); overflow: hidden; box-shadow: var(--ombre); }
.video-frame { aspect-ratio: 16 / 9; background: var(--vert-fonce); }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video figcaption { padding: .9rem 1.1rem 1.1rem; }
.video-meta { display: block; font-size: .88rem; color: var(--gris); margin-top: .3rem; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--vert-fonce); color: #e8ecdf; padding-top: 2.5rem; margin-top: 2rem; }
.site-footer a { color: var(--soleil); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.footer-title { font-family: var(--titre); font-size: 1.2rem; color: #fff; margin: 0 0 .4rem; }
.footer-grid p { margin: 0 0 .5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 1.5rem; padding: 1rem 0 1.4rem; font-size: .9rem; opacity: .85; }
.footer-bottom p { margin: 0; }

@media (max-width: 820px) {
  .intro-grid, .drone-grid { grid-template-columns: 1fr; }
  .troll-card { max-width: 320px; margin: 0 auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: 70vh; }
}

/* Crédit discret du pied de page */
.footer-bottom .credit { margin-top: .4rem; font-size: .8rem; opacity: .65; }
.footer-bottom .credit a { color: inherit; }

/* ---------- Espace admin (page cachée /admin/) ---------- */
.admin { padding-bottom: 3rem; }
.admin-login { max-width: 420px; margin: 0 auto; background: var(--papier); border-radius: var(--radius); box-shadow: var(--ombre); padding: 1.5rem; }
.admin-login label { display: block; font-weight: 700; margin-bottom: .5rem; }
.admin-login-ligne { display: flex; gap: .6rem; }
.admin-login-ligne input { flex: 1; }
.admin input, .admin select { font: inherit; padding: .65rem .8rem; border: 2px solid var(--vert-clair); border-radius: 10px; background: #fff; width: 100%; box-sizing: border-box; }
.admin input:focus, .admin select:focus { outline: none; border-color: var(--vert); }
.admin-msg { color: var(--tomate); margin: .6rem 0 0; min-height: 1.2em; }
.admin-zone { display: grid; gap: 1.5rem; }
.admin-bloc { background: var(--papier); border-radius: var(--radius); box-shadow: var(--ombre); padding: 1.5rem; }
.admin-bloc h2 { margin-top: 0; }
.admin-grille { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-bottom: 1.2rem; }
.admin-grille label { display: grid; gap: .35rem; font-weight: 700; font-size: .95rem; }
.admin-grille .large { grid-column: 1 / -1; }
.admin-resultat { margin-top: 1.2rem; padding: 1rem; background: var(--vert-clair); border-radius: 10px; }
.admin-resultat p { margin: 0 0 .8rem; overflow-wrap: anywhere; }
.admin-boutons { display: flex; flex-wrap: wrap; gap: .6rem; }
.admin-note { color: var(--gris); font-size: .9rem; }
.admin-lien { background: none; border: 0; padding: 0; color: var(--vert); text-decoration: underline; cursor: pointer; font: inherit; }
@media (max-width: 560px) { .admin-grille { grid-template-columns: 1fr; } .admin-login-ligne { flex-direction: column; } }
