    /* Polices hébergées chez nous (RGPD : aucune requête vers Google). Licence OFL. */
    @font-face { font-family: "DM Sans"; src: url(fonts/dm-sans.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
    @font-face { font-family: "Outfit"; src: url(fonts/outfit.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }


    /* Couleurs « Bleu ERPB » (celles de Y3B Gestion), choisies par Yvan le 29/11 à la place du bleu pétrole. */
    :root {
      --bg: #f3f5f9;
      --surface: #ffffff;
      --raised: #ffffff;
      --soft: #eef1f6;
      --ink: #1b2437;
      --muted: #6b7488;
      --border: #e3e7ef;
      --accent: #1e4fb8;
      --accent-soft: #e6eefd;
      --button: #2f6fed;
      --logo-bg: #cfdcfb;
      --logo-ink: #1e4fb8;
      --shadow: 0 12px 35px #1b243710;
      --sidebar: 220px;
      color-scheme: light; /* cases, listes et barres de défilement suivent le thème du site, pas celui de l'appareil */
    }

    /* Mode sombre : gris-bleu très foncé, le bleu reste un accent. */
    [data-theme="dark"] {
      --bg: #14171f;
      --surface: #1c2028;
      --raised: #232833;
      --soft: #10131a;
      --ink: #edeff4;
      --muted: #9ca3b4;
      --border: #2a2f3a;
      --accent: #7ea6ff;
      --accent-soft: #1d2a47;
      --button: #2f6fed;
      --shadow: 0 12px 35px #00000028;
      color-scheme: dark;
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; scroll-padding-top: 90px; }
    body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 "DM Sans",sans-serif; transition: background .25s,color .25s; }
    h1,h2,h3,p { margin: 0; }
    h1,h2,h3,.brand,.art-title { font-family: "Outfit",sans-serif; }
    button,input { font: inherit; }
    button { cursor: pointer; }
    button:disabled { cursor: default; }
    a { color: inherit; text-decoration: none; }
    button,a,input { -webkit-tap-highlight-color: transparent; }
    button:focus-visible,a:focus-visible,input:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
    svg { display: block; }
    .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
    [hidden] { display: none !important; }
    .sprite { position: absolute; }

    .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); padding: 29px 17px 22px; display: flex; flex-direction: column; z-index: 60; }
    .sidebar-head { display: flex; justify-content: space-between; align-items: center; }
    .brand { display: flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 800; line-height: 1; letter-spacing: -.8px; }
    .logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--logo-bg); color: var(--logo-ink); font-size: 29px; transform: rotate(-7deg); }
    .brand small { display: block; margin-top: 5px; font: 600 11px "DM Sans",sans-serif; letter-spacing: 3px; color: var(--muted); }
    .nav-label { margin: 43px 13px 12px; font-size: 11px; letter-spacing: 1.6px; color: var(--muted); }
    .side-nav { display: grid; gap: 5px; }
    .nav-item { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 11px; color: var(--muted); font-size: 13px; font-weight: 600; transition: background .2s,color .2s; }
    .nav-item:hover { background: var(--soft); color: var(--ink); }
    .nav-item.active { background: var(--accent-soft); color: var(--accent); }
    .count { margin-left: auto; background: var(--raised); border-radius: 5px; padding: 1px 6px; font-size: 11px; }
    .sidebar-bottom { margin-top: auto; }
    .sidebar-note { padding: 20px 12px; font-size: 12px; color: var(--muted); }
    .sidebar-note strong { display: block; color: var(--ink); font-family: "Outfit",sans-serif; font-size: 16px; margin-bottom: 6px; }
    .theme-button { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--soft); color: var(--ink); font-size: 12px; }
    .theme-button > span { display: flex; align-items: center; gap: 10px; }
    .switch { width: 32px; height: 19px; border-radius: 20px; padding: 3px; background: var(--border); }
    .switch::before { content: ""; width: 13px; height: 13px; background: white; border-radius: 50%; transition: transform .2s; }
    [data-theme="dark"] .switch { background: var(--button); }
    [data-theme="dark"] .switch::before { transform: translateX(13px); }

    .app { margin-left: var(--sidebar); }
    .topbar { height: 77px; padding: 0 32px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
    .topbar-left,.topbar-right { display: flex; align-items: center; gap: 14px; }
    .breadcrumb { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); }
    .breadcrumb strong { color: var(--ink); font-weight: 500; }
    .preview-label { font-size: 11px; letter-spacing: .6px; color: var(--muted); border: 1px solid var(--border); padding: 5px 8px; border-radius: 6px; }
    .profile { display: flex; align-items: center; gap: 8px; font-size: 12px; }
    .profile-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--soft); font-size: 21px; }
    .icon-button { display: grid; place-items: center; width: 38px; height: 38px; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 10px; transition: background .2s; }
    .icon-button:hover { background: var(--raised); }
    .menu-open,.menu-close { display: none; }

    main { max-width: 1550px; margin: auto; padding: 32px 32px 26px; }
    .welcome { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 28px; }
    h1 { font-size: clamp(30px,3vw,39px); font-weight: 600; letter-spacing: -1.3px; line-height: 1.2; }
    .welcome p { color: var(--muted); font-size: 13px; margin-top: 8px; }
    .browser-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
    .browser-note .icon { width: 15px; height: 15px; }
    .dashboard { display: grid; grid-template-columns: minmax(0,1fr) 285px; gap: 25px; align-items: start; }
    h2 { font-size: 20px; font-weight: 600; letter-spacing: -.4px; }
    .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
    .section-heading span { color: var(--muted); font-size: 11px; }
    .game-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
    .game { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); transition: transform .25s,border-color .25s; }
    .game:hover { transform: translateY(-5px); border-color: var(--accent); }
    .art { height: 205px; padding: 20px; position: relative; overflow: hidden; display: flex; align-items: flex-end; isolation: isolate; }
    .art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(currentColor .7px,transparent .7px); background-size: 17px 17px; opacity: .1; z-index: -1; }
    .art-tag { position: absolute; top: 13px; left: 13px; background: #ffffff20; padding: 5px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; backdrop-filter: blur(8px); z-index: 3; }
    .art-title { position: relative; z-index: 3; font-size: 29px; font-weight: 800; line-height: 1.05; letter-spacing: -.7px; }
    .art-title small { display: block; font: 500 11px "DM Sans",sans-serif; letter-spacing: 1.8px; margin-bottom: 7px; opacity: .8; }
    .illustration { position: absolute; width: 175px; height: 162px; top: 10px; left: calc(50% - 87.5px); }
    .traitors { background: #143c4a; color: #efe3ba; }
    .culture { background: #c9e8f2; color: #134a64; }
    .impostor { background: #274e66; color: #e0f0f5; }
    .geography { background: #bfe0d3; color: #234f48; }
    .potato { background: #f4d4aa; color: #5b3928; }
    .quiz-block { position: absolute; top: 38px; left: calc(50% - 40px); width: 80px; height: 83px; background: #00739b; color: #f1f8e8; border-radius: 18px; font: 800 67px/1 "Outfit",sans-serif; display: grid; place-items: center; transform: rotate(12deg); box-shadow: 7px 8px 0 #134a6415; }
    .quiz-bubble { position: absolute; top: 30px; right: 20px; padding: 5px 9px; border-radius: 8px 8px 8px 0; background: #fffdf4; color: #174a60; font-size: 11px; font-weight: 700; transform: rotate(-8deg); }
    .spark { position: absolute; top: 63px; left: 25px; color: #00739b; font-size: 28px; }
    .game-body { padding: 17px; }
    .game-name { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
    .game-name h3 { font-size: 19px; font-weight: 600; letter-spacing: -.4px; }
    .category { font-size: 11px; padding: 3px 6px; border-radius: 5px; background: var(--soft); color: var(--muted); white-space: nowrap; }
    .game-body p { font-size: 12px; line-height: 1.65; color: var(--muted); margin-top: 9px; min-height: 60px; }
    .game-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 11px; margin: 15px 0; }
    .game-meta span { display: flex; align-items: center; gap: 5px; }
    .game-meta .icon { width: 14px; height: 14px; }
    .play-button { width: 100%; min-height: 41px; border: 0; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 7px; }
    .play-button .icon { width: 15px; height: 15px; }
    .collection-note { padding-top: 19px; font-size: 11px; color: var(--muted); }

    .room-column { position: sticky; top: 24px; }
    .room-area { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
    .room-top p { font-size: 12px; color: var(--muted); margin-top: 5px; }
    .tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: 10px; margin: 18px 0; }
    .tab { flex: 1; min-height: 35px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; transition: background .2s; }
    .tab:hover { color: var(--ink); }
    .tab[aria-selected="true"] { background: var(--raised); color: var(--ink); box-shadow: 0 2px 5px #00000015; }
    .field { margin-bottom: 15px; }
    .field label,.field-label { display: block; font-size: 11px; font-weight: 600; margin-bottom: 7px; }
    .text-input { width: 100%; min-height: 43px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--ink); padding: 11px 12px; font-size: 12px; }
    .text-input::placeholder { color: var(--muted); opacity: .85; }
    .code-input { font-family: "Outfit",sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 5px; }
    .action-button { width: 100%; min-height: 44px; border: 0; border-radius: 9px; background: var(--button); color: white; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px; font-weight: 600; }
    .action-button .icon { width: 16px; height: 16px; }
    .form-note { color: var(--muted); font-size: 11px; text-align: center; margin-top: 9px; }
    .aside-tip { display: flex; gap: 9px; padding: 20px 5px; font-size: 11px; line-height: 1.7; color: var(--muted); }
    .aside-tip > span { font-size: 20px; }
    .aside-tip strong { color: var(--ink); font-weight: 500; }
        .help { border-top: 1px solid var(--border); margin-top: 31px; padding-top: 23px; }
    .help-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 25px; margin-top: 17px; }
    .help-step { display: flex; align-items: flex-start; gap: 10px; }
    .step-number { flex-shrink: 0; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--soft); font: 12px "Outfit",sans-serif; }
    .help-step strong { font-size: 12px; font-weight: 600; }
    .help-step p { color: var(--muted); font-size: 11px; margin-top: 4px; }
    footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-top: 32px; color: var(--muted); font-size: 11px; }
    .backdrop { position: fixed; inset: 0; background: #000000a6; backdrop-filter: blur(3px); border: 0; z-index: 50; }
    .mobile-nav { display: none; }
    .reveal { animation: reveal .55s both; }
    .game:nth-child(2) { animation-delay: .06s; }
    .game:nth-child(3) { animation-delay: .12s; }
    .game:nth-child(4) { animation-delay: .18s; }
    .game:nth-child(5) { animation-delay: .24s; }
    @keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

    @media (min-width: 1530px) {
      .game-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    }
    @media (max-width: 1200px) {
      :root { --sidebar: 190px; }
      .brand { font-size: 20px; }
      .sidebar { padding-inline: 12px; }
      main,.topbar { padding-inline: 25px; }
      .dashboard { gap: 19px; grid-template-columns: minmax(0,1fr) 260px; }
      .game-grid { gap: 14px; }
      .game-name { flex-direction: column; align-items: flex-start; gap: 5px; }
      .game-body { padding: 15px; }
      .game-body p { min-height: 80px; }
      .art { padding: 17px; }
      .art-title { font-size: 26px; }
      .room-area { padding: 17px; }
    }
    @media (min-width: 761px) and (max-width: 1000px) {
      :root { --sidebar: 78px; }
      body:not(.rail-open) .sidebar { align-items: center; }
      body:not(.rail-open) :is(.brand > span:last-child,.nav-label,.nav-item > span,.sidebar-note,.theme-text,.switch) { display: none !important; }
      body:not(.rail-open) .side-nav { width: 100%; margin-top: 40px; }
      body:not(.rail-open) .nav-item { justify-content: center; padding: 13px; }
      body:not(.rail-open) .sidebar-bottom { width: 100%; }
      body:not(.rail-open) .theme-button { justify-content: center; }
      body:not(.rail-open) .sidebar-head { flex-direction: column; gap: 14px; }
      .rail-toggle { display: grid; }
      .browser-note { display: none; }
    }
    @media (max-width: 900px) {
      .dashboard { grid-template-columns: 1fr; gap: 25px; }
      .room-column { position: static; grid-row: 1; }
      .room-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
      .tabs { min-width: 230px; margin: 0; }
      .room-form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 15px; margin-top: 19px; }
      .avatar-group { grid-column: 1; }
      .submit-group { grid-column: 2; align-self: end; }
      .aside-tip { display: none; }
      .game-name { flex-direction: row; align-items: center; }
      .game-body p { min-height: 60px; }
      .art { height: 220px; }
    }
    @media (max-width: 760px) {
      :root { --sidebar: 258px; }
      .sidebar { transform: translateX(-100%); transition: transform .25s ease; padding: 23px 18px; }
      body.menu-visible .sidebar { transform: translateX(0); }
      body.menu-visible { overflow: hidden; }
      .menu-open,.menu-close { display: grid; }
      .menu-close { width: 32px; height: 32px; }
      .app { margin-left: 0; }
      .topbar { height: 68px; padding-inline: 20px; background: var(--surface); }
      .breadcrumb { font-family: "Outfit",sans-serif; font-size: 19px; font-weight: 700; color: var(--ink); }
      .desktop-crumb,.profile > span:last-child,.browser-note { display: none; }
      main { padding: 26px 20px 95px; }
      .mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 8px max(8px,env(safe-area-inset-bottom)); z-index: 40; }
      .mobile-nav a,.mobile-nav button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 6px 12px; background: transparent; color: var(--muted); border: 0; border-radius: 10px; font-size: 11px; }
      .mobile-nav .active { color: var(--accent); background: var(--accent-soft); }
    }
    @media (max-width: 540px) {
      .topbar { padding-inline: 16px; }
      .topbar-left { gap: 9px; }
      .preview-label { display: none; }
      main { padding-inline: 16px; }
      h1 { font-size: 31px; }
      .welcome p { font-size: 12px; max-width: 285px; line-height: 1.7; }
      .room-top { display: block; }
      .room-top h2 { font-size: 19px; }
      .tabs { margin-top: 15px; }
      .room-form { gap: 0 10px; margin-top: 16px; }
      .action-button { font-size: 11px; gap: 5px; min-height: 41px; }
      .form-note { font-size: 11px; }
      .game-grid { gap: 12px; }
      .art { height: 182px; padding: 13px; }
      .art-tag { font-size: 11px; top: 10px; left: 10px; padding: 4px 6px; }
      .art-title { font-size: 22px; }
      .art-title small { font-size: 11px; letter-spacing: .9px; }
      .illustration { width: 138px; height: 140px; left: calc(50% - 69px); top: 5px; }
      .quiz-block { top: 39px; width: 64px; height: 69px; font-size: 54px; left: calc(50% - 32px); }
      .quiz-bubble { top: 24px; right: 10px; padding: 4px 6px; font-size: 11px; }
      .spark { left: 12px; font-size: 23px; }
      .game-body { padding: 12px; }
      .game-name { flex-direction: column; align-items: flex-start; }
      .game-name h3 { font-size: 17px; }
      .category { font-size: 11px; }
      .game-body p { font-size: 11px; min-height: 92px; }
      .game-meta { flex-direction: column; gap: 6px; margin: 12px 0; }
      .play-button { font-size: 11px; gap: 5px; }
      .play-button .icon { width: 12px; height: 12px; }
      .help-steps { grid-template-columns: 1fr; gap: 16px; }
      footer { line-height: 1.7; }
    }
    @media (max-width: 360px) {
      .game-grid { grid-template-columns: 1fr; }
      .art { height: 205px; }
      .art-title { font-size: 29px; }
      .illustration { width: 175px; height: 165px; left: calc(50% - 87.5px); }
      .game-name { flex-direction: row; align-items: center; }
      .game-body p { min-height: 0; }
      .game-meta { flex-direction: row; gap: 12px; }
      .room-form { grid-template-columns: 1fr; }
      .avatar-group,.submit-group { grid-column: 1; }
      .submit-group { margin-top: 16px; }
    }
    @media (prefers-reduced-motion: reduce) {
      *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    }

    /* ───── Écran de la room ───── */
    .room-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
    .room-game { font-size: clamp(26px,3vw,34px); font-weight: 700; letter-spacing: -.8px; }
    .room-code-box { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 16px; border-radius: 9px; background: var(--accent-soft); }
    .room-kicker { font-size: 11px; letter-spacing: 3px; color: var(--muted); }
    .room-code { font: 800 28px/1.1 "Outfit",sans-serif; letter-spacing: 5px; color: var(--accent); }
    .room-head-actions { align-items: stretch; margin-left: auto; justify-content: flex-end; }
    .room-status { color: var(--muted); font-size: 13px; margin-top: 4px; }
    .room-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
    .room-head-actions .play-button { width: auto; padding: 0 16px; font-size: 12px; }
    .room-message { min-height: 20px; font-size: 13px; color: var(--accent); margin-bottom: 10px; }
    .room-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 25px; align-items: start; }
    .player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
    .player { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--soft); flex-wrap: wrap; }
    .player.offline { opacity: .55; }
    .player-avatar { font-size: 24px; width: 34px; text-align: center; }
    .player-name { font-weight: 600; font-size: 14px; flex: 1; min-width: 100px; overflow-wrap: anywhere; }
    .badge { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--raised); color: var(--muted); white-space: nowrap; }
    .badge.host { background: var(--accent-soft); color: var(--accent); }
    .player-actions { display: flex; gap: 6px; flex-wrap: wrap; }
    .player-actions button { min-height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 11px; }
    .player-actions button:hover { background: var(--raised); }
    .player-actions .danger { color: #e5484d; }
    .game-placeholder { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
    .host-panel h2 { margin-bottom: 16px; }
    select.text-input { appearance: auto; }
    .check { display: flex; align-items: center; gap: 9px; font-size: 12px; margin-bottom: 16px; cursor: pointer; }
    .check input { width: 18px; height: 18px; accent-color: var(--button); }
    .host-buttons { display: grid; gap: 8px; }
    @media (max-width: 900px) {
      .room-layout { grid-template-columns: 1fr; }
    }
    @media (max-width: 540px) {
      .room-head-actions, .room-head-actions .play-button { width: 100%; }
      .room-code-box { width: 100%; flex-direction: row; gap: 12px; padding: 8px; }
    }


    /* Meme du patron : le GIF apparaît au survol (ou au toucher) de « C’est moiii ». */
    .boss-me { position: relative; cursor: help; border-bottom: 2px dotted var(--accent); }
    .boss-gif { position: absolute; left: 0; top: calc(100% + 8px); width: 220px; height: auto; border-radius: 12px; box-shadow: var(--shadow); z-index: 20; display: none; }
    .boss-me:hover .boss-gif, .boss-me:focus .boss-gif { display: block; }
    @media (prefers-reduced-motion: reduce) { .boss-me:hover .boss-gif, .boss-me:focus .boss-gif { display: none; } }
    .card-credit { margin-top: 10px; font-size: 11px; line-height: 1.4; color: var(--muted); opacity: .75; }
    /* Étiquettes empilées sous le nom du jeu (alignées comme le nom selon la largeur d'écran). */
    .categories { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
    .friendship-killer { background: #e5484d22; color: #e5484d; }
    @media (max-width: 1200px) { .categories { align-items: flex-start; } }
    @media (max-width: 900px) { .categories { align-items: flex-end; } }
    @media (max-width: 540px) { .categories { align-items: flex-start; } }
    @media (max-width: 360px) { .categories { align-items: flex-end; } }
    /* ───── Chat ───── */
    .room-main { display: grid; gap: 25px; min-width: 0; }
    .chat-log { list-style: none; margin: 0 0 12px; padding: 4px; height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--bg); border-radius: 12px; }
    .chat-empty { margin: auto; color: var(--muted); font-size: 13px; text-align: center; }
    .msg { display: flex; gap: 9px; padding: 6px 8px; border-radius: 10px; }
    .msg:hover { background: var(--soft); }
    .msg-avatar { font-size: 22px; line-height: 1.2; }
    .msg-body { min-width: 0; flex: 1; }
    .msg-head { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
    .msg-head strong { font-size: 13px; }
    .msg.mine .msg-head strong { color: var(--accent); }
    .msg-head time { color: var(--muted); font-size: 11px; }
    .msg-text { font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
    .msg-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
    .msg-tools button { min-height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--ink); font-size: 12px; }
    .msg-tools button.empty { opacity: 0; }
    .msg:hover .msg-tools button.empty, .msg:focus-within .msg-tools button.empty { opacity: .6; }
    .msg-tools button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
    .msg-tools .report { margin-left: auto; color: var(--muted); }
    @media (hover: none) { .msg-tools button.empty { opacity: .45; } }
    .chat-form { position: relative; display: flex; gap: 8px; }
    .chat-form .text-input { flex: 1; min-width: 0; }
    .chat-send { width: 48px; flex-shrink: 0; }
    .chat-form .icon-button { width: 44px; height: auto; font-size: 20px; }
    .emoji-panel { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 10; display: grid; grid-template-columns: repeat(8, 36px); gap: 4px; padding: 8px; background: var(--raised); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
    .emoji-panel button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 20px; }
    .emoji-panel button:hover { background: var(--accent-soft); }
    .report-dialog { max-width: min(460px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--ink); padding: 22px; }
    .report-dialog::backdrop { background: #000000a6; }
    .report-quote { margin: 12px 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
    .report-reasons { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; font-size: 13px; }
    .report-reasons legend { font-weight: 600; margin-bottom: 8px; }
    .report-reasons label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
    .report-note { font-size: 11px; color: var(--muted); margin-bottom: 14px; }
    .dialog-buttons { display: flex; gap: 10px; justify-content: flex-end; }
    .dialog-buttons button { width: auto; padding: 0 18px; }
    @media (max-width: 540px) { .emoji-panel { grid-template-columns: repeat(6, 36px); } .chat-log { height: 300px; } }
    .host-panel { position: relative; }
    .host-panel h2 { padding-right: 44px; }
    .boss-crown { position: absolute; top: -18px; right: 16px; font-size: 40px; transform: rotate(14deg); filter: drop-shadow(0 4px 6px #00000040); pointer-events: none; }
    /* ───── Jeu : Imposteur ───── */
    .game-paused { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-bottom: 12px; }
    .imp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
    .imp-timer { font: 700 18px "Outfit",sans-serif; color: var(--accent); }
    .imp-layout { display: grid; grid-template-columns: minmax(0,1fr) 200px; gap: 20px; align-items: start; }
    .imp-body { display: grid; gap: 12px; min-width: 0; }
    .imp-say { font-size: 14px; }
    .imp-say.big { font: 600 18px/1.4 "Outfit",sans-serif; }
    .imp-say.good { color: #30a46c; }
    .imp-say.bad { color: #e5484d; }
    .imp-sub { font-size: 12px; color: var(--muted); }
    .imp-secret { display: grid; gap: 8px; }
    .imp-role { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
    .imp-role.bad { font: 700 20px "Outfit",sans-serif; text-transform: none; letter-spacing: 0; color: #e5484d; }
    .imp-word { font: 800 30px "Outfit",sans-serif; color: var(--accent); margin: 4px 0; overflow-wrap: anywhere; }
    .imp-hold { user-select: none; -webkit-user-select: none; touch-action: none; }
    .imp-form { display: flex; gap: 8px; }
    .imp-form .text-input { flex: 1; min-width: 0; }
    .imp-form .action-button { width: auto; padding: 0 16px; }
    .imp-clues, .imp-scores { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
    .imp-clues li, .imp-scores li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px; background: var(--soft); font-size: 13px; }
    .imp-clues li.muted strong { color: var(--muted); font-weight: 500; }
    .imp-scores li.me { outline: 1px solid var(--accent); }
    .imp-scores.podium li { font-size: 16px; padding: 12px 14px; }
    .imp-side h3 { font-size: 14px; margin-bottom: 8px; }
    .imp-vote { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
    .imp-vote .play-button[aria-pressed="true"] { background: var(--button); color: white; }
    @media (max-width: 700px) { .imp-layout { grid-template-columns: 1fr; } }
    /* ───── Animations des jeux (coupées par la règle « moins d'animations » en haut du fichier) ───── */
    @keyframes imp-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
    @keyframes imp-slide { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
    @keyframes imp-zoom { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.06); } 100% { transform: scale(1); } }
    @keyframes imp-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
    @keyframes imp-glow { 0%, 100% { box-shadow: 0 0 0 0 #7ea6ff80; } 50% { box-shadow: 0 0 0 7px #7ea6ff00; } }
    @keyframes imp-float { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px); } }
    @keyframes imp-fall { from { transform: translateY(-10vh) rotate(0); } to { transform: translateY(110vh) rotate(720deg); } }
    @keyframes imp-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
    @keyframes imp-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }

    .imp-enter > * { animation: imp-in .45s both; }
    .imp-enter > *:nth-child(2) { animation-delay: .06s; }
    .imp-enter > *:nth-child(3) { animation-delay: .12s; }
    .imp-enter > *:nth-child(4) { animation-delay: .18s; }
    .imp-enter > *:nth-child(n+5) { animation-delay: .24s; }
    .imp-reveal { animation: imp-in .5s both !important; }
    .imp-verdict.imp-reveal { animation-name: imp-zoom !important; animation-duration: .7s !important; }
    .imp-new { animation: imp-slide .4s both; }
    .imp-myturn { animation: imp-wiggle .5s 2; }
    .imp-timer.hurry { color: #e5484d; animation: imp-pulse 1s infinite; display: inline-block; }

    /* Carte secrète qui se retourne en 3D */
    .imp-card { perspective: 900px; }
    .imp-card-inner { display: grid; min-height: 130px; transition: transform .5s cubic-bezier(.2,.8,.2,1.2); transform-style: preserve-3d; }
    .imp-card.shown .imp-card-inner { transform: rotateY(180deg); }
    .imp-card-back, .imp-card-front { grid-area: 1 / 1; padding: 16px; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; align-content: center; }
    .imp-card-back { place-items: center; gap: 4px; color: #e0f0f5; background: repeating-linear-gradient(45deg, #274e66 0 12px, #2e5a75 12px 24px); border: 2px solid #3d7180; }
    .imp-card-back span { font: 800 40px/1 "Outfit",sans-serif; color: #ffd36b; }
    .imp-card-back strong { font: 600 14px "Outfit",sans-serif; }
    .imp-card-front { transform: rotateY(180deg); background: var(--soft); border: 2px solid var(--accent); }

    /* Ordre de parole en pastilles, l'orateur pulse */
    .imp-order { display: flex; flex-wrap: wrap; gap: 6px; }
    .imp-chip { padding: 5px 10px; border-radius: 20px; background: var(--soft); font-size: 12px; color: var(--muted); transition: background .3s, color .3s; }
    .imp-chip.speaking { background: var(--accent-soft); color: var(--accent); font-weight: 700; animation: imp-glow 1.4s infinite; }

    /* Vote */
    .imp-pop > * { animation: imp-zoom .4s both; }
    .imp-vote .play-button { transition: transform .15s, background .2s; }
    .imp-vote .play-button:hover { transform: translateY(-2px); }
    .imp-vote .play-button[aria-pressed="true"] { transform: scale(1.04); }
    .imp-progress { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
    .imp-progress i { display: block; height: 100%; background: var(--button); transition: width .4s ease; }

    /* Points gagnés et confettis */
    .imp-scores strong { position: relative; }
    .imp-plus { position: absolute; right: 0; top: -14px; color: #30a46c; font-size: 13px; animation: imp-float 1.8s both; }
    .imp-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
    .imp-confetti i { position: absolute; top: 0; width: 8px; height: 14px; border-radius: 2px; animation: imp-fall linear both; }

    /* Podium de fin */
    .imp-podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; margin: 8px 0 16px; }
    .imp-step { display: grid; justify-items: center; gap: 2px; text-align: center; animation: imp-in .6s both; }
    .imp-step strong { font-size: 14px; overflow-wrap: anywhere; }
    .imp-step span { font-size: 12px; color: var(--muted); }
    .imp-step .imp-step-face { font-size: 34px; color: inherit; }
    .imp-step-block { width: 100%; margin-top: 6px; border-radius: 10px 10px 0 0; display: grid; place-items: start center; padding-top: 8px; font-size: 26px; transform-origin: bottom; animation: imp-rise .7s both; animation-delay: inherit; }
    .imp-step.rank1 .imp-step-block { height: 120px; background: linear-gradient(#ffd36b, #c9a227); }
    .imp-step.rank2 .imp-step-block { height: 85px; background: linear-gradient(#e5e7eb, #9ca3af); }
    .imp-step.rank3 .imp-step-block { height: 60px; background: linear-gradient(#f4b183, #b0703c); }
    /* ───── Disposition de la room : jeu à gauche, chat à droite ───── */
    .room-layout { grid-template-columns: minmax(0,1fr) 340px; }
    .room-side { display: grid; gap: 25px; align-content: start; position: sticky; top: 16px; }
    .room-side .chat-log { height: min(52vh, 460px); }
    .host-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }
    .host-strip > span { margin-right: auto; }
    .host-strip .play-button { width: auto; padding: 0 14px; min-height: 36px; background: var(--surface); }
    @media (max-width: 900px) {
      /* Sur téléphone : le jeu, puis le chat, puis les joueurs. */
      .room-main, .room-side { display: contents; }
      .room-layout { display: grid; grid-template-columns: 1fr; gap: 18px; }
      .host-strip { order: 0; } .host-panel { order: 1; } .game-area { order: 2; } .chat { order: 3; } .players-area { order: 4; }
      .room-side .chat-log { height: 300px; }
    }
    /* ───── Imposteur : plateau en colonnes ───── */
    @keyframes imp-dropin { from { opacity: 0; transform: translateY(-18px) scale(.6); } to { opacity: 1; transform: none; } }
    @keyframes imp-cardflip { from { opacity: 0; transform: perspective(700px) rotateY(90deg); } to { opacity: 1; transform: none; } }
    .imp-top { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
    .imp-status { display: grid; gap: 8px; align-content: start; }
    .imp-mycard { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--soft); border: 2px solid var(--accent); }
    .imp-mycard span { font-size: 12px; color: var(--muted); }
    .imp-mycard .imp-word { margin: 0; }
    .imp-word.bad { color: #e5484d; font-size: 22px; }
    .imp-flip { animation: imp-cardflip .7s both; }
    .imp-board { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
    .imp-col { flex: 1 0 118px; max-width: 170px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 14px; background: var(--soft); text-align: center; scroll-snap-align: start; transition: background .3s, outline-color .3s; outline: 2px solid transparent; }
    .imp-col.speaking { outline-color: var(--accent); animation: imp-glow 1.4s infinite; }
    .imp-col.voted { outline-color: var(--button); }
    .imp-col.out { background: #e5484d22; outline-color: #e5484d; }
    .imp-col.me .imp-col-name { color: var(--accent); }
    .imp-col-face { font-size: 40px; line-height: 1.1; }
    .imp-col.speaking .imp-col-face { animation: imp-pulse 1.2s infinite; }
    .imp-col-name { font-size: 14px; overflow-wrap: anywhere; }
    .imp-col-pts { position: relative; font-size: 11px; color: var(--muted); }
    .imp-col-pts .imp-plus { right: -26px; top: -6px; }
    .imp-col-clues { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; width: 100%; }
    .imp-col-clues li { font-size: 13px; font-weight: 600; padding: 4px 6px; border-radius: 8px; background: var(--surface); overflow-wrap: anywhere; }
    .imp-col-clues li.muted { color: var(--muted); font-weight: 400; }
    .imp-col-votes { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 30px; width: 100%; padding: 4px; border-radius: 8px; background: var(--bg); }
    .imp-voter { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: var(--raised); font-size: 15px; }
    .imp-drop { animation: imp-dropin .45s both; }
    .imp-col-vote { margin-top: auto; min-height: 36px; font-size: 12px; }
    .imp-col-vote[aria-pressed="true"] { background: #30a46c; }
    .imp-col-role { width: 100%; display: grid; gap: 2px; padding: 6px; border-radius: 8px; font-size: 12px; }
    .imp-col-role.crew { background: #30a46c22; color: #30a46c; }
    .imp-col-role.impostor { background: #e5484d22; color: #e5484d; }
    .imp-col-role.ghost { background: #c6a8ff33; color: #9b7be0; }
    @media (max-width: 700px) { .imp-top { grid-template-columns: 1fr; } .imp-col { flex-basis: 104px; } }
    /* Menu déroulant « Joueurs » dans la barre du patron */
    .host-strip { position: relative; }
    .strip-players { position: static; }
    .strip-players summary { list-style: none; width: auto; padding: 0 14px; min-height: 36px; background: var(--surface); }
    .strip-players summary::-webkit-details-marker { display: none; }
    .strip-players-box { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; max-height: 60vh; overflow-y: auto; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 18px 40px #00000055; color: var(--ink); font-weight: 400; }

    /* Imposteur : ta carte centrée au-dessus du plateau */
    .imp-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .imp-mycard { width: min(100%, 460px); justify-items: center; text-align: center; }
    .imp-mycard .imp-word { font-size: 38px; }
    .imp-status { justify-items: center; width: 100%; }
    .imp-form { width: min(100%, 460px); }
    .imp-status > .play-button, .imp-status > .action-button { width: min(100%, 460px); }
    /* Chat replié en bulle pendant la partie */
    .chat-close { display: none; width: 32px; height: 32px; margin-left: 8px; }
    .chat-bubble { position: fixed; right: 22px; bottom: 22px; z-index: 46; width: 58px; height: 58px; border: 0; border-radius: 50%; background: var(--button); color: white; font-size: 26px; box-shadow: 0 10px 28px #00000066; transition: transform .2s; }
    .chat-bubble:hover { transform: scale(1.08); }
    .chat-unread { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: #e5484d; color: white; font: 700 12px/22px "DM Sans",sans-serif; animation: imp-pulse 1.2s infinite; }
    body.in-game .room-layout { grid-template-columns: minmax(0, 1fr); }
    body.in-game .room-side { position: static; }
    body.in-room .chat { display: none; position: fixed; right: 22px; bottom: 92px; z-index: 45; width: min(380px, calc(100vw - 32px)); box-shadow: 0 18px 48px #00000077; animation: imp-in .25s both; }
    body.in-room.chat-open .chat { display: block; }
    body.in-room .chat .chat-log { height: min(45vh, 360px); }
    body.in-room .chat-close { display: grid; }
    body.in-room .chat-motto { display: none; }
    @media (max-width: 760px) {
      .chat-bubble { bottom: 86px; right: 16px; }
      body.in-room .chat { bottom: 156px; right: 16px; }
    }
    /* ───── Imposteur, déroulé KCorp : mot en grand, plateau, zone d'action en bas ───── */
    .imp-head { margin-bottom: 6px; }
    .imp-top { display: grid; justify-items: center; text-align: center; gap: 8px; margin-bottom: 18px; }
    .imp-bigword { display: grid; justify-items: center; gap: 4px; }
    .imp-bigword strong { font: 800 clamp(34px, 5vw, 56px)/1.05 "Outfit",sans-serif; color: var(--accent); letter-spacing: -1px; text-transform: uppercase; overflow-wrap: anywhere; }
    .imp-bigword.ghost strong { color: #9b7be0; text-transform: none; font-size: clamp(26px, 4vw, 40px); }
    .imp-bigword span { font-size: 12px; color: var(--muted); }
    .imp-turn { font: 600 18px "Outfit",sans-serif; }
    .imp-reveal-lines { display: grid; gap: 4px; font-size: 15px; }
    .imp-reveal-lines strong { font-family: "Outfit",sans-serif; }
    .imp-reveal-lines strong.good { color: #30a46c; }
    .imp-reveal-lines strong.bad { color: #e5484d; }
    .imp-bottom { display: grid; justify-items: center; gap: 8px; margin-top: 16px; text-align: center; }
    .imp-bottom > .play-button, .imp-bottom > .action-button { width: min(100%, 320px); }
    .imp-count { font-size: 11px; color: var(--muted); }
    .imp-voter.pending { background: #e5484d; }
    .imp-voter.locked { background: #30a46c; }
    .imp-col-ghost { min-height: 32px; font-size: 11px; width: 100%; }
    .imp-col-ghost.picked { display: block; padding: 6px; border-radius: 8px; background: #c6a8ff33; color: #9b7be0; font-weight: 600; }
    .imp-col-score { font: 800 24px "Outfit",sans-serif; }
    .imp-col-gain { font-size: 11px; font-weight: 600; color: #30a46c; line-height: 1.3; }
    .imp-lock:disabled { opacity: .5; }
    /* ───── Avatars dessinés (Toon Head, CC BY 4.0) ───── */
    .face { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 22%; user-select: none; }
    .face.emoji { display: grid; place-items: center; border-radius: 0; }
    .face.small { display: inline-block; width: 22px; height: 22px; vertical-align: middle; margin-right: 6px; }
    .profile-avatar { overflow: hidden; padding: 0; }
    .profile-avatar .face.emoji { font-size: 21px; }
    .player-avatar { width: 38px; height: 38px; font-size: 24px; display: grid; place-items: center; }
    .msg-avatar { width: 32px; height: 32px; flex-shrink: 0; font-size: 22px; display: grid; place-items: center; }
    .imp-col-face { width: 64px; height: 64px; display: grid; place-items: center; font-size: 40px; }
    .imp-voter { width: 30px; height: 30px; padding: 2px; overflow: hidden; }
    .imp-voter .face { border-radius: 6px; }
    .imp-step-face { width: 64px; height: 64px; display: grid; place-items: center; font-size: 40px; }
    .imp-inline { display: inline-flex; align-items: center; }
    .credits { font-size: 11px; color: var(--muted); }
    .credits a { text-decoration: underline; }
    /* ───── Retours d'Yvan 28/11 : menu caché en partie, joueurs centrés, indices plus gros ───── */
    /* Room et page « Jouer » (Yvan 29/11) : menu replié en icônes (comme l'écran moyen), en-tête et commandes de la room cachés */
    @media (min-width: 761px) {
      body:is(.in-room, [data-page="play"]) { --sidebar: 78px; }
      body:is(.in-room, [data-page="play"]):not(.rail-open) .sidebar { align-items: center; padding-inline: 12px; }
      body:is(.in-room, [data-page="play"]):not(.rail-open) :is(.brand > span:last-child,.nav-label,.nav-item > span,.sidebar-note,.theme-text,.switch) { display: none !important; }
      body:is(.in-room, [data-page="play"]):not(.rail-open) .side-nav { width: 100%; margin-top: 40px; }
      body:is(.in-room, [data-page="play"]):not(.rail-open) .nav-item { justify-content: center; padding: 13px; }
      body:is(.in-room, [data-page="play"]):not(.rail-open) .sidebar-bottom { width: 100%; }
      body:is(.in-room, [data-page="play"]):not(.rail-open) .theme-button { justify-content: center; }
      body:is(.in-room, [data-page="play"]):not(.rail-open) .sidebar-head { flex-direction: column; gap: 14px; }
      body:is(.in-room, [data-page="play"]) .rail-toggle { display: grid; }
    }
    body.in-game .topbar, body.in-game .room-head > div:first-child, body.in-game .room-head-actions > :not(#leave-room, .room-bug) { display: none; }
    body.in-game main { padding-top: 14px; }
    body.in-game .room-head { margin-bottom: 8px; }
    body.in-game .room-head-actions, body.in-game #leave-room { width: auto; }
    body.in-game #leave-room { min-height: 34px; }
    .imp-col:first-child { margin-left: auto; } /* centre les colonnes sans casser le défilement */
    .imp-col:last-child { margin-right: auto; }
    .imp-col { max-width: 200px; }
    .imp-col-clues { gap: 6px; }
    .imp-col-clues li { font-size: 18px; font-weight: 700; padding: 7px 8px; line-height: 1.25; }
    .imp-col-clues li.muted { font-size: 14px; }
    @media (max-width: 700px) { .imp-col-clues li { font-size: 16px; } }
    /* ───── Bouton « Signaler un bug » ───── */
    .bug-button { width: 100%; border: 0; background: transparent; cursor: pointer; margin-bottom: 8px; }
    .bug-emoji { font-weight: 400; font-size: 16px; line-height: 1; }
    #bug-text { resize: vertical; font: inherit; margin: 8px 0; }

    @keyframes neon-jelly { 30% { transform: scale(1.1, .9) translateY(3px); } 60% { transform: scale(.95, 1.07) translateY(-5px); } }

    /* ═════════ Salon de la room (demande d'Yvan du 28/11) : 3 colonnes dans la hauteur de l'écran ═════════
       joueurs (étroit) · réglages du patron au centre · chat ; pas de barre du haut, le moins de défilement possible. */
    body.in-room .topbar { display: none; }
    body.in-room main { padding-top: 16px; padding-bottom: 12px; }
    body.in-room .room-head { margin-bottom: 10px; gap: 12px; }
    body.in-room .room-game { font-size: 24px; }
    body.in-room .room-status { margin-top: 0; font-size: 12px; }
    body.in-room .room-code-box { flex-direction: row; gap: 10px; padding: 4px 12px; }
    body.in-room .room-code { font-size: 22px; }
    body.in-room .room-head-actions .play-button { min-height: 38px; }
    body.in-room .room-message { min-height: 0; margin-bottom: 6px; }
    body.in-room .room-message:empty { display: none; }
    .player-menu { position: relative; margin-left: auto; }
    .player-menu summary { list-style: none; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-weight: 800; color: var(--muted); }
    .player-menu summary::-webkit-details-marker { display: none; }
    .player-menu summary:hover, .player-menu[open] summary { background: var(--accent-soft); color: var(--accent); }
    .player-menu .player-actions { position: absolute; right: 0; top: 34px; z-index: 30; display: grid; gap: 4px; min-width: 170px; padding: 6px;
      background: var(--raised); border: 2px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
    .player-menu .player-actions button { width: 100%; text-align: left; }
    .waiting-panel { text-align: center; display: grid; place-items: center; align-content: center; gap: 10px; }
    .waiting-emoji { font-size: 54px; display: inline-block; animation: neon-jelly 1.8s ease-in-out infinite; }
    .waiting-panel h2 { font-family: "Bungee", sans-serif; font-size: 26px; color: var(--accent); text-shadow: 0 0 14px rgb(0 217 255 / var(--glow)); }
    .waiting-panel p { color: var(--muted); }
    /* Barre du haut (VicTeams / Gaming zone, BÊTA, profil) retirée partout sur PC et tablette (Yvan 28/11).
       Sur téléphone elle reste : elle porte le bouton du menu. */
    @media (min-width: 761px) { .topbar { display: none; } main { padding-top: 22px; } }

    /* ═════════ Épuration (tablette d'Yvan 28/11 : 853 × ~480 px utiles) ═════════ */
    /* Dans une room : menu de gauche réduit en icônes (Yvan 29/11), pas de pied de page ; sur téléphone, menu dans ☰. */
    body.in-room footer { display: none; }
    @media (min-width: 761px) {
      body:is(.in-room, [data-page="play"]):not(.rail-open) .sub-nav { margin: 2px 0; padding: 0; border: 0; }
      body:is(.in-room, [data-page="play"]):not(.rail-open) .sub-item { justify-content: center; }
      body:is(.in-room, [data-page="play"]):not(.rail-open) .socials { gap: 4px; }
      body:is(.in-room, [data-page="play"]):not(.rail-open) .social { width: 26px; height: 26px; }
    }
    body.in-room .room-head-actions .room-bug { width: 42px; padding: 0; font-size: 16px; }
    /* Room sur tablette : en-tête et champs plus compacts. */
    @media (min-width: 761px) and (max-width: 1279px) {
      body.in-room .text-input { min-height: 38px; padding: 7px 10px; }
      body.in-room main { padding: 10px 16px; }
      body.in-room .room-head { margin-bottom: 8px; }
      body.in-room .room-head-actions .play-button { min-height: 36px; padding: 0 12px; }
    }
    /* Écran peu haut (tablette à l'horizontale) : plateau de jeu plus compact. */
    @media (max-height: 700px) {
      body.in-game main { padding-top: 8px; }
      body.in-game .game-area { padding: 12px 16px; }
      body.in-game .imp-head { margin-bottom: 0; }
      body.in-game .imp-top { gap: 2px; margin-bottom: 10px; }
      body.in-game .imp-bigword strong { font-size: clamp(30px, 4vw, 42px); }
      body.in-game .imp-bigword:not(.ghost) > :not(strong) { display: none; }
      body.in-game .imp-turn { font-size: 16px; }
      body.in-game .imp-col { padding: 8px 6px; gap: 4px; }
      body.in-game .imp-col-face { width: 48px; height: 48px; font-size: 32px; }
      body.in-game .imp-col-clues li { font-size: 15px; padding: 4px 6px; }
    }
    /* Tablette : en-tête de la room sur une seule ligne (boutons en icônes), titre du patron sur une ligne. */
    @media (min-width: 761px) and (max-width: 1279px) {
      body.in-room .room-head { flex-wrap: nowrap; }
      body.in-room .room-status { display: none; }
      body.in-room .room-head-actions { flex-wrap: nowrap; }
      body.in-room .room-head-actions .play-button span { display: none; }
      body.in-room .room-head-actions .play-button { width: 42px; padding: 0; font-size: 16px; }
      body.in-room .room-code-box { padding: 2px 10px; }
      body.in-room .room-kicker { display: none; }
    }
    /* Pendant qu'on tape son indice sur un écran peu haut (clavier de tablette/téléphone ouvert) :
       on cache tout le superflu et on met la case juste sous le mot, les indices des autres en dessous. */
    @media (max-height: 560px) {
      body:has(#imp-clue:focus) :is(.room-head, .host-strip, .imp-head, .chat-bubble, .imp-turn, .imp-count) { display: none; }
      body:has(#imp-clue:focus) main { padding-top: 4px; }
      body:has(#imp-clue:focus) .game-area { display: flex; flex-direction: column; padding: 8px 12px; }
      body:has(#imp-clue:focus) .imp-top { order: 1; margin-bottom: 6px; }
      body:has(#imp-clue:focus) .imp-bigword strong { font-size: 26px; }
      body:has(#imp-clue:focus) .imp-bottom { order: 2; margin-bottom: 8px; }
      body:has(#imp-clue:focus) .imp-board { order: 3; }
      body:has(#imp-clue:focus) .imp-col-face { width: 34px; height: 34px; font-size: 22px; }
      body:has(#imp-clue:focus) .imp-col { padding: 6px 4px; }
    }
    /* Bouton « Quitter » : jamais écrasé, texte visible pendant la partie (Yvan 28/11, tablette). */
    body.in-room .room-head-actions #leave-room, body.in-room .room-head-actions .room-bug { min-height: 40px; flex-shrink: 0; }
    body.in-game .room-head-actions #leave-room { width: auto; padding: 0 16px; font-size: 12px; }
    body.in-game .room-head-actions #leave-room span { display: inline; }

    /* ═════════ Épuré (Yvan 28/11) : thème d'origine, sans les petits textes d'ambiance ═════════ */
    .waiting-panel h2 { font-family: "Outfit", sans-serif; text-shadow: none; }

    /* ═════════ Accueil : les jeux en pleine largeur ; le formulaire s'ouvre en fenêtre après le clic sur un jeu ═════════ */
    #home .dashboard { grid-template-columns: minmax(0, 1fr); }
    #home .game-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
    #home .room-column { display: none; }
    /* Pages (Yvan 29/11) : accueil / « Jouer » (formulaire en page, plus en fenêtre) / page d'un jeu */
    body[data-page="play"] #home > :not(.dashboard), body[data-page="play"] #jeux,
    body[data-page="game"] #home > :not(.game-page) { display: none; }
    body[data-page="play"] #home .room-column { display: grid; gap: 16px; position: static; width: min(460px, 100%); margin: 8px auto 0; animation: imp-in .2s both; }
    .back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
    .back-link:hover { color: var(--accent); }
    .game.clickable { cursor: pointer; }
    .game .play-button:disabled { pointer-events: none; }
    .game-page { max-width: 980px; margin: 0 auto; animation: imp-in .2s both; }
    .game-page-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 26px; align-items: start; }
    .game-page-art .art { border-radius: 14px; min-height: 300px; }
    .game-page h1 { font-family: "Outfit", sans-serif; font-size: 30px; margin-bottom: 10px; }
    .game-page h2 { font-size: 16px; margin: 20px 0 10px; }
    .game-page .categories { display: flex; flex-wrap: wrap; gap: 6px; }
    .game-page-pitch { color: var(--muted); margin: 12px 0; font-size: 14px; }
    .game-rules { display: grid; gap: 10px; padding-left: 20px; font-size: 14px; line-height: 1.5; }
    .game-page-play { margin-top: 22px; width: 100%; justify-content: center; }
    .game-page-play.disabled { opacity: .5; cursor: not-allowed; }
    @media (max-width: 760px) { .game-page-card { grid-template-columns: 1fr; } .game-page-art .art { min-height: 220px; } }
    /* Menu « Jeux » dépliable */
    .nav-group > summary { cursor: pointer; list-style: none; }
    .nav-group > summary::-webkit-details-marker { display: none; }
    .nav-arrow { transition: transform .2s; }
    .nav-group[open] .nav-arrow { transform: rotate(180deg); }
    .sub-nav { display: grid; gap: 2px; margin: 2px 0 4px 14px; padding-left: 8px; border-left: 1px solid var(--border); }
    .sub-item { min-height: 38px; padding: 8px 10px; font-size: 12.5px; }
    .sub-emoji { width: 20px; text-align: center; font-size: 15px; }
    /* Réseaux sociaux (sous Clair/Sombre) */
    .socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 10px; }
    .social { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: var(--soft); color: var(--muted); transition: background .2s, color .2s; }
    .social svg { width: 17px; height: 17px; fill: currentColor; }
    a.social:hover { background: var(--accent-soft); color: var(--accent); }
    span.social { opacity: .45; }
    /* Galerie d'avatars : un seul, en grand, flèches de part et d'autre */
    .avatar-gallery { display: flex; align-items: center; justify-content: center; gap: 14px; }
    .avatar-stage { width: 120px; height: 120px; border-radius: 22px; background: var(--soft); border: 2px solid var(--accent); padding: 6px; touch-action: pan-y; user-select: none; }
    .avatar-stage .avatar-big { width: 100%; height: 100%; border-radius: 16px; display: block; animation: imp-in .15s both; }
    .avatar-nav { width: 42px; height: 42px; font-size: 26px; line-height: 1; }
    .avatar-count { text-align: center; color: var(--muted); font-size: 11px; margin: 6px 0 14px; }
    .room-game-name { font-weight: 600; color: var(--accent); }
    .game-page .category { margin: 0; }
    @media (min-width: 761px) and (max-width: 1000px) {
      body:not(.rail-open) .sub-nav { margin: 2px 0; padding: 0; border: 0; }
      body:not(.rail-open) .sub-item { justify-content: center; }
      body:not(.rail-open) .socials { gap: 4px; }
      body:not(.rail-open) .social { width: 26px; height: 26px; }
    }
    .game.playable .play-button { background: var(--button); color: #fff; }

    /* ═════════ Salon : chat en bulle (Yvan 28/11) → joueurs + réglages seulement ═════════ */
    body.in-room:not(.in-game) .chat { display: none !important; }
    body.in-room.chat-open:not(.in-game) .chat { display: flex !important; flex-direction: column; position: fixed; right: 22px; bottom: 92px; z-index: 45;
      width: min(380px, calc(100vw - 32px)); height: auto; padding: 16px; box-shadow: 0 18px 48px #00000077; }
    body.in-room.chat-open:not(.in-game) .chat .chat-log { flex: none; height: min(45dvh, 360px); }
    /* Formulaire créer/rejoindre sur écran peu haut (tablette à l'horizontale) : 2 colonnes, sans défilement. */
    @media (max-height: 640px) and (min-width: 700px) {
      body[data-page="play"] #home .room-column { width: min(780px, 100%); }
      body[data-page="play"] #home .room-column > .room-area { padding: 16px 20px; }
      body[data-page="play"] #home .room-column .aside-tip, body[data-page="play"] #home .room-top p:not(.room-game-name) { display: none; }
      #home .room-top h2 { font-size: 18px; }
      #home .tabs { margin: 10px 0; }
      #home .room-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; }
      #home .room-form > * { grid-column: 1; }
      #home .room-form > .avatar-group { grid-column: 2; grid-row: 1 / span 4; }
      #home .field { margin-bottom: 10px; }
    }

    /* ═════════ Salon façon KCorp, en plus joli (Yvan 29/11) : réglages à gauche, joueurs (avatar + pseudo) à droite ═════════ */
    .face:not(.emoji) { background: var(--accent-soft); }               /* même fond pour tous les avatars */
    @media (min-width: 761px) {
      body.in-room:not(.in-game) .room-main, body.in-room:not(.in-game) .room-side { display: contents; }
      body.in-room:not(.in-game) .room-layout { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); grid-template-areas: "center players";
        max-width: 1100px; margin-inline: auto; gap: 20px; align-items: start; }
      body.in-room:not(.in-game) .host-panel, body.in-room:not(.in-game) .waiting-panel { grid-area: center; }
      body.in-room:not(.in-game) .players-area { grid-area: players; }
    }
    body.in-room:not(.in-game) .host-panel h2 { font-size: 17px; margin-bottom: 12px; }
    .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
    .settings-grid .field { margin: 0; }
    .settings-grid label { font-size: 11px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .settings-grid .check { align-self: end; margin: 0; padding-bottom: 8px; font-size: 12px; white-space: normal; overflow: visible; }
    .stepper { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; height: 38px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); overflow: hidden; }
    .stepper output { text-align: center; font-weight: 700; font-size: 14px; }
    .step-button { height: 100%; border: 0; background: var(--soft); color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer; }
    .step-button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
    .step-button:disabled { opacity: .3; cursor: default; }
    .settings-grid select.text-input { min-height: 38px; height: 38px; padding: 0 10px; }
    body.in-room .player-avatar .face.emoji { font-size: 44px; border-radius: 20px; background: var(--accent-soft); }
    @media (max-width: 1279px) { body.in-room:not(.in-game) .host-panel h2 br { display: none; } body.in-room:not(.in-game) .host-panel h2 { margin-bottom: 8px; } }
    .host-start { width: 100%; justify-content: center; margin-top: 16px; min-height: 46px; font-size: 15px; }
    .room-options { margin-top: 12px; }
    .room-options summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; }
    .room-options-box { display: grid; gap: 10px; margin-top: 10px; }
    .room-options-box .field { margin: 0; }
    /* Joueurs : une grille d'avatars, le pseudo dessous, rien d'autre */
    body.in-room .player-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 14px 8px; }
    body.in-room .player { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; background: none; border-radius: 0; flex-wrap: nowrap; }
    body.in-room .player-avatar { position: relative; width: 74px; height: 74px; }
    body.in-room .player-avatar .face { border-radius: 20px; }
    body.in-room .player.me .player-avatar .face { outline: 2px solid var(--accent); outline-offset: 2px; }
    body.in-room .player.offline { opacity: .45; }
    body.in-room .player-name { flex: none; min-width: 0; max-width: 100%; font-size: 13px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .player-tag { position: absolute; font-size: 18px; line-height: 1; filter: drop-shadow(0 1px 2px #0008); }
    .player-tag.tag-0 { top: -9px; left: -6px; transform: rotate(-18deg); }
    .player-tag.tag-1 { bottom: -4px; left: -6px; }
    .player-tag.tag-2 { bottom: -4px; right: -6px; }
    body.in-room .player-menu { position: absolute; top: -6px; right: 0; margin: 0; }
    body.in-room .player-menu summary { width: 26px; height: 26px; background: var(--raised); }
    @media (max-height: 640px) and (min-width: 761px) {
      body.in-room .player-avatar { width: 60px; height: 60px; }
      body.in-room .player-list { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px 6px; }
      .settings-grid { gap: 6px 12px; }
      .host-start { margin-top: 10px; min-height: 40px; }
      .room-options { margin-top: 8px; }
    }

    /* Connexion Discord (facultative) */
    .discord-box { display: grid; gap: 4px; margin: -6px 0 14px; }
    .discord-login, .discord-on { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
    .discord-login { justify-self: start; padding: 8px 12px; border-radius: 9px; background: #5865f2; color: #fff; }
    .discord-login:hover { background: #4752c4; }
    .discord-login svg, .discord-on svg { width: 16px; height: 16px; fill: currentColor; }
    .discord-on { color: #7983f5; }
    .discord-hint { font-size: 11px; color: var(--muted); }
    .link-button { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
    #nickname[readonly] { opacity: .8; cursor: not-allowed; }
    .discord-badge { display: inline-block; width: 13px; height: 13px; fill: #7983f5; vertical-align: -2px; margin-right: 4px; }

    /* Adresse du site en haut à droite, quand le menu est réduit (pub dans les streams, Yvan 29/11) */
    .site-tag { display: none; position: fixed; top: 6px; right: 16px; z-index: 50; font: 800 13px/1 "Outfit", sans-serif; letter-spacing: .02em; color: var(--accent); opacity: .9; }
    @media (min-width: 761px) {
      body:is(.in-room, [data-page="play"]) .site-tag { display: block; }
      body:is(.in-room, [data-page="play"]) main { padding-top: 30px; }
    }
    @media (min-width: 761px) and (max-width: 1000px) {
      .site-tag { display: block; }
      main { padding-top: 30px; }
    }

    /* Bouton ☰ du menu réduit (Yvan 29/11) : déplie le menu complet par-dessus la page */
    .rail-toggle { display: none; width: 40px; height: 40px; }
    body.rail-open .sidebar { width: 240px; align-items: stretch; box-shadow: 0 0 0 100vmax #0006, 0 0 40px #0008; z-index: 120; overflow-y: auto; }

    /* Contours des cartouches plus discrets (Yvan 29/11 : « trop prononcés ») : même trait, couleur à moitié fondue dans le fond */
    .game, .room-area { border-color: color-mix(in srgb, var(--border) 50%, transparent); }
