:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #0e0f13;
  color: #e8ecf1;
}

/* MENU */
#menu {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 50% 30%, #181b23, #0e0f13 60%);
}
#menu .panel {
  background: #10141e; border: 1px solid #2c3342; border-radius: 12px;
  padding: 20px; width: 420px; max-width: calc(100vw - 32px);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
#menu h1 { margin: 6px 0 16px; }
#menu label { display: block; margin: 10px 0; }
#menu input {
  padding: 10px 12px; border-radius: 10px; border: 1px solid #2c3342;
  background: #111521; color: #e8ecf1; width: 100%;
}
.buttons { display: flex; gap: 10px; margin: 12px 0; }
button {
  padding: 10px 14px; border-radius: 10px; border: 1px solid #2c3342;
  background: #1b2230; color: #e8ecf1; font-weight: 600;
  cursor: pointer; transition: transform .05s ease, background .15s ease;
}
button:hover { background: #242e42; }
button:active { transform: translateY(1px); }
.hidden { display: none !important; }
.hint { opacity: .6; margin-top: 8px; }

/* HUD (top, clickable controls) */
#hud {
  position: fixed; top: 10px; left: 10px; right: 10px; z-index: 1000;
  display: flex; justify-content: space-between;
  pointer-events: none;
}
.stats, .stats * { pointer-events: auto; }
.stats span {
  margin-right: 10px; background: #111521; border: 1px solid #2c3342;
  padding: 6px 10px; border-radius: 8px;
}

/* High graphics toggle */
.toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background:#111521; border:1px solid #2c3342; padding:6px 10px;
  border-radius:8px; margin-right:12px; cursor: pointer;
}
.toggle:hover { background:#162033; }

.scores { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.scores li { background: #111521; border: 1px solid #2c3342; padding: 6px 10px; border-radius: 8px; }

/* GAME */
#board { position: fixed; inset: 0; display: grid; place-items: center; }
#c {
  width: min(100vw, 100vh * 16/9);
  height: calc(min(100vw, 100vh * 16/9) * 9/16);
  border: 1px solid #2c3342; border-radius: 12px; background: #0b0e15;
}
