:root {
  color-scheme: dark;
  --base: #111215;
  --panel: #1b1d22;
  --screen: #0a0b0d;
  --edge: #40434c;
  --silver: #f1f1f3;
  --muted: #b4b7c0;
  --red: #ff6175;
  --red-deep: #a62038;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--silver);
  background: var(--base);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button {
  min-height: 38px; padding: 6px 13px; border: 1px solid var(--edge); border-radius: 6px;
  color: var(--silver); background: #26282e; cursor: pointer;
}
button:hover { background: #363940; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
button:disabled { cursor: default; opacity: .55; }
.brand {
  display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 700;
  letter-spacing: .12em; color: var(--silver);
}
.brand svg {
  width: 34px; height: 34px; padding: 4px; border: 1px solid #87394a; border-radius: 7px;
  fill: none; stroke: var(--red); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  background: #311d25;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 70px; padding: 12px max(20px, calc((100% - 1360px) / 2));
  border-top: 3px solid var(--red-deep); border-bottom: 1px solid var(--edge); background: var(--panel);
}
.main { width: min(1360px, calc(100% - 40px)); margin: 32px auto 40px; }
.heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px;
}
h1 { margin: 0; font-size: clamp(25px, 4vw, 36px); font-weight: 650; letter-spacing: -.035em; }
p { color: var(--muted); margin: 6px 0 0; }
.count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.wall { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.wall.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--edge); border-radius: 9px; }
.tile-top, .tile-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px;
}
.tile h2 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.status {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 4px 8px;
  border: 1px solid #555862; border-radius: 20px; color: var(--muted); font-size: 11px; font-weight: 700;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tile[data-state="live"] .status { color: #ff8796; border-color: #914051; background: #352128; }
.screen {
  display: grid; position: relative; place-items: center; aspect-ratio: 16 / 9; background: var(--screen);
  border-top: 1px solid #2c2f36; border-bottom: 1px solid #2c2f36;
}
.screen video, .screen .empty { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen video { object-fit: contain; }
.screen .empty {
  display: grid; place-content: center; justify-items: center; gap: 7px; padding: 14px;
  color: var(--muted); text-align: center; background: var(--screen);
}
.crosshair { color: #7f6670; font-size: 27px; line-height: 1; }
.tile[data-state="live"] .empty { display: none; }
.tile-bottom > span { color: var(--muted); font-size: 12px; }
.tile-bottom { flex-wrap: wrap; }
.tile-actions { display: flex; gap: 7px; margin-left: auto; }
.tile-bottom button { font-size: 13px; }
.move-keys { display: flex; gap: 6px; }
.move-keys button { width: 44px; min-height: 44px; padding: 0; font-size: 20px; touch-action: none; user-select: none; }
.move-keys .light { width: auto; padding: 0 10px; font-size: 13px; }
.move-keys .light[data-on="true"] { border-color: var(--red); color: var(--red); }
.move-keys button[data-pressed] { background: #522636; border-color: var(--red); }
.move-status { font-size: 12px; }
.tile:fullscreen { display: grid; grid-template-rows: auto 1fr auto; border: none; border-radius: 0; }
.tile:fullscreen .screen { min-height: 0; aspect-ratio: auto; }
.notice { margin-top: 16px; border: 1px solid var(--edge); padding: 16px; border-radius: 8px; color: var(--muted); }
.signin {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(ellipse at 50% 10%, #30242a, var(--base) 62%);
}
.login-card {
  width: min(100%, 430px); padding: 30px; background: var(--panel); border: 1px solid var(--edge);
  border-top: 3px solid var(--red-deep); border-radius: 10px; box-shadow: 0 22px 70px #0007;
}
.login-card h1 { margin-top: 24px; }
.login-card form { display: grid; gap: 8px; margin-top: 23px; }
.login-card label { font-size: 14px; font-weight: 600; }
.login-card input {
  width: 100%; min-height: 44px; margin-bottom: 7px; padding: 9px 11px; color: var(--silver);
  border: 1px solid #626570; border-radius: 6px; background: #111216;
}
.form-error { color: #ff99a8; font-size: 14px; }
.form-error:empty { display: none; }
.primary { background: var(--red-deep); border-color: #db516a; font-weight: 650; min-height: 44px; margin-top: 5px; }
.primary:hover { background: #c22b46; }
@media (max-width: 700px) {
  .wall.two { grid-template-columns: minmax(0, 1fr); }
  .main { width: calc(100% - 24px); margin-top: 22px; }
  .topbar { padding-inline: 12px; }
}
