:root {
  --bg: #0e0f12;
  --surface: #16181d;
  --surface-2: #1e2128;
  --border: #2a2e37;
  --text: #e8e6e1;
  --muted: #8b8f98;
  --accent: #5865f2;
  --ok: #3fb97f;
  --warn: #d9a441;
  --bad: #e5534b;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
h1 { margin: 12px 0 4px; font-size: 26px; letter-spacing: .5px; }
h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.error { color: var(--bad); background: rgba(229, 83, 75, .1); border: 1px solid rgba(229, 83, 75, .3); padding: 10px 12px; border-radius: 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: #3a3f4b; }
.btn-ghost { background: transparent; }
.btn-xs { padding: 3px 8px; font-size: 12px; }
.btn-discord { background: var(--accent); border-color: var(--accent); color: #fff; padding: 12px 18px; font-weight: 600; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); color: var(--muted); }
.pill-ok { color: var(--ok); border-color: rgba(63, 185, 127, .35); }
.pill-warn { color: var(--warn); border-color: rgba(217, 164, 65, .35); }
.pill-bad { color: var(--bad); border-color: rgba(229, 83, 75, .35); }

.avatar { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.avatar-empty { display: inline-block; background: var(--surface-2); }

/* Connexion */
.screen { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); text-align: center; display: grid; gap: 14px; justify-items: center; padding: 32px 26px; }
.login-card p { margin: 0; }
.logo-lg { width: 64px; height: 64px; }
.logo-sm { width: 26px; height: 26px; }

/* Application */
.layout {
  display: grid; height: 100%;
  grid-template-columns: 1fr 300px; grid-template-rows: auto 1fr;
  grid-template-areas: "top top" "stage side";
}
.topbar { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.me { display: flex; align-items: center; gap: 10px; }
.stage { grid-area: stage; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px; min-height: 0; }
.screen-wrap { position: relative; flex: 1; width: 100%; min-height: 0; display: flex; justify-content: center; background: #000; border-radius: var(--radius); overflow: hidden; }
.phone-screen { width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; background: rgba(14, 15, 18, .88); color: var(--muted); }
.toolbar { display: flex; gap: 8px; align-items: center; }
.side { grid-area: side; display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 18px 0; overflow: auto; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list li { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.log li { font-size: 13px; align-items: baseline; gap: 6px; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 70vh auto; grid-template-areas: "top" "stage" "side"; height: auto; }
  .side { padding: 0 18px 18px; }
  #me-name { display: none; }
}
