* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #1a1a2e;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", ui-monospace, monospace;
  color: #eaeaea;
}

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#hint {
  position: absolute;
  bottom: 8%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  letter-spacing: 1px;
  color: #7ed6be;
  opacity: 0.9;
  animation: blink 1.6s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 0.9; }
  50%, 100% { opacity: 0.15; }
}

/* --- Virtuelle Steuerung --- */

#controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 4% 4%;
  pointer-events: none;
}

#controls button {
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  color: #eaeaea;
  background: rgba(234,234,234,0.12);
  border: 1px solid rgba(234,234,234,0.3);
  border-radius: 10px;
  touch-action: none;
}

#controls button.pressed {
  background: rgba(126,214,190,0.35);
  border-color: #7ed6be;
}

#dpad {
  position: relative;
  width: 132px;
  height: 132px;
}

.dbtn {
  position: absolute;
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.dbtn-up { top: 0; left: 44px; border-radius: 10px 10px 4px 4px; }
.dbtn-down { bottom: 0; left: 44px; border-radius: 4px 4px 10px 10px; }
.dbtn-left { top: 44px; left: 0; border-radius: 10px 4px 4px 10px; }
.dbtn-right { top: 44px; right: 0; border-radius: 4px 10px 10px 4px; }

#abbtns {
  position: relative;
  width: 120px;
  height: 90px;
}

.abtn {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
}

.abtn-a {
  top: 0;
  right: 0;
  background: rgba(126,214,190,0.18);
}

#btn-b { bottom: 0; left: 0; }

#btn-start {
  position: absolute;
  top: 3%;
  right: 4%;
  padding: 6px 14px;
  font-size: 11px;
  letter-spacing: 1px;
}
