:root {
    --fenek-orange: #f97316;
    --fenek-orange-light: #ffedd5;
    --text-slate: #1e293b;
    --bg-white: #ffffff;
    --app-max-width: 450px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background-color: #1a1a1a;
    color: var(--text-slate);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* APP SHELL */
#app-container {
    width: 100vw;
    max-width: var(--app-max-width);
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    background-color: var(--bg-white);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.inline-home {
    position: absolute; top: 15px; right: 15px; width: 44px; height: 44px; background: white;
    border-radius: 12px; display: flex; justify-content: center; align-items: center;
    text-decoration: none; font-size: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 5000; border: 1px solid #eee;
}

/* SCROLL ENGINE */
#scroll-area {
    height: 100%; width: 100%; overflow-y: scroll; scroll-snap-type: y mandatory;
    scrollbar-width: none; touch-action: pan-y;
}
#scroll-area::-webkit-scrollbar { display: none; }

.page {
    height: 100%; width: 100%; scroll-snap-align: start; scroll-snap-stop: always;
    position: relative; display: flex; flex-direction: column;
}

/* PROGRESS BAR */
#progress-container {
    position: absolute; top: 15px; left: 15px; right: 70px; height: 4px;
    display: flex; gap: 4px; z-index: 50; opacity: 0; transition: opacity 0.3s ease;
}
#progress-container.visible { opacity: 1; }
.progress-segment {
    flex: 1; background: rgba(0, 0, 0, 0.1); border-radius: 2px; overflow: hidden;
}
.progress-fill {
    height: 100%; width: 0%; background: #FF8C42; transition: width 0.3s ease;
}

/* IMAGE AREA */
.image-area {
    height: 60%; width: 100%; background-size: cover; background-position: top center;
    position: relative; flex-shrink: 0;
}
@media (min-width: 768px) {
    .image-area img.title-cover {
        object-fit: contain !important;
        object-position: center bottom !important;
    }
}

/* WATERMARK */
.watermark-container {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; z-index: 30;
}
.wm-corner {
    position: absolute; font-size: 10px; font-weight: 900;
    color: rgba(200, 200, 200, 0.15); text-transform: uppercase;
    top: 15px; pointer-events: none; z-index: 31;
}
.wm-right { right: 5px; }
.wm-left { left: 10px; }

/* CONTENT AREA - STABILNY MARGINES */
.content-area {
    height: 50%;
    background: #fff;
    margin-top: -70px;
    border-radius: 40px 40px 0 0;
    padding: 36px 25px 24px 25px;
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    overflow-y: hidden;
}

.content-text {
    font-weight: 900;
    color: #1e293b;
    line-height: 1.2;
    font-size: clamp(15px, 4.6vw, 19px);
    padding-right: 75px;
}

/* SIDEBAR */
#sidebar {
    position: absolute; right: 15px;
    top: 55%;
    display: flex; flex-direction: column; gap: 8px; z-index: 40;
    transform: translateX(100px); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#sidebar.visible { transform: translateX(0); }

.sidebar-btn {
    width: 52px; height: 52px; border-radius: 50%; background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--fenek-orange); cursor: pointer;
    transition: transform 0.1s;
}
.sidebar-btn:active { transform: scale(0.95); }
.sidebar-btn.like-anim { animation: heartBeat 0.5s ease-in-out; color: #ef4444; }

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.heart-fx { position: fixed; color: #ff4d4d; font-size: 32px; pointer-events: none; z-index: 1000; animation: heart-fly 0.6s linear forwards; }
@keyframes heart-fly { 0% { transform: scale(1); opacity: 1; } 100% { transform: translate(var(--tx), var(--ty)) scale(0.5); opacity: 0; } }

.heart-flood { position: fixed; pointer-events: none; z-index: 9999; font-size: var(--hs, 28px); animation: heart-flood 1.0s ease-out forwards; }
@keyframes heart-flood { 0% { transform: translate(0,0) scale(0); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(var(--tx),var(--ty)) scale(0.9); opacity: 0; } }

/* OCHRONA UX AUDIOBOOKA */
#unlock-progress {
    position: fixed; bottom: 250px; left: 50%; transform: translateX(-50%);
    z-index: 99999; background: rgba(30, 41, 59, 0.9); padding: 12px 24px;
    border-radius: 50px; color: white; font-size: 11px; font-weight: 900;
    pointer-events: none; opacity: 0; transition: opacity 0.2s, transform 0.2s;
    display: flex; align-items: center; gap: 12px; backdrop-filter: blur(8px);
    text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
#unlock-progress.visible { opacity: 1; transform: translateX(-50%) translateY(10px); }
.progress-ring {
    width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.2);
    border-top: 3px solid #FF8C42; border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* LOADER */
#main-loader {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-white);
    z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}

/* MailerLite – kompaktowy wygląd w czytniku */
.ml-embedded { width: 100% !important; }
.ml-embedded .ml-form-embedWrapper { padding: 0 !important; background: transparent !important; box-shadow: none !important; border: none !important; }
.ml-embedded .ml-form-embedBody { padding: 0 !important; }
.ml-embedded input[type="email"] { border-radius: 12px !important; font-family: 'Nunito', sans-serif !important; font-weight: 700 !important; }
.ml-embedded button[type="submit"] { border-radius: 12px !important; font-family: 'Nunito', sans-serif !important; font-weight: 900 !important; background: linear-gradient(135deg, #f97316 0%, #ed64a6 100%) !important; }
