/* =====================================================================
   Taverne — thème sombre moderne (violet → corail, surfaces en verre)
   ===================================================================== */
@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage-700.woff') format('woff'); font-weight: 600 800; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage-400.woff') format('woff'); font-weight: 300 500; font-display: swap; }

:root {
  --bg: #09090e;
  --bg-2: #0e0e15;
  --well: #0b0b12;
  --panel: #13131c;
  --panel-2: #1a1a25;
  --panel-3: #242432;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --ink: #09090e;
  --text: #f3f3f8;
  --muted: #a3a3b8;
  --faint: #6c6c82;

  --violet: #7c5cff;
  --pink: #ff4d8d;
  --mustard: #ffbe3d;
  --tomato: #ff5c6c;
  --sage: #34d399;
  --teal: #2dd4bf;
  --sky: #38bdf8;
  --plum: #c084fc;
  --rose: #f472b6;

  --accent: var(--violet);
  --accent-2: #b3a4ff;
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, #7c5cff 0%, #c44dff 55%, #ff4d8d 100%);
  --good: var(--sage);
  --bad: var(--tomato);
  --info: var(--sky);

  --radius: 18px;
  --radius-sm: 12px;
  --glass: rgba(20, 20, 30, .72);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .3);
  --glow: 0 8px 28px rgba(124, 92, 255, .35);
  --hard: var(--shadow-sm);
  --hard-sm: 0 2px 8px rgba(0, 0, 0, .25);
  --hard-lg: var(--shadow);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --display: 'Bricolage', ui-rounded, system-ui, -apple-system, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow: hidden; -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(1100px 600px at 0% -10%, rgba(124, 92, 255, .20), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(255, 77, 141, .13), transparent 60%),
    var(--bg);
  overscroll-behavior: none;
}
h1, h2, h3, h4, .display { font-family: var(--display); letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small-txt { font-size: 13px; }
.hand { font: inherit; }
a { color: var(--accent-2); }
.ico { flex: none; display: block; }
::selection { background: var(--violet); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .06); color: var(--text);
  padding: 9px 16px; border-radius: 12px; font-weight: 650; font-size: 15px;
  transition: transform .15s var(--ease), background .15s, box-shadow .2s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--tomato); border-color: transparent; color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
.btn.good { background: var(--sage); border-color: transparent; color: #04241a; }
.btn.good:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 13.5px; border-radius: 10px; }
.btn.big { padding: 13px 22px; min-height: 52px; font-size: 16.5px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0;
  background: transparent; color: var(--muted); flex: none; transition: background .15s, color .15s, transform .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
input, select, textarea {
  background: var(--well); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 13px; outline: none; width: 100%;
  min-width: 0; transition: border-color .15s, box-shadow .15s; font-size: 16px;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 92, 255, .25); }
input[type=range] { padding: 0; border: 0; background: transparent; box-shadow: none !important; accent-color: var(--violet); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--violet); flex: none; }
label { display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.form-error { color: #ff8a96; min-height: 1.2em; margin: 0; font-size: 14px; font-weight: 600; }
.pill { font-size: 11.5px; background: rgba(255, 255, 255, .08); color: var(--text); padding: 1px 8px; border-radius: 99px; font-weight: 700; }
.pill:empty { display: none; }
.badge { background: var(--pink); color: #fff; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 0 6px; min-width: 19px; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }

.tabs { display: flex; gap: 4px; background: rgba(255, 255, 255, .05); padding: 4px; border-radius: 14px; align-items: center; border: 1px solid var(--line); }
.tab { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; color: var(--muted); font-weight: 650; display: inline-flex; gap: 6px; justify-content: center; align-items: center; transition: .15s; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel-3); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.tabs.small .tab { padding: 7px 8px; font-size: 13.5px; }

.role-badge { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: rgba(56, 189, 248, .18); color: var(--sky); vertical-align: 2px; }
.role-badge.admin { background: rgba(255, 190, 61, .18); color: var(--mustard); }

/* ---------- Connexion ---------- */
.view { height: 100%; height: 100dvh; }
#auth-view {
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 48px; overflow: auto;
  padding: max(32px, var(--safe-t)) max(clamp(20px, 5vw, 80px), var(--safe-r)) max(32px, var(--safe-b)) max(clamp(20px, 5vw, 80px), var(--safe-l));
}
.auth-poster { position: relative; }
.auth-poster h1 { font-size: clamp(38px, 5.6vw, 74px); line-height: 1; margin: 22px 0 14px; font-weight: 800; letter-spacing: -.04em; }
.auth-poster h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-poster .hand { font-size: 18px; color: var(--muted); display: block; }
.stickers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; max-width: 560px; }
.sticker { padding: 8px 14px; border-radius: 99px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 600; backdrop-filter: blur(8px); }
.auth-card {
  width: min(430px, 100%); justify-self: center; background: var(--glass); border: 1px solid var(--line); border-radius: 24px; padding: 26px;
  box-shadow: var(--shadow); display: grid; gap: 18px; position: relative; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.auth-card form { display: grid; gap: 14px; }
.auth-tag { margin: -6px 0 0; color: var(--muted); }
.auth-foot { margin: 0; color: var(--faint); font-size: 13px; text-align: center; }
.pending-box { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 8px 0; }
.pending-box .ill { font-size: 54px; }
.pending-box h3 { margin: 0; font-size: 24px; }
.pending-box p { margin: 0; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: -.03em; font-family: var(--display); }
.brand.big { font-size: 26px; }
.brand-mark { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 30%; background: var(--grad); font-size: .8em; box-shadow: var(--glow); }

/* ---------- Layout principal ---------- */
#main-view { display: flex; }
#sidebar { width: 296px; flex: none; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding-top: var(--safe-t); padding-left: var(--safe-l); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 6px; }
.me-card { margin: 10px 12px; padding: 10px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.me-info { display: grid; min-width: 0; flex: 1; }
.me-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.me-info small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-admin { position: relative; color: var(--mustard); }
.btn-admin .badge { position: absolute; top: -4px; right: -4px; }
.side-section { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1; }
.side-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); display: flex; gap: 8px; align-items: center; padding: 0 4px; }
.side-foot { padding: 12px 12px max(12px, var(--safe-b)); }
.inline-form { display: flex; gap: 6px; }
.inline-form input { padding: 9px 12px; }
.inline-form .btn { padding: 6px 10px; min-height: 42px; }
.friends-list { overflow: auto; display: grid; gap: 2px; align-content: start; margin: 0 -4px; padding: 0 4px; }
.friend { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; transition: background .12s; }
.friend:hover { background: rgba(255, 255, 255, .04); }
.friend .f-info { flex: 1; min-width: 0; display: grid; }
.friend .f-info strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend .f-info small { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend.online .f-info small { color: var(--sage); }
.friend.offline { opacity: .55; }
.friend .f-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.friend:hover .f-actions, .friend:focus-within .f-actions { opacity: 1; }
@media (hover: none) { .friend .f-actions { opacity: 1; } }
.req-card { background: rgba(124, 92, 255, .08); border: 1px solid rgba(124, 92, 255, .25); border-radius: 14px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.req-card .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--faint); font-size: 13.5px; padding: 8px 4px; }

.avatar { --c: var(--violet); width: 38px; height: 38px; border-radius: 50%; background: var(--c); display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; position: relative; font-size: 16px; user-select: none; font-family: var(--display); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 84px; height: 84px; font-size: 38px; }
.avatar.xl { width: 96px; height: 96px; font-size: 44px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.avatar.emoji { background: color-mix(in srgb, var(--c) 35%, var(--panel-2)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 60%, transparent); }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg-2); background: var(--faint); }
.avatar .dot.on { background: var(--sage); }

.panel { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; min-height: 64px; border-bottom: 1px solid var(--line);
  padding: max(12px, var(--safe-t)) max(20px, var(--safe-r)) 12px 20px;
  background: rgba(9, 9, 14, .7); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.topbar h1 { margin: 0; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }

/* ---------- Lobby ---------- */
.lobby-body { padding: max(28px, var(--safe-t)) max(clamp(16px, 3vw, 40px), var(--safe-r)) max(28px, var(--safe-b)) clamp(16px, 3vw, 40px); overflow: auto; display: grid; gap: 22px; align-content: start; -webkit-overflow-scrolling: touch; }
#lobby > .topbar { display: none; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lobby-hero {
  display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; padding: 26px; border-radius: 24px;
  background: radial-gradient(600px 240px at 0% 0%, rgba(124, 92, 255, .28), transparent 70%), radial-gradient(500px 220px at 100% 100%, rgba(255, 77, 141, .18), transparent 70%), var(--panel);
  border: 1px solid var(--line);
}
.lobby-hero h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); font-weight: 800; line-height: 1.05; letter-spacing: -.035em; }
.lobby-hero p { margin: 8px 0 0; color: var(--muted); font-size: 15.5px; }
.lobby-hero .hand { color: var(--accent-2); font-weight: 600; }
.join-code { display: flex; gap: 8px; max-width: 420px; flex: 1; min-width: 240px; }
.join-code input { text-transform: uppercase; letter-spacing: .14em; font-weight: 800; }
.join-code input::placeholder { letter-spacing: normal; text-transform: none; font-weight: 500; }
.section-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); display: flex; align-items: center; gap: 10px; margin: 4px 0 -8px; }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.room-card {
  --c: var(--violet); text-align: left; display: grid; gap: 14px; padding: 18px; position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; color: var(--text);
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s; animation: pop .4s var(--ease) both;
}
.room-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(260px 140px at 100% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%); pointer-events: none; }
.room-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 50%, transparent); box-shadow: var(--shadow-sm); }
.room-card h3 { margin: 0; font-size: 19px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.room-card .meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; flex-wrap: wrap; position: relative; }
.room-card .stack { position: relative; }
.stack { display: flex; }
.stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--panel); }
.stack .avatar:first-child { margin-left: 0; }
.live { color: var(--sage); background: rgba(52, 211, 153, .12); border-radius: 99px; padding: 2px 10px 2px 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.6s infinite; }
.game-tag { background: rgba(255, 255, 255, .07); color: var(--text); padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-empty { text-align: center; padding: 44px 20px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 24px; display: grid; justify-items: center; gap: 6px; background: rgba(255, 255, 255, .02); }
.lobby-empty .ill { font-size: 52px; }
.lobby-empty h3 { color: var(--text); font-size: 22px; margin: 4px 0 0; }
.lobby-empty p { margin: 0 0 12px; max-width: 420px; }

/* Bandeau notifications */
.notif-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, rgba(124, 92, 255, .18), rgba(255, 77, 141, .12)); border: 1px solid rgba(124, 92, 255, .35); }
.notif-banner .n-ico { font-size: 26px; }
.notif-banner .grow { display: grid; min-width: 0; }
.notif-banner strong { font-size: 14.5px; }
.notif-banner small { color: var(--muted); font-size: 12.5px; }
.notif-banner .n-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Salon ---------- */
.room-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.code-chip { border: 1px solid rgba(124, 92, 255, .4); background: rgba(124, 92, 255, .12); color: var(--accent-2); font-weight: 800; letter-spacing: .12em; padding: 4px 10px; border-radius: 10px; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; transition: .15s; flex: none; }
.code-chip:hover { background: rgba(124, 92, 255, .25); }
.room-body { flex: 1; display: flex; min-height: 0; }
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 16px max(16px, var(--safe-r)) 16px max(16px, var(--safe-l)); gap: 12px; min-height: 0; overflow: hidden; }
.stage-tabs { display: flex; gap: 6px; }
.stage-tabs .tab { flex: none; padding: 7px 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.stage-tabs .tab.active { background: var(--panel-3); border-color: var(--line-2); }
#video-grid { flex: 1; min-height: 0; display: grid; gap: 10px; align-content: center; justify-content: center; }
.tile {
  --c: var(--violet); position: relative; border-radius: 20px; overflow: hidden; display: grid; place-items: center; min-height: 0;
  aspect-ratio: 16 / 10; border: 1px solid var(--line); transition: box-shadow .2s, opacity .3s;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c) 28%, var(--panel)) 0, var(--panel) 70%);
  animation: pop .35s var(--ease) both;
}
.tile.speaking { box-shadow: 0 0 0 2px var(--sage), 0 0 24px rgba(52, 211, 153, .35); }
.tile.speaking .avatar { animation: ring 1.2s ease-out infinite; }
.tile.away { opacity: .55; }
.tile.away .tile-avatar { filter: grayscale(.8); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile video.contain, .tile.screen video { object-fit: contain; }
.tile video.mirror { transform: scaleX(-1); }
.tile .name {
  position: absolute; left: 10px; bottom: 10px; background: rgba(9, 9, 14, .65); color: #fff; padding: 3px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 650; display: flex; gap: 5px; align-items: center; max-width: calc(100% - 20px);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tile .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .name .ico { color: var(--tomato); }
.tile .tile-btn { position: absolute; right: 8px; top: 8px; opacity: 0; background: rgba(9, 9, 14, .6); color: #fff; width: 34px; height: 34px; }
.tile:hover .tile-btn { opacity: 1; }
.tile .conn-state { position: absolute; top: 8px; left: 8px; font-size: 11px; background: rgba(9, 9, 14, .7); padding: 3px 9px; border-radius: 99px; color: var(--mustard); font-weight: 650; }
.tile.screen { aspect-ratio: 16 / 9; }
#video-grid.focus { grid-template-columns: 1fr !important; }
#video-grid.focus .tile:not(.focused) { display: none; }

.stage.has-activity #video-grid { flex: none; display: flex; overflow-x: auto; justify-content: flex-start; gap: 8px; padding-bottom: 2px; scrollbar-width: none; }
.stage.has-activity .tile { width: 124px; flex: none; aspect-ratio: 4 / 3; border-radius: 14px; }
.stage.has-activity .tile .avatar.xl { width: 46px; height: 46px; font-size: 20px; box-shadow: none; }
.stage.has-activity .tile .name { font-size: 10.5px; left: 5px; bottom: 5px; padding: 1px 7px; }
.stage.has-activity .tile.screen { width: 200px; }
.stage.has-activity.cams-hidden #video-grid { display: none; }

/* Contrôles (dock) */
.controls {
  display: flex; align-items: center; justify-content: center; gap: 16px; position: relative;
  padding: 12px max(14px, var(--safe-r)) calc(12px + var(--safe-b)) max(14px, var(--safe-l));
  border-top: 1px solid var(--line); background: rgba(9, 9, 14, .8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.ctrl-group { display: flex; gap: 8px; }
.ctrl {
  width: 50px; height: 50px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  display: grid; place-items: center; font-size: 20px; position: relative; transition: transform .15s var(--ease), background .15s, box-shadow .2s; flex: none;
}
.ctrl:hover { background: var(--panel-3); }
.ctrl:active { transform: scale(.92); }
.ctrl.off { background: rgba(255, 92, 108, .16); border-color: rgba(255, 92, 108, .4); color: #ff8a96; }
.ctrl.on { background: rgba(52, 211, 153, .16); border-color: rgba(52, 211, 153, .45); color: var(--sage); }
.ctrl.accent { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.ctrl.accent2 { background: rgba(124, 92, 255, .16); border-color: rgba(124, 92, 255, .45); color: var(--accent-2); }
.ctrl.danger { background: var(--tomato); border-color: transparent; color: #fff; width: 64px; }
.ctrl.danger:hover { filter: brightness(1.08); }
.ctrl .badge { position: absolute; top: -5px; right: -5px; }
#c-more { display: none; }
.popover {
  position: fixed; bottom: calc(86px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 30;
  background: rgba(20, 20, 30, .985); border: 1px solid var(--line-2); border-radius: 22px; padding: 14px; box-shadow: var(--shadow);
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 140px - var(--safe-b) - var(--safe-t)); overflow: auto;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: popup .22s var(--ease);
}
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.more-grid .btn { justify-content: flex-start; }
.more-grid .btn.on { background: rgba(255, 92, 108, .16); border-color: rgba(255, 92, 108, .4); color: #ff8a96; }
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.sound-btn { border: 1px solid var(--line); background: rgba(255, 255, 255, .04); border-radius: 14px; padding: 10px 6px; display: grid; gap: 2px; justify-items: center; font-size: 12px; color: var(--muted); font-weight: 600; transition: transform .12s, background .12s; }
.sound-btn b { font-size: 24px; }
.sound-btn:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.sound-btn:active { transform: scale(.94); }
.react-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.react-grid button { font-size: 26px; border: 0; background: transparent; border-radius: 12px; padding: 6px 0; transition: transform .2s var(--spring); }
.react-grid button:hover { background: rgba(255, 255, 255, .06); transform: scale(1.2); }
.pop-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 10px; }

/* Panneau latéral salon */
#side-panel { width: 350px; flex: none; border-left: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; padding: 12px max(12px, var(--safe-r)) 12px 12px; gap: 10px; }
.side-tab { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-tab[data-pane=members], .side-tab[data-pane=scores] { overflow-y: auto; }
#chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 4px 2px; -webkit-overflow-scrolling: touch; }
.msg { display: flex; gap: 10px; padding: 5px 6px; border-radius: 12px; animation: msgin .25s var(--ease); }
.msg .m-body { min-width: 0; flex: 1; }
.msg .m-head { display: flex; gap: 8px; align-items: baseline; }
.msg .m-head strong { font-size: 14px; font-weight: 700; }
.msg .m-head time { color: var(--faint); font-size: 11px; }
.msg .m-text { word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; color: #e6e6f0; }
.msg.cont { padding-top: 0; }
.msg.cont .avatar { visibility: hidden; height: 0; }
.msg.sys { color: var(--faint); font-size: 12.5px; padding: 4px 10px; margin: 4px auto; justify-content: center; text-align: center; background: rgba(255, 255, 255, .04); border-radius: 99px; max-width: 92%; }
.msg.big-emoji .m-text { font-size: 32px; line-height: 1.2; }
#chat-form { display: flex; gap: 4px; align-items: center; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 4px; transition: border-color .15s; }
#chat-form:focus-within { border-color: var(--violet); }
#chat-form input { border: 0; background: transparent; padding: 9px 4px; box-shadow: none; }
#chat-form [type=submit] { background: var(--grad); color: #fff; }
.emoji-bar { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 6px; margin-bottom: 8px; max-height: 180px; overflow: auto; }
.emoji-bar button { border: 0; background: transparent; font-size: 22px; padding: 5px 0; border-radius: 10px; }
.emoji-bar button:hover { background: rgba(255, 255, 255, .06); }
.member { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; }
.member:hover { background: rgba(255, 255, 255, .03); }
.member .grow { min-width: 0; }
.member .grow strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.member .states { display: flex; gap: 4px; color: var(--muted); }
.member .states .ico { width: 16px; height: 16px; }
.member input[type=range] { width: 100%; height: 18px; }
.member.speaking .avatar { box-shadow: 0 0 0 3px var(--sage); }
.member.away { opacity: .5; }
.away-tag { font-size: 11px; font-weight: 700; color: var(--mustard); background: rgba(255, 190, 61, .12); padding: 1px 7px; border-radius: 99px; margin-left: 4px; }
.score-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; }
.score-row .rank { width: 26px; text-align: center; font-weight: 800; color: var(--muted); }
.score-row .pts { font-weight: 800; color: var(--accent-2); }

/* ---------- Modales & toasts ---------- */
.modal-root { position: fixed; inset: 0; background: rgba(5, 5, 9, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: max(16px, var(--safe-t)) 16px max(16px, var(--safe-b)); animation: fade .15s; }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 32px - var(--safe-t) - var(--safe-b)); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 26px; padding: 26px; position: relative; box-shadow: var(--shadow); animation: popup .28s var(--ease); overscroll-behavior: contain; }
.modal.wide { width: min(900px, 100%); }
.modal h2 { margin: 0 0 16px; font-size: 24px; padding-right: 40px; font-weight: 800; }
.modal-close { position: absolute; top: 14px; right: 14px; background: rgba(255, 255, 255, .06); }
.modal form, .modal .form { display: grid; gap: 14px; }
.modal .row { display: flex; gap: 10px; flex-wrap: wrap; }
.modal .row > * { flex: 1; min-width: 150px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text); font-size: 14.5px; cursor: pointer; }
.settings-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; display: grid; gap: 12px; }
.settings-section h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 700; font-family: var(--font); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 0; transition: transform .2s var(--spring); }
.swatch:hover { transform: scale(1.1); }
.swatch.sel { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--text); }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-size: 20px; transition: transform .2s var(--spring); }
.emoji-pick button:hover { transform: scale(1.08); }
.emoji-pick button.sel { background: rgba(124, 92, 255, .25); border-color: var(--violet); }
.meter { height: 8px; border-radius: 9px; background: var(--well); overflow: hidden; }
.meter > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--teal)); transition: width .08s; }
.switch-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.switch-row .grow { display: grid; }
.switch-row small { color: var(--muted); font-size: 12.5px; font-weight: 500; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.game-card { --c: var(--violet); text-align: left; border: 1px solid var(--line); background: var(--panel-2); border-radius: 20px; padding: 16px; display: grid; gap: 6px; align-content: start; color: var(--text); position: relative; overflow: hidden; transition: transform .2s var(--ease), border-color .2s; }
.game-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(240px 140px at 100% 0%, color-mix(in srgb, var(--c) 28%, transparent), transparent 70%); pointer-events: none; }
.game-card:nth-child(1) { --c: var(--tomato); } .game-card:nth-child(2) { --c: var(--plum); } .game-card:nth-child(3) { --c: var(--sky); }
.game-card:nth-child(4) { --c: var(--sage); } .game-card:nth-child(5) { --c: var(--mustard); }
.game-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.game-card > * { position: relative; }
.game-card .g-emoji { font-size: 34px; }
.game-card h3 { margin: 0; font-size: 18px; font-weight: 750; }
.game-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.game-card .g-min { font-size: 12px; color: var(--faint); font-weight: 600; }

#toasts { position: fixed; top: max(14px, calc(var(--safe-t) + 8px)); right: max(14px, var(--safe-r)); display: grid; gap: 10px; z-index: 60; width: min(380px, calc(100vw - 28px)); }
.toast { background: rgba(28, 28, 40, .94); color: var(--text); border: 1px solid var(--line-2); padding: 12px 14px 12px 18px; border-radius: 16px; box-shadow: var(--shadow); display: grid; gap: 8px; animation: toastin .35s var(--ease); font-size: 14.5px; font-weight: 550; position: relative; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); overflow: hidden; }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.toast.error::before { background: var(--tomato); }
.toast.good::before { background: var(--sage); }
.toast .t-actions { display: flex; gap: 6px; justify-content: flex-end; }

#float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.floater { position: absolute; font-size: 44px; animation: floatup 2.6s ease-out forwards; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.floater small { display: block; font-size: 11.5px; text-align: center; background: rgba(9, 9, 14, .8); color: #fff; border-radius: 99px; padding: 1px 8px; font-weight: 700; }

@keyframes floatup { 0% { transform: translateY(0) scale(.5); opacity: 0; } 12% { transform: translateY(-24px) scale(1.15); opacity: 1; } 100% { transform: translateY(-280px) scale(1); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
@keyframes popup { from { transform: translateY(16px) scale(.98); opacity: 0; } }
@keyframes sheetin { from { transform: translateY(100%); } }
@keyframes toastin { from { transform: translateY(-12px) scale(.97); opacity: 0; } }
@keyframes msgin { from { transform: translateY(6px); opacity: 0; } }
@keyframes pulse { 50% { transform: scale(1.07); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg) scale(1.04); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); } 100% { box-shadow: 0 0 0 16px rgba(52, 211, 153, 0); } }

/* ---------- Jeux & vidéo : panneaux ---------- */
#game-panel, #media-panel { flex: 1; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; animation: popup .3s var(--ease); }
.g-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.g-head .g-title { font-weight: 750; display: flex; gap: 8px; align-items: center; white-space: nowrap; font-family: var(--display); font-size: 16.5px; }
.g-head .g-sub { color: var(--muted); font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-body { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; }
.g-body > * { flex-shrink: 0; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; background: rgba(255, 255, 255, .08); color: var(--text); padding: 3px 11px; border-radius: 99px; font-size: 13.5px; }
.timer.urgent { background: var(--tomato); color: #fff; animation: pulse 1s infinite; }
.g-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.g-center { text-align: center; display: grid; gap: 12px; justify-items: center; }
.g-big { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-family: var(--display); }
.g-huge { font-size: 60px; font-weight: 900; line-height: 1; animation: wiggle 3s ease-in-out infinite; display: inline-block; }
.word-card { background: var(--grad); color: #fff; border-radius: 22px; padding: 20px; text-align: center; display: grid; gap: 4px; animation: pop .4s var(--ease); box-shadow: var(--glow); }
.word-card .label { color: rgba(255, 255, 255, .75); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.word-card .word { font-size: 34px; font-weight: 800; font-family: var(--display); letter-spacing: -.02em; }
.word-card .muted { color: rgba(255, 255, 255, .8); }
.word-card.white { background: linear-gradient(135deg, #f3f3f8, #cfcfe0); color: var(--ink); box-shadow: var(--shadow-sm); }
.word-card.white .label, .word-card.white .muted { color: rgba(9, 9, 14, .65); }
.word-card.dead { background: var(--panel-2); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.word-card.dead .label, .word-card.dead .muted { color: var(--muted); }
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.p-btn { border: 1px solid var(--line); background: var(--panel-2); border-radius: 18px; padding: 12px 8px; display: grid; gap: 6px; justify-items: center; position: relative; color: var(--text); transition: transform .2s var(--ease), background .15s, border-color .15s; }
.p-btn:hover:not(:disabled) { transform: translateY(-2px); background: var(--panel-3); }
.p-btn.sel { background: rgba(124, 92, 255, .22); border-color: var(--violet); box-shadow: var(--glow); }
.p-btn.sel .p-sub { color: var(--accent-2); }
.p-btn.dead { opacity: .4; }
.p-btn:disabled { cursor: default; }
button.p-btn:disabled:not(.sel) { opacity: .5; }
.p-btn .p-name { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-btn .p-sub { font-size: 12px; color: var(--muted); }
.p-btn .votes { position: absolute; top: -8px; right: -6px; background: var(--pink); color: #fff; border-radius: 99px; font-size: 12px; font-weight: 800; padding: 0 7px; box-shadow: 0 0 0 2px var(--panel); }
.p-btn .check-mark { position: absolute; top: 5px; left: 9px; color: var(--sage); font-weight: 900; }
.clue-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.clue-table th, .clue-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.clue-table th { color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; }
.clue-table tr.current td { background: rgba(124, 92, 255, .12); }
.clue-table tr.dead td { opacity: .5; text-decoration: line-through; }
.clue-table .who { display: flex; gap: 8px; align-items: center; font-weight: 650; white-space: nowrap; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); color: var(--text); }
.tag.civil { background: rgba(56, 189, 248, .16); color: var(--sky); }
.tag.undercover, .tag.loup { background: rgba(255, 92, 108, .18); color: #ff8a96; }
.tag.mrwhite { background: rgba(255, 255, 255, .85); color: var(--ink); }
.tag.good { background: rgba(52, 211, 153, .16); color: var(--sage); }
.banner { border-radius: 18px; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.banner .b-emoji { font-size: 32px; }
.banner.night { background: linear-gradient(135deg, #141a3a, #1b1433); border-color: rgba(124, 92, 255, .3); }
.banner.day { background: linear-gradient(135deg, rgba(255, 190, 61, .16), rgba(255, 92, 108, .08)); border-color: rgba(255, 190, 61, .3); }
.banner.win { background: linear-gradient(135deg, rgba(52, 211, 153, .2), rgba(45, 212, 191, .08)); border-color: rgba(52, 211, 153, .35); }
.banner.lose { background: linear-gradient(135deg, rgba(255, 92, 108, .2), rgba(255, 77, 141, .08)); border-color: rgba(255, 92, 108, .35); }
.form-line { display: flex; gap: 8px; }
.two-col { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.podium { display: grid; gap: 6px; }
.podium .score-row { background: var(--bg-2); border: 1px solid var(--line); }
.podium .score-row:first-child { background: linear-gradient(135deg, rgba(255, 190, 61, .22), rgba(255, 190, 61, .06)); border-color: rgba(255, 190, 61, .4); }
.podium .score-row:first-child .pts { color: var(--mustard); }

/* Quiz */
.quiz-q { font-size: 23px; font-weight: 800; text-align: center; margin: 4px 0; font-family: var(--display); letter-spacing: -.015em; }
.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-choice { border: 0; border-radius: 18px; padding: 16px 14px; font-weight: 700; font-size: 16px; text-align: left; display: flex; gap: 12px; align-items: center; min-height: 68px; color: #fff; transition: transform .12s, opacity .2s, box-shadow .2s; }
.quiz-choice .k { width: 32px; height: 32px; border-radius: 10px; background: rgba(0, 0, 0, .2); display: grid; place-items: center; flex: none; }
.quiz-choice:nth-child(1) { background: linear-gradient(135deg, #ff5c6c, #ff4d8d); }
.quiz-choice:nth-child(2) { background: linear-gradient(135deg, #38bdf8, #6366f1); }
.quiz-choice:nth-child(3) { background: linear-gradient(135deg, #f59e0b, #ffbe3d); color: #1f1400; }
.quiz-choice:nth-child(4) { background: linear-gradient(135deg, #10b981, #34d399); color: #03231a; }
.quiz-choice:hover:not(:disabled) { transform: translateY(-2px); }
.quiz-choice:active:not(:disabled) { transform: scale(.97); }
.quiz-choice:disabled { cursor: default; }
.quiz-choice.dim { opacity: .3; }
.quiz-choice.mine { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px #fff; }
.quiz-choice.correct { opacity: 1; transform: scale(1.02); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--sage), 0 10px 30px rgba(52, 211, 153, .35); }
.quiz-choice .who { margin-left: auto; display: flex; }
.progress { height: 8px; border-radius: 9px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); transition: width .4s; }

/* Petit bac */
.bac-letter { width: 84px; height: 84px; border-radius: 24px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 50px; font-weight: 900; font-family: var(--display); box-shadow: var(--glow); animation: pop .4s var(--ease); flex: none; }
.bac-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.bac-form label { color: var(--text); }
.bac-form input.ok { border-color: var(--sage); }
.bac-form input.ko { border-color: var(--tomato); }
.bac-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bac-table { border-collapse: separate; border-spacing: 5px; font-size: 14px; min-width: 100%; }
.bac-table th { color: var(--faint); font-size: 12px; text-align: left; padding: 4px 6px; white-space: nowrap; }
.bac-cell { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 110px; text-align: left; width: 100%; position: relative; font-weight: 600; color: var(--text); }
.bac-cell.bad { text-decoration: line-through; color: var(--faint); border-color: rgba(255, 92, 108, .5); border-style: dashed; }
.bac-cell.mine-reject { box-shadow: inset 0 0 0 2px var(--tomato); }
.bac-cell .pts { position: absolute; top: -9px; right: -6px; background: var(--sage); color: #03231a; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 0 6px; }
.bac-cell .pts.five { background: var(--mustard); color: #1f1400; }
.bac-cell .rc { font-size: 11px; color: var(--tomato); margin-left: 4px; }
.bac-cell.empty { color: var(--faint); font-style: italic; }

/* Dessin */
.draw-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 230px; gap: 12px; padding: 12px; }
.draw-main { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.canvas-box { position: relative; flex: 1; min-height: 120px; display: grid; place-items: center; overflow: hidden; }
.canvas-box canvas { background: #fdfcff; border-radius: 16px; touch-action: none; display: block; box-shadow: var(--shadow-sm); width: 320px; height: 240px; }
.canvas-box canvas.can-draw { cursor: crosshair; }
.canvas-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(9, 9, 14, .88); border-radius: 16px; text-align: center; padding: 20px; animation: fade .2s; backdrop-filter: blur(4px); }
.draw-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); flex: none; transition: transform .2s var(--spring); }
.color-dot.sel { transform: scale(1.15); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--violet); }
.size-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); display: grid; place-items: center; flex: none; color: var(--text); }
.size-btn.sel { background: rgba(124, 92, 255, .25); border-color: var(--violet); }
.size-btn i { background: currentColor; border-radius: 50%; display: block; }
.word-mask { font-size: 24px; font-weight: 800; letter-spacing: .25em; font-variant-numeric: tabular-nums; text-align: center; font-family: var(--display); overflow-wrap: anywhere; }
.draw-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.draw-scores { display: grid; gap: 2px; }
.draw-scores .score-row { padding: 5px 8px; font-size: 14px; }
.draw-scores .score-row.found { background: rgba(52, 211, 153, .14); }
.draw-scores .score-row.drawer { background: rgba(124, 92, 255, .16); }
.guess-feed { flex: 1; min-height: 80px; overflow-y: auto; background: var(--well); border-radius: 14px; padding: 8px 10px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); }
.guess-feed .ok { color: var(--sage); font-weight: 800; }
.guess-feed .close { color: var(--mustard); font-style: italic; }
.guess-feed .priv { color: var(--sage); opacity: .8; }

/* ---------- Vidéo (YouTube) ---------- */
.mv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #000; position: relative; }
.mv-screen { flex: 1; min-height: 0; position: relative; }
.mv-screen iframe, .mv-screen video, .mv-screen .yt-host { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.mv-overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; background: rgba(9, 9, 14, .9); z-index: 2; }
.mv-overlay .g-center { max-width: 440px; }
.mv-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel); border-top: 1px solid var(--line); }
.mv-bar .now { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; }
.mv-bar .now > div { display: grid; min-width: 0; }
.mv-bar .now strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mv-bar .now small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-bar .icon-btn { background: rgba(255, 255, 255, .06); color: var(--text); }
.mv-bar .icon-btn[data-m=toggle] { background: var(--grad) !important; color: #fff !important; }
.queue { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); }
.q-item img { width: 76px; height: 43px; border-radius: 9px; object-fit: cover; flex: none; background: #000; }
.q-item .grow { min-width: 0; display: grid; }
.q-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.q-item small { color: var(--muted); font-size: 12px; }
.q-item.playing { background: rgba(124, 92, 255, .14); border-color: rgba(124, 92, 255, .4); }
.yt-hint { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; color: var(--muted); font-size: 13.5px; }

/* ---------- Administration ---------- */
.admin-list { display: grid; gap: 8px; }
.u-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel-2); flex-wrap: wrap; }
.u-row .grow { min-width: 140px; display: grid; }
.u-row strong { font-size: 15px; display: flex; gap: 6px; align-items: center; font-weight: 650; }
.u-row small { color: var(--muted); font-size: 12px; }
.u-row .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.u-row.pending { background: rgba(255, 190, 61, .07); border-color: rgba(255, 190, 61, .3); }
.u-row select { width: auto; padding: 6px 8px; font-size: 14px; border-radius: 9px; }
.chan-logo { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 110px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat b { display: block; font-size: 28px; font-family: var(--display); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat:nth-child(1) b { color: var(--mustard); } .stat:nth-child(2) b { color: var(--sage); } .stat:nth-child(3) b { color: var(--sky); } .stat:nth-child(4) b { color: var(--rose); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel-2); padding: 10px 12px; border-radius: 14px; cursor: pointer; color: var(--text); font-weight: 600; flex: 1; min-width: 150px; }
.seg label:has(input:checked) { background: rgba(124, 92, 255, .2); border-color: var(--violet); }
.seg input { accent-color: var(--violet); width: 16px; height: 16px; }
.note { background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.temp-pass { font-family: var(--display); font-size: 26px; letter-spacing: .12em; background: rgba(124, 92, 255, .2); color: var(--text); border: 1px solid var(--violet); border-radius: 12px; padding: 6px 14px; display: inline-block; user-select: all; }

.install-box { display: flex; align-items: center; gap: 12px; background: rgba(124, 92, 255, .08); border: 1px solid rgba(124, 92, 255, .3); border-radius: 16px; padding: 10px 12px; }
.install-box .install-ico { font-size: 26px; }
.install-box .grow { display: grid; min-width: 0; }
.install-box strong { font-size: 14.5px; }
.install-box small { color: var(--muted); font-size: 12.5px; }

/* ---------- Responsive ---------- */
.only-mobile, .only-mobile-flex { display: none !important; }
.tab-hidden { display: none !important; }
@media (max-width: 1100px) {
  #side-panel { width: 310px; }
  .two-col { grid-template-columns: 1fr; }
  .draw-wrap { grid-template-columns: 1fr 210px; }
}
@media (max-width: 900px) {
  #auth-view { grid-template-columns: 1fr; gap: 22px; align-content: start; padding-top: max(28px, calc(var(--safe-t) + 16px)); padding-bottom: max(28px, calc(var(--safe-b) + 16px)); }
  .auth-poster h1 { font-size: clamp(32px, 9vw, 46px); margin: 18px 0 6px; }
  .auth-poster .hand { font-size: 16px; }
  .stickers { margin-top: 16px; gap: 6px; }
  .sticker { font-size: 12.5px; padding: 6px 11px; }
  .auth-card { justify-self: stretch; width: auto; padding: 20px; border-radius: 22px; }
}
@media (max-width: 860px) {
  .only-mobile { display: inline-grid !important; }
  .only-mobile-flex { display: grid !important; }
  .hide-sm { display: none; }
  #sidebar { position: fixed; inset: 0 auto 0 0; z-index: 45; transform: translateX(-104%); transition: transform .28s var(--ease); width: min(330px, 88vw); box-shadow: var(--shadow); }
  #main-view.sidebar-open #sidebar { transform: none; }
  #sidebar-backdrop { position: fixed; inset: 0; background: rgba(5, 5, 9, .6); z-index: 44; display: none; backdrop-filter: blur(3px); }
  #main-view.sidebar-open #sidebar-backdrop { display: block; }
  #side-panel {
    position: fixed; inset: 0; z-index: 42; width: auto; transform: translateY(100%); transition: transform .3s var(--ease); border: 0;
    padding: max(12px, calc(var(--safe-t) + 6px)) max(12px, var(--safe-r)) calc(10px + var(--safe-b)) max(12px, var(--safe-l));
  }
  #room.side-open #side-panel { transform: none; }
  .topbar { padding: max(10px, calc(var(--safe-t) + 4px)) max(12px, var(--safe-r)) 10px max(12px, var(--safe-l)); min-height: 56px; gap: 8px; }
  .topbar h1 { font-size: 17px; }
  .stage { padding: 10px max(10px, var(--safe-r)) 10px max(10px, var(--safe-l)); gap: 10px; }
  .lobby-body { padding: 16px max(14px, var(--safe-r)) max(20px, var(--safe-b)) max(14px, var(--safe-l)); gap: 18px; }
  #lobby > .topbar { display: flex; }
  .lobby-hero { padding: 20px; border-radius: 22px; }
  .hero-actions { width: 100%; }
  .hero-actions #btn-create-room2 { display: none; }
  .join-code { max-width: none; min-width: 0; }
  .g-body { padding: 12px; gap: 12px; }
  .quiz-choices { grid-template-columns: 1fr; }
  .quiz-choice { min-height: 56px; padding: 12px 14px; }
  .quiz-q { font-size: 19px; }
  .draw-wrap { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; padding: 8px; }
  .draw-side { max-height: 190px; }
  .draw-scores { display: flex; overflow-x: auto; gap: 4px; }
  .draw-scores .score-row { flex: none; }
  .draw-tools { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; }
  .g-head { padding: 8px 10px; gap: 6px; }
  .stage.has-activity .tile { width: 88px; }
  .stage.has-activity .tile.screen { width: 150px; }
  /* Modales en feuille (bottom sheet) */
  .modal-root { place-items: end center; padding: max(24px, var(--safe-t)) 0 0; }
  .modal { width: 100%; max-width: 640px; border-radius: 26px 26px 0 0; padding: 22px max(18px, var(--safe-r)) calc(22px + var(--safe-b)) max(18px, var(--safe-l)); max-height: calc(100dvh - max(24px, var(--safe-t))); animation: sheetin .32s var(--ease); border-bottom: 0; }
  .modal.wide { width: 100%; }
  .modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .18); margin: -10px auto 14px; }
  .modal h2 { font-size: 21px; }
  .modal-actions { position: sticky; bottom: calc(-22px - var(--safe-b)); background: var(--panel); padding: 10px 0 calc(4px + var(--safe-b)); margin-bottom: calc(-4px - var(--safe-b)); }
  .modal-actions .btn { flex: 1; }
  .word-card .word { font-size: 28px; }
  .g-huge { font-size: 46px; }
  .rooms-grid { grid-template-columns: 1fr; gap: 10px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .game-card { padding: 14px; }
  .game-card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }
  .popover { bottom: calc(80px + var(--safe-b)); }
  #toasts { left: max(12px, var(--safe-l)); right: max(12px, var(--safe-r)); width: auto; }
  /* Dock : actions essentielles + menu « plus » */
  .controls { gap: 6px; padding: 8px max(8px, var(--safe-r)) calc(8px + var(--safe-b)) max(8px, var(--safe-l)); justify-content: space-between; }
  .ctrl-group { display: contents; }
  .ctrl { width: auto; flex: 1 1 0; max-width: 58px; min-width: 38px; height: 48px; border-radius: 15px; font-size: 18px; }
  .ctrl.danger { max-width: 64px; }
  #c-deaf, #c-sounds, #c-react, #c-screen { display: none !important; }
  #c-more { display: grid; }
}
@media (max-width: 380px) {
  .ctrl { height: 44px; border-radius: 13px; min-width: 34px; }
  .controls { gap: 4px; }
  .topbar .btn.small { padding: 6px 9px; }
  .auth-card { padding: 16px; }
  .lobby-hero { padding: 16px; }
  .lobby-hero h2 { font-size: 26px; }
  .player-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .modal .row > * { min-width: 120px; }
  .bac-letter { width: 64px; height: 64px; font-size: 38px; border-radius: 18px; }
}
/* Téléphone à l'horizontale : on gagne de la hauteur */
@media (max-height: 520px) and (orientation: landscape) {
  .topbar { min-height: 46px; padding-top: max(6px, var(--safe-t)); padding-bottom: 6px; }
  .topbar h1 { font-size: 16px; }
  .controls { padding-top: 5px; padding-bottom: calc(5px + var(--safe-b)); }
  .ctrl { height: 40px; }
  .stage { padding-top: 6px; padding-bottom: 6px; gap: 6px; }
  .stage.has-activity { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
  .stage.has-activity > .stage-tabs { grid-column: 1; grid-row: 1; }
  .stage.has-activity > #media-panel, .stage.has-activity > #game-panel { grid-column: 1; grid-row: 2; }
  .stage.has-activity > .stage-tabs.hidden ~ #media-panel, .stage.has-activity > .stage-tabs.hidden ~ #game-panel { grid-row: 1 / span 2; }
  .stage.has-activity #video-grid { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; overflow-y: auto; overflow-x: hidden; width: 84px; }
  .stage.has-activity .tile { width: 80px; }
  .stage.has-activity .tile .name { display: none; }
  .controls { justify-content: center; gap: 10px; }
  .popover { bottom: calc(58px + var(--safe-b)); max-height: calc(100dvh - 80px); }
  #auth-view { grid-template-columns: 1fr 1fr; align-content: center; gap: 24px; }
  .stickers { display: none; }
  .lobby-hero { padding: 14px 18px; }
  .modal-root { padding-top: 8px; }
  .modal { max-height: calc(100dvh - 8px); }
  .g-body { padding: 10px; gap: 10px; }
}
@media (pointer: coarse) and (max-width: 860px) { #c-screen { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
.brand-mark img { width: 58%; height: 58%; display: block; }
.out-box { display: grid; gap: 10px; margin-bottom: 14px; }
.vol-row { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; }
.vol-row input { flex: 1; }
.vol-row span { width: 40px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.out-list { display: flex; flex-wrap: wrap; gap: 6px; }
.out-list .btn.sel { background: rgba(124, 92, 255, .22); border-color: var(--violet); }
.mv-vol { display: flex; align-items: center; gap: 6px; }
.mv-vol input { width: 90px; }
@media (max-width: 520px) { .mv-vol input { width: 64px; } }
@media (max-width: 400px) { .mv-bar [data-m=back], .mv-bar [data-m=fwd] { display: none; } .mv-bar { gap: 4px; padding: 6px 8px; } }
.opt-chips { display: grid; gap: 8px; }
.opt-label { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { padding: 8px 13px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--text); font-size: 14px; font-weight: 600; transition: .15s; }
.chip input:checked + span { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.chip input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
@media (max-width: 860px) { .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -4px; padding: 2px 4px 6px; scrollbar-width: none; } .chip span { white-space: nowrap; } }

/* ---------- Devine le 11 ---------- */
.g-body { container-type: inline-size; }
.lu-wrap { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.lu-side, .lu-side2 { display: grid; gap: 10px; }
.lu-card { border-radius: 18px; padding: 14px 16px; background: linear-gradient(135deg, rgba(52, 211, 153, .16), rgba(56, 189, 248, .08)); border: 1px solid rgba(52, 211, 153, .3); display: grid; gap: 6px; }
.lu-team { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sage); }
.lu-match { font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1.15; }
.lu-meta { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.lu-fb { font-size: 13.5px; color: var(--muted); min-height: 1.3em; }
.lu-fb.ok { color: var(--sage); font-weight: 700; }
.lu-fb.ko { color: #ff8a96; }
.lu-board { display: grid; gap: 4px; }
.lu-board .score-row { padding: 6px 8px; background: var(--bg-2); border: 1px solid var(--line); }
.pitch {
  position: relative; border-radius: 20px; padding: 16px 8px; display: flex; flex-direction: column; gap: 12px; justify-content: space-between; min-height: 420px;
  background: repeating-linear-gradient(0deg, #0f5132 0 44px, #11603b 44px 88px); border: 2px solid rgba(255, 255, 255, .18); overflow: hidden;
}
.pitch-lines { position: absolute; inset: 8px; border: 2px solid rgba(255, 255, 255, .22); border-radius: 12px; pointer-events: none; }
.pitch-lines::before { content: ""; position: absolute; left: 50%; bottom: -2px; width: 44%; height: 16%; transform: translateX(-50%); border: 2px solid rgba(255, 255, 255, .22); border-bottom: 0; }
.pitch-lines::after { content: ""; position: absolute; left: 50%; top: -2px; width: 44%; height: 12%; transform: translateX(-50%); border: 2px solid rgba(255, 255, 255, .22); border-top: 0; }
.p-line { position: relative; display: flex; justify-content: space-around; gap: 6px; z-index: 1; }
.lu-slot {
  flex: 0 1 132px; min-width: 0; display: grid; justify-items: center; gap: 2px; padding: 7px 6px; border-radius: 12px; text-align: center;
  background: rgba(9, 9, 14, .72); border: 1px solid rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(4px);
}
.lu-slot small { font-size: 10.5px; color: rgba(255, 255, 255, .6); }
.lu-mask { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; font-size: 13px; font-weight: 800; line-height: 1; min-height: 14px; letter-spacing: .02em; }
.lu-mask i { display: inline-block; width: 7px; height: 2px; background: rgba(255, 255, 255, .75); align-self: flex-end; margin-bottom: 1px; }
.lu-name { font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
.lu-slot.found { background: linear-gradient(135deg, #10b981, #34d399); color: #03231a; border-color: transparent; box-shadow: 0 4px 14px rgba(16, 185, 129, .35); animation: pop .35s var(--spring); }
.lu-slot.missed { background: rgba(255, 255, 255, .88); color: var(--ink); }
.lu-slot .stack .avatar { width: 18px; height: 18px; font-size: 9px; }
@container (min-width: 620px) {
  .lu-wrap { grid-template-columns: minmax(0, 1fr) minmax(190px, 240px); }
  .lu-side { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
  .lu-side .lu-card { grid-row: span 2; }
  .pitch { grid-column: 1; grid-row: 2; }
  .lu-side2 { grid-column: 2; grid-row: 2; }
}
@container (min-width: 980px) {
  .lu-wrap { grid-template-columns: minmax(230px, 290px) minmax(0, 1fr) minmax(190px, 240px); }
  .lu-side { grid-column: 1; grid-template-columns: 1fr; }
  .lu-side .lu-card { grid-row: auto; }
  .pitch { grid-column: 2; grid-row: 1; }
  .lu-side2 { grid-column: 3; grid-row: 1; }
}
@container (max-width: 520px) {
  .pitch { min-height: 360px; padding: 12px 4px; gap: 10px; }
  .p-line { gap: 3px; }
  .lu-slot { padding: 6px 3px; border-radius: 10px; }
  .lu-mask { font-size: 11px; }
  .lu-mask i { width: 5px; }
  .lu-name { font-size: 11.5px; }
  .lu-match { font-size: 18px; }
}
#update-bar {
  position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); top: max(12px, calc(var(--safe-t) + 8px)); width: min(520px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 18px;
  background: rgba(24, 20, 40, .96); border: 1px solid rgba(124, 92, 255, .5); box-shadow: var(--shadow), var(--glow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: toastin .4s var(--ease);
}
#update-bar .u-ico { font-size: 24px; }
#update-bar .grow { display: grid; min-width: 0; }
#update-bar strong { font-size: 14.5px; }
#update-bar small { color: var(--muted); font-size: 12.5px; }
.news-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.news-list li { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); line-height: 1.4; }
