:root {
  --bg: #1b1d2a;
  --panel: rgba(22, 24, 36, 0.86);
  --line: #3a3e5c;
  --fg: #f4f1ea;
  --muted: #a9a8b8;
  --accent: #ffd166;
  --pixel: "Press Start 2P", ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--fg); font: 14px/1.4 system-ui, sans-serif; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; display: block; }

#join { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 30%, #2c3150, #14151f); z-index: 10; }
.card { width: min(380px, 100%); background: var(--panel); border: 3px solid var(--line); box-shadow: 6px 6px 0 #0008; padding: 24px; display: grid; gap: 12px; }
.card h1 { font: 20px var(--pixel); margin: 0; color: var(--accent); }
.sub { margin: 0 0 8px; color: var(--muted); }
.card label, .lbl { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.card input { font: 16px system-ui; padding: 10px; border: 2px solid var(--line); background: #10111a; color: var(--fg); outline: none; }
.card input:focus { border-color: var(--accent); }
#swatches { display: flex; gap: 8px; flex-wrap: wrap; }
#swatches button { width: 28px; height: 28px; border: 3px solid transparent; cursor: pointer; padding: 0; }
#swatches button.on { border-color: #fff; box-shadow: 0 0 0 2px #000; }
button { font: 11px var(--pixel); background: #2f3350; color: var(--fg); border: 2px solid var(--line); padding: 10px 12px; cursor: pointer; box-shadow: 3px 3px 0 #0008; }
button:hover { border-color: var(--accent); }
button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #0008; }
#joinBtn { background: var(--accent); color: #222; border-color: #b8913a; margin-top: 6px; }
.note { margin: 0; font-size: 12px; color: var(--muted); }

.panel { position: fixed; background: var(--panel); border: 2px solid var(--line); padding: 12px; box-shadow: 4px 4px 0 #0008; }
.tl { top: 12px; left: 12px; max-width: 320px; }
.tr { top: 12px; right: 12px; width: 240px; }
#zoneName { font: 12px var(--pixel); color: var(--accent); margin-bottom: 6px; }
#zoneDesc { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
#count { font-size: 11px; color: var(--muted); margin-top: 8px; }
.row { display: flex; gap: 8px; }
#muteBtn.off { background: #6b2430; }
.panel h3 { font: 10px var(--pixel); margin: 0 0 10px; color: var(--fg); }
.panel h3 small { font: 11px system-ui; color: var(--muted); }
#hearList { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#hearList li { display: grid; grid-template-columns: 1fr 80px; align-items: center; gap: 8px; font-size: 13px; }
#hearList li.empty { display: block; color: var(--muted); font-size: 12px; }
#hearList i { height: 8px; background: linear-gradient(90deg, #81b29a calc(var(--v) * 100%), #33364d 0); border: 1px solid #000; }
.tl .row + .row { margin-top: 8px; }
.tl { width: 300px; }
.tl .row button { flex: 1 1 auto; font-size: 9px; padding: 8px; }
#helpBtn { width: 100%; }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(10, 10, 18, 0.6); }
.card.wide { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.card h2 { font: 14px/1.5 var(--pixel); color: var(--accent); margin: 0 0 4px; }
.card h4 { margin: 10px 0 0; font-size: 13px; color: var(--fg); }
.card h4 small { color: var(--muted); font-weight: normal; }
.modal label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.modal label b { color: var(--fg); }
.modal input[type=range] { width: 100%; accent-color: var(--accent); }
.row.end { justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
button.primary { background: var(--accent); color: #222; border-color: #b8913a; }
.intro { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; color: var(--fg); }
.intro b { color: var(--accent); }
.help { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); background: var(--panel); border: 2px solid var(--line); padding: 8px 12px; font-size: 12px; color: var(--muted); white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
#toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); background: var(--accent); color: #222; font: 10px var(--pixel); padding: 10px 14px; border: 2px solid #b8913a; box-shadow: 3px 3px 0 #0008; z-index: 5; }


#helpBtn.on { background: #ff8c42; color: #1b1b1b; border-color: #b85d1f; }

#chat { right: 12px; bottom: 12px; width: 340px; padding: 0; display: flex; flex-direction: column; max-height: 42vh; }
#chat.min { max-height: none; }
#chat.min #chatLog, #chat.min #chatForm { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 12px; border-bottom: 2px solid var(--line); }
.chat-head h3 { margin: 0; }
.chat-head button { padding: 4px 8px; box-shadow: none; }
#chatBadge { display: inline-block; background: #e5484d; color: #fff; padding: 2px 5px; margin-left: 6px; font-size: 8px; }
#chatLog { list-style: none; margin: 0; padding: 8px 12px; overflow-y: auto; flex: 1; min-height: 120px; display: grid; gap: 4px; align-content: start; font-size: 13px; word-wrap: break-word; }
#chatLog time { color: #6f6e82; font-size: 11px; }
#chatLog .sys { color: var(--muted); font-style: italic; }
#chatLog .sys-help { color: #ff8c42; font-style: normal; font-weight: 600; background: rgba(255,140,66,.12); border-left: 3px solid #ff8c42; padding: 4px 6px; }
#chatLog .sys-join { color: #81b29a; }
#chatForm { border-top: 2px solid var(--line); }
#chatInput { width: 100%; border: 0; padding: 10px 12px; background: #10111a; color: var(--fg); font: 13px system-ui; outline: none; }
#chatInput:focus { box-shadow: inset 0 0 0 2px var(--accent); }

@media (max-width: 900px) {
  .help { display: none; }
}
@media (max-width: 700px) {
  .tr { display: none; }
  #chat { width: calc(100% - 24px); max-height: 35vh; }
}

/* Icônes (Lucide) */
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button svg, .note svg, .intro svg { width: 16px; height: 16px; flex: none; }
.note svg, .intro svg { vertical-align: -3px; }
.tl .row button svg { width: 14px; height: 14px; }
#introBtn { flex: 0 0 auto; }

/* Fenêtre Paramètres compacte : une ligne par réglage */
.card.settings { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; gap: 10px; padding: 18px 20px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.settings-head h2 { margin: 0; }
.icon-btn { padding: 6px; box-shadow: none; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.settings-grid section { display: grid; gap: 6px; align-content: start; }
.settings-grid h4 { margin: 0 0 2px; font: 9px/1.6 var(--pixel); color: var(--muted); text-transform: uppercase; }
.modal label.set { display: grid; grid-template-columns: 16px 92px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; color: var(--fg); }
.modal label.set svg { width: 16px; height: 16px; color: var(--muted); }
.modal label.set b { text-align: right; font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; }
.modal label.set input { margin: 0; }
.hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.card.settings .row.end { margin-top: 4px; }
@media (max-width: 720px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.room-name { margin: -4px 0 6px; font: 11px/1.5 var(--pixel); color: var(--fg); }
.room-name.bad { color: #ff6b6b; }
.tl .row button.off { background: #6b2430; }
.tl .row button.on { background: #2f6b4a; }
#chatLog .sys-knock { color: #ffd166; font-style: normal; font-weight: 600; }

/* Caméras des gens proches */
#videos { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; max-width: calc(100% - 640px); overflow-x: auto; }
#videos:empty { display: none; }
.vtile { position: relative; width: 168px; aspect-ratio: 4 / 3; background: #10111a; border: 2px solid var(--line); box-shadow: 3px 3px 0 #0008; flex: none; }
.vtile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vtile.me video { transform: scaleX(-1); }
.vtile span { position: absolute; left: 4px; bottom: 4px; background: rgba(20,20,30,.8); font: 8px var(--pixel); padding: 4px 5px; color: #fff; }
@media (max-width: 1100px) { #videos { top: auto; bottom: 64px; left: 12px; transform: none; max-width: calc(100% - 380px); } .vtile { width: 120px; } }

/* Boutons Micro / Son / Caméra : largeur égale, jamais de retour à la ligne (l'état se lit à la couleur) */
.tl .row:has(#muteBtn) { display: grid; grid-template-columns: repeat(3, 1fr); }
.tl .row button { white-space: nowrap; min-width: 0; }

/* Panneau de porte */

#boardText { width: 100%; resize: vertical; font: 15px/1.4 system-ui, sans-serif; padding: 10px; background: #fff6d6; color: #2a2622; border: 3px solid #6b4426; outline: none; }
#boardText:focus { border-color: var(--accent); }

/* Demandes d'aide : cartes flottantes + flèche vers la personne */
#helpModal input { width: 100%; }
#helpCards { position: fixed; inset: 0; pointer-events: none; z-index: 4; }

.hcard { position: absolute; left: 0; top: 0; width: 230px; pointer-events: auto; display: grid; justify-items: center; }
.hbody { width: 100%; background: #fff3e6; color: #2a2622; border: 3px solid #ff8c42; box-shadow: 4px 4px 0 #0008; padding: 8px 10px; display: grid; gap: 4px; }
.hname { font: 9px/1.5 var(--pixel); color: #b85d1f; }
.hdist { position: absolute; right: 12px; margin-top: 8px; font-size: 11px; color: #8a6a50; }
.htext { margin: 0; font: 14px/1.3 system-ui, sans-serif; overflow-wrap: anywhere; }
.hbtns { display: flex; gap: 6px; margin-top: 2px; }
.hbtns button { flex: 1; padding: 7px 6px; font-size: 9px; box-shadow: 2px 2px 0 #0006; }
.hbtns .hignore { background: #e8dccd; color: #5a4a3a; border-color: #c9b8a2; }
.hgoing { margin: 0; font-size: 13px; font-weight: 600; color: #2f6b4a; }
.harrow { display: none; position: absolute; width: 36px; height: 36px; display: none; place-items: center; background: #ff8c42; color: #1b1b1b; border: 3px solid #1b1b1b; border-radius: 50%; animation: hblink 0.8s steps(2) infinite; z-index: 1; }
.harrow svg { width: 22px; height: 22px; stroke-width: 3.5; }
.hcard.edge .harrow { display: grid; }

@keyframes hblink { 50% { opacity: 0.25; } }

/* Paramètres : une seule colonne (les volumes) */
.card.settings { width: min(480px, 100%); }
.settings-grid { grid-template-columns: 1fr; }
.settings-grid h4 small { text-transform: none; font: 11px system-ui; }

/* ---------- Partage d'écran ---------- */

#shareBtn.on { background: #2f6b4a; }
#shareInvite { top: 64px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; z-index: 6; border-color: var(--accent); }
#shareInvite > svg { width: 20px; height: 20px; color: var(--accent); }
#shareInvite span { font-size: 14px; }
button.danger { background: #6b2430; }

/* Le tableau : cadre bois, surface claire, rebord avec craies / feutres / brosse */
#screenView { position: fixed; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(78vw, 1200px); }
#screenView.min { width: 380px; top: auto; bottom: 64px; left: auto; right: 370px; transform: none; }
.sv-board {
  padding: 14px 14px 0;
  background: linear-gradient(180deg, #b07a46, #8a5a30 40%, #a06a3a 60%, #7a4c26);
  border: 3px solid #4a2c14;
  box-shadow: 8px 8px 0 #0009, inset 0 0 0 3px #c99260;
}
.sv-head { display: flex; align-items: center; gap: 6px; padding: 0 2px 10px; }
.sv-head span { flex: 1; font: 10px/1.4 var(--pixel); color: #fff3dc; text-shadow: 2px 2px 0 #4a2c14; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-head button { padding: 6px 8px; font-size: 9px; box-shadow: 2px 2px 0 #0006; background: #5a3a20; border-color: #3a2410; }
.sv-head button.danger { background: #8a2a2f; }
.sv-surface { background: #f4f4ef; border: 4px solid #3a2410; box-shadow: inset 0 0 0 2px #d6d6cc; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.sv-surface video { width: 100%; height: 100%; object-fit: contain; display: block; background: #1b1d2a; }
.sv-tray { height: 22px; margin: 0 -14px; background: linear-gradient(180deg, #c99260, #8a5a30 55%, #5a3a20); border-top: 3px solid #4a2c14; display: flex; align-items: flex-start; gap: 10px; padding: 3px 40px 0; }
.sv-tray i { display: block; height: 7px; box-shadow: 1px 1px 0 #0006; }
.sv-tray .chalk { width: 26px; border-radius: 2px; }
.sv-tray .chalk.white { background: #f6f6f0; }
.sv-tray .chalk.yellow { background: #ffe58a; width: 18px; }
.sv-tray .marker { width: 34px; border-radius: 3px; background: linear-gradient(90deg, #eee 0 70%, currentColor 70%); }
.sv-tray .marker.red { color: #e5484d; }
.sv-tray .marker.blue { color: #3d85c6; }
.sv-tray .eraser { width: 38px; height: 10px; margin-left: auto; background: linear-gradient(180deg, #6b4426 0 45%, #d9d4c8 45%); border-radius: 2px; }
#screenView.min .sv-head span { font-size: 8px; }
#screenView.min .sv-tray { height: 14px; }
@media (max-width: 1100px) { #screenView.min { right: 12px; bottom: 120px; } }

/* Éditeur de perso : flèches à hauteur des cheveux / du visage / de la tenue */
.avatar-editor { display: grid; grid-template-columns: 44px 140px 44px; align-items: stretch; gap: 6px; justify-content: center; }
#avatarPreview { width: 140px; height: 150px; image-rendering: pixelated; background: radial-gradient(circle at 50% 60%, #2c3150, #161827); border: 2px solid var(--line); }
.avatar-editor .arrows { position: relative; }
.avatar-editor .arrows button { position: absolute; left: 0; width: 44px; height: 32px; padding: 0; box-shadow: 2px 2px 0 #0008; }
.avatar-editor .arrows button svg { width: 18px; height: 18px; }
/* positions calées sur le dessin agrandi ×5 : cheveux ≈ 25 px, visage ≈ 52 px, tenue ≈ 92 px */
.avatar-editor .arrows button:nth-child(1) { top: 14px; }
.avatar-editor .arrows button:nth-child(2) { top: 52px; }
.avatar-editor .arrows button:nth-child(3) { top: 92px; }
.avatar-editor .parts { position: relative; font-size: 12px; color: var(--muted); }
.avatar-editor .parts span { position: absolute; left: 0; white-space: nowrap; }
.avatar-editor .parts span:nth-child(1) { top: 21px; }
.avatar-editor .parts span:nth-child(2) { top: 59px; }
.avatar-editor .parts span:nth-child(3) { top: 99px; }
button.ghost { background: transparent; box-shadow: none; border-color: var(--line); justify-self: start; padding: 7px 10px; font-size: 9px; }
@media (max-width: 400px) { .avatar-editor { grid-template-columns: 40px 140px 40px; } .avatar-editor .parts { display: none; } }

/* ---------- Nouvelle disposition : carte de la pièce (haut gauche) + barre perso (bas centre) ---------- */
#roomCard { width: 260px; max-width: calc(100% - 24px); }
#roomCard #zoneDesc { margin-bottom: 0; }
#roomActions { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--line); }
#roomActions .act { width: 100%; justify-content: flex-start; padding: 8px 10px; font-size: 9px; box-shadow: 2px 2px 0 #0008; margin: 0; }
#roomActions .act svg { width: 15px; height: 15px; }
#roomActions .act.on { background: #2f6b4a; }
#boardPreview { margin: 0; padding: 6px 8px; background: #fff6d6; color: #2a2622; font: italic 12px/1.35 system-ui, sans-serif; border-left: 3px solid #c99a5b; overflow-wrap: anywhere; }

#dock { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 #0008; z-index: 3; }
#dock .grp { display: flex; gap: 4px; }
#dock .grp + .grp { padding-left: 6px; border-left: 2px solid var(--line); }
#dock .dk { flex-direction: column; gap: 4px; width: 62px; padding: 7px 2px 5px; font: 600 10px system-ui, sans-serif; letter-spacing: .01em; box-shadow: none; border-color: transparent; background: #262a42; margin: 0; }
#dock .dk:hover { border-color: var(--accent); }
#dock .dk svg { width: 19px; height: 19px; }
#dock .dk.off { background: #6b2430; }
#dock .dk.on { background: #2f6b4a; }
#helpBtn.on { background: #ff8c42 !important; color: #1b1b1b; }
#helpBtn { width: auto; margin: 0; }
#screenView.min { bottom: 90px; }
@media (max-width: 1100px) { #dock { left: 12px; transform: none; } }
@media (max-width: 700px) { #dock .dk { width: 44px; } #dock .dk span { display: none; } }

/* ---------- Icônes pixel + libellés en police pixel ---------- */
svg.px-icon { width: 16px; height: 16px; flex: none; image-rendering: pixelated; }
#dock .dk { font: 7px/1.2 var(--pixel); letter-spacing: 0; gap: 6px; padding: 8px 2px 6px; width: 64px; }
#dock .dk svg.px-icon { width: 24px; height: 24px; }
#roomActions .act svg.px-icon, .tl .row button svg.px-icon { width: 16px; height: 16px; }
.harrow svg.px-icon { width: 24px; height: 24px; }
.avatar-editor .arrows button svg.px-icon { width: 24px; height: 24px; }
#shareInvite > svg.px-icon { width: 24px; height: 24px; color: var(--accent); }
#avatarRandom { justify-self: center; }

/* ---------- Pastilles de compteur ---------- */
.badge { display: inline-block; min-width: 16px; padding: 2px 4px; background: #e5484d; color: #fff; font: 8px/1.2 var(--pixel); text-align: center; }
#roomActions .act .badge { margin-left: auto; }

/* ---------- Chat : onglets Général / Ici ---------- */
.chat-head { padding: 6px 6px 0 6px; align-items: flex-end; }
.chat-tabs { display: flex; gap: 4px; min-width: 0; }
.ctab { padding: 7px 9px; font: 8px/1.2 var(--pixel); background: transparent; border: 2px solid var(--line); border-bottom: 0; box-shadow: none; color: var(--muted); max-width: 170px; }
.ctab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctab.on { background: #2f3350; color: var(--fg); }
.ctab svg.px-icon { width: 14px; height: 14px; }
#chatLogLocal { list-style: none; margin: 0; padding: 8px 12px; overflow-y: auto; flex: 1; min-height: 120px; display: grid; gap: 4px; align-content: start; font-size: 13px; word-wrap: break-word; }
#chatLogLocal time { color: #6f6e82; font-size: 11px; }
#chatLogLocal .sys { color: var(--muted); font-style: italic; }
#chatLogLocal .sys-knock { color: #ffd166; font-style: normal; font-weight: 600; }
#chat.min #chatLogLocal { display: none; }

/* ---------- Tableau (texte / code) ---------- */
.notes-board { width: min(860px, calc(100vw - 32px)); }
.notes-surface { background: #f4f4ef; border: 4px solid #3a2410; display: grid; grid-template-rows: auto 1fr auto; max-height: calc(100vh - 160px); min-height: 360px; color: #2a2622; }
.notes-tabs { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 2px solid #d6d0c2; overflow-x: auto; }
.ntab { display: flex; align-items: center; gap: 6px; padding: 7px 10px; font: 8px/1.2 var(--pixel); background: #e7e2d6; color: #5a4a3a; border: 2px solid #d6d0c2; border-bottom: 0; box-shadow: none; flex: none; }
.ntab.on { background: #fff; color: #2a2622; }
.ntab .dot { width: 8px; height: 8px; display: block; }
.ntab b { font-size: 8px; background: #2a2622; color: #fff; padding: 2px 4px; }
.notes-list { overflow-y: auto; padding: 10px; display: grid; gap: 10px; align-content: start; }
.notes-list .empty { color: #8a7a6a; margin: 8px 2px; font-size: 14px; }
.note { background: #fff; border: 2px solid #d6d0c2; box-shadow: 3px 3px 0 #0001; }
.note header { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; background: #f0ebe0; border-bottom: 2px solid #d6d0c2; font-size: 12px; color: #7a6a5a; }
.note header span { flex: 1; }
.note header button { padding: 4px; background: transparent; border: 0; box-shadow: none; color: #5a4a3a; }
.note header button:hover { color: #e5484d; }
.note .note-text { margin: 0; padding: 10px 12px; font: 15px/1.45 system-ui, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.note .note-text a { color: #2563eb; }
.note pre { margin: 0; max-height: 420px; overflow: auto; }
.note pre code.hljs, #noteText.code { font: 20px/1.15 'VT323', ui-monospace, monospace; }
.note pre code.hljs { display: block; padding: 10px 12px; tab-size: 2; white-space: pre; }
.notes-compose { border-top: 2px solid #d6d0c2; padding: 8px; display: grid; gap: 6px; background: #ebe6da; }
.notes-compose .seg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.notes-compose .seg button { padding: 6px 9px; font-size: 8px; background: #d9d2c2; color: #3a2f25; border-color: #c4baa6; box-shadow: none; }
.notes-compose .seg button.on { background: #2a2622; color: #fff; border-color: #2a2622; }
.notes-compose .seg select { font: 13px system-ui; padding: 5px; border: 2px solid #c4baa6; background: #fff; color: #2a2622; }
.notes-compose .seg .hint { margin-left: auto; color: #7a6a5a; }
#noteText { width: 100%; resize: vertical; min-height: 80px; padding: 8px 10px; border: 2px solid #c4baa6; background: #fff; color: #2a2622; font: 15px/1.4 system-ui, sans-serif; outline: none; }
#noteText:focus { border-color: #b8913a; }
#noteText.code { background: #282c34; color: #abb2bf; }
.notes-compose .row.end { margin: 0; }
.card.history { width: min(760px, 100%); }
.card.history .notes-list { max-height: 60vh; padding: 0; }
.card.history .note { color: #2a2622; }

/* ---------- Chat : outils, messages privés, suggestions, suppression, mode agrandi ---------- */
.chat-head { gap: 6px; }
.chat-tabs { flex: 1; overflow-x: auto; scrollbar-width: none; }
.chat-tools { display: flex; gap: 4px; padding-bottom: 6px; flex: none; }
.chat-tools button { padding: 4px 6px; box-shadow: none; }
.ctab.dm { color: #c9b8ff; }
.ctab .x { font-style: normal; font: 12px/1 system-ui; padding: 0 2px; opacity: .6; }
.ctab .x:hover { opacity: 1; color: #ff6b6b; }
.ctab.blink { animation: tabblink .5s steps(2) 10; }
@keyframes tabblink { 0% { background: #ffd166; color: #222; } 100% { background: #2f3350; color: var(--fg); } }
.chatlog { list-style: none; margin: 0; padding: 8px 12px; overflow-y: auto; flex: 1; min-height: 120px; display: grid; gap: 4px; align-content: start; font-size: 13px; word-wrap: break-word; }
.chatlog time { color: #6f6e82; font-size: 11px; }
.chatlog .sys { color: var(--muted); font-style: italic; }
#chat.min .chatlog { display: none; }
#chat li { position: relative; }
#chat li a { color: #7fb8ff; overflow-wrap: anywhere; }
#chat li .who { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
#chat li .who:hover { text-decoration: underline solid; }
#chat li .who:hover::after { content: ' 💬'; font-size: 11px; }
#chat li .del { position: absolute; right: 0; top: -2px; padding: 2px; background: #2f3350; box-shadow: none; border: 0; opacity: 0; color: var(--muted); }
#chat li:hover .del { opacity: 1; }
#chat li .del:hover { color: #ff6b6b; }
#chat li .del svg.px-icon { width: 14px; height: 14px; }
#mpSuggest { list-style: none; margin: 0; padding: 4px; border-top: 2px solid var(--line); max-height: 200px; overflow-y: auto; background: #12131d; }
#mpSuggest li { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; cursor: pointer; font-size: 13px; }
#mpSuggest li.on, #mpSuggest li:hover { background: #2f3350; }
#mpSuggest li i { width: 8px; height: 8px; display: block; align-self: center; flex: none; }
#mpSuggest li b { color: var(--accent); font-weight: 600; }
#mpSuggest li small { color: var(--muted); font-size: 12px; }
#mpSuggest li.none { color: var(--muted); cursor: default; }
#chat.big { width: min(560px, calc(100vw - 24px)); max-height: 72vh; }
#chat.big .chatlog, #chat.big #chatLog, #chat.big #chatLogLocal { font-size: 14px; }

/* Onglets du chat : sur leur propre ligne, retour à la ligne si besoin (rien n'est coupé) */
.chat-head { flex-wrap: wrap; justify-content: flex-end; padding: 4px 6px 0; }
.chat-tools { padding-bottom: 4px; }
.chat-tabs { order: 2; flex: 1 1 100%; flex-wrap: wrap; overflow: visible; gap: 4px 4px; }
.ctab { max-width: 150px; }

/* ---------- Pause au coin café ---------- */
.pause-card { width: min(460px, 100%); }
.pause-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pause-choices button { padding: 12px 6px; }
.pause-choices button:last-child { grid-column: span 3; background: #4a3f7a; }
#wakeBar { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; background: #2b2550; border: 2px solid #c9b8ff; box-shadow: 4px 4px 0 #0008; z-index: 4; }
#wakeBar span { font: 9px var(--pixel); color: #e8dfff; }
@media (max-width: 1100px) { #wakeBar { left: 12px; transform: none; } }

/* Chat agrandi : 2 fois plus haut (et plus large) */
#chat.big { width: min(760px, calc(100vw - 24px)); max-height: min(58vh, calc(100vh - 110px)); }
#chat.big .chatlog, #chat.big #chatLog, #chat.big #chatLogLocal { min-height: 34vh; }
/* Barre du bas : chaque bouton prend la largeur de son libellé (plus de débordement) */
#dock .dk { width: auto; min-width: 58px; padding: 8px 8px 6px; }

/* Tableau : beaucoup plus de place en hauteur pour écrire et lire */
.notes-board { width: min(1040px, calc(100vw - 32px)); }
.notes-surface { height: min(82vh, calc(100vh - 130px)); max-height: none; }
#noteText { min-height: 32vh; }
.note pre { max-height: 60vh; }

/* ---------- Éditeur de code avec coloration en direct ---------- */
.code-editor { position: relative; display: grid; }
.code-editor pre { display: none; position: absolute; inset: 0; margin: 0; overflow: hidden; pointer-events: none;
  border: 2px solid transparent; padding: 8px 10px; background: #282c34; }
.code-editor pre code.hljs { display: block; padding: 0; background: transparent; white-space: pre; font: 20px/1.15 'VT323', ui-monospace, monospace; tab-size: 2; min-height: 100%; }
.code-editor.live pre { display: block; }
.code-editor.live #noteText { position: relative; z-index: 1; background: transparent; color: transparent; caret-color: #fff; white-space: pre; overflow: auto; font: 20px/1.15 'VT323', ui-monospace, monospace; tab-size: 2; }
.code-editor.live #noteText::placeholder { color: #7a8394; }
.code-editor.live #noteText::selection { background: rgba(255, 255, 255, .22); color: transparent; }
.notes-compose .seg .detected { color: #2f6b4a; font-weight: 600; }

/* Sélecteur de langage : même style que les boutons Texte / Code, flèche en pixel */
.notes-compose .seg select {
  appearance: none; -webkit-appearance: none;
  font: 8px/1.2 var(--pixel); color: #3a2f25;
  padding: 7px 28px 7px 9px;
  background: #d9d2c2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath fill='%233a2f25' d='M5 8h14v2H5zM7 10h10v2H7zM9 12h6v2H9zM11 14h2v2h-2z'/%3E%3C/svg%3E") no-repeat right 6px center / 16px 16px;
  border: 2px solid #c4baa6; border-radius: 0; cursor: pointer;
}
.notes-compose .seg select:hover, .notes-compose .seg select:focus { border-color: #b8913a; outline: none; }
.notes-compose .seg select option { font: 14px system-ui, sans-serif; background: #f4f4ef; color: #2a2622; }

/* Liens aux couleurs du thème (plus de bleu par défaut) */
#chat li a, #chat li a:visited { color: var(--accent); text-decoration: underline dotted 2px; text-underline-offset: 3px; }
#chat li a:hover { color: #ffe29a; text-decoration-style: solid; }
.note .note-text a, .note .note-text a:visited, #boardPreview a { color: #b85d1f; font-weight: 600; text-decoration: underline dotted 2px; text-underline-offset: 3px; }
.note .note-text a:hover { color: #8a3f10; text-decoration-style: solid; }

/* ---------- Mobile ---------- */
body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#game { touch-action: none; }
@media (hover: none) {
  #chat li .del { opacity: .55; }
}
@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) {
  .tr, .help { display: none; }
  :root { --dock-h: 58px; --sb: env(safe-area-inset-bottom, 0px); }
  /* Barre perso : toute la largeur, icônes seules */
  #dock { left: 8px; right: 8px; bottom: calc(8px + var(--sb)); transform: none; gap: 4px; padding: 4px; justify-content: space-between; }
  #dock .grp { display: contents; }
  #dock .dk { flex: 1 1 0; min-width: 0; width: auto; padding: 10px 0; }
  #dock .dk span { display: none; }
  #dock .dk svg.px-icon { width: 22px; height: 22px; }
  /* Chat au-dessus de la barre, pleine largeur */
  #chat { left: 8px; right: 8px; width: auto; bottom: calc(var(--dock-h) + 14px + var(--sb)); max-height: 40dvh; }
  #chat.big { width: auto; max-height: calc(100dvh - var(--dock-h) - 40px); }
  #chat.big .chatlog, #chat.big #chatLog, #chat.big #chatLogLocal { min-height: 0; }
  .chatlog, #chatLog, #chatLogLocal { min-height: 80px; }
  #chatInput, #noteText, .card input, #helpModal input, #boardText { font-size: 16px; } /* pas de zoom auto sur iOS */
  /* Carte de la pièce : compacte, actions en ligne */
  #roomCard { top: 8px; left: 8px; width: auto; max-width: calc(100% - 16px); padding: 8px 10px; }
  #zoneName { font-size: 10px; margin-bottom: 2px; }
  #zoneDesc { font-size: 11px; }
  #roomActions { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-top: 8px; padding-top: 8px; }
  #roomActions .act { padding: 8px; font-size: 8px; }
  #boardPreview { grid-column: 1 / -1; }
  /* Caméras : petite colonne en haut à droite */
  #videos { top: 8px; right: 8px; left: auto; bottom: auto; transform: none; flex-direction: column; max-width: none; max-height: 45dvh; overflow-y: auto; }
  .vtile { width: 92px; }
  .vtile span { font-size: 6px; }
  /* Partage d'écran */
  #screenView { width: calc(100vw - 16px); }
  #screenView.min { width: 58vw; top: auto; left: auto; right: 8px; bottom: calc(var(--dock-h) + 70px + var(--sb)); }
  .sv-board { padding: 8px 8px 0; }
  .sv-tray { margin: 0 -8px; padding: 3px 16px 0; height: 14px; }
  .sv-head button span { display: none; }
  /* bandeaux temporaires : en haut, par-dessus la carte de la pièce (le bas est pris par le chat) */
  #shareInvite { top: calc(8px + env(safe-area-inset-top, 0px)); left: 8px; right: 8px; transform: none; flex-wrap: wrap; z-index: 6; }
  #wakeBar { left: 8px; right: 8px; transform: none; top: calc(8px + env(safe-area-inset-top, 0px)); bottom: auto; justify-content: space-between; z-index: 6; }
  #toast { top: calc(8px + env(safe-area-inset-top, 0px)); width: max-content; max-width: calc(100% - 16px); line-height: 1.6; text-align: center; z-index: 7; }
  .hcard { width: 200px; }
  /* Fenêtres */
  .modal { padding: 8px; }
  .card { padding: 16px; }
  .card.wide, .card.settings { max-height: calc(100dvh - 16px); }
  .notes-board { width: calc(100vw - 16px); }
  .notes-surface { height: calc(100dvh - 110px); min-height: 0; }
  #noteText { min-height: 22dvh; }
  .notes-compose .seg .hint { display: none; }
  .pause-choices { grid-template-columns: repeat(2, 1fr); }
  .pause-choices button:last-child { grid-column: span 2; }
}
/* Téléphone à l'horizontale : peu de hauteur → barre à gauche, chat à droite */
@media (max-height: 500px) and (max-width: 1000px) {
  #dock { right: auto; width: min(420px, 55vw); }
  #dock .dk { padding: 7px 0; }
  #chat { left: auto; width: 40vw; bottom: calc(8px + var(--sb)); max-height: calc(100dvh - 16px); }
  #chat.big { width: 55vw; max-height: calc(100dvh - 16px); }
  #roomCard #zoneDesc { display: none; }
  #roomActions { grid-template-columns: 1fr; }
  #videos { right: calc(40vw + 16px); max-height: calc(100dvh - 90px); }
  #screenView { width: min(calc(100vw - 16px), calc((100dvh - 70px) * 16 / 9)); }
  #screenView.min { width: 34vw; bottom: auto; top: 8px; right: calc(40vw + 16px); }
  .notes-surface { height: calc(100dvh - 70px); }
  #noteText { min-height: 30dvh; }
}
#join { overflow-y: auto; }
@media (max-height: 560px) { #join { place-items: start center; } }
@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) {
  /* chat replié : onglets et outils sur une seule ligne */
  #chat.min .chat-head { flex-wrap: nowrap; padding-bottom: 4px; }
  #chat.min .chat-tabs { order: 0; flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; }
  #chat.min .chat-tools { padding-bottom: 0; }
  #chat.min #chatBig { display: none; }
}

/* Bandeau « Tu as demandé de l'aide » */
#helpBar { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; background: #4a2a12; border: 2px solid #ff8c42; box-shadow: 4px 4px 0 #0008; z-index: 4; max-width: calc(100% - 24px); }
#helpBar span { font: 9px/1.5 var(--pixel); color: #ffe2c8; }
#helpBar button { font-size: 9px; }
@media (max-width: 1100px) { #helpBar { left: 12px; transform: none; } }
@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) {
  #helpBar { left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top, 0px)); bottom: auto; flex-wrap: wrap; z-index: 6; }
  #helpBar button { flex: 1; }
}

/* Pagination de l'historique */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 4px; }
.pager span { font: 9px var(--pixel); color: var(--muted); min-width: 64px; text-align: center; }
.pager button { padding: 6px 10px; }
.pager button:disabled { opacity: .35; cursor: default; transform: none; }

/* Éditeur de perso : 4 rangées de flèches (coupe, couleur des cheveux, teint, tenue) */
.avatar-editor .arrows button { height: 28px; }
.avatar-editor .arrows button:nth-child(1) { top: 2px; }
.avatar-editor .arrows button:nth-child(2) { top: 38px; }
.avatar-editor .arrows button:nth-child(3) { top: 74px; }
.avatar-editor .arrows button:nth-child(4) { top: 110px; }
/* Code modo sur l'accueil */
#modToggle { justify-self: center; background: transparent; border: 0; box-shadow: none; padding: 4px 6px; font-size: 7px; color: var(--muted); opacity: .6; gap: 6px; }
.mod-toggle svg.px-icon { width: 12px; height: 12px; }
.mod-toggle:hover { opacity: 1; color: var(--fg); }
.mod-toggle:active { transform: none; box-shadow: none; }
#modBox { display: grid; gap: 6px; }
#modBox input { font: 15px ui-monospace, monospace; letter-spacing: .04em; }
#modBox .err { color: #ff6b6b; margin: 0; font-size: 12px; min-height: 0; }

/* ================= Modo'clock ================= */
/* Bandeau d'annonce, style haut-parleur : pavillon pixel + ondes */
#announce { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 8; width: min(560px, calc(100% - 24px));
  display: grid; grid-template-columns: 56px 1fr auto; grid-template-areas: "horn by close" "horn text text" "horn btns btns"; gap: 4px 12px; align-items: center;
  padding: 12px 12px 12px 10px; background: #1d1a2e; border: 3px solid #ffd166; box-shadow: 6px 6px 0 #0009, inset 0 0 0 2px #3a2f12;
  background-image: repeating-linear-gradient(-45deg, rgba(255,209,102,.06) 0 8px, transparent 8px 16px); animation: annIn .35s steps(4); }
#announce::before { content: ""; grid-area: horn; width: 48px; height: 48px; align-self: center; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%231b1b1b' d='M1 6h3v4H1z'/%3E%3Cpath fill='%23e5484d' d='M4 5h2v6H4zM6 4h2v8H6zM8 3h2v10H8z'/%3E%3Cpath fill='%23ffd166' d='M10 2h1v12h-1z'/%3E%3Cpath fill='%23ffffff' d='M12 6h1v4h-1zM14 4h1v8h-1z'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: horn .5s steps(2) infinite; }
#announceBy { grid-area: by; font: 10px/1.4 var(--pixel); color: #ffd166; }
#announceText { grid-area: text; margin: 0; font-size: 15px; line-height: 1.4; color: var(--fg); overflow-wrap: anywhere; }
#announceText a { color: var(--accent); }
#announceBtns { grid-area: btns; display: flex; gap: 8px; flex-wrap: wrap; }
#announceBtns:empty { display: none; }
#announceBtns button { padding: 8px 10px; font-size: 9px; }
#announceClose { grid-area: close; align-self: start; }
@keyframes horn { 50% { transform: scale(1.08) rotate(-4deg); } }
@keyframes annIn { from { transform: translate(-50%, -30px); opacity: 0; } }
/* Téléportation annoncée, micro général */
#tpBanner, #megaBar { position: fixed; left: 50%; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  font: 9px/1.6 var(--pixel); box-shadow: 4px 4px 0 #0009; max-width: calc(100% - 24px); }
#tpBanner { top: 76px; background: #2b2550; color: #fff3c4; border: 3px solid #ffd166; flex-direction: column; align-items: stretch; gap: 8px; }
#tpBar { height: 4px; background: #ffd166; transform-origin: left; }
#megaBar { top: 130px; background: #3a1220; color: #ffe2c8; border: 3px dashed #e5484d; }
#megaBar::before { content: "📢"; font-size: 16px; animation: horn .5s steps(2) infinite; }
#megaBar button { padding: 6px 10px; font-size: 8px; }
/* Exclu */
#kicked { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(10,10,18,.92); }
#kicked h2 { color: #ff6b6b; }
/* Lever la main */
.hand-act { width: 100%; margin-top: 8px; justify-content: flex-start; padding: 8px 10px; font-size: 9px; }
.hand-act.on { background: #ff8c42; color: #1b1b1b; }
/* Messages épinglés */
#pinnedBar { list-style: none; margin: 0; padding: 6px 10px; display: grid; gap: 4px; background: rgba(255,209,102,.08); border-bottom: 2px solid var(--line); font-size: 12px; max-height: 96px; overflow-y: auto; }
#pinnedBar li { position: relative; padding-right: 18px; overflow-wrap: anywhere; }
#pinnedBar .unpin { position: absolute; right: 0; top: 0; padding: 0 4px; box-shadow: none; background: transparent; border: 0; color: var(--muted); font: 14px system-ui; }
#chat li .del.pin { right: 22px; font: 12px system-ui; }

/* Poste de contrôle */
.card.control { width: min(900px, 100%); max-height: calc(100dvh - 32px); display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px;
  background: #15141f; border-color: #a37b12; box-shadow: 6px 6px 0 #0009, inset 0 0 0 2px #3a2f12; }
.card.control h2 { color: #f0cf6e; }
.ctl-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid #3a2f12; padding-bottom: 8px; }
.ctl-tabs button { padding: 7px 9px; font-size: 8px; box-shadow: none; background: #22202f; }
.ctl-tabs button.on { background: #a37b12; color: #15141f; border-color: #f0cf6e; }
.ctl-tabs svg.px-icon { width: 14px; height: 14px; }
.ctl-body { overflow-y: auto; min-height: 280px; display: grid; gap: 12px; align-content: start; }
.ctl-body section { display: grid; gap: 6px; padding: 10px; background: #1d1b29; border: 2px solid #2c2a3c; }
.ctl-body h4 { margin: 0; font: 9px/1.6 var(--pixel); color: #f0cf6e; }
.ctl-body textarea, .ctl-body input, .ctl-body select { font: 14px system-ui; padding: 7px 8px; background: #10111a; color: var(--fg); border: 2px solid var(--line); min-width: 0; }
.ctl-body .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ctl-body button { padding: 7px 9px; font-size: 8px; box-shadow: 2px 2px 0 #0008; justify-self: start; }
.ctl-body button.on { background: #2f6b4a; }
.ctl-row { display: grid; grid-template-columns: 12px minmax(80px, 1fr) minmax(80px, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; background: #1d1b29; border: 2px solid #2c2a3c; }
.ctl-people { display: grid; gap: 6px; }
.ctl-people .ctl-row { grid-template-columns: 12px minmax(70px, 1fr) minmax(70px, 1fr) auto; }
.ctl-people .acts { grid-column: 1 / -1; }
.ctl-row .dot { width: 10px; height: 10px; }
.ctl-row .where { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl-row .st { font-size: 13px; }
.ctl-row .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ctl-rooms { display: grid; gap: 6px; }
.ctl-rooms .ctl-row { grid-template-columns: minmax(110px, 1.4fr) auto minmax(50px, .6fr) auto; }
.ctl-rooms .cap { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.ctl-rooms .cap input { width: 58px; }
.ctl-stage .ctl-row { grid-template-columns: 1fr auto; }
.ctl-plan { width: 100%; height: auto; image-rendering: pixelated; border: 2px solid #3a2f12; cursor: crosshair; }
.ctl-privacy { margin: 0; color: #9be7ff; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpis div { background: #1d1b29; border: 2px solid #2c2a3c; padding: 10px; display: grid; gap: 4px; }
.kpis b { font: 18px var(--pixel); color: #f0cf6e; }
.kpis span { font-size: 12px; color: var(--muted); }
.bars { display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: 120px 1fr 64px; gap: 8px; align-items: center; font-size: 12px; }
.bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar i { display: block; height: 10px; background: linear-gradient(90deg, #a37b12, #f0cf6e); }
.bar b { text-align: right; color: var(--muted); font-weight: normal; }
.day { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--fg); }
.days { gap: 10px !important; }

/* Petites annonces : liège + post-it */
.card.annonces-card { width: min(980px, 100%); max-height: calc(100dvh - 24px); grid-template-rows: auto 1fr auto; }
.cork { min-height: min(560px, 62dvh); max-height: 72dvh; overflow-y: auto; padding: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px; align-content: start;
  background: #c79a5f; border: 8px solid #6b4426; box-shadow: inset 0 0 0 2px #8a5c34, inset 0 0 30px rgba(0,0,0,.25);
  background-image: radial-gradient(#b5874e 1px, transparent 1px), radial-gradient(#d6ad74 1px, transparent 1px); background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 5px; }
.cork-empty { grid-column: 1 / -1; text-align: center; color: #4a2c14; font: 22px 'Caveat', cursive; }
.postit { position: relative; min-height: 130px; padding: 18px 12px 10px; color: #2a2622; box-shadow: 3px 4px 0 rgba(0,0,0,.25); display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.postit::before { content: ""; position: absolute; top: 5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; background: #e5484d; box-shadow: inset -2px -2px 0 #8a1f22, 1px 2px 0 rgba(0,0,0,.3); } /* punaise */
.postit p { margin: 0; font: 600 21px/1.15 'Caveat', cursive; overflow-wrap: anywhere; }
.postit p a { color: #8a3f10; }
.postit small { font-size: 11px; color: rgba(0,0,0,.55); }
.postit-del { position: absolute; top: 2px; right: 2px; padding: 0 5px; background: transparent; border: 0; box-shadow: none; color: rgba(0,0,0,.5); font: 16px system-ui; }
.postit-del:hover { color: #b3261e; }
.annonce-form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.annonce-form textarea { font: 600 20px/1.2 'Caveat', cursive; padding: 6px 10px; resize: none; background: #fffbe0; color: #2a2622; border: 2px solid #c4baa6; }
.annonce-colors { display: flex; gap: 4px; }
.annonce-colors button { width: 26px; height: 26px; padding: 0; border: 2px solid rgba(0,0,0,.3); box-shadow: none; }
.annonce-colors button.on { outline: 3px solid #fff; outline-offset: 1px; }
@media (max-width: 700px) { .annonce-form { grid-template-columns: 1fr; } .cork { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); padding: 14px; gap: 14px; } }

/* Infos & favoris */
.card.info-card { width: min(820px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; }
.info-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-cols section { background: #f4f4ef; color: #2a2622; border: 4px solid #3a3e5c; padding: 10px; }
.info-cols h4 { margin: 0 0 8px; padding: 6px 8px; background: #3d85c6; color: #fff; font: 9px/1.6 var(--pixel); }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.info-list li { position: relative; padding: 6px 22px 6px 8px; background: #fff; border: 2px solid #d6d0c2; display: grid; gap: 2px; }
.info-list li.empty { color: #8a7a6a; border-style: dashed; }
.info-list a { color: #1f5f99; font-weight: 600; }
.info-list small { color: #7a6a5a; font-size: 11px; overflow-wrap: anywhere; }
.info-list p { margin: 0; white-space: pre-wrap; }
.info-add { display: grid; grid-template-columns: auto 1fr 1.4fr auto; gap: 8px; }
.info-add input, .info-add select, .info-add textarea { font: 14px system-ui; padding: 7px 8px; background: #10111a; color: var(--fg); border: 2px solid var(--line); min-width: 0; }
@media (max-width: 700px) { .info-cols, .info-add { grid-template-columns: 1fr; } .ctl-rooms .ctl-row { grid-template-columns: 1fr 1fr; } #announce { top: 8px; } }

/* Boutons réservés aux modos dans la barre du bas */
#dock .dk.modo { background: #4a3a10; color: #ffe08a; border-color: #a37b12; }
#dock .dk.modo:hover { border-color: #ffd166; }
#dock .dk.modo.live { background: #8a1f2f; color: #fff; border-color: #ff6b6b; animation: hblink 1s steps(2) infinite; }
#sky { margin-top: 6px; font-size: 11px; color: #9fb4d8; }
@media (max-height: 500px) and (max-width: 1000px) { #sky { display: none; } }
#dock .dk .wave-ico { font-size: 19px; line-height: 24px; height: 24px; font-weight: normal; }

/* Onglets du chat : une ligne qui défile + flèches sur les côtés */
.chat-head { flex-wrap: nowrap; align-items: flex-end; gap: 4px; }
.chat-tabs { order: 0; flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; scroll-behavior: smooth; }
.chat-tabs::-webkit-scrollbar { display: none; }
.ctab { flex: none; }
.tabs-arrow { position: relative; flex: none; align-self: stretch; padding: 0 3px; margin-bottom: 0; box-shadow: none; background: #22243a; border-bottom: 0; }
.tabs-arrow svg.px-icon { width: 14px; height: 14px; }
.tabs-arrow .arrow-dot { position: absolute; top: 2px; right: 1px; width: 8px; height: 8px; background: #e5484d; border: 1px solid #1b1d2a; animation: hblink .6s steps(2) infinite; }
.tabs-arrow.left .arrow-dot { right: auto; left: 1px; }

/* Touche de raccourci, en petit dans le coin bas-droit des boutons de la barre */
#dock .dk { position: relative; padding-right: 17px; padding-left: 17px; }
#dock .dk kbd { position: absolute; right: 2px; bottom: 2px; font: 6px/1 var(--pixel); color: rgba(255,255,255,.45); background: rgba(0,0,0,.25); padding: 2px 2px 1px; border-radius: 0; pointer-events: none; }
#dock .dk.modo kbd { color: rgba(255,224,138,.6); }
@media (hover: none), (max-width: 700px) { #dock .dk kbd { display: none; } #dock .dk { padding-left: 0; padding-right: 0; } }

/* En-tête du chat : onglets collés en haut et à gauche sur toute la largeur, outils posés au-dessus de la fenêtre */
#chat .chat-head { padding: 0; gap: 0; border-bottom: 2px solid var(--line); align-items: stretch; }
#chat .chat-tabs { gap: 0; }
#chat .ctab { border-top: 0; border-left: 0; border-bottom: 0; border-right: 2px solid var(--line); margin: 0; padding: 8px 10px; }
#chat .tabs-arrow { border: 0; border-right: 2px solid var(--line); padding: 0 4px; }
#chat .tabs-arrow.right { border-right: 0; border-left: 2px solid var(--line); }
#chat .chat-tools { position: absolute; bottom: 100%; right: -2px; padding: 0; gap: 0; border: 2px solid var(--line); border-bottom: 0; background: #181a28; }
#chat .chat-tools button { padding: 5px 7px; background: transparent; border: 0; border-left: 2px solid var(--line); margin: 0; box-shadow: none; }
#chat .chat-tools button:first-child { border-left: 0; }
#chat .chat-tools button:hover { border-color: var(--accent); position: relative; z-index: 1; }
#chat.min .chat-head { padding: 0; }

/* Collègues : grille d'avatars */
.card.people-card { width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; }
.card.people-card h2 small { font: 11px system-ui; color: var(--muted); }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.person { display: grid; justify-items: center; gap: 4px; padding: 10px 6px 8px; background: #1d1f30; border: 2px solid var(--line); }
.person canvas { width: 48px; height: 81px; image-rendering: pixelated; }
.person b { font: 8px/1.4 var(--pixel); color: var(--fg); text-align: center; overflow-wrap: anywhere; padding-bottom: 3px; }
.person .pst { font-size: 12px; min-height: 16px; }
.person.muted { opacity: .65; }
.pacts { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.pacts button { padding: 4px 5px; font: 13px system-ui; box-shadow: none; }
.pacts button:disabled { opacity: .35; cursor: default; transform: none; }
.pacts button.on { background: #6b2430; }
.invite-box { display: grid; gap: 6px; padding-top: 8px; border-top: 2px solid var(--line); }
.invite-box h4 { margin: 0; font: 9px/1.6 var(--pixel); color: var(--muted); text-transform: uppercase; }
.invite-box button { justify-self: start; }

/* ================= Inventaire & feuilles à collectionner ================= */
.card.inv-card { width: min(860px, 100%); }
.inv-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); }
.inv-tabs button { padding: 8px 10px; font-size: 8px; box-shadow: none; background: transparent; border-bottom: 0; color: var(--muted); }
.inv-tabs button.on { background: #2f3350; color: var(--fg); }
.inv-tabs button b { margin-left: 4px; color: var(--accent); font-size: 8px; }
.inv-pane { display: grid; gap: 8px; }
.sheets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 58dvh; overflow-y: auto; padding: 2px; }
.sheet-cell { position: relative; display: grid; justify-items: center; gap: 4px; padding: 8px 4px 6px; background: #1d1f30; border: 2px solid var(--line); box-shadow: none; font: 11px/1.2 system-ui; color: var(--fg); }
.sheet-cell canvas { width: 72px; height: 72px; image-rendering: pixelated; box-shadow: 2px 2px 0 #0006; }
.sheet-cell span { font-size: 11px; text-align: center; min-height: 26px; }
.sheet-cell b { position: absolute; top: 4px; right: 4px; font: 8px var(--pixel); color: var(--accent); }
.sheet-cell.missing { opacity: .45; cursor: default; }
.sheet-cell.missing:active { transform: none; }
.sheet-cell.missing i { display: grid; place-items: center; width: 72px; height: 72px; background: #2a2c40; border: 2px dashed #4a4e6c; font: 24px var(--pixel); color: #4a4e6c; font-style: normal; }
/* Feuille en grand */
.sheet-view { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 32px); }
.sheet-paper { padding: 14px 14px 22px; background: #fbf7ec; box-shadow: 8px 10px 0 #0008; transform: rotate(-1.5deg); }
.sheet-paper canvas { display: block; width: min(288px, 70vw); height: auto; image-rendering: pixelated; }
.sheet-view.printing .sheet-paper { animation: printOut 1.1s steps(11) both; }
@keyframes printOut { from { clip-path: inset(0 0 100% 0); transform: translateY(-40px) rotate(0); } to { clip-path: inset(0 0 0 0); transform: translateY(0) rotate(-1.5deg); } }
.sheet-info { display: grid; gap: 10px; justify-items: start; max-width: 320px; background: var(--panel); border: 3px solid var(--line); padding: 16px; box-shadow: 6px 6px 0 #0008; }
.sheet-info h2 { margin: 0; font: 14px/1.5 var(--pixel); color: var(--fg); }
.sheet-info p { margin: 0; color: var(--muted); font-size: 14px; }
.sheet-info .row { display: flex; gap: 6px; }
.rarity { padding: 4px 8px; font: 8px var(--pixel); color: #1b1b1b; }
.chat-sheet { width: 40px; height: 40px; vertical-align: middle; image-rendering: pixelated; cursor: zoom-in; box-shadow: 2px 2px 0 #0006; margin: 0 4px; }

/* Réglages : volumes à gauche, invitation à droite */
.card.settings { width: min(760px, 100%); }
.settings-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.settings-vol { display: grid; gap: 6px; }
.settings-vol .row { margin-top: 6px; gap: 6px; }
.settings-cols h4 { margin: 0 0 4px; font: 9px/1.6 var(--pixel); color: var(--muted); text-transform: uppercase; }
.settings-cols h4 small { text-transform: none; font: 11px system-ui; }
.invite-box { border-top: 0; padding-top: 0; padding-left: 20px; border-left: 2px solid var(--line); align-content: start; }
.invite-link { background: #10111a; border: 2px dashed var(--line); padding: 10px; }
.invite-link code { font: 12px/1.4 ui-monospace, monospace; color: var(--accent); overflow-wrap: anywhere; user-select: all; }
@media (max-width: 700px) { .settings-cols { grid-template-columns: 1fr; } .invite-box { border-left: 0; padding-left: 0; border-top: 2px solid var(--line); padding-top: 12px; } }

/* Déchiqueteuse */
.card.shred-card { width: min(760px, 100%); position: relative; }
.sheet-cell.picked { outline: 3px solid #e5484d; outline-offset: 1px; }
#shredStage { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 16, 26, .92); overflow: hidden; }
#shredStage canvas { width: 160px; height: 160px; image-rendering: pixelated; }
.shred-slot { position: absolute; left: 50%; top: 58%; width: 220px; height: 14px; margin-left: -110px; background: #2b2d42; border: 3px solid #1b1b1b; box-shadow: 0 6px 0 #4a4e6c; }
#shredStage.go canvas { animation: shredIn 1.3s steps(13) forwards; }
@keyframes shredIn {
  0% { transform: translateY(-80px); clip-path: inset(0 0 0 0); }
  100% { transform: translateY(60px); clip-path: inset(0 0 100% 0); }
}
#shredStage.go::after { content: ""; position: absolute; left: 50%; top: calc(58% + 17px); width: 160px; height: 0; margin-left: -80px;
  background: repeating-linear-gradient(90deg, #fbf7ec 0 8px, transparent 8px 12px); animation: strips 1.3s steps(13) forwards; }
@keyframes strips { to { height: 120px; } }

/* ✦ Shiny : reflet holographique arc-en-ciel qui traverse la feuille, en bandes pixelisées */
.shiny { position: relative; overflow: hidden; }
.shiny::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: hard-light;
  background: linear-gradient(115deg, transparent 0 41%, rgba(255,80,160,.28) 42% 44%, rgba(255,214,0,.28) 44% 46%, rgba(80,255,170,.28) 46% 48%, rgba(70,170,255,.28) 48% 50%, rgba(190,110,255,.28) 50% 52%, transparent 53%);
  background-size: 300% 100%; animation: holo 2.6s steps(26) infinite; }
.shiny::before { content: "✦"; position: absolute; z-index: 2; top: 6px; right: 8px; color: #fff3c4; font-size: 18px; text-shadow: 0 0 2px #f0b429, 1px 1px 0 #a37b12; animation: twinkle 1.2s steps(2) infinite; }
@keyframes holo { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes twinkle { 50% { opacity: .35; transform: scale(.8); } }
.chat-sheet-wrap { display: inline-block; vertical-align: middle; }
.chat-sheet-wrap.shiny::before { font-size: 10px; top: 0; right: 2px; }
.sheet-cell.has-shiny { box-shadow: 0 0 0 2px #f0b429, 0 0 10px #f0b42988; }
.sheet-cell .shiny-mark { position: absolute; top: 3px; left: 5px; color: #f0b429; font-size: 13px; animation: twinkle 1.2s steps(2) infinite; }
.check-row { display: flex !important; align-items: center; gap: 8px; font-size: 13px; color: var(--fg) !important; margin-top: 6px; cursor: pointer; }
.check-row input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Plan zoomable + aperçu d'une pièce */
.plan-wrap { max-height: 56dvh; overflow: auto; border: 2px solid #3a2f12; background: #1d1b29; cursor: grab; }
.plan-wrap:active { cursor: grabbing; }
.plan-wrap.tp, .plan-wrap.tp:active { cursor: crosshair; }
.plan-zoom .tp-btn { margin-left: auto; }
.plan-zoom .tp-btn.on { background: #e8b923; color: #1b1b1b; }
.plan-wrap .ctl-plan { display: block; border: 0; max-width: none; cursor: inherit; }
.plan-zoom button { min-width: 34px; font-size: 10px; }
.card.peek-card { width: auto; max-width: min(760px, calc(100vw - 32px)); }
#peekCanvas { display: block; max-width: 100%; max-height: 62dvh; image-rendering: pixelated; border: 3px solid #3a2f12; background: #1d1b29; }

/* Ce qu'on a en main : actions Croquer / Boire / Poser */
#snackBar { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 4; display: grid; gap: 6px; }
.snack-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: var(--panel); border: 2px solid #c79a5f; box-shadow: 4px 4px 0 #0008; }
.snack-row span { font: 9px/1.5 var(--pixel); color: var(--fg); white-space: nowrap; }
.snack-row button { padding: 6px 9px; font-size: 8px; box-shadow: 2px 2px 0 #0008; }
@media (max-width: 1100px) { #snackBar { left: 12px; transform: none; } }
@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) { #snackBar { left: 8px; right: 8px; bottom: calc(var(--dock-h) + 70px + var(--sb)); } }

/* Écran d'arrivée : carte + encadré « ce qui t'attend » à droite */
#join { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; gap: 24px; }
.join-info { width: min(330px, 100%); gap: 14px; background: rgba(22, 24, 36, .72); border-color: #2f3350; }
.join-info h2 { margin: 0; font: 11px/1.6 var(--pixel); color: var(--accent); }
.join-info ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.join-info li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.join-info li svg.px-icon { width: 24px; height: 24px; color: var(--accent); margin-top: 2px; }
.join-info li div { display: grid; gap: 2px; }
.join-info li b { font: 8px/1.6 var(--pixel); color: var(--fg); }
.join-info li span { font-size: 13px; line-height: 1.35; color: var(--muted); }
.join-info .tip { margin: 0; padding-top: 10px; border-top: 2px solid var(--line); font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { #join { align-content: start; overflow-y: auto; } .join-info { order: 2; } }
.join-info .intro-line { margin: -4px 0 0; font-size: 13px; line-height: 1.45; color: var(--fg); opacity: .85; }
/* Faire tourner le perso dans l'aperçu */
.avatar-turn { display: flex; justify-content: center; gap: 8px; margin-top: -4px; }
.avatar-turn button { padding: 5px 10px; box-shadow: 2px 2px 0 #0008; }
.avatar-turn svg.px-icon { width: 18px; height: 18px; }
#turnRight svg { transform: scaleX(-1); }
/* Encadré d'arrivée : un peu plus grand, police plus lisible */
.join-info { width: min(400px, 100%); padding: 26px; gap: 16px; }
.join-info h2 { font-size: 13px; }
.join-info .intro-line { font-size: 15px; line-height: 1.5; }
.join-info ul { gap: 15px; }
.join-info li { grid-template-columns: 34px 1fr; }
.join-info li svg.px-icon { width: 28px; height: 28px; }
.join-info li b { font-size: 10px; }
.join-info li span { font-size: 15px; }
.join-info .tip { font-size: 14px; }
/* Titre O'Campus centré en haut, au-dessus des deux cadres */
.join-title { flex: 1 0 100%; margin: 0 0 10px; text-align: center; font: 52px/1.2 var(--pixel); color: var(--accent); text-shadow: 4px 4px 0 #0008; letter-spacing: 1px; }
#joinForm .room-name { margin-top: 0; font-size: 13px; }
@media (max-width: 700px) { .join-title { font-size: 30px; } }
/* Ligne « Espace ……… O'clock » en haut de la carte */
.room-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--line); }
.room-line span { font-size: 13px; color: var(--muted); }
.room-line .room-name { margin: 0; font: 12px/1.5 var(--pixel); color: var(--accent); text-align: right; overflow-wrap: anywhere; }

/* L'aquarium en grand */
.aqua-frame { position: relative; padding: 10px; background: #2b2b33; border: 4px solid #1b1b1b; box-shadow: 10px 10px 0 #0009, inset 0 0 0 2px #4a4e6c; }
#aquaCanvas { display: block; width: min(880px, 88vw, 140vh); height: auto; image-rendering: pixelated; }
.aqua-full { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); background: var(--panel); border: 3px solid #1b1b1b; box-shadow: 4px 4px 0 #0008; padding: 6px 12px; font-weight: 700; white-space: nowrap; pointer-events: none; animation: aquaFull .25s ease-out; }
@keyframes aquaFull { from { transform: translateX(-50%) translateY(6px); opacity: 0; } }
.aqua-close { position: absolute; top: -14px; right: -14px; background: var(--panel); }

/* Batterie */
.card.drum-card { width: min(640px, 100%); }
.drum-pads { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 12px; }
.drum-pad { flex-direction: column; gap: 10px; height: 150px; font: 9px/1.4 var(--pixel); border-width: 3px; touch-action: none; user-select: none; }
.drum-pad kbd { font: 10px var(--pixel); padding: 4px 8px; background: rgba(0,0,0,.35); color: #fff; }
.drum-pad.hat { background: #a37b12; border-color: #e8b923; color: #fff3c4; }
.drum-pad.snare { background: #c8c8d0; border-color: #f4f1ea; color: #1b1b1b; }
.drum-pad.kick { background: #8a1f2f; border-color: #e5484d; color: #fff; }
.drum-pad.hit { animation: drumHit .15s steps(2); }
@keyframes drumHit { 0% { transform: scale(.94) translate(2px, 2px); filter: brightness(1.6); box-shadow: 0 0 0 #000; } 100% { transform: none; filter: none; } }
@media (max-width: 560px) { .drum-pads { grid-template-columns: 1fr; } .drum-pad { height: 90px; } }
#aquaCanvas { cursor: pointer; }

/* Boutons Oui / Non dans la bulle du guide */
.npc-ask { position: fixed; z-index: 30; display: flex; gap: 8px; transform: translateX(-50%); }
.npc-ask button { padding: 6px 14px; font: 9px var(--pixel); background: #ffd166; color: #1b1b1b; border: 2px solid #1b1b1b; box-shadow: 2px 2px 0 #0006; }
.npc-ask button[data-a="no"] { background: #eef0ff; }

/* Barre de défilement du chat, façon pixel */
@supports not selector(::-webkit-scrollbar) { #chat *, .surv-body { scrollbar-width: thin; scrollbar-color: #5a5f8a #12131d; } } /* Firefox ; Chrome utilise le style ci-dessous */
:is(#chat *, .surv-body)::-webkit-scrollbar { width: 8px; height: 8px; }
:is(#chat *, .surv-body)::-webkit-scrollbar-track { background: #12131d; border-left: 2px solid #0a0b12; }
:is(#chat *, .surv-body)::-webkit-scrollbar-thumb { background: #5a5f8a; border: 2px solid #12131d; border-radius: 0; box-shadow: inset 1px 1px 0 #7d82b0, inset -1px -1px 0 #3a3e5c; }
:is(#chat *, .surv-body)::-webkit-scrollbar-thumb:hover { background: var(--accent); box-shadow: inset 1px 1px 0 #ffe29a, inset -1px -1px 0 #c79a2e; }
:is(#chat *, .surv-body)::-webkit-scrollbar-button { display: none; }
:is(#chat *, .surv-body)::-webkit-scrollbar-corner { background: transparent; }

/* Comptoir du surveillant */
.surv-act { box-shadow: 2px 2px 0 #0008; }
.surv-act svg { width: 15px; height: 15px; }
.surv-panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(820px, calc(100vw - 24px)); max-height: 80dvh; display: flex; flex-direction: column; z-index: 25; border: 3px solid #8f5e38; box-shadow: 6px 6px 0 #0008; padding: 0; }
.surv-head { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 2px solid #4a2f1c; }
.surv-tabs { display: flex; gap: 6px; flex: 1; }
.surv-tabs button { padding: 7px 10px; font-size: 9px; box-shadow: none; }
.surv-tabs button.on { background: #8f5e38; border-color: #ffd166; color: #fff; }
.surv-body { overflow: auto; padding: 8px; }
.surv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.surv-card { background: #12131d; border: 2px solid var(--line); padding: 6px; display: grid; grid-template-columns: auto 1fr; gap: 2px 6px; align-items: center; position: relative; }
.surv-card.help { border-color: #ff8c42; }
.surv-card canvas { grid-row: span 2; width: 24px; height: 30px; image-rendering: pixelated; }
.surv-card b { font: 8px/1.4 var(--pixel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surv-card small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surv-card .help-flag { position: absolute; bottom: 2px; right: 4px; font-size: 13px; }
.surv-card .surv-acts { position: absolute; top: 2px; right: 2px; display: flex; gap: 3px; }
.surv-card .surv-acts button { padding: 2px 4px; font-size: 12px; box-shadow: none; }
.surv-card .surv-acts button.live { background: #1f6f74; border-color: #5ce1e6; }
.surv-card b { padding-right: 52px; }
.surv-card small { padding-right: 18px; }
.surv-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.surv-room { display: flex; align-items: center; gap: 8px; background: #12131d; border: 2px solid var(--line); padding: 6px 8px; }
.surv-room.on { border-color: #5ce1e6; }
.surv-room div { flex: 1; min-width: 0; }
.surv-room b { font: 8px/1.5 var(--pixel); display: block; }
.surv-room small { color: var(--muted); font-size: 11px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surv-room button { padding: 6px 8px; font-size: 8px; box-shadow: none; white-space: nowrap; }
.surv-room button.live { background: #1f6f74; border-color: #5ce1e6; }
@media (max-width: 640px) { .surv-panel { max-height: 70dvh; } }

#kickedText { white-space: pre-line; }

/* Surveillant connecté à un bureau */
#remoteBar { position: fixed; left: 50%; top: 80px; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #0f3a3d; color: #e6fdff; border: 3px solid #5ce1e6; box-shadow: 4px 4px 0 #0008; font: 10px/1.5 var(--pixel); }
#remoteBar button { font-size: 9px; padding: 8px 10px; }
.surv-intro { margin: 0 0 8px; font-size: 13px; color: var(--muted); }

/* File d'attente des demandes d'aide (comptoir des surveillants) */
.surv-tabs .badge { position: static; margin-left: 4px; }
.surv-queue { display: grid; gap: 6px; }
.surv-q { display: flex; align-items: center; gap: 8px; background: #12131d; border: 2px solid #ff8c42; padding: 6px 8px; }
.surv-q.taken { border-color: var(--line); opacity: .8; }
.surv-q canvas { width: 24px; height: 30px; image-rendering: pixelated; }
.surv-qn { font: 10px var(--pixel); color: #ff8c42; min-width: 28px; }
.surv-q.taken .surv-qn { color: var(--muted); }
.surv-qtxt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.surv-qtxt b { font: 8px/1.5 var(--pixel); }
.surv-qtxt small { color: var(--muted); font-size: 11px; }
.surv-qtxt q { font-size: 12px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surv-qtxt em { font-size: 11px; color: #81b29a; font-style: normal; }
.surv-qacts { display: flex; gap: 4px; }
.surv-qacts button { padding: 5px 7px; font-size: 9px; box-shadow: none; white-space: nowrap; }

/* Minuteur partagé d'une pièce */
.timer-menu { display: flex; flex-wrap: wrap; gap: 4px; }
.timer-menu button { padding: 6px 7px; font-size: 8px; box-shadow: none; }
#timerLeft { margin-left: auto; background: #2f6b4a; }

/* Pause : voile par-dessus tout, un seul bouton pour revenir */
#dozeOverlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; padding-bottom: 22dvh; background: rgba(10, 12, 24, .6); backdrop-filter: blur(1px); }
#dozeOverlay[hidden] { display: none; }
.doze-card { display: grid; justify-items: center; gap: 14px; padding: 26px 34px; background: var(--panel); border: 3px solid #ff8c42; box-shadow: 6px 6px 0 #0009; }
.doze-card h2 { margin: 0; font: 14px var(--pixel); color: #ffd166; }
.doze-cup { font-size: 34px; animation: dozeSteam 2.4s ease-in-out infinite; }
@keyframes dozeSteam { 50% { transform: translateY(-3px); } }
#dozeBack { font-size: 11px; padding: 12px 16px; }

#dock .dk.quit { background: #4a1f28; color: #f0a8ae; border-color: #7a3440; }
#dock .dk.quit:hover { border-color: #c85a66; }
.quit-card { display: grid; gap: 16px; text-align: center; }
.quit-card h2 { margin: 0; }
.quit-acts { display: flex; gap: 8px; justify-content: center; }
.quit-acts .danger { background: #6b2430; }

/* Modos présents, sous la carte de la pièce */
#modoCard { left: 12px; width: 260px; box-sizing: border-box; padding: 10px 12px; z-index: 5; }
#modoCard h3 { margin-bottom: 8px; }
#modoList { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 40vh; overflow-y: auto; }
#modoList li { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; }
#modoList canvas { width: 32px; height: 54px; image-rendering: pixelated; }
#modoList .mn { display: grid; gap: 3px; min-width: 0; }
#modoList .mn b { font: 8px/1.4 var(--pixel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#modoList .mn small { font-size: 11px; color: var(--muted); }
#modoList .pacts { flex-wrap: nowrap; }
@media (max-width: 720px) { #modoCard { left: 8px; width: auto; max-width: calc(100% - 16px); padding: 8px 10px; } }

/* « Voir l'écran de X » : un partage est en cours, le bouton pulse doucement avec un point rouge */
#watchBtn.live { animation: livePulse 1.6s ease-in-out infinite; }
#watchBtn.live::after { content: ''; width: 8px; height: 8px; margin-left: auto; flex: none; background: #e5484d; box-shadow: 0 0 0 2px #0006; animation: liveDot 1s steps(2, jump-none) infinite; }
@keyframes livePulse { 0%, 100% { border-color: var(--line); background: #2f3350; } 50% { border-color: #e5484d; background: #3d2f45; } }
@keyframes liveDot { 0% { opacity: 1; } 100% { opacity: .25; } }

/* Écran d'accueil : panneau à gauche avec les gens déjà là */
.join-here { width: min(260px, 100%); align-self: stretch; display: flex; flex-direction: column; gap: 14px; background: rgba(22, 24, 36, .72); border-color: #2f3350; }
.join-here h2 { margin: 0; font: 11px/1.6 var(--pixel); color: var(--accent); }
.join-here h2 small { font: 9px var(--pixel); color: #3ccf6e; margin-left: 6px; }
#hereAvatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px 6px; align-content: start; overflow-y: auto; max-height: 60vh; }
#hereAvatars canvas { width: 48px; height: 81px; image-rendering: pixelated; }
#hereAvatars .more, #hereAvatars .none { font: 8px/1.6 var(--pixel); color: var(--muted); align-self: center; }
#hereAvatars .none { grid-column: 1 / -1; }
@media (max-width: 760px) { .join-here { order: 3; align-self: auto; } }
.here-p { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.here-p span { font: 7px/1.4 var(--pixel); color: var(--fg); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Téléphone en portrait : carte de la pièce compacte, actions en une ligne d'icônes (le jeu garde la place) */
@media (max-width: 700px) {
  #roomCard { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
  #roomCard > #zoneName { flex: 1 1 auto; margin: 0; }
  #roomCard > #zoneDesc, #roomCard > #sky { flex-basis: 100%; margin: 2px 0 0; }
  #roomActions { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; flex: 0 1 auto; max-width: 100%; margin: 6px 4px 0 0; padding: 0; border: 0; scrollbar-width: none; }
  #roomActions::-webkit-scrollbar { display: none; }
  #roomActions .act, #roomCard .hand-act { width: auto; flex: 0 0 auto; padding: 8px 11px; margin: 6px 4px 0 0; }
  #roomActions .act { margin: 0; }
  #roomActions .act span, #roomCard .hand-act span { display: none; }
  #roomActions .act svg.px-icon, #roomCard .hand-act svg.px-icon { width: 18px; height: 18px; }
  #boardPreview { flex-basis: 100%; }
  /* modos présents : une ligne d'avatars, sans titre */
  #modoCard { padding: 6px 8px; }
  #modoCard h3 { display: none; }
  #modoList { display: flex; gap: 8px; overflow-x: auto; max-height: none; }
  #modoList li { grid-template-columns: 24px auto auto; gap: 4px; }
  #modoList canvas { width: 24px; height: 40px; }
  #modoList .mn small { display: none; }
}

/* Réglages : choix du micro et de la sortie son, jauge du micro */
.modal label.set.dev { grid-template-columns: 16px 92px 1fr; }
.modal label.set.dev select { min-width: 0; width: 100%; font: 13px system-ui, sans-serif; background: #10111a; color: var(--fg); border: 2px solid var(--line); padding: 6px; }
.mic-meter { height: 8px; margin: -2px 0 4px 116px; background: #10111a; border: 2px solid var(--line); }
.mic-meter i { display: block; height: 100%; width: 0; background: #3ccf6e; transition: width .08s linear; }
@media (max-width: 700px) { .mic-meter { margin-left: 0; } }

/* Recherche dans le chat */
#chatSearch { margin: 6px 8px 0; padding: 6px 8px; font: 13px system-ui, sans-serif; background: #10111a; color: var(--fg); border: 2px solid var(--line); }
#chatSearchBtn { font-size: 12px; line-height: 1; }
#chatSearchBtn.on { background: var(--accent); }
#chat li.found mark { background: #ffd16655; color: inherit; }

/* Écran tactile : gros bouton d'action (remplace la touche E) */
.act-float { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h, 58px) + 64px + env(safe-area-inset-bottom, 0px)); z-index: 6; padding: 12px 18px; font: 10px var(--pixel); background: var(--accent); color: #1b1b1b; border-color: #b8913a; max-width: calc(100% - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-float:active { transform: translateX(-50%) translateY(2px); }
