html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #10131a;
  color: #f3f5f7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: none;
}

.hidden {
  display: none !important;
}

.login {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgb(77 163 255 / 24%), transparent 34%),
    radial-gradient(circle at 80% 70%, rgb(49 210 124 / 18%), transparent 34%),
    #10131a;
}

.login-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 24px;
  background: rgb(9 12 18 / 82%);
  box-shadow: 0 28px 80px rgb(0 0 0 / 42%);
  backdrop-filter: blur(14px);
}

.login-kicker {
  margin-bottom: 10px;
  color: #31d27c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 54px);
  line-height: 0.95;
}

.login-card p {
  margin: 16px 0 24px;
  color: #aab3c2;
  line-height: 1.5;
}

.login-card label {
  display: block;
  margin-bottom: 8px;
  color: #d7deea;
  font-size: 14px;
  font-weight: 700;
}

.login-card input,
.login-card select,
.login-card button {
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  font: inherit;
}

.login-card input,
.login-card select {
  height: 48px;
  margin-bottom: 14px;
  padding: 0 14px;
  border: 1px solid rgb(255 255 255 / 18%);
  outline: none;
  background: rgb(255 255 255 / 8%);
  color: #ffffff;
}

.login-card select option {
  color: #0b0f15;
}

.login-card input:focus,
.login-card select:focus {
  border-color: #4da3ff;
  box-shadow: 0 0 0 4px rgb(77 163 255 / 16%);
}

.login-card input[type="color"] {
  padding: 4px;
  cursor: pointer;
}

.login-card button {
  height: 52px;
  border: 0;
  background: linear-gradient(135deg, #31d27c, #4da3ff);
  color: #061018;
  cursor: pointer;
  font-weight: 900;
}

.login-card button:hover {
  filter: brightness(1.08);
}

.lobby-card {
  display: grid;
  gap: 14px;
}

.settings-panel {
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 16px;
  padding: 12px;
  background: rgb(255 255 255 / 5%);
}

.settings-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.settings-panel .room-form {
  margin-top: 12px;
}

.room-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}

.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 14px;
  background: rgb(255 255 255 / 7%);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.room-row:hover {
  border-color: #4da3ff;
}

.room-row:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.room-row strong,
.room-row small {
  display: block;
}

.room-row small,
.room-empty,
.room-error {
  color: #aab3c2;
  font-size: 13px;
}

.room-form {
  display: grid;
  gap: 8px;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px !important;
  color: #d7deea;
}

.checkbox-row input {
  width: auto;
  height: auto;
  margin: 0;
}

.room-error {
  padding: 10px 12px;
  border: 1px solid rgb(255 59 59 / 34%);
  border-radius: 12px;
  background: rgb(255 59 59 / 12%);
  color: #ffb3b3;
}

.hud {
  position: fixed;
  top: 16px;
  left: 16px;
  width: min(320px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 16px;
  background: rgb(9 12 18 / 78%);
  box-shadow: 0 16px 50px rgb(0 0 0 / 30%);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.hud strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

#status,
.match,
.help,
.weapon {
  color: #aab3c2;
  font-size: 13px;
}

.match {
  margin-top: 10px;
  color: #ffffff;
  font-weight: 800;
}

.weapon {
  margin-top: 10px;
  color: #ffe066;
  font-weight: 800;
}

#scoreboard {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
}

.score-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.match-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(0 0 0 / 36%);
  pointer-events: none;
}

.death-overlay {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.death-overlay-card {
  min-width: min(320px, 100%);
  padding: 22px 26px;
  border: 1px solid rgb(255 59 59 / 34%);
  border-radius: 20px;
  background: rgb(24 9 12 / 82%);
  box-shadow: 0 22px 60px rgb(0 0 0 / 38%);
  text-align: center;
  backdrop-filter: blur(12px);
}

.death-overlay-title {
  color: #ff7070;
  font-size: 34px;
  font-weight: 950;
}

.death-overlay-text {
  margin-top: 8px;
  color: #d7deea;
  font-size: 15px;
}

.kill-feed {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.kill-feed-row {
  padding: 9px 12px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 12px;
  background: rgb(9 12 18 / 78%);
  box-shadow: 0 10px 32px rgb(0 0 0 / 24%);
  color: #aab3c2;
  font-size: 13px;
  backdrop-filter: blur(10px);
}

.kill-feed-row strong {
  color: #ffffff;
}

.inventory {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(10, 56px);
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.inventory-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 14px;
  background: rgb(9 12 18 / 82%);
  box-shadow: 0 12px 34px rgb(0 0 0 / 30%);
  backdrop-filter: blur(10px);
}

.inventory-slot.active {
  border-color: #ffe066;
  box-shadow: 0 0 0 3px rgb(255 224 102 / 18%), 0 12px 34px rgb(0 0 0 / 30%);
}

.inventory-slot.empty {
  opacity: 0.42;
}

.slot-key {
  position: absolute;
  top: 5px;
  left: 7px;
  color: #aab3c2;
  font-size: 11px;
  font-weight: 900;
}

.weapon-mini {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 18px;
  margin-top: 8px;
  border-radius: 5px;
  background: #2f3948;
  color: #ffe066;
  font-size: 10px;
  font-weight: 950;
}

.weapon-mini::after {
  content: "";
  position: absolute;
  right: -12px;
  top: 6px;
  width: 14px;
  height: 4px;
  border-radius: 999px;
  background: #9aa7b8;
}

.weapon-mini::before {
  content: "";
  position: absolute;
  left: 6px;
  bottom: -12px;
  width: 7px;
  height: 13px;
  border-radius: 3px;
  background: #171d27;
}

.weapon-smg {
  width: 36px;
}

.weapon-shotgun {
  width: 42px;
  background: #3a2418;
}

.weapon-shotgun::after {
  right: -18px;
  width: 20px;
  box-shadow: 0 6px 0 #9aa7b8;
}

.match-overlay-card {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 24px;
  background: rgb(9 12 18 / 86%);
  box-shadow: 0 28px 80px rgb(0 0 0 / 46%);
  text-align: center;
  backdrop-filter: blur(14px);
}

.scoreboard-overlay,
.instructions-overlay,
.esc-menu {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(0 0 0 / 28%);
  pointer-events: none;
}

.esc-menu {
  z-index: 7;
  pointer-events: auto;
}

.scoreboard-card,
.instructions-card,
.esc-card {
  width: min(560px, 100%);
  padding: 26px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 24px;
  background: rgb(9 12 18 / 88%);
  box-shadow: 0 28px 80px rgb(0 0 0 / 46%);
  backdrop-filter: blur(14px);
}

.esc-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
}

.esc-title {
  font-size: clamp(30px, 6vw, 48px);
  font-weight: 950;
  line-height: 1;
}

.esc-room {
  color: #aab3c2;
}

.esc-card button {
  height: 50px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #31d27c, #4da3ff);
  color: #061018;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.esc-card .danger-button {
  background: linear-gradient(135deg, #ff7070, #ffb86c);
}

.scoreboard-title,
.instructions-title {
  margin-top: 8px;
  font-size: clamp(30px, 6vw, 50px);
  font-weight: 950;
  line-height: 1;
}

.scoreboard-subtitle,
.instructions-note {
  margin-top: 8px;
  color: #aab3c2;
}

.scoreboard-table,
.end-leaderboard {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 32px 1fr 48px 48px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
  background: rgb(255 255 255 / 6%);
}

.leaderboard-row i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
}

.leaderboard-row small {
  color: #aab3c2;
}

.leaderboard-empty {
  color: #aab3c2;
}

.instructions-grid {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px 14px;
  margin-top: 20px;
}

.instructions-grid span {
  color: #ffe066;
  font-weight: 900;
}

.match-overlay-kicker {
  color: #ffe066;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.match-overlay-title {
  margin-top: 10px;
  font-size: clamp(34px, 7vw, 64px);
  font-weight: 950;
  line-height: 0.95;
}

.match-overlay-text {
  margin-top: 14px;
  color: #aab3c2;
  font-size: 16px;
}
