* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1b1d22;
  color: #f2f2f2;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

[hidden] {
  display: none !important;
}

#game {
  position: absolute;
  inset: 0;
  margin: auto;
  display: block;
}

.muted {
  color: #99a;
}

.error {
  margin: 0;
  min-height: 1em;
  color: #ff7a7a;
}

button {
  font: inherit;
  cursor: pointer;
}

button.primary {
  font-weight: 600;
  padding: 10px 18px;
  border: 0;
  border-radius: 6px;
  background: #ffca28;
  color: #222;
}

button.primary:disabled {
  background: #555;
  color: #999;
  cursor: default;
}

input {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #1b1d22;
  color: inherit;
}

input:disabled {
  color: #aab;
  border-color: #3a3d45;
}

/* ---------- Panels (join form, lobby) ---------- */

.panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: calc(100% - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: #2a2d35;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.panel h1 {
  margin: 0;
  font-size: 32px;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

#join {
  width: min(360px, calc(100% - 32px));
}

#join .tagline {
  margin: -8px 0 4px;
  color: #aab;
}

#join small,
#join .hint {
  margin: 0;
  font-size: 13px;
  color: #99a;
}

#lobby {
  width: min(640px, calc(100% - 32px));
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lobby-actions {
  display: flex;
  gap: 8px;
}

.lobby-header button,
#hud .mute-toggle {
  padding: 6px 12px;
  border: 1px solid #888;
  border-radius: 6px;
  background: transparent;
  color: inherit;
}

.lobby-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 560px) {
  .lobby-columns {
    grid-template-columns: 1fr;
  }
}

#lobby-players {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#lobby-players li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  flex: none;
}

.badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #ffca28;
  color: #222;
  font-weight: 600;
}

.me-tag {
  font-size: 12px;
  color: #99a;
}

#settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#mode-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 14px;
}

#mode-options legend {
  margin-bottom: 4px;
  color: #99a;
  font-size: 13px;
}

#mode-options label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

#rules-summary {
  margin: 0;
  font-size: 13px;
}

.lobby-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.lobby-footer p {
  margin: 0;
  font-size: 14px;
}

/* ---------- Match results (in the lobby) ---------- */

#results {
  padding: 14px 16px;
  background: #1f2228;
  border-radius: 8px;
}

#results h2 {
  margin-bottom: 4px;
}

#results .award {
  margin: 6px 0;
  font-size: 18px;
}

#results .award strong {
  color: #ffca28;
}

#results .weekend strong {
  color: #ff8a80;
}

#results table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

#results th {
  text-align: left;
  font-weight: 500;
  color: #99a;
  border-bottom: 1px solid #3a3d45;
  padding: 4px 6px;
}

#results td {
  padding: 4px 6px;
}

#results td.num,
#results th.num {
  text-align: right;
}

#results tr.me td {
  color: #ffca28;
  font-weight: 600;
}

/* ---------- In-game HUD ---------- */

#hud {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  font-size: 14px;
}

#hud .mute-toggle {
  padding: 0 6px;
  font-size: 14px;
}

#match-info {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#match-info.urgent {
  color: #ff8a80;
}

#scoreboard {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 190px;
  margin: 0;
  padding: 6px 10px;
  list-style: none;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  font-size: 13px;
}

#scoreboard li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 1px 0;
}

#scoreboard li.me {
  color: #ffca28;
  font-weight: 600;
}

#scoreboard li.out {
  color: #777;
  text-decoration: line-through;
}

#scoreboard .score {
  font-variant-numeric: tabular-nums;
  color: #ccd;
}

#scoreboard .stars {
  color: #ffca28;
  margin-left: 4px;
  font-size: 11px;
}

#killfeed {
  position: absolute;
  bottom: 8px;
  right: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 13px;
  pointer-events: none;
}

#killfeed li {
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  transition: opacity 0.5s;
}

#killfeed li.fading {
  opacity: 0;
}

#killfeed .verb {
  color: #aab;
}

#death-banner {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  font-size: 20px;
  text-align: center;
  pointer-events: none;
}

#death-banner small {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: #aab;
}

#round-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: min(360px, calc(100% - 32px));
  padding: 20px 28px;
  background: rgba(20, 22, 27, 0.88);
  border-radius: 12px;
  text-align: center;
  pointer-events: none;
}

#round-banner .title {
  font-size: 20px;
  color: #aab;
}

#round-banner .big {
  font-size: 64px;
  font-weight: 800;
  line-height: 1.1;
}

#round-banner .winner {
  margin: 6px 0 10px;
  font-size: 26px;
  font-weight: 700;
  color: #ffca28;
}

#round-banner ol {
  margin: 0 auto 10px;
  padding: 0;
  list-style: none;
  max-width: 280px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

#round-banner li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
}

#round-banner li.me {
  color: #ffca28;
}

#round-banner .next {
  font-size: 14px;
  color: #99a;
}

#weapon {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  font-size: 15px;
}

#weapon strong {
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  color: #ffca28;
}

/* ---------- Bots in the lobby ---------- */

#bot-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

#bot-controls select,
#bot-controls button {
  font: inherit;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #1b1d22;
  color: inherit;
}

#bot-controls button {
  white-space: nowrap;
}

#bot-controls button:disabled {
  color: #777;
  cursor: default;
}

.bot-tag {
  font-size: 12px;
  color: #99a;
}

.remove-bot {
  margin-left: auto;
  padding: 0 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background: transparent;
  color: #ff8a80;
  font-size: 13px;
}
