/* =====================================================================
   arcade.css – Pop-up mit der Handheld-Konsole ("hollow boy")
   Wird nach style.css geladen. Öffnet sich über das Kopf-Bild (creative head).
   ===================================================================== */

:root {
  --arcade-shell: #ffffff;        /* Gehäuse */
  --arcade-shell-dark: #dcdcdc;   /* Kanten */
  --arcade-screen: #0b1030;       /* Bildschirmfläche */
  --arcade-screen-glow: rgba(255, 255, 255, 0.07);
  --arcade-btn: #ececec;          /* Tasten */
  --arcade-width: min(22rem, 86vw);
}

/* ---------- Kopf-Bild als Auslöser ---------- */
.head-trigger { cursor: pointer; }
html.has-cursor .head-trigger { cursor: none; }      /* eigener Cursor bleibt aktiv */
.head-trigger:focus-visible { outline: 2px solid var(--fg); outline-offset: 6px; }

/* ---------- Overlay ---------- */
.arcade {
  position: fixed;
  inset: 0;
  z-index: 300;                    /* über Nav (10), Vollbildern (5) und Cursor-Spur */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 20, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
html.arcade-open .arcade { opacity: 1; visibility: visible; }

/* ---------- Gehäuse ---------- */
.arcade__device {
  width: var(--arcade-width);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: 0.9rem;
  background: var(--arcade-shell);
  border: 1px solid var(--arcade-shell-dark);
  border-bottom: 4px solid #cfcfcf;
  box-shadow: 0 24px 60px rgba(0, 0, 40, 0.45);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}
html.arcade-open .arcade__device { transform: none; }

/* Kopfleiste im Fenster-Look */
.arcade__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.1rem 0.5rem;
  border-bottom: 1px solid var(--arcade-shell-dark);
}
.arcade__name {
  margin-left: 0.5rem;
  flex: 1 1 auto;
  color: #8a8a8a;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.arcade__close {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 0.35rem;
  background: var(--arcade-btn);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
html.has-cursor .arcade__close { cursor: none; }
.arcade__close:hover { background: #dedede; }

/* Bildschirm */
.arcade__screen {
  position: relative;
  background: var(--arcade-screen);
  border-radius: 0.4rem;
  border: 2px solid #c9c9c9;
  overflow: hidden;
  line-height: 0;
}
.arcade__screen canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 160 / 144;
  image-rendering: pixelated;      /* harte Pixel statt weicher Kanten */
}
/* feine Scanlines wie auf einem alten Display */
.arcade__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px);
}

/* ---------- Bedienfeld ---------- */
.arcade__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.15rem;
}
.arcade__dpad {
  display: flex;
  gap: 0.4rem;
}
.arcade__key {
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--arcade-shell-dark);
  border-bottom: 3px solid #cfcfcf;
  border-radius: 0.4rem;
  background: var(--arcade-btn);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  touch-action: none;              /* Halten statt Doppeltipp-Zoom */
  user-select: none;
  -webkit-user-select: none;
}
html.has-cursor .arcade__key { cursor: none; }
.arcade__key:active,
.arcade__key.is-down {
  transform: translateY(1px);
  border-bottom-width: 1px;
  background: #e0e0e0;
}
.arcade__key--fire {
  width: 4.2rem;
  height: 2.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
}
.arcade__hint {
  margin-top: 0.1rem;
  color: #8a8a8a;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-align: center;
}

@media (max-width: 600px) {
  :root { --arcade-width: min(22rem, 92vw); }
  .arcade { padding: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .arcade, .arcade__device { transition: none; }
}