* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #0d0d14;
  color: #eee;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}
#app {
  position: relative;
  width: 960px;
  height: 540px;
  margin: 20px auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 2px #333, 0 10px 40px rgba(0,0,0,0.6);
}
canvas {
  display: block;
  background: #1b1b2b;
}
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.45);
  font-size: 13px;
  pointer-events: none;
}
#hud button {
  pointer-events: auto;
  margin-left: auto;
}
#hudLevel { font-weight: bold; }
#hudHint { opacity: 0.8; }

button {
  background: #4a6cf7;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin: 6px 4px 0 4px;
}
button:hover { background: #3a5ce0; }
button:disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
}

.screen {
  position: absolute;
  inset: 0;
  background: rgba(5,5,10,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen.hidden { display: none; }

.panel {
  background: #1a1a28;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 24px 32px;
  max-width: 520px;
  text-align: center;
}
.panel.wide { max-width: 820px; }
.panel h1 { margin-top: 0; }
.panel p { line-height: 1.5; font-size: 14px; opacity: 0.9; }

#levelGrid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px 4px;
}
#levelGrid button {
  margin: 0;
  padding: 6px 0;
  font-size: 12px;
}
#levelGrid button.current {
  outline: 2px solid #fff;
}
