:root {
  color-scheme: dark;
  --bg: #17181c;
  --panel: #23262d;
  --line: #363b45;
  --text: #f6f3e8;
  --muted: #aeb4c0;
  --accent: #ffd166;
  --danger: #ef476f;
  --good: #7bf1a8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 209, 102, 0.12), transparent 22rem),
    linear-gradient(135deg, #17181c 0%, #20242a 48%, #15171b 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hud {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.2rem;
}

#status {
  margin-top: 8px;
  color: var(--muted);
}

.meters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.meters span {
  min-width: 92px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(35, 38, 45, 0.82);
  color: var(--text);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101216;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  image-rendering: auto;
  cursor: crosshair;
}

.lobby {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(5px);
}

.lobby.hidden {
  display: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
button {
  width: min(280px, 74vw);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

input {
  background: #11141a;
  color: var(--text);
  padding: 0 12px;
}

button {
  background: var(--accent);
  color: #1b1608;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  filter: brightness(1.05);
}

@media (max-width: 720px) {
  .shell {
    padding: 12px;
  }

  .hud {
    align-items: stretch;
    flex-direction: column;
  }

  .meters {
    justify-content: stretch;
  }

  .meters span {
    flex: 1 1 120px;
  }
}
