/* Shadow Ninjas — one dark arcade screen, canvas centered, touch pads underneath on tablets */
:root {
  --bg: #07060b;
  --pad: rgba(255, 255, 255, 0.10);
  --pad-edge: rgba(255, 255, 255, 0.28);
  --pad-down: rgba(255, 210, 90, 0.45);
  --text: #f4e9d0;
  --p1: #3f8cff;
  --p2: #ffc531;
  color-scheme: dark;
}

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#game {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  touch-action: none;
}

#screen {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
}

/* ---------- touch controls ---------- */
#touch {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.zone {
  position: absolute;
  bottom: 0;
  pointer-events: auto;
  touch-action: none;
}

.stick-base, .stick-knob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.stick-base {
  width: 120px;
  height: 120px;
  background: var(--pad);
  border: 3px solid var(--pad-edge);
}
.stick-hint {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px dashed var(--pad-edge);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: bold 11px/1.3 ui-monospace, Menlo, monospace;
  color: var(--text);
  opacity: 0.55;
  pointer-events: none;
  padding: 14px;
  box-sizing: border-box;
}
.stick-knob {
  width: 56px;
  height: 56px;
  background: var(--pad-edge);
}

.btn {
  position: absolute;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--pad);
  border: 3px solid var(--pad-edge);
  color: var(--text);
  font: bold 13px/1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.btn b { font-size: 24px; line-height: 1; }
.btn.down { background: var(--pad-down); }
.btn.sword { width: 88px; height: 88px; }
.zone.p1 .btn { border-color: color-mix(in srgb, var(--p1) 70%, white); }
.zone.p2 .btn { border-color: color-mix(in srgb, var(--p2) 70%, white); }
.zone-label {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  font: bold 12px ui-monospace, Menlo, monospace;
  opacity: 0.7;
  pointer-events: none;
}

#corner {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 4px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}
#corner button {
  padding: 5px 8px;
  border: 2px solid var(--pad-edge);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  font: bold 11px ui-monospace, Menlo, monospace;
  letter-spacing: 0.06em;
  cursor: pointer;
  opacity: 0.75;
}
#corner button:focus-visible { outline: 2px solid var(--p2); }
#corner #install { border-color: var(--p2); color: var(--p2); opacity: 1; }

#install-help {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 6, 11, 0.8);
}
.help-card {
  max-width: 340px;
  padding: 20px;
  border: 3px solid var(--p2);
  border-radius: 10px;
  background: #1c1b29;
  font: 15px/1.45 ui-monospace, Menlo, monospace;
  text-align: center;
}
.help-card img { border-radius: 22%; image-rendering: pixelated; }
.help-card ol { text-align: left; padding-left: 22px; }
.help-card button {
  padding: 8px 18px;
  border: 2px solid var(--p2);
  border-radius: 6px;
  background: var(--p2);
  color: #1c1b29;
  font: bold 14px ui-monospace, Menlo, monospace;
}
