* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Georgia, "Times New Roman", serif;
    background: #080504;
    color: #3b210d;
    overflow-x: hidden;
}

.page-shell {
    min-height: 100vh;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #080504;
}

.storybook {
    width: min(100vw, 1448px);
    margin: 0 auto;
    position: relative;
}

.scene-stage {
    position: relative;
    width: 100%;
    overflow: visible;
    background: transparent;
}

.scene-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 0;
}

/* Speaker over the top-right of the image */
.mute-button {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 60;
    width: 46px;
    height: 42px;
    border: 1px solid rgba(255, 224, 135, 0.55);
    border-radius: 999px;
    background: rgba(20, 12, 6, 0.72);
    color: #ffe28a;
    font-size: 1.12rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}

/* Story panel */
.story-box {
    position: relative;
    z-index: 20;
    width: min(94vw, 1120px);
    margin: -92px auto 0;
    padding: 22px 34px 26px;
    background: rgba(255, 248, 222, 0.95);
    border: 2px solid rgba(91, 51, 18, 0.34);
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    text-align: center;
    color: #3b210d;
}

#story-text,
.story-box p {
    display: block;
    color: #3b210d;
    font-size: clamp(1.35rem, 2.15vw, 1.85rem);
    line-height: 1.34;
    margin: 0 0 20px;
    font-weight: 800;
}

/* Choices */
.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 22px;
    justify-content: center;
    align-items: center;
}

.choice-button,
.choices a {
    appearance: none;
    display: inline-block;
    min-width: 230px;
    border: 2px solid rgba(91, 51, 18, 0.4);
    border-radius: 999px;
    padding: 14px 30px;
    background: linear-gradient(180deg, #ffe28a 0%, #f1aa35 100%);
    color: #3b210d !important;
    font-family: inherit;
    font-size: clamp(1.12rem, 1.35vw, 1.35rem);
    font-weight: 900;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 5px 0 rgba(91, 51, 18, 0.3);
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        filter 0.12s ease;
}

.choice-button:hover,
.choices a:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.choice-button:active,
.choices a:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(91, 51, 18, 0.28);
}

/* Small audio start button */
#start-button,
.start-button {
    appearance: none;
    display: inline-block;
    margin: 0 0 12px;
    border: 1px solid rgba(91, 51, 18, 0.28);
    border-radius: 999px;
    padding: 8px 16px;
    background: rgba(255, 237, 165, 0.88);
    color: #3b210d !important;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
}

/* Payment overlay */
.payment-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.28);
}

.payment-card {
    width: min(92%, 460px);
    padding: 22px;
    border-radius: 24px;
    background: rgba(34, 18, 8, 0.92);
    border: 2px solid rgba(255, 216, 107, 0.65);
    color: #fff7d6;
    text-align: center;
}

.payment-card h2 {
    margin: 0 0 10px;
    color: #ffe28a;
}

.payment-card p {
    color: #fff7d6;
}

.payment-qr {
    width: min(280px, 78vw);
    display: block;
    margin: 14px auto;
    border-radius: 14px;
    padding: 10px;
    background: #fff;
    border: 2px solid #ffe28a;
}

.payment-status {
    color: #ffe28a;
    font-weight: 800;
}

.bolt11-box {
    margin-top: 12px;
    text-align: left;
}

.bolt11-box summary {
    cursor: pointer;
    color: #ffe28a;
    font-weight: 700;
}

.bolt11-box textarea {
    width: 100%;
    min-height: 78px;
    border-radius: 10px;
    padding: 9px;
    background: rgba(0, 0, 0, 0.42);
    color: #fff7d6;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.78rem;
}

/* Laptop / shorter desktop screens */
@media (min-width: 701px) and (max-height: 820px) {
    .storybook {
        width: min(100vw, 1240px);
    }

    .story-box {
        width: min(94vw, 1080px);
        margin-top: -82px;
        padding: 20px 30px 24px;
    }

    #story-text,
    .story-box p {
        font-size: clamp(1.25rem, 1.9vw, 1.65rem);
        margin-bottom: 18px;
    }

    .choice-button,
    .choices a {
        min-width: 220px;
        padding: 13px 28px;
        font-size: 1.18rem;
    }
}

/* Mobile */
@media (max-width: 700px) {
    .page-shell {
        padding: 0 0 22px;
        min-height: 100vh;
    }

    .storybook {
        width: 100vw;
    }

    .scene-stage {
        width: 100%;
        height: 58vh;
        min-height: 390px;
        max-height: 560px;
        overflow: hidden;
    }

    .scene-image {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        object-position: center top;
    }

    .mute-button {
        top: 8px;
        right: 8px;
        width: 40px;
        height: 36px;
        font-size: 1rem;
    }

    .story-box {
        width: calc(100% - 18px);
        margin: -18px auto 0;
        padding: 16px 14px 18px;
        border-radius: 20px;
    }

    #story-text,
    .story-box p {
        font-size: 1.18rem;
        line-height: 1.34;
        margin-bottom: 14px;
    }

    .choices {
        flex-direction: column;
        gap: 10px;
    }

    .choice-button,
    .choices a {
        width: 100%;
        min-width: 0;
        padding: 13px 14px;
        font-size: 1.08rem;
    }

    #start-button,
    .start-button {
        width: auto;
        min-width: 155px;
        font-size: 0.88rem;
        padding: 7px 12px;
    }

    .payment-overlay {
        padding: 8px;
        align-items: center;
    }

    .payment-card {
        width: min(94%, 360px);
        padding: 13px;
        border-radius: 18px;
        max-height: 94%;
        overflow-y: auto;
    }

    .payment-card h2 {
        font-size: 1.25rem;
        margin-bottom: 6px;
    }

    .payment-card p {
        font-size: 0.92rem;
        line-height: 1.25;
        margin-bottom: 8px;
    }

    .payment-qr {
        width: min(205px, 62vw);
        margin: 8px auto;
    }

    .bolt11-box textarea {
        min-height: 110px;
        font-size: 0.72rem;
    }

    body[data-scene="rani_payment"] .scene-stage {
        height: 64vh;
        min-height: 480px;
    }

    body[data-scene="rani_payment"] .story-box {
        margin: 8px auto 0;
    }
    body[data-scene="snake_zap"] .scene-image,
    body[data-scene="rani_payment"] .scene-image,
    body[data-scene="btcpay_error"] .scene-image {
        object-position: 37% top;
    }

    body[data-scene="snake_defeated"] .scene-image {
        object-position: 65% top;
    }
}
