/* style.css */
/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'MyCustomFont';
    src: url('https://no-phones-downloads.b-cdn.net/assets/april-webfont.woff2') format('woff2'),
         url('https://no-phones-downloads.b-cdn.net/assets/april-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Helvetica Neue', sans-serif;
    background: #ffffff;
    height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-overflow-scrolling: touch;
}

body.landing-active {
    overflow: hidden;
}

/* Safari-Fix */
body:not(.loaded) #landing-page { display: flex !important; }
body:not(.loaded) .os-container > div:not(#landing-page) { display: none !important; }

/* LANDING PAGE */
.landing-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
}
.main-folder {
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease-out;
}
.main-folder:hover {
    transform: scale(1.1);
}
.main-folder .folder-icon {
    font-size: clamp(60px, 15vw, 80px);
    color: #563C90;
}

/* GRID PAGE */
.grid-page {
    display: none;
    width: 100%;
    min-height: 100vh;
    position: relative;
    box-sizing: border-box;
}

/* BACK BUTTON (Desktop/Base) */
.back-btn, #video-back-btn, #text-back-btn {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 105;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease-out, top 0.3s ease, left 0.3s ease;
    margin: 0;
}
.back-btn .folder-icon, #video-back-btn .folder-icon, #text-back-btn .folder-icon {
    font-size: 50px;
    color: #563C90;
    transition: font-size 0.3s ease;
}
.back-btn:hover, #video-back-btn:hover, #text-back-btn:hover {
    transform: scale(1.15);
}

/* TEXT FOLDER (Desktop/Base) */
#text-folder {
    position: absolute;
    top: 30px;
    right: 35px;
    z-index: 100;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease-out, top 0.3s ease, right 0.3s ease;
    margin: 0;
}
#text-folder:hover {
    transform: scale(1.15);
}
#text-folder .folder-icon {
    font-size: 50px;
    /* Farbe kommt von .folder-color-* Klasse im HTML */
    transition: font-size 0.3s ease;
}

/* TEXT PAGE - Minimalistischer Look */
.text-page {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #ffffff; z-index: 100;
    font-family: 'MyCustomFont', 'Helvetica Neue', sans-serif;
    overflow-y: auto;
    display: flex; flex-direction: column; align-items: center;
}
.text-container {
    width: min(90%, 800px);
    padding: 20px;
    padding-top: 80px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    margin: 0 auto;
}
.text-container h1 {
    margin-bottom: 25px;
    color: #333;
    font-family: 'MyCustomFont', sans-serif;
    font-size: 2.2rem;
}
.text-container h3 {
    margin-top: 30px;
    margin-bottom: 12px;
    color: #333;
    font-family: 'MyCustomFont', sans-serif;
    font-size: 1.5rem;
    text-align: center;
}
.text-container h3 .fa-fw {
    color: #563C90;
    margin-right: 8px;
}
.text-block {
    margin-top: 10px;
    margin-bottom: 10px;
    width: 100%;
}
.text-block p {
    color: #555;
    line-height: 1.65;
    font-family: 'Helvetica Neue', sans-serif;
    margin: 0 auto;
    max-width: 550px;
}
.text-block p.hinweis {
    font-size: 0.85em;
    color: #777;
    margin-top: 8px;
    font-style: normal;
    font-family: 'Helvetica Neue', sans-serif;
}
.divider {
    height: 1px;
    width: 60%;
    max-width: 300px;
    background-color: #e0e0e0;
    margin: 30px auto;
}
.gewinner-liste {
    list-style: none;
    padding: 0;
    margin: 15px auto 30px auto;
    width: 100%;
    max-width: 400px;
    text-align: center;
    font-family: 'MyCustomFont', sans-serif;
}
.gewinner-liste li {
    margin-bottom: 10px;
    font-size: 1.05rem;
    padding: 8px 0px;
    border-bottom: 1px solid #f0f0f0;
    background-color: transparent;
    border-radius: 0;
}
.gewinner-liste li:last-child {
    border-bottom: none;
}
.gewinner-liste li a {
    color: #563C90;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
    font-weight: normal;
    display: inline-block;
    padding: 2px 5px;
}
.gewinner-liste li a:hover {
    color: #3a2761;
    text-decoration: none;
    background-color: rgba(86, 60, 144, 0.05);
    border-radius: 3px;
}
.form-button {
    display: inline-block;
    background-color: #563C90; /* Haupt-Lila */
    color: #ffffff;
    font-family: 'MyCustomFont', 'Helvetica Neue', sans-serif;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 6px;
    margin-top: 20px; /* Abstand nach oben */
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-out, background-color 0.2s ease-out, box-shadow 0.2s ease-out;
}
.form-button:hover {
    background-color: #442f74; /* Dunkleres Lila */
    transform: translateY(-2px) scale(1.03); /* Leichter Schwebe-Effekt */
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
.form-button .fas {
    margin-right: 10px; /* Abstand zwischen Icon und Text */
}


/* GRID VIEW (Basis für Mobile) */
.grid-view {
    display: grid;
    grid-template-columns: repeat(2, 130px);
    grid-template-rows: repeat(2, 130px);
    gap: 20px;
    margin: 90px auto 20px;
    width: max-content;
    position: relative;
    top: 0;
    padding: 0 20px;
    box-sizing: border-box;
    transition: width 0.3s ease, margin 0.3s ease, gap 0.3s ease;
}

/* FOLDER STYLES */
.folder-item {
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease-out;
    margin: 0;
    aspect-ratio: 1 / 1;
}
.folder-item:hover { transform: scale(1.1); }
.folder-icon {
    font-size: 56px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: font-size 0.3s ease;
}

/* FOLDER COLORS */
.folder-color-1 .folder-icon { color: #FFCD03; } .folder-color-2 .folder-icon { color: #2E74BA; } .folder-color-3 .folder-icon { color: #D39AC4; } .folder-color-4 .folder-icon { color: #C7BB53; } .folder-color-5 .folder-icon { color: #563C90; }
.folder-color-text .folder-icon { color: #CFCDD4; }

/* VIDEO PAGE & SUB-ELEMENTS */
.video-page {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #ffffff; z-index: 100;
    display: flex; flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.video-container {
    width: min(90%, 800px);
    position: relative;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.polaroid-frame {
    display: block;
    background-color: #fdfdfd;
    padding: 15px 15px 60px 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid #eee;
    width: 100%;
    position: relative;
    margin: 0;
}
.polaroid-frame video#video-player {
    display: block; width: 100%; height: auto; max-height: 70vh;
    object-fit: contain; background: #000; border-radius: 0;
}
.polaroid-frame .download-link {
    position: absolute; bottom: 15px; right: 15px; margin-top: 0;
    font-family: 'MyCustomFont', sans-serif !important;
    font-size: 0.85rem; color: rgba(0, 0, 0, 0.7); text-decoration: none;
    transition: color 0.2s ease;
}
.polaroid-frame .download-link:hover { color: #563C90; }
.video-container.minigame-active { padding: 20px; }

/* Stil für "Merch?"-Text */
.merch-prompt-text {
    font-family: 'MyCustomFont', sans-serif;
    font-size: clamp(3rem, 10vw, 5rem); /* Responsive Schriftgröße */
    color: #563C90; /* Haupt-Lila */
    text-align: center;
}

#collage-area {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10;
    overflow: hidden;
}
.collage-image-wrapper {
    position: absolute; height: auto;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease-out, z-index 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer; box-sizing: border-box; padding: 8px;
    background-color: #ffffff; border: 1px solid #ddd;
}
.collage-image-wrapper img { display: block; width: 100%; height: 100%; object-fit: cover; }
.collage-image-wrapper:hover { z-index: 110; transform: scale(1.05) rotate(0deg) !important; box-shadow: 8px 8px 20px rgba(0,0,0,0.4); }
.center-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: #563C90; font-family: 'MyCustomFont', sans-serif; font-size: 18px;
    text-align: center; z-index: 50; pointer-events: none; user-select: none;
    line-height: 1.4;
}

/* === DESKTOP SPECIFIC === */
@media (min-width: 769px) {
    html, body { height: 100%; overflow: hidden; }
    body.landing-active { overflow: hidden; }

    .grid-page {
        height: 100%;
        overflow: hidden;
        position: relative;
    }

    .grid-view {
        display: grid;
        grid-template-columns: repeat(2, 130px);
        grid-template-rows: repeat(2, 130px);
        gap: 20px;
        width: max-content;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
    }

    .folder-item { position: relative; width: auto; height: auto; aspect-ratio: 1 / 1; }
    #grid-page > #back-btn,
    #grid-page > #text-folder { position: fixed; top: 30px; }
    #grid-page > #back-btn { left: 30px; right: auto; z-index: 105; }
    #grid-page > #text-folder { right: 35px; left: auto; z-index: 100; }
    #text-page > #text-back-btn { position: fixed; top: 30px; left: 30px; z-index: 115; }
    #video-page > #video-back-btn { position: fixed; top: 30px; left: 30px; z-index: 115; }
}

/* === MOBILE VERSION === */
@media (max-width: 768px) {
    body { overflow-y: visible; height: auto; min-height: 100vh; }
    body.landing-active,
    .video-page[style*="display: flex"]:not(.collage-layout-active) { overflow-y: hidden; }
    .landing-page { display: flex; justify-content: center; align-items: center; height: 100vh; height: 100dvh; width: 100%; overflow: hidden; }
    .grid-page {
        min-height: 100vh; height: auto; overflow-y: auto; overflow-x: hidden;
        display: block; position: relative; box-sizing: border-box;
        padding-top: calc(env(safe-area-inset-top, 0px) + 80px);
        padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 50px);
        padding-left: calc(env(safe-area-inset-left, 0px) + 15px);
        padding-right: calc(env(safe-area-inset-right, 0px) + 15px);
    }
    .grid-view {
        display: block;
        position: relative;
        width: 100%;
        margin: 0 auto 20px;
        padding: 0;
        box-sizing: border-box;
        height: 300px;
        overflow: hidden;
    }
    .folder-item {
        position: absolute; margin: 0; display: flex; justify-content: center;
        align-items: center; aspect-ratio: unset; width: 100px; height: 100px;
    }
    .grid-view .folder-item .folder-icon {
        font-size: clamp(60px, 16vw, 80px); position: absolute;
        top: 50%; left: 50%; transform: translate(-50%, -50%);
    }
    .text-page {
        position: relative; display: block; height: auto; min-height: 100vh;
        overflow-y: auto;
        padding-top: calc(env(safe-area-inset-top, 0px) + 80px);
        padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 50px);
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        box-sizing: border-box; z-index: 100;
        -webkit-overflow-scrolling: touch;
    }
    .text-container { padding-top: 0; padding-bottom: 20px; width: min(95%, 800px); }
    
    .text-container h1 { font-size: 1.8rem; }
    .text-container h3 { font-size: 1.3rem; }
    .text-block p { font-size: 0.9rem; line-height: 1.55; }
    .gewinner-liste { max-width: 90%; }
    .gewinner-liste li { font-size: 1rem; margin-bottom: 8px; padding: 6px 0px; }
    .form-button { font-size: 1rem; padding: 10px 20px; }

    :is(
        #grid-page > #back-btn,
        #grid-page > #text-folder,
        #text-page > #text-back-btn,
        #video-page > #video-back-btn:not(.in-collage-header)
    ) {
        position: absolute !important;
        top: env(safe-area-inset-top, 0px) !important;
        margin: 0 !important; padding: 0 !important; transform: none !important;
    }
    :is(
        #grid-page > #back-btn,
        #text-page > #text-back-btn,
        #video-page > #video-back-btn:not(.in-collage-header)
    ) {
        left: env(safe-area-inset-left, 0px) !important;
        right: auto !important; z-index: 105 !important;
    }
    #grid-page > #text-folder {
        right: env(safe-area-inset-right, 0px) !important;
        left: auto !important; z-index: 100 !important;
    }
    .collage-header > #video-back-btn.in-collage-header {
        position: absolute !important;
        top: env(safe-area-inset-top, 0px) !important;
        left: env(safe-area-inset-left, 0px) !important;
        pointer-events: auto !important; z-index: 110 !important;
        margin: 0 !important; padding: 0 !important; transform: none !important;
    }
    :is(
        #grid-page > #back-btn,
        #text-page > #text-back-btn,
        #video-page > #video-back-btn,
        #grid-page > #text-folder
    ) .folder-icon {
        font-size: 48px !important;
        position: absolute; top: 50%; left: 50%;
        transform: translate(-50%, -50%);
    }

    .video-page {
        box-sizing: border-box; overflow: hidden; justify-content: center; align-items: center;
        padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
        position: fixed !important;
    }
    .video-page.collage-layout-active {
        justify-content: flex-start; align-items: stretch; overflow: hidden;
        height: 100%; position: fixed !important;
    }
    .video-page.center-content-vertically {
        justify-content: center; align-items: center;
        padding-top: env(safe-area-inset-top, 0px);
    }
    .video-container {
        width: 95%; height: auto; margin: 0 auto;
        margin-bottom: env(safe-area-inset-bottom, 20px);
    }
    .polaroid-frame { padding: 10px 10px 50px 10px; margin: 0; }
    .polaroid-frame video#video-player { max-height: 75vh; }
    .polaroid-frame .download-link { bottom: 10px; right: 10px; font-size: 0.8rem; }
    .collage-header {
        position: fixed; top: 0; left: 0; width: 100%;
        height: calc(env(safe-area-inset-top, 0px) + 80px);
        z-index: 105; pointer-events: none; padding: 0;
        box-sizing: border-box; background-color: #ffffff;
    }
    #collage-area {
        display: flex; flex-direction: column; align-items: center;
        overflow-y: auto; overflow-x: hidden;
        position: absolute; top: calc(env(safe-area-inset-top, 0px) + 80px);
        bottom: 0; left: 0; width: 100%; height: auto;
        padding-top: 20px; padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 150px);
        padding-left: env(safe-area-inset-left, 15px);
        padding-right: env(safe-area-inset-right, 15px);
        box-sizing: border-box; z-index: 10;
        -webkit-overflow-scrolling: touch;
    }
    .video-page.collage-layout-active {
        overflow: hidden !important; height: 100% !important; position: fixed !important;
    }
    .collage-image-wrapper {
        position: static !important; width: 90% !important;
        margin: 10px auto; transform: rotate(0deg) !important;
        box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
        padding: 8px; background-color: #ffffff;
    }
    .collage-image-wrapper img { display: block; width: 100%; height: auto; object-fit: cover; }
    .center-text {
        display: flex; flex-direction: column; align-items: center;
        position: static; transform: none;
        margin: 20px 10px; font-size: 1.2rem; padding: 0;
        pointer-events: auto; user-select: auto; order: 1;
        color: #563C90; font-family: 'MyCustomFont', sans-serif; text-align: center;
        line-height: 1.4;
    }
    .video-container.minigame-active { padding: 20px 0; margin-top: 0; }
    .merch-prompt-text {
        font-size: 2rem; /* Mobile-spezifische Größe */
    }
}

#ticket-link {
    display: none; position: fixed;
    bottom: 20px; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    left: 50%; transform: translateX(-50%); z-index: 200;
    font-family: 'MyCustomFont', 'Helvetica Neue', sans-serif; font-size: 0.9rem;
    color: #563C90; text-decoration: none; padding: 5px 8px;
    background-color: rgba(255, 255, 255, 0.85); border-radius: 4px;
    transition: opacity 0.3s ease-out, transform 0.2s ease-out, color 0.2s ease-out, background-color 0.2s ease-out;
    white-space: nowrap; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    opacity: 1; visibility: visible;
}
#ticket-link:hover {
    transform: translateX(-50%) scale(1.05); color: #3a2761;
    background-color: rgba(255, 255, 255, 0.95);
}
@media (max-width: 360px) {
    #ticket-link { font-size: 0.8rem; padding: 4px 6px; }
}