:root {
  color-scheme: dark;
  --bg: #080610;
  --panel: rgba(10, 7, 18, 0.78);
  --pink: #ff8ed7;
  --purple: #9e66ff;
  --text: #fff7ff;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: radial-gradient(circle at top, #2d1b49 0%, #090611 42%, #030207 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  overflow-x: hidden;
}
#app {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 14px;
  gap: 10px;
}
canvas {
  width: min(100vw - 18px, 1280px);
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 18px;
  background: #080610;
  box-shadow: 0 24px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08), 0 0 42px rgba(186,111,255,.20);
  touch-action: none;
}
.caption {
  font-size: 13px;
  opacity: .82;
  text-align: center;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: inset 0 0 20px rgba(255, 142, 215, .04);
}
#mobileControls {
  display: none;
  position: fixed;
  inset: auto 0 10px 0;
  pointer-events: none;
  padding: 0 14px;
  justify-content: space-between;
  z-index: 20;
  touch-action: none;
  user-select: none;
}
.pad {
  display: flex;
  gap: 9px;
  pointer-events: auto;
}
.pad button {
  min-width: 54px;
  height: 54px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(180deg, rgba(255,142,215,.36), rgba(74,35,116,.74));
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35);
  text-shadow: 0 2px 4px rgba(0,0,0,.55);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.right-pad button { font-size: 11px; }
.left-pad button { font-size: 22px; }
@media (max-width: 900px) {
  #app { padding-bottom: 130px; }
  #mobileControls { display: flex; }
  .caption { font-size: 11px; border-radius: 14px; }
}
@media (hover: none) and (pointer: coarse) {
  #mobileControls { display: flex; }
  #app { padding-bottom: 130px; }
}
