[hidden] { display: none !important; }

:root {
  --fg: #c8d3dc;
  --dim: #7d8a96;
  --accent: #2a9df4;
  --alien: #e0a020;
  --panel: rgba(6, 12, 20, 0.78);
  --edge: rgba(42, 157, 244, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--fg);
  font: 15px/1.45 Tahoma, Verdana, "DejaVu Sans", sans-serif;
}
/* the start page scrolls, the game doesn't */
body.playing { overflow: hidden; }

#backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) saturate(0.9);
}

#launcher {
  position: relative;
  max-width: 560px;
  margin: 6vh auto 0;
  padding: 0 16px 24px;
  text-align: center;
}

.logo { width: 96px; height: 96px; image-rendering: pixelated; }

h1 {
  margin: 8px 0 0;
  font-size: 30px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 12px var(--accent);
}
h1 span { font-size: 14px; color: var(--alien); text-shadow: none; }

.tagline { margin: 4px 0 20px; color: var(--dim); }

.panel {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 2px;
  padding: 14px 18px;
  margin-bottom: 14px;
  text-align: left;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.6);
}

label { display: block; color: var(--dim); margin-bottom: 4px; }

#launcher input:not([type=checkbox]), #launcher select {
  width: 100%;
  padding: 7px 9px;
  font: inherit;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--edge);
  outline: none;
}
#launcher select option, #launcher select optgroup { background: #0a121c; }
#launcher input:focus, #launcher select:focus { border-color: var(--accent); }
#password-row { margin-top: 10px; }

.panel h2 { margin: 0 0 10px; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; }
.dim { color: var(--dim); }
.note { margin: 4px 0 0; font-size: 12px; color: var(--dim); min-height: 0; }
.note:empty { display: none; }

details { margin: 12px 0 4px; }
summary { cursor: pointer; color: var(--dim); }
details label { margin: 6px 0; font-size: 13px; }
details.options { padding-top: 10px; padding-bottom: 10px; }
details.options summary { font-size: 13px; }

/* games on the server */
#games { list-style: none; margin: 0; padding: 0; }
#games li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(42, 157, 244, 0.2);
}
#games li:first-child { border-top: 0; padding-top: 0; }
#games li > div { flex: 1; min-width: 0; }
.game-name { color: #fff; font-weight: bold; overflow-wrap: anywhere; }
.game-meta { font-size: 13px; }
.game-meta.dim { font-size: 12px; }
#no-games { margin: 0; font-size: 13px; }

/* host form */
.field { margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0 12px; }
.grid label { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
fieldset { border: 1px solid rgba(42, 157, 244, 0.25); margin: 12px 0 0; padding: 8px 12px 10px; }
legend { color: var(--dim); padding: 0 4px; font-size: 13px; }
label.check { display: block; color: var(--fg); margin: 4px 0; cursor: pointer; }
label.check small { display: block; margin-left: 22px; color: var(--dim); font-size: 12px; }
.dim-content label.check { opacity: 0.55; }
.plugins label.check { font-size: 12px; }
#h-bots-note { margin: -4px 0 6px; color: var(--alien); }

button#host, #games button {
  font: bold 15px Tahoma, Verdana, sans-serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(#1f6fb0, #0d3d66);
  border: 1px solid var(--accent);
  cursor: pointer;
}
button#host { width: 100%; margin-top: 14px; padding: 10px; }
#games button { padding: 7px 14px; font-size: 13px; letter-spacing: 0.1em; flex: none; }
button#host:hover:not(:disabled), #games button:hover:not(:disabled) { background: linear-gradient(#2a86d0, #11507f); }
button#host:disabled, #games button:disabled { opacity: 0.5; cursor: default; }
button.link { background: none; border: 0; padding: 0; margin: 6px 0 2px; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; }

#status { min-height: 0; margin: 8px 0 0; color: var(--alien); font-size: 13px; }
#status:empty { display: none; }

.hint { color: var(--dim); font-size: 12px; }
kbd { border: 1px solid var(--dim); padding: 0 4px; border-radius: 2px; font-size: 11px; }

/* loading: a veil over the start page, so its text doesn't mix with the progress */
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12vh;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  z-index: 2;
}
#loading .box {
  width: min(480px, 80vw);
  padding: 14px 18px 16px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--edge);
}
#loading-text { margin: 0 0 10px; color: #fff; }
#loading .bar { height: 6px; background: rgba(255, 255, 255, 0.15); }
#loading-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

#canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  outline: none;
  background: #000;
  z-index: 1;
}

/* help page */
body.doc { overflow: auto; background: #05080c; }
.help { max-width: 980px; margin: 0 auto; padding: 24px 16px 60px; }
.help h1 { text-align: left; font-size: 26px; }
.help h1 span { display: block; margin-top: 2px; }
.help h2 { margin: 0 0 10px; color: #fff; font-size: 19px; letter-spacing: 0.04em; }
.help h3 { margin: 16px 0 6px; color: var(--alien); font-size: 15px; }
.help p, .help li { color: var(--fg); }
.help a { color: var(--accent); }
.help code, .help pre { font: 13px/1.4 "DejaVu Sans Mono", Consolas, monospace; color: #e8eef2; }
.help pre { background: rgba(0, 0, 0, 0.5); border: 1px solid #1c2a38; padding: 10px; overflow-x: auto; }
.help table { border-collapse: collapse; width: 100%; margin: 6px 0; }
.help caption { text-align: left; color: var(--alien); font-weight: bold; padding: 4px 0; }
.help td { border-top: 1px solid #1c2a38; padding: 4px 8px 4px 0; vertical-align: top; }
.help td:first-child { white-space: nowrap; width: 1%; }
.help .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 24px; }
.crumbs { margin-bottom: 12px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.helplink { color: var(--accent); }

#esc-hint {
  position: fixed;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--accent);
  color: #fff;
  pointer-events: none;
  z-index: 3;
}
/* the connection to the gateway dropped, reconnecting (shown over the game) */
#reconnect {
  position: fixed;
  top: 20vh;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--alien);
  color: #fff;
  text-align: center;
  pointer-events: none;
  z-index: 3;
}
#reconnect strong { display: block; color: var(--alien); }
#crash {
  position: fixed;
  top: 30vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 90vw);
  z-index: 3;
}
#crash h2 { margin: 0 0 8px; color: var(--alien); }
#crash p { word-break: break-word; }
#crash button {
  padding: 8px 14px; font: inherit; color: #fff; cursor: pointer;
  background: linear-gradient(#1f6fb0, #0d3d66); border: 1px solid var(--accent);
}
