:root {
  --bg: #05050c;
  --panel: rgba(7, 10, 20, 0.85);
  --line: rgba(255, 255, 255, 0.15);
  --text: #f5f7ff;
  --accent: #f25f5c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 20% 10%, #1b1f39 0%, #070812 35%, #040409 100%);
  color: var(--text);
  font-family: "Consolas", "Courier New", monospace;
}

canvas#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

.panel {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  pointer-events: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  backdrop-filter: blur(3px);
}

.hud-top,
.hud-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.hud-bottom {
  margin-top: 8px;
  opacity: 0.9;
}

.bombs-danger {
  color: #ff4d4d;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 20;
}

.card,
.stats-card {
  width: min(92vw, 760px);
  background: rgba(11, 13, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.card.compact {
  width: min(92vw, 420px);
  text-align: center;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-bottom: 8px;
}

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

#joinForm input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
}

#joinForm button {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  color: white;
  background: linear-gradient(90deg, #e63946, #f4a261);
  cursor: pointer;
}

.error {
  margin-top: 8px;
  min-height: 18px;
  color: #ff6b6b;
}

.hint {
  margin-top: 10px;
  opacity: 0.75;
  font-size: 12px;
}

.stats-card {
  max-height: 94vh;
  overflow: auto;
}

#statsTitle {
  font-size: 32px;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-align: center;
}

#statsDuration,
#statsCountdown {
  text-align: center;
  margin-bottom: 12px;
}

#statsMiniMap {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: 0 auto 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #0a0c15;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}

th,
td {
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px;
  text-align: center;
  font-size: 13px;
}

.explosions {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
}

#explosionList {
  margin: 8px 0 0;
  padding-left: 18px;
  max-height: 150px;
  overflow: auto;
  line-height: 1.3;
}

.hidden {
  display: none !important;
}

@media (max-width: 700px) {
  .panel {
    font-size: 12px;
    padding: 8px 10px;
  }

  .hud-top,
  .hud-bottom {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #statsTitle {
    font-size: 24px;
  }
}
