/* Chuuut : un crépuscule doux, aux couleurs de la petite lune. Assez sombre pour ne pas éblouir la nuit. */
:root {
  --ciel-haut: #2a2448;
  --ciel-bas: #3f2d55;
  --carte: rgba(255, 255, 255, .07);
  --carte-bord: rgba(255, 255, 255, .10);
  --texte: #fbf3ec;
  --discret: #c9bfdc;
  --lavande: #b8a6f0;
  --peche: #f8c4a0;
  --rose: #f3a8bf;
  --menthe: #a6e3c8;
  --beurre: #ffe7a3;
  --prune: #2a2448;
  --corail: #ff9f9f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ciel-haut); }
body {
  margin: 0; min-height: 100vh; color: var(--texte);
  background: linear-gradient(180deg, var(--ciel-haut) 0%, var(--ciel-bas) 100%) fixed;
  font: 17px/1.5 "Nunito", ui-rounded, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 92px);
}
/* Quelques étoiles discrètes dans le ciel. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(2px 2px at 12% 18%, rgba(255,231,163,.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 9%, rgba(255,231,163,.45), transparent 60%),
    radial-gradient(2px 2px at 88% 34%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 30% 46%, rgba(255,255,255,.25), transparent 60%),
    radial-gradient(2px 2px at 64% 72%, rgba(255,231,163,.3), transparent 60%),
    radial-gradient(1.5px 1.5px at 8% 84%, rgba(255,255,255,.25), transparent 60%);
}
main { max-width: 520px; margin: 0 auto; }
h1 { font-size: 1.7rem; font-weight: 800; margin: 0; letter-spacing: .01em; }
h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 .5rem; color: var(--beurre); }
a { color: var(--peche); font-weight: 700; }
.discret { color: var(--discret); font-size: .95rem; }
.carte {
  background: var(--carte); border: 1px solid var(--carte-bord); border-radius: 28px;
  padding: 20px; margin: 14px 0; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.centre { text-align: center; }
.rangee { display: flex; gap: 10px; margin-top: 14px; }
.rangee > * { flex: 1; }

/* En-tête avec la mascotte */
.entete { display: flex; align-items: center; gap: 14px; padding-top: 22px; }
.mascotte {
  width: 68px; height: 68px; border-radius: 22px; flex: none;
  box-shadow: 0 6px 22px rgba(248,196,160,.25); animation: bercer 6s ease-in-out infinite;
}
.entete .titres { min-width: 0; }
.sous-titre { margin: 2px 0 0; color: var(--discret); font-size: .95rem; }
@keyframes bercer { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-3px); } }

.pastille {
  display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: .9rem; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--discret);
}
.pastille::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.pastille.vert { background: rgba(166,227,200,.14); color: var(--menthe); }
.pastille.orange { background: rgba(255,231,163,.14); color: var(--beurre); }
.pastille.rouge { background: rgba(255,159,159,.14); color: var(--corail); }

/* Boutons tout ronds */
.btn {
  font: inherit; font-weight: 800; color: var(--prune);
  background: linear-gradient(135deg, var(--peche), var(--rose));
  border: 0; border-radius: 999px; padding: 14px 18px; width: 100%; cursor: pointer;
  box-shadow: 0 6px 18px rgba(243,168,191,.25); transition: transform .12s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn-grand { padding: 18px; font-size: 1.15rem; margin-top: 10px; }
.btn-second { background: rgba(255,255,255,.10); color: var(--texte); box-shadow: none; }
.btn.rec { background: linear-gradient(135deg, var(--corail), var(--rose)); }
.btn-icone {
  font: inherit; background: rgba(255,255,255,.10); color: var(--texte); border: 0;
  border-radius: 50%; width: 44px; height: 44px; cursor: pointer;
}

/* Le grand bouton Chuuut : une bulle qui respire doucement */
.btn-chut {
  position: relative; display: grid; place-items: center; margin: 6px auto 4px;
  width: min(66vw, 250px); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer;
  font-family: inherit; font-size: 1.9rem; font-weight: 800; letter-spacing: .04em; color: var(--prune);
  background: radial-gradient(circle at 35% 30%, #fff4e6 0%, var(--peche) 38%, var(--rose) 72%, var(--lavande) 100%);
  box-shadow: 0 0 0 12px rgba(248,196,160,.10), 0 0 0 26px rgba(184,166,240,.07), 0 14px 40px rgba(243,168,191,.35);
  animation: respirer 4.5s ease-in-out infinite; touch-action: manipulation;
  transition: box-shadow .4s, filter .3s;
}
.btn-chut:active { transform: scale(.95); animation: none; }
.btn-chut:disabled { filter: grayscale(.7) brightness(.7); animation: none; }
.btn-chut.envoi { box-shadow: 0 0 0 12px rgba(255,231,163,.25), 0 0 0 26px rgba(255,231,163,.10), 0 14px 40px rgba(255,231,163,.35); }
.btn-chut.ok { box-shadow: 0 0 0 14px rgba(166,227,200,.30), 0 0 0 30px rgba(166,227,200,.12), 0 14px 40px rgba(166,227,200,.35); }
@keyframes respirer { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

.retour { min-height: 1.5em; margin: 12px 0 0; color: var(--discret); font-size: 1rem; }
.retour.vert { color: var(--menthe); }
.retour.rouge { color: var(--corail); }

.volume { display: block; color: var(--discret); font-weight: 700; }
.volume input { width: 100%; margin-top: 12px; accent-color: var(--peche); }

.chiffres { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.chiffres dt { color: var(--discret); }
.chiffres dd { margin: 0; text-align: right; font-weight: 700; }

.liste-sons, .liste-soirees { list-style: none; padding: 0; margin: 0; }
.liste-sons li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--carte-bord); }
.liste-sons li:first-child { border-top: 0; }
.liste-sons li span { flex: 1; font-weight: 700; }
.liste-soirees li { display: flex; flex-direction: column; padding: 12px 0; border-top: 1px solid var(--carte-bord); }
.liste-soirees li:first-child { border-top: 0; }
.liste-soirees .date { color: var(--discret); font-size: .9rem; text-transform: capitalize; }
.liste-soirees b { color: var(--menthe); }
#apercu audio { width: 100%; margin-top: 10px; }

.code-famille { text-align: center; margin-top: 24px; }
.code-famille input {
  font: inherit; width: 100%; padding: 14px 18px; margin: 10px 0 14px; border-radius: 999px;
  border: 1px solid var(--carte-bord); background: rgba(0,0,0,.2); color: var(--texte); text-align: center;
}
.erreur { color: var(--corail); }

/* Barre d'onglets */
.onglets {
  position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 10px);
  max-width: 496px; margin: 0 auto; display: flex; gap: 4px; padding: 6px;
  background: rgba(42,36,72,.88); border: 1px solid var(--carte-bord); border-radius: 999px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.onglets button {
  flex: 1; font: inherit; font-size: .92rem; font-weight: 700; background: none; border: 0;
  color: var(--discret); padding: 10px 4px; border-radius: 999px; cursor: pointer;
}
.onglets button.actif { background: rgba(248,196,160,.18); color: var(--peche); }

/* Téléphone d'écoute : préparation douce, puis écran noir complet pendant la nuit. */
.page-ecoute { padding-bottom: calc(env(safe-area-inset-bottom) + 20px); }
.liste { padding-left: 1.3rem; }
.liste li { margin: 7px 0; }
.liste b { color: var(--beurre); }
#veille { position: fixed; inset: 0; z-index: 10; background: #000; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 40px; }
.etat-veille { color: #1c1a24; font-size: .8rem; text-align: center; transition: color .4s; }
body.alerte .etat-veille { color: #4a2a22; }
body.reveille .etat-veille { color: var(--texte); font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .mascotte, .btn-chut { animation: none; }
}
