:root {
  --arena: #6b6b6b;
  --frame: #2a2a2a;
  --accent: #ffd60a;
  --magenta: #ff2fd6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: radial-gradient(circle at 50% 30%, #4a4a4a 0%, #262626 70%, #171717 100%);
  font-family: 'Space Grotesk', sans-serif;
  color: #fff;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
#wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
}
#hud {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 8px;
  gap: 12px;
}
#title {
  font-family: 'Bungee', sans-serif;
  font-size: clamp(15px, 3.6vw, 30px);
  letter-spacing: 1px;
  color: var(--accent);
  text-shadow: 3px 3px 0 #000, 0 0 18px rgba(255,214,10,0.4);
}
#roundinfo {
  font-family: 'Bungee', sans-serif;
  font-size: clamp(11px, 2.4vw, 18px);
  color: var(--magenta);
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
}
canvas {
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 3px #1a1a1a;
  display: block;
  touch-action: none;
}
#players {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 6px;
}
.pchip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  transition: all 0.3s;
}
.pchip.dead {
  opacity: 0.45;
  text-decoration: line-through;
  filter: grayscale(1);
}
.pdot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.pxmark { color: #ff5555; font-weight: 900; }

#leaderboard {
  position: fixed;
  top: 60px;
  right: 8px;
  background: rgba(20,20,20,0.85);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 130px;
  backdrop-filter: blur(4px);
}
.lbtitle {
  font-family: 'Bungee', sans-serif;
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 6px;
  text-align: center;
}
.lbrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 2px 0;
}
.lbdot { width: 9px; height: 9px; border-radius: 50%; }
.lbname { flex: 1; font-weight: 700; font-size: 10px; }
.lbwin {
  font-family: 'Bungee', sans-serif;
  color: #fff;
  font-size: 13px;
}
#controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
#controls button {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  background: #2a2a2a;
  color: #fff;
  border: 2px solid #444;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
#controls button:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  transform: translateY(-2px);
}
#controls button:active { transform: translateY(0); }
#remix {
  color: #999;
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px dashed #666;
  padding-bottom: 1px;
}
#remix:hover { color: var(--magenta); border-color: var(--magenta); }

@media (max-width: 560px) {
  #leaderboard { top: auto; bottom: 62px; right: 4px; padding: 5px 7px; min-width: 108px; }
  .lbtitle { font-size: 8px; }
  #players { margin: 6px 0 4px; }
  .pchip { padding: 3px 8px; font-size: 10px; }
}