:root {
  --p1: #3b82f6;
  --p2: #ef4444;
  --arena: #ffffff;
  --bg: #000000;
  --muted: #8b8f96;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: #e8eaed;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  overflow: hidden;
  user-select: none;
}

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

/* ---------------------------------------------------------------- HUD oben */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  pointer-events: none;
  z-index: 2;
}

.score { display: flex; align-items: center; gap: 10px; }
.score .label { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.score .value { font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
#scoreP1 .value { color: var(--p1); }
#scoreP2 .value { color: var(--p2); }

.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.p1 { background: var(--p1); box-shadow: 0 0 12px var(--p1); }
.dot.p2 { background: var(--p2); box-shadow: 0 0 12px var(--p2); }

.center-info { text-align: center; }
#roundLabel { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
#shrinkLabel { font-size: 12px; margin-top: 5px; height: 15px; color: var(--muted); letter-spacing: .1em; }
#shrinkLabel.warn { color: var(--p2); }

/* ------------------------------------------------------------- Overlaytext */
#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  z-index: 3;
  text-align: center;
}
/* Plakette statt blankem Text: bleibt auf weisser Arena wie auf schwarzem Grund lesbar */
#overlayText:not(:empty) {
  font-size: clamp(22px, 4.6vw, 46px);
  max-width: min(88vw, 640px);
  font-weight: 700;
  letter-spacing: .04em;
  padding: 14px 30px;
  border-radius: 14px;
  background: rgba(8, 10, 13, .78);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(3px);
}
#overlaySub:not(:empty) {
  font-size: clamp(11px, 1.6vw, 13px);
  max-width: min(88vw, 520px);
  letter-spacing: .12em;
  color: #cfd3d8;
  padding: 7px 16px;
  border-radius: 9px;
  background: rgba(8, 10, 13, .7);
}

/* -------------------------------------------------------------- Fuss / HUD */
#footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px 20px;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
  z-index: 2;
}

.dash-wrap { display: flex; align-items: center; gap: 10px; }
.dash-bar { width: 130px; height: 6px; background: #1c1f24; border-radius: 3px; overflow: hidden; }
#dashFill { height: 100%; width: 0%; background: #ffffff; transition: width .06s linear; }
#dashFill.ready { background: #22d3a7; box-shadow: 0 0 10px #22d3a7; }

.hints { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.key {
  display: inline-block;
  min-width: 20px;
  padding: 3px 7px;
  border: 1px solid #2b2f36;
  border-radius: 5px;
  background: #101317;
  color: #cfd3d8;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 620px) {
  #footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  #hud { padding: 12px 16px; }
  .score .value { font-size: 26px; }
}
