/* =====================================================================
   MattiMatto & Friends – Aussehen
   ---------------------------------------------------------------------
   🎨 FARBEN ÄNDERN: Alle Farben stehen gesammelt hier oben.
   Die Werte sind aus dem Serverlogo abgeleitet (Stein, Moos, Glühwürmchen).
   ===================================================================== */

/* Pixelschrift – liegt lokal im Ordner "schrift" (Lizenz: SIL OFL, siehe schrift/LIZENZ.txt) */
@font-face {
    font-family: "Pixelify Sans";
    src: url("schrift/pixelify-sans-400.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Pixelify Sans";
    src: url("schrift/pixelify-sans-700.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

:root {
    --nacht:       #13120f;   /* Seitenhintergrund */
    --nacht-hell:   #1d1b17;   /* Abschnitte */
    --stein-dunkel: #3b3731;   /* Kartenrand / Schatten */
    --stein:        #6d675c;   /* Kartenflächen */
    --stein-hell:   #a59c8b;   /* Linien, leise Akzente */
    --stein-weiss:  #d9d0bd;   /* helle Steinkante */
    --moos:         #6f9b3c;   /* Hauptakzent */
    --moos-hell:    #95c553;
    --moos-dunkel:  #3f5e22;
    --gold:         #f3c95f;   /* Glühwürmchen, Hervorhebungen */
    --erde:         #6b4a2f;
    --erde-dunkel:  #4a3220;

    --text:         #ece6da;
    --text-leise:   #b5ad9e;

    --schrift-pixel: "Pixelify Sans", "Silkscreen", "Courier New", monospace;
    --schrift-text:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --breite: 1080px;
}

/* ---------- Grundlagen ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
    margin: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(111, 155, 60, .10), transparent 60%),
        var(--nacht);
    color: var(--text);
    font-family: var(--schrift-text);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--moos-hell); }
a:hover { color: var(--gold); }

code, kbd {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .92em;
}
kbd, p code, .klapper p code {
    background: var(--stein-dunkel);
    border: 1px solid var(--stein);
    border-bottom-width: 3px;
    padding: 0 .4em;
    color: var(--stein-weiss);
}

h1, h2, h3 {
    font-family: var(--schrift-pixel);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .02em;
    margin: 0 0 .5em;
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- Glühwürmchen ---------- */

.gluehwuermchen { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.gluehwuermchen span {
    position: absolute;
    width: 4px; height: 4px;
    background: var(--gold);
    box-shadow: 0 0 8px 2px rgba(243, 201, 95, .6);
    opacity: 0;
    animation: schweben var(--dauer, 12s) ease-in-out var(--verzoegerung, 0s) infinite;
}
@keyframes schweben {
    0%   { opacity: 0; transform: translate(0, 0); }
    20%  { opacity: .9; }
    50%  { opacity: .4; transform: translate(var(--x, 20px), -40px); }
    80%  { opacity: .9; }
    100% { opacity: 0; transform: translate(calc(var(--x, 20px) * -1), -90px); }
}

main, .kopf, .fuss { position: relative; z-index: 1; }

/* ---------- Kopfzeile ---------- */

.kopf {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 24px;
    padding: 10px max(16px, calc((100% - var(--breite)) / 2));
    background: rgba(19, 18, 15, .88);
    backdrop-filter: blur(8px);
    border-bottom: 3px solid var(--stein-dunkel);
}
.kopf__marke {
    display: flex; align-items: center; gap: 10px;
    color: var(--text); text-decoration: none;
    font-family: var(--schrift-pixel); font-weight: 700;
    white-space: nowrap;
}
.kopf__nav {
    display: flex; gap: 4px;
    margin-left: auto;
    overflow-x: auto;
    scrollbar-width: none;
}
.kopf__nav::-webkit-scrollbar { display: none; }
.kopf__nav a {
    padding: 6px 10px;
    color: var(--text-leise); text-decoration: none;
    font-size: 15px; white-space: nowrap;
}
.kopf__nav a:hover { color: var(--gold); background: var(--nacht-hell); }

@media (max-width: 760px) {
    .kopf { flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
    .kopf__nav { margin-left: -10px; width: calc(100% + 20px); }
    html { scroll-padding-top: 110px; }
}

/* ---------- Knöpfe im Minecraft-Stil ---------- */

.knopf {
    display: inline-block;
    padding: 12px 22px;
    font-family: var(--schrift-pixel); font-weight: 700; font-size: 17px;
    color: #fff; text-decoration: none; text-shadow: 2px 2px 0 rgba(0, 0, 0, .55);
    background: var(--stein);
    border: 3px solid #111;
    box-shadow: inset 3px 3px 0 var(--stein-hell), inset -3px -4px 0 var(--stein-dunkel);
    cursor: pointer;
    transition: transform .08s;
}
.knopf:hover { color: #fff; background: #7d7669; }
.knopf:active { transform: translateY(2px); }
.knopf--gruen {
    background: var(--moos);
    box-shadow: inset 3px 3px 0 var(--moos-hell), inset -3px -4px 0 var(--moos-dunkel);
}
.knopf--gruen:hover { background: #7fae46; }

/* ---------- Begrüßung ---------- */

.held {
    text-align: center;
    padding: 48px 16px 72px;
    max-width: var(--breite);
    margin: 0 auto;
}
.held__logo {
    width: min(320px, 70vw); height: auto;
    margin: 0 auto 8px;
    /* weicher Rand, damit der Logo-Hintergrund mit der Seite verschmilzt */
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 71%);
            mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 71%);
    animation: logo-schweben 6s ease-in-out infinite;
}
@keyframes logo-schweben {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
.held__titel {
    font-size: clamp(34px, 7vw, 64px);
    color: var(--stein-weiss);
    text-shadow: 4px 4px 0 var(--stein-dunkel), 0 0 30px rgba(243, 201, 95, .15);
    margin-bottom: 12px;
}
.held__titel span { color: var(--moos-hell); }
.held__text {
    font-size: clamp(17px, 2.4vw, 20px);
    color: var(--text-leise);
    max-width: 620px;
    margin: 0 auto 28px;
}
.held__knoepfe { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Abschnitte ---------- */

.abschnitt {
    max-width: var(--breite);
    margin: 0 auto 56px;
    padding: 0 16px;
}
.abschnitt__titel {
    font-size: clamp(26px, 4vw, 36px);
    color: var(--stein-weiss);
    display: flex; align-items: center; gap: 14px;
}
.abschnitt__titel::before {
    content: "";
    width: 18px; height: 18px; flex: none;
    background: var(--moos);
    box-shadow: inset 4px 4px 0 var(--moos-hell), inset -4px -4px 0 var(--moos-dunkel);
}
.abschnitt__intro { color: var(--text-leise); margin: -4px 0 24px; }

/* Steinplatte – Grundlage für Karten */
.schritt, .kachel, .adresse, .klapper, .karte, .regeln {
    background-color: var(--nacht-hell);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Crect x='2' y='3' width='2' height='2' fill='%23ffffff' fill-opacity='.025'/%3E%3Crect x='10' y='1' width='3' height='2' fill='%23000000' fill-opacity='.12'/%3E%3Crect x='6' y='9' width='2' height='3' fill='%23ffffff' fill-opacity='.03'/%3E%3Crect x='12' y='12' width='2' height='2' fill='%23000000' fill-opacity='.12'/%3E%3Crect x='1' y='13' width='2' height='1' fill='%23ffffff' fill-opacity='.03'/%3E%3C/svg%3E");
    background-size: 32px 32px;
    image-rendering: pixelated;
    border: 3px solid var(--stein-dunkel);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .04), 0 6px 0 rgba(0, 0, 0, .35);
}

/* ---------- Schritte ---------- */

.schritte { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.schritt { display: flex; gap: 18px; padding: 22px; }
.schritt h3 { font-size: 22px; color: var(--text); }
.schritt p { margin: 0 0 8px; }
.schritt > div { flex: 1; min-width: 0; }
.schritt__nr {
    flex: none;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    font-family: var(--schrift-pixel); font-weight: 700; font-size: 22px;
    color: var(--nacht);
    background: var(--gold);
    box-shadow: inset 3px 3px 0 #fbe3a2, inset -3px -3px 0 #b88f2f;
}

.adressen { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.adresse { padding: 16px; display: grid; gap: 10px; align-content: start; background-color: var(--nacht); }
.adresse__kopf { display: flex; flex-direction: column; }
.adresse__name { font-family: var(--schrift-pixel); font-weight: 700; font-size: 19px; color: var(--moos-hell); }
.adresse__info { font-size: 14px; color: var(--text-leise); }
.adresse__wert {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: #0c0b09;
    border: 2px solid var(--stein);
    color: var(--text);
    font: inherit; text-align: left;
    cursor: pointer;
}
.adresse__wert code { font-size: 17px; color: #fff; overflow-wrap: anywhere; }
.adresse__wert--klein { padding: 8px 14px; }
.adresse__wert--klein code { font-size: 15px; }
.adresse__wert:hover { border-color: var(--moos-hell); }
.adresse__kopieren {
    flex: none;
    font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--moos-hell);
}

/* ---------- Kacheln ---------- */

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.kachel { padding: 22px; transition: transform .15s, border-color .15s; }
.kachel:hover { transform: translateY(-3px); border-color: var(--moos-dunkel); }
.kachel__icon { font-size: 34px; display: block; margin-bottom: 8px; }
.kachel h3 { font-size: 20px; color: var(--text); }
.kachel p { margin: 0; color: var(--text-leise); font-size: 16px; }

/* ---------- Aufklapp-Blöcke ---------- */

.klappgruppe { display: grid; gap: 10px; }
.klapper > summary {
    list-style: none;
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    font-family: var(--schrift-pixel); font-weight: 700; font-size: 19px;
    cursor: pointer;
    user-select: none;
}
.klapper > summary::-webkit-details-marker { display: none; }
.klapper > summary::after {
    content: "+";
    margin-left: auto;
    width: 28px; height: 28px; flex: none;
    display: grid; place-items: center;
    font-size: 22px; line-height: 1;
    color: var(--nacht);
    background: var(--stein-hell);
    box-shadow: inset 2px 2px 0 var(--stein-weiss), inset -2px -2px 0 var(--stein);
}
.klapper[open] > summary::after { content: "−"; background: var(--moos-hell); box-shadow: inset 2px 2px 0 #c3e68f, inset -2px -2px 0 var(--moos); }
.klapper > summary:hover { color: var(--gold); }
.klapper > p { margin: 0; padding: 0 20px 18px; color: var(--text-leise); }

.befehle { list-style: none; margin: 0; padding: 0 20px 18px; display: grid; gap: 6px; }
.befehle li {
    display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 14px; align-items: center;
    padding: 8px 0;
    border-top: 1px dashed var(--stein-dunkel);
}
.befehle li:first-child { border-top: 0; }
.befehle button {
    justify-self: start;
    padding: 4px 10px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 15px;
    color: #fff;
    background: #0c0b09;
    border: 2px solid var(--stein);
    cursor: pointer;
}
.befehle button i { color: var(--gold); font-style: normal; opacity: .85; }
.befehle button:hover { border-color: var(--moos-hell); }
.befehle span { color: var(--text-leise); font-size: 16px; }

@media (max-width: 560px) {
    .befehle li { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Weltkarte ---------- */

.karte {
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    padding: 28px;
    border-color: var(--moos-dunkel);
    background-color: #1b2014;
}
.karte > div { flex: 1 1 280px; }
.karte .abschnitt__titel { margin-bottom: .3em; }
.karte p { margin: 0; color: var(--text-leise); }
.karte__icon { font-size: 54px; }

/* ---------- Galerie ---------- */

.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.galerie__bild {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 3px solid var(--stein-dunkel);
    background: var(--nacht-hell);
    box-shadow: 0 5px 0 rgba(0, 0, 0, .35);
}
.galerie__bild img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.galerie__bild:hover { border-color: var(--moos); }
.galerie__bild:hover img { transform: scale(1.05); }
.galerie__bild.ist-versteckt { display: none; }
.galerie__mehr { text-align: center; margin-top: 24px; }

.leuchtkasten {
    position: fixed; inset: 0; z-index: 50;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(8, 8, 6, .94);
}
.leuchtkasten[hidden] { display: none; }
.leuchtkasten figure { margin: 0; max-width: min(1400px, 100%); }
.leuchtkasten img {
    max-height: calc(100vh - 110px);
    width: auto; margin: 0 auto;
    border: 3px solid var(--stein-dunkel);
}
.leuchtkasten figcaption { text-align: center; color: var(--text-leise); margin-top: 10px; font-size: 15px; }
.leuchtkasten button {
    position: absolute;
    width: 48px; height: 48px;
    font-size: 30px; line-height: 1;
    color: #fff;
    background: var(--stein);
    border: 3px solid #111;
    box-shadow: inset 3px 3px 0 var(--stein-hell), inset -3px -3px 0 var(--stein-dunkel);
    cursor: pointer;
}
.leuchtkasten button:hover { background: var(--moos); }
.leuchtkasten__zu { top: 16px; right: 16px; font-size: 22px !important; }
.leuchtkasten__pfeil--zurueck { left: 16px; }
.leuchtkasten__pfeil--vor { right: 16px; }
@media (max-width: 600px) {
    .leuchtkasten__pfeil { top: auto; bottom: 16px; }
    .leuchtkasten__pfeil--zurueck { left: calc(50% - 60px); }
    .leuchtkasten__pfeil--vor { right: calc(50% - 60px); }
}

/* ---------- Regeln ---------- */

.hinweis {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 0 14px;
    font-size: 15px;
    color: var(--nacht);
    background: var(--gold);
}
.regeln {
    margin: 0;
    padding: 18px 22px 18px 52px;
    display: grid; gap: 10px;
}
.regeln li::marker { font-family: var(--schrift-pixel); font-weight: 700; color: var(--moos-hell); }
.regeln strong { color: var(--text); }
.regeln li { color: var(--text-leise); }

/* ---------- Fußzeile ---------- */

.fuss { margin-top: 80px; }
.fuss__gras {
    height: 24px;
    background:
        linear-gradient(var(--moos), var(--moos)) top / 100% 8px no-repeat,
        repeating-linear-gradient(90deg, var(--moos) 0 8px, transparent 8px 16px, var(--moos-hell) 16px 24px, transparent 24px 40px) 0 8px / 100% 8px no-repeat,
        var(--erde);
}
.fuss__inhalt {
    background: var(--erde-dunkel);
    text-align: center;
    padding: 28px 16px 36px;
    color: #d8c6ad;
}
.fuss__inhalt p { margin: 0 0 8px; }
.fuss__marke { font-family: var(--schrift-pixel); font-weight: 700; font-size: 18px; }
.fuss__links { display: flex; gap: 20px; justify-content: center; }
.fuss__links a { color: #f0e2cc; }
.fuss__klein { font-size: 13px; opacity: .7; }

/* ---------- Kopiert-Meldung ---------- */

.meldung {
    position: fixed; left: 50%; bottom: 24px; z-index: 60;
    transform: translate(-50%, 20px);
    padding: 10px 18px;
    font-family: var(--schrift-pixel); font-weight: 700;
    color: #fff;
    background: var(--moos);
    border: 3px solid #111;
    box-shadow: inset 3px 3px 0 var(--moos-hell), inset -3px -3px 0 var(--moos-dunkel);
    opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.meldung.ist-sichtbar { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Weniger Bewegung, wenn gewünscht ---------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .gluehwuermchen { display: none; }
}
