:root {
  --bg: #0b0f14;
  --panel: #121821;
  --fg: #e7eef7;
  --muted: #94a3b8;
  --accent: #5eead4;
  --btn: #1f2937;
  --good: #4ade80;
  --bad: #f87171;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: radial-gradient(1000px 600px at 50% 0%, #0e1622 0%, var(--bg) 60%);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px 24px;
  display: grid;
  gap: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar h1 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.btn {
  background: var(--btn);
  border: 1px solid #2a3648;
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn:hover:not([disabled]) { border-color: var(--accent); }

.ctl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  padding: 6px 10px;
  border: 1px solid #1e2836;
  border-radius: 10px;
  font-size: 14px;
}

#scoreboard {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}

#scoreboard .status {
  margin-left: 12px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

#game-container {
  position: relative;
  background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
  border: 1px solid #152033;
  border-radius: 14px;
  padding: 10px;
  min-height: 420px;
}

#pong {
  width: 100%;
  height: min(62vh, 560px);
  display: block;
  border-radius: 10px;
  outline: none;
}

/* Center net visual hint (drawn in canvas, this is fallback) */
#game-container::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 10px;
  bottom: 10px;
  width: 2px;
  opacity: .06;
  background: #fff;
  transform: translateX(-50%);
  pointer-events: none;
}

.overlay {
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(2px);
  border-radius: 10px;
}
.overlay.hidden { display: none; }

.card {
  background: var(--panel);
  border: 1px solid #1b2636;
  padding: 16px 18px;
  border-radius: 12px;
  text-align: center;
  max-width: 360px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.card h2 { margin: 6px 0 6px; }
.card p { margin: 0 0 12px; color: var(--muted); }

.touch {
  position: absolute;
  inset: 10px;
  display: none;
}
.touch div { position: absolute; left: 0; right: 0; height: 40%; }
#touchUp { top: 0; }
#touchDown { bottom: 0; }
.touch div:active { background: rgba(94,234,212,.08); }

@media (pointer: coarse) {
  .touch { display: block; }
}
.foot {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
