* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #0b1020; color: #e8f0ff; font-family: ui-sans-serif, system-ui, sans-serif; overflow: hidden; }
body { display: flex; flex-direction: column; }

#hud {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: #121a33; border-bottom: 2px solid #f5d76e;
  flex-shrink: 0;
}
#brand { font-weight: 800; letter-spacing: 0.12em; color: #f5d76e; }
#coverage { font-size: 13px; opacity: 0.85; margin-top: 2px; }
#hud-center { text-align: center; }
#clock { font-size: 22px; font-weight: 700; color: #f5d76e; }
#toast { min-height: 16px; font-size: 12px; color: #9ad; }
#board { min-width: 140px; }
.board-title { font-size: 11px; letter-spacing: 0.14em; color: #9ad; }
#board-list { list-style: none; font-size: 12px; }
#board-list li { display: flex; justify-content: space-between; gap: 12px; }
#board-list li.dead { opacity: 0.45; text-decoration: line-through; }
#board-list li.you { color: #7ee787; }

#inkbar-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 14px; background: #0e1630; flex-shrink: 0; gap: 12px;
}
#hint { font-size: 12px; opacity: 0.8; flex: 1; }
#dropbar-wrap { display: flex; align-items: center; gap: 8px; min-width: 160px; }
#dropLabel { font-size: 11px; letter-spacing: 0.12em; color: #ff8a8a; font-weight: 700; }
#dropbar { flex: 1; height: 8px; background: #1a2244; border-radius: 6px; overflow: hidden; border: 1px solid #3a2a44; }
#dropFill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffd166, #ff5a5a); transform-origin: left center; }
#queue { display: flex; gap: 14px; align-items: center; }
.q-slot { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.12em; color: #9ad; }
.q-ball {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 10px rgba(255,255,255,0.35);
  background: #666;
}

#stage {
  flex: 1; position: relative; min-height: 0; display: flex; flex-direction: column;
}
#arena {
  flex: 1; display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px; padding: 8px; min-height: 0;
}
.lane {
  background: #151d38; border: 1px solid #2a3a66; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; min-height: 0;
}
.lane.you { border-color: #f5d76e; }
canvas { display: block; max-width: 100%; max-height: 100%; }

#splash {
  position: fixed; inset: 0; background: rgba(6,10,22,0.92);
  display: flex; align-items: center; justify-content: center; z-index: 20;
}
#over {
  position: absolute; inset: 0;
  background: rgba(8, 12, 28, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 8; pointer-events: none;
}
#over .score-card { pointer-events: auto; }
.hidden { display: none !important; }
.splash-card, .score-card {
  width: min(420px, 92vw); background: #182244; border: 2px solid #f5d76e;
  border-radius: 16px; padding: 28px 24px; text-align: center;
}
.score-card { background: rgba(18, 28, 58, 0.92); box-shadow: 0 12px 40px rgba(0,0,0,0.45); }
#score-list { list-style: none; margin: 8px 0 16px; text-align: left; }
#score-list li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
}
#score-list li.you { color: #7ee787; }
#score-list li.winner { color: #f5d76e; font-weight: 700; }
#score-list li.dead { opacity: 0.55; }
.kicker { letter-spacing: 0.2em; font-size: 11px; color: #9ad; }
h1 { font-size: 42px; color: #f5d76e; margin: 8px 0 10px; }
.tag { opacity: 0.9; margin-bottom: 16px; }
label { display: block; margin: 12px 0; font-size: 13px; }
input, button {
  font: inherit; border-radius: 8px; border: 0; padding: 10px 14px;
}
input { width: 160px; margin-left: 8px; background: #0b1020; color: #fff; border: 1px solid #3a4d80; }
button {
  background: linear-gradient(45deg, #ff6b6b, #ff8787); color: #fff;
  font-weight: 700; cursor: pointer; margin-top: 8px;
}
.fine { margin-top: 14px; font-size: 12px; opacity: 0.7; }

@media (max-width: 900px) {
  #arena { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
}
