/* Kafmonde — mise en page. Nuit violette de l'univers Kafkalino, or du logo Immigré, néon rose.
   Une seule colonne calée sur la toile (16:9) : l'en-tête au-dessus, puis la barre du bas (le tchat,
   la danse, les smileys et les sons). app.js donne la taille de la toile dans --cw et --ch. */
@font-face { font-family: "Monde Oswald"; src: url("/assets/minigame/oswald-bold.ttf") format("truetype"); font-weight: 700; font-display: block; }

:root {
  --bg: #0d0a16;
  --surface: #191229;
  --surface-2: #231936;
  --surface-3: #2e2246;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .15);
  --text: #f7f2ff;
  --muted: #a99cc2;
  --gold: #ffd23e;
  --gold-2: #ffb81c;
  --pink: #ff5fb4;
  --violet: #8d5cff;
  --green: #50d2a0;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sign: "Monde Oswald", "Oswald", Impact, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Grille ---------- */
.monde {
  --cw: 960px;
  --ch: 540px;
  display: grid;
  grid-template-columns: var(--cw);
  grid-template-rows: auto var(--ch) auto;
  grid-template-areas: "top" "stage" "bottom";
  justify-content: center;
  align-content: center;
  gap: 12px;
  height: 100vh;
  height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(80% 55% at 50% -12%, rgba(141, 92, 255, .24), transparent 62%),
    radial-gradient(60% 45% at 50% 112%, rgba(255, 95, 180, .12), transparent 60%),
    var(--bg);
}

/* ---------- En-tête ---------- */
.monde-top { grid-area: top; display: flex; align-items: center; gap: 12px; min-width: 0; }
.monde-brand { display: flex; align-items: center; gap: 11px; min-width: 0; margin-right: auto; color: inherit; text-decoration: none; }
.monde-brand-mark { flex: none; width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 210, 62, .5), 0 0 16px rgba(255, 184, 28, .35); transition: box-shadow .2s, transform .2s; }
.monde-brand:hover .monde-brand-mark { box-shadow: 0 0 0 1px var(--gold), 0 0 22px rgba(255, 210, 62, .6); transform: rotate(-8deg); }
.monde-brand-text { display: grid; min-width: 0; line-height: 1.15; }
.monde-brand strong { font: 700 19px var(--sign); letter-spacing: .1em; background: linear-gradient(180deg, #fff6d6, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.monde-brand small { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.monde-brand small::before { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 6px var(--pink); content: ""; }

/* Le plan (présents dans tout le Kafmonde) et les amis (combien en ligne), sur deux lignes comme le logo. */
.monde-nav { display: flex; flex: none; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(25, 18, 41, .8); }
.monde-pill { position: relative; display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 13px 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); transition: background .15s, color .15s; }
.monde-pill:hover { background: var(--surface-3); color: var(--text); }
.monde-pill[aria-expanded="true"] { background: var(--surface-3); color: var(--gold); }
.monde-pill:active { transform: scale(.96); }
.monde-pill svg { flex: none; }
.monde-pill-text { display: grid; gap: 3px; text-align: left; line-height: 1; }
.monde-pill-text strong { color: var(--text); font: 700 13px/1 var(--sign); letter-spacing: .08em; text-transform: uppercase; }
.monde-pill[aria-expanded="true"] .monde-pill-text strong { color: var(--gold); }
.monde-pill-text small { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.monde-pill-text b { color: var(--text); font-weight: 800; }
.monde-pill-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.monde-pill[data-online="false"] .monde-pill-dot { background: #6f6585; box-shadow: none; }
.monde-pill[data-online="false"] .monde-pill-text b { color: var(--muted); }
/* Un ami vient d'arriver : le compteur s'allume un instant. */
.monde-pill.is-pulse { animation: monde-pill-pulse 1.4s ease-out; }
.monde-pill.is-pulse .monde-pill-dot { animation: monde-blink .35s ease-in-out 4; }
@keyframes monde-pill-pulse { 0% { box-shadow: 0 0 0 0 rgba(80, 210, 160, .7); background: rgba(80, 210, 160, .22); } 100% { box-shadow: 0 0 0 12px rgba(80, 210, 160, 0); } }
/* Kafkalino en direct : vers sa chaîne Twitch. */
.monde-live { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: #e91916; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; white-space: nowrap; box-shadow: 0 0 16px rgba(233, 25, 22, .5); }
.monde-live::before { width: 7px; height: 7px; border-radius: 50%; background: #fff; content: ""; animation: monde-blink 1.2s ease-in-out infinite; }
.monde-live:hover { filter: brightness(1.12); }

.monde-tools { display: flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(25, 18, 41, .8); }
.monde-tool { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; transition: background .15s, color .15s; }
.monde-tool:hover { background: var(--surface-3); color: var(--text); }
.monde-tool[aria-expanded="true"] { background: var(--surface-3); color: var(--gold); }
.monde-tool-wide { padding: 0 13px 0 10px; }
/* Actualiser : un point qui pulse quand une nouvelle version est en ligne ; la flèche tourne au clic. */
.monde-refresh-dot { position: absolute; top: 4px; right: 4px; display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px var(--surface); animation: monde-pulse .9s ease-in-out infinite alternate; }
.monde-refresh.is-new { color: var(--gold); }
.monde-refresh.is-new .monde-refresh-dot { display: block; }
.monde-refresh.is-spinning svg { animation: monde-spin .7s linear infinite; }
/* Mon niveau (anneau d'XP), mon titre et mes Kafpoints. */
.monde-me { position: relative; display: flex; flex: none; align-items: center; gap: 10px; height: 42px; padding: 3px 13px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(25, 18, 41, .8); color: var(--text); transition: border-color .15s, background .15s; }
.monde-needs { display: flex; flex: none; align-items: center; gap: 8px; }
/* Faim et soif : une icône et une jauge qui se vide ; le chiffre au survol, au clavier ou au toucher. */
.monde-need { position: relative; display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px 0 7px; border: 1px solid var(--line); border-radius: 999px; background: rgba(25, 18, 41, .8); color: #ffc45e; }
.monde-need[data-need="thirst"] { color: #5fd0ff; }
.monde-need svg { flex: none; }
.monde-need-bar { display: block; width: 38px; height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .14); }
.monde-need-bar i { display: block; height: 100%; border-radius: inherit; background: currentColor; transition: width .6s ease-out; }
.monde-need[data-level="1"] { color: #ff9a3c; }
.monde-need[data-level="2"], .monde-need[data-level="3"] { color: #ff4d6d; animation: monde-need-warn 1.1s ease-in-out infinite; }
.monde-need[data-level="3"] { border-color: #ff4d6d; }
.monde-need.is-gain { animation: monde-need-gain .9s ease-out; }
.monde-need::after { position: absolute; top: calc(100% + 6px); left: 50%; z-index: 6; padding: 3px 8px; border-radius: 8px; background: var(--surface-3); color: var(--text); font-size: 11px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); content: attr(data-label); opacity: 0; pointer-events: none; transform: translateX(-50%); transition: opacity .12s; }
.monde-need:hover::after, .monde-need:focus-visible::after, .monde-need[data-show="true"]::after { opacity: 1; }
@keyframes monde-need-warn { 50% { box-shadow: 0 0 0 3px rgba(255, 77, 109, .35); } }
@keyframes monde-need-gain { 0% { box-shadow: 0 0 0 0 rgba(120, 255, 170, .8); background: rgba(120, 255, 170, .28); } 100% { box-shadow: 0 0 0 10px rgba(120, 255, 170, 0); } }
.monde-me:hover, .monde-me[aria-expanded="true"] { border-color: rgba(255, 210, 62, .45); background: var(--surface-2); }
.monde-me-ring { position: relative; display: grid; flex: none; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: conic-gradient(from 200deg, var(--gold-2), #fff0a8, var(--gold), var(--gold-2)); }
.monde-me-ring::before { position: absolute; inset: 3px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4d3680, #1b1230); content: ""; }
.monde-me-ring b { position: relative; color: var(--gold); font: 700 12px/1 var(--sign); letter-spacing: .04em; }
.monde-me-text { display: grid; gap: 5px; min-width: 0; text-align: left; }
.monde-me-text strong { overflow: hidden; font: 700 16px/1 var(--sign); letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.monde-me-kp { display: flex; align-items: center; gap: 6px; padding-left: 11px; border-left: 1px solid var(--line); color: var(--gold); font-size: 13px; font-weight: 800; white-space: nowrap; }
.monde-coin { flex: none; width: 18px; height: 18px; }
/* Nouveauté pas encore ouverte : un point doré qui clignote. */
.monde-me[data-fresh="true"]::after { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--bg), 0 0 10px var(--gold); content: ""; animation: monde-blink 1.2s ease-in-out infinite; }

/* Des demandes d'ami en attente : leur nombre sur le bouton des amis. */
.monde-tool-badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--pink); color: #2a0718; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }

#mondeSoundOpen .monde-sound-off { display: none; }
#mondeSoundOpen[data-muted="true"] .monde-sound-off { display: inline; }
#mondeSoundOpen[data-muted="true"] .monde-sound-waves { display: none; }
/* Son pas encore débloqué par le navigateur : un point rose qui clignote. */
#mondeSoundOpen[data-locked="true"]::after { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px var(--surface), 0 0 8px var(--pink); content: ""; animation: monde-blink 1.2s ease-in-out infinite; }
@keyframes monde-blink { 50% { opacity: .35; } }

/* ---------- Boutons ---------- */
.monde-button { min-width: 38px; height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 700; transition: background .15s, border-color .15s, transform .1s; }
.monde-button:hover { border-color: rgba(255, 255, 255, .26); background: var(--surface-3); }
.monde-button:active, .monde-tool:active { transform: scale(.96); }
.monde-danger { border-color: rgba(255, 107, 122, .5); color: #ffb3bb; }
.monde-primary { height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #ffe27a, var(--gold-2)); color: #2a1900; font-size: 14px; font-weight: 800; box-shadow: 0 4px 16px rgba(255, 184, 28, .28), inset 0 -2px 0 rgba(0, 0, 0, .12); transition: filter .15s, transform .1s; }
.monde-primary:hover { filter: brightness(1.06); }
.monde-primary:active { transform: scale(.97); }
:is(.monde-button, .monde-primary, .monde-tool, .monde-pill, .monde-side button, .monde-send, .monde-log-open, .monde-close, .monde-brand, .monde-me, .monde-live, .monde-action, .monde-bar-item, .monde-line-name):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.monde-close { position: absolute; top: 10px; right: 10px; display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 18px; line-height: 1; }
.monde-close:hover { color: var(--text); background: var(--surface-3); }

/* ---------- Panneaux (son, fiche, apparence, aide, tuto) ---------- */
.monde-panel { border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(24, 17, 39, .97); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.monde-panel h2 { margin: 0 0 14px; color: var(--gold); font: 700 21px var(--sign); letter-spacing: .05em; }
kbd { display: inline-block; min-width: 24px; margin: 0 2px; padding: 1px 6px; border: 1px solid #4a3d66; border-bottom-width: 3px; border-radius: 6px; background: #2a2040; color: #fff; font: 700 12px var(--font); text-align: center; }

/* ---------- Barre du bas : le tchat, puis danse, smileys et sons ---------- */
.monde-bottom { grid-area: bottom; display: flex; align-items: center; gap: 10px; min-width: 0; }
.monde-side { position: relative; display: flex; flex: none; align-items: center; gap: 4px; height: 48px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(25, 18, 41, .88); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.monde-side > button { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 999px; transition: background .12s, border-color .12s, transform .12s; }
.monde-side > button:active { transform: scale(.94); }
.monde-dance { width: 38px; padding: 0; border: 1px solid rgba(141, 92, 255, .55); background: linear-gradient(180deg, rgba(141, 92, 255, .4), rgba(141, 92, 255, .18)); color: #f1e9ff; font-size: 13px; font-weight: 800; }
.monde-dance:hover { background: linear-gradient(180deg, rgba(141, 92, 255, .55), rgba(141, 92, 255, .25)); }
.monde-dance canvas { width: 26px; height: 26px; }
.monde-quick { width: 38px; padding: 0; border: 1px solid transparent; background: var(--surface-3); }
.monde-quick:hover, .monde-quick[aria-expanded="true"] { border-color: rgba(255, 210, 62, .45); background: rgba(255, 210, 62, .14); }
.monde-quick canvas { width: 26px; height: 26px; }

/* Les smileys : un petit menu au-dessus de la barre. */
.monde-emotes { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 7; display: grid; grid-template-columns: repeat(6, 44px); gap: 4px; padding: 8px; animation: monde-drop .15s ease-out; }
.monde-emotes button { position: relative; display: grid; width: 44px; height: 44px; padding: 0; place-items: center; border: 1px solid transparent; border-radius: 12px; background: rgba(255, 255, 255, .035); transition: background .12s, border-color .12s, transform .12s; }
.monde-emotes button:hover { border-color: var(--line-strong); background: var(--surface-3); transform: translateY(-1px); }
.monde-emotes button:active { transform: scale(.92); }
.monde-emotes canvas { width: 30px; height: 30px; }
.monde-gestes-open { font-size: 20px; line-height: 1; }
.monde-gestes { grid-template-columns: repeat(5, 58px); }
.monde-gestes button { width: 58px; height: 58px; align-content: center; gap: 3px; }
.monde-gestes span { font-size: 24px; line-height: 1; }
.monde-gestes small { color: var(--muted); font-size: 10px; font-weight: 800; }

/* La soundboard : les sons, puis les pastilles qui se rechargent (le titre « Sons » est caché). */
.monde-board { display: flex; align-items: center; gap: 8px; padding-left: 6px; border-left: 1px solid var(--line); }
.monde-board-pads { display: flex; gap: 4px; }
.monde-side-title { order: 2; display: flex; margin: 0 8px 0 0; font-size: 0; }
.monde-board-pips { display: flex; gap: 3px; }
.monde-board-pips i { width: 6px; height: 6px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 6px rgba(255, 95, 180, .75); transition: background .3s, box-shadow .3s; }
.monde-board-pips i.is-used { background: rgba(255, 255, 255, .14); box-shadow: none; }
.monde-pad { min-width: 50px; height: 38px; padding: 0 12px; overflow: hidden; border: 1px solid rgba(255, 95, 180, .5); border-radius: 999px; background: linear-gradient(180deg, rgba(255, 95, 180, .32), rgba(255, 95, 180, .12)); color: #ffe8f4; font: 700 14px var(--sign); letter-spacing: .05em; text-overflow: ellipsis; white-space: nowrap; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); transition: filter .12s, transform .12s, opacity .2s; }
.monde-pad:hover { filter: brightness(1.18); transform: translateY(-1px); }
.monde-pad.is-hit { animation: monde-pad-hit .35s ease-out; }
@keyframes monde-pad-hit { 0% { transform: scale(.9); box-shadow: 0 0 0 0 rgba(255, 95, 180, .7); } 100% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 95, 180, 0); } }
.monde-board.is-empty .monde-pad { opacity: .4; filter: saturate(.3); cursor: not-allowed; }

/* Les touches du clavier en petit dans le coin des smileys (seulement avec une souris). */
@media (hover: hover) and (pointer: fine) {
  .monde-emotes [data-key]::after { position: absolute; right: 4px; bottom: 2px; color: rgba(255, 255, 255, .32); font: 700 9px var(--font); content: attr(data-key); }
}

/* ---------- Scène ---------- */
.monde-stage { grid-area: stage; position: relative; display: grid; min-width: 0; min-height: 0; place-items: center; }
.monde-stage canvas#mondeCanvas { position: relative; display: block; border-radius: var(--radius); background: #120d1f; box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .07); }
.monde-status { position: absolute; top: 12px; left: 50%; z-index: 3; margin: 0; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(16, 11, 28, .88); color: #fff; font-size: 13px; font-weight: 700; transform: translateX(-50%); }
.monde-net { position: absolute; top: 12px; right: 12px; z-index: 3; margin: 0; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(16, 11, 28, .82); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.monde-net::before { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--muted); vertical-align: 1px; content: ""; }
.monde-net[data-tone="good"]::before { background: var(--green); box-shadow: 0 0 6px var(--green); }
.monde-net[data-tone="slow"]::before { background: var(--gold); }
.monde-net[data-tone="bad"]::before { background: #ff4d4d; box-shadow: 0 0 6px #ff4d4d; }
.monde-status[data-status="retry"], .monde-status[data-status="connecting"] { animation: monde-pulse 1s ease-in-out infinite alternate; }
.monde-status[data-status="off"] { background: rgba(120, 18, 40, .92); }
.monde-status-here { margin-left: 6px; padding: 3px 10px; border: 0; border-radius: 999px; background: var(--gold); color: #1a1420; font: 800 12px var(--font); cursor: pointer; }
@keyframes monde-pulse { to { opacity: .55; } }
.monde-toast { position: absolute; bottom: 14px; left: 50%; z-index: 3; margin: 0; padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; background: rgba(16, 11, 28, .92); font-size: 13px; font-weight: 600; transform: translateX(-50%); white-space: nowrap; animation: monde-fade .18s ease-out; }

.monde-loading { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; border-radius: var(--radius); background: var(--bg); }
.monde-loading span { width: 44px; height: 44px; border: 3px solid rgba(255, 210, 62, .25); border-top-color: var(--gold); border-radius: 50%; animation: monde-spin .8s linear infinite; }
@keyframes monde-spin { to { transform: rotate(360deg); } }
@keyframes monde-fade { from { opacity: 0; transform: translate(-50%, 4px); } }
@keyframes monde-drop { from { opacity: 0; transform: translateY(-6px); } }
@keyframes monde-pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } }
@keyframes monde-rise { from { opacity: 0; transform: translateY(14px); } }

/* Aide */
.monde-help { position: absolute; top: 50%; left: 50%; z-index: 5; width: min(430px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 22px 24px 20px; overflow: auto; transform: translate(-50%, -50%); animation: monde-pop .25s ease-out; }
.monde-help ul { display: grid; gap: 7px; margin: 0 0 16px; padding: 0; list-style: none; color: #e8e2f3; font-size: 14px; line-height: 1.45; }
.monde-help h3 { margin: 0 0 7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.monde-help footer { display: flex; justify-content: space-between; gap: 10px; }

/* Fiche d'un joueur */
.monde-card { position: absolute; top: 10px; right: 10px; z-index: 4; display: grid; justify-items: center; gap: 10px; width: 214px; padding: 18px 16px 16px; animation: monde-drop .18s ease-out; }
.monde-card-avatar { display: grid; width: 64px; height: 64px; place-items: center; overflow: hidden; border: 2px solid var(--gold); border-radius: 50%; background: var(--surface-3); color: var(--gold); font: 700 26px var(--sign); }
.monde-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.monde-card strong { max-width: 100%; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.monde-card-level { margin-top: -6px; color: var(--gold); font-size: 12px; font-weight: 700; }
.monde-card-actions { display: grid; gap: 6px; width: 100%; }
.monde-card-gestes { display: flex; justify-content: center; gap: 4px; width: 100%; }
.monde-card-gestes[hidden] { display: none; }
.monde-card-gestes button { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); font-size: 18px; line-height: 1; }
.monde-card-gestes button:hover { background: var(--surface-3); }
.monde-card-gestes button:active { transform: scale(.92); }
.monde-card-duel { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
.monde-card-duel[hidden] { display: none; }
.monde-card-duel span { flex-basis: 100%; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.monde-card-duel .monde-button { flex: 1; padding: 0 8px; }
.monde-card-duel .monde-button:disabled { opacity: .5; cursor: default; }

/* ---------- Défis : morpion et chifoumi (duels.js), en haut à gauche de la scène ---------- */
.monde-duel { position: absolute; top: 10px; left: 10px; z-index: 4; display: grid; justify-items: center; gap: 10px; width: 236px; padding: 16px 16px 14px; text-align: center; animation: monde-drop .18s ease-out; }
.monde-duel[hidden] { display: none; }
.monde-duel[data-state="ask"] { border-color: rgba(255, 210, 62, .45); }
.monde-duel h3 { margin: 0; color: var(--gold); font: 700 18px var(--sign); letter-spacing: .04em; }
.monde-duel-status { margin: -4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.monde-duel-body { display: grid; justify-items: center; gap: 8px; width: 100%; }
.monde-duel-grid { display: grid; grid-template-columns: repeat(3, 56px); grid-auto-rows: 56px; gap: 5px; }
.monde-duel-grid button { padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); font: 700 30px var(--sign); line-height: 1; transition: background .12s, border-color .12s, transform .1s; }
.monde-duel-grid button:not(:disabled):hover { border-color: rgba(255, 210, 62, .45); background: var(--surface-3); }
.monde-duel-grid button:not(:disabled):active { transform: scale(.94); }
.monde-duel-grid .is-x { color: var(--pink); }
.monde-duel-grid .is-o { color: #62d9ff; }
.monde-duel-grid .is-row { border-color: var(--gold); background: rgba(255, 210, 62, .16); box-shadow: 0 0 12px rgba(255, 210, 62, .35); }
.monde-duel-score { font: 700 30px var(--sign); letter-spacing: .06em; }
.monde-duel-last { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.monde-duel-hands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.monde-duel-hands button { display: grid; gap: 3px; padding: 8px 2px 6px; place-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 11px; font-weight: 700; transition: background .12s, border-color .12s, transform .1s; }
.monde-duel-hands button span { font-size: 26px; line-height: 1; }
.monde-duel-hands button:not(:disabled):hover { border-color: rgba(255, 210, 62, .45); background: var(--surface-3); }
.monde-duel-hands button:not(:disabled):active { transform: scale(.94); }
.monde-duel-hands button:disabled { opacity: .45; }
.monde-duel-hands .is-mine, .monde-duel-hands .is-mine:disabled { border-color: var(--gold); background: rgba(255, 210, 62, .16); opacity: 1; }
.monde-duel :is(.monde-duel-grid, .monde-duel-hands) button:disabled { cursor: default; }
.monde-duel :is(.monde-duel-grid, .monde-duel-hands) button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.monde-duel-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
/* La manche du chifoumi en spectacle : les poings secouent (chi… fou… mi !), les mains s'ouvrent, puis la
   gagnante écrase l'autre (à égalité, elles se cognent deux fois). Le score saute ensuite. C'est le jeu
   lui-même, comme les personnages : il reste animé même quand l'appareil demande moins d'animations
   (d'où les !important, plus précis que la règle qui coupe tout en bas). */
.monde-duel-arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; max-width: 280px; min-height: 96px; }
.monde-duel-fighter { display: grid; justify-items: center; gap: 6px; min-width: 0; }
.monde-duel-fighter.is-me { --toward: 22px; --tilt: -10deg; }
.monde-duel-fighter.is-them { --toward: -22px; --tilt: 10deg; }
.monde-duel-fighter small { max-width: 76px; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.monde-duel-hand { display: block; font-size: 44px; line-height: 1; transform-origin: 50% 85%; }
.monde-duel-hand i { display: block; font-style: normal; }
.monde-duel-fighter.is-them .monde-duel-hand i { transform: scaleX(-1); }
.monde-duel-chant { min-width: 74px; color: var(--gold); font: 700 19px var(--sign); letter-spacing: .04em; text-align: center; }
.monde-duel-arena[data-phase="shake"] .monde-duel-hand { animation: monde-duel-shake .45s ease-in-out 3 !important; }
.monde-duel-arena[data-phase="shake"] .monde-duel-chant { animation: monde-duel-chant .45s ease-out 3 !important; }
.monde-duel-arena[data-phase="show"] .monde-duel-hand, .monde-duel-arena[data-phase="strike"] .monde-duel-chant { animation: monde-duel-open .35s cubic-bezier(.3, 1.7, .5, 1) both !important; }
.monde-duel-arena[data-result="win"] .is-me .monde-duel-hand, .monde-duel-arena[data-result="lose"] .is-them .monde-duel-hand { animation: monde-duel-smash .6s cubic-bezier(.3, 1.4, .5, 1) forwards !important; }
.monde-duel-arena[data-result="win"] .is-them .monde-duel-hand, .monde-duel-arena[data-result="lose"] .is-me .monde-duel-hand { animation: monde-duel-crushed .6s ease-in forwards !important; }
.monde-duel-arena[data-result="tie"] .monde-duel-hand { animation: monde-duel-clash .5s ease-in-out 2 !important; }
.monde-duel-arena[data-result="win"] .monde-duel-chant { color: var(--green); }
.monde-duel-arena[data-result="lose"] .monde-duel-chant { color: var(--pink); }
.monde-duel-score.is-bump { animation: monde-duel-bump .55s ease-out !important; }
@keyframes monde-duel-shake { 0%, 100% { transform: none; } 40% { transform: translateY(-18px) rotate(var(--tilt)); } 75% { transform: translateY(5px); } }
@keyframes monde-duel-chant { from { opacity: .4; transform: scale(1.25); } }
@keyframes monde-duel-open { from { opacity: .2; transform: scale(.35); } }
@keyframes monde-duel-smash { 45% { transform: translate(calc(var(--toward) * 1.6), -10px) scale(1.35) rotate(calc(var(--tilt) * -1)); } 100% { transform: translateX(calc(var(--toward) * .6)) scale(1.2); } }
@keyframes monde-duel-crushed { 0%, 35% { transform: none; } 55% { transform: translateY(12px) scale(1.15, .4); } 100% { opacity: .45; filter: grayscale(1); transform: translateY(12px) scale(1, .5); } }
@keyframes monde-duel-clash { 0%, 100% { transform: none; } 45% { transform: translateX(var(--toward)) rotate(calc(var(--tilt) * -1)); } 65% { transform: translateX(calc(var(--toward) * -.3)); } }
@keyframes monde-duel-bump { 40% { color: var(--gold); transform: scale(1.35); } }

/* Ma fiche : niveau, XP, ce qui en rapporte, Kafpoints */
.monde-profile { position: absolute; top: 10px; right: 10px; z-index: 5; display: grid; gap: 12px; width: min(300px, calc(100% - 20px)); max-height: calc(100% - 20px); padding: 18px 18px 16px; overflow: auto; animation: monde-drop .18s ease-out; }
.monde-profile-head { display: flex; align-items: center; gap: 13px; padding-right: 30px; }
.monde-profile-ring { width: 60px; height: 60px; box-shadow: 0 0 22px rgba(255, 210, 62, .25); }
.monde-profile-ring::before { inset: 5px; }
.monde-profile-ring b { font-size: 20px; }
.monde-profile-head small { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.monde-profile h2 { margin: 2px 0 0; font-size: 23px; line-height: 1.1; }
.monde-profile-facts { display: grid; gap: 8px; margin: 0; padding: 0; color: #e8e2f3; font-size: 13px; line-height: 1.4; list-style: none; }
.monde-profile-facts li { position: relative; padding-left: 14px; }
.monde-profile-facts li::before { position: absolute; top: .55em; left: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); content: ""; }
.monde-profile-wallet { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid rgba(255, 210, 62, .28); border-radius: 12px; background: linear-gradient(90deg, rgba(255, 210, 62, .12), rgba(141, 92, 255, .1)); }
.monde-profile-wallet canvas { width: 34px; height: 34px; }
.monde-profile-wallet p { margin: 0; font-size: 13px; font-weight: 700; }
.monde-profile-wallet strong { color: var(--gold); font: 700 22px var(--sign); letter-spacing: .02em; }
.monde-profile-wallet small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }

/* KafBar : la carte, néon cyan comme l'enseigne */
.monde-bar { position: absolute; top: 10px; right: 10px; z-index: 5; display: flex; flex-direction: column; width: min(344px, calc(100% - 20px)); max-height: calc(100% - 20px); padding: 16px 14px 12px; border-color: rgba(98, 217, 255, .4); box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 34px rgba(98, 217, 255, .14); animation: monde-drop .18s ease-out; }
.monde-bar header { display: flex; align-items: center; gap: 10px; margin: 0 36px 12px 4px; }
.monde-bar h2 { min-width: 0; margin: 0; color: #9eeaff; letter-spacing: .14em; text-shadow: 0 0 14px rgba(98, 217, 255, .7); }
.monde-bar[data-counter="dj"] h2 { color: #ffb0e6; text-shadow: 0 0 14px rgba(255, 95, 180, .75); }
.monde-bar[data-gift="true"] h2 { overflow: hidden; font-size: 17px; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.monde-bar-wallet { display: flex; align-items: center; gap: 6px; margin: 0 0 0 auto; color: var(--gold); font-size: 13px; font-weight: 800; white-space: nowrap; }
.monde-bar-menu { display: grid; gap: 6px; min-height: 0; margin: 0; padding: 0 2px 2px 0; overflow-y: auto; list-style: none; scrollbar-width: thin; scrollbar-color: #4a3d66 transparent; }
.monde-bar-item { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 11px; width: 100%; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .035); text-align: left; transition: background .15s, border-color .15s, transform .12s; }
.monde-bar-item:hover:not(:disabled) { border-color: rgba(98, 217, 255, .55); background: rgba(98, 217, 255, .1); transform: translateY(-1px); }
.monde-bar-item:active:not(:disabled) { transform: scale(.98); }
.monde-bar-item:disabled { cursor: not-allowed; opacity: .45; }
.monde-bar-item.is-round { border-color: rgba(255, 210, 62, .45); background: linear-gradient(90deg, rgba(255, 210, 62, .16), rgba(255, 95, 180, .1)); }
.monde-bar-icon { width: 46px; height: 46px; border-radius: 11px; background: radial-gradient(circle at 50% 65%, rgba(255, 196, 70, .28), rgba(10, 6, 20, .35) 70%); }
.monde-bar-text strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.monde-bar-text small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.3; }
.monde-bar-price { padding: 6px 10px; border-radius: 999px; background: linear-gradient(180deg, #ffe27a, var(--gold-2)); color: #2a1900; font-size: 12px; font-weight: 800; white-space: nowrap; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.monde-bar-note { margin: 10px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.monde-bar-note[data-error="true"] { color: #ffb3d7; }
/* Le sac à dos (inventaire.js) et les rayons du supermarché : mêmes lignes que le KafBar, d'autres couleurs. */
.monde-bag { position: relative; color: #ffb86b; cursor: pointer; }
.monde-bag-count { min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 800; line-height: 17px; text-align: center; }
.monde-shelf { border-color: rgba(120, 230, 150, .4); box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 34px rgba(120, 230, 150, .14); }
.monde-shelf h2 { color: #aaf3bf; text-shadow: 0 0 14px rgba(120, 230, 150, .6); }
.monde-shelf .monde-bar-item:hover:not(:disabled) { border-color: rgba(120, 230, 150, .6); background: rgba(120, 230, 150, .1); }
.monde-bag-panel { border-color: rgba(255, 184, 107, .45); box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 34px rgba(255, 150, 60, .14); }
.monde-bag-panel h2 { color: #ffd2a0; text-shadow: 0 0 14px rgba(255, 150, 60, .6); }
.monde-bag-panel .monde-bar-item:hover:not(:disabled) { border-color: rgba(255, 184, 107, .65); background: rgba(255, 184, 107, .1); }
/* La régie du studio Immigré (regie.js) : ce que passe le grand écran, pour tout le studio. */
.monde-regie { border-color: rgba(255, 210, 62, .45); box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 34px rgba(255, 180, 60, .16); }
.monde-regie h2 { color: var(--gold); text-shadow: 0 0 14px rgba(255, 170, 50, .7); }
.monde-regie-now { margin: 0 4px 10px; color: var(--text); font-size: 13px; line-height: 1.35; }
.monde-regie-now b { color: #ffe27a; }
.monde-regie-now small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.monde-regie-seek { display: grid; gap: 6px; margin: 0 2px 10px; }
.monde-regie-seek[hidden] { display: none; }
.monde-regie-track { display: flex; gap: 6px; align-items: center; }
.monde-regie-keys { display: flex; gap: 6px; }
.monde-regie-keys button { flex: 1 1 0; height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(255, 255, 255, .06); color: var(--text); font: 600 12px var(--font); }
.monde-regie-keys button:hover { background: rgba(255, 255, 255, .12); }
.monde-regie-keys .monde-regie-play { border-color: rgba(255, 210, 62, .55); color: #ffe27a; font-size: 14px; }
.monde-regie-bar { flex: 1 1 auto; min-width: 0; height: 24px; accent-color: var(--gold); cursor: pointer; }
.monde-regie-bar:disabled { opacity: .45; cursor: default; }
.monde-regie-time { flex: none; min-width: 64px; color: var(--muted); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; }
.monde-regie-form { display: flex; gap: 6px; margin: 0 2px; }
/* 16 px : Safari ne zoome pas la page en entrant dans le champ. */
.monde-regie-link { flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(0, 0, 0, .3); color: var(--text); font: 500 16px var(--font); outline: none; }
.monde-regie-link::placeholder { color: #7d7196; }
.monde-regie-link:focus { border-color: rgba(255, 210, 62, .7); }
.monde-regie-go { flex: none; height: 38px; padding: 0 14px; border: 0; border-radius: 10px; background: linear-gradient(180deg, #ffe27a, var(--gold-2)); color: #2a1900; font: 800 13px var(--font); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.monde-regie-hint { margin: 6px 4px 12px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.monde-regie-next { margin: 0 4px 6px; color: var(--gold); font: 700 13px var(--sign); letter-spacing: .1em; text-transform: uppercase; }
.monde-regie-queue { display: grid; gap: 6px; max-height: 210px; margin: 0 0 4px; padding: 0; overflow-y: auto; list-style: none; }
.monde-regie-entry { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 9px; align-items: center; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .04); }
.monde-regie-entry img { width: 64px; height: 36px; border-radius: 6px; object-fit: cover; background: #07040d; }
.monde-regie-entry strong { display: block; overflow: hidden; color: var(--text); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.monde-regie-entry small { color: var(--muted); font-size: 11.5px; }
.monde-regie-actions { display: flex; gap: 6px; }
.monde-regie-actions button { flex: 1 1 0; }
.monde-regie-skip, .monde-regie-stop { flex: none; height: 34px; margin-top: 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(255, 255, 255, .06); color: var(--text); font: 600 13px var(--font); }
:is(.monde-regie-skip, .monde-regie-stop):hover { background: rgba(255, 255, 255, .12); }
:is(.monde-regie-go, .monde-regie-skip, .monde-regie-stop, .monde-regie-link, .monde-regie-keys button, .monde-regie-bar):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Le bouton du moment (commander, trinquer), en bas à droite de la scène */
.monde-action { position: absolute; right: 14px; bottom: 14px; z-index: 3; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px 0 6px; border: 1px solid rgba(98, 217, 255, .6); border-radius: 999px; background: linear-gradient(180deg, rgba(52, 36, 84, .96), rgba(26, 18, 44, .96)); color: #eafaff; font-size: 14px; font-weight: 800; box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 20px rgba(98, 217, 255, .28); animation: monde-action-in .25s ease-out; transition: filter .15s, transform .1s; }
.monde-action[data-action="tchin"] { border-color: rgba(255, 210, 62, .7); color: #fff6d8; box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 20px rgba(255, 210, 62, .3); }
.monde-action:hover { filter: brightness(1.12); }
.monde-action:active { transform: scale(.96); }
.monde-action canvas { width: 34px; height: 34px; }
.monde-action span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes monde-action-in { from { opacity: 0; transform: translateY(8px) scale(.94); } }
@media (hover: none) { .monde-action kbd { display: none; } }

/* Apparence */
.monde-look { position: absolute; top: 50%; left: 50%; z-index: 5; width: min(560px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 18px 20px 20px; overflow: auto; transform: translate(-50%, -50%); animation: monde-pop .22s ease-out; }
.monde-look-body { display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: start; }
.monde-look-body canvas { width: 160px; height: 160px; border-radius: 14px; background: radial-gradient(circle at 50% 70%, #3b2470, #160d2e); box-shadow: inset 0 0 0 1px var(--line); }
.monde-look-options { display: grid; gap: 14px; }
.monde-look-group { display: flex; flex-wrap: wrap; gap: 6px; }
.monde-look-group small { flex-basis: 100%; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.monde-look-group button { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.monde-look-group button:hover { background: var(--surface-3); }
.monde-look-group button[style] { width: 30px; min-width: 30px; height: 30px; padding: 0; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.monde-look-group button[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.monde-look-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.monde-look-tabs button { height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; }
.monde-look-tabs button:hover { background: var(--surface-3); color: inherit; }
.monde-look-tabs button[aria-selected="true"] { border-color: var(--gold); background: var(--surface-3); color: var(--gold); }
.monde-look-page { display: grid; gap: 14px; }
.monde-look-page[hidden] { display: none; }

/* Amis : demandes reçues, la liste (en ligne d'abord, avec leur lieu), demandes envoyées */
.monde-friends { position: absolute; top: 10px; right: 10px; z-index: 5; display: flex; flex-direction: column; width: min(320px, calc(100% - 20px)); max-height: calc(100% - 20px); padding: 16px 14px 12px; animation: monde-drop .18s ease-out; }
.monde-friends h2 { margin: 0 40px 2px 4px; }
.monde-friends-sum { margin: 0 40px 12px 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.monde-friends-sum b { color: #9fe8c9; }
.monde-friends-body { display: grid; gap: 12px; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #4a3d66 transparent; }
.monde-friends h3, .monde-plan h3 { margin: 0 4px 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.monde-friends ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.monde-friend { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .03); }
.monde-friend-avatar { position: relative; display: grid; flex: none; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--gold); font: 700 15px var(--sign); }
.monde-friend-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.monde-friend[data-online="true"] .monde-friend-avatar::after { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--surface), 0 0 6px var(--green); content: ""; }
.monde-friend-text { display: grid; flex: 1; min-width: 0; }
.monde-friend-text strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.monde-friend-text small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.monde-friend[data-online="true"] small { color: #9fe8c9; }
.monde-friend-act { flex: none; min-width: 30px; height: 30px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 800; }
.monde-friend-act:hover { background: var(--surface-3); color: var(--text); }
.monde-friend-act.is-yes { border: 0; background: linear-gradient(180deg, #ffe27a, var(--gold-2)); color: #2a1900; }
.monde-friend-act.is-sure { border-color: rgba(255, 107, 122, .6); color: #ffb3bb; }
.monde-friends-empty { margin: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.monde-panel-note { margin: 10px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.monde-panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 10px; }
.monde-panel-foot .monde-panel-note { flex: 1 1 180px; margin: 0 4px; }
.monde-panel-foot .monde-button { flex: none; height: 32px; padding: 0 13px; font-size: 12px; }

/* Le plan : la grande rue en miniatures collées, le Plateau au-dessus, les intérieurs en dessous */
.monde-plan { position: absolute; top: 50%; left: 50%; z-index: 5; width: min(760px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 18px 20px 16px; overflow: auto; transform: translate(-50%, -50%); animation: monde-pop .22s ease-out; }
.monde-plan h2 { margin: 0 40px 2px 0; }
.monde-plan-sum { margin: 0 40px 14px 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.monde-plan-row { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.monde-plan-row.is-above { margin-bottom: 10px; }
.monde-plan-row.is-street { gap: 2px; margin-bottom: 16px; padding: 2px; border-radius: 14px; background: rgba(255, 255, 255, .08); }
.monde-plan-row.is-inside { gap: 8px; }
.monde-plan-name.monde-plan-name { white-space: normal; text-overflow: clip; }
.monde-plan-place { position: relative; display: flex; min-height: 54px; flex-direction: column; justify-content: flex-end; border-radius: 10px; background: var(--surface-3); box-shadow: 0 0 0 1px var(--line); }
.monde-plan-row.is-street .monde-plan-place { border-radius: 3px; }
.monde-plan-row.is-street .monde-plan-place:first-child { border-radius: 12px 3px 3px 12px; }
.monde-plan-row.is-street .monde-plan-place:last-child { border-radius: 3px 12px 12px 3px; }
.monde-plan-place[data-empty="true"] .monde-plan-name { color: var(--muted); }
.monde-plan-place[data-here="true"] { z-index: 1; box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(255, 210, 62, .45); }
/* Un fil entre le Plateau et les Toits, juste en dessous. */
.monde-plan-row.is-above .monde-plan-place { overflow: visible; }
.monde-plan-row.is-above .monde-plan-place::after { position: absolute; top: 100%; left: 50%; width: 2px; height: 12px; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .45) 0 3px, transparent 3px 6px); content: ""; }
.monde-plan-name { padding: 26px 7px 6px; overflow: hidden; color: #fff; font: 700 13px/1.1 var(--sign); letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.monde-plan-row.is-above .monde-plan-name { border-radius: 0 0 10px 10px; }
.monde-plan-count { position: absolute; top: 5px; left: 5px; display: flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: rgba(12, 8, 24, .85); color: #fff; font-size: 12px; font-weight: 800; }
.monde-plan-count::before { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); content: ""; }
.monde-plan-faces { position: absolute; top: 4px; right: 5px; display: flex; }
.monde-plan-face { display: grid; width: 22px; height: 22px; margin-right: -5px; place-items: center; overflow: hidden; border: 2px solid var(--green); border-radius: 50%; background: var(--surface-3); color: var(--gold); font: 700 11px var(--sign); }
.monde-plan-face img { width: 100%; height: 100%; object-fit: cover; }
.monde-plan-face.is-more { width: auto; min-width: 22px; padding: 0 4px; border-color: var(--line-strong); border-radius: 999px; color: #fff; font: 800 10px var(--font); }
.monde-plan-live { position: absolute; top: 5px; right: 5px; padding: 2px 7px; border-radius: 999px; background: #e91916; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 0 10px rgba(233, 25, 22, .55); }
.monde-plan-you { position: absolute; top: 5px; left: 5px; max-width: calc(100% - 10px); overflow: hidden; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #2a1900; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }

/* Son */
.monde-sound { position: absolute; top: 10px; right: 10px; z-index: 4; display: grid; gap: 9px; width: 256px; padding: 16px; animation: monde-drop .18s ease-out; }
.monde-sound-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.monde-sound-row output { color: var(--text); letter-spacing: 0; }
.monde-sound-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--pink); }
.monde-sound input[type="range"] { width: 100%; margin: 0; accent-color: var(--gold-2); }
/* L'appli Windows : le même coin que les réglages du son. */
.monde-appli { position: absolute; top: 10px; right: 10px; z-index: 4; display: grid; gap: 12px; width: min(310px, calc(100% - 20px)); padding: 18px; box-sizing: border-box; animation: monde-drop .18s ease-out; }
.monde-appli-head { display: flex; align-items: center; gap: 12px; }
.monde-appli-head img { flex: none; border-radius: 14px; }
.monde-appli h2 { margin: 0 0 3px; font-size: 18px; }
.monde-appli-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.monde-appli ul { display: grid; gap: 6px; margin: 0; padding: 0 0 0 18px; color: #e8e2f3; font-size: 13px; line-height: 1.4; }
.monde-appli-get { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.monde-appli-note { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.monde-sound-help { margin: -3px 0 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }

/* ---------- Tchat ---------- */
.monde-chat { position: relative; display: flex; flex: 1; min-width: 0; align-items: center; gap: 6px; height: 48px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(25, 18, 41, .88); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: border-color .15s, box-shadow .15s; }
.monde-chat:focus-within { border-color: rgba(255, 210, 62, .55); box-shadow: 0 0 0 3px rgba(255, 210, 62, .12), 0 10px 30px rgba(0, 0, 0, .35); }
.monde-chat input { flex: 1; min-width: 0; height: 100%; padding: 0 6px; border: 0; background: transparent; color: var(--text); font: 500 14px var(--font); outline: none; }
.monde-chat input::placeholder { color: #7d7196; }
.monde-log-open { position: relative; display: grid; flex: none; width: 38px; height: 38px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--muted); transition: color .15s, background .15s; }
.monde-log-open:hover { color: var(--text); }
.monde-log-open[aria-expanded="true"] { background: rgba(255, 210, 62, .16); color: var(--gold); }
.monde-log-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--pink); color: #2a0718; font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; }
.monde-send { display: inline-flex; flex: none; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #ffe27a, var(--gold-2)); color: #2a1900; font-size: 14px; font-weight: 800; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); transition: filter .15s, transform .1s; }
.monde-send:hover { filter: brightness(1.06); }
.monde-send:active { transform: scale(.96); }

/* Historique : un tiroir translucide sur le bas de la scène, à gauche (au-dessus du message). */
.monde-history { grid-area: stage; align-self: end; justify-self: start; z-index: 3; display: flex; flex-direction: column; gap: 2px; width: min(460px, calc(100% - 24px)); max-height: 180px; margin: 0 0 12px 12px; padding: 8px 12px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(20, 14, 34, .4); list-style: none; scrollbar-width: thin; scrollbar-color: #4a3d66 transparent; transition: background .2s ease; animation: monde-drop .15s ease-out; }
.monde-history:hover { background: rgba(20, 14, 34, .85); }
.monde-history:empty::before { color: var(--muted); font-size: 13px; content: "Personne n'a encore parlé ici."; }
.monde-line { padding: 2px 0; color: #fff; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; text-shadow: 0 1px 2px #000, 0 0 4px rgba(0, 0, 0, .8); }
.monde-line-name { padding: 0; border: 0; border-radius: 4px; background: none; color: var(--c, var(--gold)); font: inherit; font-weight: 700; text-shadow: inherit; }
.monde-line-name:hover { text-decoration: underline; }
.monde-line:not(.is-system, .is-whisper) > .monde-line-name::after { color: var(--muted); font-weight: 500; content: " :"; }
/* Ce qui se passe dans le lieu : plus discret que les bulles. */
.monde-line.is-system { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 12px; font-style: italic; }
.monde-line.is-system .monde-line-name { font-style: normal; }
.monde-line-icon { flex: none; font-style: normal; }
.monde-line[data-tone="join"]::before, .monde-line[data-tone="leave"]::before { flex: none; align-self: center; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); content: ""; }
.monde-line[data-tone="leave"]::before { background: #6c6182; box-shadow: none; }
.monde-line[data-tone="friend"] { color: #d9c9ff; }
.monde-line-action { margin-left: 2px; padding: 1px 9px; border: 0; border-radius: 999px; background: var(--gold); color: #2a1900; font: 800 11px var(--font); font-style: normal; text-shadow: none; vertical-align: 1px; }
.monde-line-action:disabled { opacity: .45; cursor: default; }
/* Chuchotements : violets, en italique, seul celui à qui ils sont adressés les voit. */
.monde-line.is-whisper { color: #e7d6ff; font-style: italic; }
.monde-line.is-whisper .monde-line-name { font-style: normal; }
.monde-line.is-whisper .monde-line-icon { margin-right: 5px; font-style: normal; }

/* Le champ du tchat en mode chuchotement : l'étiquette « À Bobette » devant. */
.monde-whisper { display: inline-flex; flex: none; align-items: center; gap: 5px; max-width: 45%; height: 30px; padding: 0 4px 0 10px; border: 1px solid rgba(141, 92, 255, .6); border-radius: 999px; background: rgba(141, 92, 255, .22); color: #eadcff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.monde-whisper b { overflow: hidden; text-overflow: ellipsis; }
.monde-whisper button { display: grid; flex: none; width: 22px; height: 22px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); font-size: 14px; line-height: 1; }
.monde-whisper button:hover { background: rgba(255, 255, 255, .22); }
.monde-chat:has(.monde-whisper:not([hidden])) { border-color: rgba(141, 92, 255, .55); }

/* ---------- Écran géant de la Kafboîte : sous la toile, visible par le trou laissé dans le mur ---------- */
.monde-stage.has-screen canvas#mondeCanvas { background: transparent; }
.monde-screen { position: absolute; overflow: hidden; background: #07040d; pointer-events: none; }
.monde-screen-video, .monde-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.monde-screen-idle { position: absolute; inset: 0; display: grid; place-items: center; color: #ff6fc4; font: 800 clamp(14px, 3.4vw, 40px)/1 var(--sign); letter-spacing: .12em; text-shadow: 0 0 18px rgba(255, 80, 190, .8); animation: monde-screen-pulse 1.6s ease-in-out infinite; }
.monde-screen.is-playing .monde-screen-idle, .monde-screen.is-paused .monde-screen-idle { display: none; }
/* Écran éteint (rien de lancé à la régie du studio) : seulement l'écran d'attente. */
.monde-screen.is-off .monde-screen-video, .monde-screen.is-off iframe { visibility: hidden; }
.monde-screen.is-studio .monde-screen-idle { color: var(--gold); text-shadow: 0 0 18px rgba(255, 170, 50, .8); }
/* Écran plus large que la vidéo : elle le remplit, le haut et le bas débordent. */
.monde-screen.is-cover .monde-screen-video, .monde-screen.is-cover iframe { top: 50%; bottom: auto; height: auto; aspect-ratio: 16 / 9; transform: translateY(-50%); }
@keyframes monde-screen-pulse { 50% { opacity: .5; } }
.monde-screen-sound { position: absolute; top: 12px; left: 50%; z-index: 4; padding: 8px 14px; border: 1px solid rgba(255, 95, 180, .6); border-radius: 999px; background: rgba(26, 12, 38, .9); color: #ffe9f4; font: 600 13px/1.2 var(--font); box-shadow: 0 0 18px rgba(255, 80, 190, .35); transform: translateX(-50%); cursor: pointer; }
.monde-screen-sound:hover { background: rgba(60, 20, 70, .94); }

/* ---------- Tuto de la première visite ---------- */
.monde-tour { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.monde-tour-spot { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(8, 4, 16, .62), 0 0 0 2px var(--gold), 0 0 24px rgba(255, 210, 62, .45); transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease; }
.monde-tour-spot.is-empty { box-shadow: 0 0 0 9999px rgba(8, 4, 16, .62); }
.monde-tour-card { position: fixed; width: min(340px, calc(100vw - 32px)); padding: 18px 18px 14px; pointer-events: auto; border: 1px solid rgba(255, 210, 62, .45); border-radius: var(--radius); background: rgba(24, 17, 39, .98); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); transition: left .3s ease, top .3s ease; animation: monde-drop .2s ease-out; }
.monde-tour-title { margin: 0 0 8px; color: var(--gold); font: 700 20px var(--sign); letter-spacing: .05em; }
.monde-tour-text { margin: 0 0 16px; color: #e8e2f3; font-size: 14px; line-height: 1.5; }
.monde-tour-card footer { display: flex; align-items: center; gap: 8px; }
.monde-tour-count { margin-right: auto; color: var(--muted); font-size: 12px; font-weight: 700; }
.monde-tour-skip { height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.monde-tour-skip:hover { color: var(--text); }

/* ---------- Écrans bas (ordi portable, téléphone couché) : barres plus fines ---------- */
@media (min-width: 701px) and (max-height: 600px) {
  .monde { gap: 8px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .monde-side { height: 42px; padding: 3px; }
  .monde-side > button, .monde-pad { height: 34px; }
  .monde-brand-mark { width: 32px; height: 32px; }
  .monde-chat { height: 42px; padding: 3px; }
  .monde-me { height: 38px; }
  .monde-me-ring { width: 30px; height: 30px; }
  .monde-chat .monde-log-open, .monde-send { height: 34px; }
  .monde-chat .monde-log-open { width: 34px; }
}

/* ---------- Téléphone ---------- */
@media (max-width: 700px) {
  .monde {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "top" "stage" "feed" "bottom";
    justify-content: stretch;
    align-content: stretch;
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  .monde-top { gap: 8px; }
  .monde-brand-mark { width: 34px; height: 34px; }
  .monde-brand strong { font-size: 17px; }
  .monde-pill { gap: 6px; height: 32px; padding: 0 10px 0 9px; }
  .monde-pill-text strong, .monde-pill-unit { display: none; }
  .monde-pill-text small { font-size: 13px; }
  .monde-tool-wide { padding: 0 8px; }
  .monde-tool-wide span { display: none; }
  .monde-me { gap: 7px; height: 38px; padding-right: 10px; }
  .monde-me-ring { width: 30px; height: 30px; }
  .monde-me-ring b { font-size: 13px; }
  .monde-me-text { display: none; }
  .monde-me-kp { padding-left: 0; border-left: 0; }
  .monde-action { right: 8px; bottom: 8px; height: 42px; font-size: 13px; }

  /* Le fil du tchat, toujours ouvert sous la scène ; les nouvelles lignes arrivent en bas. */
  .monde-history { grid-area: feed; align-self: stretch; justify-self: stretch; width: auto; max-height: none; min-height: 0; margin: 0; padding: 10px 14px; background: rgba(20, 14, 34, .6); animation: none; }
  .monde-history > :first-child, .monde-history:empty::before { margin-top: auto; }
  .monde-history:empty::before { content: "Personne n'a encore parlé ici. Lance la conversation !"; }
  .monde-log-open { display: none; }
  .monde-chat input { padding-left: 12px; }
  .monde-bottom { gap: 8px; }
  .monde-side { height: 46px; padding: 3px; }
  .monde-side-title { display: none; }
  .monde-board { padding-left: 4px; }
  .monde-pad { min-width: 44px; padding: 0 8px; }

  .monde-chat { height: 46px; }
  .monde-send { width: 38px; padding: 0; justify-content: center; }
  .monde-send span { display: none; }
  .monde-look-body { grid-template-columns: 1fr; justify-items: center; }
  .monde-sound, .monde-card, .monde-profile, .monde-bar, .monde-friends { top: 8px; right: 8px; }
  /* La fiche déborde de la petite scène : elle passe devant la manette tactile (ses boutons Défier). */
  .monde-card { z-index: 6; }
  /* Le plan, les amis et la régie du studio : la scène est trop petite, ils remontent du bas de l'écran. */
  .monde-plan, .monde-friends, .monde-regie { position: fixed; top: auto; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); left: max(10px, env(safe-area-inset-left)); z-index: 20; width: auto; max-height: min(72dvh, calc(100dvh - 110px)); background: #181127; transform: none; animation: monde-rise .2s ease-out; }
  .monde-plan { padding: 14px 12px 12px; }
  /* Un défi aussi : posé sur le fil du tchat (la barre du tchat reste libre), avec des cases assez grandes pour le doigt. */
  .monde-duel { position: fixed; top: auto; right: max(10px, env(safe-area-inset-right)); bottom: calc(max(10px, env(safe-area-inset-bottom)) + 54px); left: max(10px, env(safe-area-inset-left)); z-index: 20; width: auto; max-height: calc(100dvh - 84px); overflow: auto; background: #181127; animation: monde-rise .2s ease-out; }
  .monde-duel-grid { grid-template-columns: repeat(3, 64px); grid-auto-rows: 64px; }
  .monde-duel-hands { max-width: 320px; }
  .monde-plan-name { padding: 20px 4px 4px; font-size: 10px; }
  .monde-plan-you { top: 3px; left: 3px; padding: 1px 5px; font-size: 9px; }
  .monde-plan-count { top: 3px; left: 3px; padding: 1px 5px; font-size: 10px; }
  .monde-plan-live { top: 3px; right: 3px; padding: 1px 5px; font-size: 8px; }
  .monde-plan-faces { top: 3px; right: 3px; }
  .monde-plan-face { width: 18px; height: 18px; font-size: 9px; }
  .monde-whisper { max-width: 40%; padding-left: 8px; font-size: 12px; }
}
/* ---------- Manette tactile ----------
   Seulement sur les écrans tactiles sans souris. Sur téléphone, une ligne juste sous la scène ;
   ailleurs, posée sur les coins bas de la scène (app.js la place). */
.monde-move { display: none; }
@media (hover: none) and (pointer: coarse) {
  .monde-move { position: fixed; z-index: 4; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .monde-move-side { display: flex; gap: 8px; pointer-events: auto; }
  .monde-move button { display: grid; width: 54px; height: 50px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: rgba(25, 18, 41, .78); color: var(--text); font-size: 14px; font-weight: 800; touch-action: none; -webkit-tap-highlight-color: transparent; transition: background .1s, border-color .1s, transform .08s; }
  .monde-move .monde-move-jump { width: 86px; border-color: rgba(255, 210, 62, .45); color: var(--gold); }
  .monde-move button.is-held { border-color: var(--gold); background: rgba(70, 50, 112, .95); color: var(--gold); transform: scale(.95); }
  .monde.has-move-float .monde-action { bottom: 72px; }
  .monde.has-move-float .monde-history { margin-bottom: 72px; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 700px) {
  .monde {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    grid-template-areas: "top" "stage" "move" "feed" "bottom";
  }
  .monde-move { position: static; grid-area: move; pointer-events: auto; }
  .monde-move button { background: var(--surface, rgba(25, 18, 41, .9)); }
}

/* Téléphone debout : l'en-tête passe sur deux lignes (le logo et les réglages, puis mon niveau
   et les présents du Kafmonde). */
@media (max-width: 480px) {
  .monde-needs { order: 3; margin-top: 7px; }
  .monde-top { flex-wrap: wrap; row-gap: 0; }
  .monde-top::after { order: 2; flex-basis: 100%; height: 0; content: ""; }
  .monde-tools { order: 1; margin-left: auto; }
  .monde-me { order: 3; margin-top: 7px; }
  .monde-me-text { display: grid; }
  .monde-me-bar { width: 84px; }
  .monde-nav { order: 4; margin-top: 7px; margin-left: auto; }
  /* Sur cette deuxième ligne il y a la place : « PLAN ● 3 », « AMIS ● 1 ». */
  .monde-pill-text { display: flex; align-items: center; gap: 7px; }
  .monde-pill-text strong { display: block; font-size: 12px; }
  .monde-live { order: 4; margin-top: 7px; padding: 5px 9px; }
}

/* ---------- Nouvelle version : en grand, puis le jeu s'actualise tout seul ---------- */
.monde-update { position: fixed; inset: 0; z-index: 80; display: grid; padding: 16px; place-items: center; background: rgba(8, 5, 16, .8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: monde-update-in .25s ease-out; }
.monde-update-card { width: min(520px, 100%); padding: 30px 28px 26px; text-align: center; animation: monde-rise .3s ease-out; }
.monde-update-logo { display: block; width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 22px; box-shadow: 0 0 0 2px var(--gold), 0 0 40px rgba(255, 210, 62, .45); }
.monde-update h2 { margin: 0 0 12px; font-size: clamp(34px, 8vw, 54px); line-height: 1; text-transform: uppercase; }
.monde-update p { margin: 0 0 14px; color: var(--muted); font-size: 16px; line-height: 1.45; }
.monde-update .monde-update-count { color: var(--text); font-weight: 700; }
.monde-update-count b { color: var(--gold); font: 700 26px var(--sign); }
.monde-update-bar { display: block; height: 6px; margin: 0 0 22px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.monde-update-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); transform-origin: left; animation: monde-update-wait 10s linear forwards; }
.monde-update-now { height: 46px; padding: 0 26px; font-size: 16px; }
@keyframes monde-update-in { from { opacity: 0; } }
@keyframes monde-update-wait { to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Bureau du shérif : les lettres et les avis de recherche, lus en grand par-dessus la toile. */
.monde-papier { position: absolute; top: 50%; left: 50%; z-index: 6; display: flex; width: var(--cw); height: var(--ch); flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--radius); background: rgba(14, 8, 5, .68); cursor: pointer; transform: translate(-50%, -50%); }
.monde-papier[hidden] { display: none; }
.monde-papier img { display: block; min-height: 0; max-width: 90%; max-height: calc(100% - 44px); flex: 0 1 auto; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)); user-select: none; -webkit-user-drag: none; }
.monde-papier-in { animation: monde-papier-in .24s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes monde-papier-in { from { opacity: 0; transform: translateY(16px) rotate(-2.2deg) scale(.95); } to { opacity: 1; transform: none; } }
.monde-papier p { flex: none; margin: 8px 0 0; padding: 3px 12px; border-radius: 999px; background: rgba(20, 10, 6, .82); color: #f3dcae; font-size: 13px; font-weight: 700; white-space: nowrap; }
/* Sur téléphone, la toile est trop petite pour lire : la feuille prend tout l'écran. */
@media (max-width: 760px) { .monde-papier { position: fixed; inset: 0; z-index: 60; width: auto; height: auto; border-radius: 0; background: rgba(14, 8, 5, .9); transform: none; } .monde-papier img { max-width: 96%; } }
@media (prefers-reduced-motion: reduce) { .monde-papier-in { animation: none; } }
