:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101314;
  color: #f8f0dc;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 216, 107, 0.13), transparent 25rem),
    linear-gradient(135deg, #101314 0%, #182125 45%, #2d151d 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  min-height: 44px;
  color: #1b1410;
  background: #ffd86b;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #ffe58f;
}

input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  min-height: 44px;
  padding: 0 14px;
  color: #fff7e4;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

input:focus {
  border-color: #ffd86b;
  box-shadow: 0 0 0 3px rgba(255, 216, 107, 0.2);
}

.hidden {
  display: none !important;
}

.screen {
  width: min(92vw, 760px);
}

.lobby-panel {
  display: grid;
  gap: 24px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(15, 18, 18, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.eyebrow,
.label {
  margin: 0;
  color: #ffd86b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 10px;
  font-size: clamp(42px, 8vw, 76px);
  line-height: 0.94;
}

.summary {
  margin: 0;
  max-width: 560px;
  color: rgba(248, 240, 220, 0.78);
  font-size: 18px;
  line-height: 1.45;
}

.join-form {
  display: grid;
  gap: 9px;
}

.join-form label {
  color: rgba(248, 240, 220, 0.76);
  font-size: 14px;
  font-weight: 700;
}

.join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.connection-note {
  min-height: 20px;
  color: rgba(248, 240, 220, 0.68);
  font-size: 14px;
}

#game-wrap {
  width: min(96vw, 1080px);
  display: grid;
  gap: 12px;
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.hud > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  background: rgba(9, 12, 13, 0.72);
}

.hud strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #fff8df;
  text-overflow: ellipsis;
  white-space: nowrap;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 216, 107, 0.32);
  border-radius: 8px;
  background: #161a1a;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  image-rendering: auto;
}

@media (max-width: 680px) {
  body {
    padding: 12px;
  }

  .lobby-panel {
    padding: 24px;
  }

  .join-row {
    grid-template-columns: 1fr;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud > div:last-child {
    grid-column: span 2;
  }
}
