/* Un espace calme : fond de brume, une lueur qui respire, les jeux posés l'un sous l'autre.
   Le jeu choisi teinte la lueur (abricot pour le tarot, lilas pour les miroirs, rose pour les 77, bleu pour le jeu de 32) ; tout le reste se tait.
   Surfaces nettes, ombres douces en couches, mouvements courts : rien ne crie, tout répond. */
:root {
  color-scheme: light;
  --fond: #f1f3ee;
  --surface: #ffffff;
  --surface-2: #e9ede7;
  --trait: #dfe5de;
  --trait-fort: #c9d3cb;
  --texte: #16201d;
  --texte-2: #5a6762;
  --accent: #1f6b59;
  --accent-2: #2e8770;
  --accent-encre: #f6fbf8;
  --accent-doux: #dcece3;
  --alerte: #b24f38;
  --or: #f0b24a;
  --tarot-a: #f5d3ac;
  --tarot-b: #d3e7da;
  --miroirs-a: #ddd6f5;
  --miroirs-b: #cde4ea;
  --les77-a: #f5cfcd;
  --les77-b: #d6daf4;
  --jeu32-a: #cfe0f4;
  --jeu32-b: #f4d9d6;
  --lueur-a: var(--tarot-a);
  --lueur-b: var(--miroirs-a);
  --ombre: rgba(22, 32, 29, .16);
  --voile: rgba(16, 24, 22, .34);
  --verre: rgba(255, 255, 255, .72);
  --relief: inset 0 1px 0 rgba(255, 255, 255, .7);
  --ombre-carte: 0 1px 2px rgba(22, 32, 29, .05), 0 10px 28px -16px rgba(22, 32, 29, .18);
  --ombre-haute: 0 2px 6px rgba(22, 32, 29, .05), 0 22px 44px -20px rgba(22, 32, 29, .28);
  --anneau: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
  --f-majeur: #7a68c0;
  --f-batons: #c8674a;
  --f-coupes: #4d88ab;
  --f-epees: #7f8a96;
  --f-pentacles: #c2952c;
  --f-miroirs: #6f7fb5;
  --c-rouge: #c6524a;
  --c-indigo: #5a5fc0;
  --police-titre: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --police-texte: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --doux: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fond: #0d1412;
    --surface: #151e1b;
    --surface-2: #1e2925;
    --trait: #25322d;
    --trait-fort: #34443d;
    --texte: #e9f0ec;
    --texte-2: #96a69f;
    --accent: #8dd2b6;
    --accent-2: #b3e5cf;
    --accent-encre: #0a1c15;
    --accent-doux: #1c3a2e;
    --alerte: #f0957c;
    --tarot-a: #4d3a26;
    --tarot-b: #1c3529;
    --miroirs-a: #352f5c;
    --miroirs-b: #1a353d;
    --les77-a: #4d2a2e;
    --les77-b: #252a58;
    --jeu32-a: #213a57;
    --jeu32-b: #4b2a2b;
    --c-rouge: #e8837a;
    --c-indigo: #9296ee;
    --ombre: rgba(0, 0, 0, .55);
    --voile: rgba(0, 0, 0, .58);
    --verre: rgba(21, 30, 27, .7);
    --relief: inset 0 1px 0 rgba(255, 255, 255, .045);
    --ombre-carte: inset 0 1px 0 rgba(255, 255, 255, .04), 0 12px 30px -16px rgba(0, 0, 0, .7);
    --ombre-haute: inset 0 1px 0 rgba(255, 255, 255, .05), 0 26px 50px -20px rgba(0, 0, 0, .8);
    --anneau: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #0d1412;
  --surface: #151e1b;
  --surface-2: #1e2925;
  --trait: #25322d;
  --trait-fort: #34443d;
  --texte: #e9f0ec;
  --texte-2: #96a69f;
  --accent: #8dd2b6;
  --accent-2: #b3e5cf;
  --accent-encre: #0a1c15;
  --accent-doux: #1c3a2e;
  --alerte: #f0957c;
  --tarot-a: #4d3a26;
  --tarot-b: #1c3529;
  --miroirs-a: #352f5c;
  --miroirs-b: #1a353d;
  --les77-a: #4d2a2e;
  --les77-b: #252a58;
  --jeu32-a: #213a57;
  --jeu32-b: #4b2a2b;
  --c-rouge: #e8837a;
  --c-indigo: #9296ee;
  --ombre: rgba(0, 0, 0, .55);
  --voile: rgba(0, 0, 0, .58);
  --verre: rgba(21, 30, 27, .7);
  --relief: inset 0 1px 0 rgba(255, 255, 255, .045);
  --ombre-carte: inset 0 1px 0 rgba(255, 255, 255, .04), 0 12px 30px -16px rgba(0, 0, 0, .7);
  --ombre-haute: inset 0 1px 0 rgba(255, 255, 255, .05), 0 26px 50px -20px rgba(0, 0, 0, .8);
  --anneau: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
body[data-jeu="tarot"] { --lueur-a: var(--tarot-a); --lueur-b: var(--tarot-b); }
body[data-jeu="miroirs"] { --lueur-a: var(--miroirs-a); --lueur-b: var(--miroirs-b); }
body[data-jeu="les77"] { --lueur-a: var(--les77-a); --lueur-b: var(--les77-b); }
body[data-jeu="jeu32"] { --lueur-a: var(--jeu32-a); --lueur-b: var(--jeu32-b); }

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  background:
    radial-gradient(34rem 22rem at 12% -6rem, var(--lueur-a), transparent 72%),
    radial-gradient(30rem 20rem at 96% 2rem, var(--lueur-b), transparent 72%),
    var(--fond);
  background-repeat: no-repeat;
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
/* Dans l'application, la lueur reste en place quand on fait défiler, et dérive très lentement. */
body:has(> .app) { background: var(--fond); }
body:has(> .app)::before {
  content: ""; position: fixed; inset: -10vh -10vw; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38rem 26rem at 8% 0%, var(--lueur-a), transparent 70%),
    radial-gradient(34rem 24rem at 100% 8%, var(--lueur-b), transparent 70%),
    radial-gradient(40rem 30rem at 60% 115%, color-mix(in srgb, var(--lueur-a) 55%, transparent), transparent 70%);
  transition: background .8s;
  animation: derive 28s ease-in-out infinite alternate;
}
@keyframes derive { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-2vw, 1.5vh, 0) scale(1.05); } }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.app { max-width: 38rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; padding-block: 1rem 0; }
h1, h2 { font-family: var(--police-titre); font-weight: 520; margin: 0; text-wrap: balance; letter-spacing: -.025em; }
h2 { font-size: clamp(1.95rem, 6.2vw, 2.35rem); line-height: 1.06; letter-spacing: -.035em; }
p { margin: 0; }
button, select, textarea, input { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; }
.invisible { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* En-tête */
.entete { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; min-height: 2.75rem; }
.marque { display: flex; align-items: center; gap: .6rem; margin-right: auto; font-size: 1.3rem; font-weight: 560; letter-spacing: -.025em; }
.orbe {
  width: 1.2rem; height: 1.2rem; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--accent-2) 70%, #fff) 30%, var(--accent) 85%);
  box-shadow: 0 0 0 4px var(--accent-doux), 0 0 22px 2px color-mix(in srgb, var(--accent-2) 45%, transparent);
}
body.occupe .orbe { animation: souffle 4s ease-in-out infinite; }
@keyframes souffle { 0%, 100% { transform: scale(.82); } 50% { transform: scale(1.18); } }
.entete-outils { display: flex; gap: .4rem; flex-wrap: wrap; }
.entete .btn-petit { background: var(--verre); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-align: center;
  padding: .85rem 1.4rem; border-radius: 999px; border: 1px solid var(--trait);
  background: var(--surface); color: var(--texte); cursor: pointer;
  box-shadow: var(--relief), 0 1px 2px rgba(22, 32, 29, .05);
  transition: transform .18s var(--doux), background-color .18s, border-color .18s, box-shadow .18s, color .18s, filter .18s;
}
.btn:hover:not(:disabled) { border-color: var(--trait-fort); background-color: color-mix(in srgb, var(--surface) 94%, var(--texte)); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-plein {
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-encre); border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 22px -12px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-plein:hover:not(:disabled) { background-color: transparent; border-color: transparent; filter: brightness(1.06) saturate(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 14px 28px -12px color-mix(in srgb, var(--accent) 85%, transparent); }
.btn-grand { font-size: 1.1rem; padding: 1.1rem 1.5rem; width: 100%; }
.btn-petit { font-size: .88rem; font-weight: 550; padding: .5rem .95rem; }
.btn[aria-pressed="false"] { color: var(--texte-2); }
.btn[aria-pressed="true"] { background: var(--accent-doux); border-color: transparent; box-shadow: none; }
.lien { background: none; border: 0; padding: .3rem 0; color: var(--texte-2); text-decoration: underline; text-decoration-color: var(--trait-fort); text-decoration-thickness: 1.5px; text-underline-offset: 5px; cursor: pointer; font-size: .95rem; transition: color .15s, text-decoration-color .15s; }
.lien:hover { color: var(--texte); text-decoration-color: var(--accent); }
.icone { width: 1.2em; height: 1.2em; flex: none; }

/* Écrans : chacun arrive en douceur */
.ecran { display: flex; flex-direction: column; gap: 1.5rem; }
.ecran:not([hidden]) { animation: apparait .5s var(--doux) both; }
@keyframes apparait { from { opacity: 0; transform: translateY(12px); } }
.intro { display: flex; flex-direction: column; gap: .7rem; padding-top: 1.25rem; }
.intro p { color: var(--texte-2); font-size: 1.08rem; max-width: 30rem; }
.etiquette { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--texte-2); font-weight: 600; }
.intro .etiquette { color: var(--accent); }
.intro .etiquette::before { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-right: .6rem; vertical-align: .12em; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 .2rem color-mix(in srgb, currentColor 18%, transparent); }
.champ label { font-size: .92rem; font-weight: 600; color: var(--texte); letter-spacing: -.005em; }

/* Choix du jeu */
.jeux { display: flex; flex-direction: column; gap: .8rem; }
.jeu {
  --teinte: var(--lueur-a);
  display: flex; align-items: center; gap: 1rem; text-align: left; min-width: 0; color: var(--texte);
  background: linear-gradient(100deg, color-mix(in srgb, var(--teinte) 34%, var(--surface)) 0%, var(--surface) 58%);
  border: 1px solid var(--trait); border-radius: 28px; padding: .8rem 1.1rem .8rem .8rem;
  cursor: pointer; box-shadow: var(--ombre-carte);
  transition: transform .25s var(--doux), box-shadow .25s, border-color .25s;
}
.jeu:hover { transform: translateY(-3px); box-shadow: var(--ombre-haute); border-color: var(--trait-fort); }
.jeu:active { transform: translateY(-1px) scale(.99); }
.jeu[data-jeu="tarot"] { --teinte: var(--tarot-a); }
.jeu[data-jeu="miroirs"] { --teinte: var(--miroirs-a); }
.jeu[data-jeu="les77"] { --teinte: var(--les77-a); }
.jeu[data-jeu="jeu32"] { --teinte: var(--jeu32-a); }
.jeu-image { width: 84px; aspect-ratio: 1; flex: none; color: var(--texte); transition: transform .35s var(--doux); }
.jeu:hover .jeu-image { transform: rotate(-4deg) scale(1.04); }
.jeu-image .tache { fill: var(--teinte); }
.jeu-image .papier { fill: var(--surface); }
.jeu-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.jeu-nom { font-family: var(--police-titre); font-size: 1.32rem; font-weight: 540; letter-spacing: -.025em; line-height: 1.15; }
.jeu-detail { font-size: .9rem; color: var(--texte-2); line-height: 1.35; }
.jeu-fleche {
  width: 2.25rem; height: 2.25rem; padding: .55rem; border-radius: 50%; flex: none;
  color: var(--texte-2); background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  transition: transform .25s var(--doux), background-color .25s, color .25s;
}
.jeu:hover .jeu-fleche { transform: translateX(3px); background: var(--accent); color: var(--accent-encre); }
@media (max-width: 420px) {
  .jeu { gap: .8rem; padding-right: .8rem; }
  .jeu-image { width: 70px; }
  .jeu-nom { font-size: 1.22rem; }
  .jeu-fleche { width: 2rem; height: 2rem; padding: .48rem; }
}
.mention { font-size: .85rem; color: var(--texte-2); }

/* Champs */
.champ { display: flex; flex-direction: column; gap: .45rem; }
.champ-ligne { display: flex; gap: .5rem; align-items: flex-end; }
textarea, select, input[type="text"], input[type="email"], input[type="password"], input[type="search"] {
  width: 100%; min-width: 0; background-color: var(--surface); border: 1px solid var(--trait); border-radius: 16px;
  padding: .8rem 1rem; color: var(--texte); box-shadow: 0 1px 2px rgba(22, 32, 29, .04);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
textarea:hover, select:hover, input[type="text"]:hover, input[type="email"]:hover, input[type="password"]:hover, input[type="search"]:hover { border-color: var(--trait-fort); }
textarea:focus-visible, select:focus-visible, input[type="text"]:focus-visible, input[type="email"]:focus-visible, input[type="password"]:focus-visible, input[type="search"]:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: var(--anneau);
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.6rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23849189' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .95rem center; background-size: 1.05rem;
}
textarea { resize: vertical; min-height: 3.4rem; }
textarea::placeholder, input::placeholder { color: var(--texte-2); opacity: .75; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.actions { display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.aide { font-size: .93rem; color: var(--texte-2); text-wrap: pretty; }
.actions .aide { text-align: center; text-wrap: balance; }
.provisoire { font-size: .9rem; font-style: italic; color: var(--texte-2); min-height: 1.2em; }

/* Bandeau */
.bandeau {
  position: sticky; top: max(.5rem, env(safe-area-inset-top, 0px)); z-index: 5;
  border: 1px solid var(--trait); border-radius: 20px; padding: .9rem 1.05rem;
  background: var(--verre); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: var(--ombre-haute);
  display: flex; flex-direction: column; gap: .6rem; align-items: flex-start;
  animation: apparait .35s var(--doux) both;
}
.bandeau p::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--alerte); margin-right: .55rem; vertical-align: .08em; box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--alerte) 20%, transparent); }
.bandeau-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Tirage */
.photo { width: 100%; max-height: 14rem; object-fit: cover; border-radius: 24px; background: var(--surface-2); box-shadow: var(--ombre-carte); }
.attente { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; text-align: center; padding-block: 1.5rem; }
.attente p { color: var(--texte-2); max-width: 22rem; text-wrap: balance; }
.respire {
  width: 5.5rem; height: 5.5rem; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, var(--surface), var(--lueur-a) 55%, var(--accent-doux));
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent-doux) 45%, transparent), 0 0 60px 10px color-mix(in srgb, var(--lueur-a) 70%, transparent);
  animation: souffle 4s ease-in-out infinite;
}
.points { display: inline-flex; gap: .35rem; padding-block: .4rem; }
.points i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); animation: point 1.4s ease-in-out infinite; }
.points i:nth-child(2) { animation-delay: .2s; }
.points i:nth-child(3) { animation-delay: .4s; }
@keyframes point { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

.cartes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 1rem .7rem; }
.cartes li { display: flex; flex-direction: column; gap: .35rem; align-items: center; min-width: 0; }
.carte {
  width: 100%; max-width: 120px; aspect-ratio: 2 / 3; padding: .55rem .4rem .6rem; border-radius: 14px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface-2) 45%, var(--surface)));
  color: var(--texte); border: 1px solid var(--trait);
  box-shadow: var(--ombre-carte); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: .25rem;
  transition: transform .22s var(--doux), box-shadow .22s, border-color .22s;
}
.cartes .carte:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: var(--ombre-haute); border-color: var(--trait-fort); }
body[data-jeu="tarot"] .carte, body[data-jeu="tarot"] .ajout { aspect-ratio: 70 / 120; }
.carte-num { font-size: .72rem; color: var(--texte-2); letter-spacing: .06em; line-height: 1; min-height: .72rem; align-self: flex-start; padding-left: .2rem; }
.carte-glyphe { width: 58%; flex: 1; min-height: 0; }
.carte.inv .carte-glyphe { transform: rotate(180deg); }
.carte-nom { font-size: .76rem; font-weight: 550; line-height: 1.15; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.carte.inconnue { border-style: dashed; border-color: var(--alerte); background: color-mix(in srgb, var(--alerte) 5%, var(--surface)); justify-content: center; font-family: var(--police-titre); font-size: 1.8rem; color: var(--texte-2); }
.carte-place { font-size: .8rem; line-height: 1.25; color: var(--texte-2); text-align: center; }
.carte-place b { color: var(--texte); font-weight: 600; }
.pastille { font-size: .7rem; font-weight: 600; line-height: 1; padding: .3rem .58rem; border-radius: 999px; background: var(--accent-doux); color: var(--texte); }
.pastille.doute { background: color-mix(in srgb, var(--alerte) 8%, transparent); box-shadow: inset 0 0 0 1px var(--alerte); color: var(--alerte); }
.pastille.discret { background: transparent; box-shadow: inset 0 0 0 1px var(--trait-fort); color: var(--texte-2); }
.ajout { aspect-ratio: 2 / 3; width: 100%; max-width: 120px; border: 1.5px dashed var(--trait-fort); border-radius: 14px; background: color-mix(in srgb, var(--surface) 40%, transparent); color: var(--texte-2); cursor: pointer; font-size: .88rem; padding: .4rem; transition: border-color .2s, color .2s, background-color .2s; }
.ajout:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent-doux) 40%, transparent); }
.rangee { display: flex; flex-wrap: wrap; gap: .6rem; }
.rangee .btn { flex: 1 1 12rem; }
.erreur { color: var(--alerte); font-size: .93rem; }

/* Fenêtres : une carte posée au centre, une feuille qui monte sur téléphone */
dialog {
  border: 1px solid var(--trait); border-radius: 28px; background: var(--surface); color: var(--texte);
  padding: 1.5rem; width: min(26rem, calc(100vw - 32px));
  box-shadow: var(--relief), 0 40px 80px -30px rgba(0, 0, 0, .4);
}
dialog[open] { animation: fenetre .32s var(--doux) both; }
@keyframes fenetre { from { opacity: 0; transform: translateY(14px) scale(.97); } }
dialog::backdrop { background: var(--voile); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: voile .3s ease both; }
@keyframes voile { from { opacity: 0; } }
dialog form { display: flex; flex-direction: column; gap: 1.1rem; }
dialog h2 { font-size: 1.45rem; letter-spacing: -.025em; }
dialog select, dialog input[type="text"], dialog input[type="email"], dialog input[type="password"] { background-color: var(--fond); }
@media (max-width: 560px) {
  dialog:not(.fenetre-schema) {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 28px 28px 0 0; border-bottom: 0;
    padding: 1.6rem 1.25rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
  }
  dialog:not(.fenetre-schema)::before { content: ""; display: block; width: 2.6rem; height: 5px; border-radius: 99px; background: var(--trait-fort); margin: -.7rem auto 1rem; }
  dialog:not(.fenetre-schema)[open] { animation: feuille .38s var(--doux) both; }
  @keyframes feuille { from { transform: translateY(100%); } }
}
.case { display: flex; align-items: center; gap: .6rem; }
.case input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }

/* Séance */
.ruban { display: flex; gap: .45rem; overflow-x: auto; padding: .2rem .1rem .6rem; scrollbar-width: thin; }
.ruban .carte { width: 62px; flex: none; padding: .3rem .2rem .35rem; border-radius: 10px; cursor: default; box-shadow: 0 1px 2px rgba(22, 32, 29, .06); }
.ruban .carte-nom { font-size: .5rem; }
.ruban .carte-num { font-size: .5rem; min-height: .5rem; }
.resume { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; font-size: .9rem; color: var(--texte-2); }
.fil { display: flex; flex-direction: column; gap: 1.5rem; }
.msg { display: flex; flex-direction: column; gap: .45rem; min-width: 0; animation: apparait .4s var(--doux) both; }
.msg-qui { display: flex; align-items: center; gap: .5rem; font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--texte-2); font-weight: 600; }
.msg-qui::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--accent-2) 40%, var(--accent)); box-shadow: 0 0 10px color-mix(in srgb, var(--accent-2) 55%, transparent); }
.msg-moi .msg-qui::before { background: var(--trait-fort); box-shadow: none; }
.msg-texte { display: flex; flex-direction: column; gap: .75rem; overflow-wrap: anywhere; }
.msg-lanterne .msg-texte { font-size: 1.08rem; line-height: 1.65; max-width: 65ch; }
.msg-lanterne strong { font-weight: 650; }
.msg-lanterne .msg-qui { text-transform: none; letter-spacing: 0; font-size: .86rem; }   /* le nom s'écrit « Paroles de Cartes », jamais en capitales */
.msg-moi { align-items: flex-end; }
.msg-moi .msg-texte { background: var(--accent-doux); border-radius: 22px 22px 6px 22px; padding: .7rem 1.05rem; max-width: 85%; box-shadow: var(--relief); }
.msg-note { font-size: .88rem; font-style: italic; color: var(--texte-2); }
.ecouter { align-self: flex-start; }
.reponses { display: flex; flex-wrap: wrap; gap: .5rem; }
.reponses .btn { font-size: .95rem; padding: .6rem 1.05rem; }
.reponses .btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pied {
  position: sticky; bottom: 0; z-index: 4;
  background: linear-gradient(to top, var(--fond) 72%, color-mix(in srgb, var(--fond) 0%, transparent));
  padding-block: 1.1rem .7rem; padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: .5rem;
}
.pied-outils { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.saisie {
  display: flex; gap: .4rem; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--trait); border-radius: 28px; padding: .4rem .4rem .4rem 1.1rem;
  box-shadow: var(--ombre-haute); transition: border-color .15s, box-shadow .15s;
}
.saisie:focus-within { border-color: var(--accent); box-shadow: var(--anneau), var(--ombre-haute); }
.saisie textarea { border: 0; background: transparent; padding: .5rem 0; min-height: 2.5rem; max-height: 9rem; resize: none; field-sizing: content; border-radius: 0; box-shadow: none; }
.saisie textarea:focus, .saisie textarea:focus-visible { outline: none; box-shadow: none; }
.rond { width: 2.6rem; height: 2.6rem; padding: 0; flex: none; }

@media (prefers-reduced-motion: reduce) {
  body.occupe .orbe, .respire, .points i, body:has(> .app)::before { animation: none; }
  .ecran:not([hidden]), .msg, .bandeau, dialog[open], dialog::backdrop { animation: none !important; }
  .btn, .jeu, .jeu-image, .jeu-fleche, .carte { transition: none; }
}

/* ---------- Site autonome : accès, clé, voix en direct ---------- */
.panneau { background: var(--surface); border: 1px solid var(--trait); border-radius: 28px; padding: 1.4rem; display: flex; flex-direction: column; gap: 1rem; box-shadow: var(--ombre-carte); }
.panneau h3 { font-family: var(--police-titre); font-weight: 540; font-size: 1.15rem; margin: 0; letter-spacing: -.015em; }
.reussite { color: var(--accent); font-size: .93rem; }
.etat-voix { display: flex; align-items: center; gap: .6rem; font-size: .93rem; color: var(--texte-2); min-height: 1.6rem; }
.etat-voix::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--trait-fort); flex: none; }
.etat-voix[data-etat="parle"]::before { background: var(--accent); animation: point 1.4s ease-in-out infinite; }
.etat-voix[data-etat="ecoute"]::before { background: var(--c-rouge); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--c-rouge) 22%, transparent); }
.etat-voix[data-etat="attente"]::before { background: var(--accent); animation: point 1.4s ease-in-out infinite; }
.micro { position: relative; width: 2.6rem; height: 2.6rem; padding: 0; flex: none; overflow: visible; }
.micro[aria-pressed="true"] { background: var(--c-rouge); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px var(--c-rouge); }
.micro .halo { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c-rouge); opacity: 0; transform: scale(var(--niveau, 1)); transition: transform .08s linear; pointer-events: none; }
.micro[aria-pressed="true"] .halo { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .etat-voix::before { animation: none !important; } .micro .halo { transition: none; } }

/* ---------- Choix du tirage et schémas ---------- */
.filtres { display: flex; gap: .45rem; overflow-x: auto; padding: .15rem .1rem .4rem; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.filtres .btn { flex: none; }
.filtres .btn[aria-pressed="true"] { background: var(--texte); color: var(--fond); border-color: transparent; box-shadow: 0 6px 14px -8px var(--ombre); }
.chapitre { display: flex; flex-direction: column; gap: .85rem; padding-top: .6rem; }
.chapitre + .chapitre { padding-top: 1.8rem; }
.chapitre h3 { font-family: var(--police-titre); font-weight: 540; font-size: 1.25rem; letter-spacing: -.02em; margin: 0; }
.tirages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1.1rem .85rem; }
.tirage {
  display: flex; flex-direction: column; gap: .4rem; text-align: left; padding: 0; min-width: 0;
  background: none; border: 0; cursor: pointer; color: var(--texte);
}
.tirage img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; border: 1px solid var(--trait); background: var(--surface-2); box-shadow: var(--ombre-carte); transition: transform .25s var(--doux), box-shadow .25s; }
.tirage:hover img { transform: translateY(-4px); box-shadow: var(--ombre-haute); }
.tirage-titre { font-weight: 600; font-size: .95rem; line-height: 1.2; }
.tirage-taille { font-size: .82rem; color: var(--texte-2); line-height: 1.2; }
.schema { margin: 0; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.schema-image { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; max-width: 100%; border-radius: 22px; }
.schema-image img { display: block; width: auto; max-width: 100%; height: auto; max-height: 52vh; border-radius: 22px; border: 1px solid var(--trait); box-shadow: var(--ombre-haute); transition: transform .25s var(--doux); }
.schema-image:hover img { transform: scale(1.01); }
.fenetre-schema { width: min(34rem, calc(100vw - 16px)); padding: .6rem; }
.fenetre-schema form { gap: .6rem; }
.fenetre-schema img { display: block; width: 100%; height: auto; border-radius: 20px; }
.resume-liens { display: inline-flex; gap: 1rem; }
@media (prefers-reduced-motion: reduce) { .tirage img, .schema-image img { transition: none; } }

/* Navigation : retour et accueil */
.marque button { display: flex; align-items: center; gap: .6rem; background: none; border: 0; padding: .3rem 0; font: inherit; letter-spacing: inherit; cursor: pointer; }
.retour { width: 2.6rem; height: 2.6rem; padding: 0; flex: none; }
.entete .rond, .haut .rond { background: var(--verre); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
/* Coin de l'en-tête : jour ou nuit, et déconnexion. Sur téléphone, il reste à côté de la marque ; les outils passent dessous. */
.entete-coin { display: flex; gap: .4rem; order: 3; }
/* Choix de la langue : un rond qui montre FR, EN ou ES ; la liste native du téléphone s'ouvre au toucher. */
.choix-langue { position: relative; cursor: pointer; }
.choix-langue .code-langue { font-size: .78rem; font-weight: 600; letter-spacing: .04em; }
.choix-langue select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.choix-langue:focus-within { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.entete-outils { order: 2; }
.entete-outils:not(:has(> :not([hidden]))) { display: none; }
@media (max-width: 560px) {
  .entete-coin { order: 2; }
  .entete-outils { order: 3; flex-basis: 100%; }
}
.bascule-theme .icone { transition: transform .45s var(--doux); }
.bascule-theme:hover .icone { transform: rotate(-20deg); }
.bascule-theme .soleil, .bascule-theme[data-etat="dark"] .lune { display: none; }
.bascule-theme[data-etat="dark"] .soleil { display: block; }
#deconnexion:hover:not(:disabled) { color: var(--alerte); border-color: color-mix(in srgb, var(--alerte) 45%, var(--trait)); }
@media (prefers-reduced-motion: reduce) { .bascule-theme .icone { transition: none; } }

/* Plateau : les cartes reconnues, à leur place sur le schéma */
.plateau { position: relative; width: 100%; max-width: 19rem; margin-inline: auto; border-radius: 24px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--trait); box-shadow: var(--ombre-carte); }
.plateau-place { position: absolute; transform: translate(-50%, -50%); border-radius: 10px; border: 1px solid var(--trait); background: var(--surface); padding: .2rem; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; cursor: pointer; min-width: 0; line-height: 1.1; box-shadow: 0 6px 14px -10px var(--ombre); transition: border-color .15s, box-shadow .15s; }
.plateau-place:hover { border-color: var(--accent); }
.plateau-place b { font-family: var(--police-titre); font-size: 1rem; font-weight: 600; color: var(--accent); }
.plateau-place span { font-size: .68rem; text-align: center; overflow-wrap: anywhere; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.plateau-place.vide { border-style: dashed; background: transparent; box-shadow: none; cursor: default; }
.plateau-place.vide b { color: var(--texte-2); }
.plateau-place.travers { z-index: 1; transform: translate(-50%, -50%) rotate(90deg); }
.plateau-place.doute { border-color: var(--alerte); }
.plateau.large { max-width: none; }
.plateau.large .plateau-place span { font-size: .56rem; }
.plateau.serre .plateau-place span { display: none; }
.plateau.serre .plateau-place b { font-size: .72rem; }

/* Lectures de la visite, à télécharger */
.lectures { display: flex; flex-direction: column; gap: .7rem; }
.lectures h3 { font-family: var(--police-titre); font-weight: 540; font-size: 1.2rem; letter-spacing: -.015em; margin: 0; }
.lectures ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.lectures li { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--trait); border-radius: 20px; padding: .65rem .65rem .65rem 1.05rem; box-shadow: var(--ombre-carte); }
.lectures li > span { flex: 1; min-width: 0; line-height: 1.3; }
.lectures li small { display: block; color: var(--texte-2); font-size: .82rem; }

/* Comptes et crédits */
.offres { display: flex; flex-direction: column; gap: .85rem; }
.offres h3 { font-family: var(--police-titre); font-weight: 540; font-size: 1.4rem; letter-spacing: -.025em; margin: 0; }
.offres .aide { margin-top: -.4rem; }
.grille { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.grille th, .grille td { text-align: right; padding: .6rem .3rem; border-bottom: 1px solid var(--trait); font-weight: 400; }
.grille th { color: var(--texte-2); font-size: .82rem; font-weight: 600; }
.grille th:first-child, .grille td:first-child { text-align: left; }
.releve { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.releve li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--trait); }
.releve small { display: block; color: var(--texte-2); }
.releve b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Le crédit : une petite lueur, partout la même */
.credit { display: inline-flex; align-items: center; gap: .32rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.credit i { width: .82em; height: .82em; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #fff3d6, #f0b24a 62%, #c9822a); box-shadow: 0 0 0 .16em color-mix(in srgb, #f0b24a 24%, transparent), 0 0 .7em color-mix(in srgb, #f0b24a 45%, transparent); }
.pastille-credits { gap: .4rem; }

/* Solde */
.apercu { display: flex; flex-direction: column; gap: .7rem; border: 1.5px dashed var(--trait-fort); border-radius: 22px; padding: .95rem 1.05rem; font-size: .93rem; color: var(--texte-2); }
.apercu strong { color: var(--texte); font-weight: 600; }
.segments { display: flex; gap: .25rem; background: var(--surface-2); border-radius: 999px; padding: .25rem; box-shadow: inset 0 1px 2px rgba(22, 32, 29, .06); }
.segments button { flex: 1; min-width: 0; border: 0; background: none; border-radius: 999px; padding: .55rem .4rem; font-size: .88rem; font-weight: 550; line-height: 1.15; color: var(--texte-2); cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; }
.segments button:hover { color: var(--texte); }
.segments button[aria-pressed="true"] { background: var(--surface); color: var(--texte); box-shadow: 0 1px 2px rgba(22, 32, 29, .08), 0 6px 14px -10px var(--ombre); }
.solde {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 1.2rem;
  background: var(--surface); border: 1px solid var(--trait); border-radius: 30px; padding: 1.3rem; box-shadow: var(--ombre-haute);
}
.solde::before { content: ""; position: absolute; width: 16rem; aspect-ratio: 1; right: -6rem; top: -8rem; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--or) 22%, transparent), transparent 70%); pointer-events: none; }
.jauge { position: relative; width: 8.2rem; aspect-ratio: 1; flex: none; display: grid; place-items: center; }
.jauge svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.jauge circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.jauge .fond { stroke: var(--surface-2); }
.jauge .part-abo { stroke: #e9a93f; }
.jauge .part-achat { stroke: var(--accent); }
.jauge-nombre { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.jauge-nombre b { font-family: var(--police-titre); font-weight: 540; font-size: 2.7rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.jauge-nombre span { font-size: .85rem; color: var(--texte-2); margin-top: .3rem; }
.solde-texte { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .55rem; }
.solde-texte .etiquette { text-transform: none; letter-spacing: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.solde-detail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; font-size: .95rem; line-height: 1.3; }
.solde-detail li { display: flex; gap: .5rem; align-items: baseline; }
.solde-detail li::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; flex: none; background: var(--accent); }
.solde-detail li.abo::before { background: #e9a93f; }
.solde-detail li.rien::before { background: var(--alerte); }
.solde-detail small { display: block; color: var(--texte-2); font-size: .82rem; }
.solde-equivalent { font-size: .9rem; color: var(--texte-2); line-height: 1.35; }

/* Offres */
.formules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.formule { position: relative; display: flex; flex-direction: column; gap: .35rem; background: var(--surface); border: 1px solid var(--trait); border-radius: 24px; padding: 1.15rem 1rem 1rem; min-width: 0; box-shadow: var(--ombre-carte); transition: transform .22s var(--doux), box-shadow .22s; }
.formule:hover { transform: translateY(-2px); box-shadow: var(--ombre-haute); }
.formule.avant { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 18px 40px -22px color-mix(in srgb, var(--accent) 60%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent-doux) 45%, var(--surface)), var(--surface) 55%); }
.formule.actuelle { background: var(--accent-doux); border-color: transparent; box-shadow: none; }
.formule-nom { font-weight: 600; }
.formule .equivalent { font-weight: 600; font-size: .98rem; line-height: 1.25; margin-top: .25rem; }
.formule .equivalent + .credit { margin-top: 0; font-size: .88rem; color: var(--texte-2); }
.recharge .equivalent { font-size: .85rem; font-weight: 600; line-height: 1.2; }
.formule-prix { font-family: var(--police-titre); font-size: 1.75rem; font-weight: 540; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.formule-prix small { font-family: var(--police-texte); font-size: .88rem; letter-spacing: 0; color: var(--texte-2); }
.formule p { font-size: .88rem; line-height: 1.35; color: var(--texte-2); }
.formule .credit { font-size: .98rem; color: var(--texte); margin-top: .25rem; white-space: normal; line-height: 1.2; }
.formule .btn { margin-top: auto; padding: .65rem .8rem; font-size: .95rem; }
.formule-plus { position: absolute; top: -.7rem; right: 1rem; font-size: .74rem; font-weight: 650; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-encre); border-radius: 999px; padding: .22rem .7rem; line-height: 1.3; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.recharges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.recharge { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; background: var(--surface); border: 1px solid var(--trait); border-radius: 22px; padding: 1rem .5rem .75rem; min-width: 0; box-shadow: var(--ombre-carte); transition: transform .22s var(--doux), box-shadow .22s; }
.recharge:hover { transform: translateY(-2px); box-shadow: var(--ombre-haute); }
.recharge .credit { font-family: var(--police-titre); font-size: 1.6rem; font-weight: 540; letter-spacing: -.025em; }
.recharge .credit i { width: .5em; height: .5em; }
.recharge > span:not(.credit) { font-size: .85rem; color: var(--texte-2); line-height: 1.2; }
.recharge b { font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .2rem; }
.recharge .btn { width: 100%; padding: .55rem .3rem; font-size: .88rem; margin-top: .35rem; }

/* Coût de chaque tirage */
input[type="search"] { padding: .75rem 1rem; }
.couts { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.couts-titre { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--texte-2); font-weight: 600; margin: 0 0 .3rem; }
.cout { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--trait); padding: .55rem .3rem; cursor: pointer; border-radius: 0; transition: background-color .15s; }
.cout:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.cout img { width: 40px; height: 50px; object-fit: cover; border-radius: 9px; border: 1px solid var(--trait); background: var(--surface-2); flex: none; }
.cout > span:nth-child(2) { flex: 1; min-width: 0; line-height: 1.25; font-weight: 550; }
.cout small { display: block; font-weight: 400; color: var(--texte-2); font-size: .83rem; }
.cout .credit { font-size: 1.05rem; }
.tirage-image { position: relative; display: block; }
.tirage-image .credit { position: absolute; bottom: .5rem; right: .45rem; font-size: .9rem; line-height: 1; padding: .34rem .58rem; border-radius: 999px; background: var(--verre); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--texte); box-shadow: 0 4px 12px -6px var(--ombre); }
.prix-tirage { display: flex; flex-direction: column; gap: .35rem; background: var(--surface); border: 1px solid var(--trait); border-radius: 22px; padding: .9rem 1.15rem; font-size: .95rem; line-height: 1.35; box-shadow: var(--ombre-carte); }
.prix-tirage .ligne { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.prix-tirage small { color: var(--texte-2); font-size: .86rem; }
.prix-tirage .manque { color: var(--alerte); }
.prix-tirage .btn { align-self: flex-start; margin-top: .25rem; }
.schema-prix { text-align: center; color: var(--texte-2); font-size: .95rem; margin: .6rem 0; }
@media (max-width: 400px) {
  .jauge { width: 6.8rem; }
  .jauge-nombre b { font-size: 2.2rem; }
  .solde { gap: .9rem; padding: 1rem; }
  .formule { padding: 1rem .85rem .85rem; }
  .formule-prix { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) { .formule, .recharge, .ajout, .plateau-place { transition: none; } }

/* Profil et inscription */
.deux-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.case { align-items: flex-start; line-height: 1.4; font-size: .95rem; cursor: pointer; }
.case input { flex: none; margin-top: .1rem; }
a.lien { display: inline-block; }
#bonjour { text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 550; color: var(--texte-2); }
#bonjour::before { display: none; }

.liens-bas { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; }
.champs { display: flex; flex-direction: column; gap: 1rem; }
/* La fenêtre défile : un peu de marge intérieure pour que l'anneau des champs ne soit pas rogné. */
dialog form { max-height: calc(100dvh - 6rem); overflow-y: auto; padding: 5px; margin: -5px; }
dialog .btn-plein, dialog .btn-plein:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22); }
