html, body {
  margin: 0; padding: 0;
  background: #000;
  height: 100%;
  overflow: hidden;
  font-family: "Lucida Grande", "Segoe UI", Arial, sans-serif;
}
#stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
#gamewrap { position: relative; line-height: 0; }
#screen {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  outline: none;
}
#click-to-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 5;
}
#click-to-play.overlay-hidden { display: none; }
.ctp-box {
  background: rgba(0,0,0,.82);
  border: 2px solid #7a1010;
  padding: 18px 26px;
  text-align: center;
  color: #fff;
  line-height: 1.5;
  max-width: 90%;
}
.ctp-title { font-size: 22px; font-weight: 800; letter-spacing: 2px; color: #e8b43c; }
.ctp-line { margin-top: 8px; }
.ctp-line.small { font-size: 12px; color: #bbb; }

/* ---- authored launcher/about overlay (outside the game canvas) ---- */
#side-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 8, 18, 0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
#side-overlay.hidden { display: none; }
.side-panel {
  background: linear-gradient(160deg, #fdf7ff 0%, #f3ecff 100%);
  color: #3a2c50;
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(20, 8, 60, 0.5), 0 0 0 6px rgba(255,255,255,0.55);
  padding: 26px 30px 22px;
  width: min(680px, 92vw);
  max-height: 88vh;
  overflow: auto;
  animation: side-bounce 420ms cubic-bezier(.2,1.6,.4,1);
  transition: transform 320ms cubic-bezier(.2,1.6,.4,1), opacity 240ms ease;
}
.side-panel.closing { transform: scale(0.9) translateY(12px); opacity: 0; }
@keyframes side-bounce {
  0% { transform: scale(0.82) translateY(26px); opacity: 0; }
  62% { transform: scale(1.03) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}
.side-panel h1 {
  margin: 0 0 4px;
  font-size: 26px;
  letter-spacing: 0.5px;
  color: #4b2e83;
}
.side-panel h1 .accent { color: #e0559b; }
.side-panel .sub { color: #8a76a8; font-size: 13px; margin-bottom: 14px; }
.side-panel h2 { font-size: 15px; margin: 16px 0 8px; color: #6b3fa0; }
.keymap { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.krow {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 12px;
  padding: 7px 12px;
  box-shadow: 0 2px 6px rgba(80, 40, 140, 0.12);
  position: relative;
}
.krow .action { font-size: 13px; font-weight: 600; color: #4a3a68; }
.krow kbd {
  font-family: inherit;
  background: #efe6ff;
  border-radius: 8px;
  border: 1.5px solid #cbb6f2;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
  color: #5b3fa8;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(.2,1.6,.4,1), background 120ms;
}
.krow kbd:hover { transform: translateY(-2px) scale(1.06); background: #e6d8ff; }
.krow kbd.listening { background: #ffd7ec; border-color: #ff8ac2; color: #d81b7a; animation: pulse-k 700ms infinite alternate; }
@keyframes pulse-k { from { transform: scale(1); } to { transform: scale(1.09); } }
.krow .tip {
  position: absolute; left: 50%; top: -34px; transform: translateX(-50%) scale(0.9);
  background: #3b2a5e; color: #ffe9f6;
  font-size: 11px; padding: 4px 10px; border-radius: 9px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 140ms, transform 160ms cubic-bezier(.2,1.6,.4,1);
}
.krow:hover .tip { opacity: 1; transform: translateX(-50%) scale(1); }
.side-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: 999px;
  font-weight: 800; font-size: 14px; letter-spacing: .3px;
  background: linear-gradient(150deg, #ff5fb2, #b06bff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(200, 60, 170, .35);
  transition: transform 180ms cubic-bezier(.2,1.6,.4,1), filter 120ms;
}
.btn:hover { transform: translateY(-2px) scale(1.04); filter: brightness(1.07); }
.btn.ghost { background: #efe8fb; color: #6b3fa0; box-shadow: none; }
.legal { font-size: 11px; color: #9484b3; margin-top: 14px; line-height: 1.5; }

#touch-note {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 30px;
  background: #000; color: #e8b43c;
  font-size: 16px; line-height: 1.6;
}
#touch-note.hidden { display: none; }
