:root {
  --paper: #eef1f2;
  --card: #ffffff;
  --line: #d5dbde;
  --ink: #16181d;
  --soft: #5d6670;
  --honey: #ffc21a;
  --logo-mark: #16181d;
  --live: #0f7a74;
  --mute: #d8432f;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --on-ink: #ffffff;
  --field: #ffffff;
  --ink-hover: #2c3038;
  --empty: #e1e6e8;
  --hexagon: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  color-scheme: light;
}

/* Mode sombre : noir et jaune */
:root[data-theme="dark"] {
  /* Texte clair lisible ; le jaune (honey) reste pour les accents / alvéoles */
  --paper: #0b0b0a;
  --card: #161612;
  --line: #3d381c;
  --ink: #f3eecf;
  --soft: #b0a36a;
  --honey: #ffc21a;
  --logo-mark: #ffc21a;
  --live: #ffd84d;
  --mute: #ff6a4d;
  --on-ink: #16181d;
  --field: #0f0f0d;
  --ink-hover: #ffe066;
  --empty: #2a2714;
  --on-honey: #16181d; /* texte sur fond miel */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--body);
}

button, input, select { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; }

.brand { display: flex; align-items: center; gap: 10px; font: 700 18px var(--display); letter-spacing: -0.03em; }
.logo { width: 32px; height: 26px; flex: 0 0 auto; }
.brand .logo path { fill: var(--logo-mark); }

/* ───── Accueil : le seul grand aplat de la page ───── */

.join {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  background-color: var(--honey);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='55.43' height='96'%3E%3Cpath d='M0 16L27.71 0L55.43 16M0 16V48M55.43 16V48M0 48L27.71 64L55.43 48M27.71 64V96' fill='none' stroke='%23f0b300' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 110.86px 192px;
}
.join .logo { fill: none; stroke: none; }

.join-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(24px, 5vw, 72px);
}
.join h1 {
  margin: 0 0 20px;
  max-width: 13ch;
  font: 700 clamp(30px, 4.4vw, 58px) / 1.04 var(--display);
  letter-spacing: -0.045em;
}
.lede { margin: 0; max-width: 44ch; font-size: 18px; line-height: 1.45; }
.hero-text { margin-block: auto; }

.join-panel {
  display: grid;
  align-content: center;
  padding: clamp(24px, 4vw, 56px);
  background: var(--card);
}
.join-panel form { width: min(380px, 100%); }
.join-panel h2 { margin: 0 0 24px; font: 700 22px var(--display); letter-spacing: -0.03em; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 20px; padding: 0; border: 0; }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: block;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
}
.seg input:checked + span { background: var(--ink); color: var(--on-ink); }
.seg input:focus-visible + span { outline: 3px solid var(--honey); outline-offset: 2px; }

.field { display: grid; gap: 6px; margin-bottom: 16px; font-weight: 600; font-size: 14px; }
input:not([type="radio"]):not([type="range"]), select {
  width: 100%;
  padding: 12px 14px;
  background: var(--field);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  font-weight: 400;
  font-size: 16px;
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }

.join[data-role="student"] .t { display: none; }

.go {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
  font: 700 15px var(--display);
  letter-spacing: -0.02em;
  cursor: pointer;
}
.go:hover { background: var(--ink-hover); }
.go:disabled { opacity: 0.5; cursor: wait; }
.go.small { width: auto; margin: 0; padding: 10px 16px; font-size: 14px; }
.err { min-height: 1.5em; margin: 12px 0 0; color: var(--mute); font-size: 14px; font-weight: 500; }

@media (max-width: 800px) {
  .join { grid-template-columns: 1fr; }
  .join-hero { gap: 28px; }
}

/* ───── Classe ───── */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.room-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.who { margin-left: auto; color: var(--soft); font-size: 14px; }
.net { display: flex; align-items: center; gap: 6px; color: var(--live); font-size: 13px; font-weight: 600; }
.net::before { content: ""; width: 9px; height: 10px; background: currentColor; clip-path: var(--hexagon); }
.net.bad { color: var(--mute); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 20px 24px 96px;
}

.switch select { width: auto; max-width: 260px; padding: 6px 10px; font-size: 14px; font-weight: 600; }
.lobby { max-width: 760px; margin: 0 auto; padding: 20px 24px 40px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 14px; }
  .lobby { padding: 14px; }
  .bar { padding: 10px 14px; }
}

.pane { padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.pane h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 700 15px var(--display); letter-spacing: -0.03em; }
.count { margin-left: auto; color: var(--soft); font: 500 13px var(--body); letter-spacing: 0; }
.hex {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 34px;
  background: var(--honey);
  clip-path: var(--hexagon);
  color: #16181d;
  font: 700 13px var(--display);
  font-style: normal;
}
.hex.empty { background: var(--empty); color: var(--soft); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tiles.big { grid-template-columns: 1fr; }
.tiles:empty { display: block; }
.tiles:empty::before,
.rooms:empty::before {
  content: attr(data-empty);
  display: block;
  padding: 44px 16px;
  text-align: center;
  color: var(--soft);
  border: 1.5px dashed var(--line);
  border-radius: 10px;
}

.tile { position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: #1c2024; border-radius: 10px; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.cam-off video { visibility: hidden; }
.avatar { position: absolute; inset: 0; display: none; place-items: center; color: var(--honey); font: 700 40px var(--display); }
.tile.cam-off .avatar { display: grid; }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px var(--live);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.tile.speaking::after { opacity: 1; }
.tile figcaption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  background: rgba(22, 24, 29, 0.8);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}
.tile .dot { width: 9px; height: 10px; background: var(--honey); clip-path: var(--hexagon); }
.tile.mic-off .dot { background: var(--mute); }
.tile.screen { grid-column: 1 / -1; aspect-ratio: 16 / 9; background: #000; }
.tile.screen video { object-fit: contain; }
.tiles.big:has(.screen) .tile:not(.screen) { max-width: 260px; } /* la caméra du prof passe en vignette */

/* Agrandir : bouton en haut à droite de chaque tuile, visible au survol (toujours sur écran tactile). */
.expand {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(22, 24, 29, 0.75);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.expand svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.expand .shrink { display: none; }
.tile:hover .expand, .expand:focus-visible { opacity: 1; }
@media (hover: none) { .expand { opacity: 1; } }

.tile:fullscreen, .tile.expanded { aspect-ratio: auto; border-radius: 0; background: #000; }
.tile.expanded { position: fixed; inset: 0; z-index: 40; max-width: none !important; }
.tile:fullscreen video, .tile.expanded video { object-fit: contain; }
.tile:fullscreen .expand, .tile.expanded .expand { opacity: 1; }
.tile:fullscreen .grow, .tile.expanded .grow { display: none; }
.tile:fullscreen .shrink, .tile.expanded .shrink { display: block; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.controls:empty { display: none; }

.tog, .ghost {
  padding: 9px 14px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.ghost { background: transparent; }
.tog:hover, .ghost:hover { border-color: var(--ink); }
.tog::before { content: ""; display: inline-block; width: 9px; height: 10px; margin-right: 8px; background: var(--mute); clip-path: var(--hexagon); }
.tog[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.tog[aria-pressed="true"]::before { background: var(--honey); }

.vol { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--soft); font-size: 13px; }
input[type="range"] { width: 110px; accent-color: var(--ink); }

/* ───── Salles disponibles ───── */

.rooms { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.room-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.room-info { display: grid; gap: 1px; min-width: 0; margin-right: auto; }
.room-info b { font: 700 14px var(--display); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.room-info small { color: var(--soft); font-size: 13px; }
.room-info .names { color: var(--ink); }
.room-actions { display: flex; align-items: center; gap: 8px; }
.live { display: flex; align-items: center; gap: 6px; color: var(--live); font-size: 13px; font-weight: 600; white-space: nowrap; }
.live::before { content: ""; width: 9px; height: 10px; background: currentColor; clip-path: var(--hexagon); }

.create { display: flex; gap: 8px; }
.create input:not([type="radio"]) { flex: 1; min-width: 0; padding: 10px 12px; font-size: 15px; }

@media (max-width: 520px) {
  .room-card { flex-wrap: wrap; }
  .room-info { flex: 1 1 calc(100% - 42px); }
  .room-actions { flex-basis: 100%; justify-content: flex-end; }
}

/* ───── Fil de discussion ───── */

/* Les boutons restent en bas à droite ; le fil se déploie au-dessus. */
.dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Son bloqué par le navigateur : petit bouton à gauche de « Discussion ». */
.gate {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--honey);
  color: #16181d;
  box-shadow: 0 6px 20px rgba(22, 24, 29, 0.25);
  cursor: pointer;
  animation: nudge 1.6s ease-in-out infinite;
}
.gate svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes nudge { 50% { box-shadow: 0 0 0 6px rgba(255, 194, 26, 0.35), 0 6px 20px rgba(22, 24, 29, 0.25); } }

.chat-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font: 700 14px var(--display);
  box-shadow: 0 6px 20px rgba(22, 24, 29, 0.25);
  cursor: pointer;
}
.chat-toggle::before { content: ""; width: 10px; height: 11px; background: var(--honey); clip-path: var(--hexagon); }
.chat-toggle[aria-expanded="true"] { background: var(--ink-hover); }
.unread {
  min-width: 20px;
  padding: 1px 6px;
  color: #fff;
  background: var(--mute);
  border-radius: 999px;
  font: 600 12px var(--body);
  text-align: center;
}

.chat {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 40px));
  height: min(540px, calc(100vh - 150px));
  box-shadow: 0 12px 40px rgba(22, 24, 29, 0.18);
}
.chat .close { margin-left: auto; padding: 4px 10px; font-size: 13px; }
.chat-list {
  flex: 1;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  margin: 0 0 12px;
  padding: 0 4px 0 0;
  overflow-y: auto;
  list-style: none;
}
.chat-list:empty::before {
  content: attr(data-empty);
  padding: 28px 12px;
  text-align: center;
  color: var(--soft);
  border: 1.5px dashed var(--line);
  border-radius: 10px;
}
.msg-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.msg-head b { font-weight: 600; }
.msg-head time { color: var(--soft); font-size: 12px; }
.msg.mine .msg-head b { color: var(--live); }
.msg p { margin: 2px 0 0; overflow-wrap: anywhere; }
.badge { padding: 0 6px; background: var(--honey); color: #16181d; border-radius: 4px; font-size: 11px; font-weight: 600; }

@media (max-width: 520px) {
  .chat { right: 10px; left: 10px; width: auto; bottom: 76px; height: calc(100vh - 140px); }
  .dock { right: 14px; bottom: 14px; }
}

/* ───── Retours ───── */

.toasts { position: fixed; left: 20px; bottom: 20px; z-index: 20; display: grid; gap: 8px; }
.toast { max-width: 320px; padding: 12px 16px; background: var(--ink); border-radius: 8px; color: var(--on-ink); font-size: 14px; }
/* ───── Bouton de thème (présent sur toutes les vues) ───── */

.theme-toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

/* Accueil : le bouton flotte en haut à droite, au-dessus du panneau. */
.theme-toggle.floating { position: absolute; top: 16px; right: 16px; z-index: 30; background: var(--card); border-color: var(--ink); }

:root[data-theme="dark"] .join {
  background-color: #0a0a0a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='55.43' height='96'%3E%3Cpath d='M0 16L27.71 0L55.43 16M0 16V48M55.43 16V48M0 48L27.71 64L55.43 48M27.71 64V96' fill='none' stroke='%2333290a' stroke-width='1.5'/%3E%3C/svg%3E");
}

/* ───── Volume individuel sur chaque vignette ───── */

.tile-vol {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  background: rgba(22, 24, 29, 0.8);
  border-radius: 8px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}
.tile:hover .tile-vol, .tile-vol:focus-within { opacity: 1; }
@media (hover: none) { .tile-vol { opacity: 1; } }
.tile:fullscreen .tile-vol, .tile.expanded .tile-vol { opacity: 1; }
.vol-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
}
.vol-btn:hover { background: rgba(255, 255, 255, 0.15); }
.vol-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile-vol .cross { display: none; }
.tile-vol.off .cross { display: block; }
.tile-vol.off .waves { display: none; }
.tile-vol input[type="range"] { width: 76px; accent-color: #ffc21a; }

.device-wrap { min-width: 0; }
.device {
  max-width: 190px;
  padding: 9px 10px;
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: 500 13px var(--body, inherit);
  text-overflow: ellipsis;
  cursor: pointer;
}
.device:hover, .device:focus-visible { border-color: var(--ink); }

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

/* ───── Réactions emoji ───── */

.react-wrap { position: relative; }
.react-toggle, .effects-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: 0 4px 14px rgba(22, 24, 29, 0.12);
  cursor: pointer;
  font-size: 20px;
}
.react-toggle:hover, .effects-toggle:hover,
.react-toggle[aria-expanded="true"], .effects-toggle[aria-expanded="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}
.effects-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.react-bar {
  position: absolute;
  bottom: 56px;
  right: 0;
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(22, 24, 29, 0.18);
  z-index: 20;
}
.react-bar button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}
.react-bar button:hover {
  background: var(--paper);
  transform: scale(1.18);
}
.react-bar button:active { transform: scale(0.95); }

/* Emoji qui flotte au-dessus de la salle */
.flying-emoji {
  position: fixed;
  z-index: 50;
  font-size: 42px;
  pointer-events: none;
  animation: fly-up 2.2s ease-out forwards;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}
@keyframes fly-up {
  0%   { opacity: 0; transform: translate(-50%, 20px) scale(0.4); }
  12%  { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -120px) scale(1); }
}

/* ───── Effets vidéo (flou / fonds) ───── */

.effects-panel {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 16;
  width: min(320px, calc(100vw - 40px));
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(22, 24, 29, 0.18);
}
.effects-panel h3 {
  margin: 0 0 6px;
  font: 700 15px var(--display);
  letter-spacing: -0.03em;
}
.effects-hint {
  margin: 0 0 14px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.4;
}
.effects-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.effect-opt {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 8px 4px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.effect-opt:hover { border-color: var(--ink); }
.effect-opt[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}
.effect-preview {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  background: #1c2024;
}
.effect-preview.none { background: linear-gradient(135deg, #2a2f36, #1c2024); }
.effect-preview.blur {
  background: linear-gradient(135deg, #4a5560, #2a2f36);
  filter: blur(2px);
}
.effect-preview.bg1 { background: linear-gradient(145deg, #ffc21a 0%, #e8a200 100%); }
.effect-preview.bg2 { background: linear-gradient(145deg, #0f172a 0%, #1e293b 60%, #334155 100%); }
.effect-preview.bg3 { background: linear-gradient(145deg, #14532d 0%, #166534 50%, #22c55e 100%); }
.effect-preview.bg4 { background: linear-gradient(145deg, #0c4a6e 0%, #0284c7 50%, #7dd3fc 100%); }


.effect-preview.custom {
  background: var(--empty);
  background-size: cover;
  background-position: center;
  position: relative;
}
.effect-preview.custom::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 18px var(--display);
  color: var(--soft);
}
.effect-preview.custom.has-image::after { display: none; }
.effect-opt[data-effect="custom"] {
  grid-column: 1 / -1;
}
.close-effects { width: 100%; margin-top: 4px; }

/* Application sur la tuile locale */
.tile.local-effect-blur video {
  filter: blur(10px) brightness(0.95);
}
.tile.local-effect-bg1,
.tile.local-effect-bg2,
.tile.local-effect-bg3,
.tile.local-effect-bg4 {
  background-size: cover;
  background-position: center;
}
.tile.local-effect-bg1 { background-image: linear-gradient(145deg, #ffc21a 0%, #e8a200 100%); }
.tile.local-effect-bg2 { background-image: linear-gradient(145deg, #0f172a 0%, #1e293b 60%, #334155 100%); }
.tile.local-effect-bg3 { background-image: linear-gradient(145deg, #14532d 0%, #166534 50%, #22c55e 100%); }
.tile.local-effect-bg4 { background-image: linear-gradient(145deg, #0c4a6e 0%, #0284c7 50%, #7dd3fc 100%); }

/* Quand un fond est actif, on garde la vidéo un peu transparente pour voir le fond derrière */
.tile.local-effect-bg1 video,
.tile.local-effect-bg2 video,
.tile.local-effect-bg3 video,
.tile.local-effect-bg4 video {
  opacity: 0.82;
  mix-blend-mode: soft-light;
}

@media (max-width: 520px) {
  .react-bar {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
  .effects-panel {
    right: 10px;
    left: 10px;
    width: auto;
  }
}

/* ───── Soundboard ───── */

.sfx-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: 0 4px 14px rgba(22, 24, 29, 0.12);
  cursor: pointer;
}
.sfx-toggle:hover,
.sfx-toggle[aria-expanded="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}
.sfx-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sfx-panel {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 16;
  width: min(340px, calc(100vw - 40px));
  max-height: min(480px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(22, 24, 29, 0.18);
}
.sfx-panel h3 {
  margin: 0 0 6px;
  font: 700 15px var(--display);
  letter-spacing: -0.03em;
}
.sfx-hint {
  margin: 0 0 10px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.4;
}
.sfx-broadcast {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sfx-broadcast input {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}

.sfx-list {
  flex: 1;
  min-height: 80px;
  max-height: 260px;
  overflow-y: auto;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  align-content: start;
}
.sfx-list:empty::before {
  content: attr(data-empty);
  display: block;
  padding: 28px 12px;
  text-align: center;
  color: var(--soft);
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.sfx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.sfx-item .sfx-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}
.sfx-item .sfx-play,
.sfx-item .sfx-del {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-size: 14px;
}
.sfx-item .sfx-play:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.sfx-item .sfx-del:hover {
  border-color: var(--mute);
  color: var(--mute);
}
.sfx-item.playing .sfx-play {
  background: var(--honey);
  border-color: var(--honey);
  color: #16181d;
}

.sfx-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.sfx-actions .go { flex: 1; }

@media (max-width: 520px) {
  .sfx-panel {
    right: 10px;
    left: 10px;
    width: auto;
  }
}

.sfx-file-input {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

/* ───── Outils salle : main, timer, sondage, rec ───── */

.tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(22, 24, 29, 0.12);
  cursor: pointer;
  font: 600 13px var(--body);
  position: relative;
}
.tool-btn:hover,
.tool-btn[aria-expanded="true"],
.tool-btn[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}
.tool-btn[aria-pressed="true"] {
  background: var(--honey);
  border-color: var(--honey);
  color: #16181d;
}
.tool-badge {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--mute);
  color: #fff;
  font: 600 11px var(--body);
  text-align: center;
}
.tool-btn[aria-pressed="true"] .tool-badge {
  background: #16181d;
  color: var(--honey);
}

.tool-panel {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 16;
  width: min(360px, calc(100vw - 40px));
  max-height: min(520px, calc(100vh - 140px));
  overflow-y: auto;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(22, 24, 29, 0.18);
}
.tool-panel h3 {
  margin: 0 0 8px;
  font: 700 15px var(--display);
  letter-spacing: -0.03em;
}

.hand-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.hand-list:empty::before {
  content: attr(data-empty);
  display: block;
  padding: 20px;
  text-align: center;
  color: var(--soft);
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  font-size: 13px;
}
.hand-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
}
.hand-item .hand-pos {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--honey);
  color: #16181d;
  font-size: 12px;
}
.hand-item button {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.timer-display {
  font: 700 42px/1.1 var(--display);
  text-align: center;
  letter-spacing: -0.04em;
  margin: 8px 0 14px;
  font-variant-numeric: tabular-nums;
}
.timer-display.warn { color: var(--mute); }
.timer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.small-preset {
  padding: 6px 10px !important;
  font-size: 12px !important;
}
.timer-custom {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}
.timer-custom input {
  width: 64px;
  margin-left: 6px;
  padding: 6px 8px;
}
.timer-banner {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font: 700 18px var(--display);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 24px rgba(22, 24, 29, 0.25);
  pointer-events: none;
}
.timer-banner.warn {
  background: var(--mute);
  color: #fff;
  animation: nudge 1s ease-in-out infinite;
}

.poll-q {
  margin: 0 0 12px;
  font: 600 15px var(--body);
}
.poll-choices {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.poll-choice {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}
.poll-choice:hover { border-color: var(--ink); }
.poll-choice[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.poll-results-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.poll-bar-row {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.poll-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--empty);
  overflow: hidden;
}
.poll-bar-fill {
  height: 100%;
  background: var(--honey);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.poll-create textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--field);
  font: inherit;
  resize: vertical;
}

.rec-status {
  margin: 8px 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--soft);
}
.rec-status.live {
  color: var(--mute);
}
.rec-status.live::before {
  content: "● ";
}

.tile.hand-up::before {
  content: "✋";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  pointer-events: none;
}

@media (max-width: 700px) {
  .tool-label { display: none; }
  .tool-btn { width: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  .tool-panel { right: 10px; left: 10px; width: auto; }
}

/* ───── Barre d’outils hex : − fixe, outils qui roulent vers la gauche ───── */

.tools-hive {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  pointer-events: none;
}
.tools-hive > * { pointer-events: auto; }

.tools-gate.gate {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  transform: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.ruche-menu {
  --s: 48px;
  --h: calc(var(--s) * 0.8660254);
  --gap: 7px;
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: var(--gap);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.ruche-cell {
  position: relative;
  flex: 0 0 var(--s);
  width: var(--s);
  height: var(--h);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #16181d;
  transform-origin: center center;
}
.ruche-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #e8a317;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  z-index: 0;
}
.ruche-cell:hover {
  z-index: 2;
  filter: brightness(1.08);
}
.ruche-cell:hover::before { background: #f5b520; }

.ruche-cell[aria-expanded="true"]::before,
.ruche-cell[aria-pressed="true"]::before {
  background: #16181d;
}
.ruche-cell[aria-expanded="true"],
.ruche-cell[aria-pressed="true"] {
  color: #ffc21a;
}

/* FAB (−/+) : toujours visible, jamais déplacé */
.ruche-fab,
.ruche-fab[aria-expanded="true"],
.ruche-fab[aria-pressed="true"] {
  color: #16181d !important;
  z-index: 3;
  flex: 0 0 var(--s);
  width: var(--s);
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  overflow: visible !important;
}
.ruche-fab::before,
.ruche-fab[aria-expanded="true"]::before,
.ruche-fab[aria-pressed="true"]::before {
  background: #e8a317 !important;
}
.ruche-fab:hover {
  filter: brightness(1.08);
}

.ruche-ico {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

.ruche-plus { position: relative; width: 100%; height: 100%; }
.ruche-plus::before,
.ruche-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #16181d;
  border-radius: 1px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.ruche-plus::before {
  width: 14px;
  height: 2.5px;
  transform: translate(-50%, -50%);
}
.ruche-plus::after {
  width: 2.5px;
  height: 14px;
  transform: translate(-50%, -50%);
}
.tools-hive[data-open="true"] .ruche-plus::after {
  opacity: 0;
  transform: translate(-50%, -50%) scaleY(0);
}

.ruche-cell .tool-badge {
  position: absolute;
  top: 0;
  right: 4px;
  z-index: 2;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #d8432f;
  color: #fff;
  font: 700 9px var(--body);
  line-height: 15px;
  text-align: center;
}

.ruche-cell[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 5px 9px;
  background: #16181d;
  color: #fff;
  border-radius: 8px;
  font: 600 12px var(--body);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 0.15s;
}
.ruche-cell[data-tip]:hover::after { opacity: 1; }
.ruche-fab::after { content: none !important; }

/* États + animations ouverture / fermeture (roulement) */

.ruche-cell:not(.ruche-fab) {
  transition:
    width 0.32s ease,
    flex-basis 0.32s ease,
    opacity 0.28s ease,
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.15s;
}

/* Fermé : repliés vers le + avec rotation */
.tools-hive[data-open="false"] .ruche-cell:not(.ruche-fab) {
  width: 0;
  flex-basis: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translateX(40px) rotate(360deg) scale(0.3);
}
.tools-hive[data-open="false"] .ruche-menu {
  gap: 0;
  transition: gap 0.3s ease;
}

/* Ouvert */
.tools-hive[data-open="true"] .ruche-cell:not(.ruche-fab) {
  opacity: 1;
  pointer-events: auto;
  overflow: visible;
  transform: translateX(0) rotate(0deg) scale(1);
}
.tools-hive[data-open="true"] .ruche-menu {
  gap: var(--gap);
  transition: gap 0.3s ease;
}

/* Cascade à l’OUVERTURE : du + (droite) vers la gauche */
.tools-hive[data-open="true"] .ruche-cell:not(.ruche-fab):nth-child(9) { transition-delay: 0.02s; }
.tools-hive[data-open="true"] .ruche-cell:not(.ruche-fab):nth-child(8) { transition-delay: 0.05s; }
.tools-hive[data-open="true"] .ruche-cell:not(.ruche-fab):nth-child(7) { transition-delay: 0.08s; }
.tools-hive[data-open="true"] .ruche-cell:not(.ruche-fab):nth-child(6) { transition-delay: 0.11s; }
.tools-hive[data-open="true"] .ruche-cell:not(.ruche-fab):nth-child(5) { transition-delay: 0.14s; }
.tools-hive[data-open="true"] .ruche-cell:not(.ruche-fab):nth-child(4) { transition-delay: 0.17s; }
.tools-hive[data-open="true"] .ruche-cell:not(.ruche-fab):nth-child(3) { transition-delay: 0.20s; }
.tools-hive[data-open="true"] .ruche-cell:not(.ruche-fab):nth-child(2) { transition-delay: 0.23s; }
.tools-hive[data-open="true"] .ruche-cell:not(.ruche-fab):nth-child(1) { transition-delay: 0.26s; }

/* Cascade à la FERMETURE : les plus à gauche partent en premier */
.tools-hive[data-open="false"] .ruche-cell:not(.ruche-fab):nth-child(1) { transition-delay: 0.00s; }
.tools-hive[data-open="false"] .ruche-cell:not(.ruche-fab):nth-child(2) { transition-delay: 0.03s; }
.tools-hive[data-open="false"] .ruche-cell:not(.ruche-fab):nth-child(3) { transition-delay: 0.06s; }
.tools-hive[data-open="false"] .ruche-cell:not(.ruche-fab):nth-child(4) { transition-delay: 0.09s; }
.tools-hive[data-open="false"] .ruche-cell:not(.ruche-fab):nth-child(5) { transition-delay: 0.12s; }
.tools-hive[data-open="false"] .ruche-cell:not(.ruche-fab):nth-child(6) { transition-delay: 0.15s; }
.tools-hive[data-open="false"] .ruche-cell:not(.ruche-fab):nth-child(7) { transition-delay: 0.18s; }
.tools-hive[data-open="false"] .ruche-cell:not(.ruche-fab):nth-child(8) { transition-delay: 0.21s; }
.tools-hive[data-open="false"] .ruche-cell:not(.ruche-fab):nth-child(9) { transition-delay: 0.24s; }

/* Panneaux */
.side-panel,
.effects-panel,
.sfx-panel,
.tool-panel,
.chat {
  position: fixed;
  right: 16px;
  bottom: 90px;
  top: auto;
  left: auto;
  transform: none;
  z-index: 19;
  width: min(340px, calc(100vw - 32px));
  max-height: min(55vh, 500px);
  overflow-y: auto;
  margin: 0;
}
.react-bar.side-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(22, 24, 29, 0.16);
  width: auto;
  max-width: min(280px, calc(100vw - 32px));
  max-height: none;
}
.react-bar.side-panel button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 22px;
  cursor: pointer;
}
.chat {
  height: min(460px, 50vh);
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .tools-hive { right: 10px; bottom: 10px; }
  .ruche-menu { --s: 42px; --gap: 5px; }
  .ruche-cell[data-tip]::after { display: none; }
  .side-panel, .effects-panel, .sfx-panel, .tool-panel, .chat {
    right: 10px; left: 10px; width: auto; bottom: 80px;
  }
}

/* ───── Lobby en alvéoles ───── */

.lobby-pane { max-width: 860px; margin: 0 auto; }
.lobby-hint { margin: -6px 0 16px; color: var(--soft); font-size: 14px; }
.lobby-hive {
  --w: 132px;
  --h: calc(var(--w) * 1.1547);
  --g: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--g);
  padding: 12px 4px 24px;
  min-height: 140px;
}
.lobby-hive:empty::before {
  content: attr(data-empty);
  display: block;
  width: 100%;
  padding: 36px 16px;
  text-align: center;
  color: var(--soft);
  border: 1.5px dashed var(--line);
  border-radius: 12px;
}
.hive-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: var(--w);
  height: var(--h);
  padding: 16px 14px 18px;
  border: 0;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s, transform 0.15s, filter 0.15s;
  clip-path: var(--hexagon);
  filter: drop-shadow(0 2px 4px rgba(22, 24, 29, 0.08));
  /* Mode clair par défaut : fond jaune, texte gris */
  background: var(--honey);
  color: #5d6670;
}
.hive-cell .hive-name {
  font: 700 14px/1.25 var(--display);
  letter-spacing: -0.03em;
  max-width: 11ch;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-word;
  color: inherit;
}
.hive-cell .hive-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  padding: 2px 7px;
  border-radius: 999px;
  font: 700 11px var(--body);
  color: inherit;
  background: rgba(22, 24, 29, 0.12);
}
/* Clair : hover → fond gris clair, texte plus sombre */
.hive-cell:hover,
.hive-cell:focus-visible {
  outline: 0;
  transform: scale(1.05);
  background: #d5d9dc;
  color: #16181d;
  filter: drop-shadow(0 6px 12px rgba(22, 24, 29, 0.14));
}
.hive-cell:hover .hive-count,
.hive-cell:focus-visible .hive-count {
  background: rgba(22, 24, 29, 0.16);
}

/* Variante « mine » en clair : un peu plus marquée */
.hive-cell.mine {
  box-shadow: inset 0 0 0 3px #16181d;
}

/* ── Mode sombre ──
   Fond gris-noir, texte + chiffre jaunes.
   Hover : inversion (fond jaune, texte sombre). */
:root[data-theme="dark"] .hive-cell {
  background: #1c1c18;
  color: var(--honey);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}
:root[data-theme="dark"] .hive-cell .hive-name {
  color: var(--honey);
  font-weight: 800;
}
:root[data-theme="dark"] .hive-cell .hive-count {
  background: rgba(255, 194, 26, 0.18);
  color: var(--honey);
}
:root[data-theme="dark"] .hive-cell:hover,
:root[data-theme="dark"] .hive-cell:focus-visible {
  background: var(--honey);
  color: #16181d;
  filter: drop-shadow(0 6px 14px rgba(255, 194, 26, 0.35));
}
:root[data-theme="dark"] .hive-cell:hover .hive-name,
:root[data-theme="dark"] .hive-cell:focus-visible .hive-name {
  color: #16181d;
}
:root[data-theme="dark"] .hive-cell:hover .hive-count,
:root[data-theme="dark"] .hive-cell:focus-visible .hive-count {
  background: rgba(22, 24, 29, 0.2);
  color: #16181d;
}
:root[data-theme="dark"] .hive-cell.mine {
  box-shadow: inset 0 0 0 3px var(--honey);
}
:root[data-theme="dark"] .hive-cell.mine:hover {
  box-shadow: inset 0 0 0 3px #16181d;
}

/* ───── Main levée : contour + paralélogramme d’ordre (haut droite) ───── */

.tile.hand-up {
  outline: 3px solid var(--honey);
  outline-offset: -3px;
  box-shadow: 0 0 0 1px rgba(255, 194, 26, 0.35);
}
.tile.hand-up::before { content: none; }

.tile .hand-order {
  position: absolute;
  top: 10px;
  right: -2px;
  z-index: 4;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  padding: 0 10px 0 12px;
  background: var(--honey);
  color: #16181d;
  font: 800 13px var(--display);
  /* paralélogramme orienté vers l’intérieur (gauche) */
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
  box-shadow: -2px 2px 0 rgba(22, 24, 29, 0.25);
  pointer-events: none;
}
.tile.hand-up::after {
  /* petit bec / excroissance vers l’intérieur de la vidéo */
  content: "";
  position: absolute;
  top: 14px;
  right: 26px;
  z-index: 3;
  width: 14px;
  height: 10px;
  background: var(--honey);
  transform: skewX(28deg);
  pointer-events: none;
}

/* Format vidéo 16:9 plus net */
.tile {
  aspect-ratio: 16 / 9;
}
.tile video {
  object-fit: cover;
  background: #0e1114;
}
.tiles.big .tile {
  aspect-ratio: 16 / 9;
  max-height: min(52vh, 480px);
}

/* Texte sombre sur accents miel */
.badge,
.hive-tool[aria-pressed="true"],
.timer-banner.warn {
  color: #16181d !important;
}
:root[data-theme="dark"] .go {
  background: var(--honey);
  color: #16181d;
}
:root[data-theme="dark"] .go:hover {
  background: #ffd84d;
  color: #16181d;
}
:root[data-theme="dark"] .go.small {
  background: var(--honey);
  color: #16181d;
}
:root[data-theme="dark"] .tog[aria-pressed="true"] {
  background: var(--honey);
  border-color: var(--honey);
  color: #16181d;
}
:root[data-theme="dark"] .seg input:checked + span {
  background: var(--honey);
  color: #16181d;
}

/* ───── Documents partagés ───── */
.docs-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.docs-list:empty::before {
  content: attr(data-empty);
  display: block;
  padding: 20px;
  text-align: center;
  color: var(--soft);
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  font-size: 13px;
}
.docs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.docs-item .docs-meta {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.docs-item .docs-meta b {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docs-item .docs-meta small {
  color: var(--soft);
  font-size: 12px;
}
.docs-item a,
.docs-item button {
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: inherit;
  font: 600 12px var(--body);
  text-decoration: none;
  cursor: pointer;
}
.docs-item a:hover,
.docs-item button:hover {
  border-color: var(--ink);
}
.docs-item .docs-del {
  color: var(--mute);
}
