/* =============================================================
   PLANIGAMES — geteiltes Stylesheet
   Hybrid-Look: dunkles Premium-Studio + farbige Game-Welten.
   Tailwind (CDN) liefert die Utilities, hier liegen nur die
   maßgeschneiderten Effekte (Cursor, Filmkorn, Reveals, Blöcke).
   ============================================================= */

:root {
    --x: 50%;
    --y: 50%;
    /* Studio-Akzent (Standard): Schwarz / Weiß / Orange.
       Game-Seiten überschreiben --accent live für ihre eigene Welt. */
    --accent: #ff7d1a;          /* Orange       */
    --accent-2: #e6a015;        /* dunkles Gold  */
    --accent-3: #ffa53d;        /* helles Orange */
    --bg: #050505;              /* (fast) Schwarz, neutral */
}

html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { overscroll-behavior-y: none; background: var(--bg); }

/* Perfekte Illusion: System-Cursor nur auf Feinzeiger-Geräten ausblenden */
@media (pointer: fine) {
    html, body, a, button, input, textarea, select, option, .magnetic, .cursor-hot {
        cursor: none !important;
    }
}

/* ---------- Hintergrund: ruhig & premium (statt Filmkorn) ---------- */
/* Sanfte Vignette + Top-Glow auf reinem Schwarz – kein Rauschen mehr. */
.noise-bg {
    background-color: var(--bg);
    background-image:
        radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 55%),
        radial-gradient(100% 60% at 50% 115%, color-mix(in srgb, var(--accent-2) 6%, transparent), transparent 60%);
    background-attachment: fixed;
}
/* Alte Filmkorn-Textur entfernt */
.grain-overlay::after { content: none; display: none; }

/* Schwebende Magie-/Glut-Partikel (Canvas, von app.js animiert) */
#fx-canvas {
    position: fixed; inset: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0;
}

/* ---------- Marken-Typo-Helfer ---------- */
.font-display { font-family: 'Clash Display', 'Archivo', system-ui, sans-serif; }
.text-gradient {
    /* Verlauf dunkles Gelb -> Orange (wie im Logo-Schriftzug "GAMES") */
    background: linear-gradient(110deg, var(--accent-2), var(--accent) 75%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.text-stroke {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.16);
    color: transparent;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.text-stroke:hover { -webkit-text-stroke: 1px #fff; color: #fff; }

/* ---------- Custom Cursor ---------- */
#cursor-dot {
    position: fixed; top: 0; left: 0; width: 7px; height: 7px;
    background: #fff; border-radius: 9999px; z-index: 9999;
    pointer-events: none; mix-blend-mode: difference;
    transform: translate3d(-50%, -50%, 0);
}
#cursor-ring {
    position: fixed; top: 0; left: 0; width: 38px; height: 38px;
    border: 1px solid rgba(255,255,255,0.45); border-radius: 9999px;
    z-index: 9998; pointer-events: none; mix-blend-mode: difference;
    transform: translate3d(-50%, -50%, 0);
    transition: width .25s ease, height .25s ease, background-color .25s ease, border-color .25s ease;
}
body.cursor-active #cursor-ring { width: 64px; height: 64px; background: rgba(255,255,255,0.08); }
/* Auf Touch-/Handy-Geräten gibt es keinen Mauszeiger -> Custom-Cursor komplett ausblenden */
@media (hover: none), (pointer: coarse) {
    #cursor-dot, #cursor-ring { display: none !important; }
}

/* ---------- Burger & Mobile-Menü ---------- */
.burger {
    position: relative; width: 44px; height: 44px; border: 0; background: transparent;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; z-index: 60;
}
.burger span {
    display: block; width: 26px; height: 2px; border-radius: 2px; background: #fff;
    transition: transform .35s cubic-bezier(0.16,1,0.3,1), opacity .25s ease;
}
.burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
    position: fixed; inset: 0; z-index: 45;
    background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 14%, #060606), #050505 70%);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    display: flex; flex-direction: column; justify-content: center;
    padding: 7rem 2rem 3rem;
    opacity: 0; visibility: hidden; transform: translateY(-12px);
    transition: opacity .4s ease, transform .4s cubic-bezier(0.16,1,0.3,1), visibility .4s;
}
.mobile-menu.open { opacity: 1; visibility: visible; transform: none; }
.mm-nav { display: flex; flex-direction: column; gap: 1.1rem; max-width: 30rem; }
.mm-link {
    font-family: 'Clash Display', 'Archivo', sans-serif; font-size: clamp(2rem, 9vw, 2.8rem);
    font-weight: 800; line-height: 1; color: #fff; text-decoration: none; letter-spacing: -0.01em;
    opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(0.16,1,0.3,1);
}
.mm-link.is-active { color: transparent; background: linear-gradient(110deg, var(--accent-2), var(--accent) 75%); -webkit-background-clip: text; background-clip: text; }
.mm-sub { color: #8a8a93; text-decoration: none; font-size: 1rem; opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(0.16,1,0.3,1); }
.mm-sub:hover { color: #fff; }
.mm-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.4rem; opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(0.16,1,0.3,1); }
.mobile-menu.open .mm-link, .mobile-menu.open .mm-sub, .mobile-menu.open .mm-actions {
    opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 0.06s + 0.08s);
}
body.menu-open { overflow: hidden; }

/* ---------- Scroll-Progress ---------- */
#scroll-progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0%;
    background: linear-gradient(to right, var(--accent), var(--accent-3), var(--accent-2));
    z-index: 9990; transition: width 0.1s linear;
}

/* ---------- Ambient Glow-Blobs (statisch – performant, auch auf Safari) ---------- */
.glow-blob { position: fixed; border-radius: 9999px; filter: blur(110px); pointer-events: none; z-index: 0; }
/* Effekt-Stufen (im Admin wählbar): "Aus / minimal" blendet alles bis auf die Vignette aus */
body.fx-off .glow-blob, body.fx-off #fx-canvas { display: none; }

/* ---------- Header ---------- */
#site-header { transition: all .5s cubic-bezier(0.16,1,0.3,1); }
#site-header.scrolled {
    background: rgba(5, 5, 5, 0.82);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

/* ---------- Scroll-Reveal ---------- */
.reveal { opacity: 0; transform: translateY(38px); transition: opacity 1s cubic-bezier(0.16,1,0.3,1), transform 1s cubic-bezier(0.16,1,0.3,1); }
.reveal.in { opacity: 1; transform: none; }
.line-mask { overflow: hidden; display: block; }
.line-inner { display: block; transform: translateY(115%); transition: transform 1.05s cubic-bezier(0.16,1,0.3,1); }
.reveal-on .line-inner { transform: translateY(0); }

/* ---------- Laufband ---------- */
@keyframes marquee { 0% { transform: translate3d(0,0,0); } 100% { transform: translate3d(-50%,0,0); } }
.animate-marquee { animation: marquee 30s linear infinite; }

/* ---------- Karten / Glow / Shine ---------- */
.tilt-card {
    position: relative; transform-style: preserve-3d;
    transition: transform .3s cubic-bezier(0.16,1,0.3,1), border-color .35s ease, box-shadow .35s ease;
}
.tilt-card.tilting { transition: transform 90ms linear, border-color .35s ease, box-shadow .35s ease; }
.card-glow {
    position: absolute; inset: 0; border-radius: inherit; z-index: 0; opacity: 0;
    transition: opacity .4s ease; pointer-events: none;
    background: radial-gradient(380px circle at var(--x) var(--y), color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%);
}
.tilt-card:hover .card-glow { opacity: 1; }
.card-shine {
    position: absolute; top: 0; left: -80%; width: 60%; height: 100%; z-index: 1; pointer-events: none;
    background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,0.10) 50%, transparent 100%);
    transform: skewX(-16deg); transition: left .8s cubic-bezier(0.16,1,0.3,1);
}
.tilt-card:hover .card-shine { left: 150%; }

/* Magnetische Buttons */
.magnetic { transition: transform .25s cubic-bezier(0.16,1,0.3,1); }

/* Akzent-Button */
.btn-accent {
    background: linear-gradient(110deg, var(--accent), var(--accent-3));
    color: #fff; box-shadow: 0 10px 40px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-ghost { border: 1px solid rgba(255,255,255,0.18); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.04); }

/* Status-Badges */
.badge { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }

/* ---------- Markdown / Prose ---------- */
.prose-pg { color: #c7c7d1; line-height: 1.75; font-size: 1.02rem; }
.prose-pg h1, .prose-pg h2, .prose-pg h3 { color: #fff; font-weight: 800; letter-spacing: -0.01em; margin: 1.6em 0 .5em; line-height: 1.15; }
.prose-pg h1 { font-size: 1.9rem; } .prose-pg h2 { font-size: 1.5rem; } .prose-pg h3 { font-size: 1.2rem; }
.prose-pg p { margin: 0 0 1.1em; }
.prose-pg a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose-pg ul, .prose-pg ol { margin: 0 0 1.1em 1.2em; }
.prose-pg ul { list-style: disc; } .prose-pg ol { list-style: decimal; }
.prose-pg li { margin: .35em 0; }
.prose-pg img { border-radius: 0.9rem; margin: 1.4em 0; }
.prose-pg blockquote { border-left: 2px solid var(--accent); padding-left: 1rem; color: #e4e4ef; font-style: italic; margin: 1.4em 0; }
.prose-pg code { font-family: 'JetBrains Mono', monospace; font-size: .85em; background: rgba(255,255,255,0.07); padding: .15em .4em; border-radius: .35rem; }
.prose-pg hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 2em 0; }

/* Patchnote-Marker (### im Body bekommen kleine farbige Punkte) */
.prose-pg ul.changelog { list-style: none; margin-left: 0; }
.prose-pg ul.changelog li { position: relative; padding-left: 1.4rem; }
.prose-pg ul.changelog li::before { content: ""; position: absolute; left: 0; top: .55em; width: .5rem; height: .5rem; border-radius: 9999px; background: var(--accent); }

/* ---------- Lightbox (Screenshot-Galerie) ---------- */
#lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(3,3,4,0.95);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center; }
#lightbox.hidden { display: none; }
#lightbox .lb-img { max-width: 92vw; max-height: 84vh; border-radius: 12px; box-shadow: 0 30px 90px rgba(0,0,0,.7); }
#lightbox .lb-close, #lightbox .lb-nav {
    position: absolute; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; border-radius: 9999px; cursor: pointer; display: grid; place-items: center; transition: background .2s, border-color .2s; }
#lightbox .lb-close:hover, #lightbox .lb-nav:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.4); }
#lightbox .lb-close { top: 1.2rem; right: 1.4rem; width: 44px; height: 44px; font-size: 1.1rem; }
#lightbox .lb-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 2rem; line-height: 1; }
#lightbox .lb-prev { left: 1.2rem; } #lightbox .lb-next { right: 1.2rem; }
#lightbox .lb-count { position: absolute; bottom: 1.3rem; left: 50%; transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #b9b9c4; letter-spacing: .1em; }
@media (max-width: 640px) { #lightbox .lb-nav { width: 42px; height: 42px; font-size: 1.5rem; } }

::selection { background: var(--accent); color: #050505; }

/* Reduced motion: nur sicherstellen, dass Inhalte sichtbar bleiben */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal, .line-inner { transition: none !important; }
    .glow-1, .glow-2 { animation: none !important; }
}

/* Utility: feines Gitter */
.grid-lines {
    background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 64px 64px;
}
