/* =========================================================
   8-bit Horizon – Styles
   Farben kommen aus dem aktiven Theme (js/themes.js) als
   CSS-Variablen. Die Werte hier sind nur der Fallback.
   ========================================================= */
@font-face { font-family: "Pixelify Sans"; src: url("../assets/fonts/PixelifySans-Medium.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("../assets/fonts/Silkscreen-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #0a0c1f; --panel: #12162e; --ink: #f2f6ff; --muted: #a3aed6;
  --accent: #ff8a1f; --accent2: #3aa8ff; --line: #26305e;
  --on-accent: #0a0c1f;
  --font-body: "Pixelify Sans", ui-monospace, Menlo, Consolas, monospace;
  --font-ui: "Silkscreen", "Pixelify Sans", ui-monospace, monospace;
  --px: 4px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 19px; line-height: 1.55;
  -webkit-font-smoothing: none; text-rendering: optimizeSpeed;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent2); }
h1, h2, h3 { font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: 0.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px dashed var(--accent2); outline-offset: 4px; }
[hidden] { display: none !important; }

.container { width: min(1120px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; z-index: 100; font-family: var(--font-ui); }
.skip:focus { left: 8px; }

/* ---------- Pixel-Rahmen (Treppenkanten statt runder Ecken) ---------- */
.px {
  position: relative; background: var(--panel); margin: var(--px);
  box-shadow: 0 calc(var(--px) * -1) 0 0 var(--line), 0 var(--px) 0 0 var(--line),
              calc(var(--px) * -1) 0 0 0 var(--line), var(--px) 0 0 0 var(--line);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px; margin: var(--px);
  font-family: var(--font-ui); font-size: 14px; line-height: 1; letter-spacing: 0.04em; text-decoration: none;
  padding: 15px 22px; color: var(--on-accent); background: var(--accent); cursor: pointer; border: 0;
  box-shadow: 0 -4px 0 0 #000, 0 4px 0 0 #000, -4px 0 0 0 #000, 4px 0 0 0 #000,
              inset 0 -4px 0 0 rgba(0,0,0,.28), inset 0 4px 0 0 rgba(255,255,255,.38);
  transition: transform .08s steps(2);
}
.btn:hover { color: var(--on-accent); transform: translateY(2px); filter: brightness(1.08); }
.btn:active { transform: translateY(4px); }
.btn-small { padding: 11px 15px; font-size: 12px; }
.btn-ghost { background: var(--panel); color: var(--ink); box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line), inset 0 -4px 0 0 rgba(0,0,0,.25); }
.btn-ghost:hover { color: var(--accent); }
.btn-blue { background: var(--accent2); }
.play::before { content: ""; width: 12px; height: 14px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); animation: blink 1s steps(2, jump-none) infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 clamp(16px, 4vw, 40px);
  transition: background .2s steps(3);
}
.site-header.is-solid, body.nav-open .site-header { background: color-mix(in srgb, var(--bg) 94%, transparent); box-shadow: 0 4px 0 0 var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 22px; }
.brand img { width: 44px; height: 44px; image-rendering: auto; }
.brand:hover { color: var(--ink); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a:not(.btn) {
  font-family: var(--font-ui); font-size: 13px; letter-spacing: 0.05em; color: var(--ink); text-decoration: none; padding: 10px 14px;
  text-shadow: 0 2px 0 rgba(0,0,0,.6);
}
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"] { box-shadow: inset 0 -4px 0 0 var(--accent); }
.nav-toggle { display: none; width: 48px; height: 48px; background: var(--panel); border: 0; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 6px; box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); }
.nav-toggle span { width: 22px; height: 4px; background: var(--ink); }

/* ---------- Szene ---------- */
.scene-host { position: absolute; inset: 0; overflow: hidden; background: var(--bg); }
.scene-canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; }

/* ---------- Hero (Titelbildschirm) ---------- */
.hero { position: relative; min-height: 640px; height: 100svh; display: grid; place-items: center; overflow: hidden; isolation: isolate; }
.hero .scene-host::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 46%, transparent 38%, rgba(0,0,0,.38) 100%); }
.hero-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(var(--header-h) + 8px) 20px 72px; gap: 8px; }
.hero-logo { width: clamp(230px, min(50vh, 86vw), 560px); height: auto; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35)); animation: bob 2.6s linear infinite; }
@keyframes bob { 0%, 49.9% { transform: translateY(0); } 50%, 100% { transform: translateY(-6px); } }
.hero-tag { max-width: 34ch; font-size: clamp(18px, 2.2vw, 22px); text-shadow: 0 2px 0 rgba(0,0,0,.8); margin: 4px 0 8px; padding: 6px 14px 8px; background: rgba(6, 8, 22, .6); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.greeting { font-family: var(--font-ui); font-size: 13px; letter-spacing: .06em; color: var(--on-accent); background: var(--accent2); padding: 8px 12px; margin: 0 0 6px; box-shadow: 0 -4px 0 0 #000, 0 4px 0 0 #000, -4px 0 0 0 #000, 4px 0 0 0 #000; }
.hero-steps { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, transparent 0 8px, color-mix(in srgb, var(--bg) 25%, transparent) 8px 16px, color-mix(in srgb, var(--bg) 55%, transparent) 16px 24px, color-mix(in srgb, var(--bg) 85%, transparent) 24px 32px, var(--bg) 32px); }

#theme-picker { position: absolute; z-index: 3; left: clamp(14px, 2vw, 26px); bottom: 54px; }
.theme-btn { width: 40px; height: 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; background: rgba(8,10,24,.5); border: 0; cursor: pointer; opacity: .5; box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); }
.theme-btn span { width: 16px; height: 3px; background: var(--ink); }
.theme-btn:hover, .theme-btn:focus-visible { opacity: 1; }

/* Dialoge (Passwort, Galerie) */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(2, 4, 14, .82); }
.modal { border: 0; padding: 28px; width: min(440px, calc(100% - 48px)); background: var(--panel); margin: auto;
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); }
.modal h2 { font-size: 28px; margin-bottom: 10px; }
.modal p { color: var(--muted); font-size: 17px; }
.modal label { display: block; font-family: var(--font-ui); font-size: 12px; letter-spacing: .05em; margin-bottom: 8px; }
.modal input { width: 100%; font: inherit; font-size: 20px; color: var(--ink); background: var(--bg); border: 0; padding: 12px 14px; box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); }
.modal input:focus-visible { outline: 0; box-shadow: 0 -4px 0 0 var(--accent), 0 4px 0 0 var(--accent), -4px 0 0 0 var(--accent), 4px 0 0 0 var(--accent); }
.modal-error { color: #ff7a7a !important; margin: 12px 0 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 20px; }
.modal .btn { margin-left: 0; }
.theme-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.theme-list li:first-child { grid-column: 1 / -1; }
.theme-list button { width: 100%; text-align: left; font-family: var(--font-body); font-size: 18px; color: var(--ink); background: none; border: 0; padding: 8px 10px; cursor: pointer; }
.theme-list button:hover { background: var(--line); }
.theme-list button.is-on::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--accent); margin-right: 10px; }

/* ---------- Sektionen ---------- */
.section { padding: 88px 0; }
.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(32px, 4.6vw, 46px); margin-bottom: 12px; }
.section-head p { color: var(--muted); margin: 0; }

/* Projekt-Karten */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px 28px; }
.card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); transition: transform .1s steps(2); }
.card:hover { color: var(--ink); transform: translateY(-4px); --line: var(--c, var(--accent)); }
.card-art { height: 132px; overflow: hidden; background-color: var(--c, var(--accent));
  background-image: conic-gradient(rgba(0,0,0,.22) 25%, transparent 0 50%, rgba(0,0,0,.22) 0 75%, transparent 0); background-size: 16px 16px; position: relative; }
.card-art img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.card-art::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background: var(--panel); clip-path: polygon(0 100%, 0 50%, 6% 50%, 6% 0, 14% 0, 14% 50%, 100% 50%, 100% 100%); }
.card-body { padding: 4px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 26px; }
.card p { color: var(--muted); margin: 0; font-size: 17px; }
.card-idea { justify-content: center; background: transparent; box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); border: 0; outline: 0; }
.card-idea .card-body { padding-top: 24px; align-items: flex-start; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--font-ui); font-size: 11px; letter-spacing: .04em; padding: 5px 8px; background: var(--line); color: var(--ink); }
.tag.is-live { background: #2fbf71; color: #04210f; }
.tag.is-wip { background: var(--accent); color: var(--on-accent); }
.tag.is-plan { background: var(--accent2); color: #04122e; }

/* Neuigkeiten */
.section-news { padding-bottom: 24px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 32px 28px; }
.news { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 24px; text-decoration: none; color: var(--ink); transition: transform .1s steps(2); }
a.news:hover { color: var(--ink); transform: translateY(-4px); --line: var(--c, var(--accent)); }
.news-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.news-head time { font-family: var(--font-ui); font-size: 11px; letter-spacing: .04em; color: var(--muted); }
.news h3 { font-size: 26px; margin-top: 4px; }
.news-title { margin: 0; color: var(--c, var(--accent)); font-size: 19px; }
.news-text { margin: 0; color: var(--muted); font-size: 17px; }
.news-empty { background: transparent; }
.news-empty .news-text { margin-top: 6px; }
.more { margin: 28px 0 0; }
.empty { color: var(--muted); max-width: 52ch; }

/* Community */
.community { background: linear-gradient(var(--panel), var(--bg)); box-shadow: 0 -4px 0 0 var(--line); }
.community-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: start; }
.community h2 { font-size: clamp(32px, 4.6vw, 46px); margin-bottom: 16px; }
.community p { color: var(--muted); max-width: 52ch; }
.community .btn { margin-left: 0; }
.checks { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.checks li { padding-left: 26px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; background: var(--accent); box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.3); }
.server-map { padding: 24px 26px; font-size: 17px; }
.server-map h3 { font-size: 15px; font-family: var(--font-ui); font-weight: 400; color: var(--accent); letter-spacing: .05em; margin: 18px 0 6px; }
.server-map h3:first-child { margin-top: 0; }
.server-map ul { list-style: none; margin: 0; padding: 0; }
.server-map li { color: var(--muted); padding: 1px 0 1px 18px; }
.server-map li::before { content: "#"; color: var(--accent2); margin-left: -18px; display: inline-block; width: 18px; }
.server-map li.voice::before { content: "+"; }
.server-map .note { font-size: 15px; color: var(--muted); opacity: .85; }
#socials { display: flex; flex-wrap: wrap; margin-top: 18px; }

.about p { max-width: 66ch; }
.about h2 { font-size: clamp(30px, 4vw, 40px); margin-bottom: 14px; }
.about p { color: var(--muted); }

/* ---------- Unterseiten ---------- */
.banner { position: relative; height: clamp(250px, 34vh, 340px); overflow: hidden; isolation: isolate; display: flex; align-items: flex-end; }
.banner .scene-host::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.35), transparent 45%); }
.banner-text { position: relative; z-index: 2; padding-bottom: 34px; }
.banner h1 { display: inline-block; font-size: clamp(32px, 6vw, 54px); padding: 6px 18px 10px; margin: 4px; background: color-mix(in srgb, var(--bg) 88%, transparent); box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); }
.banner .tags { margin-top: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 36px; }
.chip { font-family: var(--font-ui); font-size: 12px; letter-spacing: .04em; color: var(--ink); background: var(--panel); border: 0; padding: 11px 15px; margin: 4px; cursor: pointer; box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); }
.chip:hover { color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: 0 -4px 0 0 #000, 0 4px 0 0 #000, -4px 0 0 0 #000, 4px 0 0 0 #000; }

.detail { display: grid; grid-template-columns: 1fr 340px; gap: 56px; align-items: start; }
.detail-main .lead { font-size: 23px; color: var(--ink); }
.detail-main p { color: var(--muted); max-width: 64ch; }
.detail-main .lead { max-width: 52ch; }
.detail-side { padding: 24px; }
.detail-side h2 { font-size: 24px; margin-bottom: 14px; }
.side-links { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 8px; }
.side-h { font-size: 22px !important; margin: 18px 0 12px !important; }
.side-empty { color: var(--muted); font-size: 16px; margin: 0; }
.updates { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.updates li { display: grid; gap: 2px; padding-left: 14px; box-shadow: inset 4px 0 0 0 var(--accent); }
.updates time { font-family: var(--font-ui); font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.updates strong { font-weight: 500; font-size: 19px; }
.updates span { color: var(--muted); font-size: 16px; }
.block-h { font-size: 28px; margin: 40px 0 14px; }
.block-p { max-width: 64ch; color: var(--muted); }
.detail-main > .gallery, .detail-main > .checks { margin: 22px 0; }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.tile { position: relative; display: block; padding: 0; margin: 4px; aspect-ratio: 16 / 9; overflow: hidden; border: 0; cursor: pointer; background: var(--panel); color: var(--ink); text-align: left;
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); transition: transform .1s steps(2); }
.tile:hover { transform: translateY(-4px); --line: var(--accent); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; font-size: 15px; line-height: 1.25; background: rgba(6, 8, 20, .82); }
.tile-video { background-color: var(--accent); background-image: conic-gradient(rgba(0,0,0,.22) 25%, transparent 0 50%, rgba(0,0,0,.22) 0 75%, transparent 0); background-size: 16px 16px; }
.tile-play { position: absolute; left: 50%; top: 42%; width: 40px; height: 46px; background: #fff; transform: translate(-35%, -50%); clip-path: polygon(0 0, 100% 50%, 0 100%); filter: drop-shadow(0 4px 0 rgba(0,0,0,.4)); }
.tile-video .tile-label { color: #fff; }
.fineprint { font-size: 14px !important; margin-top: 16px; opacity: .8; }

/* Lightbox */
.lightbox { border: 0; padding: 18px 18px 22px; background: var(--panel); width: min(1040px, calc(100% - 24px)); max-height: calc(100% - 24px); margin: auto; overflow: auto;
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); }
.lb-stage { display: flex; justify-content: center; background: #000; }
.lb-stage img { max-width: 100%; max-height: 68vh; object-fit: contain; }
.lb-video { aspect-ratio: 16 / 9; }
.lb-video iframe { width: 100%; height: 100%; border: 0; }
.lb-cap { margin: 14px 0 0; color: var(--muted); min-height: 1.5em; }
.lb-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 10px; }
.lb-nav .btn:last-child { margin-left: auto; }
.lb-count { font-family: var(--font-ui); font-size: 12px; color: var(--muted); }

.prose { max-width: 68ch; }
.prose h2 { font-size: 26px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--muted); }
.todo { background: var(--accent); color: var(--on-accent); padding: 0 6px; }

/* ---------- Footer ---------- */
.site-footer { padding: 48px 0 56px; background: var(--bg); box-shadow: 0 -4px 0 0 var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 18px; }
.footer-brand img { width: 96px; height: 96px; }
.footer-brand p { margin: 0; color: var(--muted); font-size: 16px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-links a { font-family: var(--font-ui); font-size: 12px; letter-spacing: .05em; color: var(--ink); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  body { font-size: 18px; }
  .community-grid, .detail { grid-template-columns: 1fr; gap: 36px; }
  .nav-toggle { display: flex; }
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; padding: 12px 20px 24px; background: var(--bg); box-shadow: 0 4px 0 0 var(--line); transform: translateY(-120%); visibility: hidden; transition: transform .16s steps(4), visibility 0s .16s; }
  body.nav-open .nav { transform: none; visibility: visible; transition: transform .16s steps(4); }
  .nav a:not(.btn) { padding: 16px 6px; font-size: 14px; }
  .nav .btn { align-self: flex-start; margin-top: 12px; }
  .brand span { font-size: 19px; }
  .section { padding: 64px 0; }
  #theme-picker { bottom: 50px; }
}
@media (max-height: 700px) and (min-width: 861px) { .hero-logo { width: min(44vh, 420px); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
