:root {
  --hud-width: min(360px, 88vw);
  --bg: #060606;
  --bg-deep: #000000;
  --neon: #f2f2f2;
  --neon-soft: rgba(255, 255, 255, 0.28);
  --neon-strong: rgba(255, 255, 255, 0.7);
  --panel: rgba(10, 10, 10, 0.88);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 20% 10%, #1b1b1b 0%, var(--bg) 40%, var(--bg-deep) 100%);
  font-family: "Share Tech Mono", monospace;
  color: var(--neon);
  user-select: none;
}

#matrix-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

#scene-root {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--hud-width);
  z-index: 1;
}

#scene-root canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 2;
  width: var(--hud-width);
  border-right: 1px solid var(--neon-soft);
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.9) 0%, var(--panel) 100%);
  backdrop-filter: blur(5px);
  box-shadow: 0 0 1rem rgba(255, 255, 255, 0.12), inset 0 0 2rem rgba(255, 255, 255, 0.06);
  display: flex;
}

.hud-inner {
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  min-height: 100%;
}

.hud h1 {
  margin: 0 0 0.75rem;
  letter-spacing: 0.14em;
  font-size: clamp(1rem, 2.8vw, 1.35rem);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.42);
}

.hud p {
  margin: 0.1rem 0;
  font-size: clamp(0.78rem, 2.2vw, 0.95rem);
  line-height: 1.35;
  color: #dfdfdf;
}

.register-form {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.register-form label {
  color: #efefef;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.register-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.52);
  color: #f4f4f4;
  font-family: inherit;
  padding: 0.45rem 0.55rem;
  outline: none;
}

.register-form input:focus {
  border-color: var(--neon-strong);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

#register-btn,
#start-btn {
  margin-top: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: #f3f3f3;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.55rem 0.95rem;
  font-family: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 130ms ease, box-shadow 130ms ease, background 130ms ease;
}

#register-btn:hover,
#start-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.26);
}

#register-btn:active,
#start-btn:active {
  transform: translateY(0);
}

#start-btn {
  margin-top: 0.8rem;
}

#register-btn:disabled,
#start-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

.timer-box {
  margin-top: 0.95rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timer-box span {
  color: #ececec;
  font-size: 0.85rem;
}

.timer-box strong {
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.status-text {
  margin-top: 0.65rem;
  border: 1px dashed rgba(255, 255, 255, 0.32);
  padding: 0.55rem 0.6rem;
  min-height: 62px;
}

@media (max-width: 860px) {
  :root {
    --hud-width: min(330px, 92vw);
  }

  .hud {
    width: var(--hud-width);
  }
}

@media (max-width: 700px) {
  .hud {
    width: 100%;
    max-height: 48vh;
    bottom: auto;
    border-right: 0;
    border-bottom: 1px solid var(--neon-soft);
  }

  .hud-inner {
    min-height: auto;
  }

  #scene-root {
    inset: 0;
  }
}
