/* Le site d'Idle Purr : la veillée (CHARTE.md). Une seule laine relie tout ; chaque saison change la nuit, la laine
   et la lueur. Les polices sont celles des jeux. */

@font-face { font-family: "Lilita One"; src: url("polices/lilita.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url("polices/nunito.woff") format("woff"); font-weight: 200 1000; font-display: swap; }

:root {
  --nuit: #2a1c38;
  --velours: #3b2850;
  --laine: #ff8a65;
  --laine-ombre: #b84d3f;
  --creme: #fff3e6;
  --doux: #dccbe3;
  --rose: #ff7f7f;
  --rose-fonce: #d9585e;
  --lueur: #ffc46b;
  --fil-x: 50%;            /* l'axe de la laine (site.js) */
  --marge: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}
html[data-saison="halloween"] { --nuit: #221430; --velours: #34204a; --laine: #ff9800; --laine-ombre: #9c4f00; --lueur: #ffae42; --doux: #d8c8ec; }
html[data-saison="noel"] { --nuit: #121c3a; --velours: #1d2b55; --laine: #e8433f; --laine-ombre: #861c1a; --lueur: #ffe3a0; --doux: #cad5f0; }
html[data-saison="lunaire"] { --nuit: #320c14; --velours: #4b1620; --laine: #ffc72c; --laine-ombre: #94660a; --lueur: #ff8a4c; --doux: #f1d2c8; }
html[data-saison="valentin"] { --nuit: #32112a; --velours: #4a1a3f; --laine: #ff5c93; --laine-ombre: #9e1f4d; --lueur: #ffa3c9; --doux: #f1d0e2; }
html[data-saison="printemps"] { --nuit: #1a2b24; --velours: #273f31; --laine: #f48fb1; --laine-ombre: #a3486a; --lueur: #e6ffa8; --doux: #d0e4d6; }
html[data-saison="ete"] { --nuit: #1b2046; --velours: #29306a; --laine: #ffb300; --laine-ombre: #9c6400; --lueur: #ffd36b; --doux: #d2d6f3; }

* { box-sizing: border-box; }
html { background: var(--nuit); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--nuit);
  color: var(--creme);
  font: 400 1.125rem/1.6 "Nunito", system-ui, sans-serif;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--laine); }
:focus-visible { outline: 3px solid var(--lueur); outline-offset: 4px; border-radius: 8px; }
.entete, main, .pied { position: relative; z-index: 1; }
main { overflow-x: clip; }   /* les lueurs qui débordent de l'écran ne le font pas défiler */

/* Les titres : ceux des jeux (crème, contour rose, ombre brune) */
.titre {
  font-family: "Lilita One", "Nunito", sans-serif;
  font-weight: 400;
  color: var(--creme);
  letter-spacing: 0.01em;
  line-height: 1.08;
  -webkit-text-stroke: 0.05em var(--rose-fonce);
  text-shadow: 0 0.07em 0 rgba(25, 8, 18, 0.5);
}
@supports (paint-order: stroke fill) {
  .titre { -webkit-text-stroke: 0.15em var(--rose-fonce); paint-order: stroke fill; }
}

/* --- La laine ------------------------------------------------------------------------------------------------------ */
.fil-page { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; overflow: visible; }
.fil-page .ombre { stroke: var(--laine-ombre); stroke-width: 9; }
.fil-page .laine { stroke: var(--laine); stroke-width: 6; }
.fil-page .brins { stroke: color-mix(in srgb, var(--laine) 45%, #fff); stroke-width: 1.6; stroke-dasharray: 2 9; }
.pelote svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pelote-fond { fill: var(--laine); stroke: var(--laine-ombre); stroke-width: 3; }
.pelote-brins { fill: none; stroke: var(--laine-ombre); stroke-width: 2.6; stroke-linecap: round; opacity: 0.6; }

/* --- L'en-tête et le logo « le fil » -------------------------------------------------------------------------------- */
.entete {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  max-width: 1240px; margin: 0 auto; padding: 18px var(--marge) 8px;
}
.logo { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 30px 14px 0; text-decoration: none; }
.logo-tete { width: 72px; height: 72px; position: relative; z-index: 1; }
.logo-nom { font-size: 2.1rem; position: relative; z-index: 1; white-space: nowrap; }
.logo-fil { position: absolute; left: 34px; right: 16px; bottom: 0; height: 30px; overflow: visible; }
.logo-fil path { fill: none; stroke: var(--laine); stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.logo .pelote { position: absolute; right: 0; bottom: -10px; width: 30px; height: 30px; }
.langue {
  color: var(--creme); text-decoration: none; font-weight: 800; font-size: 1rem;
  padding: 7px 16px; border-radius: 999px; border: 2px solid color-mix(in srgb, var(--creme) 28%, transparent);
}
.langue:hover { border-color: var(--laine); }

/* --- Le héros : le chaton de la saison ----------------------------------------------------------------------------- */
.heros {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center;
  gap: clamp(16px, 3vw, 48px); max-width: 1240px; margin: 0 auto;
  padding: clamp(8px, 2vw, 24px) var(--marge) 24px; min-height: min(76vh, 700px);
}
.heros-texte { max-width: 34rem; }
.heros h1 { font-size: clamp(2.5rem, 1.3rem + 3.4vw, 4.4rem); margin: 0; }
.chapo { font-size: 1.3rem; color: var(--doux); margin: 1.4rem 0 1rem; max-width: 30rem; }
.annonce { font-weight: 800; color: var(--lueur); margin: 0 0 1.8rem; max-width: 30rem; }
.annonce:empty { display: none; }
.bouton {
  display: inline-block; font-family: "Lilita One", sans-serif; font-size: 1.6rem; color: #fff; text-decoration: none;
  background: var(--rose); border-radius: 26px; padding: 14px 36px 10px; border-bottom: 8px solid var(--rose-fonce);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28); transition: transform 0.08s, border-bottom-width 0.08s;
  -webkit-text-stroke: 0.1em #b5434a; paint-order: stroke fill;
}
.bouton:active { transform: translateY(4px); border-bottom-width: 4px; }

.heros-chat { display: flex; flex-direction: column; align-items: center; }
.chat {
  position: relative; display: block; width: min(100%, 540px); aspect-ratio: 1; padding: 0; border: 0;
  background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.chat .souffle { position: absolute; inset: 0; z-index: 1; transform-origin: 50% 95%; animation: souffle 2.6s ease-in-out infinite; }
.chat .tendre { position: absolute; inset: 0; transform-origin: 50% 95%; }
.chat img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.chat.gelee .tendre { animation: gelee 0.6s cubic-bezier(0.3, 1.5, 0.5, 1); }   /* le chaton et ses lueurs s’écrasent ensemble */
.eclat { position: absolute; inset: -55%; width: 210%; height: 210%; pointer-events: none; }   /* MARGE de site.js */
.eclat.derriere { z-index: 0; mix-blend-mode: screen; }
.eclat.lumiere { z-index: 2; mix-blend-mode: screen; }
@supports (mix-blend-mode: plus-lighter) { .eclat.lumiere { mix-blend-mode: plus-lighter; } }
.eclat.posees { z-index: 3; }
.chat-indice { margin: 0.4rem 0 0; color: var(--doux); font-size: 0.95rem; opacity: 0.75; }
.ancre-pattes { position: absolute; left: 52%; top: 91%; width: 2px; height: 2px; }
@keyframes souffle { 50% { transform: scale(1.015, 0.985); } }
@keyframes gelee {
  18% { transform: scale(1.1, 0.86); }
  45% { transform: scale(0.95, 1.06); }
  70% { transform: scale(1.02, 0.98); }
}

/* --- Les jeux, enfilés sur la laine ---------------------------------------------------------------------------------- */
.jeux { max-width: 1100px; margin: 0 auto; padding: 24px var(--marge) 40px; }
.jeux > h2, .partage > h2, .annee > h2 { font-size: clamp(2rem, 1.3rem + 2vw, 3rem); margin: 0 0 0.8rem; max-width: min(28rem, calc(50vw - var(--marge) - 48px)); }
.jeux-liste { list-style: none; margin: 0; padding: 0; }
.jeu { display: grid; grid-template-columns: 1fr 132px 1fr; align-items: center; column-gap: clamp(20px, 4vw, 56px); padding: 30px 0; }
/* chaque jeu est une perle : quand la laine l'atteint, elle s'allume d'un coup, avec une onde de la couleur du thème */
.perle { grid-column: 2; grid-row: 1; justify-self: center; position: relative; width: 116px; height: 116px; border-radius: 30px; }
.jeu-icone {
  display: block; width: 100%; height: 100%; border-radius: inherit; position: relative; z-index: 1;
  box-shadow: 0 0 0 7px var(--nuit), 0 0 38px color-mix(in srgb, var(--lueur) 45%, transparent);
  transition: filter 0.5s, box-shadow 0.5s;
}
.perle::before, .perle::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; }
.perle::before { background: radial-gradient(circle, color-mix(in srgb, var(--lueur) 85%, transparent) 0%, transparent 68%); }
.perle::after { border: 4px solid var(--laine); box-shadow: 0 0 18px var(--laine); }
.fil-actif .perle:not(.atteinte) .jeu-icone { filter: saturate(0.55) brightness(0.7); box-shadow: 0 0 0 7px var(--nuit); }
.perle.atteinte .jeu-icone { animation: perle-icone 0.9s ease-out; }
.perle.atteinte::before { animation: perle-eclat 1.1s ease-out; }
.perle.atteinte::after { animation: perle-onde 1s ease-out; }
@keyframes perle-icone { 20% { transform: scale(1.14); filter: brightness(1.4); } }
@keyframes perle-eclat { 0% { opacity: 0; transform: scale(0.8); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(2.4); } }
@keyframes perle-onde { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
.pied .pelote.atteinte { animation: perle-icone 0.9s ease-out; }
.jeu-texte { grid-row: 1; max-width: 22rem; }
.jeu-texte h3 { font-size: 2.4rem; margin: 0 0 0.35rem; }
.jeu-texte p { margin: 0 0 0.6rem; color: var(--doux); }
.jeu-texte .statut { color: var(--laine); font-weight: 800; font-size: 1rem; margin: 0; }
.jeu-capture { grid-row: 1; width: 290px; height: auto; border-radius: 24px; border: 6px solid var(--velours); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.jeu.gauche .jeu-texte { grid-column: 1; justify-self: end; text-align: right; }
.jeu.gauche .jeu-capture { grid-column: 3; justify-self: start; transform: rotate(2deg); }
.jeu.droite .jeu-texte { grid-column: 3; justify-self: start; }
.jeu.droite .jeu-capture { grid-column: 1; justify-self: end; transform: rotate(-2deg); }

/* --- Les chatons partagés, assis sur la laine ------------------------------------------------------------------------ */
.partage, .annee { max-width: 1100px; margin: 0 auto; padding: 72px var(--marge) 24px; }
.partage > p, .annee > p { max-width: 24rem; color: var(--doux); margin: 0 0 2.6rem; }
.corde { display: flex; justify-content: center; gap: clamp(4px, 2vw, 28px); padding-top: 12px; }
.corde-chat { position: relative; width: clamp(64px, 15vw, 170px); }
.corde-chat img { display: block; width: 100%; height: auto; position: relative; z-index: 1; }

/* --- L'année des fêtes ----------------------------------------------------------------------------------------------- */
.annee-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.fete { text-align: center; opacity: 0.7; }
.fete.en-cours { opacity: 1; }
.fete-img { position: relative; max-width: 150px; margin: 0 auto; }
.fete-img img { display: block; width: 100%; height: auto; position: relative; z-index: 1; }
.fete.en-cours .fete-img img { filter: drop-shadow(0 0 22px var(--lueur)); }
.fete h3 { font-size: 1.4rem; margin: 0.3rem 0 0.1rem; }
.fete-chat { margin: 0; font-weight: 800; color: var(--laine); }
.fete-dates, .fete-etat { margin: 0; font-size: 0.95rem; color: var(--doux); }
.fete.en-cours .fete-etat { color: var(--lueur); font-weight: 800; }

/* --- Le pied de page : la laine finit en pelote, Caramel dort dessus ----------------------------------------------- */
.pied { text-align: center; padding: 64px 16px 48px; }
.pied-pelote { position: relative; width: 250px; height: 170px; margin: 0 auto 12px; }
.pied-pelote img { position: absolute; left: 0; bottom: 0; width: 180px; z-index: 1; }
.pelote.grosse { position: absolute; right: 8px; bottom: 6px; width: 70px; height: 70px; }
.pied-liens { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin: 8px 0 20px; }
.pied-liens a { color: var(--creme); font-weight: 700; text-decoration-color: var(--laine); text-underline-offset: 5px; }
.merci { color: var(--doux); margin: 0 0 6px; }
.merci a { font-weight: 800; }
.coeur { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.droits { color: var(--doux); font-size: 0.9rem; opacity: 0.8; margin: 0; }

/* --- Les pages de texte (mentions légales, confidentialité) ----------------------------------------------------------- */
.texte { max-width: 46rem; margin: 0 auto; padding: 24px var(--marge) 32px; }
.texte h1 { font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem); margin: 0.4em 0 0.3em; }
.texte h2 { font-size: 1.5rem; margin: 2em 0 0.4em; color: var(--lueur); }
.texte h3 { font-size: 1.15rem; margin: 1.4em 0 0.2em; }
.texte p, .texte li { color: color-mix(in srgb, var(--creme) 88%, var(--doux)); }
.texte .date, .texte .sous-titre { color: var(--doux); }
.liste-jeux { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.liste-jeux a { display: flex; align-items: center; gap: 12px; color: var(--creme); font-weight: 800; text-decoration: none; padding: 8px; border-radius: 16px; }
.liste-jeux a:hover { background: var(--velours); }
.liste-jeux img { width: 48px; height: 48px; border-radius: 12px; }

/* --- Téléphone : la laine descend le long du bord gauche ------------------------------------------------------------ */
@media (max-width: 820px) {
  :root { --fil-x: 26px; --marge: 16px; }
  .heros, .jeux, .partage, .annee { padding-left: 66px; padding-right: 16px; }
  .jeux > h2, .partage > h2, .annee > h2 { max-width: none; }
  .heros { grid-template-columns: 1fr; min-height: 0; padding-top: 0; padding-bottom: 40px; }
  .heros-chat { order: -1; }
  .chat { width: min(80vw, 380px); }
  .heros .ancre-pattes { display: none; }
  .heros h1 { font-size: clamp(2.1rem, 1.2rem + 4.5vw, 2.8rem); }
  .chapo { font-size: 1.15rem; }
  .logo-tete { width: 56px; height: 56px; }
  .logo-nom { font-size: 1.7rem; }
  .jeu { display: block; position: relative; padding: 22px 0; }
  .perle { position: absolute; left: -66px; top: 20px; width: 52px; height: 52px; border-radius: 15px; }
  .jeu-icone { box-shadow: 0 0 0 5px var(--nuit), 0 0 22px color-mix(in srgb, var(--lueur) 45%, transparent); }
  .perle::after { border-width: 3px; }
  .jeu.gauche .jeu-texte, .jeu.droite .jeu-texte { text-align: left; max-width: none; }
  .jeu-texte h3 { font-size: 2rem; }
  .jeu.gauche .jeu-capture, .jeu.droite .jeu-capture { display: block; width: 230px; margin-top: 14px; transform: none; border-width: 5px; border-radius: 20px; }
  .corde { justify-content: flex-start; gap: 2px; }
  .corde-chat { width: 19%; }
  .annee-liste { grid-template-columns: 1fr; gap: 18px; }
  .fete { display: grid; grid-template-columns: 92px 1fr; column-gap: 14px; align-items: center; text-align: left; position: relative; }
  .fete-img { grid-row: 1 / span 4; position: static; }
  .fete .ancre-pattes { left: -40px; top: 50%; }
  .fete h3 { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chat .souffle, .chat.gelee .tendre { animation: none; }
  .perle.atteinte .jeu-icone, .perle.atteinte::before, .perle.atteinte::after, .pied .pelote.atteinte { animation: none; }
}
.texte .perdu { display: block; width: 220px; margin: 1rem 0; }
