:root {
    --bg-color: #FDFBF7;
    --text-color: #3F3331;
    --accent-color: #E2C2B9;
    --heart-color: #E78895;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Quicksand', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* Verhindert kosmetisches Scrollen auf Handys */
    height: 100vh;
    height: 100dvh; /* echte sichtbare Höhe, ignoriert von Browsern ohne dvh-Support */
}

/* MOOD OVERLAY */
.mood-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(253, 251, 247, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease;
}

.mood-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.mood-box {
    position: relative;
    background: var(--white);
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    max-width: 90%;
}

.mood-close-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.mood-close-btn:active {
    transform: scale(0.88);
    background: rgba(0,0,0,0.05);
}

.mood-box h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.mood-buttons {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
}

.mood-btn {
    font-size: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.mood-btn:active {
    transform: scale(1.3);
}

/* MAIN CONTAINER */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 500px;
    margin: 0 auto;
    padding: 0.5rem 1rem 1rem 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 12%;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
}

.action-mini-btn {
    background: none;
    border: 1px solid var(--accent-color);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-color);
}

/* FILTER CONTROLS */
.filter-section {
    height: 10%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.segmented-control {
    display: flex;
    background: #EFECE6;
    padding: 0.2rem;
    border-radius: 16px;
    width: 100%;
}

.segmented-control input {
    display: none;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 14px;
    transition: background 0.2s;
}

.segmented-control input:checked + label {
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* STREAM PICTURE */
.stream-section {
    height: 64%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0;
}

.stream-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    display: flex;
    gap: 4px;
}

/* ÄNDERUNG: Sorgt dafür, dass das Bild IMMER komplett sichtbar ist */
.stream-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Zeigt das ganze Bild ohne Abschneiden */
    background-color: #f4f1ea; /* Gibt Querformat-Bildern einen dezenten, hübschen Rahmen */
}

/* DOPPEL-FLAUSCH: bei trauriger Mood zwei Bilder nebeneinander */
.stream-image-wrapper.double-mode .stream-img {
    width: calc(50% - 2px);
}

/* FOOTER DAUMEN ZONE */
footer {
    height: 14%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.circle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.circle-btn:active {
    transform: scale(0.88);
}

.circle-btn.is-fav {
    background: var(--heart-color);
}

.main-payload-btn {
    flex: 1;
    height: 50px;
    border-radius: 25px;
    border: none;
    background: var(--accent-color);
    color: var(--text-color);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.15s ease;
}

.main-payload-btn:active {
    transform: scale(0.96);
}

.main-payload-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* LOADERS & TOASTS */
.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #eee;
    border-top: 3px solid var(--text-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.hidden { display: none !important; }

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 2000;
}

/* TABLET & DESKTOP BREAKPOINT: App bleibt im Handy-Format, wird als zentrierte Karte dargestellt */
@media (min-width: 768px) {
    body {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .app-container {
        height: 90vh;
        height: 90dvh;
        max-width: 420px;
        border-radius: 32px;
        box-shadow: 0 20px 60px rgba(63, 51, 49, 0.12);
        padding: 1rem 1.2rem 1.2rem 1.2rem;
    }
}


/* Verhindert das unschöne Aufblitzen des Alt-Textes während des Ladens */
img:not([src]), img[src=""] {
    opacity: 0;
}