html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #02030a;
  color: #cfe4ff;
  font-family: "Segoe UI", system-ui, sans-serif;
}

#app {
  display: grid;
  height: 100%;
}

#app > * {
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 0;
}

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

#hud {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 22px;
  pointer-events: none;
  user-select: none;
}

#hud-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 17px;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(80, 220, 255, 0.55);
}

#msg {
  flex: 1;
  text-align: center;
  color: #ffb3a8;
  opacity: 0;
  transition: opacity 0.3s;
}

#msg.show { opacity: 1; }

#hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 2px;
}

.track {
  width: 220px;
  height: 10px;
  border: 1px solid rgba(120, 225, 255, 0.5);
  border-radius: 5px;
  overflow: hidden;
  background: rgba(15, 35, 60, 0.5);
}

.fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #2fc7f0, #7ceaff);
  transition: width 0.12s linear;
}

#shield-fill {
  background: linear-gradient(90deg, #35d17a, #9df0c0);
}

#shield-fill.low {
  background: linear-gradient(90deg, #e2493b, #ff9d7d);
}

.track.hit {
  border-color: #ff5f4d;
  box-shadow: 0 0 12px rgba(255, 80, 60, 0.9);
}

#overlay {
  display: grid;
  place-items: center;
  background: rgba(2, 4, 12, 0.78);
  cursor: pointer;
  text-align: center;
  overflow-y: auto;
  padding: 24px 0;
}

#overlay.hidden { display: none; }

#home-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(120, 225, 255, 0.4);
  border-radius: 10px;
  background: rgba(8, 14, 30, 0.85);
  color: #9fdcff;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

#home-btn svg { width: 24px; height: 24px; }

#home-btn:hover {
  color: #52e6ff;
  border-color: rgba(82, 230, 255, 0.8);
  box-shadow: 0 0 14px rgba(60, 210, 255, 0.35);
}

#overlay-card {
  padding: 30px 44px;
  border: 1px solid rgba(110, 220, 255, 0.35);
  border-radius: 14px;
  background: rgba(8, 14, 30, 0.88);
  box-shadow: 0 0 40px rgba(50, 190, 255, 0.22), inset 0 0 24px rgba(50, 190, 255, 0.05);
  max-width: 560px;
}

#overlay-card h1 {
  margin: 0 0 14px;
  font-size: 40px;
  letter-spacing: 8px;
  color: #eaf7ff;
  text-shadow: 0 0 16px rgba(80, 220, 255, 0.85), 0 0 34px rgba(255, 90, 220, 0.25);
}

#overlay-card p {
  margin: 6px 0;
  font-size: 14px;
  color: #a9c6e8;
}

#overlay-card .cta {
  margin-top: 14px;
  font-size: 17px;
  letter-spacing: 3px;
  color: #6fe6ff;
}

#mobile-note {
  color: #ffb3a8 !important;
  font-size: 15px !important;
  letter-spacing: 1px;
}

.hidden { display: none !important; }

#nick-row { margin-top: 16px; }

#nick-input {
  width: 240px;
  padding: 9px 12px;
  background: rgba(12, 24, 44, 0.9);
  border: 1px solid rgba(120, 225, 255, 0.45);
  border-radius: 8px;
  color: #dff4ff;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 1px;
  text-align: center;
  outline: none;
}

#nick-input:focus {
  border-color: rgba(90, 230, 255, 0.9);
  box-shadow: 0 0 10px rgba(60, 210, 255, 0.3);
}

#nick-error {
  min-height: 18px;
  margin-top: 5px;
  font-size: 12.5px;
  color: #ff8d7d;
  letter-spacing: 1px;
}

#overlay-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

#overlay-buttons button {
  padding: 10px 18px;
  background: rgba(30, 75, 130, 0.35);
  border: 1px solid rgba(110, 220, 255, 0.5);
  border-radius: 8px;
  color: #dff4ff;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 2px;
  cursor: pointer;
}

#overlay-buttons button:hover {
  background: rgba(55, 135, 210, 0.5);
  box-shadow: 0 0 12px rgba(60, 210, 255, 0.3);
}

#radar {
  border-radius: 50%;
  opacity: 0.85;
  align-self: flex-end;
}

#speed-fill.boost {
  background: linear-gradient(90deg, #ff5ad0, #ffa4e6);
}

#board {
  margin-top: 22px;
  border-top: 1px solid rgba(110, 220, 255, 0.25);
  padding-top: 14px;
}

#board h2 {
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: 2px;
  color: #bfe8ff;
}

#board-week { color: #6fe6ff; font-weight: 400; }

#board-list {
  margin: 0;
  padding: 0 0 0 26px;
  text-align: left;
  font-size: 13.5px;
  color: #a9c6e8;
  max-height: 190px;
  overflow-y: auto;
}

#board-list li { padding: 2px 0; }

#board-list li .b-score { float: right; color: #6fe6ff; }

.board-loading { list-style: none; color: #7d97b8; }

.board-note {
  font-size: 11.5px !important;
  color: #7d97b8 !important;
  margin-top: 8px !important;
}
