/* Arcade-Portal: die Halle. Jedes Spiel ist ein Automat – eingeschaltete
   leuchten, geplante stehen dunkel daneben. Der Grund ist dem
   Schwarzlicht-Teppich der Spielhallen nachempfunden. */

@font-face {
  font-family: 'Bungee';
  src: url('/gemeinsam/schrift/bungee-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
  font-display: swap;
}
@font-face {
  font-family: 'Bungee';
  src: url('/gemeinsam/schrift/bungee-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  font-display: swap;
}
@font-face {
  font-family: 'Press Start 2P';
  src: url('/gemeinsam/schrift/press-start-2p-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
  font-display: swap;
}

:root {
  --teppich: #160a33;
  --magenta: #ff3d9a;
  --cyan: #2be0ff;
  --muenzlicht: #ffc93c;
  --text: #f3eeff;
  --leise: #a99ecb;
  --linie: #3a2d5c;
  --fehler: #ff6b6b;
  --schild: 'Bungee', 'Arial Black', sans-serif;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --text-schrift: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--teppich); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.45 var(--text-schrift);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background-color: var(--teppich);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180' fill='none' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg opacity='.2'%3E%3Cpath d='M14 30l10-10 10 10 10-10' stroke='%23ff3d9a'/%3E%3Ccircle cx='122' cy='26' r='9' stroke='%232be0ff'/%3E%3Cpath d='M150 66l7 13h-14z' stroke='%23ffc93c'/%3E%3Cpath d='M56 84c8-10 16 10 24 0s16 10 24 0' stroke='%232be0ff'/%3E%3Cpath d='M30 116l4 8 8 4-8 4-4 8-4-8-8-4 8-4z' stroke='%23ffc93c'/%3E%3Ccircle cx='108' cy='138' r='3' fill='%23ff3d9a' stroke='none'/%3E%3Cpath d='M142 118l16 16M158 118l-16 16' stroke='%23ff3d9a'/%3E%3Ccircle cx='72' cy='160' r='11' stroke='%23ff3d9a'/%3E%3Cpath d='M56 163c10 6 26 4 34-6' stroke='%23ffc93c'/%3E%3Cpath d='M8 172h16M164 172h10' stroke='%232be0ff'/%3E%3Ccircle cx='96' cy='12' r='2.5' fill='%23ffc93c' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--cyan); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--muenzlicht);
  outline-offset: 3px;
}

/* ---------- Kopfzeile: Leuchtschild der Halle ---------- */

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 16px 8px;
}

.kopf__marke {
  font-family: var(--schild);
  font-size: 30px;
  line-height: 1;
  color: #fff6fb;
  text-decoration: none;
  text-shadow: 0 0 2px #fff, 0 0 10px var(--magenta), 0 0 24px var(--magenta), 0 0 44px rgba(255, 61, 154, 0.6);
}

.kopf__benutzer { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kopf__kuerzel { font-family: var(--pixel); font-size: 12px; color: var(--muenzlicht); }
.kopf__name { color: var(--leise); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kopf__abmelden { margin: 0; }

@media (max-width: 520px) {
  .kopf__name { display: none; }
}

.tipp {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
  font-size: 13px;
  color: var(--leise);
}
@media (hover: hover), (display-mode: standalone) {
  .tipp { display: none; }
}

/* ---------- Die Halle ---------- */

.halle {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.automaten {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 22px 14px;
}

.automat {
  /* Farben je Automat, unten pro Spiel gesetzt */
  --marquee-a: #3b2f5c;
  --marquee-b: #241b3d;
  --marquee-text: #e6defa;
  --leiste: #4b3f6b;
  display: flex;
  flex-direction: column;
  padding: 8px 9px 10px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #2b2047 0%, #1b1430 100%);
  /* T-Molding: die farbige Kunststoffkante am Gehäuse */
  box-shadow:
    inset 3px 0 0 var(--leiste),
    inset -3px 0 0 var(--leiste),
    0 18px 26px -14px rgba(0, 0, 0, 0.85);
}

.automat__front {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
}

.automat__marquee {
  display: block;
  padding: 9px 6px 8px;
  border-radius: 4px;
  font-family: var(--schild);
  font-size: 15px;
  line-height: 1.1;
  text-align: center;
  color: var(--marquee-text);
  background: linear-gradient(180deg, var(--marquee-a), var(--marquee-b));
  overflow-wrap: anywhere;
}

.automat__schirm {
  position: relative;
  display: block;
  margin-top: 8px;
  aspect-ratio: 7 / 8;
  overflow: hidden;
  border-radius: 16px / 18px;   /* gewölbte Röhre */
  background: #000;
  box-shadow: 0 0 0 4px #0a0614, 0 0 0 5px #2f2448;
}

/* Glas: Spiegelung oben, Rasterzeilen, dunkle Ränder */
.automat__schirm::before,
.automat__schirm::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.automat__schirm::before {
  z-index: 2;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0) 38%);
}
.automat__schirm::after {
  z-index: 1;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.6) 100%);
}

.automat__bild {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.automat__pult {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 9px;
  padding: 8px 8px 9px;
  border-radius: 4px;
  background: linear-gradient(180deg, #140d26, #0d0819);
}

.automat__rekord {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 2px 0;
  font-family: var(--pixel);
  font-size: 10px;
  line-height: 1.4;
  color: var(--muenzlicht);
  text-decoration: none;
}
.automat__hi { color: var(--magenta); }
.automat__kuerzel { color: var(--cyan); }
.automat__punkte--leer { color: #7c6a3a; }

.automat__herkunft,
.automat__karte {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--leise);
}
.automat__karte {
  color: #8578a6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Eingeschaltet: Marquee leuchtet, Röhre springt beim Öffnen an */
.automat--an .automat__marquee {
  box-shadow: 0 0 22px -4px var(--marquee-a), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  text-shadow: 0 0 10px color-mix(in srgb, var(--marquee-text) 60%, transparent);
}
.automat--an .automat__bild {
  animation: einschalten 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 150ms both;
}
.automat--an .automat__front:active .automat__schirm {
  box-shadow: 0 0 0 4px #0a0614, 0 0 0 5px var(--muenzlicht);
}

@keyframes einschalten {
  0%   { transform: scale(0.02, 0.006); filter: brightness(8); opacity: 1; }
  35%  { transform: scale(1, 0.006); filter: brightness(6); }
  70%  { transform: scale(1, 1); filter: brightness(1.8); }
  100% { transform: none; filter: none; }
}

/* Ausgeschaltet: matte Röhre, Marquee ohne Licht */
.automat--aus {
  background: linear-gradient(180deg, #221a39 0%, #160f27 100%);
}
.automat--aus .automat__marquee {
  filter: saturate(0.25) brightness(0.5);
}
.automat--aus .automat__schirm {
  background: radial-gradient(ellipse at 38% 32%, #1e2a27 0%, #0b100f 62%, #050706 100%);
}
.automat__bald {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 8px;
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.6;
  text-align: center;
  color: #5d6f69;
}

/* Farben der einzelnen Automaten (Marquee-Hintergrund, Schrift, Gehäusekante) */
.automat[data-spiel="space-invaders"] { --marquee-a: #2246d6; --marquee-b: #0f1b6b; --marquee-text: #fff36b; --leiste: #ffd23f; }
.automat[data-spiel="asteroids"]      { --marquee-a: #3a3a3a; --marquee-b: #0c0c0c; --marquee-text: #f2f2f2; --leiste: #9aa0a6; }
.automat[data-spiel="galaga"]         { --marquee-a: #1a1a6e; --marquee-b: #07072a; --marquee-text: #ff5050; --leiste: #e8e8e8; }
.automat[data-spiel="phoenix"]        { --marquee-a: #ff7a1a; --marquee-b: #a8160a; --marquee-text: #fff2a8; --leiste: #ff9a00; }
.automat[data-spiel="time-pilot"]     { --marquee-a: #3a9cf0; --marquee-b: #0c3e8a; --marquee-text: #ffffff; --leiste: #e53935; }
.automat[data-spiel="centipede"]      { --marquee-a: #3fae3f; --marquee-b: #145214; --marquee-text: #ffe14d; --leiste: #ffb000; }
.automat[data-spiel="donkey-kong"]    { --marquee-a: #d8231a; --marquee-b: #6e0904; --marquee-text: #ffffff; --leiste: #1e63d6; }
.automat[data-spiel="krull"]          { --marquee-a: #6a2ab0; --marquee-b: #24093f; --marquee-text: #ffcf40; --leiste: #b04cff; }

/* ---------- Seiten mit Inhalt (Formulare, Bestenliste, Fehler) ---------- */

.inhalt {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}
.inhalt--schmal { max-width: 420px; padding-top: 48px; }

.inhalt__titel {
  margin: 8px 0 20px;
  font-family: var(--schild);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
  color: #fff6fb;
  text-shadow: 0 0 2px #fff, 0 0 10px var(--magenta), 0 0 24px var(--magenta);
}
.seite--formular .inhalt__titel { text-align: center; font-size: 40px; margin-bottom: 28px; }
.inhalt__untertitel { margin: -10px 0 20px; color: var(--leise); }
.inhalt__hinweis { margin-top: 22px; color: var(--leise); text-align: center; }

.meldung {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: rgba(13, 8, 25, 0.85);
}
.meldung--fehler { border-color: var(--fehler); color: #ffd6d6; }

/* Knöpfe wie am Bedienfeld: runde Kappe mit Hub */
.knopf {
  display: inline-block;
  padding: 12px 22px 11px;
  border: 0;
  border-radius: 999px;
  font: 600 16px/1.2 var(--text-schrift);
  color: #2a1700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: radial-gradient(circle at 50% 30%, #ffe08a, var(--muenzlicht) 55%, #e0a514);
  box-shadow: 0 4px 0 #9a6a00, 0 6px 14px rgba(0, 0, 0, 0.45);
  touch-action: manipulation;
}
.knopf:active { transform: translateY(3px); box-shadow: 0 1px 0 #9a6a00, 0 2px 6px rgba(0, 0, 0, 0.45); }
.knopf--leise {
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--linie);
  box-shadow: none;
}
.knopf--leise:active { transform: none; background: rgba(255, 255, 255, 0.06); box-shadow: none; }

.formular {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 12px;
  background: rgba(13, 8, 25, 0.88);
  box-shadow: inset 0 0 0 1px var(--linie);
}
.formular .knopf { justify-self: stretch; margin-top: 4px; }
.formular__feld { display: grid; gap: 6px; }
.formular__label { font-weight: 600; font-size: 15px; }
.formular__eingabe {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 16px;   /* kleiner zoomt iOS beim Antippen */
  color: var(--text);
  background: #0a0614;
  border: 2px solid var(--linie);
  border-radius: 8px;
}
.formular__eingabe:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(43, 224, 255, 0.2); }
.formular__eingabe--kuerzel {
  width: 6.5em;
  font-family: var(--pixel);
  font-size: 18px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muenzlicht);
}
.formular__hinweis { color: var(--leise); font-size: 13px; }
.formular__fehler { display: block; color: var(--fehler); font-size: 13px; }

/* ---------- Bestenliste wie im Automaten ---------- */

.bestenliste {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--pixel);
  font-size: 11px;
  line-height: 1.5;
  background: rgba(5, 3, 12, 0.9);
  border-radius: 10px;
  overflow: hidden;
}
.bestenliste th {
  padding: 12px 8px 10px;
  font-weight: 400;
  font-size: 9px;
  color: var(--magenta);
  text-align: left;
}
.bestenliste td { padding: 7px 8px; }
.bestenliste .bestenliste__platz,
.bestenliste .bestenliste__punkte { text-align: right; font-variant-numeric: tabular-nums; }
.bestenliste td.bestenliste__kuerzel { color: var(--cyan); }
.bestenliste td.bestenliste__punkte { color: var(--muenzlicht); }
.bestenliste td.bestenliste__name,
.bestenliste td.bestenliste__datum { font-family: var(--text-schrift); font-size: 13px; color: var(--leise); }
.bestenliste__zeile--eigen td { background: rgba(255, 201, 60, 0.1); }
@media (max-width: 480px) {
  .bestenliste__datum { display: none; }
}

.persoenlich {
  margin: 24px 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(13, 8, 25, 0.88);
}
.persoenlich__titel { margin: 0 0 6px; font-size: 15px; }
.persoenlich__wert { margin: 0; color: var(--leise); }
.persoenlich__punkte { font-family: var(--pixel); font-size: 14px; color: var(--muenzlicht); }
.aktionen { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  .automat--an .automat__bild { animation: none; }
  .knopf:active { transform: none; }
}
