/* Storylinn Main Layout - Clean Version */

:root {
    --bg: #F4EBDD;
    --text: #1C1A16;
    --accent: #E9DDC9;
    --glass: rgba(244, 235, 221, 0.9);
    --transition: 0.4s ease;
}

[data-theme="dark"] {
    --bg: #071A2C;
    --text: #F2F5F7;
    --accent: #0B2238;
    --glass: rgba(7, 26, 44, 0.9);
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden; 
    transition: background-color var(--transition), color var(--transition);
}

.logo {
    position: fixed;
    top: 30px;
    left: 30px;
    font-size: 28px;
    font-weight: 800;
    text-transform: none;
    font-family: sans-serif;
    letter-spacing: -1.8px;
    cursor: default;
    user-select: none;
    z-index: 1000;
}

.controls {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.btn-round {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--text);
    background: none;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
    -webkit-appearance: none;
}

.btn-round:hover {
    background-color: var(--text);
    color: var(--bg);
}

/* Install button visibility:
   - Hidden on desktops/laptops
   - Visible on phones/tablets
   - ALWAYS hidden when running as an installed app */
#install-btn {
    display: none;
}

@media (max-width: 1024px) {
    #install-btn {
        display: flex;
    }
}

/* Installed / standalone mode override */
@media (display-mode: standalone) {
    #install-btn {
        display: none !important;
    }
}

#stage {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10%;
    text-align: center;
    cursor: pointer;
    position: relative;
}

/* Pick your news (+) button (centered above Mood) */
#stage > button.btn-round {
    position: absolute;
    left: 50%;
    bottom: 120px;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    font-size: 26px;
    line-height: 1;
    z-index: 5;
}

/* Daily counter (now functional, still calm) */
#daily-counter {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);

    font-family: sans-serif;
    font-size: 13px;          /* slightly larger */
    font-weight: 700;
    letter-spacing: 0.6px;

    opacity: 1;               /* normal contrast */
    color: var(--text);

    pointer-events: none;
    user-select: none;

    transition: opacity var(--transition), transform 0.25s ease;
    will-change: transform, opacity;
}

/* Mood filter (above the counter, calm + minimal) */
#mood-filter {
    position: absolute;
    left: 50%;
    bottom: 52px;
    transform: translateX(-50%);

    font-family: sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.6px;
    color: var(--text);

    opacity: 1;
    user-select: none;
    pointer-events: auto;
}

#mood-filter .mood-option {
    cursor: pointer;
    font-weight: 400;
}

#mood-filter .mood-option.is-selected {
    font-weight: 700;
}

#mood-filter .mood-sep {
    opacity: 0.65;
    margin: 0 6px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .logo { 
        top: 20px; 
        left: 20px; 
        font-size: 24px; 
    }
    .controls { 
        top: 20px; 
        right: 20px; 
    }
    #stage { 
        padding: 5%; 
    }
    #daily-counter {
        bottom: 22px;
        font-size: 12px;       /* slightly larger on mobile */
        letter-spacing: 0.5px;
        opacity: 1;
    }

    #mood-filter {
        bottom: 44px;
        font-size: 12px;
        letter-spacing: 0.5px;
    }

    #mood-filter .mood-sep {
        margin: 0 5px;
    }

    #stage > button.btn-round {
        bottom: 132px;
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
}

/* Mobile footer spacing safeguard (prevents Mood + Counter overlap) */
@media (max-width: 768px) {
    #daily-counter {
        bottom: calc(40px + env(safe-area-inset-bottom, 0px));
        max-width: 92vw;
        text-align: center;
        line-height: 1.25;
    }

    #mood-filter {
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }

    #stage > button.btn-round {
        bottom: calc(132px + env(safe-area-inset-bottom, 0px));
    }
}
