* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: #0b0b12;
  color: #eee;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
}
#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: #14141f; }
.screen {
  position: absolute;
  inset: 0;
  background: rgba(5,5,10,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen.hidden { display: none; }
.panel {
  background: #1a1a28;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 16px 24px;
  width: 800px;
  text-align: center;
}
.small-panel { width: 480px; }
.panel h1 { margin: 0 0 4px; letter-spacing: 3px; }
#sub { margin: 0 0 8px; opacity: 0.8; font-size: 14px; }
#levelGrid {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px 4px;
  background: #12121c;
  border-radius: 6px;
}
#levelGrid button {
  margin: 0;
  padding: 6px 0;
  font-size: 11px;
  background: #2a2a40;
}
#levelGrid button.done { background: #2f8f56; }
#levelGrid button:disabled { background: #22222e; color: #555; cursor: not-allowed; }
button {
  background: #4a6cf7;
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  margin: 4px;
}
button:hover:not(:disabled) { filter: brightness(1.2); }
.controls { margin-top: 10px; font-size: 13px; line-height: 1.7; }
.controls .small { opacity: 0.65; font-size: 12px; margin-top: 4px; line-height: 1.5; }
.p1 { color: #4ad0ff; }
.p2 { color: #ff5b7a; }
#resBody { white-space: pre-line; line-height: 1.7; }
