/* Rad-ish — retro shell styling */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: #0b0912;
  overflow: hidden;
  font-family: monospace;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#stage {
  position: relative;
  width: 100vw; height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #14101f 0%, #0b0912 100%);
}

#game {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  box-shadow: 0 0 0 4px #000, 0 0 40px rgba(0,0,0,0.8);
  touch-action: none;
}

#loading {
  position: absolute;
  color: #ffe04a;
  font-size: 20px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #000;
}

/* ---------- touch controls ---------- */
#touchUI { display: none; }
body.touch #touchUI {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tbtn {
  position: absolute;
  bottom: 4vh;
  width: 64px; height: 64px;
  border-radius: 12px;
  background: rgba(255,255,255,0.14);
  border: 2px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
}
#btnL { left: 4vw; }
#btnR { left: calc(4vw + 76px); }
#btnPause { right: 4vw; top: 4vh; bottom: auto; width: 44px; height: 44px; font-size: 16px; }
.tbtn:active { background: rgba(255,224,74,0.35); }
body.touch #game { cursor: default; }
.ed-name {
  width: 100%;
  font-family: monospace;
  font-size: 11px;
  background: #1e1930;
  color: #ffe04a;
  border: 1px solid #3a3450;
  padding: 3px 6px;
}

/* ---------- editor panel ---------- */
#editorPanel {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  background: rgba(12, 10, 24, 0.92);
  border-right: 2px solid #ffe04a;
  color: #cfd8e8;
  font-size: 11px;
  overflow-y: auto;
  z-index: 10;
  padding: 8px;
}
.ed-title {
  color: #ffe04a;
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-shadow: 1px 1px 0 #000;
}
.ed-sub {
  color: #7ee87e;
  margin: 8px 0 4px;
  letter-spacing: 1px;
}
#edThemes { display: flex; flex-wrap: wrap; gap: 3px; }
#edThemes button, #edPalette button, .ed-actions button {
  font-family: monospace;
  font-size: 10px;
  padding: 3px 6px;
  background: #1e1930;
  color: #cfd8e8;
  border: 1px solid #3a3450;
  cursor: pointer;
}
#edThemes button.active, #edPalette button.active {
  background: #ffe04a;
  color: #1a1626;
  border-color: #fff;
}
.ed-size { display: flex; gap: 8px; align-items: center; }
.ed-size input {
  width: 52px;
  font-family: monospace;
  background: #1e1930;
  color: #fff;
  border: 1px solid #3a3450;
  padding: 2px 4px;
}
.ed-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.ed-actions button { text-align: left; }
#edPalette { display: flex; flex-wrap: wrap; gap: 3px; }
.ed-group-title {
  width: 100%;
  color: #8898b0;
  margin-top: 6px;
  border-bottom: 1px solid #2a2440;
}

/* hide editor panel edge on very small screens */
@media (max-width: 520px) {
  #editorPanel { width: 180px; font-size: 10px; }
}
