:root {
  --bg: #0c0d10;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-line: rgba(255, 255, 255, 0.09);
  --ink: #edeef1;
  --muted: #8f95a3;
  --accent: #6ea8fe;
  --good: #4ac776;
  --warn: #e8b84b;
  --bad: #ff6b6b;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body.centred {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pad { padding: 16px; }

/* ---- chrome ---- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(12, 13, 16, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--panel-line);
}

.bar-left, .bar-right { display: flex; align-items: center; gap: 10px; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(74, 199, 118, 0.5);
  animation: pulse 2.4s ease-out infinite;
}
.dot.stale { background: var(--warn); animation: none; }
.dot.dead { background: var(--bad); animation: none; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 199, 118, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(74, 199, 118, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 199, 118, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
}

/* ---- panels ---- */

.card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 16px;
}

.login { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; }
.login form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

label { font-size: 13px; color: var(--muted); }

input[type="password"] {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--panel-line);
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: inherit;
  min-height: 44px;
}
input[type="password"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #06121f;
  font: inherit;
  font-weight: 640;
  cursor: pointer;
}
button.ghost {
  background: transparent;
  border-color: var(--panel-line);
  color: var(--ink);
  font-weight: 500;
  min-height: 34px;
  padding: 6px 12px;
}
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.error { color: var(--bad); margin: 0; font-size: 13.5px; }

/* ---- game blocks ---- */

.game { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.game + .game { border-top: 1px solid var(--panel-line); }

.game-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.tile {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tile .value { font-size: 24px; font-weight: 660; letter-spacing: -0.02em; }
.tile .label { font-size: 12px; color: var(--muted); }
.tile .value.good { color: var(--good); }
.tile .value.warn { color: var(--warn); }
.tile .value.bad { color: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
caption { text-align: left; font-size: 12px; color: var(--muted); padding-bottom: 6px; }
th, td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--panel-line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 600; color: var(--muted); font-size: 12px; }
tr.alert td { background: rgba(255, 107, 107, 0.09); }

.scroll { overflow-x: auto; }

.bar-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  min-width: 70px;
}
.bar-fill { height: 100%; border-radius: 3px; background: var(--good); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.bad { background: var(--bad); }

.notice {
  border-radius: var(--radius);
  border: 1px solid rgba(232, 184, 75, 0.3);
  background: rgba(232, 184, 75, 0.08);
  padding: 10px 12px;
  font-size: 13px;
}
.notice.bad { border-color: rgba(255, 107, 107, 0.3); background: rgba(255, 107, 107, 0.08); }

footer { border-top: 1px solid var(--panel-line); max-width: 760px; }

@media (max-width: 520px) {
  .tile .value { font-size: 20px; }
  .game, .pad { padding: 12px; }
}
