body.item_page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

body.item_page .site_main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 16px;
}

body.item_page .site_footer {
    flex-shrink: 0;
    padding-top: 12px;
    padding-bottom: 16px;
}

.item_detail {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100dvh - 11.5rem);
    background: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: 0 10px 24px var(--shadow);
    overflow: hidden;
}

.item_detail .back_link,
.item_detail .item_category,
.item_detail h1,
.item_detail .truth_tag,
.item_detail .item_author,
.item_detail .item_credit,
.item_detail .item_actions,
.item_detail .item_media,
.item_detail .video_preview,
.item_detail .item_video {
    flex-shrink: 0;
}

.item_detail h1,
.item_detail h2,
.item_title {
    font-family: var(--font_ui);
    font-size: clamp(1.2rem, 2.8vw, 1.55rem);
    line-height: 1.25;
    margin: 0 0 10px;
    font-weight: 700;
}

.item_category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-family: var(--font_ui);
    font-size: 0.82rem;
    font-weight: 600;
    color: #6a5b4d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.item_category_icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.item_media img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 14px;
    background: var(--paper_dark);
}

.item_body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    font-size: 1.05rem;
    line-height: 1.4;
    margin: 8px 0 10px;
    -webkit-overflow-scrolling: touch;
}

.item_video {
    width: 100%;
    border-radius: 14px;
    background: #000;
}

.video_preview {
    font-family: var(--font_ui);
    font-weight: 700;
}

.truth_tag {
    display: inline-block;
    font-family: var(--font_ui);
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.truth_real { background: #dff2d8; }
.truth_trick { background: #ffe7c2; }
.truth_art { background: #e7dff8; }
.truth_unsure { background: #ececec; }

.item_credit {
    font-family: var(--font_ui);
    font-size: 0.9rem;
    color: #6a5b4d;
}

.item_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
}

.shuffle_link {
    font-family: var(--font_ui);
    text-decoration: none;
    background: var(--accent_soft);
    color: var(--ink);
    padding: 10px 16px;
    border: 2px solid var(--header_bg);
    border-radius: 999px;
}

.deck_finished_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.surprise_detail {
    text-align: center;
}

.item_teaser {
    font-style: italic;
    color: #6a5b4d;
}

.item_author_preview {
    font-family: var(--font_ui);
    font-size: 0.85rem;
    color: #6a5b4d;
    margin-top: 8px;
}

.item_detail_poem {
    text-align: center;
    padding-left: 28px;
    padding-right: 28px;
}

.item_poem_topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    margin: 0 0 8px;
}

.item_poem_topbar .back_link {
    margin: 0;
    text-align: left;
}

.item_category_top {
    margin: 0;
    flex-shrink: 0;
}

.item_category_top .item_category_icon {
    width: 28px;
    height: 28px;
}

.item_body_poem {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    line-height: 1.35;
    margin: 6px auto 8px;
    max-width: 34em;
    white-space: pre-line;
}

body[data-age="little"] .item_detail h1,
body[data-age="little"] .item_title {
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
    line-height: 1.3;
    font-weight: 800;
}

body[data-age="little"] .item_body,
body[data-age="little"] .item_body_poem {
    font-family: var(--font_ui);
    font-size: clamp(1.25rem, 3.4vw, 1.6rem);
    line-height: 1.45;
    font-weight: 600;
    letter-spacing: 0.01em;
}

body[data-age="little"] .item_author {
    font-size: 1rem;
}

body[data-age="curious"] .item_body_poem {
    font-size: clamp(1.05rem, 2.4vw, 1.25rem);
}

body[data-age="explorer"] .item_body_poem {
    font-size: clamp(1rem, 2.1vw, 1.15rem);
    line-height: 1.35;
}

.item_detail[data-font-size="small"] .item_title {
    font-size: clamp(1rem, 2.4vw, 1.25rem);
}

.item_detail[data-font-size="small"] .item_body,
.item_detail[data-font-size="small"] .item_body_poem {
    font-size: clamp(0.92rem, 2.1vw, 1.05rem);
    line-height: 1.35;
}

.item_detail[data-font-size="medium"] .item_title {
    font-size: clamp(1.15rem, 2.8vw, 1.45rem);
    margin-bottom: 20px;
}

.item_detail[data-font-size="medium"] .item_body,
.item_detail[data-font-size="medium"] .item_body_poem {
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    line-height: 1.28;
}

.item_detail[data-font-size="large"] .item_title {
    font-size: clamp(1.6rem, 4.4vw, 2.15rem);
    margin-bottom: 22px;
}

.item_detail[data-font-size="large"] .item_body,
.item_detail[data-font-size="large"] .item_body_poem {
    font-size: clamp(1.5rem, 4vw, 1.85rem);
    line-height: 1.3;
}

.item_detail[data-font-size="xlarge"] .item_title {
    font-size: clamp(1.85rem, 5.2vw, 2.55rem);
}

.item_detail[data-font-size="xlarge"] .item_body,
.item_detail[data-font-size="xlarge"] .item_body_poem {
    font-size: clamp(1.75rem, 4.8vw, 2.2rem);
    line-height: 1.45;
}

.item_author {
    font-family: var(--font_ui);
    text-align: center;
    color: #6a5b4d;
    margin: 0 0 8px;
    font-size: 0.9rem;
    line-height: 1.3;
}

.item_detail_poem .item_author {
    margin-top: 18px;
}

@media (min-width: 721px) {
    body.item_page .site_main {
        justify-content: center;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .item_detail_poem {
        width: 100%;
        height: 75dvh;
        max-height: 75dvh;
        flex: 0 0 auto;
        padding-left: 48px;
        padding-right: 48px;
    }

    .item_detail_poem .item_content_stage {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        min-height: 0;
        overflow-y: auto;
        padding: 16px 32px;
    }

    .item_detail_poem .item_title {
        margin: 0 0 14px;
        max-width: 36em;
    }

    .item_detail_poem[data-font-size="medium"] .item_title {
        margin-bottom: 22px;
    }

    .item_detail_poem[data-font-size="large"] .item_title {
        margin-bottom: 26px;
    }

    .item_detail_poem .item_body_poem {
        flex: 0 1 auto;
        margin: 0 auto 10px;
        max-width: 36em;
        overflow-y: auto;
    }

    .item_detail_poem .item_author {
        flex-shrink: 0;
        margin: 20px 0 0;
    }

    .item_detail_poem .item_actions {
        justify-content: center;
        margin-top: auto;
        padding-top: 14px;
        border-top: 2px solid rgba(47, 38, 31, 0.1);
    }
}
