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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 207, 74, 0.18), transparent 34rem),
    linear-gradient(135deg, #121820 0%, #1b242b 48%, #101418 100%);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(100vw, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  place-items: center;
}

.hidden {
  display: none !important;
}

.lobby {
  width: min(100%, 520px);
  display: grid;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid #ffcf4a;
  border-radius: 8px;
  background: #202a31;
  color: #ffcf4a;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
p {
  margin: 0;
}

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

p {
  color: #afbcc7;
  margin-top: 6px;
}

.join-panel,
.status-grid,
.hud,
.scoreboard {
  border: 1px solid #33434e;
  border-radius: 8px;
  background: rgba(20, 28, 34, 0.86);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.join-panel {
  padding: 18px;
  display: grid;
  gap: 10px;
}

label,
.status-grid span,
.hud span {
  color: #91a0ab;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.join-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  min-width: 0;
  border: 1px solid #455864;
  border-radius: 6px;
  padding: 11px 12px;
  background: #0e1419;
  color: #edf3f7;
  outline: none;
}

input:focus {
  border-color: #57d6ff;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: #ffcf4a;
  color: #11171d;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #ffe079;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
}

.status-grid div,
.hud div {
  padding: 14px;
  background: rgba(14, 20, 25, 0.7);
}

.status-grid strong,
.hud strong {
  display: block;
  margin-top: 4px;
}

.game-wrap {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  grid-template-rows: auto 1fr;
  gap: 14px;
  align-items: start;
}

.hud {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

canvas {
  width: 100%;
  max-height: calc(100vh - 145px);
  aspect-ratio: 16 / 9;
  image-rendering: auto;
  border: 1px solid #465965;
  border-radius: 8px;
  background: #182027;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

.scoreboard {
  width: 100%;
  min-height: 160px;
  padding: 10px;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 9px 8px;
  border-radius: 6px;
  color: #dce5ec;
}

.score-row.me {
  background: rgba(87, 214, 255, 0.12);
}

.score-row span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.score-row strong {
  color: #ffcf4a;
}

.score-row em {
  grid-column: 1 / -1;
  color: #91a0ab;
  font-size: 0.8rem;
  font-style: normal;
}

@media (max-width: 820px) {
  .shell {
    padding: 14px;
    place-items: start center;
  }

  .game-wrap {
    grid-template-columns: 1fr;
  }

  .hud {
    grid-template-columns: 1fr 1fr 1fr;
  }

  canvas {
    max-height: none;
  }
}
