* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
  overflow: hidden;
}

#game {
  display: block;
  background: #0f3460;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#splash, #over {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

#splash.hidden, #over.hidden {
  display: none;
}

#over-board {
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid #ff6b35;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  min-width: 260px;
  max-width: 340px;
  margin: 0 0 1.4rem;
}

#over-board h3 {
  color: #ff6b35;
  margin-bottom: 0.55rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

#over-list {
  list-style: none;
  font-size: 0.95rem;
}

#over-list li {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 0.35rem;
  opacity: 0.85;
}

#over-list li.you {
  color: #ff6b35;
  font-weight: bold;
  opacity: 1;
}

#over-list li.dead {
  opacity: 0.45;
}

#over p {
  margin-bottom: 1.1rem;
}

h1 {
  font-size: 4rem;
  color: #ff6b35;
  text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
  margin-bottom: 1rem;
  font-weight: 900;
}

p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  text-align: center;
  max-width: 400px;
}

.name-row {
  display: flex;
  gap: 1rem;
}

input {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #ff6b35;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  width: 200px;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: bold;
  background: #ff6b35;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background: #ff8555;
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

#hud {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  pointer-events: none;
  z-index: 50;
}

#board {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #ff6b35;
  border-radius: 8px;
  padding: 1rem;
  max-width: 250px;
  backdrop-filter: blur(5px);
}

#board h3 {
  color: #ff6b35;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

#board-list {
  list-style: none;
  font-size: 0.85rem;
}

#board-list li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  opacity: 0.8;
}

#board-list li.you {
  color: #ff6b35;
  font-weight: bold;
  opacity: 1;
}

.swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 0.5rem;
}

#status {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #ff6b35;
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.9rem;
  backdrop-filter: blur(5px);
}

#status div {
  margin-bottom: 0.25rem;
}

#buff {
  color: #ffd166;
}

#orbs {
  color: #7cf0ff;
}

#crew {
  color: #e0b3ff;
}

#legend {
  position: absolute;
  left: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #ff6b35;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  backdrop-filter: blur(5px);
}

#legend h3 {
  color: #ff6b35;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.legend {
  list-style: none;
  display: grid;
  gap: 0.28rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  opacity: 0.92;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.legend b {
  min-width: 3.6rem;
  letter-spacing: 0.04em;
}

.splash-legend {
  margin: 0 0 1.4rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 107, 53, 0.45);
  border-radius: 10px;
  text-align: left;
}

#toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 107, 53, 0.9);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#toast:not(:empty) {
  opacity: 1;
}