/* ===================================================================
   GEMINI HUD — Refonte MJ (mockup La Taverne des Aventuriers)
   Desktop MJ ≥1101px · Mobile ≤1100px · Joueurs : main.css
   =================================================================== */

@media (min-width: 1101px) {
  body.is-gm #screen-room {
    --hud-bg: url('/assets/gemini-hud-pack/bg-room-mj.jpg');
    --hud-frame-stone: url('/assets/gemini-hud-pack/frame-stone-9slice.png');
    --hud-frame-map: url('/assets/gemini-hud-pack/frame-map-center.png');
    --hud-sign: url('/assets/gemini-hud-pack/sign-taverne.png');
    --hud-workshop-dial: url('/assets/gemini-hud-pack/panel-workshop-dial.png');
    --hud-sfx-console: url('/assets/gemini-hud-pack/panel-sfx-console.png');
    --hud-gold: #c4a45a;
    --hud-gold-light: #e5c173;
    --hud-copper: #8c6f34;
    --button-plaque: url('/assets/gemini-hud/button-plaque.png');
    --button-plaque-active: url('/assets/gemini-hud/button-plaque-active.png');
    --plaque-ratio: 3.89;

    background:
      radial-gradient(ellipse 130% 92% at 50% 42%, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.86) 78%),
      var(--hud-bg) center / cover no-repeat fixed;
  }

  /* ── Plaques bronze (mockup Gemini) ── */
  body.is-gm .gem-plaque-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #efd69e !important;
    background: transparent !important;
    background-image: var(--button-plaque) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 100% 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    cursor: pointer;
    white-space: nowrap;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.72));
    transition: filter 0.15s, color 0.15s;
    clip-path: none !important;
    box-shadow: none !important;
  }

  body.is-gm .gem-plaque-btn:hover,
  body.is-gm .gem-plaque-btn:focus-visible {
    color: #fff2c2 !important;
    filter: brightness(1.16) drop-shadow(0 0 6px rgba(196, 164, 90, 0.4));
    outline: none;
  }

  body.is-gm .gem-plaque-btn.active {
    color: #fff8dc !important;
    background-image: var(--button-plaque-active) !important;
    filter: brightness(1.1) drop-shadow(0 0 8px rgba(196, 164, 90, 0.45));
  }

  body.is-gm .gem-plaque-btn--sm {
    min-height: 34px;
    padding: 6px 10px !important;
    font-size: 0.56rem;
  }

  body.is-gm .gem-plaque-btn--xs {
    min-height: 30px;
    padding: 5px 8px !important;
    font-size: 0.5rem;
    letter-spacing: 0.05em;
  }

  /* ── Grille globale ── */
  body.is-gm .room-layout {
    grid-template-columns: clamp(190px, 13vw, 240px) minmax(0, 1fr) !important;
    background: transparent !important;
  }

  body.is-gm .room-layout::after {
    background: radial-gradient(120% 100% at 50% 38%, transparent 38%, rgba(0, 0, 0, 0.55) 100%) !important;
  }

  /* ── Colonne joueurs ── */
  body.is-gm .sidebar-players {
    background: linear-gradient(180deg, rgba(17, 23, 34, 0.97) 0%, rgba(8, 12, 20, 0.99) 100%) !important;
    border-right: 2px solid var(--hud-copper) !important;
    box-shadow: inset -8px 0 22px rgba(0, 0, 0, 0.5), 4px 0 16px rgba(0, 0, 0, 0.45) !important;
  }

  body.is-gm .sidebar-players .sidebar-header {
    flex-direction: column;
    align-items: stretch;
    position: relative;
    min-height: auto !important;
    padding: 8px 10px 10px !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(196, 164, 90, 0.35) !important;
  }

  body.is-gm .sidebar-players .sidebar-header::before {
    content: "";
    display: block;
    height: 54px;
    background: var(--hud-sign) center / contain no-repeat;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.65));
  }

  body.is-gm .sidebar-players .sidebar-header h3 {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
  }

  body.is-gm .sidebar-players .sidebar-header .online-badge {
    position: absolute;
    top: 6px;
    right: 8px;
  }

  body.is-gm .online-badge {
    width: 20px;
    height: 20px;
    padding: 0;
    color: transparent;
    background: radial-gradient(circle at 35% 30%, #74d9d1, #246a70 70%);
    border: 1px solid #75d9d0;
    box-shadow: 0 0 8px rgba(79, 209, 197, 0.45);
  }

  body.is-gm .player-item {
    padding: 12px 8px 10px !important;
    border-radius: 8px !important;
    background: linear-gradient(165deg, rgba(58, 32, 24, 0.94) 0%, rgba(12, 14, 22, 0.98) 100%) !important;
    border: 1px solid rgba(196, 164, 90, 0.55) !important;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55), 0 4px 10px rgba(0, 0, 0, 0.35) !important;
  }

  body.is-gm .player-item::before { display: none !important; }

  body.is-gm .pc-top {
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
  }

  body.is-gm .pc-avatar {
    width: 58px !important;
    height: 58px !important;
    border-radius: 50% !important;
    border: 3px solid var(--hud-gold) !important;
    box-shadow: 0 0 0 2px #160b08, 0 4px 14px rgba(0, 0, 0, 0.65) !important;
  }

  body.is-gm .pc-names { text-align: center; width: 100%; }
  body.is-gm .pc-meta { padding-left: 0 !important; justify-content: center; flex-wrap: wrap; }
  body.is-gm .pc-hp { padding-left: 0 !important; width: 100%; margin-top: 4px; }
  body.is-gm .pc-dot { position: absolute; top: 10px; right: 10px; }
  body.is-gm .player-name { color: var(--hud-gold-light); }

  /* Console SFX (mockup bas-gauche) */
  body.is-gm #sfx-panel {
    margin-top: auto;
    color: #b8aa91;
    background: linear-gradient(180deg, rgba(27, 16, 13, 0.96), rgba(10, 14, 22, 0.99)) !important;
    border-top: 2px solid rgba(140, 111, 52, 0.75);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
  }

  body.is-gm #sfx-panel.sfx-panel--focused {
    border-top-color: #c4a45a !important;
    box-shadow:
      inset 0 8px 18px rgba(0, 0, 0, 0.48),
      0 0 0 2px rgba(196, 164, 90, 0.55),
      0 0 22px rgba(196, 164, 90, 0.28) !important;
  }

  body.is-gm #sfx-panel-body { position: relative; }

  body.is-gm #sfx-panel-body::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    width: 115%;
    height: 82px;
    background: var(--hud-sfx-console) center bottom / contain no-repeat;
    opacity: 0.42;
    pointer-events: none;
    z-index: 0;
  }

  body.is-gm #sfx-panel-body > * { position: relative; z-index: 1; }

  body.is-gm .sfx-header span:first-child {
    font-family: var(--font-heading);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--hud-gold-light);
  }

  body.is-gm .sidebar-footer {
    background: rgba(8, 12, 18, 0.96) !important;
    border-top: 1px solid rgba(140, 111, 52, 0.5);
  }

  /* ── Centre : topbar + viewport + atelier ── */
  body.is-gm .room-center {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.38fr) !important;
    grid-template-rows: 56px minmax(0, 1fr) !important;
    gap: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    background: transparent !important;
  }

  body.is-gm .room-center::before { display: none !important; }

  /* Bandeau titre + boutons mockup (Lancer / Carte / Atelier / Partir) */
  body.is-gm .room-center > .room-topbar {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    height: 56px !important;
    padding: 0 16px 0 20px !important;
    background: linear-gradient(180deg, rgba(28, 14, 10, 0.97) 0%, rgba(12, 8, 8, 0.99) 100%) !important;
    border-bottom: 2px solid var(--hud-copper) !important;
    position: relative;
    display: flex !important;
    align-items: center !important;
  }

  body.is-gm .room-topbar h2 {
    color: var(--hud-gold-light);
    font-size: 1.28rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  }

  body.is-gm .gm-badge {
    color: #55bdb5;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  body.is-gm .room-actions-primary {
    display: none !important;
  }

  body.is-gm .mobile-actions-toggle {
    display: inline-flex !important;
    margin-left: auto;
  }

  body.is-gm .gm-tools { display: none !important; }

  body.is-gm .room-center > .room-topbar .room-actions {
    display: none !important;
  }

  body.is-gm .room-center > .room-topbar .room-actions.mobile-actions-open {
    display: flex !important;
    position: absolute;
    top: calc(100% + 4px);
    right: 14px;
    z-index: 120;
    flex-direction: column;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    background: linear-gradient(160deg, #4a2a1e, #21110d) !important;
    border: 2px solid var(--hud-copper) !important;
    padding: 8px !important;
  }

  /* ── Viewport pierre (carte + journal) ── */
  body.is-gm .hud-viewport {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    margin: 10px 10px 12px 12px !important;
    padding: 0 !important;
    border: 20px solid transparent !important;
    border-image: var(--hud-frame-stone) 64 fill / 20px stretch !important;
    background:
      linear-gradient(180deg, rgba(234, 211, 174, 0.04) 0%, transparent 12%),
      linear-gradient(165deg, rgba(28, 18, 12, 0.94) 0%, rgba(8, 10, 18, 0.98) 100%) !important;
    box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.65), 0 10px 28px rgba(0, 0, 0, 0.45) !important;
    overflow: hidden !important;
  }

  body.is-gm .hud-viewport .tactical-topbar {
    min-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0;
    pointer-events: none;
  }

  body.is-gm .hud-viewport #tactical-map-zone {
    order: 1 !important;
    flex: 1.4 1 0 !important;
    min-height: 200px !important;
    max-height: 64% !important;
    margin: 0 !important;
    border: none !important;
    border-bottom: 2px solid rgba(140, 111, 52, 0.6) !important;
    background:
      radial-gradient(circle at 50% 40%, rgba(34, 48, 68, 0.4), rgba(8, 10, 16, 0.95)),
      var(--hud-frame-map) center / cover no-repeat !important;
    box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.58) !important;
  }

  body.is-gm .hud-viewport #tactical-canvas { background: #080c12 !important; }
  body.is-gm #tactical-map-zone::before,
  body.is-gm #tactical-map-zone::after { display: none; }

  /* Journal de séance */
  body.is-gm .hud-viewport .gm-chat-console {
    order: 2 !important;
    flex: 0.9 1 0 !important;
    min-height: 150px !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    background: transparent !important;
  }

  body.is-gm .gm-chat-console-header {
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 8px 16px 6px !important;
    background: linear-gradient(180deg, rgba(22, 12, 9, 0.94), rgba(12, 10, 10, 0.9)) !important;
    border-bottom: 1px solid rgba(196, 164, 90, 0.35);
  }

  body.is-gm .gm-chat-console-title {
    font-family: var(--font-heading);
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--hud-gold-light);
  }

  body.is-gm .gm-chat-console-sub {
    font-size: 0.66rem;
    color: rgba(196, 164, 90, 0.55);
    font-style: italic;
  }

  body.is-gm .gm-chat-console-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.is-gm .gm-chat-console .chat-log-zone {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    padding: 8px 14px 4px !important;
    background: rgba(6, 8, 14, 0.5) !important;
  }

  body.is-gm .chat-log {
    gap: 8px;
    mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 8px), transparent 100%);
  }

  body.is-gm .msg {
    padding: 8px 14px;
    background: linear-gradient(105deg, rgba(68, 36, 28, 0.94), rgba(17, 29, 39, 0.96));
    border: 1px solid rgba(196, 164, 90, 0.34);
    border-left: 5px solid #3d9f98;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45), 0 3px 7px rgba(0, 0, 0, 0.42);
  }

  body.is-gm .msg-dice strong { font-size: 1.5rem; color: #71ddd1 !important; }

  /* Rail chat : Bibliothèque · Scène · Musique · Fil d'aventure (sans doublon rosace) */
  body.is-gm .hud-chat-rail.gem-rail {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(14, 10, 10, 0.9), rgba(8, 10, 16, 0.94));
    border-top: 1px solid rgba(196, 164, 90, 0.3);
    border-bottom: 1px solid rgba(140, 111, 52, 0.4);
  }

  body.is-gm .hud-rail-btn.gem-plaque-btn {
    min-height: 36px;
    min-width: 88px;
    padding: 6px 16px !important;
  }

  /* Zone saisie + Envoyer */
  body.is-gm .gm-chat-console .chat-input-zone {
    flex-shrink: 0 !important;
    background: linear-gradient(180deg, rgba(10, 14, 22, 0.97), rgba(6, 8, 14, 0.99)) !important;
    border-top: 2px solid rgba(140, 111, 52, 0.7) !important;
  }

  body.is-gm .gm-tools { display: none !important; }

  body.is-gm .gem-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    padding: 10px 14px !important;
  }

  body.is-gm #chat-input {
    flex: 1;
    min-height: 68px;
    background: rgba(234, 211, 174, 0.08) !important;
    border: 1px solid rgba(196, 164, 90, 0.35) !important;
    color: #e8dcc8 !important;
  }

  body.is-gm .gem-send-btn {
    min-width: 108px !important;
    min-height: 68px !important;
    padding: 8px 14px !important;
    font-size: 0.68rem !important;
    align-self: stretch;
  }

  /* ── Panneau Atelier MJ (droite, mockup rosace) ── */
  body.is-gm .gm-workshop-dock {
    display: flex !important;
    flex-direction: column !important;
    grid-column: 2 !important;
    grid-row: 2 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 10px 12px 12px 0 !important;
    border-left: 2px solid rgba(140, 111, 52, 0.85);
    background:
      linear-gradient(180deg, rgba(14, 10, 8, 0.95) 0%, rgba(6, 8, 14, 0.99) 100%) !important;
    box-shadow: inset 10px 0 24px rgba(0, 0, 0, 0.5);
  }

  body.is-gm .gm-side-stack {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  body.is-gm .gm-atelier-panel {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 10px 8px;
    gap: 10px;
    border-bottom: 1px solid rgba(196, 164, 90, 0.28);
  }

  body.is-gm .gm-atelier-panel__banner {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--hud-gold-light);
    padding: 8px 6px 10px;
    border-bottom: 1px solid rgba(196, 164, 90, 0.35);
    text-shadow: 0 0 16px rgba(196, 164, 90, 0.25);
  }

  /* Rosace CSS pure (sans PNG — évite doublons de libellés) */
  body.is-gm .gm-atelier-dial {
    --wheel-n: 6;
    --wheel-r: 88px;
    position: relative;
    width: min(100%, 252px);
    height: 252px;
    margin: 4px auto 8px;
    flex-shrink: 0;
  }

  body.is-gm .gm-atelier-dial__ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
  }

  body.is-gm .gm-atelier-dial__ring--outer {
    inset: 0;
    border: 2px solid rgba(196, 164, 90, 0.42);
    background:
      radial-gradient(circle at 50% 44%, rgba(48, 38, 28, 0.55) 0%, rgba(8, 10, 16, 0.94) 70%);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.62), 0 0 20px rgba(196, 164, 90, 0.1);
  }

  body.is-gm .gm-atelier-dial__ring--inner {
    inset: 26%;
    border: 1px solid rgba(196, 164, 90, 0.25);
    background: radial-gradient(circle, rgba(12, 16, 26, 0.92) 0%, rgba(4, 6, 12, 0.98) 100%);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55);
  }

  body.is-gm .gm-atelier-dial__core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--hud-gold-light);
    background: linear-gradient(145deg, rgba(58, 46, 28, 0.96), rgba(16, 12, 10, 0.98));
    border: 1px solid rgba(196, 164, 90, 0.55);
    box-shadow: 0 0 16px rgba(196, 164, 90, 0.22);
    z-index: 1;
  }

  body.is-gm .gm-atelier-dial__compass {
    width: 34px;
    height: 34px;
  }

  body.is-gm .gem-dial-btn--orbit {
    --btn-w: 62px;
    --btn-h: 34px;
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: var(--btn-w);
    height: var(--btn-h);
    margin: calc(var(--btn-h) / -2) 0 0 calc(var(--btn-w) / -2);
    padding: 3px 4px !important;
    font-size: 0.44rem !important;
    line-height: 1.05;
    border-radius: 3px;
    white-space: normal;
    transform:
      rotate(calc(-90deg + (360deg / var(--wheel-n)) * var(--i)))
      translateY(calc(-1 * var(--wheel-r)))
      rotate(calc(90deg - (360deg / var(--wheel-n)) * var(--i)));
  }

  body.is-gm .gem-dial-btn--orbit:hover,
  body.is-gm .gem-dial-btn--orbit:focus-visible {
    filter: brightness(1.16) drop-shadow(0 0 6px rgba(196, 164, 90, 0.4));
  }

  body.is-gm .gm-atelier-modes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  body.is-gm .gm-atelier-context {
    flex: 1 1 auto;
    min-height: 0;
  }

  body.is-gm .gm-atelier-panel-set {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }

  body.is-gm .gm-atelier-panel-set--hint {
    display: flex;
    flex-direction: column;
    gap: 8px;
    grid-template-columns: none;
  }

  body.is-gm .gm-atelier-ambiance-hint {
    margin: 0;
    padding: 8px 6px;
    font-size: 0.58rem;
    line-height: 1.45;
    color: rgba(196, 164, 90, 0.72);
    text-align: center;
    border: 1px dashed rgba(196, 164, 90, 0.22);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
  }

  body.is-gm .gm-atelier-panel-set .gem-plaque-btn--xs {
    min-height: 28px;
    white-space: normal;
    line-height: 1.15;
  }

  body.is-gm .sfx-add-btn {
    font-size: 0.62rem !important;
    letter-spacing: 0.04em;
  }

  /* Fil d'aventure — sous l'atelier MJ */
  body.is-gm .gm-fda-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(10, 12, 18, 0.92) 0%, rgba(6, 8, 12, 0.98) 100%);
  }

  body.is-gm .gm-fda-panel__head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(196, 164, 90, 0.3);
    background: linear-gradient(180deg, rgba(22, 12, 9, 0.94), rgba(12, 10, 10, 0.9));
  }

  body.is-gm .gm-fda-panel__title {
    flex: 1;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hud-gold-light);
  }

  body.is-gm .gm-fda-count {
    font-family: var(--font-heading);
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    color: rgba(196, 164, 90, 0.75);
    padding: 2px 6px;
    border: 1px solid rgba(196, 164, 90, 0.35);
    border-radius: 10px;
  }

  body.is-gm .gm-fda-refresh {
    min-height: 26px !important;
    padding: 4px 8px !important;
    font-size: 0.46rem !important;
  }

  body.is-gm .gm-fda-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  body.is-gm .gm-fda-empty {
    padding: 12px 8px;
    text-align: center;
    font-size: 0.62rem;
    line-height: 1.45;
    color: rgba(196, 164, 90, 0.6);
    font-style: italic;
  }

  body.is-gm .gm-fda-card {
    text-align: left;
    width: 100%;
    padding: 8px 9px;
    border: 1px solid rgba(196, 164, 90, 0.32);
    background: linear-gradient(165deg, rgba(48, 38, 28, 0.55) 0%, rgba(8, 10, 16, 0.92) 100%);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
  }

  body.is-gm .gm-fda-card:hover,
  body.is-gm .gm-fda-card:focus-visible {
    border-color: rgba(196, 164, 90, 0.55);
    outline: none;
  }

  body.is-gm .gm-fda-card.expanded {
    border-color: rgba(196, 164, 90, 0.65);
    background: linear-gradient(165deg, rgba(58, 46, 28, 0.72) 0%, rgba(10, 12, 18, 0.96) 100%);
  }

  body.is-gm .gm-fda-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 5px;
  }

  body.is-gm .gm-fda-card__title {
    font-family: var(--font-heading);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--hud-gold-light);
    line-height: 1.25;
  }

  body.is-gm .gm-fda-card__date {
    flex-shrink: 0;
    font-size: 0.5rem;
    color: rgba(196, 164, 90, 0.55);
    white-space: nowrap;
  }

  body.is-gm .gm-fda-card__body {
    font-size: 0.58rem;
    line-height: 1.45;
    color: rgba(232, 220, 200, 0.88);
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.is-gm .gm-fda-card.expanded .gm-fda-card__body {
    display: block;
    -webkit-line-clamp: unset;
    max-height: none;
  }

  body.is-gm .gm-fda-panel--focused {
    box-shadow: inset 0 0 0 2px rgba(196, 164, 90, 0.45);
  }

  /* Atelier ouvert : masquer rosace, garder le FDA visible */
  body.is-gm.workshop-dock-open .gm-atelier-panel { display: none !important; }

  body.is-gm.workshop-dock-open .gm-fda-panel {
    flex: 1 1 auto;
    border-top: none;
  }

  body.is-gm.workshop-dock-open .gm-workshop-dock #workshop-overlay {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    background: transparent !important;
    z-index: 6;
  }

  body.is-gm.workshop-dock-open .gm-workshop-dock .workshop-panel {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    background: linear-gradient(180deg, rgba(17, 23, 34, 0.98), rgba(8, 12, 20, 0.99)) !important;
  }

  body.is-gm.workshop-dock-open .gm-workshop-dock .workshop-header {
    background: linear-gradient(180deg, rgba(22, 14, 10, 0.98), rgba(10, 8, 8, 0.96)) !important;
    border-bottom: 1px solid rgba(196, 164, 90, 0.35);
  }

  /* Exceptions petits contrôles */
  body.is-gm .scroll-to-bottom-btn,
  body.is-gm .win-btn {
    background-image: none !important;
  }
}

/* Joueurs : pas d'atelier ni rail MJ */
body:not(.is-gm) .gm-workshop-dock,
body:not(.is-gm) .hud-chat-rail { display: none !important; }

body:not(.is-gm) .gm-chat-console-header { display: none !important; }

@media (max-width: 1100px) {
  body.is-gm .gm-chat-console-header { display: none !important; }

  body.is-gm .gm-workshop-dock {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    pointer-events: none !important;
    z-index: 700;
    border: none !important;
    background: none !important;
    margin: 0 !important;
  }

  body.is-gm .gm-atelier-panel { display: none !important; }

  body.is-gm .gm-fda-panel { display: none !important; }

  body.is-gm .gm-workshop-dock #workshop-overlay:not(.hidden) {
    pointer-events: auto !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 700 !important;
    background: rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(4px) !important;
  }

  body.is-gm .gm-tools {
    display: flex !important;
  }

  body.is-gm .room-actions-primary {
    display: flex !important;
    margin-left: auto;
  }

  body.is-gm .mobile-actions-toggle { display: inline-flex !important; }

  body.is-gm .hud-viewport {
    margin: 0 !important;
    border: none !important;
    border-image: none !important;
    box-shadow: none !important;
  }

  body.is-gm .hud-viewport .tactical-topbar {
    min-height: 34px !important;
    height: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.is-gm .hud-chat-rail.gem-rail {
    display: flex !important;
    padding: 6px 8px;
  }

  body.is-gm .hud-rail-btn.gem-plaque-btn {
    min-height: 32px !important;
    font-size: 0.54rem !important;
    min-width: 72px;
  }

  body.is-gm #screen-room {
    --hud-bg: url('/assets/gemini-hud-pack/bg-room-mj.jpg');
    --button-plaque: url('/assets/gemini-hud/button-plaque.png');
    background:
      radial-gradient(ellipse 120% 90% at 50% 30%, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.88) 75%),
      var(--hud-bg) center / cover no-repeat fixed;
  }

  body.is-gm .sidebar-players .sidebar-header::before {
    height: 40px;
    background: url('/assets/gemini-hud-pack/sign-taverne.png') center / contain no-repeat;
  }

  body.is-gm .mobile-tabbar {
    background: linear-gradient(180deg, #160c09, #0b0808) !important;
    border-top: 2px solid #8c6f34 !important;
  }
}
