@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #faf0e6;
    --panel: rgba(255, 255, 255, .8);
    --btn: #ffe4e1;
    --btnText: #8b4513;
    --shadow: 0 8px 32px rgba(0, 0, 0, .1);
    --radius: 14px;
    --radiusBtn: 12px;

    --topPad: 58px;
    --bottomPad: 58px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

.landingScreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top, rgba(255, 228, 225, .95), rgba(250, 240, 230, .98) 45%, #faf0e6 100%);
    overflow: hidden;
    transition: opacity .45s ease, visibility .45s ease;
}

.landingScreen.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.landingCard {
    position: relative;
    text-align: center;
    padding: 34px 28px;
    min-width: min(88vw, 360px);
    border-radius: 28px;
    background: rgba(255, 255, 255, .58);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(139, 69, 19, .12);
    box-shadow:
        0 18px 50px rgba(139, 69, 19, .10),
        inset 0 1px 0 rgba(255, 255, 255, .65);
    animation: landingFloat 3.2s ease-in-out infinite;
}

.landingLogoWrap {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
}

.imageLogo {
    padding: 12px;
    overflow: hidden;
}

.imageLogo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 50%;
}

.landingLogoRing {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        conic-gradient(from 0deg,
            rgba(139, 69, 19, .10),
            rgba(255, 228, 225, .95),
            rgba(139, 69, 19, .16),
            rgba(255, 228, 225, .95),
            rgba(139, 69, 19, .10));
    animation: spinSoft 8s linear infinite;
    box-shadow:
        0 0 0 8px rgba(255, 255, 255, .48) inset,
        0 10px 30px rgba(139, 69, 19, .12);
}

.landingLogo {
    position: relative;
    z-index: 1;
    width: 180px;
    height: 180px;
    display: grid;
    place-items: center;
    text-align: center;
    line-height: 1.15;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .4px;
    color: #8b4513;
    background: transparent;
    box-shadow: none;
}

.imageLogo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 0;
}

.landingSub {
    color: #8b4513;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: .82;
    margin-bottom: 8px;
}

.landingSparkles {
    color: #b06a3c;
    font-size: 18px;
    letter-spacing: 6px;
    margin-bottom: 16px;
    animation: twinkle 1.8s ease-in-out infinite;
}

.landingLoader {
    width: min(220px, 62vw);
    height: 8px;
    margin: 0 auto;
    border-radius: 999px;
    background: rgba(139, 69, 19, .10);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .05);
}

.landingLoader span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8b4513, #c97c4b, #ffe4e1);
    box-shadow: 0 0 18px rgba(201, 124, 75, .35);
    animation: loadingBar 1.2s ease-out forwards;
}

.landingGlow {
    position: absolute;
    border-radius: 50%;
    filter: blur(20px);
    opacity: .45;
    pointer-events: none;
}

.landingGlow.glow1 {
    width: 240px;
    height: 240px;
    background: rgba(255, 228, 225, .9);
    top: 12%;
    left: 8%;
    animation: blobMove1 7s ease-in-out infinite alternate;
}

.landingGlow.glow2 {
    width: 300px;
    height: 300px;
    background: rgba(255, 210, 200, .6);
    right: 6%;
    bottom: 10%;
    animation: blobMove2 8s ease-in-out infinite alternate;
}

@keyframes loadingBar {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

@keyframes spinSoft {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes landingFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes twinkle {

    0%,
    100% {
        opacity: .55;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.06);
    }
}

@keyframes blobMove1 {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(22px, -18px) scale(1.08);
    }
}

@keyframes blobMove2 {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(-26px, 18px) scale(1.12);
    }
}

body.landingActive {
    overflow: hidden;
}

@media (max-width: 420px) {
    .landingCard {
        padding: 28px 20px;
        min-width: min(90vw, 320px);
        border-radius: 24px;
    }

    .landingLogoWrap {
        width: 180px;
        height: 180px;
        margin-bottom: 14px;
    }

    .landingLogo {
        width: 160px;
        height: 160px;
        font-size: 21px;
    }

    .landingSub {
        font-size: 12px;
        letter-spacing: 1px;
    }
}

body {
    margin: 0;
    background: var(--bg);
    font-family: 'Prompt', system-ui, -apple-system, "Segoe UI", sans-serif;
    overflow: hidden;
    color: #333;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}

.ui {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0));
    border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.left,
.right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.right a {
    color: #8b4513;
    text-decoration: none;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    border: 1px solid rgba(0, 0, 0, .1);
    transition: background .15s ease, color .15s ease;
}

.right a:hover {
    background: #ffe4e1;
}

.pill {
    color: #333;
    background: var(--panel);
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(0, 0, 0, .1);
}

button {
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--btn);
    color: var(--btnText);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
    transition: transform .08s ease, opacity .15s ease;
}

button:active {
    transform: scale(.98);
}

.stage {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--topPad) 32px var(--bottomPad);
}

.zoomWrap {
    transform-origin: center top;
    will-change: transform;
}

#flipbook {
    background: #fff;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    overflow: hidden;
}

.page {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
}

.page img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    z-index: 10;
    background: linear-gradient(to top, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0));
    border-top: 1px solid rgba(0, 0, 0, .1);
}

.navbtn {
    width: 48px;
    height: 44px;
    border-radius: var(--radiusBtn);
    display: grid;
    place-items: center;
    padding: 0;
}

input[type="range"] {
    width: min(55vw, 420px);
    accent-color: #8b4513;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(139, 69, 19, .2);
    border-radius: 999px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffe4e1;
    border: 2px solid #8b4513;
    box-shadow: 0 4px 12px rgba(139, 69, 19, .2);
}

#flipbook,
.page,
.page img {
    transform: translateZ(0);
    backface-visibility: hidden;
}

.page img {
    image-rendering: auto;
}

@media (max-width:420px) {
    button {
        padding: 9px 10px;
    }

    .navbtn {
        width: 44px;
        height: 42px;
    }

    .pill {
        font-size: 12px;
        padding: 7px 9px;
    }

    input[type="range"] {
        width: min(58vw, 320px);
    }
}

body.popupOpen {
    overflow: hidden;
}

.promoPopup {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
}

.promoPopup.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.promoBackdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.promoBox {
    position: relative;
    z-index: 1;
    width: min(92vw, 360px);
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
    animation: promoPop .28s ease;
}

.promoImageLink {
    display: block;
    text-decoration: none;
}

.promoImage {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.promoClose {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 24px;
    line-height: 1;
    background: rgba(255, 255, 255, .92);
    color: #8b4513;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
    z-index: 2;
}

.promoClose:hover {
    transform: scale(1.04);
}

.promoActions {
    padding: 16px;
    background: #fff;
    display: flex;
    justify-content: center;
}

.lineBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #06c755;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 8px 20px rgba(6, 199, 85, .22);
    transition: transform .15s ease, opacity .15s ease;
}

.lineBtn:hover {
    transform: translateY(-1px);
    opacity: .95;
}

.lineBtn:active {
    transform: scale(.98);
}

@keyframes promoPop {
    from {
        transform: scale(.92);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 420px) {
    .promoBox {
        width: min(94vw, 280px);
        border-radius: 20px;
    }

    .promoClose {
        width: 34px;
        height: 34px;
        font-size: 22px;
        top: 8px;
        right: 8px;
    }

        .promoActions {
            padding: 14px;
        }
    
        .lineBtn {
            width: 100%;
            min-width: 0;
            font-size: 14px;
            padding: 12px 16px;
        }
}

/* ===== Tablet / iPad support ===== */
@media (min-width: 768px) and (max-width: 1180px) {
    :root {
        --topPad: 72px;
        --bottomPad: 76px;
    }

    .ui,
    .bottom {
        padding-left: 20px;
        padding-right: 20px;
    }

    .ui {
        gap: 14px;
    }

    .left,
    .right {
        gap: 10px;
    }

    .pill {
        font-size: 14px;
        padding: 10px 14px;
    }

    .right a,
    button {
        font-size: 14px;
        padding: 11px 14px;
    }

    .navbtn {
        width: 54px;
        height: 48px;
    }

    .stage {
        padding: var(--topPad) 40px var(--bottomPad);
    }

    input[type="range"] {
        width: min(52vw, 520px);
    }

    .promoBox {
        width: min(72vw, 460px);
    }

    .lineBtn {
        min-width: 260px;
        font-size: 16px;
    }
}

@media (min-width: 768px) and (max-width: 1180px) and (orientation: landscape) {
    .stage {
        padding-left: 56px;
        padding-right: 56px;
    }

    input[type="range"] {
        width: min(40vw, 460px);
    }
}