:root {
    --bg-color: #070709;
    --surface-color: rgba(20, 20, 27, 0.65);
    --surface-hover: rgba(30, 30, 45, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 0, 127, 0.3);
    --text-primary: #f8f9fa;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --primary-color: #ff007f;
    --primary-hover: #e60072;
    --secondary-color: #7f00ff;
    --accent-gradient: linear-gradient(135deg, #ff007f 0%, #7f00ff 100%);
    --card-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --font-sans: 'Plus Jakarta Sans', 'Outfit', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

@keyframes cardFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Background Gradients */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    pointer-events: none;
    z-index: -1;
    transform: translateZ(0);
    will-change: transform;
}

.bg-glow-1 {
    top: -200px;
    left: -200px;
    background: var(--primary-color);
}

.bg-glow-2 {
    bottom: -200px;
    right: -200px;
    background: var(--secondary-color);
}

/* App Container & Header */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 7, 9, 0.8);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    filter: drop-shadow(0 0 8px rgba(255, 0, 127, 0.4));
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #bbb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.live-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    width: 320px;
    position: relative;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 127, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.search-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text-secondary);
    margin-right: 0.75rem;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    font-family: inherit;
}

.clear-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    position: absolute;
    right: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 127, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 127, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-icon svg {
    width: 1.1rem;
    height: 1.1rem;
    transition: transform 0.3s ease;
}

#refresh-btn:hover .refresh-icon {
    transform: rotate(180deg);
}

/* Grid Layout & Section */
.main-content {
    padding: 2.5rem 0;
}

.grid-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.grid-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    position: relative;
    padding-left: 0.8rem;
}

.grid-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background: var(--accent-gradient);
    border-radius: 4px;
}

.filter-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* Cards & Skeletons */
.skeleton-card {
    height: 380px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.room-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    animation: cardFadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    content-visibility: auto;
    contain-intrinsic-size: 0 390px;
}

.room-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px rgba(255, 0, 127, 0.15);
    background: var(--surface-hover);
}

.card-media-wrapper {
    position: relative;
    width: 100%;
    padding-top: 125%;
    /* 4:5 ratio for idol pictures */
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-img.loaded, .card-img[complete], .card-img.offline-img {
    opacity: 1;
}

.room-card:hover .card-img {
    transform: scale(1.05);
}

/* Crossfade overlay for snapshot updates */
.card-img-snapshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    filter: none;
    transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    pointer-events: none;
}

.card-img-snapshot-overlay.visible {
    opacity: 1;
}

/* Playlist item thumbnail wrapper & overlay */
.playlist-item-thumb-wrapper {
    position: relative;
    display: flex;
}

.playlist-item-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    pointer-events: none;
}

.playlist-item-img-overlay.visible {
    opacity: 1;
}

.card-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 2;
}

.card-live-badge {
    background: rgba(220, 38, 38, 0.92);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.live-badge-dot {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    animation: pulse 1s infinite alternate;
}

.card-viewer-badge {
    background: rgba(10, 10, 15, 0.85);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-area-badge {
    background: rgba(10, 10, 15, 0.85);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-viewer-badge svg {
    width: 0.85rem;
    height: 0.85rem;
    stroke: currentColor;
}

.card-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    z-index: 1;
}

.room-card:hover .card-play-overlay {
    opacity: 1;
}

.play-circle {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(255, 0, 127, 0.4);
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.room-card:hover .play-circle {
    transform: scale(1);
}

.play-circle svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: white;
    margin-left: 3px;
}

.card-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-grow: 1;
}

.card-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.1rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.card-actions button,
.card-actions a {
    flex: 1;
}

/* Status Banner */
.status-banner {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    color: #fca5a5;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Modals & Backdrop Blur */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-container {
    width: 100%;
    max-width: 1400px;
    background: #0d0d12;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 50px rgba(127, 0, 255, 0.15);
    display: flex;
    flex-direction: column;
    height: 92vh;
    max-height: 92vh;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.current-idol-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-avatar-img {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.current-idol-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.current-idol-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.close-btn svg {
    width: 1.2rem;
    height: 1.2rem;
}

/* Modal Split Screen Wrapper */
.modal-content-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

/* Player Panel (Left) */
.player-left-panel {
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #050508;
    position: relative;
    min-height: 0;
}

.video-wrapper {
    flex-grow: 1;
    position: relative;
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#live-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Custom Overlays inside Player */
.video-loader,
.video-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: rgba(7, 7, 9, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(255, 0, 127, 0.15);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.video-error-overlay {
    background: rgba(13, 13, 18, 0.95);
    text-align: center;
    padding: 2rem;
}

.error-icon {
    font-size: 3rem;
}

.error-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ef4444;
}

.error-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 320px;
    margin-bottom: 0.5rem;
}

.player-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.actions-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.live-tag {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.viewer-count {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.viewer-count svg {
    width: 1.1rem;
    height: 1.1rem;
}

.actions-right {
    display: flex;
    gap: 0.5rem;
}

/* Playlist Panel (Right - now at Bottom) */
.player-right-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.01);
    flex-shrink: 0;
}

.playlist-header {
    padding: 0.6rem 1.5rem 0.2rem 1.5rem;
    border-bottom: none;
    background: transparent;
}

.playlist-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* Playlist Carousel Wrapper */
.playlist-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.playlist-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(13, 13, 18, 0.85);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.playlist-nav-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 12px rgba(255, 0, 127, 0.5);
}

.playlist-nav-btn.prev {
    left: 0.75rem;
}

.playlist-nav-btn.next {
    right: 0.75rem;
}

.playlist-nav-btn.disabled {
    opacity: 0;
    pointer-events: none;
}

.playlist-nav-btn svg {
    width: 1.1rem;
    height: 1.1rem;
}

.sidebar-playlist {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0.5rem 1rem 0.5rem;
    width: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 0, 127, 0.4) rgba(255, 255, 255, 0.03);
}

.sidebar-playlist::-webkit-scrollbar {
    height: 6px;
    display: block;
}

.sidebar-playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin: 0 3.5rem;
}

.sidebar-playlist::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

.sidebar-playlist::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Playlist Item Card - Stories style circular cards */
.playlist-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 90px;
    flex-shrink: 0;
    gap: 0.4rem;
    padding: 0.5rem 0.4rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.playlist-item.active {
    background: rgba(255, 0, 127, 0.08);
    border-color: rgba(255, 0, 127, 0.3);
    box-shadow: 0 0 12px rgba(255, 0, 127, 0.15);
}

.playlist-item-img {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    object-fit: cover;
    background-color: #1a1a24;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
}

.playlist-item.active .playlist-item-img {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(255, 0, 127, 0.5);
}

.playlist-item-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 0;
}

.playlist-item-name {
    font-weight: 600;
    font-size: 0.75rem;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.playlist-item-title {
    display: none;
}

.playlist-item-viewers {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.playlist-item-viewers svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(13, 13, 18, 0.9);
    border: 1px solid var(--border-hover);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg), 0 0 15px rgba(255, 0, 127, 0.2);
    z-index: 2000;
    backdrop-filter: blur(10px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
}

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

/* Responsive adjustments */
@media (max-width: 1024px) {
    .modal-container {
        height: 95vh;
        max-height: 95vh;
    }

    .modal-content-wrapper {
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    .player-left-panel {
        width: 100%;
        flex-grow: 1;
        min-height: 0;
    }

    .player-right-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 0 1rem;
    }

    .main-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 1rem 0;
    }

    .header-left {
        justify-content: space-between;
    }

    .header-right {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .grid-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .modal-overlay {
        padding: 0.5rem;
    }

    .modal-container {
        height: 98vh;
        max-height: 98vh;
        border-radius: 12px;
    }

    .player-left-panel {
        width: 100%;
        flex-grow: 1;
        min-height: 0;
    }

    .sidebar-playlist {
        padding: 0.5rem 2.5rem 0.6rem 2.5rem;
        gap: 0.75rem;
    }
}

/* Category Tabs Styling */
.category-tabs-container {
    display: flex;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem 0;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    align-self: flex-start;
    backdrop-filter: blur(8px);
}

.category-tab {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
}

.category-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.category-tab.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 0, 127, 0.25);
}

.card-cat-badge {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    z-index: 2;
    pointer-events: none;
}

/* Offline Styles */
.card-offline-badge {
    background: rgba(74, 85, 104, 0.85);
    /* Slate gray */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #e2e8f0;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-time-badge {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.offline-img {
    filter: grayscale(1) opacity(0.5);
}

/* Country Filters Styling */
.country-filters-container {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0 1.5rem 0;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    align-self: flex-start;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.country-filter {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-sans);
}

.country-filter:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.country-filter.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Subtag Filters Styling */
.subtag-filters-container {
    display: flex;
    gap: 0.5rem;
    margin: -0.75rem 0 1.25rem 0;
    padding: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
    width: 100%;
}

.subtag-filters-container::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

.subtag-filter {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    outline: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-sans);
}

.subtag-filter:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.subtag-filter.active {
    background: rgba(236, 72, 153, 0.12);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.08);
}

/* Resolution Selector Dropdown */
.resolution-selector-container {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    gap: 0.4rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.resolution-selector-container:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.resolution-select {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding-right: 0.25rem;
}

.resolution-select option {
    background: #0d0d12;
    color: var(--text-primary);
}

/* Mobile Split Screen Layout Optimization (Live left, vertical playlist right) */
@media (max-width: 768px) {
    .modal-content-wrapper {
        flex-direction: row !important;
        height: 100% !important;
        overflow: hidden !important;
    }

    .player-left-panel {
        width: 72% !important;
        height: 100% !important;
        flex-grow: 1 !important;
        min-height: 0 !important;
    }

    .player-right-panel {
        width: 28% !important;
        height: 100% !important;
        border-top: none !important;
        border-left: 1px solid var(--border-color) !important;
        flex-shrink: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .playlist-carousel-container {
        flex-direction: column !important;
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative !important;
        display: flex !important;
        align-items: stretch !important;
    }

    .sidebar-playlist {
        flex-direction: column !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: 100% !important;
        padding: 0.5rem !important;
        gap: 0.5rem !important;
        width: 100% !important;
        display: flex !important;
    }

    .playlist-item {
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        width: 100% !important;
        padding: 0.4rem !important;
        gap: 0.5rem !important;
    }

    .playlist-item-img {
        width: 2.25rem !important;
        height: 2.25rem !important;
    }

    .playlist-item-info {
        align-items: flex-start !important;
    }

    .playlist-item-name {
        font-size: 0.7rem !important;
    }

    .playlist-item-viewers {
        font-size: 0.6rem !important;
    }

    .playlist-nav-btn {
        display: none !important;
    }
}

/* Also apply mobile split screen layout when data-is-mobile="true" is present on the modal */
#player-modal[data-is-mobile="true"] .modal-content-wrapper {
    flex-direction: row !important;
    height: 100% !important;
    overflow: hidden !important;
}

#player-modal[data-is-mobile="true"] .player-left-panel {
    width: 72% !important;
    height: 100% !important;
    flex-grow: 1 !important;
    min-height: 0 !important;
}

#player-modal[data-is-mobile="true"] .player-right-panel {
    width: 28% !important;
    height: 100% !important;
    border-top: none !important;
    border-left: 1px solid var(--border-color) !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

#player-modal[data-is-mobile="true"] .playlist-carousel-container {
    flex-direction: column !important;
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
    display: flex !important;
    align-items: stretch !important;
}

#player-modal[data-is-mobile="true"] .sidebar-playlist {
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100% !important;
    padding: 0.5rem !important;
    gap: 0.5rem !important;
    width: 100% !important;
    display: flex !important;
}

#player-modal[data-is-mobile="true"] .playlist-item {
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    width: 100% !important;
    padding: 0.4rem !important;
    gap: 0.5rem !important;
}

#player-modal[data-is-mobile="true"] .playlist-item-img {
    width: 2.25rem !important;
    height: 2.25rem !important;
}

#player-modal[data-is-mobile="true"] .playlist-item-info {
    align-items: flex-start !important;
}

#player-modal[data-is-mobile="true"] .playlist-item-name {
    font-size: 0.7rem !important;
}

#player-modal[data-is-mobile="true"] .playlist-item-viewers {
    font-size: 0.6rem !important;
}

#player-modal[data-is-mobile="true"] .playlist-nav-btn {
    display: none !important;
}

/* Player Page Layouts */
.player-page-body {
    margin: 0;
    padding: 0;
    background-color: #050508;
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.player-page-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 10;
}

.player-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(13, 13, 20, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    box-sizing: border-box;
}

.player-page-header .header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.player-page-header .back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-page-header .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-page-workspace {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 70px);
    width: 100vw;
    overflow: hidden;
    background: rgba(10, 10, 15, 0.4);
}

/* Desktop styles: left panel fills remaining space, right panel compact 320px */
.player-page-workspace .player-left-panel {
    width: calc(100% - 320px);
    flex-grow: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    box-sizing: border-box;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-page-workspace .player-right-panel {
    width: 320px;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    background: rgba(10, 10, 15, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.player-page-workspace.sidebar-collapsed .player-right-panel {
    display: none !important;
}

.player-page-workspace.sidebar-collapsed .player-left-panel {
    width: 100% !important;
    border-right: none !important;
}

.toggle-sidebar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-sidebar-btn.collapsed {
    background: rgba(255, 0, 127, 0.15);
    border-color: rgba(255, 0, 127, 0.4);
    color: #ff3399;
}

/* Playlist header with dot indicator */
.player-page-workspace .playlist-header {
    padding: 1.25rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.5rem;
}

.player-page-workspace .playlist-header h4 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-page-workspace .playlist-header h4::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-color);
}

/* Video Wrapper */
.player-page-workspace .video-wrapper {
    flex-grow: 1;
    background-color: #000;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.player-page-workspace video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-page-workspace .playlist-carousel-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-grow: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0.5rem 0.75rem;
}

.player-page-workspace .sidebar-playlist {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    gap: 0.6rem;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overflow-anchor: none;
    scroll-behavior: auto;
}

/* Playlist item styling */
.player-page-workspace .playlist-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    width: 100%;
    padding: 0.6rem;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-sizing: border-box;
}

.player-page-workspace .playlist-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.player-page-workspace .playlist-item.active {
    background: linear-gradient(135deg, rgba(255, 0, 127, 0.15) 0%, rgba(255, 0, 127, 0.03) 100%);
    border-color: rgba(255, 0, 127, 0.45);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.15);
}

/* Thumbnail wrapper with pulsing live badge */
.player-page-workspace .playlist-item-thumb-wrapper {
    position: relative;
    flex-shrink: 0;
    display: flex;
}

.player-page-workspace .playlist-item-thumb-wrapper::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 8px;
    height: 8px;
    background: #ff4757;
    border: 1.5px solid #0a0a0f;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff4757;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(255, 71, 87, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
    }
}

.player-page-workspace .playlist-item-img {
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 8px;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.25s ease;
}

.player-page-workspace .playlist-item-img-overlay {
    border-radius: 8px;
}

.player-page-workspace .playlist-item.active .playlist-item-img {
    border-color: var(--primary-color);
}

.player-page-workspace .playlist-item-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-start;
}

.player-page-workspace .playlist-item-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-page-workspace .playlist-item-title {
    display: none;
}

.player-page-workspace .playlist-item-viewers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.player-page-workspace .playlist-item-viewers svg {
    width: 0.8rem;
    height: 0.8rem;
}

/* Mobile Styles for the Player Page */
@media (max-width: 768px) {
    .player-page-header {
        padding: 0.5rem 1rem;
        height: 60px;
    }

    .player-page-header .current-idol-info img {
        width: 2.25rem;
        height: 2.25rem;
    }

    .player-page-header h3 {
        font-size: 0.9rem;
    }

    .player-page-header p {
        font-size: 0.7rem;
    }

    .player-page-workspace {
        flex-direction: column !important;
        height: calc(100vh - 60px) !important;
        overflow: hidden !important;
    }

    .player-page-workspace .player-left-panel {
        width: 100% !important;
        height: auto !important;
        flex-shrink: 0 !important;
        padding: 0.5rem !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
    }

    .player-page-workspace .video-wrapper {
        width: 100% !important;
        aspect-ratio: 16 / 9 !important;
        height: auto !important;
        min-height: unset !important;
        border-radius: 12px !important;
    }

    .player-page-workspace .player-right-panel {
        width: 100% !important;
        flex-grow: 1 !important;
        min-height: 0 !important;
        border-left: none !important;
        overflow: hidden !important;
    }

    .player-page-workspace .playlist-item {
        padding: 0.4rem !important;
        gap: 0.5rem !important;
    }

    .player-page-workspace .playlist-item-img {
        width: 3.5rem !important;
        height: 2.5rem !important;
        border-radius: 6px !important;
    }

    .player-page-workspace .playlist-item-name {
        font-size: 0.75rem !important;
    }

    .player-page-workspace .playlist-item-viewers {
        font-size: 0.65rem !important;
    }
}

/* Also apply same layout when data-is-mobile="true" is on workspace */
.player-page-workspace[data-is-mobile="true"] {
    flex-direction: column !important;
}

.player-page-workspace[data-is-mobile="true"] .player-left-panel {
    width: 100% !important;
    height: auto !important;
    flex-shrink: 0 !important;
    padding: 0.5rem !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.player-page-workspace[data-is-mobile="true"] .video-wrapper {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    min-height: unset !important;
    border-radius: 12px !important;
}

.player-page-workspace[data-is-mobile="true"] .player-right-panel {
    width: 100% !important;
    flex-grow: 1 !important;
    min-height: 0 !important;
    border-left: none !important;
    overflow: hidden !important;
}

.player-page-workspace[data-is-mobile="true"] .playlist-item {
    padding: 0.4rem !important;
    gap: 0.5rem !important;
}

.player-page-workspace[data-is-mobile="true"] .playlist-item-img {
    width: 3.5rem !important;
    height: 2.5rem !important;
    border-radius: 6px !important;
}

.player-page-workspace[data-is-mobile="true"] .playlist-item-name {
    font-size: 0.75rem !important;
}

.player-page-workspace[data-is-mobile="true"] .playlist-item-viewers {
    font-size: 0.65rem !important;
}

/* Settings Modal specific styles */
.settings-modal-container {
    max-width: 500px !important;
    height: auto !important;
    max-height: 90vh !important;
    background: rgba(13, 13, 18, 0.95) !important;
}

.settings-modal-content {
    padding: 2rem;
    color: var(--text-primary);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.token-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.token-input-wrapper input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.token-input-wrapper input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.token-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.status-label {
    color: var(--text-secondary);
}

.status-value {
    font-weight: 600;
}

.status-value.configured {
    color: #10b981;
    /* Green */
}

.status-value.not-configured {
    color: #f59e0b;
    /* Amber */
}

.status-value.loading {
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.form-actions button {
    min-width: 100px;
}

/* Card Favorite Button */
.card-fav-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 10;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(15, 15, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
}

.card-fav-btn:hover {
    background: rgba(255, 0, 127, 0.15);
    border-color: rgba(255, 0, 127, 0.4);
    color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 0, 127, 0.2);
}

.card-fav-btn.active {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 0, 127, 0.3);
}

.name-paid-lock {
    margin-left: 6px;
    font-size: 0.85em;
    vertical-align: middle;
    cursor: help;
}

/* ==========================================================================
   GRID VIEW (4 SLOTS) STYLES
   ========================================================================== */
.grid-workspace {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 70px);
    width: 100vw;
    overflow: hidden;
    background: rgba(10, 10, 15, 0.4);
}

.grid-sidebar {
    width: 320px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    background: rgba(10, 10, 15, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.grid-sidebar-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.grid-room-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    cursor: grab;
    transition: all 0.2s ease;
    animation: cardFadeInUp 0.3s ease both;
    user-select: none;
}

.grid-room-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.grid-room-card:active {
    cursor: grabbing;
}

.grid-room-avatar {
    width: 4.75rem;
    height: 4.75rem;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.grid-room-info {
    flex-grow: 1;
    min-width: 0;
}

.grid-room-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-room-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-room-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
}

.grid-room-viewers {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.grid-room-viewers svg {
    width: 0.8rem;
    height: 0.8rem;
}

.grid-room-platform-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.grid-room-platform-badge.camprofiles {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.grid-room-platform-badge.yylive {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.grid-room-platform-badge.hot51 {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.grid-room-platform-badge.swag {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.grid-main-area {
    flex-grow: 1;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
    box-sizing: border-box;
    background: rgba(5, 5, 8, 0.75);
}

.grid-slot {
    position: relative;
    background: rgba(13, 13, 20, 0.5);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.grid-slot.active {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.grid-slot.drag-hover {
    border-color: var(--primary-color);
    background: rgba(255, 0, 127, 0.04);
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.15);
    transform: scale(1.01);
}

.grid-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
    pointer-events: none;
}

.grid-placeholder-icon {
    width: 3.5rem;
    height: 3.5rem;
    opacity: 0.4;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.grid-slot.drag-hover .grid-placeholder-icon {
    color: var(--primary-color);
    opacity: 0.8;
    transform: scale(1.1);
}

.grid-placeholder-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-secondary);
}

.grid-placeholder-desc {
    font-size: 0.8rem;
    max-width: 220px;
    line-height: 1.4;
}

/* Player UI inside grid slot */
.grid-player-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    background: #000;
}

.grid-player-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 10;
    box-sizing: border-box;
    transition: opacity 0.25s ease;
    opacity: 1;
}

.grid-player-container:hover .grid-player-header {
    opacity: 1;
}

.grid-player-title-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.grid-player-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.grid-player-nickname {
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.grid-player-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grid-control-btn {
    background: rgba(13, 13, 20, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    backdrop-filter: blur(4px);
}

.grid-control-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(255, 0, 127, 0.4);
}

.grid-control-btn svg {
    width: 0.9rem;
    height: 0.9rem;
}

.grid-control-btn.close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.grid-player-video-wrapper {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    position: relative;
}

.grid-player-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.grid-player-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 10;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.grid-player-container:hover .grid-player-footer {
    opacity: 1;
}

.grid-select-preset {
    background: rgba(13, 13, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.grid-select-preset option {
    background: #0d0d12;
    color: white;
}

/* Quick Slot Selector Popup for mobile click action */
.quick-slot-selector {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(13, 13, 20, 0.95);
    border: 1px solid var(--border-hover);
    border-radius: 16px;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    width: 240px;
}

.quick-slot-selector-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.quick-slot-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
}

.quick-slot-opt-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-slot-opt-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(255, 0, 127, 0.3);
}

.quick-slot-selector-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 0.25rem;
}

@media (max-width: 1024px) {
    .grid-workspace {
        flex-direction: column;
    }

    .grid-sidebar {
        width: 100%;
        height: 180px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .grid-sidebar-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        height: 100%;
        padding: 0.75rem;
    }

    .grid-room-card {
        width: 220px;
        flex-shrink: 0;
        height: calc(100% - 0.5rem);
        box-sizing: border-box;
    }

    .grid-main-area {
        height: calc(100vh - 70px - 180px);
    }
}

@media (max-width: 640px) {
    .grid-main-area {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        overflow-y: auto;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .grid-slot {
        height: 220px;
    }
}

/* Live Stream Recording Style Rules */
.record-btn-container {
    display: inline-flex;
    align-items: center;
}

#record-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#record-btn .record-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
}

#record-btn.recording {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

#record-btn.recording .record-dot {
    animation: record-pulse 1s infinite alternate;
    box-shadow: 0 0 8px #ef4444;
}

#record-btn.paused {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

#record-btn.paused .record-dot {
    background-color: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
    animation: none;
}

#end-record-btn,
.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

#end-record-btn:hover,
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

#cancel-record-btn {
    background: rgba(107, 114, 128, 0.2);
    border: 1px solid rgba(156, 163, 175, 0.3);
    color: #d1d5db;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

#cancel-record-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

#record-btn.uploading {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    cursor: not-allowed;
}

#record-btn.uploading .record-dot {
    background-color: #3b82f6;
    animation: upload-pulse 1s infinite alternate;
}

@keyframes record-pulse {
    0% {
        opacity: 0.3;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes upload-pulse {
    0% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

/* Config modal GDrive selector styling */
.config-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.config-select-wrapper {
    position: relative;
    width: 100%;
}

.config-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: all 0.2s ease;
}

.config-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.2);
}

.config-select option {
    background-color: #0d0d12;
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Room tag badge with hover interaction */
.room-tag-badge {
    background: rgba(255, 0, 127, 0.08);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--primary-color);
    border: 1px solid rgba(255, 0, 127, 0.2);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.room-tag-badge:hover {
    background: rgba(255, 0, 127, 0.15);
    border-color: rgba(255, 0, 127, 0.4);
    transform: translateY(-1px);
}

/* Pagination Bar Styling */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem 3rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

/* ==========================================================================
   PREMIUM UX REFRESH — discovery, watching and favorites
   ========================================================================== */
:root {
    --bg-color: #08080b;
    --surface-color: rgba(19, 19, 25, 0.82);
    --surface-hover: rgba(28, 27, 37, 0.96);
    --border-color: rgba(255, 255, 255, 0.085);
    --border-hover: rgba(255, 61, 141, 0.46);
    --text-primary: #fbfaff;
    --text-secondary: #aaa8b5;
    --text-muted: #777583;
    --primary-color: #ff3d8d;
    --primary-hover: #ff5b9e;
    --secondary-color: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #ff3d8d 0%, #a855f7 100%);
    --shadow-lg: 0 30px 70px -22px rgba(0, 0, 0, 0.85);
}

body {
    background:
        radial-gradient(circle at 12% -10%, rgba(255, 61, 141, 0.1), transparent 28rem),
        radial-gradient(circle at 92% 4%, rgba(139, 92, 246, 0.09), transparent 30rem),
        var(--bg-color);
}

button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #ff74ad;
    outline-offset: 3px;
}

.main-header {
    padding: 1rem 0;
    background: rgba(8, 8, 11, 0.78);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025);
}

.main-header .header-left,
.main-header .header-right {
    gap: 0.75rem;
}

.logo-icon {
    width: 2.25rem;
    height: 2.25rem;
}

.logo h1 {
    font-size: 1.3rem;
    letter-spacing: -0.04em;
}

.search-box {
    width: min(30vw, 360px);
    min-height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
}

.search-box:focus-within {
    border-color: rgba(255, 61, 141, 0.55);
    background: rgba(255, 255, 255, 0.065);
    box-shadow: 0 0 0 4px rgba(255, 61, 141, 0.08);
}

.main-content {
    padding: 2.25rem 0 4rem;
}

.grid-section {
    gap: 1.1rem;
}

.section-eyebrow,
.playlist-eyebrow {
    margin: 0 0 0.35rem;
    color: #ff74ad;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.grid-header h2 {
    padding: 0;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    letter-spacing: -0.03em;
}

.grid-header h2::before {
    display: none;
}

.category-tabs-container,
.country-filters-container {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
}

.category-tabs-container::-webkit-scrollbar,
.country-filters-container::-webkit-scrollbar {
    display: none;
}

.category-tab,
.country-filter {
    min-height: 42px;
    white-space: nowrap;
}

.tab-count {
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.38rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.rooms-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: clamp(0.8rem, 1.5vw, 1.25rem);
}

.room-card {
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(25, 24, 32, 0.92), rgba(14, 14, 19, 0.96));
    box-shadow: 0 12px 35px -24px rgba(0, 0, 0, 0.9);
    content-visibility: auto;
    contain-intrinsic-size: 0 390px;
}

.room-card::before {
    display: none;
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 48px -24px rgba(255, 61, 141, 0.38);
}

.card-media-wrapper {
    padding-top: 124%;
    animation: none;
}

.card-img {
    transition-duration: 0.32s;
}

.card-badges {
    top: 0.7rem;
    left: 0.7rem;
    right: 3.75rem;
    gap: 0.4rem;
}

.card-live-badge,
.card-viewer-badge,
.card-area-badge,
.card-offline-badge,
.card-time-badge {
    min-height: 27px;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 8, 12, 0.88);
}

.card-live-badge {
    background: rgba(239, 35, 91, 0.95);
}

.card-fav-btn {
    top: 0.7rem;
    right: 0.7rem;
    bottom: auto;
    left: auto;
    width: 27px;
    height: 27px;
    color: #fff;
    background: rgba(8, 8, 12, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-fav-btn svg {
    width: 14px;
    height: 14px;
}

.card-fav-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #ff3d8d, #e52e70);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 8px 22px rgba(255, 61, 141, 0.34);
}

.card-fav-btn.active svg {
    fill: currentColor !important;
    stroke: currentColor !important;
}

.card-play-overlay {
    border: 0;
    padding: 0;
    color: inherit;
    background: linear-gradient(180deg, transparent 48%, rgba(6, 5, 9, 0.55));
}

.play-circle {
    width: 3.75rem;
    height: 3.75rem;
    background: rgba(8, 8, 12, 0.85);
}

.card-info {
    padding: 0.95rem;
    gap: 0.3rem;
}

.card-info h3 {
    font-size: 0.96rem;
    letter-spacing: -0.01em;
}

.card-actions {
    gap: 0.55rem;
    padding-top: 0.65rem;
}

.card-actions .play-btn {
    min-height: 40px;
}

.card-actions .copy-btn {
    flex: 0 0 40px;
    padding: 0;
}

/* Dedicated player: favorite is primary; technical tools remain secondary. */
.player-page-header {
    height: 76px;
    padding: 0.8rem 1.25rem;
    background: rgba(10, 9, 14, 0.82);
}

.player-page-workspace {
    height: calc(100dvh - 76px);
}

.player-page-header .current-idol-info {
    gap: 0.75rem;
    min-width: 0;
}

.player-page-header .current-idol-info > div {
    min-width: 0;
}

.player-page-header .current-idol-info h3,
.player-page-header .current-idol-info p {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.player-page-header .current-idol-info p {
    max-width: min(36vw, 480px);
}

.player-page-header .header-right {
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
}

.player-favorite-btn {
    min-height: 42px;
    padding: 0 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 61, 141, 0.28);
    color: #ff8abb;
    background: rgba(255, 61, 141, 0.08);
    font: 700 0.8rem var(--font-sans);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.player-favorite-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 61, 141, 0.15);
}

.player-favorite-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #ff3d8d, #e52e70);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(255, 61, 141, 0.3);
}

.player-favorite-btn svg {
    width: 19px;
    height: 19px;
}

.player-favorite-btn.active svg {
    fill: currentColor;
}

.player-page-workspace .player-left-panel {
    width: calc(100% - clamp(400px, 30vw, 460px));
    padding: clamp(0.8rem, 1.5vw, 1.25rem);
    background: #07070a;
}

.player-page-workspace .player-right-panel {
    width: clamp(400px, 30vw, 460px);
}

.player-page-workspace .video-wrapper {
    border-radius: 18px;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.52);
}

.player-page-workspace .player-actions {
    min-height: 60px;
    padding: 0.65rem 0.25rem 0;
    border: 0;
    background: transparent;
}

.player-page-workspace .playlist-header {
    padding: 1.2rem 1rem 0.7rem;
}

.player-page-workspace .playlist-header h4 {
    text-transform: none;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.player-page-workspace .playlist-header h4::before {
    display: none;
}

.player-page-workspace .playlist-helper {
    margin: 0.3rem 0 0;
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.35;
}

.player-page-workspace .playlist-item {
    min-height: 142px;
    padding: 0.55rem;
    gap: 0.8rem;
    border-radius: 16px;
}

.player-page-workspace .playlist-item-thumb-wrapper {
    width: 104px;
    height: 128px;
    border-radius: 12px;
    overflow: visible;
}

.player-page-workspace .playlist-item-img {
    width: 104px;
    height: 128px;
    border-radius: 12px;
    object-position: center top;
}

.player-page-workspace .playlist-item-img-overlay {
    border-radius: 12px;
}

.player-page-workspace .playlist-item-info {
    gap: 0.42rem;
}

.player-page-workspace .playlist-item-name {
    font-size: 0.9rem;
    line-height: 1.3;
}

.player-page-workspace .playlist-item-viewers {
    font-size: 0.72rem;
}

.player-page-workspace .playlist-item-info::after {
    content: "Nhấn để xem live";
    margin-top: 0.15rem;
    color: #ff74ad;
    font-size: 0.68rem;
    font-weight: 700;
}

.player-page-workspace .playlist-item:hover {
    transform: translateX(2px);
    border-color: rgba(255, 61, 141, 0.25);
}

.playlist-favorite-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.playlist-favorite-btn:hover {
    color: #ff74ad;
    background: rgba(255, 61, 141, 0.12);
    transform: scale(1.06);
}

.playlist-favorite-btn.active {
    color: #fff;
    background: #ff3d8d;
}

.playlist-favorite-btn svg {
    width: 18px;
    height: 18px;
}

.playlist-favorite-btn.active svg {
    fill: currentColor;
}

.toast {
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    border-color: rgba(255, 61, 141, 0.35);
    background: rgba(24, 22, 29, 0.94);
}

@media (max-width: 900px) {
    .app-container {
        padding: 0 1rem;
    }

    .main-header {
        flex-wrap: wrap;
    }

    .main-header .header-left {
        flex: 1 1 auto;
    }

    .main-header .header-right {
        flex: 1 0 100%;
        flex-direction: row;
        align-items: center;
    }

    .main-header .search-box {
        flex: 1 1 auto;
        width: auto;
    }

    .main-header .btn-icon span {
        display: none;
    }

    .main-header .btn-icon {
        width: 44px;
        min-width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    .main-header .header-left {
        justify-content: flex-start;
    }

    .live-counter {
        margin-left: auto;
        max-width: 46vw;
    }

    .live-counter #counter-text {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .main-content {
        padding-top: 1.5rem;
    }

    .country-filters-container,
    .category-tabs-container {
        width: 100%;
        align-self: stretch;
    }

    .rooms-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .card-info {
        padding: 0.75rem;
    }

    .card-info p {
        font-size: 0.72rem;
    }

    .card-actions .play-btn {
        font-size: 0.75rem;
        padding-inline: 0.5rem;
    }

    .card-fav-btn {
        width: 27px;
        height: 27px;
    }

    .card-cat-badge,
    .card-area-badge {
        display: none;
    }

    .player-page-header {
        height: 64px;
        padding: 0.5rem 0.65rem;
    }

    .player-page-header .header-left {
        flex: 1 1 auto;
        min-width: 0;
        gap: 0.55rem;
    }

    .player-page-header .back-btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        padding: 0;
        justify-content: center;
    }

    .player-page-header .back-btn span,
    .player-page-header .favorite-label,
    .player-page-header .viewer-count {
        display: none;
    }

    .player-page-header .player-avatar-img {
        width: 38px;
        height: 38px;
    }

    .player-page-header .current-idol-info p {
        max-width: 28vw;
    }

    .player-page-header .header-right {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 0.45rem;
    }

    .player-favorite-btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        padding: 0;
    }

    .player-page-workspace,
    .player-page-workspace[data-is-mobile="true"] {
        height: calc(100dvh - 64px) !important;
        flex-direction: column !important;
    }

    .player-page-workspace .player-left-panel,
    .player-page-workspace[data-is-mobile="true"] .player-left-panel {
        width: 100% !important;
        height: auto !important;
        padding: 0.45rem !important;
        flex: 0 0 auto !important;
    }

    .player-page-workspace .video-wrapper,
    .player-page-workspace[data-is-mobile="true"] .video-wrapper {
        width: 100% !important;
        height: clamp(300px, 52dvh, 520px) !important;
        min-height: 300px !important;
        aspect-ratio: auto !important;
        border-radius: 12px !important;
    }

    .player-page-workspace .player-actions {
        min-height: 54px;
        padding: 0.45rem 0.1rem 0;
        gap: 0.5rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .player-page-workspace .actions-left,
    .player-page-workspace .actions-right {
        flex: 0 0 auto;
        gap: 0.4rem;
    }

    .player-page-workspace .player-actions .btn-sm {
        min-height: 38px;
        white-space: nowrap;
    }

    .player-page-workspace #vlc-play-link {
        display: none;
    }

    .player-page-workspace .player-right-panel,
    .player-page-workspace[data-is-mobile="true"] .player-right-panel {
        width: 100% !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }

    .player-page-workspace .playlist-header {
        padding: 0.75rem 0.75rem 0.4rem;
        margin: 0;
    }

    .player-page-workspace .playlist-carousel-container {
        padding: 0.3rem 0 0.7rem 0.65rem;
        overflow: hidden !important;
        align-items: stretch;
    }

    .player-page-workspace .sidebar-playlist,
    .player-page-workspace[data-is-mobile="true"] .sidebar-playlist {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 0.65rem 0.25rem 0 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x proximity;
        scroll-padding-left: 0.65rem;
        scrollbar-width: none;
    }

    .player-page-workspace .sidebar-playlist::-webkit-scrollbar {
        display: none;
    }

    .player-page-workspace .playlist-item,
    .player-page-workspace[data-is-mobile="true"] .playlist-item {
        position: relative;
        width: 132px !important;
        min-width: 132px !important;
        min-height: 188px !important;
        height: 100% !important;
        padding: 0.38rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.45rem !important;
        text-align: left !important;
        scroll-snap-align: start;
        overflow: hidden;
    }

    .player-page-workspace .playlist-item-thumb-wrapper,
    .player-page-workspace[data-is-mobile="true"] .playlist-item-thumb-wrapper {
        width: 100% !important;
        height: min(132px, 15.7dvh) !important;
        min-height: 108px;
        border-radius: 11px !important;
        overflow: hidden;
    }

    .player-page-workspace .playlist-item-img,
    .player-page-workspace[data-is-mobile="true"] .playlist-item-img {
        width: 100% !important;
        height: 100% !important;
        border-radius: 11px !important;
        object-fit: cover;
        object-position: center top;
    }

    .player-page-workspace .playlist-item-info,
    .player-page-workspace[data-is-mobile="true"] .playlist-item-info {
        width: 100%;
        align-items: flex-start !important;
        gap: 0.2rem;
    }

    .player-page-workspace .playlist-item-name,
    .player-page-workspace[data-is-mobile="true"] .playlist-item-name {
        width: 100%;
        font-size: 0.78rem !important;
    }

    .player-page-workspace .playlist-item-info::after {
        display: none;
    }

    .playlist-favorite-btn {
        position: absolute;
        top: 0.7rem;
        right: 0.7rem;
        z-index: 4;
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        color: #fff;
        background: rgba(8, 8, 12, 0.68);
        border: 1px solid rgba(255, 255, 255, 0.18);
        backdrop-filter: blur(10px);
        box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28);
    }

    .player-page-workspace .sidebar-load-more-wrapper {
        flex: 0 0 132px;
        width: 132px;
        min-width: 132px;
        display: flex;
        align-items: center;
        padding: 0;
    }
}

@media (max-width: 390px) {
    .rooms-grid {
        gap: 0.55rem;
    }

    .card-info h3 {
        font-size: 0.85rem;
    }

    .card-actions .copy-btn {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 127, 0.4);
}

.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0 0.25rem;
}

.page-transition {
    animation: pageFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-load-more-wrapper {
    padding: 12px 10px;
    width: 100%;
    box-sizing: border-box;
}

.sidebar-load-more-btn {
    width: 100%;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    text-align: center;
}

.sidebar-load-more-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 0, 127, 0.4);
    color: #ffffff;
}
