/* --- Reset & Basis --- */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/roboto-v51-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  src: url('fonts/roboto-v51-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 500;
  src: url('fonts/oswald-v57-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 700;
  src: url('fonts/oswald-v57-latin-700.woff2') format('woff2');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body, html {
    width: 100%;
    overflow-x: hidden;
    font-family: 'Roboto', sans-serif;
    background-color: #1a120e;
    color: #fff;
}

/* --- Header / Navigation --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    background: rgba(26, 18, 14, 0.6);
    border-bottom: 1px solid rgba(210, 166, 121, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.desktop-menu a {
    color: white;
    text-decoration: none;
    margin-left: 35px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.desktop-menu a:hover {
    color: #d2a679;
}

.mobile-menu-btn {
    display: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, rgba(26,18,14,0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    max-width: 1400px;
    padding: 0 5%;
}

.text-container {
    display: flex;
    flex-direction: column;
    color: white;
}

h1 {
    font-family: 'Oswald', sans-serif;
    line-height: 1.1;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

p {
    margin-bottom: 40px;
}

.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.cta-button {
    padding: 16px 40px;
    text-decoration: none;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.3s, transform 0.3s, border-color 0.3s, color 0.3s;
    border: 2px solid transparent;
    display: inline-block;
}

.cta-button:hover {
    transform: scale(1.05);
    background-color: #a06b38 !important;
    color: #fff !important;
}

/* --- Features (Bilder & Spiel) --- */
.features-main {
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    position: relative;
	isolation: isolate;
}

.feature-section {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 5% 0 5%;
    position: relative;
    gap: 60px;
}

.feature-section:nth-child(even) {
    flex-direction: row-reverse;
}

.feature-mockup {
    flex: 0 1 50%;
    display: flex;
    justify-content: flex-end;
}

.feature-section:nth-child(even) .feature-mockup {
    justify-content: flex-start;
}

.feature-mockup img {
    max-height: 60vh;
    max-width: 100%;
    object-fit: contain;
}

.feature-text {
    flex: 0 1 50%;
    max-width: 600px;
    transform: translateX(50px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1) 0.2s, opacity 0.8s ease 0.2s;
}

.feature-section:nth-child(even) .feature-text {
    transform: translateX(-50px);
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.feature-section.is-visible .feature-text {
    transform: translate(0, 0);
    opacity: 1;
}

.feature-text h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.1;
    text-transform: uppercase;
}

.feature-text ul {
    list-style: none;
    font-size: 1.2rem;
    line-height: 1.6;
    width: 100%;
}

.feature-text ul li {
    margin-bottom: 12px;
    padding-left: 35px;
    position: relative;
}

.feature-section:nth-child(even) .feature-text ul li {
    padding-right: 35px;
    padding-left: 0;
    text-align: right;
}

.feature-text ul li::before {
    content: '🐾';
    position: absolute;
    left: 0;
    font-size: 1rem;
    color: #d2a679;
}

.feature-section:nth-child(even) .feature-text ul li::before {
    left: auto;
    right: 0;
}

/* --- 1. Ebene: Rotierender Hintergrund (Ganz hinten) --- */
.features-main::after {
    content: '';
    position: fixed;
    top: calc(50vh - 150vmax);
    left: calc(50vw - 150vmax);
    width: 300vmax;
    height: 300vmax;
    z-index: -2; 
    pointer-events: none;
    
    /* Erdige Töne statt Rot/Schwarz */
    background: linear-gradient(45deg, #0a0807 0%, #291e19 30%, #17110e 50%, #3a2a22 80%, #000000 100%);
    animation: rotateBackground 40s linear infinite;
}

@keyframes rotateBackground {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- 2. Ebene: Maus-Glow (Zwischen Content und Hintergrund) --- */
.features-main::before {
    content: '';
    position: fixed;
    top: -50vh;
    left: -50vw;
    width: 200vw;
    height: 200vh;
    z-index: -1; 
    pointer-events: none;
    /* Angepasst auf ein warmes Goldbraun passend zum Rest */
    background: radial-gradient(
        circle 1200px at calc(var(--mouse-x, 50vw) + 50vw) calc(var(--mouse-y, 50vh) + 50vh), 
        rgba(210, 166, 121, 0.15) 0%, 
        rgba(210, 166, 121, 0) 70%
    );
}

/* Sichert ab, dass Texte und Bilder über dem Glow bleiben */
.feature-section {
    position: relative;
    z-index: 1;
}

/* --- Footer --- */
.site-footer {
    position: fixed;
    left: 0;
    bottom: 0; 
    padding: 15px 0 20px; 
    width: 100%;
    text-align: center;
    z-index: 9999;
}

.site-footer a, .site-footer .separator {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: #d2a679;
}

.site-footer .separator {
    margin: 0 10px;
}

/* --- Legal Modal --- */
.legal-modal {
    display: none; 
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999; 
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.legal-content-wrapper {
    background: #291e19;
    border: 1px solid rgba(210, 166, 121, 0.2);
    padding: 40px;
    border-radius: 20px;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    color: white;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.close-legal {
    position: sticky;
    top: -20px;
    float: right;
    cursor: pointer;
    font-size: 2rem;
    color: #d2a679;
    z-index: 10;
    background: #291e19;
    padding: 5px 10px;
    border-radius: 50%;
}

.legal-text-block h2, .legal-text-block h3 {
    font-family: 'Oswald', sans-serif;
    margin-bottom: 15px;
    color: #d2a679;
}

.legal-text-block p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.legal-links-mobile {
    display: none;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .feature-section {
        flex-direction: column !important;
        justify-content: center;
        padding-top: 100px;
        padding-bottom: 50px;
        gap: 30px;
    }

    .feature-mockup {
        flex: 0 0 auto;
        justify-content: center !important;
    }

    .feature-mockup img {
        max-height: 40vh;
    }

    .feature-text, .feature-section:nth-child(even) .feature-text {
        transform: translateY(30px);
        text-align: center;
        align-items: center;
        padding: 0 10px;
    }

    .feature-section.is-visible .feature-text {
        transform: translate(0, 0);
    }

    .feature-text ul li, .feature-section:nth-child(even) .feature-text ul li {
        text-align: left;
        padding-left: 35px;
        padding-right: 0;
    }

    .feature-text ul li::before, .feature-section:nth-child(even) .feature-text ul li::before {
        left: 0;
        right: auto;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; z-index: 10000; }
	
	.hero {
        align-items: flex-start;
        padding-top: 130px; /* Passt den Abstand nach oben unter dem Header an */
    }
    
    .desktop-menu {
        display: none;
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100vh;
        background: rgba(26, 18, 14, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 9998;
    }
    
    .desktop-menu.active { display: flex; }
    .desktop-menu a { margin: 15px 0; font-size: 1.8rem; }
    
    .site-footer { display: none; }
    
    .legal-links-mobile {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        margin-top: 50px;
    }

    .legal-links-mobile a {
        font-size: 1rem !important;
        color: rgba(255, 255, 255, 0.5) !important;
        margin: 0 !important;
    }
	
	
}

/* --- Spiel (Dackel-Snake) --- */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 100px 20px 40px 20px;
    text-align: center;
}

.game-header {
    margin-bottom: 20px;
}

.game-header h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 2.5rem;
    color: #d2a679;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.score-board {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 15px;
}

.score-board span {
    color: #d2a679;
    font-weight: bold;
}

.game-canvas-wrapper {
    position: relative;
    border: 4px solid #8b5a2b;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.7);
    background-color: #140e0b;
}

canvas#snakeCanvas {
    display: block;
    background-color: #1f1612;
}

.game-controls-mobile {
    display: none;
    grid-template-columns: repeat(3, 70px);
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.game-btn {
    background-color: #8b5a2b;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.5rem;
    padding: 15px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.game-btn:active {
    transform: scale(0.95);
    background-color: #a06b38;
}

.btn-up { grid-column: 2; }
.btn-left { grid-column: 1; grid-row: 2; }
.btn-down { grid-column: 2; grid-row: 2; }
.btn-right { grid-column: 3; grid-row: 2; }

@media (max-width: 768px) {
    .game-controls-mobile {
        display: grid;
    }
}