:root {
  --ink: #d7e3f4;
  --dim: #7f8ea6;
  --accent: #46d7ff;
  --warm: #ff8c32;
  --panel: rgba(10, 16, 28, 0.78);
  --line: rgba(120, 170, 220, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #03050a;
  color: var(--ink);
  font: 15px/1.45 "Inter", "Segoe UI", system-ui, sans-serif;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

[hidden] { display: none !important; }

/* Lobby */

#lobby {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(3, 5, 10, 0.25), rgba(3, 5, 10, 0.8));
}

.panel {
  width: min(440px, calc(100vw - 32px));
  padding: 28px 30px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 4px;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(70, 215, 255, 0.06);
}

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.panel > label:first-child { margin-top: 0; }

input {
  width: 100%;
  padding: 9px 11px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 3px;
  font: inherit;
  outline: none;
}

input:focus { border-color: var(--accent); }

.row { display: flex; gap: 8px; }

button {
  padding: 9px 16px;
  color: #04121a;
  background: var(--accent);
  border: 0;
  border-radius: 3px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

button:hover { filter: brightness(1.15); }
button:disabled { opacity: 0.4; cursor: default; filter: none; }

#sessions {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 210px;
  overflow-y: auto;
}

#sessions li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  margin-bottom: 6px;
  background: rgba(0, 0, 0, 0.25);
}

#sessions li.empty {
  color: var(--dim);
  border-style: dashed;
  padding: 10px 11px;
}

#sessions .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sessions .count { color: var(--dim); font-variant-numeric: tabular-nums; }
#sessions button { padding: 5px 12px; background: transparent; color: var(--accent); border: 1px solid var(--accent); }

#status {
  margin: 14px 0 0;
  min-height: 1.45em;
  font-size: 13px;
  color: var(--dim);
}

#status.error { color: #ff7a6b; }

/* In the game */

#hud { position: fixed; inset: 0; pointer-events: none; }

#hud-info, #hud-players, #hud-help {
  position: absolute;
  padding: 7px 11px;
  background: rgba(6, 10, 18, 0.55);
  border-left: 2px solid var(--accent);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: pre;
}

#hud-info { top: 14px; left: 14px; }
#hud-players { top: 14px; right: 14px; border-left: 0; border-right: 2px solid var(--warm); text-align: right; }
#hud-help { bottom: 14px; left: 50%; transform: translateX(-50%); border: 0; color: var(--dim); white-space: nowrap; }
#hud-help b { color: var(--ink); font-weight: 600; }

#hud-alert {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 16px;
  background: rgba(120, 12, 8, 0.85);
  border: 1px solid #ff6b5a;
  color: #fff;
  font-weight: 600;
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

#leave {
  position: absolute;
  bottom: 14px;
  right: 14px;
  pointer-events: auto;
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line);
  font-weight: 400;
}

#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

.tag {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 1px 7px;
  font-size: 12px;
  color: #fff;
  background: rgba(6, 10, 18, 0.6);
  border-bottom: 2px solid var(--accent);
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
}
