:root {
  --bg: #0b0e14;
  --panel: #161b26;
  --line: #2a3242;
  --accent: #7ec8e3;
  --text: #e6ebf2;
  --muted: #8a93a6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  display: flex;
  justify-content: center;
}

#wrap {
  width: 960px;
  max-width: 100%;
  padding: 1rem;
}

h1 { font-size: 1.4rem; margin: 0.3rem 0 0.6rem; }

#hud {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  padding: 0.5rem 0.7rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 0.6rem;
}
#hud b { color: var(--accent); }

#stage {
  position: relative;
  width: 960px;
  max-width: 100%;
}

canvas {
  width: 100%;
  display: block;
  background: #10141c;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 14, 0.82);
  border-radius: 8px;
}
#overlay.hidden { display: none; }

.panel {
  width: 520px;
  max-width: 92%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.3rem 1.5rem;
  text-align: center;
}
.panel h2 { margin: 0 0 0.5rem; }
.panel p { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.row {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  justify-content: center;
}
input[type=text] {
  flex: 1;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0d1118;
  color: var(--text);
  font-size: 1rem;
}
button {
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #06222e;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }

#ov-stats {
  background: #0d1118;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem;
  margin: 0.6rem 0;
  font-size: 1rem;
}
#ov-stats.hidden { display: none; }

#lb-wrap h3 { font-size: 1rem; margin: 0.8rem 0 0.4rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; }

#flash {
  position: absolute;
  top: 18%;
  left: 0; right: 0;
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: #ffd166;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
#flash.show { opacity: 1; }

.foot { color: var(--muted); font-size: 0.8rem; text-align: center; margin-top: 0.8rem; }
