/*
 * Operations console.
 *
 * Shares the game's palette so an operator moving between the two is not disoriented, but
 * deliberately plainer: dense, high-contrast, no motion. Nothing here should be pleasant
 * to click by accident.
 */
:root {
  --void: #000610;
  --base: #000a14;
  --raised: #04121f;
  --panel: #071a2b;
  --hairline: rgba(151, 188, 224, 0.10);
  --hairline-strong: rgba(151, 188, 224, 0.22);

  --x: #f5a623;
  --o: #00b1fd;

  --text: #eaf2fb;
  --text-dim: #9db2cc;
  --muted: #7b91ad;

  --success: #2fd98c;
  --warning: #f5a623;
  --danger: #ff5470;

  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

/*
 * The `hidden` attribute is how every view in this console is shown and hidden, and the
 * user-agent rule behind it is only `display: none` at the lowest possible specificity.
 * Any class rule that sets `display` — `.gate` below sets `grid` — silently beats it, and
 * the "hidden" element stays on screen. Stating it once here means `hidden` can be trusted
 * everywhere else in this file.
 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

.muted { color: var(--muted); }
.pad { padding: 20px; }
.error { color: var(--danger); }
.fineprint { color: var(--muted); font-size: 12px; margin: 4px 0 0; }

/* ── Brand ─────────────────────────────────────────────────────────────────── */

.brand {
  display: flex; align-items: baseline; gap: 2px;
  font-weight: 700; font-size: 22px; letter-spacing: -0.02em;
}
.brand .mark-x { color: var(--x); }
.brand .mark-o { color: var(--o); }
.brand-text { margin-left: 8px; color: var(--text); font-weight: 600; }
.brand.small { font-size: 16px; }

/* ── Sign-in ───────────────────────────────────────────────────────────────── */

.gate {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(1000px 600px at 50% -10%, #06192b 0%, var(--void) 70%);
}

.gate-card { width: min(380px, 100%); }

.card {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 28px;
  display: flex; flex-direction: column; gap: 8px;
}

label {
  font-size: 12px; font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-top: 10px;
}

input, select, textarea {
  background: var(--void);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--o);
  outline-offset: 1px;
}
textarea { resize: vertical; font-family: inherit; }

button {
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
}
button:disabled { opacity: 0.5; cursor: default; }

.primary { background: var(--o); color: #001322; margin-top: 18px; padding: 11px 16px; }
.ghost   { background: transparent; border-color: var(--hairline-strong); color: var(--text-dim); }
.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--o); }
.danger  { background: var(--danger); color: #22000a; }

/* ── Shell ─────────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
  background: var(--raised);
  border-bottom: 1px solid var(--hairline);
}

.tabs { display: flex; gap: 4px; margin-right: auto; }
.tab {
  background: transparent; color: var(--muted);
  padding: 7px 14px;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel); color: var(--text); }

.who { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.who-name { color: var(--text-dim); }
.roles {
  font-family: var(--mono); font-size: 11px;
  color: var(--o);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px; padding: 2px 10px;
}

main { padding: 24px; max-width: 1400px; margin: 0 auto; }

/* ── Overview ──────────────────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-group {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-group h3 {
  margin: 0 0 14px; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.stat { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; }
.stat-label { color: var(--text-dim); }
.stat-value { font-family: var(--mono); font-size: 19px; font-weight: 600; }
.stat-value.alarm { color: var(--danger); }
.stat-value.quiet { color: var(--muted); }

/* ── Lists ─────────────────────────────────────────────────────────────────── */

.toolbar { display: flex; gap: 12px; margin-bottom: 16px; }
.toolbar input { max-width: 420px; }
.toolbar select { width: auto; }

.split { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.list, .detail {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.list.wide { max-height: none; }

.row-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  width: 100%; text-align: left; background: transparent; border-radius: 0;
  font-weight: 400;
}
.row-item:last-child { border-bottom: none; }
.row-item:hover { background: var(--panel); }
.row-item.selected { background: var(--panel); box-shadow: inset 3px 0 0 var(--o); }

.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }

.pill {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pill.banned  { color: var(--danger); }
.pill.staff   { color: var(--o); }
.pill.void    { color: var(--danger); }
.pill.live    { color: var(--success); }
.pill.rated   { color: var(--x); }

/* ── Player detail ─────────────────────────────────────────────────────────── */

.detail h2 { margin: 0 0 4px; font-size: 20px; }
.detail-head { padding: 20px; border-bottom: 1px solid var(--hairline); }
.detail-body { padding: 20px; display: grid; gap: 24px; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12px; }

.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 600; margin: 0 0 8px;
}

.banner {
  border: 1px solid var(--danger);
  background: rgba(255, 84, 112, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 12px;
  font-size: 13px;
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.mini {
  border-top: 1px solid var(--hairline);
  padding: 9px 0;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; font-size: 12px;
}
.mini:first-of-type { border-top: none; }

/* ── Confirm dialog ────────────────────────────────────────────────────────── */

.confirm {
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 24px;
  width: min(460px, calc(100vw - 32px));
}
.confirm::backdrop { background: rgba(0, 4, 10, 0.72); }
.confirm h2 { margin: 0 0 6px; font-size: 18px; }
.confirm form { display: flex; flex-direction: column; gap: 6px; }
/* `align-items: center` matters: without it a flex child stretches to the row height, and
   the pills — which are rounded to their own height — render as tall ovals. */
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 18px; }
.field { display: contents; }

/* ── Toast ─────────────────────────────────────────────────────────────────── */

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  z-index: 50;
  max-width: min(560px, calc(100vw - 32px));
}
.toast.bad { border-color: var(--danger); color: var(--danger); }
.toast.good { border-color: var(--success); }

/* ── Sign-in divider ───────────────────────────────────────────────────────── */

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 14px;
  color: var(--muted); font-size: 12px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--hairline-strong);
}

#google-button { display: flex; justify-content: center; min-height: 40px; }
