/* Les autres pages (Projets, RIULZ, Studio, Casino, Imprimante…) en Apple et Liquid Glass.
   Chargé après le style propre de chaque page ; ne fait rien en Edgerunner (la classe page-refonte n'est posée qu'en Apple / Liquid Glass). */
html.page-refonte {
  --corps: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --titre: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --rayon: 14px; --ressort: cubic-bezier(.2, .85, .25, 1);
  --remplir: rgba(120, 120, 128, .2);
  background: var(--fond);
}
html.page-refonte body { font-family: var(--corps); background: transparent; color: var(--blanc); letter-spacing: normal; }
html.page-refonte :where(body *:not(code):not(pre):not(kbd)) { letter-spacing: normal; font-family: inherit; }
html.page-refonte :where(code, pre, kbd) { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* En-tête façon iOS : retour en chevron, grand titre. */
html.page-refonte header { gap: 10px; }
html.page-refonte header a.retour, html.page-refonte header #retour, html.page-refonte header > a:first-child { border: 0; background: none; color: var(--accent); font-size: 1.9rem; line-height: 1; padding: 2px 8px 6px 0; }
html.page-refonte header b, html.page-refonte header .titre { display: block; font: 700 1.55rem var(--titre); color: var(--blanc); text-transform: lowercase; }
html.page-refonte header b::first-letter, html.page-refonte header .titre::first-letter { text-transform: uppercase; }
html.page-refonte header small { display: block; font-size: .8rem; color: var(--doux); text-transform: lowercase; }
html.page-refonte header small::first-letter { text-transform: uppercase; }

/* Les blocs : cartes arrondies sans bordure néon. */
html.page-refonte section, html.page-refonte .carte, html.page-refonte .panneau, html.page-refonte .bloc, html.page-refonte .table, html.page-refonte .fil, html.page-refonte dialog, html.page-refonte .modale {
  border: 0 !important; border-radius: 18px; background: var(--panneau); box-shadow: none; color: var(--blanc);
}
html.page-refonte .carte { background: var(--panneau2); }
html.page-refonte h2, html.page-refonte h3 { font: 600 .78rem var(--corps); color: var(--doux); letter-spacing: .02em; text-transform: uppercase; }

/* Boutons et champs iOS. */
html.page-refonte button, html.page-refonte a.lien-bouton, html.page-refonte .bouton {
  border: 0; border-radius: 999px; background: var(--panneau2); color: var(--accent); font-weight: 600; box-shadow: none; text-shadow: none;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.5), background-color .25s, opacity .25s;
}
/* Les boutons qui sont en fait des cartes (commerce, interrupteur du pilote, template…) : coins de carte, texte normal, pas de pilule. */
html.page-refonte button:is(.s-carte, .s-inter, .s-tpl, .carte), html.page-refonte button:has(> div, > small, > p) {
  border-radius: 16px; color: var(--blanc); text-align: left; font-weight: 500;
}
html.page-refonte button:is(.s-inter):is(.on) { color: var(--blanc); }
html.page-refonte input[type=checkbox], html.page-refonte input[type=radio] { border-color: rgba(var(--texte-rgb, 235, 235, 245), .35); }
html.page-refonte input[type=checkbox]:checked, html.page-refonte input[type=radio]:checked { border-color: var(--accent); }
html.page-refonte button:active, html.page-refonte a.lien-bouton:active { transform: scale(.94); transition-duration: .08s; }
html.page-refonte button.principal, html.page-refonte button.actif, html.page-refonte .onglets button.actif { background: var(--accent); color: #fff; border: 0; }
html.page-refonte button.danger { color: #ff453a; }
html.page-refonte input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]), html.page-refonte select, html.page-refonte textarea {
  border: 0; border-radius: 12px; background: var(--panneau2); color: var(--blanc); font-weight: 500; box-shadow: none;
}
html.page-refonte input:focus, html.page-refonte select:focus, html.page-refonte textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; }
html.page-refonte input[type=range], html.page-refonte input[type=checkbox] { accent-color: var(--accent); }
html.page-refonte .onglets { background: var(--panneau2); border-radius: 999px; padding: 3px; gap: 2px; }
html.page-refonte .onglets button { background: transparent; color: var(--blanc); }
html.page-refonte .onglets button.actif { background: var(--panneau); color: var(--blanc); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
html.page-refonte .puce { border: 0; background: var(--panneau2); color: var(--blanc); }
html.page-refonte .toast { border: 0; border-radius: 999px; background: rgba(var(--fond-rgb), .85); color: var(--blanc); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
html.page-refonte .barre { background: var(--panneau2); } html.page-refonte .barre i { background: var(--accent); }
html.page-refonte .ligne { border-bottom-color: rgba(var(--texte-rgb), .08); }
html.page-refonte a { color: var(--accent); }

/* Arrivée de la page : les blocs montent en cascade. */
html.page-refonte body > header { animation: page-du-haut .6s var(--ressort) both; }
html.page-refonte body > section, html.page-refonte main > section, html.page-refonte body > main { animation: page-du-bas .6s var(--ressort) both; }
html.page-refonte body > section:nth-of-type(2), html.page-refonte main > section:nth-of-type(2) { animation-delay: .05s; }
html.page-refonte body > section:nth-of-type(3), html.page-refonte main > section:nth-of-type(3) { animation-delay: .1s; }
html.page-refonte body > section:nth-of-type(n+4), html.page-refonte main > section:nth-of-type(n+4) { animation-delay: .15s; }
html.page-refonte .carte { animation: page-du-bas .5s var(--ressort) both; }
@keyframes page-du-haut { from { opacity: 0; transform: translateY(-12px); } }
@keyframes page-du-bas { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Liquid Glass : fond animé et verre ---------- */
.fond-verre { display: none; }
html.page-refonte[data-style="verre"] .fond-verre { display: block; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
html.page-refonte[data-style="verre"] .fond-verre > i {
  position: absolute; width: 85vmax; height: 85vmax; left: calc(50% - 42.5vmax); top: calc(50% - 42.5vmax); border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--c), .62) 0, rgba(var(--c), .28) 34%, rgba(var(--c), 0) 66%); opacity: .85;
  will-change: transform; animation: page-tache-1 26s ease-in-out infinite alternate;
}
html.page-refonte[data-style="verre"].theme-clair .fond-verre > i { opacity: .6; }
.fond-verre > i:nth-child(1) { --c: var(--bleu-rgb); }
.fond-verre > i:nth-child(2) { --c: var(--rouge-rgb); animation-name: page-tache-2 !important; animation-duration: 31s !important; }
.fond-verre > i:nth-child(3) { --c: 140, 90, 255; animation-name: page-tache-3 !important; animation-duration: 23s !important; }
.fond-verre > i:nth-child(4) { --c: 255, 196, 60; animation-name: page-tache-1 !important; animation-duration: 37s !important; animation-direction: alternate-reverse !important; width: 60vmax !important; height: 60vmax !important; }
.fond-verre > i:nth-child(5) { --c: 60, 220, 230; animation-name: page-tache-2 !important; animation-duration: 29s !important; animation-direction: alternate-reverse !important; width: 55vmax !important; height: 55vmax !important; }
@keyframes page-tache-1 { 0% { transform: translate(-38vw, -34vh) scale(1); } 50% { transform: translate(22vw, -12vh) scale(1.2); } 100% { transform: translate(-6vw, 26vh) scale(.9); } }
@keyframes page-tache-2 { 0% { transform: translate(36vw, -20vh) scale(.9); } 50% { transform: translate(-18vw, 18vh) scale(1.15); } 100% { transform: translate(30vw, 36vh) scale(1); } }
@keyframes page-tache-3 { 0% { transform: translate(-30vw, 38vh) scale(1.1); } 50% { transform: translate(28vw, 24vh) scale(.85); } 100% { transform: translate(-10vw, -30vh) scale(1.1); } }
html.page-refonte[data-style="verre"] :is(section, .panneau, .bloc, .table, .fil, dialog, .modale, header) {
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .02) 42%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .06)), var(--panneau);
  border: 1px solid var(--bord) !important; -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .35), inset -1px -1px 0 rgba(255, 255, 255, .08), 0 10px 30px rgba(0, 0, 0, .18);
}
html.page-refonte[data-style="verre"] body > header { border-radius: 26px; padding: 6px 12px; }
html.page-refonte[data-style="verre"] button, html.page-refonte[data-style="verre"] .carte {
  background: linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .04) 50%, rgba(255, 255, 255, .08)), var(--panneau2);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .35), inset -1px -1px 0 rgba(255, 255, 255, .08); border: 1px solid var(--bord);
}
html.page-refonte[data-style="verre"] button.principal, html.page-refonte[data-style="verre"] button.actif {
  background: linear-gradient(180deg, rgba(255, 255, 255, .25), transparent 60%), var(--accent); border-color: transparent;
}
html.page-refonte[data-style="verre"] header a.retour, html.page-refonte[data-style="verre"] header #retour { background: none !important; box-shadow: none !important; border: 0 !important; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html.page-refonte[data-style="verre"] :is(section, .panneau, .bloc, .table, header) { background: rgba(var(--fond2-rgb), .9); }
}
html.page-refonte.sans-anim *, html.page-refonte.sans-anim .fond-verre > i { animation: none !important; }
@media (prefers-reduced-motion: reduce) { html.page-refonte .fond-verre > i { animation-play-state: paused !important; } }
