/* ========================================
   Shorts Page - YouTube Shorts-style 
   Vertical Game Swiper
   ======================================== */

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

:root {
    --shorts-bg: #000;
    --shorts-accent: #FF6B6B;
    --shorts-accent-glow: rgba(255, 107, 107, 0.4);
    --shorts-text: #fff;
    --shorts-text-muted: rgba(255, 255, 255, 0.6);
    --shorts-glass: rgba(255, 255, 255, 0.08);
    --shorts-glass-border: rgba(255, 255, 255, 0.12);
    --shorts-overlay: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.5) 0%,
        transparent 15%,
        transparent 50%,
        rgba(0, 0, 0, 0.8) 75%,
        rgba(0, 0, 0, 0.98) 100%
    );
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* ===== Reset & Base ===== */
.shorts-page {
    margin: 0;
    padding: 0;
    background: var(--shorts-bg);
    color: var(--shorts-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ===== Top Header Bar ===== */
.shorts-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: calc(12px + var(--safe-top)) 16px 12px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

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

.shorts-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shorts-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.shorts-back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.shorts-logo {
    font-size: 1rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shorts-logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--shorts-accent), #A78BFA);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

/* ===== Main Swiper Container ===== */
.shorts-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
}

.shorts-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.shorts-track.no-transition {
    transition: none !important;
}

/* ===== Individual Game Slide ===== */
.shorts-slide {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Thumbnail / Background Image */
.shorts-slide-bg {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s ease, opacity 0.5s ease;
    filter: blur(15px) brightness(0.6);
}

.shorts-slide.active .shorts-slide-bg {
    animation: shorts-bg-zoom 20s ease-in-out infinite alternate;
}

.shorts-title-img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    height: 100%;
    max-height: 48vh;
    transform: translate(-50%, -60%);
    object-fit: contain;
    z-index: 46;
    transition: opacity 0.5s ease;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.8));
    pointer-events: none;
}

/* NEW badge for works submitted within the last 7 days */
.shorts-new-badge {
    position: absolute;
    top: calc(64px + env(safe-area-inset-top, 0px));
    left: 14px;
    z-index: 47;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff5f6d, #ffc371);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 2px 10px rgba(255, 95, 109, 0.5);
    pointer-events: none;
    animation: shorts-new-badge-pop 0.4s ease;
}

@keyframes shorts-new-badge-pop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.shorts-slide.has-game-active .shorts-new-badge {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shorts-loading-bar-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, 15vh);
    z-index: 46;
    border-radius: 4px;
    overflow: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.shorts-loading-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--shorts-accent);
}

.shorts-slide.active:not(.has-game-active) .shorts-loading-bar-fill {
    animation: shorts-load-progress 1.5s linear forwards;
}

@keyframes shorts-load-progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.shorts-slide.has-game-active .shorts-title-img,
.shorts-slide.has-game-active .shorts-loading-bar-container,
.shorts-slide.has-game-active .shorts-slide-bg {
    opacity: 0;
}

@keyframes shorts-bg-zoom {
    0% { transform: scale(1.0); }
    100% { transform: scale(1.08); }
}

/* Gradient Overlay */
.shorts-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--shorts-overlay);
    pointer-events: none;
    z-index: 45;
}

/* ===== Game Info Panel (Bottom Left) ===== */
.shorts-info {
    position: absolute;
    bottom: calc(110px + var(--safe-bottom));
    left: 12px;
    right: 76px;
    z-index: 50;
    pointer-events: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.shorts-info > * {
    pointer-events: auto;
}

.shorts-info-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: white;
    margin-bottom: 4px;
    line-height: 1.3;
    text-shadow: 0 2px 12px rgba(0,0,0,0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shorts-info-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}

.shorts-info-author-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    flex-shrink: 0;
    border: 1.5px solid rgba(255,255,255,0.3);
}

.shorts-info-desc {
    display: none; /* Hide description in shorts view to save space */
}

.shorts-info-tags {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.shorts-info-tag {
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

/* ===== Action Buttons (Right Side) ===== */
.shorts-actions {
    position: absolute;
    right: 12px;
    bottom: calc(110px + var(--safe-bottom));
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 16px;
    z-index: 50;
    transition: all 0.3s ease;
}

.shorts-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.shorts-action-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    transition: all 0.3s ease;
}

.shorts-action-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.shorts-action-icon.liked {
    background: var(--shorts-accent);
    border-color: var(--shorts-accent);
    box-shadow: 0 0 20px var(--shorts-accent-glow);
    animation: shorts-like-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shorts-like-svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.shorts-action-icon.liked .shorts-like-svg {
    fill: currentColor;
}

@keyframes shorts-like-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.shorts-action-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ===== Play Button (Center) ===== */
.shorts-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 60;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.9);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 8px 32px rgba(255, 107, 107, 0.5),
        0 0 60px rgba(255, 107, 107, 0.2);
    animation: shorts-play-pulse 2s ease-in-out infinite;
}

.shorts-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.12);
    box-shadow: 
        0 12px 40px rgba(255, 107, 107, 0.6),
        0 0 80px rgba(255, 107, 107, 0.3);
}

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

@keyframes shorts-play-pulse {
    0%, 100% {
        box-shadow: 
            0 8px 32px rgba(255, 107, 107, 0.5),
            0 0 60px rgba(255, 107, 107, 0.2);
    }
    50% {
        box-shadow: 
            0 8px 32px rgba(255, 107, 107, 0.7),
            0 0 80px rgba(255, 107, 107, 0.35);
    }
}

.shorts-play-btn svg {
    width: 32px;
    height: 32px;
    fill: white;
    margin-left: 4px;
}

.shorts-play-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.6);
}

/* ===== Game iframe Container ===== */
.shorts-game-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-top: calc(56px + var(--safe-top));
    padding-bottom: calc(140px + var(--safe-bottom));
    box-sizing: border-box;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    background: transparent;
}

.shorts-game-frame.active {
    opacity: 1;
    pointer-events: auto;
}

.shorts-game-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Close game overlay button */
.shorts-game-close {
    position: absolute;
    top: calc(12px + var(--safe-top));
    right: 12px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.1rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shorts-game-close.visible {
    display: flex;
}

.shorts-game-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* ===== Bottom Navigation Bar ===== */
.shorts-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    padding: 12px 16px calc(12px + var(--safe-bottom));
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: none;
}

.shorts-bottom-bar > * {
    pointer-events: auto;
}

.shorts-scroll-guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    animation: shorts-scroll-bounce 2.5s infinite;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.shorts-scroll-guide:hover {
    opacity: 1;
}

.shorts-scroll-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.shorts-scroll-arrow {
    width: 24px;
    height: 24px;
    color: white;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8));
}

@keyframes shorts-scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ===== Loading & Skeleton ===== */
.shorts-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 30;
}

.shorts-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--shorts-accent);
    border-radius: 50%;
    animation: shorts-spin 0.8s linear infinite;
}

@keyframes shorts-spin {
    to { transform: rotate(360deg); }
}

.shorts-loading-text {
    font-size: 0.85rem;
    color: var(--shorts-text-muted);
    font-weight: 500;
}

/* Skeleton Slide */
.shorts-skeleton {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    animation: shorts-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes shorts-skeleton-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}



@keyframes shorts-hint-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* ===== Progress Dots ===== */
.shorts-progress {
    position: fixed;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 100;
    padding: 8px 4px;
}

.shorts-progress-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.shorts-progress-dot.active {
    background: var(--shorts-accent);
    width: 4px;
    height: 16px;
    border-radius: 2px;
    box-shadow: 0 0 8px var(--shorts-accent-glow);
}

/* ===== Playtime Badge ===== */
.shorts-playtime {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 6px;
}

/* ===== Empty State ===== */
.shorts-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 30;
}

.shorts-empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.shorts-empty-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--shorts-text-muted);
    margin-bottom: 8px;
}

.shorts-empty-sub {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ===== End of Feed ===== */
.shorts-end-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    text-align: center;
}

.shorts-end-icon {
    font-size: 3rem;
    opacity: 0.6;
}

.shorts-end-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--shorts-text-muted);
}

.shorts-end-btn {
    padding: 12px 24px;
    background: var(--shorts-glass);
    border: 1px solid var(--shorts-glass-border);
    border-radius: 12px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shorts-end-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== Toast Notification ===== */
.shorts-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 500;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.shorts-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
    /* Desktop: Center the experience in a phone-like frame */
    .shorts-page {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #0a0a0a;
    }

    .shorts-container {
        max-width: 420px;
        max-height: 100vh;
        border-radius: 0;
        position: relative;
        box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
    }

    .shorts-header {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
    }

    .shorts-bottom-bar {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
    }

    .shorts-progress {
        right: calc(50% - 220px);
    }
}

/* ===== Transition Effects ===== */
.shorts-slide-enter {
    animation: shorts-slide-in 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes shorts-slide-in {
    from { 
        opacity: 0.5;
        transform: scale(0.95);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Double-tap like animation */
.shorts-double-tap-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 6rem;
    z-index: 200;
    pointer-events: none;
    filter: drop-shadow(0 4px 12px rgba(255, 107, 107, 0.6));
}

.shorts-double-tap-heart.animate {
    animation: shorts-heart-explode 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes shorts-heart-explode {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

/* ===== Shorts Modal UI (Comments) ===== */
.shorts-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.shorts-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.shorts-comments-modal {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 65vh;
    background: #1e1e24;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    z-index: 210;
    display: flex;
    flex-direction: column;
    transition: bottom 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.shorts-comments-modal.active {
    bottom: 0;
}

.shorts-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.shorts-comments-header h3 {
    margin: 0;
    font-size: 1rem;
    color: white;
}

.shorts-comments-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
}

.shorts-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
}

.shorts-comment-item {
    display: flex;
    gap: 12px;
}

.shorts-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
}

.shorts-comment-content {
    flex: 1;
}

.shorts-comment-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 4px;
}

.shorts-comment-text {
    font-size: 0.9rem;
    color: white;
    line-height: 1.4;
    word-break: break-word;
}

.shorts-comments-form {
    padding: 12px 16px calc(12px + var(--safe-bottom));
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    gap: 8px;
    background: #1e1e24;
}

#shorts-comment-input {
    flex: 1;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 10px 16px;
    color: white;
    font-size: 0.95rem;
    outline: none;
}

#shorts-comment-input:focus {
    border-color: var(--shorts-accent);
}

#shorts-comment-submit {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--shorts-accent);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#shorts-comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================
   PC Desktop Layout (min-width: 1024px)
   YouTube Shorts-style 3-column layout
   ============================================= */

/* Hide PC panels on mobile */
.shorts-pc-panel {
    display: none;
}
.shorts-pc-center {
    width: 100%;
    height: 100%;
}
.shorts-desktop-layout {
    width: 100%;
    height: 100%;
}

@media (min-width: 1024px) {
    .shorts-desktop-layout {
        display: flex;
        align-items: stretch;
        height: 100vh;
        height: 100dvh;
        gap: 0;
    }

    /* Show PC panels */
    .shorts-pc-panel {
        display: flex;
        flex-direction: column;
        width: 320px;
        min-width: 280px;
        max-width: 360px;
        flex-shrink: 0;
        background: #0a0a0f;
        border-right: 1px solid rgba(255,255,255,0.06);
    }
    .shorts-pc-right {
        border-right: none;
        border-left: 1px solid rgba(255,255,255,0.06);
    }

    .shorts-pc-panel-inner {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    /* Center game area */
    .shorts-pc-center {
        flex: 1;
        min-width: 0;
        height: 100vh;
        height: 100dvh;
        position: relative;
        max-width: 500px;
        margin: 0 auto;
    }

    .shorts-pc-center .shorts-container {
        border-radius: 0;
        position: relative;
        width: 100%;
        max-width: 420px;
        height: 100%;
        margin: 0 auto;
        z-index: 10;
    }

    /* ===== PC Center Navigation Buttons ===== */
    .shorts-pc-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: -32px; /* Moved outside the game area */
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 16px;
        pointer-events: none;
        z-index: 50; /* Ensure it stays above video content */
    }

    .shorts-pc-nav-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(30, 30, 38, 0.6);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        pointer-events: auto;
        transition: all 0.2s ease-out;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .shorts-pc-nav-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }

    .shorts-pc-nav-btn:active {
        transform: scale(0.95);
    }

    .shorts-pc-nav-btn[disabled] {
        opacity: 0.3;
        pointer-events: none;
        background: rgba(0, 0, 0, 0.3);
    }

    /* ===== Left Panel: Game Info ===== */
    .shorts-pc-info-header {
        padding: 72px 20px 16px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .shorts-pc-author-row {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .shorts-pc-author-icon {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea, #764ba2);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        flex-shrink: 0;
        border: 2px solid rgba(255,255,255,0.15);
    }
    .shorts-pc-author-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .shorts-pc-author-name {
        color: white;
        font-weight: 700;
        font-size: 0.95rem;
        line-height: 1.3;
    }

    .shorts-pc-meta {
        color: rgba(255,255,255,0.45);
        font-size: 0.78rem;
        margin-top: 2px;
    }

    .shorts-pc-title {
        padding: 20px 20px 0;
        color: white;
        font-size: 1.15rem;
        font-weight: 800;
        line-height: 1.45;
        margin: 0;
        letter-spacing: -0.01em;
    }

    .shorts-pc-tags {
        padding: 10px 20px 0;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .shorts-pc-tags .shorts-pc-tag {
        padding: 3px 10px;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 20px;
        font-size: 0.72rem;
        font-weight: 600;
        color: rgba(255,255,255,0.7);
    }

    .shorts-pc-desc {
        padding: 16px 20px;
        color: rgba(255,255,255,0.6);
        font-size: 0.88rem;
        line-height: 1.65;
        flex: 1;
        overflow-y: auto;
        white-space: pre-wrap;
        word-break: break-word;
    }
    .shorts-pc-desc:empty {
        display: none;
    }
    .shorts-pc-desc::-webkit-scrollbar {
        width: 4px;
    }
    .shorts-pc-desc::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.15);
        border-radius: 4px;
    }

    /* Actions row */
    .shorts-pc-actions {
        padding: 16px 20px;
        display: flex;
        gap: 8px;
        border-top: 1px solid rgba(255,255,255,0.06);
        flex-shrink: 0;
    }

    .shorts-pc-action-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px 0;
        border-radius: 10px;
        background: rgba(255,255,255,0.07);
        border: 1px solid rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.85);
        font-size: 0.8rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
    }
    .shorts-pc-action-btn:hover {
        background: rgba(255,255,255,0.13);
        border-color: rgba(255,255,255,0.2);
    }

    .shorts-pc-like-btn .shorts-pc-like-svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        transition: all 0.3s ease;
    }
    .shorts-pc-like-btn.liked {
        background: rgba(255,107,107,0.15);
        border-color: rgba(255,107,107,0.4);
        color: var(--shorts-accent);
    }
    .shorts-pc-like-btn.liked .shorts-pc-like-svg {
        fill: var(--shorts-accent);
        stroke: var(--shorts-accent);
    }

    /* ===== Right Panel: Comments ===== */
    .shorts-pc-comments-header {
        padding: 72px 20px 14px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        flex-shrink: 0;
    }
    .shorts-pc-comments-header h3 {
        color: white;
        font-size: 0.95rem;
        font-weight: 700;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .shorts-pc-comments-count {
        color: rgba(255,255,255,0.4);
        font-weight: 500;
        font-size: 0.85rem;
    }

    .shorts-pc-comments-list {
        flex: 1;
        overflow-y: auto;
        padding: 12px 16px;
    }
    .shorts-pc-comments-list::-webkit-scrollbar {
        width: 4px;
    }
    .shorts-pc-comments-list::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.15);
        border-radius: 4px;
    }

    .shorts-pc-comments-empty {
        text-align: center;
        color: rgba(255,255,255,0.3);
        font-size: 0.88rem;
        padding: 40px 0;
        line-height: 1.6;
    }

    .shorts-pc-comment-item {
        display: flex;
        gap: 10px;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .shorts-pc-comment-item:last-child {
        border-bottom: none;
    }
    .shorts-pc-comment-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(255,255,255,0.1);
        flex-shrink: 0;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(255,255,255,0.4);
    }
    .shorts-pc-comment-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .shorts-pc-comment-author {
        font-size: 0.78rem;
        font-weight: 700;
        color: rgba(255,255,255,0.7);
        margin-bottom: 3px;
    }
    .shorts-pc-comment-text {
        font-size: 0.88rem;
        color: rgba(255,255,255,0.9);
        line-height: 1.5;
        word-break: break-word;
    }

    /* Comments form (right panel) */
    .shorts-pc-comments-form {
        padding: 12px 16px;
        border-top: 1px solid rgba(255,255,255,0.08);
        display: flex;
        gap: 8px;
        flex-shrink: 0;
        background: #0d0d14;
    }
    .shorts-pc-comments-form input {
        flex: 1;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 20px;
        padding: 10px 16px;
        color: white;
        font-size: 0.9rem;
        outline: none;
        transition: border-color 0.2s;
    }
    .shorts-pc-comments-form input:focus {
        border-color: var(--shorts-accent);
    }
    .shorts-pc-comments-form button {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: var(--shorts-accent);
        color: white;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: opacity 0.2s;
    }
    .shorts-pc-comments-form button:hover {
        opacity: 0.85;
    }

    /* Hide mobile-only elements on PC */
    .shorts-bottom-bar {
        display: none !important;
    }
    .shorts-progress {
        display: none !important;
    }

    /* ===== Spoiler Blur for Comments ===== */
    .shorts-pc-spoiler-wrap {
        position: relative;
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .shorts-pc-spoiler-wrap .shorts-pc-comments-list {
        filter: blur(8px);
        transition: filter 0.4s ease;
        pointer-events: none;
        user-select: none;
    }

    .shorts-pc-spoiler-wrap.revealed .shorts-pc-comments-list {
        filter: none;
        pointer-events: auto;
        user-select: auto;
    }

    .shorts-pc-spoiler-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 5;
        background: rgba(10, 10, 15, 0.3);
        transition: opacity 0.35s ease;
    }

    .shorts-pc-spoiler-wrap.revealed .shorts-pc-spoiler-overlay {
        opacity: 0;
        pointer-events: none;
    }

    .shorts-pc-spoiler-icon {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(255, 255, 255, 0.6);
        margin-bottom: 12px;
        transition: all 0.25s ease;
    }
    .shorts-pc-spoiler-overlay:hover .shorts-pc-spoiler-icon {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
        color: white;
        transform: scale(1.08);
    }

    .shorts-pc-spoiler-text {
        color: rgba(255, 255, 255, 0.85);
        font-size: 0.95rem;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .shorts-pc-spoiler-sub {
        color: rgba(255, 255, 255, 0.4);
        font-size: 0.78rem;
    }
}

/* Wider screens: expand panels */
@media (min-width: 1400px) {
    .shorts-pc-panel {
        width: 360px;
        max-width: 400px;
    }
}
