/* Star Soft engine styles. Every game's index.html links this file. */

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

.ss-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  touch-action: none;
}

/* The game's own canvas and, laid exactly over it, the Amiga display
   (core/display.js). In AMIGA and SMOOTH modes the game canvas is invisible
   but stays underneath, so mouse and touch events still reach it. */
.ss-screen-wrap {
  position: relative;
  line-height: 0;
}

.ss-screen {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  outline: none;
}

.ss-display {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---- Touch controls ---- */

.ss-touch {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  --ss-ctl: min(34vmin, 170px);
  --ss-btn: min(17vmin, 84px);
  --ss-edge: max(16px, env(safe-area-inset-left));
}

.ss-touch-stick,
.ss-touch-btn {
  pointer-events: auto;
  touch-action: none;
  position: absolute;
  box-sizing: border-box;
  border: 3px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.ss-touch-stick {
  left: var(--ss-edge);
  bottom: max(16px, env(safe-area-inset-bottom));
  width: var(--ss-ctl);
  height: var(--ss-ctl);
  border-radius: 50%;
}

.ss-touch-knob {
  position: absolute;
  left: 30%;
  top: 30%;
  width: 40%;
  height: 40%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: transform 40ms linear;
}

.ss-touch-stick.active .ss-touch-knob { background: rgba(255, 210, 63, 0.7); transition: none; }

.ss-touch-buttons {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 14px;
}

.ss-touch-buttons .ss-touch-btn:nth-child(2) { margin-bottom: calc(var(--ss-btn) * 0.6); }

.ss-touch-btn {
  position: relative;
  width: var(--ss-btn);
  height: var(--ss-btn);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font: bold calc(var(--ss-btn) * 0.32) monospace;
}

.ss-touch-btn.active { background: rgba(255, 210, 63, 0.45); border-color: rgba(255, 210, 63, 0.9); color: #fff; }

.ss-touch-top {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  gap: 10px;
}

.ss-touch-small {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 14px;
}

/* ---- Desktop-only notice ---- */

.ss-notice {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #ddd;
  font: 16px/1.5 monospace;
  text-align: center;
}

.ss-notice h1 { color: #ffd23f; font-size: 22px; }
.ss-notice a { color: #8fd3ff; }
