:root {
    --primary-color: #e91e63; /* Ein schönes Pink/Rot */
    --background-color: #fce4ec; /* Sehr helles Pink als Hintergrund */
    --text-color: #333;
    --card-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lato', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow-x: hidden;
    margin: 0;
    /* Hintergrund wird jetzt über Slideshow geregelt, aber Fallback Farbe bleibt */
    background-color: #222; 
}

.background-slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.bg-slide.active {
    opacity: 1;
}

/* Audio Button */
.audio-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 9999; /* Maximaler Z-Index */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background 0.2s;
}

.audio-btn:hover {
    transform: scale(1.1);
    background: #fff;
}

/* Timer Styling */
.timer-wrapper {
    margin-top: 40px;
    color: #fff; /* Weiß für guten Kontrast auf Hintergrund */
    text-shadow: 0 2px 10px rgba(0,0,0,0.7); /* Schatten für Lesbarkeit */
    font-family: 'Lato', sans-serif;
    animation: fadeIn 2s ease;
}

.timer-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
    opacity: 0.9;
}

#live-timer {
    font-family: 'Courier New', monospace; /* Monospace damit Zahlen nicht springen */
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-block;
    backdrop-filter: blur(5px);
}

/* Container für die zentrierte Karte */
.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    /* padding-top entfernt, damit es nicht so riesig wirkt */
    z-index: 10;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Die Karte selbst - Briefpapier Look */
.content {
    background-color: #fffcf5; /* Warmes Elfenbein */
    background-image: repeating-linear-gradient(#fffcf5, #fffcf5 31px, #e8e8e8 32px); /* Linien */
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    width: 100%;
    min-height: 400px;
    position: relative;
    margin-bottom: 30px;
    transition: all 0.5s ease-in-out;
}

/* Text Schritte initial ausblenden */
.text-step {
    display: none;
    animation: fadeIn 0.8s ease;
}

.text-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Texte Styling */
.content p {
    margin-bottom: 2rem;
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    line-height: 2rem; /* Muss zum Lineal passen */
    color: #444;
}

.headline {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #b76e79; /* Rosenholz */
    text-align: center;
}

.intro {
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
    line-height: 1.6;
}

/* Controls Area (Buttons + Timer) */
.controls-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Button Container (unten im Brief) */
.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px; /* Abstand zum Text */
    padding-top: 20px;
    border-top: 1px dashed #ddd; /* Schicke Trennlinie */
}

.hidden {
    display: none !important;
}

/* Timer Styling (unten) */
.timer-wrapper {
    background: transparent; /* Kein weißer Hintergrund mehr */
    padding: 10px 20px;
    border-radius: 0;
    text-align: center;
    margin-top: 50px; /* Mehr Abstand zum Brief */
    box-shadow: none; /* Kein Schatten mehr */
    color: white; /* Weißer Text für Kontrast auf Hintergrundbild */
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); /* Schatten für Lesbarkeit */
}

.timer-label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

#live-timer {
    font-family: 'Lato', monospace; /* Monospace für stabiles Zählen */
    font-size: 1.2rem;
    font-weight: bold;
}
.heart-pulse {
    font-size: 4rem;
    text-align: center;
    margin-top: 2rem;
    animation: pulseHeart 1.5s infinite;
}

@keyframes pulseHeart {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.visit-counter {
    margin-top: 15px; /* Etwas Abstand zum Timer */
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Lato', sans-serif;
    display: block; /* Eigene Zeile erzwingen */
    text-align: center;
}

/* Mobile Anpassungen */
@media (max-width: 480px) {
    .content {
        padding: 25px 20px;
        margin-top: 50px; /* Minimaler Abstand oben */
    }
    .headline {
        font-size: 2rem;
    }
    .content p {
        font-size: 1.35rem;
    }
    /* Buttons mobil oben links halten, aber kleiner */
    .top-controls {
        top: 10px;
        left: 10px;
        width: auto;
        transform: none; /* Kein Zentrieren */
        justify-content: flex-start;
        padding: 0;
        gap: 8px; /* Näher zusammen */
    }
    
    .gallery-btn {
        font-size: 0.8rem; /* Kleinerer Text */
        padding: 8px 12px;
    }
    
    .audio-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* --- Top Controls Container --- */
.top-controls {
    position: fixed;
    top: 15px; /* Ganz nah an der Ecke */
    left: 15px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Shared Button Styles */
.control-btn {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4); /* Dünnerer Rand */
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.8);
}

/* gallery specific */
.gallery-btn {
    padding: 8px 15px; /* Kompakter */
    border-radius: 20px; /* Kleinerer Radius */
    font-size: 0.9rem;
    font-weight: normal; /* Nicht mehr fett */
}

/* audio specific */
.audio-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.1rem;
    padding: 0;
}

/* Entferne alte Styles falls vorhanden, um Konflikte zu vermeiden */
/* (Dies überschreibt die vorherigen .audio-btn und .gallery-btn Regeln durch Kaskade, da am Ende) */

/* Gallery Modal Styling */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200; /* Über allem anderen */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto; /* Scrollbar erlauben falls nötig */
}

/* Versteckt Klasse */
.gallery-modal.hidden {
    display: none;
}

.gallery-content {
    background: #222;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    padding: 20px;
    border-radius: 10px;
    overflow-y: auto;
    position: relative;
    color: white;
    text-align: center;
}

.gallery-content h2 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 20px;
    color: #fffcf5;
}

.close-gallery {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s;
}

.close-gallery:hover {
    color: white;
}

/* Grid Layout für Bilder */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    height: 200px; /* Einheitliche Höhe für Vorschau */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    
    /* Schutz vor Download */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none; /* Deaktiviert Rechtsklick und Drag auf das Bild */
}

.gallery-item:not(.blurred):hover img {
    transform: scale(1.1); /* Zoom nur bei klaren Bildern */
}

/* Blur Effekt für bestimmte Bilder */
.gallery-item.blurred img {
    filter: blur(10px);
    pointer-events: none; /* Verhindert Interaktion/Rechtsklick um das Blurren zu umgehen */
}

/* GLOBALER BILDERSCHUTZ - Auch Hintergrundbilder etc */
img {
    -webkit-user-drag: none;
    user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none; /* Brutal aber effektiv für reinen "Look" Content */
}

/* Ausnahmen für interaktive Elemente falls nötig */
button img, a img {
    pointer-events: auto; /* Falls Icons in Buttons klickbar sein müssen */
}



/* Dezent dekorative Blumen/Herzen in den Ecken */
.content::before,
.content::after {
    content: '🌹'; /* Simpel und effektiv: Rosen-Emoji als Deko */
    position: absolute;
    font-size: 5rem; /* Größer */
    opacity: 0.8; /* Deutlich sichtbarer */
    pointer-events: none;
    z-index: 0;
}

.content::before {
    top: -15px;
    left: -10px;
    transform: rotate(-30deg);
}

.content::after {
    bottom: -15px;
    right: -10px;
    transform: rotate(20deg);
}

/* Inhalt muss über den Rosen liegen */
.content h1, 
.content p, 
.content button, 
.content div {
    position: relative;
    z-index: 1;
}

/* Alternative: Feine Blumen-SVG Hintergrund */
.content {
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(233, 30, 99, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 90%, rgba(233, 30, 99, 0.03) 0%, transparent 20%);
}

.headline {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.intro {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
}

/* Button Styling */
.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.nav-btn {
    padding: 8px 25px; /* Schmaler (weniger Höhe) */
    font-size: 0.9rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.5px; /* Modern: Leichter Abstand */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    font-weight: 400;
}

.nav-btn.primary {
    background: #e91e63; 
    background: linear-gradient(135deg, #e91e63, #d81b60);
    color: white;
    box-shadow: 0 3px 10px rgba(233, 30, 99, 0.2); /* Subtiler, moderner Schatten */
}

.nav-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.3);
}

.nav-btn.secondary {
    background-color: transparent;
    color: #777;
    border-color: #ddd; /* Sehr dünner, dezenter Rahmen */
}

.nav-btn.secondary:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: rgba(233, 30, 99, 0.05);
}

.nav-btn .icon {
    font-size: 1.1em;
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Text Steps Styling */
.text-container {
    text-align: left;
    margin-top: 20px;
}

.text-step {
    display: none; /* Initially hidden */
    animation: fadeIn 0.8s ease-out forwards;
}

.text-step.active {
    display: block;
}

.text-step p {
    margin-bottom: 1.2rem;
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    line-height: 2rem; /* Angepasst an Papierlinien */
    color: #444;
}

.signature {
    margin-top: 30px;
    font-weight: bold;
    font-style: italic;
    color: var(--primary-color);
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
}

.no-ai-note {
    font-size: 0.9rem;
    color: #999;
    margin-top: 5px; /* Etwas näher an den Namen rücken */
    font-weight: normal;
    font-style: normal;
    display: block; /* Damit es eine neue Zeile ist */
    text-align: center; /* Zentriert */
    width: 100%;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.5px;
}

/* Lebendiges Herz am Ende */
.heart-pulse {
    font-size: 2rem;
    margin-top: 30px;
    text-align: center;
    animation: heartbeat 2s infinite ease-in-out;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Optimierung */
@media (max-width: 480px) {
    .headline {
        font-size: 2.5rem;
    }
    .content {
        padding: 30px 15px;
    }
}