/* ============================================================================
   LA PENSION DES PLANTES — Design system
   « Herbier de famille sous la lumière dorée » : carnet botanique français,
   véranda au soleil. Clean, chaleureux, jamais enfantin. Accessible 45+.
   ============================================================================ */

:root {
  --creme: #FAF6EE;
  --creme-2: #F3ECDD;
  --papier: #FDFBF5;
  --encre: #2E3B2E;
  --encre-douce: #55624F;
  --sauge: #7A9471;
  --sauge-fonce: #3E5B45;
  --sauge-pale: #DCE5D4;
  --miel: #D9B44A;
  --or: #8A6D1F;       /* or « texte » : contraste ≥ 4,5:1 sur les fonds papier */
  --or-doux: #C9A227;
  --terracotta: #C1704F;
  --terracotta-fonce: #A85D3F;
  --rose: #D77FA1;
  --ombre: 46, 59, 46;

  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --f-main: "Caveat", "Bradley Hand", cursive;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;
  --tap: 48px;

  --fs-base: 17px;
  --lum-haut: #FFF6DF;   /* teinte du ciel selon l'heure (surchargée par data-heure) */
  --lum-bas: #F8EFD9;
  --lum-accent: #D9B44A;
}

html[data-texte="grand"] { --fs-base: 20px; }

/* --- L'heure réelle teinte la véranda ------------------------------------- */
body[data-heure="aube"]  { --lum-haut: #F3EEE4; --lum-bas: #FCE9D4; --lum-accent: #E8B87F; }
body[data-heure="matin"] { --lum-haut: #FDF6E0; --lum-bas: #F5EFD8; --lum-accent: #E5C558; }
body[data-heure="midi"]  { --lum-haut: #FFFBEA; --lum-bas: #F7F2DC; --lum-accent: #D9B44A; }
body[data-heure="soir"]  { --lum-haut: #F9E5C0; --lum-bas: #F2D3A8; --lum-accent: #D98E4A; }
body[data-heure="nuit"]  { --lum-haut: #DFE3D3; --lum-bas: #CFD8C4; --lum-accent: #9FB8AD; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: var(--fs-base); }

body {
  font-family: var(--f-body);
  color: var(--encre);
  background: var(--creme);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* Grain de papier discret sur tout le fond */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app {
  position: relative; z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--lum-haut) 0%, var(--lum-bas) 42%, var(--creme) 100%);
  transition: background 2s ease;
  box-shadow: 0 0 60px rgba(var(--ombre), 0.12);
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--or-doux); outline-offset: 2px; border-radius: var(--r-sm); }
input { font: inherit; }

h1, h2, h3, .display { font-family: var(--f-display); font-weight: 600; color: var(--sauge-fonce); letter-spacing: 0.01em; }
/* Halo crème : les titres se détachent des fonds illustrés */
.screen > h2, .famille-titre h3, .topbar .brand .title {
  text-shadow: 0 1px 0 rgba(253, 251, 245, 0.95), 0 0 14px rgba(253, 251, 245, 0.85), 0 0 4px rgba(253, 251, 245, 0.9);
}
.topbar .brand .sub { text-shadow: 0 1px 0 rgba(253, 251, 245, 0.9), 0 0 8px rgba(253, 251, 245, 0.8); }

/* ============================== Barre du haut ============================== */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  gap: 10px;
  /* Scrim : la marque reste lisible sur les fonds de pièces générés */
  background: linear-gradient(180deg, rgba(250, 246, 238, 0.92) 0%, rgba(250, 246, 238, 0.62) 68%, rgba(250, 246, 238, 0) 100%);
}
.topbar .brand { display: flex; flex-direction: column; line-height: 1.15; }
.topbar .brand .title { font-family: var(--f-display); font-size: 1.18rem; color: var(--sauge-fonce); }
.topbar .brand .sub { font-size: 0.74rem; color: var(--encre-douce); letter-spacing: 0.06em; text-transform: uppercase; }

.pills { display: flex; gap: 8px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  background: var(--papier);
  border: 1.5px solid rgba(var(--ombre), 0.1);
  border-radius: 999px;
  padding: 9px 14px;
  min-height: 44px;
  font-weight: 700; font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(var(--ombre), 0.07);
}
.pill .icon { color: var(--miel); }
.pill.niveau .icon { color: var(--sauge); }
.pill.club { border-color: var(--or-doux); color: var(--or); }

/* =============================== Écrans ==================================== */

.screen { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 16px 108px; -webkit-overflow-scrolling: touch; }
.screen[hidden] { display: none; }

.hint-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--papier);
  border-radius: var(--r-md);
  border: 1.5px solid rgba(var(--ombre), 0.08);
  box-shadow: 0 4px 16px rgba(var(--ombre), 0.08);
  padding: 13px 16px;
  margin: 8px 0 14px;
  font-size: 0.98rem;
  min-height: var(--tap);
  width: 100%;
  text-align: left;
}
.hint-banner .icon { color: var(--terracotta); flex-shrink: 0; }
.hint-banner strong { color: var(--sauge-fonce); }
.hint-banner.actionable:active { transform: scale(0.985); }

/* ============================ La véranda =================================== */

.soleil-btn {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  margin: 0 auto 6px;
  background: linear-gradient(160deg, #FBEEC4, #F4D98B);
  border-radius: 999px;
  padding: 10px 22px;
  min-height: 44px;
  font-weight: 800; color: #7a5c12;
  box-shadow: 0 4px 18px rgba(201, 162, 39, 0.35);
  font-variant-numeric: tabular-nums;
}
.soleil-btn .icon { color: var(--or-doux); }
.soleil-btn:active { transform: scale(0.96); }
.soleil-btn.vide { opacity: 0.45; box-shadow: none; }

.etageres { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }

.etagere-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 4px 10px;
  border-bottom: 7px solid #C8A876;
  border-radius: 0 0 4px 4px;
  position: relative;
  margin-bottom: 14px;
}
.etagere-row::after {
  content: ""; position: absolute; left: 2px; right: 2px; bottom: -11px;
  height: 4px; border-radius: 3px;
  background: rgba(var(--ombre), 0.12);
  filter: blur(3px);
}

.slot {
  position: relative;
  aspect-ratio: 5 / 6;
  border-radius: var(--r-sm);
  display: flex; align-items: flex-end; justify-content: center;
  transition: transform 0.15s ease;
}
.slot:active { transform: scale(0.97); }
.slot.libre {
  border: 2px dashed rgba(var(--ombre), 0.18);
  align-items: center;
  color: var(--encre-douce);
  font-size: 0.8rem;
}
.slot .art { width: 92%; height: auto; }
.slot .art svg, .slot .art img { width: 100%; height: auto; display: block; }

.plant-name {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  font-size: 0.78rem; font-weight: 800; color: var(--encre);
  white-space: nowrap; max-width: 96%; overflow: hidden; text-overflow: ellipsis;
  background: rgba(253, 251, 245, 0.94);
  padding: 2px 9px; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(var(--ombre), 0.18);
}

/* Scintillement : un geste de soin attend */
.sparkle {
  position: absolute; top: 4px; right: 4px;
  width: 28px; height: 28px;
  color: #9C7A16; /* l'affordance clé doit rester lisible : ≥ 3:1 sur le fond */
  animation: sparkle-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(217, 180, 74, 0.9)) drop-shadow(0 1px 1px rgba(46, 59, 46, 0.35));
}
@keyframes sparkle-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  50% { transform: scale(1.25) rotate(18deg); opacity: 1; }
}

.pret-badge {
  position: absolute; top: 4px; left: 4px;
  background: var(--sauge-fonce); color: var(--creme);
  font-size: 0.74rem; font-weight: 800;
  border-radius: 999px; padding: 3px 8px;
  animation: sparkle-pulse 2.2s ease-in-out infinite;
}
.seuil-badge {
  position: absolute; top: 4px; left: 4px;
  background: var(--papier); color: var(--encre-douce);
  font-size: 0.74rem; font-weight: 700;
  border-radius: 999px; padding: 3px 8px;
  border: 1px solid rgba(var(--ombre), 0.15);
}

/* Balancement doux des plantes */
.plant-art svg { transform-origin: 50% 92%; animation: sway 5.5s ease-in-out infinite; }
.slot:nth-child(2) .plant-art svg { animation-delay: -1.8s; }
.slot:nth-child(3) .plant-art svg { animation-delay: -3.4s; }
@keyframes sway {
  0%, 100% { transform: rotate(-1.1deg); }
  50% { transform: rotate(1.1deg); }
}

/* Progression de stade sous la plante */
.stage-bar {
  position: absolute; bottom: 24px; left: 14%; right: 14%;
  height: 6px; border-radius: 4px;
  background: rgba(var(--ombre), 0.16);
  outline: 2px solid rgba(253, 251, 245, 0.9); /* lisible sur les fonds chargés */
  overflow: hidden;
}
.stage-bar > div { height: 100%; background: linear-gradient(90deg, var(--sauge), var(--miel)); border-radius: 3px; transition: width 1s linear; }

/* ====================== Sections basses de la véranda ===================== */

.section-card {
  background: var(--papier);
  border-radius: var(--r-lg);
  border: 1.5px solid rgba(var(--ombre), 0.07);
  box-shadow: 0 6px 22px rgba(var(--ombre), 0.07);
  padding: 16px;
  margin: 14px 0;
}
.section-card h3 { display: flex; align-items: center; gap: 8px; font-size: 1.06rem; margin-bottom: 4px; }
.section-card h3 .icon { color: var(--sauge); }
.section-card .sub { color: var(--encre-douce); font-size: 0.88rem; margin-bottom: 10px; }

.boutures-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bouture-chip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--creme-2);
  border-radius: var(--r-md);
  padding: 10px 8px;
}
.bouture-chip .art { width: 44px; }
.bouture-chip .art svg { width: 100%; height: auto; }
.bouture-chip .nom { font-size: 0.76rem; font-weight: 700; color: var(--encre-douce); text-align: center; }
.bouture-chip button {
  font-size: 0.8rem; font-weight: 800;
  border-radius: 999px; padding: 6px 8px;
  background: var(--sauge-pale); color: var(--sauge-fonce);
  min-height: 44px; width: 100%;
  white-space: nowrap;
}
.bouture-chip button.rempoter { background: var(--miel); color: #5d470e; }

/* Les plantes gardées (collection) */
.kept-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 10px; }
.kept-plant { flex: 0 0 84px; text-align: center; }
.kept-plant .art svg, .kept-plant .art img { width: 100%; height: auto; }
.kept-plant .nom { font-size: 0.78rem; font-weight: 700; color: var(--encre-douce); }
.kept-plant .variant { color: var(--or); font-size: 0.74rem; font-weight: 800; }

/* ============================ Boutons ===================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 800; font-size: 1rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--sauge-fonce); color: var(--creme); box-shadow: 0 6px 18px rgba(62, 91, 69, 0.35); }
.btn-gold { background: linear-gradient(160deg, var(--miel), var(--or-doux)); color: #4d3a08; box-shadow: 0 6px 18px rgba(201, 162, 39, 0.35); }
.btn-ghost { background: var(--creme-2); color: var(--encre-douce); }
.btn-danger { background: #B95C50; color: #fff; }
.btn:disabled { opacity: 0.45; transform: none; box-shadow: none; cursor: default; }
.btn-block { width: 100%; }

/* ============================ Navigation basse ============================ */

.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 600px;
  display: flex;
  background: var(--papier);
  border-top: 1.5px solid rgba(var(--ombre), 0.09);
  box-shadow: 0 -8px 30px rgba(var(--ombre), 0.10);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 40;
}
.bottomnav button {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px 12px;
  color: var(--encre-douce);
  font-size: 0.75rem; font-weight: 700;
  position: relative;
  min-height: 60px;
}
.bottomnav button .icon { width: 26px; height: 26px; }
.bottomnav button.actif { color: var(--sauge-fonce); }
.bottomnav button.actif::before {
  content: ""; position: absolute; top: 0; left: 25%; right: 25%;
  height: 3px; border-radius: 0 0 3px 3px; background: var(--miel);
}
.bottomnav .badge {
  position: absolute; top: 6px; right: calc(50% - 22px);
  min-width: 19px; height: 19px;
  background: var(--terracotta); color: #fff;
  border-radius: 999px; font-size: 0.7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

.icon { display: inline-flex; width: 22px; height: 22px; vertical-align: middle; }
.icon svg { width: 100%; height: 100%; }

/* ============================ Feuilles modales ============================ */

.sheet-veil {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(46, 59, 46, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: veil-in 0.25s ease;
}
@keyframes veil-in { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 600px;
  max-height: 88dvh; overflow-y: auto;
  background: var(--papier);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 26px 22px calc(30px + env(safe-area-inset-bottom, 0));
  animation: sheet-up 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -12px 50px rgba(var(--ombre), 0.25);
}
@keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } }
.sheet h2 { font-size: 1.35rem; margin-bottom: 8px; padding-right: 44px; }
.sheet .sheet-sub { color: var(--encre-douce); margin-bottom: 14px; font-size: 0.95rem; }
.sheet .sheet-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.sheet-close { position: sticky; top: 0; float: right; color: var(--encre-douce); min-width: var(--tap); min-height: var(--tap); font-size: 1.5rem; }

/* Le mot manuscrit (papier déchiré) */
.mot-manuscrit {
  font-family: var(--f-main);
  font-size: 1.5rem; line-height: 1.35;
  color: #4a4033;
  background: #FFFDF6;
  border: 1px solid rgba(var(--ombre), 0.1);
  border-radius: 4px;
  padding: 18px 20px;
  margin: 14px 0;
  transform: rotate(-1.2deg);
  box-shadow: 0 4px 14px rgba(var(--ombre), 0.12);
  position: relative;
}
.mot-manuscrit::before {
  content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%) rotate(2deg);
  width: 74px; height: 18px;
  background: rgba(217, 180, 74, 0.4);
  border-radius: 2px;
}

.arrivee-visuel { display: flex; justify-content: center; margin: 8px 0; }
.arrivee-visuel .art { width: 170px; }
.arrivee-visuel .art svg, .arrivee-visuel .art img { width: 100%; height: auto; }

/* Diagnostic */
.symptomes { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.symptome {
  display: flex; align-items: center; gap: 10px;
  background: var(--creme-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  min-height: var(--tap);
  font-weight: 600;
  text-align: left;
  border: 2px solid transparent;
}
.symptome.vu { border-color: var(--sauge); background: var(--sauge-pale); }
.symptome .icon { color: var(--terracotta); }

/* Gestes de soin */
.gestes-row { display: flex; gap: 12px; justify-content: center; margin: 18px 0; }
.geste-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--creme-2);
  border-radius: var(--r-md);
  padding: 12px;
  min-width: 88px; min-height: 76px;
  font-size: 0.78rem; font-weight: 700; color: var(--sauge-fonce);
}
.geste-btn .icon { width: 30px; height: 30px; color: var(--sauge); }
.geste-btn:disabled { opacity: 0.4; }
.geste-btn.pret { background: var(--sauge-pale); box-shadow: 0 0 0 2px var(--sauge), 0 4px 14px rgba(122, 148, 113, 0.3); }
.geste-btn .recharge { font-size: 0.66rem; color: var(--encre-douce); font-weight: 600; }

/* ============================ Herbier ===================================== */

.herbier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.herbier-card {
  background: var(--papier);
  border-radius: var(--r-md);
  border: 1.5px solid rgba(var(--ombre), 0.08);
  padding: 10px 8px;
  text-align: center;
  position: relative;
}
.herbier-card .art { width: 76%; margin: 0 auto; }
.herbier-card .art svg, .herbier-card .art img { width: 100%; height: auto; }
.herbier-card .nom { font-size: 0.8rem; font-weight: 800; color: var(--sauge-fonce); margin-top: 4px; }
.herbier-card.inconnue { opacity: 0.55; filter: grayscale(0.7); }
.herbier-card.inconnue .nom { color: var(--encre-douce); }
.herbier-card .pan-star { position: absolute; top: 6px; right: 6px; color: var(--or-doux); width: 20px; height: 20px; }

.famille-titre { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 4px; }
.famille-titre h3 { font-size: 1.02rem; }
.famille-titre .compte { font-size: 0.8rem; color: var(--encre-douce); font-weight: 700; }
.famille-titre .or { color: var(--or); }

.fiche-plante .art { width: 150px; margin: 0 auto; }
.fiche-plante .latin { font-style: italic; color: var(--encre-douce); font-size: 0.9rem; text-align: center; }
.fiche-bloc { background: var(--creme-2); border-radius: var(--r-md); padding: 13px 15px; margin: 10px 0; font-size: 0.94rem; }
.fiche-bloc .titre-bloc { font-weight: 800; color: var(--sauge-fonce); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
.animaux-ok { color: var(--sauge-fonce); font-weight: 700; }
.animaux-toxique { color: var(--terracotta-fonce); font-weight: 700; }

/* ============================ Courrier ==================================== */

.lettres { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.lettre-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--papier);
  border-radius: var(--r-md);
  border: 1.5px solid rgba(var(--ombre), 0.08);
  padding: 14px;
  min-height: 64px;
  width: 100%;
  text-align: left;
  box-shadow: 0 3px 12px rgba(var(--ombre), 0.06);
}
.lettre-card .icon { color: var(--terracotta); flex-shrink: 0; width: 26px; height: 26px; }
.lettre-card.non-lue { border-color: var(--miel); box-shadow: 0 3px 14px rgba(217, 180, 74, 0.25); }
.lettre-card .de { font-weight: 800; font-size: 0.95rem; }
.lettre-card .apercu { color: var(--encre-douce); font-size: 0.82rem; }

.lettre-papier {
  background: #FFFDF6;
  border: 1px solid rgba(var(--ombre), 0.1);
  border-radius: 6px;
  padding: 20px 18px;
  margin: 12px 0;
  font-size: 1rem; line-height: 1.55;
  box-shadow: 0 4px 14px rgba(var(--ombre), 0.1);
}
.lettre-papier.journal { font-family: var(--f-main); font-size: 1.4rem; line-height: 1.4; color: #4a4033; }
.lettre-papier .signature { text-align: right; font-family: var(--f-main); font-size: 1.4rem; margin-top: 10px; color: #6b5d4a; }

/* ============================ Maison ====================================== */

.room-card {
  background: var(--papier);
  border-radius: var(--r-lg);
  border: 1.5px solid rgba(var(--ombre), 0.08);
  padding: 16px;
  margin: 12px 0;
}
.room-card.verrouillee { opacity: 0.6; }
.room-card h3 { font-size: 1.08rem; }
.room-steps { display: flex; gap: 6px; margin: 10px 0; }
.room-steps span { flex: 1; height: 8px; border-radius: 4px; background: rgba(var(--ombre), 0.1); }
.room-steps span.fait { background: linear-gradient(90deg, var(--sauge), var(--miel)); }
.room-card .cout { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.room-card .cout .icon { color: var(--miel); width: 18px; height: 18px; }

.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.shop-item {
  background: var(--papier);
  border-radius: var(--r-md);
  border: 1.5px solid rgba(var(--ombre), 0.08);
  padding: 12px;
  text-align: center;
}
.shop-item .art { width: 60px; margin: 0 auto 6px; }
.shop-item .art svg, .shop-item .art img { width: 100%; height: auto; }
.shop-item .nom { font-size: 0.8rem; font-weight: 700; min-height: 2.3em; }

/* ============================ Toasts & célébrations ======================= */

.toasts { position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column-reverse; gap: 8px; width: min(92vw, 560px); pointer-events: none; }
.toast {
  background: var(--sauge-fonce); color: var(--creme);
  border-radius: var(--r-md);
  padding: 13px 18px;
  font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 8px 26px rgba(var(--ombre), 0.3);
  animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1), toast-out 0.4s ease 3.4s forwards;
  display: flex; align-items: center; gap: 10px;
}
.toast.dore { background: linear-gradient(160deg, var(--miel), var(--or-doux)); color: #4d3a08; }
.toast .icon { flex-shrink: 0; }
@keyframes toast-in { from { transform: translateY(14px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(10px); opacity: 0; } }

/* Pluie dorée à la collecte du soleil */
.goutte-vole {
  position: fixed; z-index: 80; pointer-events: none;
  width: 14px; height: 14px; color: var(--or-doux);
  animation: goutte-vole 0.8s ease-in forwards;
}
@keyframes goutte-vole {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 0), -110px) scale(0.5); opacity: 0; }
}

/* Célébration panachée / niveau */
.celebration { text-align: center; padding: 8px 0; }
.celebration .grand { font-family: var(--f-display); font-size: 1.7rem; color: var(--or); animation: celebration-pop 0.5s cubic-bezier(0.22, 1.6, 0.36, 1); }
@keyframes celebration-pop { from { transform: scale(0.5); opacity: 0; } }

/* ============================ Divers ====================================== */

.avant-apres { display: flex; align-items: flex-end; justify-content: center; gap: 16px; margin: 18px 0; }
.avant-apres .art { width: 132px; }
.avant-apres .fleche { padding-bottom: 42px; }
.avant-apres .fleche { font-size: 1.6rem; color: var(--miel); }

.code-row { display: flex; gap: 8px; margin-top: 10px; }
.code-row input {
  flex: 1;
  border: 2px solid rgba(var(--ombre), 0.15);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  background: var(--papier);
  min-height: var(--tap);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}
textarea.carnet-zone {
  width: 100%;
  border: 2px solid rgba(var(--ombre), 0.15);
  border-radius: var(--r-sm);
  padding: 12px;
  min-height: 110px;
  background: var(--papier);
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
}

.perk-list { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 12px 0; }
.perk-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; }
.perk-list li::before { content: "✦"; color: var(--or-doux); font-weight: 800; }

.sacred-note {
  background: var(--sauge-pale);
  color: var(--sauge-fonce);
  border-radius: var(--r-md);
  padding: 12px 15px;
  font-weight: 700; font-size: 0.9rem;
  text-align: center;
  margin: 12px 0;
}

.footer-phrase {
  text-align: center;
  font-family: var(--f-main);
  font-size: 1.35rem;
  color: var(--encre-douce);
  padding: 22px 24px 10px;
  opacity: 0.85;
}

.compteur-attente { font-size: 0.82rem; color: var(--encre-douce); text-align: center; margin-top: 6px; }

.progress-xp { height: 7px; border-radius: 4px; background: rgba(var(--ombre), 0.1); overflow: hidden; margin-top: 4px; }
.progress-xp > div { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--sauge), var(--miel)); transition: width 0.6s ease; }

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

/* Grand écran : la véranda flotte sur un fond feuillu très doux */
@media (min-width: 640px) {
  body { background: linear-gradient(140deg, #E8E4D2, #D5DCC8 55%, #E4DCC4); }
  #app { height: 100vh; border-radius: 0; }
  .bottomnav { border-radius: 0; }
}

/* ============================ Tutoriel ==================================== */
/* Le carnet de Marguerite guide : halo doux + bulle manuscrite, jamais bloquant */

#tuto-root { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

.tuto-hole {
  position: fixed;
  border-radius: var(--r-md);
  box-shadow: 0 0 0 9999px rgba(46, 59, 46, 0.38), 0 0 0 4px rgba(217, 180, 74, 0.95), 0 0 24px 6px rgba(217, 180, 74, 0.55);
  animation: tuto-breathe 2s ease-in-out infinite;
}
@keyframes tuto-breathe {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(46, 59, 46, 0.38), 0 0 0 4px rgba(217, 180, 74, 0.95), 0 0 24px 6px rgba(217, 180, 74, 0.55); }
  50% { box-shadow: 0 0 0 9999px rgba(46, 59, 46, 0.38), 0 0 0 6px rgba(217, 180, 74, 1), 0 0 34px 10px rgba(217, 180, 74, 0.7); }
}

.tuto-bubble {
  position: fixed;
  left: 50%; transform: translateX(-50%) rotate(-0.6deg);
  width: min(88vw, 340px);
  background: #FFFDF6;
  border: 1px solid rgba(46, 59, 46, 0.12);
  border-radius: 6px;
  box-shadow: 0 10px 32px rgba(46, 59, 46, 0.3);
  padding: 16px 18px 12px;
  font-family: var(--f-main);
  font-size: 1.35rem; line-height: 1.3;
  color: #4a4033;
  pointer-events: auto;
}
.tuto-bubble::before {
  content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%) rotate(1.5deg);
  width: 64px; height: 16px;
  background: rgba(217, 180, 74, 0.45);
  border-radius: 2px;
}
.tuto-signature { text-align: right; font-size: 1.05rem; color: #8a7a62; margin-top: 4px; }
.tuto-skip {
  display: block; margin: 8px 0 0 auto;
  font-family: var(--f-body); font-size: 0.8rem; font-weight: 700;
  color: var(--encre-douce);
  min-height: 32px;
  pointer-events: auto;
}

.tuto-veil {
  position: fixed; inset: 0;
  background: rgba(46, 59, 46, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  pointer-events: auto;
}
.tuto-bubble-centre { position: static; transform: rotate(-0.6deg); }
.tuto-bubble-centre .btn { font-family: var(--f-body); font-size: 1rem; margin-top: 12px; }

/* Guide d'installation sur l'écran d'accueil */
.pwa-steps { margin: 10px 0 2px 4px; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; }
.pwa-steps li { font-size: 0.95rem; line-height: 1.45; padding-left: 4px; }
.pwa-steps li::marker { color: var(--sauge-fonce); font-weight: 800; }

/* ============================ Monétisation visible ======================== */

.soleil-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 6px; }
.soleil-row .soleil-btn { margin: 0; }

.rideaux-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 9px 16px;
  border-radius: 999px;
  background: var(--papier);
  border: 2px solid var(--miel);
  color: #7a5c12; font-weight: 800; font-size: 0.88rem;
  box-shadow: 0 3px 12px rgba(201, 162, 39, 0.25);
}
.rideaux-pill .icon { color: var(--or-doux); width: 20px; height: 20px; }
.rideaux-pill:active { transform: scale(0.96); }

.pill-club-cta { border-color: var(--or-doux); color: var(--or); background: linear-gradient(160deg, #FDF6DF, #F8ECC4); }
.pill-club-cta .icon { color: var(--or-doux); }
.pill-club-cta.actif { background: linear-gradient(160deg, var(--miel), var(--or-doux)); color: #4d3a08; }

.founder-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: 46px; padding: 10px 16px;
  margin: 4px 0 12px;
  border-radius: var(--r-md);
  background: linear-gradient(120deg, #F6E7B8, #EDD48A, #F6E7B8);
  border: 1.5px solid var(--or-doux);
  color: #5d470e; font-weight: 800; font-size: 0.88rem;
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.3);
}
.founder-banner .icon { color: var(--or); flex-shrink: 0; }
.founder-banner:active { transform: scale(0.985); }

.club-upsell {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%;
  text-align: left;
  margin: 14px 0 2px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: linear-gradient(160deg, #FDF6DF, #F8ECC4);
  border: 1.5px solid var(--or-doux);
  color: #5d470e; font-weight: 700; font-size: 0.92rem;
  line-height: 1.45;
}
.club-upsell .icon { color: var(--or); flex-shrink: 0; margin-top: 2px; }

.boutique-reelle { border-color: var(--or-doux); margin-top: 10px; }

/* Petits écrans : la barre du haut fait de la place à la pastille Club */
@media (max-width: 480px) {
  .topbar { padding: 10px 12px 10px; gap: 6px; }
  .topbar .brand .title { font-size: 1rem; }
  .topbar .brand .sub { display: none; }
  .pills { gap: 6px; }
  .pill { padding: 8px 10px; font-size: 0.86rem; min-height: 42px; }
  .pill .icon { width: 18px; height: 18px; }
}

/* La plante de la semaine (lien produit direct) */
.plante-semaine {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--creme-2);
  text-decoration: none; color: inherit;
  min-height: 64px;
}
.plante-semaine .de { font-weight: 800; font-size: 0.92rem; color: var(--sauge-fonce); }
.plante-semaine .apercu { font-size: 0.84rem; color: var(--encre-douce); }
.plante-semaine .art svg, .plante-semaine .art img { width: 100%; height: auto; }
