/* slingy — terminal-styled fullscreen game chrome.
   Colours come from the yptox theme vars (--bg/--fg/--accent), so the page
   recolours with the site theme switcher. */

:root {
  --bg-color: #0d0208;
  --fg-color: #00ff41;
  --accent-color: #008f11;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-color);
  color: var(--fg-color);
  font-family: 'VT323', monospace;
  /* stop iOS rubber-band + double-tap zoom on the playfield */
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none; /* pointer events only — no scroll/pinch */
}

/* back to site */
.back-link {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 20;
  color: var(--fg-color);
  text-decoration: none;
  font-size: 22px;
  opacity: 0.6;
  border: 2px dashed var(--fg-color);
  padding: 0 8px;
  transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}
.back-link:hover {
  opacity: 1;
  background: var(--accent-color);
  color: var(--bg-color);
}

/* overlays (title / run-end) */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg-color) 70%, transparent);
  transition: opacity 0.35s ease;
}
.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.panel {
  text-align: center;
  border: 2px dashed var(--fg-color);
  padding: 28px 36px;
  max-width: 90vw;
  background: color-mix(in srgb, var(--bg-color) 85%, transparent);
  box-shadow: 6px 6px 0 var(--fg-color);
}
.panel h1 {
  font-size: clamp(48px, 12vw, 96px);
  margin: 0 0 4px;
  letter-spacing: 2px;
}
.panel .tag {
  margin: 0 0 18px;
  opacity: 0.75;
  font-size: clamp(18px, 4vw, 26px);
}
.panel .how {
  font-size: clamp(16px, 3.6vw, 22px);
  line-height: 1.5;
  opacity: 0.85;
  margin: 0 0 22px;
}

.btn {
  display: inline-block;
  background: transparent;
  color: var(--fg-color);
  border: 2px solid var(--fg-color);
  font-family: inherit;
  font-size: clamp(20px, 5vw, 28px);
  padding: 6px 18px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover {
  background: var(--accent-color);
  color: var(--bg-color);
}

/* bottom-left toggles */
.toggles {
  position: fixed;
  left: 12px;
  bottom: 10px;
  z-index: 20;
  display: flex;
  gap: 10px;
}
.mini {
  background: transparent;
  border: none;
  color: var(--fg-color);
  font-family: 'VT323', monospace;
  font-size: 18px;
  opacity: 0.55;
  cursor: pointer;
  padding: 2px 4px;
  transition: opacity 0.2s, color 0.2s;
}
.mini:hover {
  opacity: 1;
  color: var(--accent-color);
}

/* CRT scanlines (subtle, non-interactive) */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    color-mix(in srgb, var(--bg-color) 22%, transparent) 3px,
    transparent 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  .scanlines {
    display: none;
  }
}
