.custom-reel-page {
    width: 100%;
    max-width: 1024px;
    min-height: 100dvh;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Noto Sans JP', sans-serif;
    background: #fff;
    font-weight: 500;
}

.custom-reel-page,
.custom-reel-page * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.custom-reel-page-content {
    height: 100%;
    width: 100%;
    margin: 0 auto;
}

.custom-reel-content {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    position: relative;
    background: #000;
    overflow: hidden;
}

.custom-reel-viewport {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #000;
    touch-action: none;
    overscroll-behavior: contain;
}

.custom-reel-track {
    width: 100%;
    height: auto;
    will-change: transform;
}

.custom-reel-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    font-size: 0.875rem;
    z-index: 30;
}

.custom-reel-loading.is-hidden {
    display: none;
}

.custom-reel-slide {
    width: 100%;
    height: calc(100dvh - var(--fixed-header-height) - var(--fixed-footer-height));
    position: relative;
    overflow: hidden;
    background: #000;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.custom-reel-media {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

.custom-reel-iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: #000;
    pointer-events: none;
}

.custom-reel-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.custom-reel-slide.is-paused .custom-reel-play-overlay {
    opacity: 1;
}

.custom-reel-slide.is-playing .custom-reel-play-overlay {
    opacity: 0;
}

/* 再生ボタン */
.custom-reel-play-button {
    width: 72px;
    height: 72px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-reel-play-icon {
    width: 0;
    height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 24px solid #fff;
    margin-left: 4px;
}

.custom-reel-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #000;
}

.custom-reel-link {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 0.875rem;
    text-decoration: none;
    pointer-events: auto;
    z-index: 25;
}

.custom-reel-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.875rem;
    text-align: center;
    background: #000;
    padding: 1rem;
    box-sizing: border-box;
}

.custom-reel-empty {
    width: 100%;
    height: calc(100dvh - var(--fixed-header-height) - var(--fixed-footer-height));
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
}

/* プログレスバー */
.custom-reel-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.2);
    z-index: 30;
    overflow: visible;
    touch-action: none;
}

.custom-reel-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #E9528E;
    transform: scaleX(0);
    transform-origin: left center;
}

.custom-reel-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    background: #E9528E;
    transform: translate(-50%, -50%);
    z-index: 999;
}

/* 画面上部レイヤー */
.custom-reel-top-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 130px;
    padding: 1.25rem;
    box-sizing: border-box;
    z-index: 25;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.96) 0%,
        rgba(0, 0, 0, 0.88) 32%,
        rgba(0, 0, 0, 0.56) 68%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
}

.custom-reel-user-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.custom-reel-user-avatar {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 9999px;
    display: block;
    flex-shrink: 0;
    overflow: hidden;
    pointer-events: auto;
}

.custom-reel-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.custom-reel-user-name {
    color: #fff;
    font-size: 1.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 画面下部レイヤー */
.custom-reel-bottom-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 80px;
    padding: 1.25rem;
    box-sizing: border-box;
    z-index: 25;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 0.625rem;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.75) 20%,
        rgba(0, 0, 0, 0.22) 68%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
    align-items: center;
}

.custom-reel-video-description {
    color: #fff;
    font-size: 1rem;
    word-break: break-word;
    white-space: pre-line;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    flex: 1;
    min-width: 0;
}

.custom-reel-tiktok-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    pointer-events: auto;
}

.custom-reel-tiktok-logo {
    display: block;
    width: 3rem;
    height: 3rem;
    object-fit: contain;
}

.custom-reel-mute-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
}

.custom-reel-mute-icon {
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}