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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(28, 39, 52, 0.9), rgba(13, 17, 24, 0.95)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 44px);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  background: #f4b942;
  color: #221704;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #ffd166;
}

input {
  min-width: 0;
  border: 1px solid #33465d;
  border-radius: 6px;
  padding: 11px 12px;
  background: #121a25;
  color: #f8fbff;
  outline: none;
}

input:focus {
  border-color: #5ad7ff;
  box-shadow: 0 0 0 3px rgba(90, 215, 255, 0.16);
}

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

.hidden {
  display: none !important;
}

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

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

.mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #f4b942;
  color: #1f1707;
  font-weight: 900;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

p {
  margin: 6px 0 0;
  color: #b8c8d8;
}

.join-panel {
  border: 1px solid #26364a;
  border-radius: 8px;
  padding: 18px;
  background: rgba(15, 22, 31, 0.86);
}

.join-panel label {
  display: block;
  margin-bottom: 8px;
  color: #dce7f3;
  font-size: 0.92rem;
  font-weight: 700;
}

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

.status {
  min-height: 22px;
  font-size: 0.92rem;
}

.game-wrap {
  width: 100%;
  display: grid;
  gap: 12px;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}

.hud strong {
  display: block;
}

#connection-label {
  display: block;
  color: #99adbf;
  font-size: 0.86rem;
}

.scoreboard {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.scoreboard li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  height: 32px;
  border: 1px solid #2a3b4e;
  border-left: 4px solid var(--player-color, #f4b942);
  border-radius: 6px;
  padding: 0 9px;
  background: #121a25;
}

.scoreboard span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoreboard strong {
  margin-left: auto;
}

.canvas-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #304357;
  border-radius: 8px;
  overflow: hidden;
  background: #111722;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  image-rendering: auto;
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 16px, 960px);
    padding: 12px 0;
  }

  .brand {
    align-items: flex-start;
  }

  .mark {
    width: 48px;
    height: 48px;
  }

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

  .join-row {
    display: grid;
  }

  .hud {
    display: grid;
    align-items: start;
  }

  .scoreboard {
    justify-content: flex-start;
  }
}
