/* ========================================
   BIERO - TikTok/Shorts Style Feed CSS
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --accent-color: #ffa502;
    --dark-bg: #000000;
    --card-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
}

html, body {
    height: 100%;
    overflow: hidden;
    background-color: var(--dark-bg);
    font-family: 'Segoe UI', 'Yu Gothic', 'Hiragino Sans', sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: pan-y;
}

/* ========================================
   Age Verification Gate
   ======================================== */
.age-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Solid black background - no transparency */
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 15px;
}

.age-gate.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.age-gate-content {
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    padding: 35px 20px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid var(--primary-color);
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(255, 107, 157, 0.3);
}

.age-gate-content h2 {
    font-size: 28px;
    margin-bottom: 15px;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.age-gate-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}

.age-gate-content .warning {
    font-size: 14px;
    color: var(--primary-color);
    margin-top: 15px;
    margin-bottom: 25px;
}

.age-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-age {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    touch-action: manipulation;
}

.btn-age.enter {
    background: var(--gradient-2);
    color: white;
}

.btn-age.enter:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-age.exit {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-age.exit:active {
    background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   Main Feed Container
   ======================================== */
.feed-container {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: var(--dark-bg);
}

.feed-container.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ========================================
   Vertical Scroll (Works Navigation)
   ======================================== */
.works-feed {
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Solid black background */
    background: #000000;
    /* Isolate stacking context */
    isolation: isolate;
    /* Prevent content from showing through gaps */
    contain: paint;
    /* Faster snap behavior to reduce time where multiple items might be visible */
    scroll-behavior: smooth;
}

.works-feed::-webkit-scrollbar {
    display: none;
}

/* Hide work items that are not snapped (during scroll animation) */
.works-feed > * {
    background: #000000;
}

/* During scroll, ensure proper z-index stacking */
.works-feed.is-scrolling .work-item {
    /* Force layer creation for smoother scroll */
    will-change: transform, z-index;
}

/* Ensure visible cards have proper stacking context */
.work-item:not(.content-hidden) {
    /* Create stacking context for z-index to work */
    isolation: isolate;
}

/* ========================================
   Work Item (Full Screen Slide)
   ======================================== */
.work-item {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    z-index: 1;
    /* Solid black background to prevent bleed-through */
    background: #000000;
    /* Clip all content to bounds */
    overflow: hidden;
}

/* Ensure solid background covers entire work item */
.work-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #000000;
    z-index: 0;
    pointer-events: none;
}

/* ========================================
   Content Hidden State - Critical for preventing flash
   ======================================== */

/* Hide content when work item is not in viewport */
.work-item.content-hidden {
    background: #000000 !important;
}

/* Hide all children for content-hidden items */
.work-item.content-hidden > * {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ========================================
   Horizontal Carousel (Media within Work)
   ======================================== */
.media-carousel {
    height: 100%;
    width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    display: flex;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Solid black background */
    background: #000000;
    /* Clip content to prevent bleed-through */
    clip-path: inset(0);
    -webkit-clip-path: inset(0);
}

.media-carousel::-webkit-scrollbar {
    display: none;
}

.media-slide {
    min-width: 100%;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Solid black background - ensure no transparency */
    background: #000000 !important;
    /* Clip content to prevent bleed-through during transitions */
    overflow: hidden;
    /* Isolate stacking context */
    isolation: isolate;
}

/* ========================================
   Media Content (Images & Videos)
   ======================================== */
.media-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Solid black background */
    background: #000000;
    /* Clip content - use clip-path for transform elements like media-bg */
    overflow: hidden;
    clip-path: inset(0);
    -webkit-clip-path: inset(0);
}

/* ========================================
   Affiliate Redirect Slide
   ======================================== */
.affiliate-slide {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.affiliate-slide-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
}

.affiliate-slide-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.affiliate-slide-label {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ========================================
   Affiliate Review Overlay (審査中表示)
   ======================================== */
.affiliate-review-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}

.affiliate-review-popup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid var(--primary-color);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(255, 107, 157, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 75%;
    text-align: center;
    animation: affiliatePopupPulse 2s ease-in-out infinite;
}

.affiliate-review-icon {
    font-size: 36px;
    line-height: 1;
}

.affiliate-review-text {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes affiliatePopupPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 8px 32px rgba(255, 107, 157, 0.3),
            0 0 0 1px rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(0.9);
        box-shadow: 
            0 6px 24px rgba(255, 107, 157, 0.25),
            0 0 0 1px rgba(255, 255, 255, 0.08);
    }
}

/* Responsive adjustments for affiliate review popup */
@media (max-width: 480px) {
    .affiliate-review-popup {
        padding: 16px 18px;
        max-width: 70%;
        gap: 8px;
    }
    
    .affiliate-review-icon {
        font-size: 24px;
    }
    
    .affiliate-review-text {
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    .affiliate-review-popup {
        padding: 24px 32px;
        max-width: 400px;
    }
    
    .affiliate-review-icon {
        font-size: 36px;
    }
    
    .affiliate-review-text {
        font-size: 14px;
    }
}

.media-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.media-content video {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Background blur effect */
.media-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    /* Solid black fallback background */
    background-color: #000000;
    filter: blur(30px) brightness(0.3);
    transform: scale(1.2);
    z-index: 0;
}

.media-content img,
.media-content video {
    position: relative;
    z-index: 1;
}

/* ========================================
   FANZA Sample Video (thumbnail + play button)
   ======================================== */
.fanza-video-slide {
    background: #000;
}

/* 再生ボタン */
.fanza-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 24px 32px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fanza-video-play-btn:hover {
    background: rgba(255, 107, 157, 0.8);
    border-color: #fff;
    transform: translate(-50%, -50%) scale(1.05);
}

.fanza-video-play-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.fanza-video-play-btn .play-icon {
    font-size: 48px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.fanza-video-play-btn .play-label {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}

/* 全画面表示時のiframeスタイル */
.fullscreen-fanza-video {
    /* iframeのサイズはJSで動的に決定されるため、ここでは制約のみ */
    max-width: 90vw;
    max-height: 80vh;
    border: none;
    border-radius: 8px;
    background: #000;
}

/* ========================================
   Carousel Indicators
   ======================================== */
.carousel-indicators {
    position: absolute;
    top: calc(20px + var(--safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    display: flex;
    gap: 6px;
    z-index: 100;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    /* Prevent flash during transitions */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s;
}

.carousel-indicator.active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 4px;
}

/* アフィリエイトスライド用のインジケーター（最後のドット） */
.carousel-indicator.affiliate-indicator {
    background: rgba(255, 165, 2, 0.5);
    position: relative;
}

.carousel-indicator.affiliate-indicator::after {
    content: '→';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 6px;
    color: white;
    opacity: 0;
}

.carousel-indicator.affiliate-indicator.active {
    background: var(--accent-color);
}

.carousel-indicator.affiliate-indicator.active::after {
    opacity: 1;
    font-size: 10px;
}

/* ========================================
   Work Info Overlay
   ======================================== */
.work-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    padding-bottom: calc(100px + var(--safe-area-inset-bottom));
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 40%,
        transparent 100%
    );
    z-index: 50;
    /* Prevent flash during transitions */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.work-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.4;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-actress {
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 600;
}

/* Work Meta Row - Horizontal scrollable */
.work-meta-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.work-meta-row::-webkit-scrollbar {
    display: none;
}

.work-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}


.work-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.work-description:active {
    opacity: 0.7;
}

/* Description Overlay */
.description-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    /* Prevent flash during transitions */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    pointer-events: none;
}

.description-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.description-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(15px + var(--safe-area-inset-top)) 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.description-overlay-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.description-overlay-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.description-overlay-close:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}

.description-overlay-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    padding-bottom: calc(20px + var(--safe-area-inset-bottom));
}

.description-overlay-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ========================================
   Action Buttons (Right Side)
   ======================================== */
.action-buttons {
    position: absolute;
    right: 12px;
    bottom: calc(120px + var(--safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
    /* Prevent flash during transitions */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
}

.action-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
}

.action-btn-icon:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}

.action-btn-label {
    font-size: 11px;
    color: var(--text-primary);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.action-btn.like .action-btn-icon {
    color: #ff4757;
}

.action-btn.like.active .action-btn-icon {
    background: rgba(255, 71, 87, 0.3);
    color: #ff4757;
}

/* ========================================
   FANZA Affiliate Button
   ======================================== */
.fanza-btn {
    position: absolute;
    bottom: calc(20px + var(--safe-area-inset-bottom));
    left: 20px;
    right: 20px;
    padding: 14px 20px;
    background: var(--gradient-2);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
    transition: all 0.3s;
    touch-action: manipulation;
    /* Prevent flash during transitions */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.fanza-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.fanza-btn .icon {
    font-size: 18px;
}

/* ========================================
   Media Fullscreen Button (各メディアスライドの全画面ボタン)
   ======================================== */
.media-fullscreen-btn {
    position: absolute;
    top: calc(70px + var(--safe-area-inset-top));
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.media-fullscreen-btn:active {
    transform: scale(0.9);
    background: rgba(0, 0, 0, 0.8);
}

.media-fullscreen-btn span {
    line-height: 1;
}

/* ========================================
   Twitter Thumbnail Fullscreen Button (旧形式・互換性用)
   ======================================== */
.twitter-thumbnail-btn {
    position: absolute;
    bottom: calc(20px + var(--safe-area-inset-bottom));
    left: 20px;
    right: 20px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4a4a4a 0%, #2d2d2d 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    touch-action: manipulation;
    cursor: pointer;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.twitter-thumbnail-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.twitter-thumbnail-btn .icon {
    font-size: 18px;
}

/* ========================================
   Image Fullscreen Overlay
   ======================================== */
.image-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.image-fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.image-fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    padding-top: calc(16px + var(--safe-area-inset-top));
    flex-shrink: 0;
}

.image-fullscreen-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.image-fullscreen-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.image-fullscreen-close:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}

.image-fullscreen-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: calc(20px + var(--safe-area-inset-bottom));
    overflow: hidden;
}

.image-fullscreen-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* ========================================
   Navigation Hints
   ======================================== */
.nav-hint {
    position: absolute;
    z-index: 60;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-hint.vertical {
    left: 50%;
    bottom: calc(180px + var(--safe-area-inset-bottom));
    transform: translateX(-50%);
}

.nav-hint.horizontal {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.nav-hint-content {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.work-item:first-child .nav-hint.vertical,
.media-slide:first-child .nav-hint.horizontal {
    opacity: 1;
    animation: fadeHint 3s ease-out forwards;
}

@keyframes fadeHint {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

/* ========================================
   Loading State
   ======================================== */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   Infinite Scroll / Load More
   ======================================== */
.load-more-sentinel {
    height: 1px;
    width: 100%;
    visibility: hidden;
}

.load-more-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.load-more-indicator.visible {
    opacity: 1;
}

.loading-spinner-small {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinSmall 1s linear infinite;
}

@keyframes spinSmall {
    to { transform: rotate(360deg); }
}

/* End of content message */
.end-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.end-message span {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
}

.end-message p {
    font-size: 14px;
    line-height: 1.6;
}

.end-message .sub {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   Header (Minimal)
   ======================================== */
.feed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: calc(15px + var(--safe-area-inset-top)) 20px 15px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        transparent 100%
    );
    z-index: 200;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    gap: 12px;
    /* Prevent flash during transitions */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.feed-header > * {
    pointer-events: auto;
}

.feed-header .back-btn {
    font-size: 20px;
    font-weight: bold;
}

.site-logo {
    font-size: 22px;
    font-weight: bold;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    touch-action: manipulation;
}

.header-btn:active {
    transform: scale(0.9);
}


/* ========================================
   Media Queries
   ======================================== */

/* Tablet and larger */
@media (min-width: 768px) {
    .work-item {
        display: flex;
        justify-content: center;
    }
    
    .media-carousel {
        max-width: 500px;
    }
    
    .work-info {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .fanza-btn,
    .twitter-thumbnail-btn {
        max-width: 460px;
        margin: 0 auto;
    }
    
    .action-buttons {
        right: calc(50% - 280px);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .media-carousel {
        max-width: 400px;
    }
    
    .work-info {
        max-width: 400px;
    }
    
    .fanza-btn,
    .twitter-thumbnail-btn {
        max-width: 360px;
    }
    
    .action-buttons {
        right: calc(50% - 230px);
    }
}

/* Landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
    .work-info {
        padding-bottom: calc(80px + var(--safe-area-inset-bottom));
    }
    
    .action-buttons {
        bottom: calc(90px + var(--safe-area-inset-bottom));
        gap: 12px;
    }
    
    .action-btn-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .fanza-btn,
    .twitter-thumbnail-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .carousel-indicators {
        top: calc(10px + var(--safe-area-inset-top));
    }
}

/* ========================================
   Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .carousel-indicator,
    .action-btn-icon,
    .fanza-btn,
    .twitter-thumbnail-btn {
        transition: none;
    }
    
    .nav-hint.vertical,
    .nav-hint.horizontal {
        animation: none;
        opacity: 0;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .action-btn-icon {
        border: 1px solid rgba(255, 255, 255, 0.5);
    }
}

/* ========================================
   Bottom Navigation Bar
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + var(--safe-area-inset-bottom));
    padding-bottom: var(--safe-area-inset-bottom);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    /* Prevent flash during transitions */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 24px;
    line-height: 1;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

/* Adjust feed content for bottom nav */
.works-feed {
    padding-bottom: calc(60px + var(--safe-area-inset-bottom));
}

.work-info {
    padding-bottom: calc(140px + var(--safe-area-inset-bottom));
}

.fanza-btn,
.twitter-thumbnail-btn {
    bottom: calc(80px + var(--safe-area-inset-bottom));
}

.action-buttons {
    bottom: calc(180px + var(--safe-area-inset-bottom));
}

.nav-hint.vertical {
    bottom: calc(240px + var(--safe-area-inset-bottom));
}

/* ========================================
   Search Page
   ======================================== */
.search-container {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: var(--dark-bg);
}

.search-container.hidden {
    display: none;
}

.search-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: calc(15px + var(--safe-area-inset-top)) 16px 15px;
    background: var(--dark-bg);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-header .site-logo {
    font-size: 18px;
    white-space: nowrap;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0 12px;
    gap: 8px;
}

.search-icon {
    font-size: 16px;
    opacity: 0.6;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 12px 0;
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-clear {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-content {
    position: absolute;
    top: calc(70px + var(--safe-area-inset-top));
    bottom: calc(60px + var(--safe-area-inset-bottom));
    left: 0;
    right: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px;
}

.search-section {
    margin-bottom: 30px;
}

.search-section.hidden {
    display: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.section-header .section-title {
    margin-bottom: 0;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
}


/* Recent Searches */
.recent-searches {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.recent-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.recent-icon {
    font-size: 16px;
    opacity: 0.5;
}

/* Search Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Work Card (Search/Profile) */
.work-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
    transition: transform 0.2s;
}

.work-card:active {
    transform: scale(0.98);
}

.work-card-image {
    aspect-ratio: 3/4;
    background-size: cover;
    background-position: center;
    position: relative;
}

.work-card-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.work-card-platform {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.work-card-info {
    padding: 12px;
}

.work-card-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.work-card-actress {
    font-size: 12px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

/* Twitter Card Icon Placeholder (画像がない場合のXアイコン) */
.twitter-card-icon-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
    pointer-events: none;
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

/* Loading Search */
.loading-search {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.no-results p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Load More Button (Search Results) */
.load-more-btn {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px;
    margin-top: 10px;
    background: rgba(255, 107, 157, 0.1);
    border: 2px dashed rgba(255, 107, 157, 0.3);
    border-radius: 12px;
    color: var(--primary-color);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.load-more-btn:hover {
    background: rgba(255, 107, 157, 0.2);
    border-color: rgba(255, 107, 157, 0.5);
}

.load-more-btn:active {
    transform: scale(0.98);
}

.load-more-btn .remaining-count {
    font-size: 12px;
    font-weight: normal;
    opacity: 0.7;
}

/* ========================================
   Profile Page
   ======================================== */
.profile-container {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: var(--dark-bg);
}

.profile-container.hidden {
    display: none;
}

.profile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: calc(15px + var(--safe-area-inset-top)) 20px 15px;
    background: var(--dark-bg);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-content {
    position: absolute;
    top: calc(60px + var(--safe-area-inset-top));
    bottom: calc(60px + var(--safe-area-inset-bottom));
    left: 0;
    right: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Profile Info */
.profile-info {
    text-align: center;
    padding: 30px 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.3), rgba(196, 69, 105, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 15px;
}

.profile-name {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 8px;
}

.profile-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Profile Stats */
.profile-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    padding: 0 16px;
    gap: 8px;
    margin-top: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: rgba(255, 107, 157, 0.2);
    color: var(--primary-color);
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 20px 16px;
}

.tab-content.active {
    display: block;
}

/* Works Grid (Profile) */
.works-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .works-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.work-card-container {
    position: relative;
}

.work-card-container .like-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Profile Empty State */
.tab-content .empty-state {
    padding: 60px 20px;
    height: auto;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn-browse {
    display: inline-block;
    padding: 12px 24px;
    background: var(--gradient-2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
}

/* ========================================
   Shorts (TikTok) Styles
   ======================================== */
.work-item-shorts {
    position: relative;
    /* Solid background to prevent bleed-through */
    background: #000000;
    /* Ensure content is clipped */
    overflow: hidden;
    clip-path: inset(0);
    -webkit-clip-path: inset(0);
}

.shorts-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Solid black background */
    background: #000000;
    /* Ensure content is clipped */
    overflow: hidden;
    clip-path: inset(0);
    -webkit-clip-path: inset(0);
    /* Above the background pseudo-element */
    z-index: 1;
}

.shorts-embed {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Solid background and clipping */
    background: #000000;
    overflow: hidden;
}

/* TikTok埋め込みはコンテンツサイズに合わせる（クリック位置ずれ防止） */
.shorts-embed.tiktok-embed-wrapper {
    position: relative;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    /* Clip content to prevent bleed-through */
    overflow: hidden;
    background: #000000;
}

.shorts-embed.tiktok-embed-wrapper .tiktok-embed {
    margin: 0 !important;
}

/* TikTok埋め込みのiframe */
.shorts-embed.tiktok-embed-wrapper iframe {
    display: block !important;
}

.shorts-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Solid dark background as fallback */
    background-color: #000000;
}

.shorts-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    gap: 16px;
    /* Prevent flash during transitions */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.shorts-play-overlay .play-icon {
    font-size: 64px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.shorts-play-overlay .platform-badge {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: white;
}

/* 漫画タイプ用のスタイル調整 */
.work-item-manga .work-info {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.8) 50%,
        transparent 100%
    );
}

/* ショート動画のwork-info位置調整 */
.work-item-shorts .work-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.7) 60%,
        transparent 100%
    );
    padding: 80px 16px calc(100px + var(--safe-area-inset-bottom));
    z-index: 10;
}

.work-item-shorts .action-buttons {
    z-index: 20;
}

.work-item-shorts .fanza-btn {
    z-index: 20;
}

/* TikTok専用スタイル */

/* TikTokサムネは「少し内側に収めて」見切れを軽減（隙間は最小限） */
.work-item-shorts[data-platform="tiktok"] .shorts-container {
    padding: 10px;
    box-sizing: border-box;
}

.work-item-shorts[data-platform="tiktok"] .shorts-thumbnail {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    height: 90%;
    max-height: calc(100% - 20px);
    aspect-ratio: 9 / 16;
    max-width: calc(100% - 20px);
    margin: auto;
    border-radius: 12px;
    overflow: hidden;
}

/* ========================================
   Shorts Thumbnail Overlay (サムネイルオーバーレイ)
   動画準備完了までサムネイルを表示
   ======================================== */
.shorts-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    pointer-events: none;
}

.shorts-thumbnail-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.shorts-thumbnail-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.shorts-thumbnail-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000000;
}

/* サムネイルがない場合のプレースホルダー */
.shorts-thumbnail-bg.shorts-thumbnail-placeholder {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.shorts-thumbnail-loading {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px 30px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.shorts-thumbnail-loading span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

/* TikTokプラットフォームのサムネイル調整 */
.work-item-shorts[data-platform="tiktok"] .shorts-thumbnail-overlay {
    padding: 10px;
    box-sizing: border-box;
}

.work-item-shorts[data-platform="tiktok"] .shorts-thumbnail-bg {
    position: relative;
    width: auto;
    height: 90%;
    max-height: calc(100% - 20px);
    aspect-ratio: 9 / 16;
    max-width: calc(100% - 20px);
    margin: auto;
    border-radius: 12px;
    overflow: hidden;
}

/* ========================================
   Twitter/X Media Carousel Styles
   ======================================== */
.work-item-twitter {
    /* Solid dark background */
    background: #000000;
    /* Ensure content is clipped */
    overflow: hidden;
    clip-path: inset(0);
    -webkit-clip-path: inset(0);
}

/* Twitter用のカルーセルはvideoと同じスタイルを使用 */
.work-item-twitter .media-carousel {
    background: #000000;
}

/* Twitterメディアがない場合のプレースホルダー */
.twitter-no-media-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #15202b 0%, #1a1a2e 50%, #0f3460 100%);
    color: rgba(255, 255, 255, 0.5);
    gap: 16px;
}

.twitter-no-media-icon {
    font-size: 80px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
}

.twitter-no-media-placeholder p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.twitter-placeholder-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Twitter Detail Button (FANZAと同じレイアウト)
   ======================================== */
.twitter-detail-btn {
    position: absolute;
    bottom: calc(80px + var(--safe-area-inset-bottom));
    left: 20px;
    right: 20px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1da1f2 0%, #657786 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(29, 161, 242, 0.4);
    transition: all 0.3s;
    touch-action: manipulation;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.twitter-detail-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.twitter-detail-btn .icon {
    font-size: 18px;
}

/* Tablet and larger */
@media (min-width: 768px) {
    .twitter-detail-btn {
        max-width: 460px;
        margin: 0 auto;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .twitter-detail-btn {
        max-width: 360px;
    }
}

/* ========================================
   Twitter Work Info and Actions
   ======================================== */
.work-item-twitter .work-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    padding-bottom: calc(140px + var(--safe-area-inset-bottom));
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.8) 50%,
        transparent 100%
    );
    z-index: 50;
}

.work-item-twitter .work-author {
    color: #1da1f2;
    font-size: 14px;
    margin-bottom: 8px;
}

.work-item-twitter .action-buttons {
    z-index: 100;
}

/* ========================================
   Shorts Affiliate Button (作品を探す)
   ======================================== */
.shorts-affiliate-btn {
    position: absolute;
    bottom: calc(80px + var(--safe-area-inset-bottom));
    left: 20px;
    right: 20px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4a4a4a 0%, #2d2d2d 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    touch-action: manipulation;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.shorts-affiliate-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.shorts-affiliate-btn .icon {
    font-size: 18px;
}

/* Tablet and larger */
@media (min-width: 768px) {
    .shorts-affiliate-btn {
        max-width: 460px;
        margin: 0 auto;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .shorts-affiliate-btn {
        max-width: 360px;
    }
}


