:root {
  color-scheme: light;
  --bg: #f5f7f2;
  --ink: #19231f;
  --muted: #66736e;
  --line: #cfd8d1;
  --panel: #ffffff;
  --accent: #2b7a57;
  --accent2: #4a5fb5;
  --danger: #b33a3a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { border: 0; background: var(--accent); color: white; padding: 10px 14px; border-radius: 6px; cursor: pointer; min-height: 42px; }
button:hover { filter: brightness(.95); }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--danger); }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: white; color: var(--ink); }
textarea { resize: vertical; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 22px; margin: 0; }
.topbar p { margin: 3px 0 0; color: var(--muted); }
.layout { max-width: 1280px; margin: 0 auto; padding: 20px; }
.band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 12px; }
.metrics div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.metrics span { display: block; color: var(--muted); font-size: 13px; }
.metrics strong { display: block; font-size: 20px; margin-top: 4px; overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-top: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.row { display: flex; gap: 10px; align-items: stretch; }
.row input { min-width: 0; }
.muted { color: var(--muted); }
.players { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.players li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: #eef7f1; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #101511; color: #dce9dc; border-radius: 8px; padding: 12px; min-height: 80px; max-height: 520px; overflow: auto; }
.logs { font-size: 13px; line-height: 1.45; }
.properties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tabs button { background: #eef2ee; color: var(--ink); border: 1px solid var(--line); min-height: 38px; }
.tabs button.active { background: var(--accent); color: white; border-color: var(--accent); }
.field label { display: flex; justify-content: space-between; gap: 10px; font-weight: 650; margin-bottom: 4px; }
.field label span { color: var(--muted); font-size: 12px; font-weight: 500; align-self: center; overflow-wrap: anywhere; }
.field small { display: block; color: var(--muted); margin-top: 4px; min-height: 34px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.toolbar button { background: var(--accent2); padding: 8px 10px; min-height: 36px; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #e6f2ea, #f7f1e7); }
.login-shell { width: min(420px, calc(100vw - 32px)); }
.login-panel { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.login-panel h1 { margin: 0 0 20px; }
.login-panel button { width: 100%; margin-top: 14px; }
.error { color: var(--danger); }
[data-role="admin"] .participant-only { display: none; }
[data-role="participant"] .admin-only { display: none; }
@media (max-width: 820px) {
  .topbar { align-items: flex-start; padding: 14px 16px; }
  .layout { padding: 12px; }
  .metrics, .grid, .properties { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
}
