@font-face {
  font-family: "Michroma";
  src: url("/static/fonts/Michroma-Regular.woff2") format("woff2");
  font-display: swap;
}
:root {
  --space: #02050c;
  --panel: rgba(5, 18, 36, .80);
  --panel-edge: #2a7cc4;
  --panel-glow: rgba(79, 179, 255, .28);
  --blue: #3f97dc;
  --blue-dim: #2b6aa3;
  --blue-hi: #9fdcff;
  --white: #eef6ff;
  --text: #cfe2f5;
  --muted: #7f9cba;
  --orange: #ff9a2e;
  --red: #e04848;
  --green: #3fbf55;
  --yellow: #f2c230;
  --pad-blue: #2f6fe0;
  --menu-font: "Michroma", "Eurostile", "Microgramma", "Bank Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--space);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
[hidden] { display: none !important; }

/* ---------- the scene: stars, the ring, Threshold */
#stars, .scene { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#stars { z-index: 0; }
.scene { z-index: 1; }
/* the background video covers the scene; the scene shows until it loads */
.backdrop {
  position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none; background: transparent;
}
.nebula {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 500px at 78% 18%, rgba(40, 70, 140, .30), transparent 70%),
    radial-gradient(700px 420px at 12% 85%, rgba(110, 40, 90, .22), transparent 70%),
    radial-gradient(1200px 700px at 50% 120%, rgba(20, 60, 110, .35), transparent 70%);
}

/* ---------- layout */
main {
  position: relative; z-index: 2; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 16px 96px;
}
.brand { text-align: center; margin: 2vh 0 4vh; user-select: none; }
.wordmark {
  margin: 0; font: 400 clamp(56px, 11vw, 108px)/1 var(--menu-font); letter-spacing: .18em; padding-left: .18em;
  background: linear-gradient(180deg, #ffffff 0%, #e2eefa 30%, #8eb2d8 52%, #46719f 60%, #c7dcf1 78%, #f4f9ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(80, 160, 255, .35)) drop-shadow(0 2px 0 rgba(0, 0, 0, .6));
  position: relative;
}
.brand .rule {
  height: 1px; width: min(720px, 86vw); margin: 10px auto 8px;
  background: linear-gradient(90deg, transparent, rgba(120, 200, 255, .7), transparent);
  box-shadow: 0 0 10px rgba(80, 170, 255, .6);
}
.brand .sub { font: 12px var(--menu-font); letter-spacing: .5em; color: var(--blue-hi); padding-left: .5em; }

.screen { width: 100%; max-width: 1000px; display: flex; flex-direction: column; align-items: center; }

/* ---------- Halo-style panels and titles */
.panel {
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 22px var(--panel-glow), inset 0 0 40px rgba(40, 130, 220, .12);
  padding: 22px 24px;
  backdrop-filter: blur(3px);
}
.title {
  margin: 0 0 16px; font: 400 20px/1.2 var(--menu-font); letter-spacing: .06em; text-transform: uppercase;
  background: linear-gradient(180deg, #d6f0ff, #4aa6ec 70%, #2c7fc8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(70, 160, 255, .45));
  display: flex; align-items: baseline; gap: 12px;
}
.title .count { font-size: 13px; }
.bar {
  height: 2px; margin: -6px 0 16px;
  background: linear-gradient(90deg, var(--panel-edge), rgba(42, 124, 196, 0));
}
.bar.spaced { margin-top: 12px; }

/* ---------- sign in / create user */
.auth { width: min(440px, 100%); }
.field { display: block; margin-bottom: 14px; }
.field span {
  display: block; margin-bottom: 6px; font: 11px var(--menu-font); letter-spacing: .14em; color: var(--blue-hi);
  text-transform: uppercase;
}
.field input {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 16px; color: var(--white);
  background: rgba(0, 8, 20, .75); border: 1px solid #1f5a90; border-radius: 6px; outline: none;
}
.field input:focus { border-color: var(--blue-hi); box-shadow: 0 0 0 3px rgba(79, 179, 255, .25), 0 0 14px rgba(79, 179, 255, .35); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.btn {
  flex: 1 1 160px; cursor: pointer; padding: 12px 16px; border-radius: 8px; white-space: nowrap;
  font: 13px var(--menu-font); letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue-hi); background: rgba(10, 40, 75, .7); border: 1px solid #2a7cc4;
  transition: color .15s, box-shadow .15s, background .15s;
}
.btn:hover, .btn:focus-visible { color: var(--white); box-shadow: 0 0 16px rgba(79, 179, 255, .55); outline: none; }
.btn.primary { background: linear-gradient(180deg, #2f8fe0, #175a9c); color: var(--white); border-color: #7cc6ff; }
.btn:disabled { opacity: .55; cursor: progress; }
.error { min-height: 22px; margin: 4px 0 10px; color: #ff8f8f; font-size: 14px; }
.fine { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.fine a, .help a { color: var(--blue-hi); }

/* ---------- main menu */
.layout { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
@media (max-width: 780px) { .layout { grid-template-columns: 1fr; } }
.welcome { font: 12px var(--menu-font); letter-spacing: .16em; color: var(--muted); margin: 0 0 18px; text-transform: uppercase; }
.welcome b { color: var(--blue-hi); font-weight: 400; }
.badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 4px; font-size: 10px;
  color: #1b1300; background: var(--orange); letter-spacing: .14em; vertical-align: 2px;
}
.menu { display: flex; flex-direction: column; align-items: flex-start; }
.item {
  background: none; border: 0; cursor: pointer; padding: 8px 0; text-align: left;
  font: 400 clamp(20px, 3vw, 28px)/1.25 var(--menu-font); letter-spacing: .04em; text-transform: uppercase;
  color: var(--blue); transition: color .12s, text-shadow .12s, transform .12s;
}
.item:hover, .item:focus-visible {
  color: var(--white); outline: none; transform: translateX(4px);
  text-shadow: 0 0 6px rgba(160, 220, 255, .9), 0 0 18px rgba(79, 179, 255, .8);
}
.item.danger:hover, .item.danger:focus-visible { text-shadow: 0 0 6px rgba(255, 160, 160, .9), 0 0 18px rgba(224, 72, 72, .8); }
.status { min-height: 24px; margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.status.error { color: #ff8f8f; }
.notice {
  width: 100%; margin: 0 0 18px; padding: 10px 14px; border-radius: 8px;
  color: #ffd7a8; background: rgba(60, 30, 0, .7); border: 1px solid #a8641c;
}

.players { list-style: none; margin: 0; padding: 0; }
.players li {
  display: flex; align-items: center; gap: 12px; padding: 10px 6px;
  border-top: 1px solid rgba(42, 124, 196, .35);
}
.players li:first-child { border-top: 0; }
.players .pad-icon { width: 34px; height: 24px; flex: none; color: var(--blue); }
.players .you .pad-icon { color: var(--green); }
.players .name { font: 14px var(--menu-font); letter-spacing: .06em; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .meta { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.players .tag { font-size: 10px; letter-spacing: .14em; color: var(--green); margin-left: 6px; font-family: var(--menu-font); }
.players .empty { color: var(--muted); justify-content: center; padding: 18px 0; }
.kick {
  margin-left: 10px; cursor: pointer; padding: 4px 10px; border-radius: 6px;
  font: 10px var(--menu-font); letter-spacing: .12em; color: #ffb4b4; background: rgba(70, 10, 14, .7); border: 1px solid #a33;
}
.kick:hover, .kick:focus-visible { color: #fff; box-shadow: 0 0 12px rgba(224, 72, 72, .7); outline: none; }

.help { width: 100%; margin-top: 28px; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 780px) { .help-grid { grid-template-columns: 1fr; } }
.help h3 { margin: 0 0 8px; font: 12px var(--menu-font); letter-spacing: .14em; color: var(--blue-hi); text-transform: uppercase; }
.help ul { margin: 0; padding-left: 18px; color: var(--text); font-size: 14px; }
.help li { margin-bottom: 4px; }
kbd {
  font: 12px ui-monospace, monospace; padding: 1px 6px; border-radius: 4px; color: var(--white);
  border: 1px solid #2a5f92; border-bottom-width: 2px; background: rgba(0, 10, 25, .8);
}

/* ---------- loading */
.loading { width: min(560px, 100%); text-align: center; }
.loading .title { justify-content: center; }
.segments { display: flex; gap: 5px; height: 16px; margin: 8px 0 14px; }
.segments i {
  flex: 1; border-radius: 2px; background: rgba(42, 124, 196, .25);
  animation: glow 1.4s ease-in-out infinite;
}
@keyframes glow {
  0%, 100% { background: rgba(42, 124, 196, .25); box-shadow: none; }
  40% { background: #7fd0ff; box-shadow: 0 0 10px rgba(127, 208, 255, .9); }
}

/* ---------- controller hints and version, as in the game's menus */
.hints {
  position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 28px;
  padding: 12px 16px; font: 12px var(--menu-font); letter-spacing: .1em; color: var(--blue-hi);
  background: linear-gradient(0deg, rgba(2, 8, 18, .95), rgba(2, 8, 18, 0));
  pointer-events: none;
}
.pad {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; margin-right: 6px;
  font: 700 11px system-ui, sans-serif; color: #fff; font-style: normal; vertical-align: -4px;
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .35), 0 0 6px rgba(0, 0, 0, .5);
}
.pad.a { background: radial-gradient(circle at 35% 30%, #8fe39b, var(--green) 60%); }
.pad.b { background: radial-gradient(circle at 35% 30%, #ff9a9a, var(--red) 60%); }
.pad.y { background: radial-gradient(circle at 35% 30%, #ffe48a, var(--yellow) 60%); color: #2b2100; }
.version {
  position: fixed; z-index: 3; right: 18px; bottom: 44px; font: 11px var(--menu-font); color: var(--orange);
  letter-spacing: .08em; text-shadow: 0 0 6px rgba(255, 140, 30, .5); pointer-events: none;
}
@media (max-width: 600px) { .version { display: none; } .hints { gap: 14px; font-size: 10px; } }

/* ---------- confirm dialog */
dialog {
  color: var(--text); background: rgba(5, 18, 36, .97); border: 2px solid var(--panel-edge); border-radius: 12px;
  box-shadow: 0 0 30px var(--panel-glow); padding: 22px 24px; max-width: 420px;
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog p { margin: 0 0 18px; }
dialog.wide { max-width: 520px; width: calc(100% - 32px); }
.warn {
  padding: 12px 14px; border-radius: 8px; color: #ffe2bf; background: rgba(70, 35, 0, .75); border: 1px solid #c77a22;
}
.warn b { color: #fff; }
.codes {
  list-style: none; margin: 0 0 16px; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px; border-radius: 8px; background: rgba(0, 8, 20, .8); border: 1px solid #1f5a90; counter-reset: code;
}
.codes li {
  counter-increment: code; font: 600 17px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em;
  color: var(--white); user-select: all;
}
.codes li::before { content: counter(code) "."; display: inline-block; width: 1.8em; color: var(--muted); font-weight: 400; }
@media (max-width: 480px) { .codes { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.link {
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--blue-hi);
  font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}
.link:hover, .link:focus-visible { color: var(--white); outline: none; }
.smallprint { margin: 12px 0 0; text-align: center; }
.smallprint.under-field { text-align: left; margin: -4px 0 10px; }
.smallprint .link { font-size: 12px; color: var(--muted); }
.step { margin: 0 0 14px; padding: 8px 12px; border-radius: 6px; color: #c9f5d0; background: rgba(10, 60, 25, .6); border: 1px solid #2f8f45; font-size: 14px; }

/* admin page */
.admin { width: 100%; }
.table-wrap { overflow-x: auto; }
.users { width: 100%; border-collapse: collapse; font-size: 14px; }
.users th {
  text-align: left; padding: 6px 10px 10px; white-space: nowrap; font: 10px var(--menu-font); letter-spacing: .14em;
  color: var(--blue-hi); text-transform: uppercase; border-bottom: 1px solid var(--panel-edge);
}
.users td { padding: 10px; border-top: 1px solid rgba(42, 124, 196, .35); white-space: nowrap; }
.users tr:first-child td { border-top: 0; }
.users .name { font-family: var(--menu-font); color: var(--white); }
.users .low { color: var(--orange); }
.users .row-actions { text-align: right; }
.users .row-actions button + button { margin-left: 8px; }
.flag { margin-left: 8px; font: 9px var(--menu-font); letter-spacing: .12em; color: var(--orange); }
.mini {
  cursor: pointer; padding: 5px 10px; border-radius: 6px; font: 10px var(--menu-font); letter-spacing: .12em;
  color: var(--blue-hi); background: rgba(10, 40, 75, .7); border: 1px solid #2a7cc4;
}
.mini:hover, .mini:focus-visible { color: #fff; box-shadow: 0 0 12px rgba(79, 179, 255, .6); outline: none; }
.admin .actions { margin-top: 18px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head .title { margin: 0; }
.admin-head .btn { flex: 0 0 auto; }
.admin h3 { margin: 26px 0 8px; font: 12px var(--menu-font); letter-spacing: .14em; color: var(--blue-hi); text-transform: uppercase; }
.setting { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; font-size: 14px; }
.setting input {
  width: 84px; padding: 6px 9px; font: inherit; color: var(--white); background: rgba(0, 8, 20, .75);
  border: 1px solid #1f5a90; border-radius: 6px; outline: none;
}
.setting input:focus { border-color: var(--blue-hi); box-shadow: 0 0 0 3px rgba(79, 179, 255, .25); }
.setting .what { color: var(--muted); font-size: 13px; }
.invites { list-style: none; margin: 0; padding: 0; }
.invites li { display: flex; align-items: center; gap: 14px; padding: 9px 4px; border-top: 1px solid rgba(42, 124, 196, .35); flex-wrap: wrap; }
.invites li:first-child { border-top: 0; }
.invites .code { font: 600 17px ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .12em; color: var(--white); }
.invites .code.dim { color: var(--muted); text-decoration: line-through; }
.invites .what { color: var(--muted); font-size: 13px; }
.invites .what.open { color: #9fe3ae; }
.invites button { margin-left: auto; }
.bigcode {
  display: block; margin: 6px 0 16px; text-align: center; font: 600 44px ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .18em; color: var(--white); text-shadow: 0 0 14px rgba(79, 179, 255, .6); user-select: all;
}
.btn.danger { color: #ffb4b4; background: rgba(70, 10, 14, .75); border-color: #a33; }
.btn.danger:hover, .btn.danger:focus-visible { color: #fff; box-shadow: 0 0 16px rgba(224, 72, 72, .6); }
code.pw {
  font: 600 18px ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .06em; color: var(--white);
  background: rgba(0, 8, 20, .8); border: 1px solid #1f5a90; padding: 2px 8px; border-radius: 4px; user-select: all;
}

/* short screens (laptops): a smaller title, so the forms clear the hint bar */
@media (max-height: 820px) {
  main { padding-top: 18px; padding-bottom: 84px; }
  .brand { margin: 0 0 2.5vh; }
  .wordmark { font-size: clamp(48px, 8vh, 80px); }
  .panel { padding: 18px 22px; }
  .field { margin-bottom: 10px; }
  /* the controller hints are decoration: on short screens they would cover the forms */
  .hints { display: none; }
  .version { bottom: 12px; }
  main { padding-bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) { .segments i { animation: none; background: #4aa6ec; } .item { transition: none; } }
