* { 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: 18px 26px;
  width: 760px;
  text-align: center;
}
.small-panel { width: 460px; }
.panel h1 { margin: 0 0 6px; letter-spacing: 3px; }
#sub { margin: 0 0 10px; opacity: 0.8; font-size: 14px; }
#levelGrid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 5px;
  max-height: 250px;
  overflow-y: auto;
  padding: 6px 4px;
  background: #12121c;
  border-radius: 6px;
}
#levelGrid button {
  margin: 0;
  padding: 6px 0;
  font-size: 12px;
  background: #2a2a40;
}
#levelGrid button.done { background: #2f8f56; }
button {
  background: #4a6cf7;
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  margin: 4px;
}
button:hover { filter: brightness(1.2); }
.controls { margin-top: 12px; font-size: 14px; line-height: 1.7; }
.controls .small { opacity: 0.6; font-size: 12px; margin-top: 4px; }
.p1 { color: #4ad0ff; }
.p2 { color: #ff5b7a; }
#resBody { white-space: pre-line; line-height: 1.6; }

#result { background: rgba(5,5,10,0.5); align-items: flex-end; padding-bottom: 20px; }
