/* Le Cocon de Sarah — voir docs/DIRECTION_ARTISTIQUE.md
   Bleu nuit (profondeur), lavande (identité), rose poudré (accent), crème (surfaces), ambre (lumières). */
:root {
  --night: #2e3561;
  --night-2: #232a52;
  --night-3: #1a1f40;
  --ink: #2a2140;
  --lav: #b9a3e3;
  --lav-2: #8a72c4;
  --lav-soft: #ddd0f5;
  --rose: #f3b6c9;
  --rose-2: #d98ea7;
  --cream: #fff6ea;
  --linen: #f6e7cf;
  --amber: #f2b450;
  --amber-soft: #ffd98a;
  --sage: #9cc4a4;
  --live: #e05a74;
  --twitch: #8a76c2;
  --panel: #fffaf2;
  --panel-ink: #2a2140;
  --muted: #6c6385;
  --chat-w: 340px;
  --kb: 0px;
  --top-h: 54px;
  --font: ui-rounded, 'Nunito', 'Quicksand', 'Segoe UI', system-ui, sans-serif;
  font-family: var(--font);
  color-scheme: light;

  /* ---- Jetons d'interface (thème Clair = rendu d'origine) ----
     Surfaces des panneaux, textes, contours, boutons, champs, états, statuts.
     Le thème Nuit (html[data-theme='nuit']) ne redéfinit QUE ces jetons. */
  --surface: var(--panel);          /* fenêtres, menus, chat, notifications */
  --surface-raised: #ffffff;        /* cartes et lignes posées sur un panneau */
  --surface-hover: #fbf6ff;
  --surface-warm: #fff4e4;          /* en-têtes du chat */
  --text: var(--ink);               /* texte principal sur les panneaux */
  --text-soft: #4a4064;
  --accent-text: #6a4f9a;
  --outline: var(--ink);            /* contours « dessinés » */
  --shadow-hard: var(--ink);        /* ombres pleines sous boutons et cartes */
  --line: #d9cfe8;                  /* séparateurs fins */
  --btn-bg: var(--cream);
  --btn-hover: #ffffff;
  --btn-primary: var(--rose);
  --btn-primary-hover: #f8c7d6;
  --btn-primary-text: var(--ink);
  --btn-lav: var(--lav-soft);
  --btn-danger: #f5b2bf;
  --btn-danger-text: var(--ink);
  --chip-bg: var(--lav-soft);       /* pastilles, compteurs, sélections douces */
  --hi-bg: var(--amber-soft);       /* bouton enfoncé, rôle, bandeau d'avertissement */
  --field-bg: #ffffff;
  --field-text: var(--ink);
  --field-placeholder: #8a8199;
  --tint-lav: #f3ecff;              /* encarts d'information */
  --tint-rose: #ffe9f0;
  --tint-amber: #fff3d6;
  --tint-sage: #dcf5e3;
  --ok-text: #3d7a55;
  --warn-text: #8a5a00;
  --err-text: #8c1d36;
  --err-bg: #ffe1e7;
  --code-bg: rgba(42, 33, 64, 0.08);
  --stage-in: #e9def8;              /* fond des aperçus d'avatar (vestiaire, profil) */
  --stage-out: #ffffff;
  --backdrop: rgba(20, 16, 41, 0.6);
  --scroll-thumb: #c9bde3;
  --scroll-track: transparent;
}

/* ---- Thème Nuit : bleu nuit, surfaces prune / lavande sombre, texte crème doux ----
   Appliqué par js/theme-boot.js avant le premier affichage (data-theme sur <html>). */
html[data-theme='nuit'] {
  color-scheme: dark;
  --panel: #2a2244;
  --panel-ink: #f4e9da;
  --muted: #bdb0d6;
  --surface-raised: #342a55;
  --surface-hover: #3f3466;
  --surface-warm: #322849;
  --text: #f4e9da;
  --text-soft: #d6cbe8;
  --accent-text: #cdb8ff;
  --outline: #5a4b85;
  --shadow-hard: #120e24;
  --line: #43396a;
  --btn-bg: #3a3060;
  --btn-hover: #463a72;
  --btn-primary: #a95f80;
  --btn-primary-hover: #b86d8e;
  --btn-primary-text: #fff6ea;
  --btn-lav: #4a3d7a;
  --btn-danger: #7c3046;
  --btn-danger-text: #ffe8ee;
  --chip-bg: #463a72;
  --hi-bg: #5c4620;
  --field-bg: #1d1834;
  --field-text: #f4e9da;
  --field-placeholder: #9d92b8;
  --tint-lav: #352b5c;
  --tint-rose: #4a2a40;
  --tint-amber: #463a1f;
  --tint-sage: #23463a;
  --ok-text: #8fd6a6;
  --warn-text: #f2c46b;
  --err-text: #ffa3b6;
  --err-bg: #4b2230;
  --code-bg: rgba(255, 246, 234, 0.1);
  --stage-in: #4a3d78;
  --stage-out: #241d3e;
  --backdrop: rgba(8, 6, 20, 0.62);
  --scroll-thumb: #56487f;
  --scroll-track: #1d1834;
}
/* Barres de défilement assorties au thème (Firefox, puis Chrome/Edge/Safari) */
* { scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
html[data-theme='nuit'] ::selection { background: #6b55a8; color: #fff6ea; }
/* Changement de thème : courte transition, coupée si les animations sont réduites */
html.theme-switch, html.theme-switch * { transition: background-color .18s ease, border-color .18s ease, color .18s ease !important; }
@media (prefers-reduced-motion: reduce) { html.theme-switch, html.theme-switch * { transition: none !important; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night-3); color: var(--cream); overscroll-behavior: none; }
body { -webkit-tap-highlight-color: transparent; overflow: hidden; }
body.on-landing { overflow-y: auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.fine { font-size: 13px; line-height: 1.45; }
.spacer { flex: 1; }
.topbar .spacer { flex: 0 1 auto; }
a { color: inherit; }
code { background: var(--code-bg); border-radius: 4px; padding: 0 4px; }
img.px-icon, canvas.symbol-canvas, .px { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- Boutons : normal / survol / appui / focus / désactivé ---------- */
.btn {
  font: inherit; font-weight: 800; font-size: 14px; letter-spacing: 0.1px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 2px solid var(--outline); background: var(--btn-bg); color: var(--text);
  box-shadow: 0 3px 0 var(--shadow-hard); cursor: pointer; text-decoration: none; user-select: none;
  transition: transform 0.06s, box-shadow 0.06s, background-color 0.15s;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow-hard); }
.btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: 0 3px 0 var(--shadow-hard); }
.btn.primary { background: var(--btn-primary); color: var(--btn-primary-text); }
.btn.primary:hover { background: var(--btn-primary-hover); }
.btn.lav { background: var(--btn-lav); }
.btn.danger { background: var(--btn-danger); color: var(--btn-danger-text); }
.btn.twitch { background: var(--twitch); color: #fff; }
.btn.twitch:hover { background: #9886d0; }
.btn.big { min-height: 54px; font-size: 17px; padding: 0 24px; border-radius: 16px; }
.btn.small { min-height: 36px; padding: 0 11px; font-size: 13px; box-shadow: 0 2px 0 var(--shadow-hard); }
.btn.round { width: 44px; padding: 0; border-radius: 50%; font-size: 20px; }
.btn.on, .btn[aria-pressed='true'] { background: var(--hi-bg); }
.btn.icon-only { width: 38px; padding: 0; }
.btn .px-icon { width: 24px; height: 24px; flex: none; }
.btn.small .px-icon { width: 20px; height: 20px; }

.pill { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 99px; border: 2px solid var(--outline); }
.pill.live { background: var(--live); color: #fff; }
.sim-badge { display: inline-block; background: var(--hi-bg); color: var(--text); font-weight: 800; font-size: 12px; padding: 3px 8px; border-radius: 6px; border: 2px solid var(--outline); }

input, select, textarea {
  font: inherit; font-size: 16px; color: var(--field-text); background: var(--field-bg);
  border: 2px solid var(--outline); border-radius: 10px; padding: 8px 10px; min-height: 44px; width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--amber); }
::placeholder { color: var(--field-placeholder); opacity: 1; }
/* cases à cocher et boutons radio : taille native (pas étirés comme un champ texte), couleur du thème */
input[type='checkbox'], input[type='radio'] { width: 20px; height: 20px; min-height: 0; padding: 0; vertical-align: -4px; accent-color: var(--lav-2); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; cursor: not-allowed; }
label { font-weight: 800; font-size: 14px; display: block; margin: 10px 0 4px; }
.row { display: flex; gap: 8px; align-items: center; }
.form-error { background: var(--err-bg); color: var(--err-text); border: 2px solid var(--live); border-radius: 10px; padding: 8px 10px; font-size: 14px; }

/* ---------- Écrans ---------- */
.screen { position: fixed; inset: 0; }
.loading { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #3b3470, var(--night-2) 60%, var(--night-3)); }
.loading-card { text-align: center; padding: 24px; max-width: 360px; }
.symbol-canvas { width: 96px; height: 96px; }
.symbol-canvas.small { width: 32px; height: 32px; }
.symbol-canvas.big { width: 112px; height: 112px; }
#loading-symbol { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-4px); } }
.loading-title { font-size: 24px; font-weight: 900; margin: 10px 0 2px; }
.loading-text { color: var(--lav-soft); margin: 0 0 14px; }

/* ---------- Jeu ---------- */
.game { display: flex; flex-direction: column; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.topbar {
  display: flex; align-items: center; gap: 8px; min-height: var(--top-h);
  padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top));
  background: linear-gradient(var(--night), var(--night-2)); border-bottom: 3px solid var(--outline); z-index: 5;
}
.topnav { display: flex; gap: 6px; }
.icon-btn .lbl { display: none; }
@media (min-width: 1200px) { .icon-btn .lbl { display: inline; } }
.icon-btn { padding: 0 10px; }
.room-title { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; flex: 1 1 auto; }
.room-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; font-size: 15.5px; }
.room-title .muted { color: var(--lav-soft); opacity: 0.85; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-banner { background: var(--hi-bg); color: var(--text); font-weight: 800; font-size: 12px; text-align: center; padding: 3px 8px; border-bottom: 2px solid var(--outline); }
.announce { background: var(--chip-bg); color: var(--text); padding: 7px 12px; font-size: 14px; border-bottom: 2px solid var(--outline); display: flex; gap: 10px; align-items: center; }
.announce strong { white-space: nowrap; }
.jail-banner { background: #2e3561; color: #fff6ea; padding: 7px 12px; font-size: 14px; border-bottom: 2px solid var(--lav); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.jail-banner strong { color: var(--lav-soft); }
.jail-banner b { color: #fff; font-variant-numeric: tabular-nums; }
.jail-banner .fine { color: var(--lav-soft); opacity: 0.85; }
body.jailed #btn-nav, body.jailed #act-react, body.jailed .quick-slot { opacity: 0.45; }
.quick-slots { display: contents; }
.quick-slot .emo { font-size: 18px; line-height: 1; }
.actionbar .quick-slot span.emo { display: inline; } /* téléphone : les libellés sont masqués, pas l'emoji */
.quick-slot canvas { width: 24px; height: 24px; image-rendering: pixelated; }
.react-menu .quick-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.react-menu .quick-head .sep { margin: 0; }
.react-menu .quick-edit { min-height: 32px; flex-direction: row; font-size: 12px; }
.react-menu .quick-hint { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--muted); }
.react-menu button[aria-checked='true'] { box-shadow: 0 0 0 2px var(--lav-2); }
.react-menu .car-toggle { grid-column: 1 / -1; flex-direction: row; gap: 8px; min-height: 40px; }

.main { flex: 1; display: flex; min-height: 0; position: relative; }
.stage-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.stage { flex: 1; position: relative; min-height: 0; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.zoom-ctrl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 8px; }
.actionbar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: max(10px, env(safe-area-inset-bottom));
  display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: 18px;
  background: var(--night-2); border: 2px solid var(--outline); box-shadow: 0 3px 0 var(--shadow-hard);
  max-width: calc(100% - 20px); overflow-x: auto; scrollbar-width: none;
}
.actionbar .btn { min-height: 44px; white-space: nowrap; padding: 0 12px; }
.reacts { display: flex; gap: 4px; }
.react-btn { width: 44px; padding: 0; }
.react-btn canvas { width: 27px; height: 27px; image-rendering: pixelated; }
.chat-toggle { display: none; }

/* Salon du Live : le vrai lecteur Twitch, jamais recouvert */
.cinema { background: radial-gradient(ellipse at 50% 0%, #4b2a4a, #1c1630 70%); border-bottom: 3px solid var(--outline); padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.cinema-frame {
  position: relative; width: min(100%, calc((52vh - 60px) * 16 / 9)); min-width: min(400px, 100%); aspect-ratio: 16 / 9; min-height: 0;
  border: 6px solid #3b2f52; border-radius: 10px; background: #0d0b18;
  box-shadow: 0 0 0 3px var(--outline), 0 0 30px rgba(185, 163, 227, 0.25);
}
body.is-live .cinema-frame { box-shadow: 0 0 0 3px var(--outline), 0 0 36px rgba(224, 90, 116, 0.35); }
.cinema-frame::before, .cinema-frame::after { content: ''; position: absolute; top: -12px; bottom: -8px; width: 26px; z-index: -1; background: repeating-linear-gradient(90deg, #8e3b5c 0 6px, #6c2945 6px 10px); border-radius: 6px; }
.cinema-frame::before { left: -30px; }
.cinema-frame::after { right: -30px; }
.marquee { position: absolute; top: -10px; left: 8%; right: 8%; height: 6px; background: radial-gradient(circle, var(--amber-soft) 2px, transparent 3px) 0 0 / 14px 6px; opacity: 0.55; }
body.is-live .marquee { opacity: 1; }
.player-slot, .player-slot iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-offline, .player-start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; background: radial-gradient(circle at 50% 40%, #2e3561, #141029); }
.player-offline p { margin: 4px 0; }
.big-moon { width: 46px; height: 46px; border-radius: 50%; box-shadow: inset -12px -6px 0 0 #fff1c8; transform: rotate(-20deg); }
.cinema-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; max-width: 900px; }
.cinema-tools .fine { color: var(--lav-soft); opacity: 0.8; }
.cinema.collapsed .cinema-frame { display: none; }
/* Option « Live au-dessus du chat » (ordinateur) : le lecteur passe dans la colonne du chat et la salle garde toute sa
   hauteur. Placement par grille (le bloc du lecteur ne change pas de place dans la page : l'iframe Twitch n'est pas rechargée). */
@media (max-width: 900px) and (orientation: landscape) { #btn-player-side { display: none; } } /* horizontal : disposition inchangée */
@media (min-width: 901px) {
  body.live-side .main { display: grid; grid-template-columns: minmax(0, 1fr) auto clamp(424px, var(--chat-w), 60vw); grid-template-rows: auto minmax(0, 1fr) auto; }
  body.live-side .stage-wrap { display: contents; }
  body.live-side .stage { grid-column: 1; grid-row: 1 / 3; }
  body.live-side .mainnav { grid-column: 1; grid-row: 3; }
  body.live-side .resizer { grid-column: 2; grid-row: 1 / 4; }
  body.live-side .cinema { grid-column: 3; grid-row: 1; min-width: 0; padding: 12px 12px 8px; container-type: inline-size; }
  body.live-side .chat-panel { grid-column: 3; grid-row: 2 / 4; width: auto; min-width: 0; max-width: none; min-height: 0; }
  /* 400 × 300 au minimum (taille minimale du lecteur officiel Twitch) */
  body.live-side .cinema-frame { width: 100%; min-width: 0; aspect-ratio: auto; height: max(300px, calc((100cqw - 24px) * 9 / 16)); }
  body.live-side .cinema-frame::before, body.live-side .cinema-frame::after, body.live-side .cinema-tools .fine, body.live-side #btn-watch { display: none; }
}
/* Même option sur téléphone (portrait) : la salle en haut, jamais recouverte ; le lecteur devient la tête d'un tiroir
   « live + chat » en bas. Chat replié = lecteur seul (derniers messages en bulles sur la salle), déplié = lecteur + chat,
   « Regarder et discuter » = chat agrandi. Ordre visuel seulement : l'iframe n'est pas rechargée. */
.chat-float { display: none; }
@media (max-width: 900px) and (orientation: portrait) {
  body.live-side .stage-wrap { display: contents; }
  body.live-side .stage { order: 1; flex: 1 1 0; min-height: 110px; }
  body.live-side .cinema { order: 2; flex: none; padding: 0; gap: 0; border-bottom: 0; border-top: 3px solid var(--outline); border-radius: 16px 16px 0 0; overflow: hidden; box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.3); position: relative; z-index: 2; }
  body.live-side .cinema-frame { width: 100%; min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
  body.live-side .marquee { display: none; }
  body.live-side .cinema-tools { width: 100%; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding: 5px 8px; gap: 6px; }
  body.live-side .cinema-tools .btn { flex: none; min-height: 32px; font-size: 13px; padding: 0 10px; }
  /* le chat cède de la hauteur avant la salle sur les petits écrans */
  body.live-side .chat-panel { order: 3; position: static; height: auto; flex: 0 1 clamp(170px, 30vh, 270px); min-height: 118px; border-top: 0; border-radius: 0; box-shadow: none; }
  body.live-side .chat-panel.collapsed { flex: none; min-height: 0; }
  body.live-side .chat-head { padding: 4px 10px; }
  body.live-side #chat-sub, body.live-side .chat-rule { display: none; } /* la règle reste dans le fil du chat */
  body.live-side .chat-form { padding-bottom: 6px; }
  body.live-side .chat-hint { font-size: 11.5px; line-height: 1.3; padding-bottom: 6px; min-height: 0; }
  body.live-side.watch .chat-panel { flex: 1 1 auto; }
  body.live-side:not(.chat-open):not(.watch) .chat-float { display: flex; }
  .chat-float { position: absolute; left: 8px; bottom: 74px; max-width: min(78%, 330px); flex-direction: column; gap: 4px; pointer-events: none; z-index: 3; }
  .chat-float .msg { font-size: 12.5px; line-height: 1.35; padding: 3px 9px; border-radius: 10px; background: rgba(23, 26, 54, 0.82); border: 1px solid rgba(185, 163, 227, 0.45); color: #f3eefc; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; animation: float-in 0.25s ease-out; }
  .chat-float .msg .ts, .chat-float .msg .status, .chat-float .msg .reason, .chat-float .msg .ingame, .chat-float .msg .badge, .chat-float .msg .badge-txt { display: none; }
}
@keyframes float-in { from { opacity: 0; transform: translateY(6px); } }

/* Chat */
.resizer { width: 8px; cursor: col-resize; background: var(--ink); touch-action: none; }
.resizer:hover, .resizer:focus-visible { background: var(--lav-2); outline: none; }
.chat-panel { width: var(--chat-w); min-width: 260px; max-width: 60vw; display: flex; flex-direction: column; background: var(--panel); color: var(--panel-ink); }
.chat-head { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 2px solid var(--lav); background: var(--surface-warm); }
.chat-head > div:first-child { flex: 1; min-width: 0; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.chip { font-size: 11px; font-weight: 800; background: var(--chip-bg); border: 1.5px solid var(--lav-2); border-radius: 99px; padding: 1px 7px; color: var(--text); }
#chat-collapse { display: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 8px 10px; font-size: 14.5px; line-height: 1.45; overscroll-behavior: contain; }
.msg { padding: 3px 4px; border-radius: 6px; word-wrap: break-word; overflow-wrap: anywhere; }
.msg + .msg { margin-top: 2px; }
.msg .who { font-weight: 800; }
.like-row { margin: 6px 0; }
/* Style du pseudo : reflet sur la couleur choisie (niveau 10), couleurs changeantes « Aurore » (niveau 50), arc-en-ciel
   (exclusivité). Figé si l'appareil réduit les animations ou en mode calme. */
.name-reflet, .name-arcenciel { background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: name-shine 3.2s linear infinite; }
.name-reflet { background-image: linear-gradient(100deg, var(--nc) 35%, #fff6ea 50%, var(--nc) 65%); }
.name-arcenciel { background-image: linear-gradient(90deg, #e05a5a, #e8962e, #c9b22a, #3fae5e, #3f8fd8, #8a62d8, #d65aa8, #e05a5a); animation-duration: 2.6s; }
html[data-theme='nuit'] .name-arcenciel { background-image: linear-gradient(90deg, #ff8a8a, #ffc46b, #fff08a, #8fe39a, #7fd0ff, #b79cff, #ff9ad5, #ff8a8a); }
.name-aurore { animation: name-aurore 9s ease-in-out infinite; }
html[data-theme='nuit'] .name-aurore { animation-name: name-aurore-nuit; }
@keyframes name-shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes name-aurore { 0%, 100% { color: #7a62b8; } 17% { color: #c46f8e; } 33% { color: #a8771f; } 50% { color: #3f9a80; } 67% { color: #3f86b8; } 83% { color: #b04472; } }
@keyframes name-aurore-nuit { 0%, 100% { color: #c9bbe7; } 17% { color: #f0c5d3; } 33% { color: #ecd2a4; } 50% { color: #afdacd; } 67% { color: #acd2ec; } 83% { color: #e6aac3; } }
@media (prefers-reduced-motion: reduce) { .name-reflet, .name-arcenciel { animation: none; -webkit-text-fill-color: currentColor; background: none; } .name-aurore { animation: none; } }
body.calm .name-reflet, body.calm .name-arcenciel, body.calm .name-aurore { animation: none; }
/* Lueur (niveau 30) : halo de la couleur du pseudo qui s'allume et s'apaise. Fondu (niveau 48) : une vague de fondu
   traverse les lettres de gauche à droite (masque), puis courte pause. */
.name-lueur { animation: name-lueur 2.8s ease-in-out infinite; }
@keyframes name-lueur { 0%, 100% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 0 0 5px currentColor, 0 0 11px currentColor; } }
.name-fondu { -webkit-mask-image: linear-gradient(90deg, #000 0 35%, rgba(0, 0, 0, 0.2) 50%, #000 65% 100%); mask-image: linear-gradient(90deg, #000 0 35%, rgba(0, 0, 0, 0.2) 50%, #000 65% 100%); -webkit-mask-size: 300% 100%; mask-size: 300% 100%; animation: name-fondu 3.6s ease-in-out infinite; }
@keyframes name-fondu { 0% { -webkit-mask-position: 100% 0; mask-position: 100% 0; } 75%, 100% { -webkit-mask-position: 0% 0; mask-position: 0% 0; } }
@media (prefers-reduced-motion: reduce) { .name-lueur, .name-fondu { animation: none; } .name-fondu { -webkit-mask-image: none; mask-image: none; } }
body.calm .name-lueur, body.calm .name-fondu { animation: none; }
body.calm .name-fondu { -webkit-mask-image: none; mask-image: none; }
.level-row { margin: 6px 0; }
.level-bar { height: 8px; border-radius: 4px; background: var(--chip-bg); border: 1px solid var(--outline); overflow: hidden; margin-top: 4px; max-width: 220px; }
.level-bar > span { display: block; height: 100%; background: var(--lav); }
.ns-card .ns-preview { display: flex; justify-content: center; padding: 14px 8px; margin: 8px 0 4px; border-radius: 12px; background: radial-gradient(120% 140% at 50% 0%, #3b2f5c, #241c38); }
.ns-plate { display: inline-block; padding: 2px 10px; border-radius: 9px; background: rgba(42, 33, 64, 0.88); font-weight: 700; font-size: 15px; color: #fff6ea; }
.ns-plate span { color: #fff6ea; }
.ns-plate .name-aurore, .tag-pill .name-aurore, .on-plate.name-aurore { animation-name: name-aurore-nuit; }
.on-plate.name-arcenciel { background-image: linear-gradient(90deg, #ff8a8a, #ffc46b, #fff08a, #8fe39a, #7fd0ff, #b79cff, #ff9ad5, #ff8a8a); }
.ns-card .ns-preview + .ns-label { margin-top: 4px; }
.ns-card .ns-label { display: block; margin: 10px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ns-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ns-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--outline); padding: 0; cursor: pointer; }
.ns-swatch[aria-pressed='true'] { outline: 3px solid var(--amber); outline-offset: 1px; }
.ns-swatch.none { background: repeating-linear-gradient(135deg, #fff6ea 0 4px, #d9cfe9 4px 8px); }
.ns-fx { display: flex; flex-wrap: wrap; gap: 6px; }
.ns-fx .btn { display: inline-flex; align-items: center; gap: 6px; }
.ns-fx .btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.ns-fx small { white-space: nowrap; font-size: 10.5px; font-weight: 800; padding: 0 6px; border-radius: 99px; background: var(--chip-bg); color: var(--muted); }
.ns-fx .ns-excl small { background: linear-gradient(90deg, #ff8a8a, #ffc46b, #8fe39a, #7fd0ff, #b79cff); color: #2a2140; }
.shop-name { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 9px; border-radius: 9px; background: rgba(42, 33, 64, 0.88); color: #fff6ea; font-weight: 800; font-size: 13px; }
.shop-name.grand { font-size: 20px; padding: 6px 16px; border-radius: 12px; }
.shop-name .name-aurore { animation-name: name-aurore-nuit; }
@media (max-width: 520px) { .ns-swatch { width: 34px; height: 34px; } .ns-fx .btn { flex: 1 1 calc(50% - 6px); justify-content: center; } .ns-fx .btn:has(small) { flex-basis: 100%; } }
.like-heart { color: var(--accent-text); font-weight: 900; }
.like-btn.on { background: var(--btn-primary); }
.msg .ts { color: var(--muted); font-size: 11px; font-weight: 700; margin-right: 5px; font-variant-numeric: tabular-nums; }
.hide-ts .msg .ts { display: none; }
.msg .badge { width: 18px; height: 18px; vertical-align: -3px; margin-right: 2px; }
.msg .badge-txt { font-size: 10px; font-weight: 800; background: var(--chip-bg); border-radius: 4px; padding: 0 3px; margin-right: 3px; }
.msg .emote { height: 24px; vertical-align: -6px; }
.msg .mention { font-weight: 700; background: var(--tint-rose); border-radius: 4px; padding: 0 2px; }
.msg.system { color: var(--muted); font-style: italic; font-size: 13px; }
.msg.mine { background: var(--tint-lav); }
.msg .status { font-size: 11.5px; font-weight: 800; margin-left: 6px; white-space: nowrap; }
.msg .status.pending { color: var(--muted); }
.msg .status.sent { color: var(--ok-text); }
.msg .status.refused { color: var(--live); }
.msg .status.unknown { color: var(--warn-text); }
.msg.refused .text { text-decoration: line-through; opacity: 0.6; }
.msg .reason { display: block; font-size: 12.5px; color: var(--err-text); }
.msg .reason.warn { color: var(--warn-text); }
.msg .retry { margin-top: 3px; }
.msg .ingame { font-size: 10px; font-weight: 800; color: #fff; background: var(--lav-2); border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
.msg .reply { display: block; font-size: 12px; color: var(--muted); }
.msg.deleted .text { font-style: italic; color: var(--muted); }
.tw-cta { margin: 0 10px 8px; padding: 10px; border-radius: 12px; background: var(--tint-lav); border: 2px solid var(--twitch); font-size: 13.5px; }
.tw-cta p { margin: 0 0 8px; }
.chat-form { display: flex; gap: 6px; padding: 8px 10px 4px; }
.chat-form input { flex: 1; min-width: 0; }
.chat-hint { padding: 0 10px 8px; color: var(--muted); min-height: 18px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.chat-hint .who-send { font-weight: 800; color: var(--twitch); }
/* Live de Sarah : Twitch, seul canal de discussion (onglets, règle, brouillon mis de côté) */
.chat-tabs { display: flex; gap: 4px; padding: 6px 10px 0; background: var(--surface-warm); border-bottom: 2px solid var(--lav); }
.chat-tab { flex: 1; font: inherit; font-size: 13px; font-weight: 800; padding: 6px 8px; border: 2px solid var(--lav); border-bottom: none; border-radius: 10px 10px 0 0; background: var(--panel); color: var(--muted); cursor: pointer; }
.chat-tab[aria-selected="true"] { background: var(--tint-lav); color: var(--text); border-color: var(--twitch); }
#tab-twitch[aria-selected="true"] { color: var(--accent-text); }
.chat-tab[hidden], .chat-tab .tab-count[hidden], .chat-tab .tab-pause[hidden] { display: none; }
.msg .gc-room { font-size: 11px; color: var(--muted); }
.chat-rule { margin: 8px 10px 0; padding: 8px 10px; border-radius: 12px; background: var(--tint-rose); border: 2px solid var(--rose-2); font-size: 13.5px; font-weight: 700; }
.chat-rule.provisional { background: var(--tint-amber); border-color: var(--amber); }
.chat-draft { margin: 0 10px 8px; padding: 8px 10px; border-radius: 12px; background: var(--tint-amber); border: 2px dashed var(--amber); font-size: 13px; }
.chat-draft p { margin: 0 0 6px; }
.chat-draft q { display: block; font-style: italic; margin-bottom: 6px; overflow-wrap: anywhere; }
.chat-draft .row { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-form input:disabled { opacity: 0.7; cursor: not-allowed; }

/* Barre d'édition */
.edit-bar { position: absolute; left: 10px; top: 10px; right: 64px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; background: var(--panel); color: var(--text); padding: 8px; border-radius: 14px; border: 2px solid var(--outline); box-shadow: 0 3px 0 var(--shadow-hard); }
.edit-bar .title { font-weight: 900; margin-right: 6px; }
.edit-bar .err { color: var(--live); font-size: 13px; font-weight: 800; flex-basis: 100%; }

/* Menu contextuel, info-bulle, visite guidée, mode photo */
.ctx-menu { position: fixed; z-index: 40; min-width: 200px; max-width: min(280px, calc(100vw - 16px)); background: var(--panel); color: var(--text); border: 2px solid var(--outline); border-radius: 14px; box-shadow: 0 4px 0 var(--shadow-hard); padding: 6px; }
.ctx-menu .ctx-head { padding: 6px 8px 8px; border-bottom: 2px solid var(--lav-soft); margin-bottom: 4px; }
.ctx-menu .ctx-head strong { display: block; font-size: 15px; }
.ctx-menu .ctx-head span { font-size: 12px; color: var(--muted); }
.ctx-menu button { display: flex; width: 100%; align-items: center; gap: 8px; min-height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-weight: 700; font-size: 14px; color: var(--text); cursor: pointer; text-align: left; }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--chip-bg); outline: none; }
.ctx-menu button.danger { color: var(--err-text); }
.ctx-menu .ctx-turn { display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 4px 0 10px; font-weight: 700; font-size: 14px; }
.ctx-menu .ctx-turn span { flex: 1; }
.ctx-menu .ctx-turn .ctx-turn-btn { flex: none; width: 44px; min-height: 36px; justify-content: center; padding: 0; font-size: 20px; line-height: 1; background: var(--chip-bg); }
.tip { position: fixed; z-index: 35; pointer-events: none; background: var(--ink); color: var(--cream); border-radius: 10px; padding: 6px 10px; font-size: 13px; max-width: 260px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); }
.tip strong { display: block; font-size: 13.5px; }
.tip span { color: var(--lav-soft); }
.tour { position: absolute; left: 12px; top: calc(var(--top-h) + 12px); z-index: 20; width: min(300px, calc(100vw - 24px)); background: var(--panel); color: var(--text); border: 2px solid var(--outline); border-radius: 16px; box-shadow: 0 4px 0 var(--shadow-hard); padding: 12px 14px; }
.tour h3 { margin: 0 0 6px; font-size: 15px; }
.tour ol { margin: 0 0 8px; padding-left: 20px; font-size: 14px; }
.tour li { margin: 3px 0; }
.tour li.done { color: var(--ok-text); text-decoration: line-through; }
.tour li.now { font-weight: 800; }
.photo-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 45; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; background: var(--night-2); border: 2px solid var(--outline); border-radius: 16px; padding: 8px; box-shadow: 0 3px 0 var(--shadow-hard); max-width: calc(100vw - 16px); }
body.photo .topbar, body.photo .actionbar, body.photo .zoom-ctrl, body.photo .chat-panel, body.photo .resizer, body.photo .sim-banner, body.photo .announce, body.photo .cinema, body.photo .tour, body.photo .edit-bar { display: none !important; }

/* Connexion & notifications */
.conn { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--top-h) + 10px + env(safe-area-inset-top)); z-index: 50; background: var(--hi-bg); color: var(--text); border: 2px solid var(--outline); border-radius: 12px; padding: 8px 12px; display: flex; gap: 10px; align-items: center; font-weight: 800; box-shadow: 0 3px 0 var(--shadow-hard); max-width: calc(100vw - 16px); }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; z-index: 60; pointer-events: none; width: min(92vw, 420px); transition: bottom 0.2s; }
.toast { background: var(--panel); color: var(--text); border: 2px solid var(--outline); border-radius: 12px; padding: 9px 12px; font-size: 14px; box-shadow: 0 3px 0 var(--shadow-hard); animation: pop 0.18s ease-out; pointer-events: auto; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.toast.error { background: var(--err-bg); }
.toast.live { background: var(--tint-rose); border-color: var(--live); }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }

/* Fenêtres */
.modal { width: min(600px, calc(100vw - 16px)); max-height: min(88vh, 780px); padding: 0; border: 3px solid var(--outline); border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: 0 6px 0 var(--shadow-hard); overflow: hidden; }
.modal.wide { width: min(820px, calc(100vw - 16px)); }
.modal[open] { display: flex; flex-direction: column; animation: pop 0.16s ease-out; }
.modal::backdrop { background: var(--backdrop); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 2px solid var(--lav); background: var(--tint-lav); }
.modal-head h2 { margin: 0; font-size: 19px; flex: 1; }
.modal-back { flex: none; white-space: nowrap; }
.modal-back[hidden] { display: none; }
/* Téléphone : le bouton Retour et la croix sur une ligne, le titre en dessous */
@media (max-width: 560px) {
  .modal-head:has(.modal-back:not([hidden])) { flex-wrap: wrap; row-gap: 10px; }
  .modal-head:has(.modal-back:not([hidden])) #modal-close { order: 1; margin-left: auto; }
  .modal-head:has(.modal-back:not([hidden])) h2 { order: 2; flex-basis: 100%; }
}
.modal-body { overflow-y: auto; padding: 12px 16px 18px; overscroll-behavior: contain; }
.modal-body h3 { margin: 14px 0 6px; font-size: 15px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.room-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-row .room-item { flex: 1 1 220px; min-width: 0; }
/* Mes chambres : « Éditeur » et « Supprimer » passent sous la chambre quand la place manque (téléphone) */
@media (max-width: 480px) { .room-row > .btn { flex: 1; } }
.room-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--outline); border-radius: 14px; background: var(--surface-raised); cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; box-shadow: 0 2px 0 var(--shadow-hard); }
.room-item:hover, .room-item:focus-visible { background: var(--surface-hover); outline: none; box-shadow: 0 2px 0 var(--shadow-hard), 0 0 0 3px var(--amber-soft); }
.room-item .info { flex: 1; min-width: 0; }
.room-item .info strong { display: block; font-size: 15px; }
.room-item .info span { font-size: 13px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .count { font-weight: 800; font-size: 13px; white-space: nowrap; background: var(--chip-bg); border-radius: 99px; padding: 3px 9px; }
.room-item .count.full { background: var(--err-bg); color: var(--err-text); }
.room-item .room-thumb { width: 40px; height: 40px; flex: none; }
.dot-live { display: inline-block; width: 9px; height: 9px; background: var(--live); border-radius: 50%; margin-right: 5px; }
.profile { display: flex; gap: 14px; align-items: flex-start; }
.profile canvas { width: 80px; height: 155px; image-rendering: pixelated; background: radial-gradient(circle at 50% 75%, var(--stage-in), var(--stage-out)); border-radius: 14px; border: 2px solid var(--outline); flex: none; }
.profile canvas.kit-portrait { image-rendering: auto; }
.profile .role { font-size: 12px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--hi-bg); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.item-card { border: 2px solid var(--outline); border-radius: 12px; background: var(--surface-raised); padding: 6px; text-align: center; font: inherit; font-size: 12.5px; cursor: pointer; color: inherit; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 124px; box-shadow: 0 2px 0 var(--shadow-hard); }
.item-card:hover, .item-card:focus-visible { box-shadow: 0 2px 0 var(--shadow-hard), 0 0 0 3px var(--amber-soft); outline: none; }
.item-card canvas { width: 92px; height: 72px; object-fit: scale-down; object-position: center bottom; image-rendering: pixelated; } /* vignettes posées sur une même ligne de sol */
.item-card .qty { font-weight: 800; color: var(--twitch); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table td, .table th { border-bottom: 1px solid var(--lav-soft); padding: 5px 4px; text-align: left; vertical-align: top; }
.notice-box { background: var(--tint-lav); border: 2px solid var(--twitch); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.notice-box ul { margin: 6px 0; padding-left: 18px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--lav-soft); }
.setting div { min-width: 0; }
.setting strong { display: block; font-size: 14.5px; }
.setting span { font-size: 13px; color: var(--muted); }
.help-list { margin: 6px 0; padding-left: 20px; font-size: 14.5px; line-height: 1.55; }
.announce-card { border: 2px solid var(--outline); border-radius: 12px; background: var(--surface-raised); padding: 10px 12px; margin-bottom: 8px; }
.announce-card .meta { font-size: 12px; color: var(--muted); }

/* Vestiaire */
.wardrobe { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; }
.wardrobe .stagebox { display: flex; flex-direction: column; align-items: center; gap: 8px; position: sticky; top: 0; align-self: start; }
.wardrobe .stagebox canvas { width: 160px; height: 290px; background: radial-gradient(ellipse at 50% 85%, var(--stage-in) 0 30%, var(--stage-out) 70%); border: 2px solid var(--outline); border-radius: 18px; image-rendering: pixelated; }
.wardrobe .rot { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.wardrobe .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.thumb-opt { width: 70px; padding: 4px 2px 2px; border: 2px solid var(--outline); border-radius: 12px; background: var(--surface-raised); cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.thumb-opt canvas { image-rendering: pixelated; max-width: 100%; }
.thumb-opt[aria-pressed='true'], .swatch[aria-pressed='true'], .outfit[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--amber); }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--outline); cursor: pointer; padding: 0; }
.outfit { width: 96px; padding: 6px 4px; border: 2px solid var(--outline); border-radius: 14px; background: var(--surface-raised); cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.outfit canvas { image-rendering: pixelated; }
.swatch-origin { background: repeating-linear-gradient(135deg, #fff 0 5px, #e7def3 5px 10px); }
.look-collection { margin: 6px 0; }
.look-collection > summary { cursor: pointer; font-weight: 800; padding: 6px 2px; }
.look-collection .outfit { width: 104px; }
.opt-group { margin-bottom: 10px; }
.opt-group > strong { display: block; font-size: 13.5px; margin-bottom: 6px; }

/* ---------- Téléphone & tablette étroite ---------- */
@media (max-width: 900px) {
  :root { --top-h: 52px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 6px; }
  .hero-scene { order: -1; }
  .symbol-canvas.big { width: 72px; height: 72px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .topbar .lbl { display: none; }
  .topbar #btn-nav .lbl { display: inline; }
  .topnav { gap: 4px; }
  .topnav .btn { width: 42px; padding: 0; min-height: 40px; }
  .resizer { display: none; }
  .main { flex-direction: column; }
  .chat-panel {
    position: absolute; left: 0; right: 0; bottom: var(--kb); width: auto; max-width: none; min-width: 0;
    height: min(46%, 380px); border-top: 3px solid var(--outline); border-radius: 18px 18px 0 0; z-index: 8;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.3); transition: height 0.2s;
  }
  .chat-panel.collapsed { height: auto; }
  .chat-panel.collapsed .chat-log, .chat-panel.collapsed .chat-tabs, .chat-panel.collapsed .chat-draft, .chat-panel.collapsed .tw-cta, .chat-panel.collapsed .chat-form, .chat-panel.collapsed .chat-hint, .chat-panel.collapsed #chat-chips { display: none; }
  #chat-collapse { display: inline-flex; }
  .chat-toggle { display: inline-flex; }
  .actionbar { bottom: calc(var(--sheet, 64px) + var(--kb) + 8px); }
  .actionbar .btn span { display: none; }
  .actionbar .btn { padding: 0 10px; }
  .zoom-ctrl { top: 8px; right: 8px; }
  .edit-bar { right: 58px; }
  /* Taille minimale du lecteur Twitch (400 × 300) respectée dès que la largeur de l’écran le permet. */
  .cinema-frame { width: min(100%, max(calc(40vh * 16 / 9), 534px)); min-width: 0; }
  body.watch .cinema-frame { width: 100%; }
  .cinema-tools .fine { display: none; }
  .cinema { padding: 6px; }
  .cinema-frame::before, .cinema-frame::after { display: none; }
  .wardrobe { grid-template-columns: minmax(0, 1fr); }
  .wardrobe .stagebox { position: static; flex-direction: row; justify-content: center; }
  .wardrobe .stagebox canvas { width: 110px; height: 200px; }
  .room-title strong { max-width: 34vw; }
  .tour { top: auto; bottom: calc(var(--sheet, 64px) + var(--kb) + 70px); }

  body.watch .stage, body.watch .actionbar { display: none; }
  body.watch .cinema { flex: none; }
  body.watch .chat-panel { position: static; height: auto; flex: 1; border-radius: 0; box-shadow: none; padding-bottom: var(--kb); }
  body.watch .main { flex-direction: column; }
  body.watch .stage-wrap { flex: none; }
}
@media (max-width: 480px) {
  .topbar { gap: 5px; padding-left: 6px; padding-right: 6px; overflow: hidden; }
  .topnav #btn-inventory { display: none; } /* accessible depuis Réglages › Mon inventaire */
  .topbar #btn-nav { width: 42px; padding: 0; }
  .topbar #btn-nav .lbl { display: none; }
  .topnav .btn { width: 38px; min-height: 38px; }
  .topnav .btn .px-icon { width: 20px; height: 20px; }
  .room-title strong { font-size: 14px; max-width: none; }
  .pill.live { font-size: 0; padding: 0; width: 14px; height: 14px; border-radius: 50%; flex: none; }
  .sim-banner { font-size: 11px; }
  .logotype { font-size: 40px; }
}
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  body.watch .main { flex-direction: row; }
  body.watch .stage-wrap { flex: 1.4; }
  body.watch .cinema-frame { width: min(100%, calc((100vh - 110px) * 16 / 9)); }
  body.watch .chat-panel { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  /* le site public (accueil) a ses propres règles : il respecte aussi le choix explicite « Reprendre les animations » */
  body:not(.on-landing) *, body:not(.on-landing) *::before, body:not(.on-landing) *::after { animation: none !important; transition: none !important; }
}
body.calm *, body.calm *::before, body.calm *::after { animation: none !important; transition: none !important; }

/* Pages simples (autorisation simulée, hors connexion) */
.page-simple { display: grid; place-items: center; min-height: 100%; background: var(--night-2); overflow: auto; }
.card-simple { background: var(--panel); color: var(--text); max-width: 520px; margin: 20px; padding: 24px; border-radius: 18px; border: 3px solid var(--outline); box-shadow: 0 5px 0 var(--shadow-hard); }

/* ---------- v0.3 : réactions, invitations, duels ---------- */
.react-menu { position: fixed; z-index: 41; background: var(--panel); color: var(--text); border: 2px solid var(--outline); border-radius: 16px; box-shadow: 0 4px 0 var(--shadow-hard); padding: 8px; display: grid; grid-template-columns: repeat(4, minmax(64px, 1fr)); gap: 6px; max-width: calc(100vw - 16px); }
.react-menu button { min-height: 58px; flex-direction: column; gap: 2px; font-size: 12px; padding: 4px; }
.react-menu button .emo { font-size: 20px; line-height: 1; }
.react-menu button canvas { width: 24px; height: 24px; image-rendering: pixelated; }
.react-menu .sep { grid-column: 1 / -1; font-size: 12px; font-weight: 800; color: var(--muted); margin-top: 2px; }
.invite-card { position: fixed; z-index: 55; left: 50%; transform: translateX(-50%); top: calc(var(--top-h) + 14px + env(safe-area-inset-top)); width: min(420px, calc(100vw - 16px)); background: var(--panel); color: var(--text); border: 2px solid var(--outline); border-radius: 16px; box-shadow: 0 4px 0 var(--shadow-hard); padding: 12px; display: flex; flex-direction: column; gap: 10px; animation: pop 0.18s ease-out; }
.invite-card .inv-main { display: flex; gap: 10px; align-items: center; }
.invite-card .inv-main strong { display: block; font-size: 15px; }
.invite-card .game-illu { width: 84px; height: 54px; border-radius: 8px; border: 2px solid var(--outline); flex: none; }
.inv-bar { height: 6px; border-radius: 3px; background: var(--chip-bg); overflow: hidden; }
.inv-bar span { display: block; height: 100%; background: var(--amber); transition: width 0.25s linear; }
.game-picks { display: flex; flex-direction: column; gap: 10px; }
.game-pick { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 2px solid var(--outline); border-radius: 14px; background: var(--surface-raised); padding: 8px; box-shadow: 0 2px 0 var(--shadow-hard); }
.game-illu { image-rendering: pixelated; border-radius: 10px; }
.game-pick .gp-text strong { display: block; font-size: 15.5px; }
.game-pick .gp-text span { font-size: 13.5px; color: var(--text-soft); }
.game-pick details { font-size: 13px; margin-top: 4px; }
.game-pick summary { cursor: pointer; font-weight: 800; color: var(--lav-2); }
.pill.duel { background: var(--hi-bg); color: var(--text); }
.match-panel { position: fixed; z-index: 50; right: 12px; top: calc(var(--top-h) + 12px); width: min(470px, calc(100vw - 24px)); max-height: calc(100vh - var(--top-h) - 24px); overflow-y: auto; background: var(--panel); color: var(--text); border: 3px solid var(--outline); border-radius: 20px; box-shadow: 0 6px 0 var(--shadow-hard); padding: 12px 14px 14px; overscroll-behavior: contain; }
.mp-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mp-title strong { font-size: 18px; }
.mp-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.mp-vs { font-size: 12px; font-weight: 800; color: var(--muted); }
.mp-player { display: flex; gap: 8px; align-items: center; border: 2px solid var(--outline); border-radius: 12px; padding: 4px 8px; background: var(--surface-raised); min-width: 0; }
.mp-player canvas { width: 28px; height: 49px; image-rendering: pixelated; flex: none; }
.mp-player canvas.kit-portrait { height: 51px; image-rendering: auto; }
.mp-player strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-player div { min-width: 0; }
.mp-player.p0 { background: var(--tint-lav); }
.mp-player.p1 { background: var(--tint-rose); }
.mp-player.active { box-shadow: 0 0 0 3px var(--amber); }
.mp-status { font-weight: 800; text-align: center; margin: 10px 0 6px; }
.mp-status.over { font-size: 18px; color: var(--lav-2); }
.mp-timer { display: flex; align-items: center; gap: 8px; }
.mp-timer-bar { flex: 1; height: 8px; background: var(--chip-bg); border-radius: 4px; overflow: hidden; }
.mp-timer-bar span { display: block; height: 100%; background: var(--sage); transition: width 0.25s linear; }
.mp-timer.warn .mp-timer-bar span { background: var(--live); }
.mp-timer.warn .mp-timer-text { color: var(--live); font-weight: 800; }
.mp-flash { text-align: center; color: var(--err-text); font-weight: 800; font-size: 13.5px; margin: 4px 0; }
.mp-board { margin: 8px 0; }
.c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: #3d4a9a; border: 3px solid var(--outline); border-radius: 12px; padding: 6px; }
.c4-col { display: grid; grid-template-rows: repeat(6, 1fr); gap: 4px; background: transparent; border: 0; padding: 2px; border-radius: 8px; cursor: pointer; }
.c4-col:not([disabled]):hover, .c4-col:focus-visible { background: rgba(255, 224, 138, 0.25); outline: none; }
.c4-col[disabled] { cursor: default; }
.c4-cell { aspect-ratio: 1; border-radius: 50%; background: #1a1f40; display: grid; place-items: center; font-size: clamp(12px, 3.2vw, 18px); font-weight: 900; color: var(--ink); box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35); }
.c4-cell.p0 { background: var(--lav); }
.c4-cell.p1 { background: var(--rose); }
.c4-cell.last { box-shadow: 0 0 0 2px #fff6ea; }
.c4-cell.win { box-shadow: 0 0 0 3px var(--amber); animation: twinkle 0.8s steps(2) infinite; }
.mem { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mem-card { position: relative; aspect-ratio: 3 / 4; border: 2px solid var(--outline); border-radius: 10px; background: var(--lav-2); display: grid; place-items: center; cursor: pointer; padding: 2px; box-shadow: 0 2px 0 var(--shadow-hard); }
.mem-card canvas { max-width: 86%; max-height: 80%; image-rendering: pixelated; }
.mem-card.down canvas { width: 60%; }
.mem-card.up, .mem-card.found { background: var(--btn-bg); cursor: default; }
.mem-card.found.p0 { background: var(--tint-lav); }
.mem-card.found.p1 { background: var(--tint-rose); }
.mem-card.up { box-shadow: 0 0 0 3px var(--amber); }
.mem-card[disabled] { cursor: default; }
.mem-mark { position: absolute; top: 1px; right: 4px; font-size: 12px; font-weight: 900; }
.pfc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pfc-btn { flex-direction: column; min-height: 84px; font-size: 14px; }
.pfc-ico { font-size: 30px; line-height: 1; }
.pfc-reveal { text-align: center; background: var(--surface-raised); border: 2px solid var(--outline); border-radius: 12px; padding: 8px; font-weight: 700; }
.mp-foot { justify-content: center; align-items: center; }
@keyframes twinkle { 50% { opacity: 0.55; } }
@media (max-width: 900px) {
  .match-panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 86vh; border-radius: 20px 20px 0 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); z-index: 52; }
  .game-pick { grid-template-columns: 84px minmax(0, 1fr); }
  .game-pick .game-illu { width: 84px; height: 54px; }
  .game-pick .btn { grid-column: 1 / -1; }
}
/* Le plateau tient toujours dans la hauteur de l'écran (pas de défilement pour jouer). */
.c4 { width: min(100%, calc((100vh - 300px) * 7 / 6), 440px); margin: 0 auto; }
.mem { width: min(100%, calc((100vh - 290px) * 1.12), 460px); margin: 0 auto; }
@media (max-width: 900px) { .match-panel .mp-player canvas { display: none; } }

/* ---------- v0.3 : éditeur d'appartement ---------- */
.swatch.small { width: 30px; height: 30px; }
.variant-pick { display: flex; gap: 5px; align-items: center; }
.inv-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 8px; margin-bottom: 8px; }
.fam-chips { justify-content: flex-start; margin-bottom: 10px; gap: 6px; }
.decor-status { font-weight: 800; }
.decor-status.pending { color: var(--warn-text); }
.modal.see-through { margin: auto 12px 12px auto; max-height: min(70vh, 640px); width: min(440px, calc(100vw - 16px)); }
.modal.see-through::backdrop { background: rgba(20, 16, 41, 0.12); }
@media (max-width: 900px) { .modal.see-through { margin: auto auto 0; width: 100%; max-height: 55vh; border-radius: 20px 20px 0 0; } .inv-filters { grid-template-columns: 1fr; } }
.opt { font: inherit; font-size: 13px; font-weight: 800; border: 2px solid var(--outline); border-radius: 10px; background: var(--surface-raised); padding: 6px 10px; min-height: 40px; cursor: pointer; color: var(--text); box-shadow: 0 2px 0 var(--shadow-hard); }
.opt:hover { background: var(--surface-hover); }
.opt[aria-pressed='true'] { background: var(--hi-bg); box-shadow: 0 2px 0 var(--shadow-hard), 0 0 0 2px var(--amber); }
.opt-group .opts { gap: 6px; }
@media (max-width: 900px) { .modal.see-through { max-height: 46vh; } }

/* ---------- v0.3 : compagnons ---------- */
.pet-list { display: grid; gap: 10px; margin: 10px 0; }
.pet-card { display: flex; gap: 12px; align-items: center; border: 2px solid var(--outline); border-radius: 14px; padding: 8px 10px; background: var(--surface-raised); }
.pet-card.on { background: var(--hi-bg); box-shadow: 0 0 0 2px var(--amber); }
.pet-card canvas { flex: none; image-rendering: pixelated; }
.pet-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.pet-where { font-size: 13px; font-weight: 800; color: var(--accent-text); }
.pet-rename { display: flex; gap: 6px; }
.pet-rename input { flex: 1; min-width: 0; }
.pet-info .actions { justify-content: flex-start; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; }
.pet-adopt { display: flex; gap: 14px; align-items: flex-start; }
.pet-preview { flex: none; border: 2px dashed var(--outline); border-radius: 14px; padding: 6px; background: var(--surface-hover); }
.pet-preview canvas { display: block; image-rendering: pixelated; }
.pet-adopt-form { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.pet-adopt-form label { font-weight: 800; font-size: 13px; }
.opt-row { display: flex; gap: 6px; flex-wrap: wrap; }
.opt-row .opt { display: inline-flex; align-items: center; gap: 4px; }
.opt-row .opt canvas { image-rendering: pixelated; width: 34px; height: auto; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.notice-calm { background: var(--tint-amber); border-radius: 10px; padding: 6px 10px; }
@media (max-width: 560px) { .pet-adopt { flex-direction: column; align-items: center; } .pet-adopt-form { width: 100%; } }

/* ---------- v0.3 : vestiaire ---------- */
.wardrobe-status { font-size: 12px; font-weight: 800; text-align: center; margin: 0; color: var(--ok-text); max-width: 200px; }
.wardrobe-status.pending { color: var(--warn-text); }
.wardrobe .rot .btn[aria-pressed='true'] { background: var(--hi-bg); box-shadow: 0 2px 0 var(--shadow-hard), 0 0 0 2px var(--amber); }
.thumb-opt.conflict { border-style: dashed; opacity: 0.85; }
.outfit-card { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.btn.danger-soft { font-size: 11px; padding: 2px 8px; min-height: 26px; }
.wardrobe h4 { margin: 10px 0 6px; }
@media (max-width: 900px) { .wardrobe .stagebox { flex-wrap: wrap; } .wardrobe-status { max-width: none; width: 100%; } }

/* ---------- v0.4 : amis ---------- */
.icon-btn { position: relative; }
.count-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e05a74; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; border: 2px solid var(--ink); }
.friend-list { display: grid; gap: 8px; margin: 8px 0; }
.friend-card { display: flex; gap: 10px; align-items: center; border: 2px solid var(--outline); border-radius: 14px; padding: 6px 10px; background: var(--surface-raised); }
.friend-card canvas { flex: none; width: 32px; height: auto; image-rendering: pixelated; }
.friend-card canvas.kit-portrait { width: 40px; image-rendering: auto; }
.friend-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.friend-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-status { font-size: 13px; font-weight: 700; color: var(--text-soft); display: inline-flex; align-items: center; gap: 5px; }
.friend-status .dot { width: 9px; height: 9px; border-radius: 50%; background: #c9c3d6; border: 1.5px solid var(--outline); flex: none; }
.friend-status.on { color: var(--ok-text); }
.friend-status.on .dot { background: #6fd18f; }
.friend-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.friends-panel h4 { margin: 12px 0 4px; }
@media (max-width: 520px) { .friend-card { flex-wrap: wrap; } .friend-actions { width: 100%; justify-content: flex-start; } }

/* ---------- v0.5 : Twitch ---------- */
button.pill.live { cursor: pointer; border: 0; font: inherit; font-size: 11px; font-weight: 800; }
button.pill.live:hover { filter: brightness(1.08); }
.watch-sarah { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 12px; border: 2px solid var(--outline); border-radius: 16px; background: var(--tint-lav); cursor: pointer; font: inherit; color: var(--text); text-align: left; box-shadow: 0 3px 0 var(--shadow-hard); }
.watch-sarah.on { background: var(--tint-rose); }
.watch-sarah:disabled { opacity: 0.7; cursor: default; }
.watch-sarah .ws-icon { width: 38px; height: 38px; border-radius: 50%; background: #8a76c2; color: #fff; display: grid; place-items: center; font-size: 16px; flex: none; border: 2px solid var(--outline); }
.watch-sarah .ws-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.watch-sarah .ws-text span { font-size: 13px; color: var(--text-soft); }
.chip.warn { background: var(--tint-amber); }
.ok-txt { color: var(--ok-text); }
.warn-txt { color: var(--warn-text); }
.consent-lead { font-weight: 800; font-size: 15px; margin-bottom: 10px; }

/* ---------- v0.6 : statuts Twitch (badges du Cocon) ---------- */
.status-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.status-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1.5px solid var(--outline); background: var(--surface-raised); color: var(--text); }
.status-chip .status-ico { image-rendering: pixelated; width: 18px; height: 18px; }
.status-chip.st-owner { background: var(--tint-amber); }
.status-chip.st-mod { background: var(--tint-sage); }
.status-chip.st-vip { background: var(--tint-rose); }
.status-chip.st-sub { background: var(--tint-lav); }
.ctx-head .status-chips { margin-top: 6px; }
.profile-status { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 4px 12px; margin: 10px 0; font-size: 14px; }
.kv dt { font-weight: 800; }
.kv dd { margin: 0; word-break: break-word; }
.sim-status { border-top: 2px dashed var(--line); margin-top: 12px; padding-top: 8px; }
.sim-status .row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 8px 0; }
label.inline { display: inline; font-weight: 700; margin-right: 6px; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 6px; } }

/* ---------- Apparence : raccourci soleil / lune et choix Clair / Nuit / Système ---------- */
.theme-btn svg { width: 22px; height: 22px; flex: none; }
.discord-btn svg { width: 22px; height: 22px; flex: none; color: var(--accent-text); }
.topbar .theme-btn { width: 40px; padding: 0; } /* raccourci discret : icône seule, libellé accessible (aria-label) */
.theme-btn .lbl { display: none !important; }
.theme-btn-float { display: none; }
.theme-btn .ico-sun { display: none; }
html[data-theme='nuit'] .theme-btn .ico-sun { display: block; }
html[data-theme='nuit'] .theme-btn .ico-moon { display: none; }
.seg { display: inline-flex; flex: none; border: 2px solid var(--outline); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 0 var(--shadow-hard); }
.seg-btn { font: inherit; font-size: 13px; font-weight: 800; min-height: 38px; padding: 0 12px; border: 0; background: var(--btn-bg); color: var(--text); cursor: pointer; }
.seg-btn + .seg-btn { border-left: 2px solid var(--outline); }
.seg-btn:hover { background: var(--btn-hover); }
.seg-btn:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }
.seg-btn[aria-checked='true'] { background: var(--hi-bg); }
.seg-btn[aria-checked='true']::before { content: '✓ '; }
@media (max-width: 520px) { .setting:has(.seg) { flex-direction: column; align-items: stretch; } .seg { align-self: flex-start; } }

/* ---------- Thème Nuit : éléments déjà sombres, assombris d'un cran pour rester doux ---------- */
html[data-theme='nuit'] body, html[data-theme='nuit'] { background: #16122b; }
html[data-theme='nuit'] .topbar { background: linear-gradient(#221c44, #1b1738); }
html[data-theme='nuit'] .actionbar, html[data-theme='nuit'] .photo-bar { background: #1f1a3c; }
html[data-theme='nuit'] .loading { background: radial-gradient(ellipse at 50% 30%, #2c2556, #1b1738 60%, #120f24); }
html[data-theme='nuit'] .page-simple { background: #1b1738; }
html[data-theme='nuit'] .tip { background: #120e24; border: 1px solid var(--outline); }
html[data-theme='nuit'] .chip { border-color: var(--outline); }
html[data-theme='nuit'] .btn.twitch { background: #6f5daa; }
html[data-theme='nuit'] .btn.twitch:hover { background: #7d6bb8; }
html[data-theme='nuit'] .swatch { border-color: #9a8bc8; }
html[data-theme='nuit'] .mem-card.up, html[data-theme='nuit'] .mem-card.found { background: var(--surface-raised); }
html[data-theme='nuit'] .count-badge { border-color: #120e24; }
html[data-theme='nuit'] .status-chip { border-color: var(--outline); }
html[data-theme='nuit'] .chat-tab { border-color: var(--line); }
html[data-theme='nuit'] .msg .badge-txt { color: var(--text); }
html[data-theme='nuit'] .form-error, html[data-theme='nuit'] .toast.error { border-color: #e06a86; }
/* petits textes lavande / Twitch / alerte : éclaircis pour rester lisibles sur le prune */
html[data-theme='nuit'] .mp-status.over, html[data-theme='nuit'] .game-pick summary { color: var(--accent-text); }
html[data-theme='nuit'] .item-card .qty, html[data-theme='nuit'] .chat-hint .who-send { color: #c3b2f5; }
html[data-theme='nuit'] .edit-bar .err, html[data-theme='nuit'] .msg .status.refused, html[data-theme='nuit'] .mp-timer.warn .mp-timer-text { color: #ff8fa6; }

/* Statut « Absent » (disponibilité sociale) */
/* Posée sur la salle, centrée, à gauche des boutons de zoom : sa disparition ne déplace aucun bouton sous le doigt. */
.away-bar { position: absolute; top: 10px; left: 10px; right: 64px; margin: 0 auto; width: fit-content; max-width: calc(100% - 74px); z-index: 4; background: var(--panel); color: var(--text); padding: 8px 12px; font-size: 14px; border-radius: 14px; border: 2px solid var(--outline); box-shadow: 0 3px 0 var(--shadow-hard); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; text-align: center; }
#btn-back.nudge { animation: away-nudge 0.6s ease 2; }
@keyframes away-nudge { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { #btn-back.nudge { animation: none; outline: 3px solid var(--lav); } }

.six7-prev { width: 32px; height: 40px; image-rendering: pixelated; display: block; }

/* Battle d'aura */
.aura-gauge { position: relative; height: 38px; margin: 10px 4px 6px; border-radius: 19px; border: 2px solid var(--outline); background: linear-gradient(90deg, #2e3561, #3b3f80); overflow: hidden; }
.aura-zone { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--aura, #b9a3e3) 55%, transparent); border-left: 2px solid var(--aura, #b9a3e3); border-right: 2px solid var(--aura, #b9a3e3); }
.aura-core { position: absolute; top: 4px; bottom: 4px; width: 4px; margin-left: -2px; border-radius: 2px; background: #fff6ea; }
.aura-cursor { position: absolute; top: 2px; bottom: 2px; width: 6px; margin-left: -3px; border-radius: 3px; background: #f4c477; box-shadow: 0 0 0 2px #2a2140; }
.aura-cursor.wait { opacity: 0.4; }
.aura-shot { position: absolute; bottom: 1px; width: 16px; margin-left: -8px; text-align: center; font-size: 15px; line-height: 1; color: #fff6ea; text-shadow: 0 0 2px #2a2140; }
.aura-shot.p1 { color: #f3b6c9; }
.aura-count { min-height: 1.4em; text-align: center; font-weight: 800; margin: 2px 0 6px; }
.aura-btn { width: 100%; min-height: 56px; font-size: 20px; }
.aura-rounds { margin: 8px 0 0; padding-left: 20px; font-size: 13px; }
.inv-rules { margin: 4px 0; font-size: 13px; }

/* L'Arcade du Cocon : écran de borne commun aux six jeux (toujours « de nuit » : c'est un écran allumé), au format 4 : 5,
   qui tient dans la hauteur visible sans défilement (ordinateur : panneau à droite ; téléphone : panneau du bas). */
.arcade-panel { padding: 10px 12px 12px; }
.arc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 8px; }
.arc-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.arc-name strong { font-size: 17px; }
.arc-tgs { display: flex; gap: 6px; }
.arc-tg { border: 1px solid var(--outline); background: var(--btn-bg); color: var(--text); border-radius: 10px; padding: 4px 10px; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.arc-tg[aria-pressed='true'] { background: var(--btn-lav, var(--tint-lav)); }
.arc-tg[aria-pressed='false'] { opacity: 0.7; }
.arc-screen {
  --ink: #f4effc; position: relative; width: min(100%, calc((100dvh - var(--top-h) - 190px) * 0.8)); aspect-ratio: 4 / 5; margin: 0 auto; border-radius: 18px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 18%, #2f2560, #15112d 75%); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 40px rgba(185, 163, 227, 0.18), 0 10px 30px rgba(0, 0, 0, 0.3); touch-action: manipulation; user-select: none; -webkit-user-select: none; isolation: isolate;
}
.arc-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 6; border-radius: inherit; background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), transparent 35%); }
.arc-hud { position: absolute; inset: 10px 12px auto; z-index: 4; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.arc-hud span { background: rgba(10, 8, 26, 0.55); border: 1px solid rgba(255, 255, 255, 0.13); padding: 3px 10px; border-radius: 999px; }
.arc-lives { color: #f3b6c9; letter-spacing: 2px; }
.arc-layer { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; background: rgba(14, 11, 32, 0.7); backdrop-filter: blur(5px); }
.arc-layer p { margin: 0; }
.arc-kicker { font-weight: 800; color: #d9c8ff; font-size: 14px; letter-spacing: 0.04em; }
.arc-big { font-size: 38px; font-weight: 900; text-align: center; margin: 0; background: linear-gradient(135deg, #b9a3e3, #f3b6c9); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.arc-layer .fine { color: #cfc5ea; }
.arc-timer { font-variant-numeric: tabular-nums; font-weight: 900; }
.arc-foot { justify-content: center; align-items: center; margin-top: 10px; }
.arc-pop { position: absolute; left: var(--x); top: var(--y); z-index: 5; pointer-events: none; font-weight: 900; font-size: 18px; color: #f3b6c9; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); white-space: nowrap; animation: arc-pop 0.85s ease-out forwards; }
.arc-pop.warn { color: #f5cd7c; }
@keyframes arc-pop { from { opacity: 1; transform: translate(-50%, 0) scale(0.9); } to { opacity: 0; transform: translate(-50%, -36px) scale(1.1); } }
.arc-intro .arc-short { font-weight: 700; }
.arc-games { flex-wrap: wrap; }

/* Mémoire des compagnons : cartes qui se retournent */
.arc-mem { position: absolute; inset: 46px 12px 12px; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); gap: 7px; }
.mem2 { perspective: 600px; border: 0; padding: 0; background: none; cursor: pointer; min-height: 0; min-width: 0; color: inherit; }
.mem2 .in { position: relative; display: block; width: 100%; height: 100%; transition: transform 0.35s cubic-bezier(0.3, 0.7, 0.3, 1.2); transform-style: preserve-3d; }
.mem2.up .in, .mem2.found .in { transform: rotateY(180deg); }
.mem2 .b, .mem2 .f { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; display: grid; place-items: center; }
.mem2 .b { background: linear-gradient(160deg, #4a3d86, #2c2458); border: 1px solid rgba(255, 255, 255, 0.18); color: #b9a3e3; font-size: 18px; }
.mem2 .f { transform: rotateY(180deg); background: linear-gradient(180deg, #fbf3ff, #eadff9); border: 1px solid rgba(255, 255, 255, 0.4); overflow: hidden; }
.mem2 .f canvas { width: 88% !important; height: auto; max-height: 88%; object-fit: contain; }
.mem2.found .f { box-shadow: 0 0 0 3px #9fd8c4, 0 0 16px rgba(159, 216, 196, 0.5); }
.mem2:disabled { cursor: default; }
.mem2:focus-visible .b { outline: 2px solid #f3b6c9; outline-offset: 2px; }

/* Défi de réflexes : zone classique ou Cible filante */
.arc-reflex { position: absolute; inset: 0; border: 0; padding: 0; background: #2a2350; color: #f4effc; font: inherit; font-size: 24px; font-weight: 900; cursor: pointer; transition: background 0.12s; }
.arc-reflex .msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; pointer-events: none; }
.arc-reflex:not(.cible).wait { background: #5a2f4a; }
.arc-reflex:not(.cible).go { background: #2f8a5e; }
.arc-reflex.cible { background: transparent; cursor: crosshair; font-size: 21px; }
.arc-reflex.cible .msg { color: #d3cae8; }
.arc-target { position: absolute; left: var(--tx); top: var(--ty); width: var(--tr); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #f3b6c9 0 18%, #fff 18% 32%, #b9a3e3 32% 50%, #fff 50% 64%, #f3b6c9 64% 100%); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2), 0 0 30px rgba(243, 182, 201, 0.7); animation: arc-grow 0.16s ease-out; }
@keyframes arc-grow { from { transform: translate(-50%, -50%) scale(0.3); } }
.arc-bars { position: absolute; left: 14px; right: 14px; bottom: 12px; height: 54px; display: flex; gap: 6px; align-items: flex-end; pointer-events: none; z-index: 3; }
.arc-bars div { flex: 1; height: var(--h); min-height: 4px; position: relative; border-radius: 6px 6px 3px 3px; background: linear-gradient(135deg, #b9a3e3, #f3b6c9); }
.arc-bars em { position: absolute; top: -17px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 11px; font-weight: 800; color: #d3cae8; }

/* Séquences : formes et notes */
.arc-pads { position: absolute; inset: 54px 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.arc-pad { border: 0; border-radius: 22px; cursor: pointer; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 30%, #1d1838); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 60%, transparent); transition: background 0.12s, transform 0.12s, box-shadow 0.12s; }
.arc-pad svg { width: 42%; height: 42%; fill: color-mix(in srgb, var(--c) 70%, #fff); opacity: 0.75; }
.arc-pad.lit { background: var(--c); transform: scale(1.04); box-shadow: 0 0 0 3px #fff6ea, 0 0 40px var(--c); }
.arc-pad.lit svg { opacity: 1; fill: #fff; }
.arc-pad:disabled { cursor: default; }
body.calm .arc-pad { transition: none; }

/* Taquin du Cocon */
.arc-taquin { position: absolute; top: 48px; left: 50%; width: min(calc(100% - 28px), calc(125% - 108px)); aspect-ratio: 1; transform: translateX(-50%); border-radius: 14px; background: rgba(0, 0, 0, 0.28); }
.arc-tile { position: absolute; border: 0; padding: 0; border-radius: 10px; cursor: pointer; background-color: #3a2f6e; background-repeat: no-repeat; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.35); transition: left 0.13s ease-out, top 0.13s ease-out; }
.arc-tile span { position: absolute; top: 3px; left: 6px; font-size: 11px; font-weight: 900; color: #fff; text-shadow: 0 1px 3px #000; opacity: 0.8; }
.arc-peek { position: absolute; inset: 0; z-index: 2; border-radius: 14px; background-size: cover; opacity: 0; pointer-events: none; transition: opacity 0.15s; }
.arc-peek.on { opacity: 1; }
.arc-under { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: center; }
body.calm .arc-tile { transition: none; }

/* La course du renard */
.arc-run { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }

/* Le bon ton */
.arc-ton { position: absolute; inset: 46px 14px 14px; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; }
.arc-timebar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.arc-timebar div { height: 100%; background: linear-gradient(90deg, #b9a3e3, #f3b6c9); transform-origin: left; }
.arc-word { display: grid; place-items: center; font-weight: 900; font-size: clamp(34px, 10vw, 54px); letter-spacing: 0.02em; text-align: center; }
.arc-word.intro { font-size: 20px; color: #d3cae8 !important; }
.arc-word.shake { animation: arc-shake 0.3s; }
@keyframes arc-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.arc-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.arc-choice { border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px; padding: 14px 8px; background: rgba(255, 255, 255, 0.06); color: #f4effc; font: inherit; font-weight: 800; cursor: pointer; display: flex; gap: 8px; align-items: center; justify-content: center; }
.arc-choice i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.arc-choice:active { transform: scale(0.97); }
.arc-choice:disabled { opacity: 0.55; cursor: default; }
@media (max-width: 900px) {
  .arc-screen { width: min(100%, calc((86dvh - 170px) * 0.8)); }
}
@media (prefers-reduced-motion: reduce) {
  .mem2 .in, .arc-tile, .arc-pad, .arc-peek { transition: none; }
  .arc-pop, .arc-target, .arc-word.shake { animation: none; }
}
.arc-board { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.arc-board li { display: grid; grid-template-columns: 2.2em 1fr auto auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 10px; background: var(--surface-raised); border: 2px solid var(--outline); }
.arc-board li.me { background: var(--tint-lav); }
.arc-board .rk { font-weight: 900; }
.arc-board .sc { font-variant-numeric: tabular-nums; font-weight: 800; }

/* Boutique de récompenses (points de chaîne Twitch) */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 10px 0; }
.shop-card { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--outline); border-radius: 14px; padding: 10px; background: var(--surface-raised); }
.shop-card.soon { opacity: 0.75; }
.shop-prev { width: 54px; min-height: 54px; display: grid; place-items: center; flex: none; }
.shop-prev canvas { max-width: 54px; max-height: 60px; image-rendering: pixelated; }
.aura-dot { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--outline); font-size: 18px; }
.shop-admin table input { max-width: 190px; }

.wallet-balance { display: flex; align-items: baseline; gap: 10px; font-size: 22px; margin: 6px 0; }
.wallet-balance strong { font-variant-numeric: tabular-nums; }
/* ---------- Panneau d'administration (jetons du thème : clair et nuit) ---------- */
.adm h4 { margin: 14px 0 6px; font-size: 15px; }
.adm-tabs { flex-wrap: wrap; }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 8px 0; }
.adm-direct-link { display: block; margin: 6px 0; padding: 8px 10px; font: 500 12.5px/1.4 var(--mono, ui-monospace, monospace); word-break: break-all; background: var(--surface-raised); border: 1.5px dashed var(--line); border-radius: 4px; user-select: all; }
.adm-direct-row { margin: 10px 0 14px; } .adm-direct-row > strong { display: block; font-size: 14px; } .adm-direct-row > p { margin: 2px 0 0; }
.adm-card { background: var(--surface-raised); border: 2px solid var(--outline); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 3px 0 var(--shadow-hard); }
.adm-card strong { font-size: 20px; color: var(--accent-text); }
.adm-card span { font-weight: 700; font-size: 13px; }
.adm-card small { color: var(--muted); font-size: 12px; }
.adm-table td, .adm-table th { vertical-align: top; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.adm-num { width: 64px; }
.adm-search { gap: 6px; }
.adm-search input { flex: 1; min-width: 0; }
.adm-acts input[type='text'] { width: 100%; margin-bottom: 6px; }
.adm-sanctions, .adm-incidents { margin: 4px 0; padding-left: 18px; }
@media (max-width: 480px) {
  .adm-table { font-size: 13px; }
  .adm-table th:nth-child(3), .adm-table td:nth-child(3) { white-space: nowrap; }
}

/* ---------- Navigation, niveau et progression (maquettes « interface », 18/10/2026) ---------- */
/* Ancien menu du haut : ses boutons restent dans la page (états, raccourcis) et sont proposés dans « Plus ». */
.legacy-nav { display: none !important; } /* jour / nuit : Réglages › Mode jour / nuit */
/* Barre du haut : Mes amis à gauche de la puce de profil, Réglages tout à droite (icônes seules, libellé accessible) */
.topbar .top-icon { width: 40px; min-height: 40px; padding: 0; flex: none; }
.topbar .top-icon .px-icon { width: 22px; height: 22px; }
.topbar #btn-nav { display: none; }

/* Puce de profil : pseudo, « Niv. X », barre d'XP discrète et accès Progression */
.me-chip { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 4px; border-radius: 16px; background: rgba(255, 246, 234, 0.08); border: 2px solid rgba(185, 163, 227, 0.45); min-width: 0; }
.me-chip-av { width: 34px; height: 32px; border-radius: 50%; background: var(--stage-in); border: 2px solid var(--lav); flex: none; }
.me-chip-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.me-chip-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.me-chip-row strong { color: var(--cream); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16ch; }
.lvl-badge { font: 800 12px/1 var(--font); color: var(--cream); background: var(--night); border: 2px solid var(--lav); border-radius: 10px; padding: 3px 7px; white-space: nowrap; cursor: pointer; }
.lvl-badge:hover, .lvl-badge:focus-visible { background: var(--lav-2); }
.xp-bar { display: inline-block; width: 96px; height: 6px; border-radius: 3px; background: rgba(255, 246, 234, 0.18); overflow: hidden; flex: none; }
.xp-bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--rose), var(--lav)); border-radius: 3px; }
.linkish { background: none; border: 0; padding: 2px 0; color: var(--lav-soft); font: 700 12px var(--font); cursor: pointer; text-decoration: underline transparent; white-space: nowrap; }
.linkish:hover, .linkish:focus-visible { text-decoration-color: currentColor; }
.prog .linkish, .moi-head .linkish { color: var(--accent-text); white-space: normal; text-align: left; }

/* Barre de navigation principale */
.mainnav { display: flex; justify-content: center; gap: 4px; align-self: center; margin: 6px auto 8px; padding: 5px; border-radius: 18px; background: var(--night-2); border: 2px solid var(--outline); box-shadow: 0 3px 0 var(--shadow-hard); z-index: 6; }
.nav-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 84px; min-height: 52px; padding: 4px 10px; border-radius: 13px; border: 2px solid transparent; background: transparent; color: var(--cream); font: 800 13px var(--font); cursor: pointer; }
.nav-tab .px-icon { width: 24px; height: 24px; }
.nav-tab:hover { background: rgba(185, 163, 227, 0.16); }
.nav-tab:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
.nav-tab.on { background: var(--night); border-color: var(--lav); }
.nav-tab .count-badge { top: 2px; right: 10px; }
.mobile-only { display: none !important; }
.plus-menu { grid-template-columns: 1fr; min-width: 220px; }
.plus-menu .btn { flex-direction: row; justify-content: flex-start; gap: 8px; min-height: 44px; position: relative; }
.plus-menu .btn .count-badge { position: static; margin-left: auto; }
.moi-head { display: flex; flex-direction: column; gap: 4px; padding: 4px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.moi-head .xp-bar { width: 100%; background: var(--chip-bg); }
.react-menu .btn.locked, .opt[disabled] { opacity: 0.6; }
.thumb-opt.locked { opacity: 0.72; border-style: dashed; }

/* Écran Progression — DA « Verre de nuit » (23/10/2026) : bandeau personnel, paliers, tuiles de verre, détail.
   Jetons --g-* et --grad de hud-verre-de-nuit.css (thèmes Nuit et Clair). */
#modal:has(.prog) { width: min(1240px, calc(100vw - 24px)); max-width: none; }
.prog { display: flex; flex-direction: column; gap: 12px; }
.prog > *, .prog-bar > * { min-width: 0; }
.prog-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 18px; align-items: center; padding: 14px 18px; border-radius: 20px; border: 1px solid var(--glass-line); background: linear-gradient(115deg, rgba(185, 163, 227, 0.2), rgba(243, 182, 201, 0.08) 55%, transparent), var(--g-faint); box-shadow: var(--g-inset); }
.ph-av canvas { display: block; width: 64px; height: 60px; border-radius: 50%; image-rendering: pixelated; border: 2px solid transparent; background: linear-gradient(var(--g-avatar-ring), var(--g-avatar-ring)) padding-box, var(--grad) border-box; box-shadow: 0 6px 18px var(--g-shade); }
.ph-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ph-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ph-id > strong { font-size: 19px; font-weight: 800; color: var(--g-ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ph-id .lvl-badge { cursor: default; font-size: 12.5px; padding: 4px 9px; }
.ph-title { font-size: 12px; font-weight: 700; color: var(--accent-text); padding: 3px 9px; border-radius: 99px; background: var(--g-hover); }
.ph-xp { height: 9px; border-radius: 99px; background: var(--g-hover); overflow: hidden; box-shadow: inset 0 0 0 1px var(--glass-line); max-width: 560px; }
.ph-xp > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); box-shadow: 0 0 12px rgba(243, 182, 201, 0.7); }
.ph-cap { margin: 0; font-size: 12.5px; color: var(--g-ink-soft); }
.ph-cap strong { color: var(--g-ink-strong); }
.ph-side { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 220px; }
.ph-next { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; border-radius: 14px; border: 1px solid var(--glass-line); background: var(--g-faint); color: var(--g-ink); font: inherit; text-align: left; cursor: pointer; }
.ph-next:hover { background: var(--g-hover); }
.ph-next:focus-visible { outline: 2px solid #f3b6c9; outline-offset: 2px; }
.ph-next-thumb { display: grid; place-items: center; width: 44px; height: 40px; border-radius: 11px; background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 35%, transparent), transparent), var(--g-hover); flex: none; overflow: hidden; }
.ph-next-thumb canvas { image-rendering: pixelated; }
.ph-next small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--g-ink-soft); }
.ph-next strong { display: block; font-size: 13px; line-height: 1.2; }
.prog-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.prog-sub { margin: 0; color: var(--g-ink-soft); font-size: 13px; flex: 1 1 320px; }
.prog-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.prog-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--glass-line); background: var(--g-faint); color: var(--g-ink); font: 800 12.5px var(--font); cursor: pointer; }
.prog-chip small { font-size: 11px; font-weight: 700; color: var(--g-ink-soft); }
.prog-chip:hover { background: var(--g-hover); }
.prog-chip.here { background: var(--g-sel); box-shadow: inset 0 0 0 1px var(--g-sel-line); }
.prog-chip.full small { color: var(--ok-text); }
.prog-chip:focus-visible { outline: 2px solid #f3b6c9; outline-offset: 2px; }
.prog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.prog-track { position: relative; max-height: max(300px, calc(min(88vh, 780px) - 322px)); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scroll-padding-top: 4px; }
.prog-group { border: 1px solid var(--glass-line); border-radius: 18px; padding: 12px; margin-bottom: 12px; background: var(--g-faint); box-shadow: var(--g-inset); }
.prog-group > header { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 0 2px 10px; flex-wrap: wrap; }
.pg-kicker { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.prog-group h3 { margin: 1px 0 0; font-size: 16px; font-weight: 800; color: var(--g-ink-strong); display: inline; }
.pg-desc { margin-left: 8px; font-size: 12px; color: var(--g-ink-soft); }
.pg-count { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--g-ink-soft); }
.pg-count strong { color: var(--g-ink); font-weight: 800; }
.pg-bar { width: 72px; height: 5px; border-radius: 99px; background: var(--g-hover); overflow: hidden; }
.pg-bar > span { display: block; height: 100%; background: var(--grad); }
.prog-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.prog-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 116px; padding: 24px 4px 10px; border-radius: 14px; border: 1px solid var(--glass-line); background: var(--g-faint); color: var(--g-ink); cursor: pointer; font: 700 11.5px/1.15 var(--font); text-align: center; overflow: hidden; transition: background 0.15s, box-shadow 0.15s, transform 0.15s; }
.prog-card::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--rc); box-shadow: 0 0 10px var(--rc); opacity: 0.85; }
.prog-card:hover { background: var(--g-hover); transform: translateY(-1px); }
.prog-card:focus-visible { outline: 2px solid #f3b6c9; outline-offset: 2px; }
.prog-card.on { background: var(--g-sel); box-shadow: 0 0 0 2px var(--g-ring), 0 0 18px var(--g-sel-line); }
.prog-card.big { background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 16%, transparent), transparent 70%), var(--g-faint); }
.prog-card.big.on { background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 16%, transparent), transparent 70%), var(--g-sel); }
.pc-lvl { position: absolute; top: 6px; left: 6px; min-width: 20px; padding: 2px 6px; border-radius: 99px; background: var(--g-hover); font-weight: 800; font-size: 10.5px; line-height: 1.2; color: var(--g-ink); }
.prog-card.current .pc-lvl { background: var(--grad); color: var(--btn-primary-text); box-shadow: 0 0 10px rgba(243, 182, 201, 0.6); }
.prog-card.current { box-shadow: inset 0 0 0 1px rgba(243, 182, 201, 0.7); }
.prog-card.current.on { box-shadow: 0 0 0 2px var(--g-ring), 0 0 18px var(--g-sel-line); }
.pc-state { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 900; line-height: 1; }
.pc-state.owned { background: rgba(124, 199, 154, 0.22); color: var(--ok-text); box-shadow: inset 0 0 0 1px rgba(124, 199, 154, 0.55); }
.pc-state.owned::before { content: "✓"; }
.pc-state.equipped { background: var(--grad); color: var(--btn-primary-text); box-shadow: 0 0 8px rgba(243, 182, 201, 0.6); }
.pc-state.equipped::before { content: "★"; font-size: 9px; }
.pc-state.pending { background: var(--amber); box-shadow: 0 0 8px rgba(242, 180, 80, 0.6); width: 9px; height: 9px; top: 10px; right: 9px; }
.pc-state.locked { width: 8px; height: 8px; top: 10px; right: 10px; background: var(--g-hover); box-shadow: inset 0 0 0 1px var(--glass-line); }
.pc-thumb { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; }
.pc-thumb::before { content: ""; position: absolute; inset: 2px 12%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 26%, transparent), transparent); z-index: 0; }
.pc-thumb > * { position: relative; z-index: 1; }
.pc-thumb canvas { max-height: 54px; max-width: 100%; image-rendering: pixelated; }
.prog-card.s-locked .pc-thumb > * { opacity: 0.45; filter: grayscale(0.5); }
.prog-card.s-locked .pc-name { color: var(--g-ink-soft); }
.pc-name { overflow-wrap: anywhere; padding: 0 2px; }
.pc-anim { position: absolute; top: 26px; right: 7px; font-size: 10px; color: var(--accent-text); opacity: 0.85; }
.pc-plate { display: inline-block; max-width: calc(100% - 4px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 5px; border-radius: 7px; background: rgba(42, 33, 64, 0.88); color: #fff6ea; font-weight: 800; font-size: 10.5px; }
.pc-plate.grand { font-size: 22px; padding: 8px 18px; border-radius: 13px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35); }
.pc-plate .name-aurore { animation-name: name-aurore-nuit; }
.r-commun { --rc: #c9bfdc; }
.r-peu_commun { --rc: #8fc9a0; }
.r-rare { --rc: #7fb7e8; }
.r-epique { --rc: #b48ce8; }
.r-legendaire { --rc: #f2c45a; }
.r-mythique { --rc: #f08fc0; }
.rarity { display: inline-block; padding: 2px 8px; border-radius: 10px; border: 2px solid var(--rc); font-weight: 800; font-size: 12px; }
.prog .rarity { border-width: 1px; border-radius: 99px; padding: 3px 10px; font-size: 11.5px; color: var(--rc); background: color-mix(in srgb, var(--rc) 14%, transparent); }
html[data-theme='clair'] .prog .rarity { color: color-mix(in srgb, var(--rc) 55%, #2a2140); }
.prog-side { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; }
.prog-detail { border: 1px solid var(--glass-line); border-radius: 20px; padding: 14px; background: var(--g-faint); box-shadow: var(--g-inset); }
.pd-head { display: flex; justify-content: space-between; align-items: center; }
.pd-kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.prog-preview { display: flex; align-items: center; justify-content: center; min-height: 150px; margin: 8px 0; border-radius: 12px; background: radial-gradient(circle at 50% 40%, var(--stage-in), var(--stage-out)); border: 2px solid var(--rc, var(--line)); overflow: hidden; }
.prog-preview canvas { max-width: 100%; max-height: 150px; image-rendering: pixelated; }
.prog-detail .prog-preview { min-height: 156px; margin: 10px 0 12px; border-radius: 16px; border: 1px solid var(--glass-line); background: radial-gradient(60% 70% at 50% 45%, color-mix(in srgb, var(--rc) 30%, transparent), transparent), var(--g-game); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 30%, transparent), var(--g-inset); }
.prog-detail h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; color: var(--g-ink-strong); }
.pd-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pd-state { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--g-hover); color: var(--g-ink-soft); }
.pd-state.owned { background: rgba(124, 199, 154, 0.18); color: var(--ok-text); }
.pd-state.equipped { background: var(--grad); color: var(--btn-primary-text); }
.pd-state.pending { background: var(--g-warn-bg); color: var(--warn-text); }
.chip-anim { font-size: 11px; padding: 2px 7px; border-radius: 9px; background: var(--chip-bg); color: var(--text); }
.prog .chip-anim { font-weight: 800; padding: 3px 10px; border-radius: 99px; color: var(--accent-text); }
.pd-desc { margin: 0 0 10px; color: var(--g-ink-soft); font-size: 13.5px; line-height: 1.45; }
.prog-detail .kv { margin: 0 0 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.prog-detail .kv dt { color: var(--g-ink-soft); font-weight: 700; }
.prog-detail .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.prog-detail .actions .btn.primary { flex: 1 1 0; white-space: nowrap; }
.prog-foot { margin: 4px 2px; font-size: 12px; color: var(--g-ink-soft); }

@media (max-width: 1100px) {
  .prog-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .prog-hero { grid-template-columns: auto minmax(0, 1fr); }
  .ph-side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .ph-next { flex: 1 1 220px; }
}
@media (max-width: 900px) {
  /* téléphone : barre d'onglets en bas de l'écran (Salles, Boutique, Moi, Sac, Plus) */
  :root { --navh: 62px; }
  .pc-only { display: none !important; }
  .mobile-only { display: flex !important; }
  .mainnav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 16px 16px 0 0; border-width: 2px 0 0; justify-content: space-around; padding: 4px 4px max(4px, env(safe-area-inset-bottom)); box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.25); z-index: 9; }
  .nav-tab { min-width: 0; flex: 1; min-height: 50px; font-size: 12px; padding: 2px; }
  .game { padding-bottom: calc(var(--navh) + env(safe-area-inset-bottom)); }
  body.kb-open .mainnav { display: none; }
  body.kb-open .game { padding-bottom: 0; }
  .me-chip { padding: 2px 6px 2px 2px; gap: 6px; flex: none; }
  .me-chip-av { width: 28px; height: 26px; }
  .me-chip-row strong, #me-chip-prog { display: none; }
  .xp-bar { width: 52px; }
  .prog-layout { grid-template-columns: minmax(0, 1fr); }
  .prog-side { position: static; order: -1; }
  .prog-track { max-height: none; overflow: visible; }
  .prog-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prog-card { min-height: 112px; font-size: 12.5px; }
  .prog-preview { min-height: 120px; }
  .prog-hero { padding: 12px; gap: 8px 12px; border-radius: 18px; }
  .ph-av canvas { width: 52px; height: 48px; }
  .ph-id > strong { font-size: 17px; }
  .ph-side { flex-direction: column; }
  .ph-next { flex: none; }
  .prog-bar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .prog-sub { flex: none; font-size: 12.5px; }
  .prog-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
  .prog-chip { flex: none; }
  .prog-group { padding: 10px; border-radius: 16px; }
  .pg-desc { display: block; margin: 2px 0 0; }
  .prog-detail .prog-preview { min-height: 130px; }
}
html[data-theme='nuit'] .mainnav { background: #1f1a3c; }

/* Boutique du Cocon (maquette « interface-boutique ») */
#modal:has(.shop-layout) { width: min(1120px, calc(100vw - 24px)); max-width: none; }
.shop-head { margin: -4px 0 8px; }
.shop-tagline { margin: 0; font-weight: 800; color: var(--accent-text); }
.shop-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-modes .shop-mode { min-height: 52px; font-size: 15px; justify-content: center; gap: 10px; border-radius: 14px; }
.shop-modes .shop-mode.on { border-color: var(--lav); box-shadow: 0 0 0 2px var(--lav); }
.mode-ico { width: 22px; height: 22px; border-radius: 6px; background: var(--twitch); display: inline-block; }
.mode-ico.home { background: var(--lav); border-radius: 50%; }
.shop-lead { margin: 4px 0 8px; }
.shop-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.shop-cats .btn.on { background: var(--btn-primary); }
.shop-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.shop-layout .shop-grid { margin: 0; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
button.shop-card { width: 100%; text-align: left; cursor: pointer; color: var(--text); font: inherit; border-color: var(--rc, var(--outline)); }
button.shop-card:hover { background: var(--surface-hover); }
button.shop-card.on { box-shadow: 0 0 0 3px var(--rc, var(--lav)); }
.shop-card-body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.price.pts { color: var(--accent-text); }
.shop-detail { border: 2px solid var(--rc, var(--line)); border-radius: 14px; padding: 10px; background: var(--surface-raised); position: sticky; top: 0; }
.shop-detail h3 { margin: 0; }
.shop-detail .prog-preview canvas { transform: scale(2); }
.shop-detail .prog-preview canvas.portrait-lisse { transform: none; }
@media (max-width: 900px) {
  .shop-modes .shop-mode { font-size: 13px; min-height: 48px; padding: 4px 6px; }
  .shop-layout { grid-template-columns: minmax(0, 1fr); }
  .shop-detail { position: static; order: -1; }
}
.game-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 2px solid var(--lav); border-radius: 10px; font-size: 12px; font-weight: 800; }

/* ---------- Profil, vestiaire intégré et badges (maquettes « interface-profil », 18/10/2026) ---------- */
#modal:has(.profile-panel), #modal:has(.badge-manager), #modal:has(.badge-admin) { width: min(1120px, calc(100vw - 24px)); max-width: none; }
.me-chip-open { padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; display: flex; }
.me-chip-open:focus-visible, .me-chip-name:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.me-chip-name { background: none; border: 0; padding: 0; color: var(--cream); font: 800 14px var(--font); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16ch; }
.profile-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 200px)); gap: 8px; margin-bottom: 12px; }
.profile-tab { min-height: 46px; justify-content: center; gap: 8px; font-size: 15px; border-radius: 14px; }
.profile-tab.on { background: var(--btn-lav); border-color: var(--lav-2); box-shadow: 0 0 0 2px var(--lav); }
.profile-tab .px-icon { width: 22px; height: 22px; }
.profile-tab.dirty::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-left: 4px; }
.profile-grid { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.profile-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border: 2px solid var(--line); border-radius: 16px; background: radial-gradient(circle at 50% 30%, var(--stage-in), var(--stage-out)); position: sticky; top: 0; }
html[data-theme='nuit'] .profile-stage { background: radial-gradient(circle at 50% 30%, #3a3170, #1f1a3c); }
.profile-stage-floor { position: relative; padding-bottom: 14px; }
.profile-stage-floor::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 170px; height: 46px; transform: translateX(-50%); background: var(--lav); opacity: 0.55; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); z-index: 0; }
.profile-stage-cv { position: relative; z-index: 1; width: 160px; height: 290px; image-rendering: pixelated; }
.profile-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.profile-card { border: 2px solid var(--line); border-radius: 16px; padding: 12px; background: var(--surface-raised); }
.profile-card h4 { margin: 0 0 8px; }
.ph-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-head h3 { margin: 0; font-size: 24px; }
.profile-head .lvl-badge { cursor: default; font-size: 14px; padding: 5px 10px; }
.xp-bar.wide { flex: 1; min-width: 120px; height: 10px; background: var(--chip-bg); }
.status-select, .status-pill { width: auto; flex: none; border-radius: 12px; border: 2px solid var(--line); padding: 6px 10px; font: 800 14px var(--font); background: var(--surface); color: var(--ok-text); }
.status-select.away, .status-pill.away { color: var(--warn-text); }
.motto { margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--tint-lav); overflow-wrap: anywhere; white-space: pre-wrap; }
.motto-edit textarea { width: 100%; resize: vertical; min-height: 64px; }
.motto-actions { align-items: center; gap: 8px; margin-top: 6px; }
.empty-state { margin: 4px 0 8px; font-style: italic; }
.badge-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.badge-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; max-width: 120px; text-align: center; }
.badge-cell .badge-name { font-weight: 800; font-size: 13px; overflow-wrap: anywhere; }
.badge-cell.sm .badge-name { font-size: 12px; }
.badge-medal { position: relative; display: inline-grid; place-items: center; border-radius: 30%; background: color-mix(in srgb, var(--bc) 30%, var(--surface)); border: 3px solid var(--bc); box-shadow: inset 0 0 0 2px rgba(255, 246, 234, 0.35), 0 2px 0 var(--shadow-hard); overflow: hidden; }
.badge-medal canvas { image-rendering: pixelated; }
.badge-medal.sm { width: 32px; height: 32px; border-width: 2px; }
.badge-medal.sm canvas { width: 24px; height: 24px; }
.badge-medal.md { width: 64px; height: 64px; }
.badge-medal.md canvas { width: 48px; height: 48px; }
.badge-medal.lg { width: 88px; height: 88px; }
.badge-medal.lg canvas { width: 72px; height: 72px; }
.badge-medal.xs { width: 22px; height: 22px; border-width: 2px; border-radius: 35%; }
.badge-medal.xs canvas { width: 16px; height: 16px; }
.badge-cell.main .badge-medal, .badge-medal.main { outline: 3px solid var(--amber); outline-offset: 2px; }
.badge-medal.twitch canvas { width: 60%; height: 60%; }
.beta-word { font: 900 13px var(--font); letter-spacing: 2px; color: #e8bd62; text-shadow: 0 1px 0 #2a2140; }
/* BÊTA TESTEUR : reflet qui parcourt lentement la bordure + petite étoile (boucle lente, aucun clignotement rapide) */
.badge-medal.anim { border-color: #e8bd62; }
.badge-medal.anim::after { content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 42%, rgba(255, 246, 234, 0.55) 50%, transparent 58%); transform: translateX(-80%); animation: badge-shine 4.2s ease-in-out infinite; pointer-events: none; }
.badge-star { position: absolute; top: 6%; right: 8%; width: 18%; height: 18%; background: #ffe9a0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: badge-star 4.2s ease-in-out infinite; opacity: 0.25; }
@keyframes badge-shine { 0% { transform: translateX(-80%); } 45%, 100% { transform: translateX(80%); } }
@keyframes badge-star { 0%, 55% { opacity: 0.25; transform: scale(0.8); } 70% { opacity: 1; transform: scale(1.1); } 85%, 100% { opacity: 0.25; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .badge-medal.anim::after, .badge-star { animation: none; } .badge-star { opacity: 0.8; } }
body.calm .badge-medal.anim::after, body.calm .badge-star { animation: none !important; }
.profile-actions { justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.profile-actions .btn { min-height: 44px; }
.wardrobe-lead { margin: 0 0 8px; }
/* Zone Badges du profil et « Gérer mes badges » */
.badges-card { display: grid; gap: 10px; }
.badges-card h4 { margin: 0; }
.bc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bc-head .btn { min-height: 38px; }
.bc-sub { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.badge-tile { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; text-align: center; min-width: 0; }
.bt-medal { position: relative; display: inline-grid; }
.bt-name { font-weight: 800; font-size: 12.5px; line-height: 1.25; overflow-wrap: anywhere; }
.bt-pip, .bt-on, .bt-lock { position: absolute; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; font: 800 11px var(--font); box-shadow: 0 1px 3px rgba(10, 6, 30, 0.35); }
.bt-pip { top: -4px; left: -6px; background: var(--amber); color: #2a2140; }
.bt-on { bottom: -2px; right: -6px; background: var(--btn-primary, #c9b2f0); color: var(--btn-primary-text, #1d1838); }
.bt-lock { top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--panel); color: var(--text); width: 28px; height: 28px; border-radius: 50%; }
.bt-lock .ico { width: 15px; height: 15px; }
.badge-tile.locked .badge-medal { filter: grayscale(0.9); opacity: 0.45; }
.badge-tile.locked .bt-name { color: var(--muted); }
.tag-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px 4px 6px; border-radius: 999px; background: rgba(42, 33, 64, 0.88); color: #f4effc; font-size: 14px; max-width: 100%; }
.tag-pill strong { margin-left: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-raised); font-weight: 800; font-size: 13px; }
.tw-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 40px; }
.tw-toggle.off .tw-chip { opacity: 0.5; text-decoration: line-through; }
.badge-manager { display: grid; gap: 18px; }
.badge-manager h4 { margin: 0 0 8px; }
.badge-manager p { margin: 0; }
.bm-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; }
.bm-block { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: var(--surface-raised); display: grid; gap: 8px; align-content: start; }
.bm-slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bm-slot { display: grid; gap: 4px; justify-items: center; padding: 6px 4px; border-radius: 12px; border: 1px solid var(--line); min-width: 0; }
.bm-slot.sel { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text) inset; }
.bm-slot.empty { border-style: dashed; place-content: center; min-height: 92px; }
.bm-slot-pick { display: grid; justify-items: center; gap: 4px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; min-width: 0; max-width: 100%; }
.bm-slot-name { font-size: 12px; font-weight: 800; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-slot-ctl { display: flex; gap: 2px; }
.btn.icon.xs { min-width: 28px; min-height: 28px; width: 28px; padding: 0; font-size: 15px; line-height: 1; border-radius: 9px; }
.bm-coll-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 12px; align-items: start; }
.badge-tile-btn { border: 1px solid transparent; border-radius: 14px; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; min-width: 0; }
.badge-tile-btn:hover { background: var(--surface-hover); }
.badge-tile-btn.sel { border-color: var(--accent-text); background: var(--surface-hover); }
.badge-tile-btn:focus-visible, .bm-slot-pick:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.bm-detail { position: sticky; top: 0; display: grid; gap: 10px; padding: 14px; border-radius: 16px; border: 2px solid var(--rc, var(--line)); background: var(--surface-raised); }
.bm-detail.empty { border-style: dashed; border-color: var(--line); }
.bm-detail.locked { border-style: dashed; }
.bm-detail.locked .badge-medal { filter: grayscale(0.9); opacity: 0.5; }
.bm-detail-top { display: flex; gap: 12px; align-items: center; }
.bm-detail-top > div { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.bm-detail-name { font-size: 17px; overflow-wrap: anywhere; }
.bm-detail-actions { display: grid; gap: 10px; }
.bm-detail-actions > .btn { justify-content: center; min-height: 42px; }
.bm-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.bm-seg-label { grid-column: 1 / -1; font-size: 12px; font-weight: 800; color: var(--muted); padding: 2px 4px 0; }
.bm-seg-btn { min-height: 38px; border: 0; border-radius: 9px; background: none; color: var(--text); font: 800 13px var(--font); cursor: pointer; }
.bm-seg-btn:hover { background: var(--surface-hover); }
.bm-seg-btn.on { background: var(--amber); color: #2a2140; }
.bm-seg-btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
.bm-bar { position: sticky; bottom: -1px; z-index: 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--g-solid, var(--panel)); box-shadow: 0 -6px 20px rgba(10, 6, 30, 0.25); }
.bm-bar .bm-state { flex: 1 1 auto; color: var(--muted); }
.bm-bar.dirty { border-color: var(--amber); }
.bm-bar.dirty .bm-state { color: var(--warn-text, var(--amber)); font-weight: 800; }
@media (max-width: 900px) {
  .bm-top, .bm-coll-grid { grid-template-columns: minmax(0, 1fr); }
  .bm-detail { position: static; order: -1; }
}
@media (max-width: 520px) {
  /* Téléphone : badges en lignes compactes (médaillon à gauche, nom à droite), deux colonnes si la place le permet. */
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 6px; }
  .badge-tile { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; gap: 8px; padding: 6px; text-align: left; }
  .badge-tile .badge-medal.md, .badge-tile .badge-medal.lisse.md { width: 38px; height: 38px; }
  .badge-tile .badge-medal.md canvas { width: 28px; height: 28px; }
  .bt-name { font-size: 12.5px; overflow-wrap: anywhere; hyphens: auto; }
  .bt-pip, .bt-on { min-width: 16px; height: 16px; padding: 0 3px; font-size: 10px; }
  .bt-pip { top: -5px; left: -5px; }
  .bt-on { bottom: -4px; right: -5px; }
  .bt-lock { width: 22px; height: 22px; }
  .bt-lock .ico { width: 12px; height: 12px; }
  .badge-tile-btn { border-color: var(--line); }
  .badge-tile-btn.sel { border-color: var(--accent-text); }
  .bm-detail .badge-medal.lg, .bm-detail .badge-medal.lisse.lg { width: 64px; height: 64px; }
  .bm-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bm-bar { flex-wrap: nowrap; padding: 8px; }
  .bm-bar .bm-state { display: none; }
  .bm-bar .btn.primary { margin-left: auto; }
}
/* Administration des badges */
.adm-results, .adm-badges { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 6px; }
.adm-badges li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-badges .btn { margin-left: auto; }
.badge-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.badge-form input { width: 100%; margin-bottom: 6px; }
.badge-admin .badge-row .badge-cell { gap: 6px; }
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-stage { position: static; }
  .profile-stage-cv { width: 112px; height: 203px; }
  .profile-tabs { grid-template-columns: 1fr 1fr; }
  .profile-actions { justify-content: stretch; }
  .profile-actions .btn { flex: 1 1 140px; }
  .badge-form { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Atelier d’appartement (maquettes PC et mobile : bleu nuit, lavande, rose, formes douces) ---------- */
.atelier { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: auto 1fr auto; background: #1b1f45; color: #f3eefc; font-family: var(--font); }
.atelier[hidden] { display: none; }
body.atelier-open .mainnav, body.atelier-open .actionbar { visibility: hidden; }
.at-ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.at-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid rgba(185, 163, 227, 0.35); background: #20255a; }
.at-title { display: flex; flex-direction: column; min-width: 0; }
.at-title strong { font-size: 20px; letter-spacing: 0.2px; }
.at-sub { font-size: 13px; color: #c9b8f0; }
.at-crumb { font-size: 14px; color: #c9b8f0; padding-left: 14px; border-left: 1px solid rgba(185, 163, 227, 0.35); }
.at-spacer { flex: 1; }
.at-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid rgba(185, 163, 227, 0.55); background: transparent; color: #f3eefc; cursor: pointer; }
.at-iconbtn:hover, .at-iconbtn:focus-visible { background: rgba(185, 163, 227, 0.18); outline: none; }
.at-body { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(300px, 360px); gap: 14px; padding: 14px; min-height: 0; }
.at-nav { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; }
.at-step { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid rgba(185, 163, 227, 0.3); background: #222860; color: inherit; cursor: pointer; font: inherit; }
.at-step:hover, .at-step:focus-visible { border-color: #b9a3e3; outline: none; }
.at-step.on { border-color: #f0a8d8; background: #2e2a6e; box-shadow: 0 0 0 2px rgba(240, 168, 216, 0.25); }
.at-num { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; background: #3a3a80; flex: none; }
.at-step.on .at-num { background: #f0a8d8; color: #2a1f4a; }
.at-steptxt { display: flex; flex-direction: column; min-width: 0; }
.at-steptxt strong { font-size: 15px; }
.at-steptxt span { font-size: 12.5px; color: #c9b8f0; }
.at-namebox { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; font-size: 13px; color: #c9b8f0; }
.at-input { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 12px; border: 1.5px solid rgba(185, 163, 227, 0.45); background: #1b1f45; color: #f3eefc; font: inherit; }
.at-input:focus-visible { outline: none; border-color: #f0a8d8; }
.at-input.num { width: 64px; text-align: center; padding: 8px 4px; display: inline-flex; align-items: center; justify-content: center; }
.at-stage { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; border-radius: 18px; border: 1.5px solid rgba(185, 163, 227, 0.35); background: radial-gradient(ellipse at 50% 40%, #262c66, #1a1e44); overflow: hidden; }
.at-stagebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px; }
.at-tool { display: inline-flex; align-items: center; gap: 6px; min-width: 38px; height: 38px; justify-content: center; padding: 0 10px; border-radius: 11px; border: 1.5px solid rgba(185, 163, 227, 0.45); background: #20255a; color: #f3eefc; font: inherit; font-size: 16px; cursor: pointer; }
.at-tool.on { border-color: #f0a8d8; background: #33306f; }
.at-tool:hover, .at-tool:focus-visible { border-color: #f0a8d8; outline: none; }
.at-sep { width: 8px; }
.at-zoom { min-width: 56px; text-align: center; font-size: 14px; }
.at-view { position: relative; min-height: 0; }
.at-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.at-size { justify-self: center; margin: 8px; padding: 8px 18px; border-radius: 999px; border: 1.5px solid rgba(185, 163, 227, 0.55); background: #20255a; font-size: 15px; white-space: pre; }
.at-handles { position: absolute; inset: 0; pointer-events: none; }
.at-handle { position: absolute; width: 22px; height: 22px; border-radius: 6px; border: 2px solid #fff; background: #c9a6f0; color: #2a1f4a; font-size: 11px; line-height: 1; padding: 0; pointer-events: auto; cursor: grab; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transform: rotate(45deg); }
.at-handle:focus-visible { outline: 3px solid #f0a8d8; }
.at-testbar { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: rgba(32, 37, 90, 0.92); border: 1.5px solid #f0a8d8; font-size: 13px; }
.at-testbar[hidden] { display: none; }
.at-tabs { display: none; }
.at-panel { display: flex; flex-direction: column; min-height: 0; border-radius: 18px; border: 1.5px solid rgba(185, 163, 227, 0.35); background: #20255a; overflow: hidden; }
.at-phead { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid rgba(185, 163, 227, 0.25); }
.at-phead h2 { margin: 0; font-size: 19px; }
.at-phead p { margin: 2px 0 0; font-size: 13px; color: #c9b8f0; }
.at-pbody { padding: 12px 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.at-pbody h3 { margin: 6px 0 0; font-size: 15px; }
.at-note { margin: 0; font-size: 12.5px; color: #c9b8f0; line-height: 1.4; }
.at-note.info { padding: 8px 10px; border-radius: 10px; background: rgba(185, 163, 227, 0.1); }
.at-row { display: flex; gap: 8px; align-items: center; }
.at-row.wrap { flex-wrap: wrap; }
.at-cards4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.at-cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.at-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; border: 1.5px solid rgba(185, 163, 227, 0.35); background: #1b1f45; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.at-card small { font-size: 11px; color: #c9b8f0; }
.at-card.on { border-color: #f0a8d8; background: #2e2a6e; box-shadow: 0 0 0 2px rgba(240, 168, 216, 0.25); }
.at-card:focus-visible, .at-swatch:focus-visible, .at-chip:focus-visible, .at-itembtn:focus-visible { outline: 3px solid #f0a8d8; outline-offset: 1px; }
.at-room-ico { width: 34px; height: 20px; background: linear-gradient(135deg, #f2c69a 50%, #e3a876 50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.at-room-ico.confort { width: 40px; height: 22px; }
.at-room-ico.grand { width: 46px; height: 26px; }
.at-room-ico.custom { background: linear-gradient(135deg, #e7c6f6 50%, #c9a6f0 50%); }
.at-shape { width: 44px; height: 24px; background: #f2c69a; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.at-shape.carre { width: 34px; height: 24px; }
.at-shape.L { clip-path: polygon(50% 0, 100% 50%, 75% 62%, 50% 50%, 25% 62%, 0 50%); }
.at-dim { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.at-stepper { display: inline-flex; gap: 6px; align-items: center; }
.at-door { display: grid; gap: 10px; }
.at-door .at-door-where { font-weight: 600; }
.at-surface { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 12px; border: 1.5px solid rgba(185, 163, 227, 0.35); background: #1b1f45; font-size: 14px; }
.at-seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: #1b1f45; border: 1.5px solid rgba(185, 163, 227, 0.3); }
.at-seg.small { flex-wrap: wrap; }
.at-segbtn { flex: 1; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.at-segbtn.on { background: #f0a8d8; color: #2a1f4a; font-weight: 700; }
.at-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.at-chip { padding: 6px 11px; border-radius: 999px; border: 1.5px solid rgba(185, 163, 227, 0.45); background: transparent; color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; }
.at-chip.on { background: #b9a3e3; color: #22204a; border-color: #b9a3e3; font-weight: 700; }
.at-swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.at-swatches.walls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.at-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border-radius: 12px; border: 1.5px solid rgba(185, 163, 227, 0.3); background: #1b1f45; color: inherit; font: inherit; font-size: 11.5px; line-height: 1.2; text-align: center; cursor: pointer; }
.at-swatch.on { border-color: #f0a8d8; box-shadow: 0 0 0 2px rgba(240, 168, 216, 0.3); }
.at-swatch canvas { image-rendering: pixelated; }
.at-sw-sol { width: 66px; height: 36px; }
.at-sw-mur { width: 30px; height: 66px; }
.at-sw-pano { width: 96px; height: 54px; border-radius: 6px; }
.at-sw-none { width: 96px; height: 54px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: linear-gradient(#232a52, #3d3566); font-size: 20px; }
.at-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.at-item { position: relative; }
.at-itembtn { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 14px; border: 1.5px solid rgba(185, 163, 227, 0.3); background: #1b1f45; color: inherit; font: inherit; cursor: pointer; min-height: 132px; }
.at-itembtn:hover { border-color: #b9a3e3; }
.at-thumbslot { width: 100%; height: 74px; display: flex; align-items: flex-end; justify-content: center; }
.at-thumb { max-width: 100%; max-height: 74px; image-rendering: pixelated; }
.at-iname { font-size: 12.5px; text-align: center; line-height: 1.2; }
.at-imeta { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.at-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #2e2a6e; }
.at-badge.ok { background: #3f7a62; }
.at-badge.free { background: #3a4a8a; }
.at-badge.lock { background: #6b3a5c; }
.at-badge.var { background: #4b3f86; }
.at-fav { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(27, 31, 69, 0.85); color: #8a82b0; cursor: pointer; font-size: 14px; }
.at-fav.on { color: #ffe08a; }
.at-place { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; border: 1.5px solid #f0a8d8; background: #26296a; }
.at-bigthumb { width: 96px; height: auto; image-rendering: pixelated; flex: none; }
.at-status { margin: 0; font-size: 13px; }
.at-status.ok { color: #9fe0b6; }
.at-status.ko { color: #ffb3c4; }
.at-confirm { padding: 12px; border-radius: 14px; border: 1.5px solid #ffe08a; background: #2e2a5e; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.at-confirm p { margin: 0; line-height: 1.4; }
.at-field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.at-pbody .setting { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.at-pbody .setting span { display: block; font-size: 12px; color: #c9b8f0; }
.at-foot { display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(185, 163, 227, 0.35); background: #20255a; }
.at-dirty { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: #c9b8f0; }
.at-dot { width: 10px; height: 10px; border-radius: 50%; background: #6f8f7a; }
.at-dirty.on { color: #ffe08a; }
.at-dirty.on .at-dot { background: #f2b450; }
.at-foot .btn { display: inline-flex; align-items: center; gap: 6px; }
.at-save { min-width: 160px; justify-content: center; background: #e7a9f3; color: #2a1f4a; }
.atelier.testing .at-nav, .atelier.testing .at-panel { opacity: 0.55; }
@media (max-width: 1100px) {
  .at-body { grid-template-columns: minmax(0, 1fr) minmax(280px, 330px); }
  .at-nav { display: none; }
  .at-tabs { display: flex; grid-column: 1 / -1; order: -1; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
  .at-tab { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 92px; padding: 8px 6px; border-radius: 14px; border: 1.5px solid rgba(185, 163, 227, 0.3); background: #222860; color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; }
  .at-tab.on { border-color: #f0a8d8; background: #2e2a6e; }
  .at-crumb { display: none; }
}
@media (max-width: 760px) {
  /* téléphone : aperçu en haut, onglets à faire défiler, panneau tactile, actions fixées en bas */
  .at-top { padding: 8px 10px; gap: 8px; }
  .at-title strong { font-size: 17px; }
  .at-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(220px, 42vh) auto minmax(0, 1fr); gap: 8px; padding: 8px; overflow: hidden; }
  .at-stage { grid-row: 1; height: 42vh; min-height: 220px; }
  .at-tabs { order: 0; grid-row: 2; }
  .at-panel { grid-row: 3; }
  .at-stagebar { gap: 4px; padding: 6px; }
  .at-tool { height: 34px; min-width: 34px; padding: 0 8px; }
  .at-tool.wide span { display: none; }
  .at-size { font-size: 13px; padding: 5px 12px; margin: 4px; }
  .at-cards4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .at-swatches.walls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .at-foot { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .at-dirty { width: 100%; justify-content: center; }
  .at-foot .at-spacer { display: none; }
  .at-foot .btn { flex: 1; justify-content: center; min-height: 44px; }
  .at-save { min-width: 0; }
}
@media (max-width: 400px) {
  .at-foot .btn { padding: 0 6px; font-size: 14px; }
  .at-foot .btn .at-ico { display: none; }
  .at-title .at-sub { display: none; }
}

/* ---------- Changelog (Réglages › Changelog et page d’accueil) ---------- */
.changelog { display: flex; flex-direction: column; gap: 10px; }
.cl-day { border: 2px solid var(--outline); border-radius: 14px; background: var(--surface-raised); overflow: hidden; }
.cl-day > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.cl-day > summary::-webkit-details-marker { display: none; }
.cl-day > summary::after { content: '▾'; font-size: 14px; opacity: 0.7; transition: transform 0.15s; }
.cl-day:not([open]) > summary::after { transform: rotate(-90deg); }
.cl-day > summary:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }
.cl-title { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 16px; }
.cl-date { font-size: 12.5px; font-weight: 600; opacity: 0.75; }
.cl-name { font-size: 16px; }
.cl-count { font-size: 12px; opacity: 0.7; white-space: nowrap; margin-left: auto; }
.cl-items { list-style: none; margin: 0; padding: 4px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.cl-item { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; align-items: start; }
.cl-item strong { display: block; font-size: 14px; }
.cl-item p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; opacity: 0.85; }
.cl-tag { display: inline-block; text-align: center; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #f3b6c9; color: #4a2340; }
.cl-tag.ameliore { background: #ddd0f5; color: #2e3561; }
.cl-tag.corrige { background: #c4e0c8; color: #24452e; }
@media (max-width: 480px) { .cl-item { grid-template-columns: minmax(0, 1fr); gap: 4px; } .cl-tag { justify-self: start; } }
@media (prefers-reduced-motion: reduce) { .cl-day > summary::after { transition: none; } }
.cl-day, .cl-title { min-width: 0; }
@media (max-width: 480px) { .cl-count { display: none; } .cl-day > summary { padding: 10px 12px; } .cl-items { padding: 4px 12px 12px; } }

/* Essai « DA lisse » (?lisse) : aperçus d'objets lissés, jamais pixelisés */
canvas.lisse { image-rendering: auto !important; }

/* =====================================================================
   Interface lisse (HUD, 20/10/2026) — maquette docs/maquettes/jeu.html validée par la propriétaire.
   Contours doux et clairs, ombres légères, surfaces crème / lavande, icônes vectorielles (/img/icones.svg).
   Restyle seulement : identifiants, gestionnaires et dispositions (PC, téléphone, live au-dessus du chat) inchangés.
   ===================================================================== */
:root {
  --outline: #ddd2ea;
  --shadow-hard: rgba(42, 33, 64, 0.07);
  --line: #e4daef;
  --hud-surface: #fffaf3;
  --hud-shadow: 0 1px 2px rgba(42, 33, 64, 0.06), 0 6px 18px rgba(42, 33, 64, 0.08);
  --hud-shadow-strong: 0 2px 6px rgba(42, 33, 64, 0.08), 0 18px 48px rgba(42, 33, 64, 0.16);
  --hud-accent: #6f57ae;
  --hud-accent-pale: #ece4fa;
  --hud-text-pale: #665d7f;
}
html[data-theme='nuit'] {
  --outline: #463d72;
  --shadow-hard: rgba(0, 0, 0, 0.22);
  --line: #43396a;
  --hud-surface: #2a2244;
  --hud-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 6px 18px rgba(0, 0, 0, 0.25);
  --hud-shadow-strong: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 48px rgba(0, 0, 0, 0.42);
  --hud-accent: #cdb8ff;
  --hud-accent-pale: #3d3468;
  --hud-text-pale: #b7abd3;
}
svg.ico-lisse { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }

/* boutons : bordure fine, ombre douce, toujours 44 px de haut */
.btn { border-width: 1.5px; border-radius: 999px; box-shadow: 0 2px 6px var(--shadow-hard); transition: transform 0.12s, box-shadow 0.15s, background-color 0.15s, border-color 0.15s; }
.btn:hover { border-color: var(--lav); }
.btn:active { transform: translateY(1px) scale(0.98); box-shadow: 0 1px 3px var(--shadow-hard); }
.btn.small { box-shadow: 0 1px 4px var(--shadow-hard); }
.btn.primary { border-color: transparent; box-shadow: 0 2px 0 rgba(217, 102, 140, 0.3), 0 8px 20px rgba(217, 102, 140, 0.18); }
.btn.round, .btn.icon-only { border-radius: 50%; }
.btn .px-icon.ico-lisse, .nav-tab .ico-lisse { width: 22px; height: 22px; }
.btn.small .ico-lisse { width: 18px; height: 18px; }
.btn:focus-visible, .nav-tab:focus-visible { outline: 3px solid var(--hud-accent); outline-offset: 2px; }
.pill { border-width: 1.5px; border-color: transparent; }
input, select, textarea { border-width: 1.5px; border-radius: 12px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--hud-accent-pale); border-color: var(--lav-2); }

/* écran de jeu : fond crème et lavande (thème Clair), nuit étoilée (thème Nuit) */
.game { background: linear-gradient(180deg, #efe5f7, #f7eee4); color: var(--text); }
html[data-theme='nuit'] .game { background: linear-gradient(180deg, #1c2050, #2a2559); }

/* barre du haut : surface claire, salle actuelle en pastille, accès rapides arrondis */
.topbar { background: color-mix(in srgb, var(--hud-surface) 94%, transparent); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 var(--shadow-hard); gap: 10px; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); color: var(--text); }
.room-title { flex: 0 1 auto; padding: 4px 16px 4px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface-raised); box-shadow: var(--hud-shadow); cursor: pointer; transition: border-color 0.15s; }
.room-title:hover, .room-title:focus-visible { border-color: var(--lav); outline: none; }
.room-title:focus-visible { box-shadow: 0 0 0 3px var(--hud-accent-pale); }
.room-title strong { color: var(--text); }
.room-title .muted { color: var(--hud-text-pale); opacity: 1; font-weight: 700; }
.topbar .spacer { flex: 1 1 auto; }
.topbar .top-icon { width: 44px; min-height: 44px; border-radius: 50%; background: var(--surface-raised); box-shadow: var(--hud-shadow); }
.topbar .top-icon .ico-lisse { width: 21px; height: 21px; }
.count-badge { background: var(--rose-2); color: #fff; border: 0; box-shadow: 0 0 0 2px var(--hud-surface); }
#live-pill { border: 0; padding: 6px 12px; box-shadow: var(--hud-shadow); cursor: pointer; }
.me-chip { background: var(--surface-raised); border: 1.5px solid var(--line); border-radius: 999px; padding: 3px 14px 3px 3px; box-shadow: var(--hud-shadow); }
.me-chip-av { border: 0; box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 4px var(--rose); background: var(--hud-accent-pale); }
.me-chip-row strong, .me-chip-name { color: var(--text); }
.lvl-badge { color: #fff; background: var(--lav-2); border: 0; border-radius: 999px; padding: 3px 8px; }
html[data-theme='nuit'] .lvl-badge { background: #6b55a8; }
/* Boost d'XP pendant le live (même pastille que « EN DIRECT », plus discrète) */
.xp-boost { font: 800 11px/1 var(--font); color: #fff; background: var(--live); border-radius: 999px; padding: 3px 7px; white-space: nowrap; letter-spacing: 0.02em; box-shadow: 0 0 0 2px rgba(224, 90, 116, 0.25); animation: xp-boost-pulse 2.4s ease-in-out infinite; }
.xp-boost[hidden] { display: none; }
@keyframes xp-boost-pulse { 50% { box-shadow: 0 0 0 4px rgba(224, 90, 116, 0.12); } }
@media (prefers-reduced-motion: reduce) { .xp-boost { animation: none; } }
.xp-bar { background: var(--hud-accent-pale); }
.xp-bar > span { background: linear-gradient(90deg, var(--lav-2), var(--rose-2)); }
.linkish { color: var(--hud-accent); }
.sim-banner, .announce { border-bottom: 1px solid var(--line); }
.sim-banner { background: var(--tint-amber); }

/* salle : boutons de zoom, barre des gestes, barres flottantes */
.zoom-ctrl .btn.round { background: var(--hud-surface); border-color: var(--line); box-shadow: var(--hud-shadow); font-weight: 700; }
.actionbar { background: transparent; border: 0; box-shadow: none; padding: 0; gap: 6px; }
.actionbar .btn { min-height: 40px; padding: 0 14px 0 10px; background: color-mix(in srgb, var(--hud-surface) 94%, transparent); border-color: var(--line); box-shadow: var(--hud-shadow); font-weight: 700; }
.actionbar .btn:hover { background: var(--tint-rose); }
.actionbar .btn .ico-lisse { color: var(--rose-2); width: 20px; height: 20px; }
.edit-bar, .tour, .photo-bar, .conn, .ctx-menu, .react-menu { border-width: 1.5px; border-color: var(--line); box-shadow: var(--hud-shadow-strong); border-radius: 18px; }
.photo-bar { background: var(--hud-surface); }
.tip { border-radius: 12px; box-shadow: var(--hud-shadow); }
.toast { border-width: 1.5px; border-color: var(--line); border-radius: 14px; box-shadow: var(--hud-shadow-strong); }

/* barre d'accès principale : dock arrondi, onglet ouvert en lavande */
.mainnav { background: var(--hud-surface); border: 1.5px solid var(--line); border-radius: 22px; box-shadow: var(--hud-shadow-strong); padding: 6px; gap: 2px; margin: 4px auto 10px; }
.nav-tab { color: var(--text-soft); border: 0; border-radius: 16px; min-width: 76px; font-size: 12.5px; transition: background 0.15s, color 0.15s; }
.nav-tab:hover { background: var(--surface-hover); color: var(--text); }
.nav-tab.on, .nav-tab[aria-expanded='true'] { background: var(--hud-accent-pale); color: var(--hud-accent); }
.nav-tab .count-badge { right: 12px; }

/* chat : colonne claire, règle du live encadrée, messages aérés */
.resizer { background: var(--line); width: 4px; }
.resizer:hover, .resizer:focus-visible { background: var(--lav); }
.chat-panel { background: var(--hud-surface); border-left: 1px solid var(--line); }
.chat-head { background: transparent; border-bottom: 1px solid var(--line); padding: 10px 12px 10px 16px; }
#chat-title { font-size: 16px; }
.chip { border: 0; background: var(--hud-accent-pale); color: var(--text); padding: 2px 9px; }
.chat-tabs { background: transparent; border-bottom: 1px solid var(--line); padding: 8px 10px; gap: 4px; }
.chat-tab { border: 0; border-radius: 999px; background: var(--surface-hover); min-height: 36px; }
.chat-tab[aria-selected='true'], #tab-twitch[aria-selected='true'] { background: var(--twitch); color: #fff; border: 0; }
.chat-rule { border-width: 1.5px; border-color: color-mix(in srgb, var(--twitch) 45%, var(--line)); background: color-mix(in srgb, var(--twitch) 12%, var(--hud-surface)); font-weight: 600; border-radius: 14px; }
.chat-draft { border-width: 1.5px; border-radius: 14px; }
.chat-log { padding: 10px 12px; }
.msg { padding: 4px 8px; border-radius: 10px; }
.msg + .msg { margin-top: 3px; }
.msg.system { background: var(--tint-lav); font-style: normal; }
.chat-form { gap: 8px; padding: 10px 12px 6px; border-top: 1px solid var(--line); }
.chat-form input { border-radius: 999px; padding: 0 16px; }
.chat-hint { color: var(--hud-text-pale); }
#chat-collapse { border-radius: 50%; width: 36px; padding: 0; }

/* Salon du Live : écran arrondi, sans rideaux */
.cinema { background: transparent; border-bottom: 0; }
.cinema-frame { border: 0; border-radius: 18px; overflow: hidden; box-shadow: var(--hud-shadow-strong); }
body.is-live .cinema-frame { box-shadow: var(--hud-shadow-strong), 0 0 0 3px rgba(224, 90, 116, 0.55); }
.cinema-frame::before, .cinema-frame::after, .marquee { display: none; }
.player-offline, .player-start { background: linear-gradient(160deg, #2a2f5e, #343a6e 60%, #463f78); color: #fff6ea; }
.cinema-tools .fine { color: var(--hud-text-pale); opacity: 1; }
.cinema-tools .btn { background: var(--hud-surface); }

/* fenêtres : surface claire, en-tête aéré ; sur ordinateur, posées à gauche du chat (la salle reste visible) */
.modal { border: 1.5px solid var(--line); border-radius: 22px; box-shadow: var(--hud-shadow-strong); }
.modal::backdrop { background: rgba(42, 33, 64, 0.16); }
html[data-theme='nuit'] .modal::backdrop { background: rgba(8, 6, 20, 0.45); }
.modal-head { background: transparent; border-bottom: 1px solid var(--line); padding: 12px 12px 12px 18px; }
#modal-close { border-radius: 50%; width: 40px; min-height: 40px; box-shadow: none; }
/* fenêtres courantes (salles, amis, réglages…) : posées à gauche du chat ; les grands écrans (profil, boutique,
   progression, badges) restent centrés */
@media (min-width: 1100px) {
  body:not(.on-landing) #modal:not(.see-through):not(:has(.prog, .shop-layout, .profile-panel, .badge-manager, .badge-admin, .nav-cocon)) {
    margin: calc(var(--top-h) + 14px) calc(var(--chat-w) + 24px) auto auto;
    width: min(600px, calc(100vw - var(--chat-w) - 48px));
    max-height: calc(100vh - var(--top-h) - 110px);
  }
  body:not(.on-landing) #modal.wide:not(.see-through):not(:has(.prog, .shop-layout, .profile-panel, .badge-manager, .badge-admin, .nav-cocon, .csx)) { width: min(820px, calc(100vw - var(--chat-w) - 48px)); }
}
.room-item, .item-card, .announce-card { border-width: 1.5px; border-color: var(--line); box-shadow: 0 1px 3px var(--shadow-hard); border-radius: 16px; }
.room-item:hover, .room-item:focus-visible, .item-card:hover, .item-card:focus-visible { box-shadow: 0 0 0 3px var(--hud-accent-pale); border-color: var(--lav); }
.notice-box { border-width: 1.5px; border-radius: 14px; }
.setting { border-bottom-color: var(--line); }

/* téléphone : navigation compacte, tiroir du chat arrondi */
@media (max-width: 900px) {
  .topbar { padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); gap: 6px; }
  .room-title { padding: 3px 12px 3px 12px; }
  .me-chip { padding: 2px; }
  .mainnav { margin: 0; border-radius: 0; border-width: 1px 0 0; box-shadow: none; padding: 4px 4px max(4px, env(safe-area-inset-bottom)); width: 100%; justify-content: space-around; }
  .nav-tab { min-width: 0; flex: 1; min-height: 50px; }
  .chat-panel { border: 1.5px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(42, 33, 64, 0.16); }
  .actionbar .btn { padding: 0 12px; }
}
@media (max-width: 480px) {
  .room-title { max-width: 46vw; }
}

/* Nouveau personnage (portraitKit) : image lisse, jamais pixelisée */
.profile-stage-cv:not(.px), .me-chip-av:not(.px) { image-rendering: auto; }

/* ---------------------------------------------------------------- Vestiaire du personnage « kit »
   Modèle A « Cabine » (choisi par la propriétaire) : rail de catégories à gauche, miroir, grille aérée,
   couleurs sous la grille, barre d'action fixe en bas. Jetons du « Verre de nuit » (thèmes Nuit et Clair). */
.wk {
  --wk-line: var(--glass-line, var(--line));
  --wk-faint: var(--g-faint, var(--chip-bg));
  --wk-sel: var(--g-sel, var(--hi-bg));
  --wk-sel-line: var(--g-sel-line, var(--outline));
  --wk-ring: var(--g-ring, var(--lav));
  --wk-grad: var(--grad, var(--btn-primary));
  display: grid; grid-template-columns: 84px 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas: 'rail miroir panneau' 'rail miroir couleurs' 'barre barre barre';
  height: clamp(460px, calc(94vh - 170px), 720px); min-width: 0;
  border: 1px solid var(--wk-line); border-radius: 22px; background: var(--wk-faint); overflow: hidden;
}
#modal:has(.wk) { max-height: min(94vh, 900px); }
.wk button { font: inherit; color: inherit; cursor: pointer; }
.wk button:disabled { cursor: default; opacity: 0.5; }
.wk button:focus-visible, .wk input:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.wk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wk-rangee { display: flex; gap: 8px; align-items: center; }

/* puces et segments */
.wk-mes-tenues, .wk-puce, .wk-seg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--wk-line); background: var(--wk-faint); color: var(--text-soft, var(--text)); white-space: nowrap; }
.wk-mes-tenues { padding: 8px 14px; flex: none; }
.wk-mes-tenues.on, .wk-puce.on { background: var(--wk-sel); border-color: var(--wk-sel-line); color: var(--text); }
.wk-point { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; }

/* rail des catégories : mini-vignette de la pièce portée */
.wk-rail { grid-area: rail; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-right: 1px solid var(--wk-line); overflow-y: auto; scrollbar-width: none; }
.wk-cat { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px; border: 0; border-radius: 16px; background: none; font-size: 11px; font-weight: 800; color: var(--muted); }
.wk-cat:hover { background: var(--g-hover, var(--chip-bg)); }
.wk-cat-ico { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 15px; background: var(--wk-faint); border: 1px solid var(--wk-line); overflow: hidden; }
.wk-cat-ico canvas { width: 40px; height: 40px; }
.wk-cat.on { color: var(--text); }
.wk-cat.on .wk-cat-ico { background: var(--wk-grad); border-color: transparent; color: var(--btn-primary-text, #1d1838); box-shadow: 0 4px 12px var(--g-shade, rgba(0, 0, 0, 0.25)); }

/* miroir */
.wk-miroir { grid-area: miroir; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-right: 1px solid var(--wk-line); min-height: 0; }
.wk-cadre { position: relative; flex: 1; min-height: 0; border-radius: 20px; border: 1px solid var(--wk-line); background: radial-gradient(ellipse at 50% 86%, var(--stage-in) 0 28%, var(--stage-out) 72%); overflow: hidden; }
.wk-scene { position: absolute; inset: 0; margin: auto; width: 100%; height: 100%; object-fit: contain; }
.wk-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; }
.wk-rond { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--wk-line); background: var(--glass, var(--panel)); font-size: 17px; font-weight: 900; line-height: 1; flex: none; }
.wk-court { display: none; }
.wk-segments { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--wk-line); background: var(--wk-faint); justify-content: center; max-width: 100%; }
.wk-segments .wk-seg { border-color: transparent; background: none; padding: 6px 10px; }
.wk-sous .wk-seg { padding: 5px 11px; }
.wk-seg.on { background: var(--wk-sel); border-color: var(--wk-sel-line); color: var(--text); }
.wk-segments .wk-seg.on { background: var(--wk-grad); color: var(--btn-primary-text, #1d1838); border-color: transparent; }
.wk-tenue-portee { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; max-height: 96px; overflow-y: auto; scrollbar-width: thin; }
.wk-puce { font-size: 11px; padding: 4px 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* panneau : filtres et grille */
.wk-panneau { grid-area: panneau; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 0; min-height: 0; min-width: 0; }
.wk-filtres { display: flex; flex-direction: column; gap: 8px; }
.wk-ligne { flex-wrap: wrap; }
.wk-recherche { position: relative; flex: 1 1 200px; min-width: 0; display: flex; align-items: center; }
.wk-recherche::before { content: '⌕'; position: absolute; left: 14px; top: 50%; transform: translateY(-54%); color: var(--muted); font-size: 18px; font-weight: 900; pointer-events: none; }
.wk .wk-champ { width: 100%; min-width: 0; font: inherit; font-size: 14px; padding: 9px 14px; border-radius: 999px !important; background: var(--field-bg); color: var(--field-text, var(--text)); }
.wk-recherche .wk-champ { padding-left: 38px; }
.wk-sous { display: flex; gap: 5px; flex-wrap: wrap; }
.wk-titre { margin: 2px auto 0 0; font-size: 16px; display: flex; flex-direction: column; gap: 2px; }
.wk-titre-sous { font-size: 12px; font-weight: 700; color: var(--muted); }
.wk-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 12px; overflow-y: auto; min-height: 0; flex: 1; padding: 3px 4px 14px 3px; overscroll-behavior: contain; scrollbar-width: thin; }
.wk-carte { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 0; border-radius: 16px; border: 1px solid var(--wk-line); background: var(--wk-faint); overflow: hidden; min-width: 0; text-align: left; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.wk-carte:hover { transform: translateY(-2px); box-shadow: 0 6px 16px var(--g-shade, rgba(0, 0, 0, 0.2)); }
.wk-vign { display: grid; place-items: center; aspect-ratio: 1; background: radial-gradient(circle at 50% 60%, var(--g-hover, var(--chip-bg)), transparent 70%); }
.wk-vign canvas { width: 100%; height: 100%; }
.wk-vign.haute { aspect-ratio: 128 / 186; }
.wk-nom { font-size: 12px; font-weight: 800; padding: 6px 9px 9px; color: var(--text-soft, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-carte.portee { border-color: transparent; box-shadow: 0 0 0 2px var(--wk-ring); background: var(--wk-sel); }
.wk-carte.portee .wk-nom { color: var(--text); }
.wk-carte.essai { box-shadow: 0 0 0 2px var(--amber); }
.wk-carte.verrou canvas { opacity: 0.5; filter: saturate(0.4); }
.wk-badge { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--wk-grad); color: var(--btn-primary-text, #1d1838); font-size: 12px; font-weight: 900; }
.wk-etat { position: absolute; top: 7px; right: 7px; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--amber); color: #2a2140; }
.wk-etat.wk-lock { background: rgba(10, 8, 26, 0.6); color: #f4effc; }
.wk-etat svg { width: 12px; height: 12px; }
.wk-retirer .wk-vign { color: var(--muted); }
.wk-croix { font-size: 34px; line-height: 1; font-weight: 800; }
.wk-vide { grid-column: 1 / -1; color: var(--muted); }
.wk-tenue { display: flex; flex-direction: column; gap: 6px; }
.wk-ranger { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px; border-radius: 16px; border: 1px dashed var(--wk-line); }
.wk-ranger .wk-champ { flex: 1 1 180px; width: auto; }
.wk-ranger .fine { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12px; }

/* couleurs */
.wk-couleurs { grid-area: couleurs; display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 12px; border-top: 1px solid var(--wk-line); min-width: 0; }
.wk-couleurs[hidden] { display: none; }
.wk-couleurs-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wk-etiquette { font-size: 11px; font-weight: 900; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.wk-piece { font-size: 13px; margin-right: auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-lien { flex: none; border: 0; background: none; padding: 4px 2px; font-size: 12px; font-weight: 800; color: var(--accent-text, var(--text)); text-decoration: underline; text-underline-offset: 3px; }
.wk-pal-ligne { min-width: 0; }
.wk-palette { display: flex; gap: 7px; overflow-x: auto; padding: 5px 4px 6px; scrollbar-width: thin; min-width: 0; flex: 1; }
.wk-teinte { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); padding: 0; display: grid; place-items: center; }
html[data-theme='clair'] .wk-teinte { border-color: rgba(42, 33, 64, 0.2); }
.wk-teinte[aria-checked='true'] { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--wk-ring); }
.wk-teinte[aria-checked='true']::after { content: '✓'; font-size: 13px; font-weight: 900; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.wk-perso { flex: none; display: inline-flex; }
.wk-perso input { width: 34px; height: 30px; padding: 0; border-radius: 10px !important; background: none; cursor: pointer; }

/* barre d'action */
.wk-barre { grid-area: barre; display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--wk-line); background: var(--g-bar, var(--panel)); }
.wk-statut { margin: 0 auto 0 0; font-size: 12px; font-weight: 800; color: var(--ok-text); min-width: 0; }
.wk-statut.sale, .wk-statut.envoi { color: var(--warn-text); }
.wk-statut.erreur { color: var(--err-text, #c0384a); }
.wk-barre .btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 9px 18px; font-weight: 800; }
.wk-barre .wk-enregistrer:not(:disabled) { background: var(--wk-grad); color: var(--btn-primary-text, #1d1838); border-color: transparent; }

/* téléphone et fenêtre étroite : tout en colonne, rail en bandeau, barre collée en bas */
@media (max-width: 760px) {
  #modal .modal-body:has(.wk) { padding: 10px 10px 0; }
  .wk-long { display: none; }
  .wk-court { display: inline; }
  .wk { display: flex; flex-direction: column; height: auto; min-height: 0; border-radius: 18px; overflow: visible; }
  .wk-rail { flex-direction: row; padding: 8px; border-right: 0; border-bottom: 1px solid var(--wk-line); overflow-x: auto; overflow-y: hidden; }
  .wk-cat { flex: 1 1 0; min-width: 48px; padding: 6px 1px; font-size: 10.5px; }
  .wk-cat-ico { width: 42px; height: 42px; }
  .wk-cat-ico canvas { width: 40px; height: 40px; }
  .wk-miroir { display: grid; grid-template-columns: 128px minmax(0, 1fr); grid-template-rows: 1fr; gap: 8px 10px; padding: 10px; border-right: 0; border-bottom: 1px solid var(--wk-line); }
  .wk-cadre { height: 200px; flex: none; }
  .wk-zoom { top: 6px; right: 6px; }
  .wk-zoom .wk-rond { width: 30px; height: 30px; }
  .wk-recherche { flex-basis: 100%; }
  .wk-mes-tenues { margin-left: auto; padding: 7px 11px; }
  .wk-mes-tenues i { display: none; }
  .wk-tenue-portee { justify-content: flex-start; align-content: flex-start; max-height: 200px; }
  .wk-panneau { padding: 10px 10px 0; }
  .wk-grille { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 52vh; flex: none; }
  .wk-nom { font-size: 11px; padding: 5px 7px 7px; }
  .wk-couleurs { padding: 10px; }
  .wk-pal-ligne { flex-wrap: wrap; }
  .wk-palette { flex-basis: 100%; flex-wrap: wrap; overflow: visible; }
  .wk-barre { position: sticky; bottom: 0; z-index: 2; flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px; border-radius: 0 0 18px 18px; background: var(--g-solid, var(--panel)); }
  .wk-statut { flex-basis: 100%; font-size: 11px; line-height: 1.25; }
  .wk-barre .btn { flex: 1 1 0; justify-content: center; min-height: 44px; padding: 8px 10px; font-size: 13px; }
  .wk-seg, .wk-rond { min-height: 36px; }
}

/* Compagnons rendus dans Blender : portraits définis à la taille de l'écran, réduits avec lissage (jamais « pixelated ») */
canvas.portrait-lisse { image-rendering: auto !important; height: auto; }
.opt-row .opt canvas.portrait-lisse { width: 34px !important; }

/* Son de la Bulle ASMR : bouton dans la barre du haut (seulement dans la salle), son panneau et le même bloc dans les Réglages */
.topbar .bulle-son:not(.on) { opacity: 0.6; }
.topbar .bulle-son:not(.on) .ico-lisse { clip-path: polygon(0 0, 62% 0, 62% 100%, 0 100%); }
.son-panel { position: fixed; z-index: 42; width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - 90px); overflow: auto; background: var(--panel); color: var(--text); border: 2px solid var(--outline); border-radius: 16px; box-shadow: 0 4px 0 var(--shadow-hard); padding: 14px; }
.son-close { position: absolute; top: 6px; right: 8px; width: 32px; height: 32px; border: 0; background: none; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.son-panel .son-head { padding-right: 30px; }
.son-controls { display: grid; gap: 12px; width: 100%; }
.son-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.son-head strong { display: block; font-size: 15px; }
.son-head .fine { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.son-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.son-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-raised); color: var(--text); cursor: pointer; font: inherit; }
.son-chip strong { font-size: 13.5px; }
.son-chip span { font-size: 11.5px; color: var(--muted); }
.son-chip[aria-pressed='true'] { border-color: var(--lav); background: var(--hud-accent-pale); }
.setting-son { display: block; }
.setting-son > .fine { margin: 8px 0 0; }
.vol-row { display: flex; align-items: center; gap: 10px; }
.vol-row span { flex: none; font-size: 12px; }
.vol-range { flex: 1 1 auto; min-width: 0; accent-color: var(--lav); }
.son-controls .vol-row { margin: 0; }
/* Vitesse des gains (Administration › Crédits) */
.adm-eco { gap: 6px; margin-bottom: 12px; }
.adm-eco strong { font-size: 14px; color: var(--text); }
