/* 3Singes Board — console d'exploitation. Noir mat, surfaces à liseré, jaune 3Singes en accent.
   Polices du jeu : Bricolage Grotesque pour lire, IBM Plex Mono pour toute donnée. */
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 400 800; font-display: swap; src: url(/fonts/bricolage-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 400 800; font-display: swap; src: url(/fonts/bricolage-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(/fonts/plex-mono-500-latin.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 600; font-display: swap; src: url(/fonts/plex-mono-600-latin.woff2) format('woff2'); }

:root {
  --bg: #0b0b0c;
  --surface: #141415;
  --surface-2: #1c1c1e;
  --surface-3: #262628;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f1ea;
  --muted: #a39f95;
  --faint: #6b675f;
  --accent: #f5b400;
  --accent-ink: #1b1815;
  --pink: #f58daa;
  --ok: #3ecf8e;
  --warn: #f5b400;
  --crit: #ef5350;
  --info: #6aa8ff;
  --blind: #d8d4ca;
  --deaf: #f5b400;
  --mute: #f58daa;
  --radius: 14px;
  --gap: 14px;
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-weight: 500; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ boot + sign-in */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); text-align: center; }
.boot img { border-radius: 16px; border: 1px solid var(--line-strong); }
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(100%, 400px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; display: grid; gap: 18px; justify-items: center; text-align: center; }
.gate-card img { border-radius: 18px; border: 1px solid var(--line-strong); }
.gate-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.gate-card h1 span { color: var(--accent); }
.gate-card p { color: var(--muted); max-width: 32ch; }
.gate-error { background: rgba(239, 83, 80, 0.1); border: 1px solid rgba(239, 83, 80, 0.45); color: #ffb4b1; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-2); font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.g-logo { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ shell */
.shell { max-width: 1280px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top)) 16px 0; background: rgba(11, 11, 12, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand span { color: var(--accent); }
.spacer { flex: 1; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(62, 207, 142, 0.15); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(245, 180, 0, 0.15); }
.dot.crit { background: var(--crit); box-shadow: 0 0 0 4px rgba(239, 83, 80, 0.18); }
.me { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.me img, .me .initial { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; color: var(--text); object-fit: cover; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 6px -16px 0; padding: 0 16px; }
.nav::-webkit-scrollbar { display: none; }
.nav button { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; color: var(--muted); font-weight: 600; }
.nav button:hover { color: var(--text); }
.nav button[aria-current='page'] { color: var(--text); border-bottom-color: var(--accent); }
main { padding-top: 18px; display: grid; gap: var(--gap); }
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ cards, tiles */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; }
@media (max-width: 1100px) { .col-3 { grid-column: span 6; } }
@media (max-width: 900px) { .col-8, .col-6, .col-4 { grid-column: span 12; } .col-3 { grid-column: span 6; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; display: grid; gap: 12px; align-content: start; }
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card-head h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--faint); margin-left: auto; }
.tiles { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.tile .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.tile .value { font: 600 30px/1.1 var(--mono); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tile .hint { font-size: 12px; color: var(--faint); }
.tile.ok .value { color: var(--ok); } .tile.warn .value { color: var(--warn); } .tile.crit .value { color: var(--crit); } .tile.accent .value { color: var(--accent); }
.tile.missing .value { color: var(--faint); font-size: 22px; }

/* ------------------------------------------------------------------ lights */
.lights { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.light { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.light .dot { margin-top: 5px; }
.light b { font-weight: 700; }
.light small { grid-column: 2; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.light.warn { border-color: rgba(245, 180, 0, 0.4); } .light.crit { border-color: rgba(239, 83, 80, 0.55); }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); font-weight: 700; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); font-weight: 500; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.empty { color: var(--faint); padding: 14px 4px; font-size: 14px; }

/* ------------------------------------------------------------------ pills, bars */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; background: rgba(255, 255, 255, 0.03); }
.pill.ok { color: var(--ok); border-color: rgba(62, 207, 142, 0.5); background: rgba(62, 207, 142, 0.08); }
.pill.warn { color: var(--warn); border-color: rgba(245, 180, 0, 0.5); background: rgba(245, 180, 0, 0.08); }
.pill.crit { color: var(--crit); border-color: rgba(239, 83, 80, 0.55); background: rgba(239, 83, 80, 0.08); }
.pill.info { color: var(--info); border-color: rgba(106, 168, 255, 0.5); background: rgba(106, 168, 255, 0.08); }
.pill.BLIND { color: var(--blind); } .pill.DEAF { color: var(--deaf); } .pill.MUTE { color: var(--mute); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.split { display: grid; gap: 8px; }
.split-row { display: grid; grid-template-columns: minmax(60px, 140px) minmax(30px, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.split-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.split-row .val { font-family: var(--mono); font-weight: 500; white-space: nowrap; }
.track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: flex; }
.track > i { display: block; height: 100%; background: var(--accent); }
.track.ok > i { background: var(--ok); } .track.pink > i { background: var(--pink); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-family: var(--mono); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.note { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 12px; color: var(--muted); font-size: 13.5px; }
.note.warn { border-color: rgba(245, 180, 0, 0.5); color: var(--warn); } .note.crit { border-color: rgba(239, 83, 80, 0.55); color: #ffb4b1; }

/* ------------------------------------------------------------------ rooms */
.rooms { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.room { border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.room-head { display: flex; align-items: center; gap: 10px; }
.room-code { font: 700 22px/1 var(--mono); letter-spacing: 0.08em; }
.seats { display: grid; gap: 6px; }
.seat { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.seat .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.off { color: var(--faint); }
.bomb { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.bomb .row { display: flex; justify-content: space-between; font-family: var(--mono); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------------ charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--faint); font: 500 10.5px var(--mono); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .hit { fill: transparent; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ------------------------------------------------------------------ log */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters input, .filters select { min-height: 36px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 10px; }
.filters input { flex: 1; min-width: 160px; }
.feed { display: grid; gap: 0; font-size: 13.5px; }
.feed-row { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.feed-row:last-child { border-bottom: 0; }
.feed-row time { font: 500 12px var(--mono); color: var(--faint); white-space: nowrap; padding-top: 1px; }
.feed-row .what { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.logline { font: 500 12.5px/1.5 var(--mono); }
.logline.error { color: #ffb4b1; } .logline.warn { color: #ffd98a; }
.loading { opacity: 0.55; pointer-events: none; transition: opacity 0.2s; }
.stale { color: var(--warn); }
@media (max-width: 560px) { .feed-row { grid-template-columns: 1fr; gap: 0; } .tile .value { font-size: 26px; } .page-head h2 { font-size: 21px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ------------------------------------------------------------------ petits écrans */
@media (max-width: 640px) {
  .me .who { display: none; }
  .status span { display: none; }
  .brand { font-size: 16px; }
}
#banner:empty { display: none; }
