/* ══════════════════════════════════════════════════════════════════════════
   MOOGLY TV — Ultra-Modern Cinema Player & Channel Page Stylesheet
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Channel Badges ── */
.channel-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.channel-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Stream Health Panel ── */
.stream-health-panel {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    backdrop-filter: blur(10px);
}

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

.health-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.health-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.health-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.health-metric {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 11px;
    color: var(--text-dim);
}

.metric-value {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

/* ── Live Stats Panel ── */
.live-stats-panel {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    backdrop-filter: blur(10px);
}

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

.stats-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.live-indicator-small {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-dot-small {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stat-item {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    background: rgba(0,0,0,0.4);
}

.stat-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Embed Modal Styles ── */
.embed-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.embed-modal-content {
    background: #0f1318;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: 90%;
    max-width: 660px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255,255,255,0.04);
    animation: slideUp 0.25s ease;
}

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

.embed-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.embed-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-heading, inherit);
}

.embed-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.embed-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.embed-modal-body {
    padding: 22px;
}

.embed-option-group {
    margin-bottom: 22px;
}

.embed-option-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.embed-size-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.embed-size-btn {
    background: #141920;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
}

.embed-size-btn:hover {
    background: #1a202a;
    border-color: rgba(255, 255, 255, 0.14);
}

.embed-size-btn.active {
    background: rgba(255, 71, 87, 0.08);
    border-color: #ff4757;
}

.embed-size-btn span {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
}

.embed-size-btn small {
    display: block;
    font-size: 11.5px;
    color: var(--text-dim, #718096);
}

.embed-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.embed-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 14px;
    background: #141920;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.18s ease;
}

.embed-checkbox:hover {
    background: #1a202a;
    border-color: rgba(255, 255, 255, 0.1);
}

.embed-checkbox input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #ff4757;
    cursor: pointer;
}

.embed-checkbox span {
    font-size: 13.5px;
    color: rgba(255,255,255,0.85);
}

.embed-code-container {
    position: relative;
}

.embed-code-output {
    width: 100%;
    height: 100px;
    background: #080b10;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    padding-top: 40px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    color: #00f0ff;
    resize: none;
    line-height: 1.5;
}

.embed-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff4757;
    border: none;
    color: #fff;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
}

.embed-copy-btn:hover {
    background: #ff6b81;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,71,87,0.3);
}

@media (max-width: 600px) {
    .embed-size-options {
        grid-template-columns: 1fr;
    }
    .embed-modal-content {
        width: 95%;
        max-height: 95vh;
    }
}

/* ── Enhanced Player Visual Improvements ── */
.enhanced-player {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 100%);
}

.player-channel-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    margin-top: 20px;
}

.player-channel-logo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.channel-description {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    backdrop-filter: blur(10px);
}

.channel-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #fff;
    padding: 8px 0;
}

.channel-details .prose {
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 12px;
}

.player-keys-panel {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    backdrop-filter: blur(10px);
}

.keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.key-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.key-item kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 12px;
    color: #fff;
    min-width: 32px;
    text-align: center;
}

/* ── Channel Availability Notice ── */
.channel-availability-notice {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    backdrop-filter: blur(10px);
    position: relative;
}

.notice-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.notice-content {
    flex: 1;
}

.notice-content strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.notice-content p {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    margin: 0;
}

.notice-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 20px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.notice-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ── Page Layout & Breadcrumbs ── */
.player-page {
    padding-top: 24px;
    padding-bottom: 60px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb a:hover {
    color: var(--cyan);
}

.breadcrumb .sep {
    color: var(--text-dim);
    font-size: 12px;
}

.breadcrumb .current {
    color: var(--text-white);
    font-weight: 600;
}

/* ── 2-Column Master Layout ── */
.player-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
    width: 100%;
}

.player-main-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Theater Mode Expansion */
.player-layout.theater-mode {
    grid-template-columns: 1fr;
}

.player-layout.theater-mode .channel-drawer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.player-layout.theater-mode .drawer-list {
    max-height: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

/* ── Cinema Video Container ── */
.player-cinema-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #020308;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border-mid);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 35px var(--cyan-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--trans);
}

.player-cinema-wrapper:hover {
    border-color: var(--border-bright);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.95), 0 0 45px var(--cyan-glow);
}

.player-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

/* ── Watermark ── */
.player-watermark {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    user-select: none;
    font-family: var(--font-heading);
    transition: opacity 0.25s ease;
}

/* ── Small Non-blocking Loading Spinner ── */
.player-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(5, 7, 15, 0.85);
    border: 1px solid var(--border-mid);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 18px var(--cyan-subtle);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--r-full);
    padding: 8px 18px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 15;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.spinner-mini {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 240, 255, 0.25);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
    flex-shrink: 0;
}

.spinner-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: 0.2px;
    white-space: nowrap;
}

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

/* ── Big Center Play Button ── */
.player-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.2);
    border: 2px solid var(--cyan);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 35px var(--cyan-glow), inset 0 0 15px rgba(0, 240, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 18;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-big-play svg {
    margin-left: 4px;
}

.player-big-play:hover {
    transform: translate(-50%, -50%) scale(1.12);
    background: var(--cyan);
    color: #03050c;
    box-shadow: 0 0 50px var(--cyan);
}

/* ── Floating Non-blocking Reconnect Badge ── */
.player-reconnect-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(10, 13, 26, 0.94);
    border: 1px solid rgba(245, 166, 35, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--r-full);
    padding: 5px 12px 5px 14px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 25;
    pointer-events: auto;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 15px rgba(245, 166, 35, 0.15);
    animation: fadeInDown 0.25s ease;
}

.reconnect-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
    animation: livePulse 1.5s infinite;
    flex-shrink: 0;
}

.reconnect-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-bright);
    margin: 0;
    white-space: nowrap;
}

.btn-reconnect-action {
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--cyan);
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-reconnect-action:hover {
    background: var(--cyan);
    color: #03050c;
    box-shadow: 0 0 12px var(--cyan-glow);
    transform: scale(1.04);
}

/* ── Premium Lock Overlay ── */
.player-premium-lock {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(18, 23, 45, 0.95) 0%, rgba(3, 5, 12, 0.98) 100%);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    z-index: 30;
}

.player-premium-lock .lock-icon {
    stroke: var(--amber);
    margin-bottom: 16px;
    filter: drop-shadow(0 0 16px var(--amber-glow));
}

.player-premium-lock .lock-badge {
    background: var(--amber-grad);
    color: #03050c;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 14px;
    border-radius: var(--r-full);
    margin-bottom: 12px;
}

.player-premium-lock h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.player-premium-lock p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 440px;
    margin-bottom: 22px;
    line-height: 1.6;
}

/* ── Custom Controls Overlay ── */
.player-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(3, 5, 12, 0.96) 0%, rgba(3, 5, 12, 0.6) 60%, transparent 100%);
    padding: 24px 20px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 20;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.player-cinema-wrapper:hover .player-controls-overlay,
.player-cinema-wrapper.controls-active .player-controls-overlay,
.player-controls-overlay.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.player-cinema-wrapper.controls-hidden .player-controls-overlay {
    opacity: 0 !important;
    transform: translateY(6px) !important;
    pointer-events: none !important;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Control Buttons */
.ctrl-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--trans-fast);
    flex-shrink: 0;
}

.ctrl-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 16px var(--cyan-glow);
    transform: scale(1.08);
}

.ctrl-btn.active {
    color: var(--live);
    border-color: var(--live);
    background: rgba(255, 43, 86, 0.15);
    box-shadow: 0 0 16px var(--live-glow);
}

/* ── Chromecast Button States & Toast ── */
#btn-cast {
    transition: all 0.25s ease;
}

#btn-cast.active,
#btn-cast.cast-connected {
    color: var(--cyan) !important;
    border-color: var(--cyan) !important;
    background: rgba(0, 240, 255, 0.2) !important;
    box-shadow: 0 0 18px var(--cyan-glow) !important;
    animation: castGlow 2s infinite ease-in-out;
}

#btn-cast.cast-connecting {
    color: var(--warning, #ffb800) !important;
    border-color: var(--warning, #ffb800) !important;
    animation: castPulse 1s infinite ease-in-out;
}

@keyframes castGlow {
    0%, 100% { box-shadow: 0 0 10px var(--cyan-glow); }
    50% { box-shadow: 0 0 22px rgba(0, 240, 255, 0.7); }
}

@keyframes castPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.player-cast-toast {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8, 12, 26, 0.95);
    border: 1px solid var(--cyan);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--cyan-glow);
    color: #fff;
    padding: 8px 18px;
    border-radius: var(--r-full, 9999px);
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 70;
    backdrop-filter: blur(14px);
    animation: fadeInDown 0.25s ease;
    white-space: nowrap;
    pointer-events: none;
}

/* Live Indicator in Player */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 43, 86, 0.2);
    border: 1px solid rgba(255, 43, 86, 0.4);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Volume Slider */
.volume-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 70px;
    height: 4px;
    accent-color: var(--cyan);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
    transition: width 0.2s ease;
}

.volume-slider:hover {
    width: 90px;
}

/* Quality Badge in Player */
.quality-badge {
    background: rgba(0, 240, 255, 0.14);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--cyan);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

/* ── Settings Dropdown Menu ── */
.settings-menu-wrapper {
    position: relative;
}

.player-settings-menu {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    width: 260px;
    background: rgba(10, 13, 26, 0.96);
    border: 1px solid var(--border-mid);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 240, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--r-md);
    padding: 14px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
    animation: fadeInDown 0.2s ease;
}

.player-settings-menu.active {
    display: flex !important;
}

.settings-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.btn-close-settings {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-close-settings:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.settings-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cyan);
    margin-bottom: 6px;
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 130px;
    overflow-y: auto;
}

.settings-options-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.settings-opt-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.settings-opt-btn.speed-btn {
    justify-content: center;
    padding: 5px 2px;
}

.settings-opt-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    color: #fff;
}

.settings-opt-btn.active {
    background: rgba(0, 240, 255, 0.16);
    border-color: rgba(0, 240, 255, 0.4);
    color: var(--cyan);
    font-weight: 700;
}

.settings-opt-btn .check-mark {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
}

.settings-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.35);
    color: var(--cyan);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-action-btn:hover {
    background: var(--cyan);
    color: #03050c;
    box-shadow: 0 0 12px var(--cyan-glow);
}

/* ── Channel Header (Below Player) ── */
.player-channel-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px 24px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    backdrop-filter: blur(16px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.channel-logo-container {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: #03050c;
    border: 1px solid var(--border-mid);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-channel-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.channel-info-stack {
    min-width: 0;
}

.player-channel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.player-channel-title h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-channel-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.tag-cat {
    padding: 3px 10px;
    border-radius: var(--r-full);
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--cyan);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.tag-meta, .tag-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ── Description & Shortcuts ── */
.channel-description, .player-keys-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 20px;
    margin-top: 16px;
    backdrop-filter: blur(14px);
}

.channel-description summary, .player-keys-panel summary {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-white);
    cursor: pointer;
    outline: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-description .prose {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.6;
}

.keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.key-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-main);
}

.key-item kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    font-family: monospace;
    font-size: 12px;
    color: var(--cyan);
    font-weight: 700;
}

/* ── Sidebar / Channel Drawer ── */
.channel-drawer {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
    backdrop-filter: blur(16px);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: var(--text-white);
}

.drawer-count {
    background: rgba(0, 240, 255, 0.12);
    color: var(--cyan);
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 800;
}

.drawer-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 650px;
    overflow-y: auto;
    padding-right: 4px;
}

.drawer-list::-webkit-scrollbar {
    width: 4px;
}

.drawer-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
    text-decoration: none;
    color: inherit;
    transition: var(--trans);
}

.drawer-item:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--border-mid);
    transform: translateX(4px);
}

.drawer-thumb-wrapper {
    width: 68px;
    height: 42px;
    border-radius: 8px;
    background: #020308;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
}

.drawer-item-img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.drawer-item-img.fallback-img {
    width: 100%;
    height: 100%;
    background: var(--bg-elevated);
}

.drawer-item-info {
    flex-grow: 1;
    min-width: 0;
}

.drawer-item-name {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-item-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-item-cat {
    color: var(--cyan);
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET & MOBILE PLAYER EXPERIENCE
   Desktop (>1024px): 2-col sidebar layout, hover controls, no changes
   Tablet (768-1024px): 1-col, grid drawer
   Mobile (<768px): full-screen video first, touch controls
   Small phones (<480px): condensed buttons, drawer hidden
══════════════════════════════════════════════════════════════ */

/* ── TABLET: Stack layout, drawer becomes horizontal grid ── */
@media (max-width: 1024px) {
    .player-layout {
        grid-template-columns: 1fr;
    }

    .channel-drawer {
        margin-top: 20px;
    }

    .drawer-list {
        max-height: 420px;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 10px;
    }
}

/* ── MOBILE: Full overhaul for phone screens ── */
@media (max-width: 768px) {

    /* --- PAGE LAYOUT --- */
    .player-page {
        padding-top: 10px;
        padding-bottom: 40px;
        padding-left: 0;
        padding-right: 0;
    }

    /* Remove container side padding so video goes edge-to-edge */
    .player-page.container,
    .container.player-page {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }

    /* Breadcrumb compact */
    .breadcrumb {
        font-size: 11px;
        gap: 5px;
        margin-bottom: 8px;
        padding-left: 12px;
        padding-right: 12px;
        overflow: hidden;
    }
    .breadcrumb a:not(:last-of-type):not(:first-of-type) {
        display: none; /* Hide middle crumbs on mobile, keep Home + current */
    }

    /* --- VIDEO PLAYER CONTAINER --- */
    .player-cinema-wrapper {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        box-shadow: none;
        /* Controls always visible on mobile via CSS, shown/hidden via JS tap */
    }

    /* On mobile, always show controls when the .controls-active class is on */
    .player-cinema-wrapper .player-controls-overlay {
        opacity: 0;
        pointer-events: none;
        transform: translateY(0); /* no vertical shift on mobile – stays at bottom */
        transition: opacity 0.2s ease;
        padding: 48px 10px 12px; /* tall gradient top for visibility */
    }

    .player-cinema-wrapper.controls-active .player-controls-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    /* Gradient behind controls is stronger on mobile */
    .player-controls-overlay {
        background: linear-gradient(to top,
            rgba(3, 5, 12, 0.98) 0%,
            rgba(3, 5, 12, 0.7) 50%,
            transparent 100%);
    }

    /* --- CONTROL ROWS --- */
    .controls-left {
        gap: 6px;
        flex: 1;
    }

    .controls-right {
        gap: 6px;
        flex-shrink: 0;
    }

    /* --- BUTTONS: Large finger-friendly touch targets --- */
    .ctrl-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 50%;
        background: rgba(8, 11, 24, 0.72);
        border: 1.5px solid rgba(255, 255, 255, 0.18);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .ctrl-btn svg {
        width: 21px;
        height: 21px;
    }

    .ctrl-btn:active {
        transform: scale(0.88);
        background: rgba(0, 240, 255, 0.28);
        border-color: rgba(0, 240, 255, 0.7);
        transition: transform 0.1s ease;
    }

    /* --- HIDE DESKTOP-ONLY ITEMS ON MOBILE --- */
    #btn-theater,
    .volume-slider,
    .volume-wrapper .volume-slider {
        display: none !important;
    }

    /* Keep volume button but make it standalone */
    .volume-wrapper {
        gap: 0;
    }

    /* --- LIVE BADGE (compact) --- */
    .live-indicator {
        font-size: 9.5px;
        padding: 2.5px 7px;
        gap: 4px;
        letter-spacing: 0.4px;
        white-space: nowrap;
    }
    .live-dot {
        width: 5px;
        height: 5px;
        min-width: 5px;
    }

    /* --- QUALITY BADGE (compact) --- */
    .quality-badge {
        font-size: 9px;
        padding: 2px 5px;
        letter-spacing: 0.3px;
    }

    /* --- SETTINGS PANEL: Slide-up sheet on mobile --- */
    .player-settings-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 22px 22px 0 0 !important;
        background: rgba(6, 10, 22, 0.99) !important;
        border: 1px solid rgba(0, 240, 255, 0.2) !important;
        border-bottom: none !important;
        box-shadow: 0 -8px 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(0, 240, 255, 0.08) !important;
        padding: 8px 0 env(safe-area-inset-bottom, 24px) !important;
        z-index: 3000 !important;
        animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
    }

    /* Drag handle indicator */
    .settings-menu-header::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(255,255,255,0.2);
        border-radius: 2px;
        margin: 0 auto 16px;
    }

    .settings-menu-header {
        flex-direction: column;
        padding: 16px 20px 10px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        gap: 4px;
        font-size: 16px;
        margin-bottom: 0;
    }

    .settings-menu-header > span {
        align-self: flex-start;
    }

    .btn-close-settings {
        position: absolute;
        right: 16px;
        top: 14px;
        width: 34px;
        height: 34px;
        font-size: 18px;
        background: rgba(255,255,255,0.07);
        border-radius: 50%;
    }

    .settings-section {
        padding: 14px 20px;
    }

    .settings-section-title {
        font-size: 11px;
        margin-bottom: 10px;
    }

    .settings-opt-btn {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 10px;
        min-height: 48px;
    }

    .settings-opt-btn.speed-btn {
        min-height: 44px;
        font-size: 13.5px;
        padding: 10px 6px;
    }

    .settings-options-row {
        gap: 8px;
        flex-wrap: wrap;
    }

    .settings-action-btn {
        min-height: 48px;
        font-size: 14px;
        border-radius: 12px;
        padding: 12px 16px;
    }

    @keyframes sheetSlideUp {
        from { transform: translateY(100%); opacity: 0.5; }
        to { transform: translateY(0); opacity: 1; }
    }

    /* --- BIG CENTER PLAY BUTTON --- */
    .player-big-play {
        width: 72px;
        height: 72px;
    }
    .player-big-play svg {
        width: 36px;
        height: 36px;
    }

    /* --- CHANNEL INFO HEADER (below player) --- */
    .player-channel-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 14px;
        gap: 12px;
        margin-top: 10px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .header-left {
        width: 100%;
        align-items: flex-start;
        gap: 12px;
    }

    .channel-logo-container {
        width: 52px;
        height: 52px;
        min-width: 52px;
        border-radius: 12px;
        padding: 6px;
        flex-shrink: 0;
    }

    .channel-info-stack {
        min-width: 0;
        flex: 1;
    }

    .player-channel-title {
        align-items: flex-start;
        gap: 8px;
    }

    .player-channel-title h1 {
        font-size: 19px;
        white-space: normal; /* Allow wrapping */
        overflow: visible;
        text-overflow: unset;
    }

    .player-channel-tags {
        gap: 6px;
        margin-top: 5px;
    }

    .tag-meta, .tag-views {
        font-size: 11.5px;
    }

    /* Action buttons row — full width, stacked */
    .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .header-actions .btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
        border-radius: 10px;
    }

    /* --- PLAYER LAYOUT STACK --- */
    .player-layout {
        gap: 10px;
    }

    /* --- RELATED CHANNELS DRAWER (mobile grid) --- */
    .channel-drawer {
        margin-top: 10px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 16px 12px;
    }

    .drawer-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        max-height: 400px;
        overflow-y: auto;
    }

    .drawer-item {
        padding: 8px;
        gap: 8px;
        flex-direction: column;
        align-items: flex-start;
    }

    .drawer-thumb-wrapper {
        width: 100%;
        height: 52px;
        border-radius: 8px;
    }

    .drawer-item-info {
        width: 100%;
    }

    .drawer-item-name {
        font-size: 12px;
    }

    .drawer-item-meta {
        font-size: 10.5px;
        gap: 5px;
    }

    /* --- DESCRIPTION & SHORTCUTS --- */
    .channel-description, .player-keys-panel {
        margin-top: 10px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 14px;
    }

    .keys-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* ── SMALL PHONES (<480px): Tighten further ── */
@media (max-width: 480px) {

    .ctrl-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

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

    /* Hide PiP on tiny screens — Cast + Settings + Fullscreen are most important */
    #btn-pip {
        display: none !important;
    }

    /* Hide HD badge, show in settings */
    .quality-badge {
        display: none !important;
    }

    .player-channel-title h1 {
        font-size: 17px;
    }

    .drawer-list {
        grid-template-columns: 1fr;
    }

    .drawer-item {
        flex-direction: row;
        align-items: center;
    }

    .drawer-thumb-wrapper {
        width: 64px;
        height: 40px;
    }
}

/* ── VERY SMALL (<360px): Minimum viable ── */
@media (max-width: 360px) {
    .ctrl-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .ctrl-btn svg {
        width: 17px;
        height: 17px;
    }

    .controls-left,
    .controls-right {
        gap: 4px;
    }

    .live-indicator {
        display: none; /* Free up space on ultra-narrow */
    }

    .player-channel-title h1 {
        font-size: 16px;
    }
}

    .player-layout {
        grid-template-columns: 1fr;
    }

    .channel-drawer {
        margin-top: 24px;
    }

    .drawer-list {
        max-height: 400px;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 10px;
    }
}

/* ── Responsive Breakpoints (Computer vs Mobile Optimization) ── */
@media (max-width: 1024px) {
    .player-layout {
        grid-template-columns: 1fr;
    }

    .channel-drawer {
        margin-top: 24px;
    }

    .drawer-list {
        max-height: 420px;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 768px) {
    /* Player cinema container */
    .player-cinema-wrapper {
        border-radius: var(--r-sm, 12px);
    }

    /* Controls Overlay for Mobile */
    .player-controls-overlay {
        padding: 16px 12px 10px;
        gap: 8px;
    }

    .controls-left, .controls-right {
        gap: 8px;
    }

    /* Larger, finger-friendly touch targets */
    .ctrl-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        border-radius: 50%;
        background: rgba(10, 14, 28, 0.75);
        border: 1px solid rgba(255, 255, 255, 0.16);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .ctrl-btn svg {
        width: 20px;
        height: 20px;
    }

    .ctrl-btn:active {
        transform: scale(0.92);
        background: rgba(0, 240, 255, 0.25);
        border-color: var(--cyan);
    }

    /* Hide desktop-only controls on mobile screens */
    #btn-theater {
        display: none !important;
    }

    .volume-slider {
        display: none !important;
    }

    /* Live indicator on mobile */
    .live-indicator {
        font-size: 10px;
        padding: 3px 8px;
        gap: 5px;
        letter-spacing: 0.5px;
    }

    .live-dot {
        width: 5px;
        height: 5px;
    }

    /* Quality badge on mobile */
    .quality-badge {
        font-size: 10px;
        padding: 2.5px 6px;
    }

    /* Settings Menu on Mobile (Touch-friendly Bottom Sheet) */
    .player-settings-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        border-radius: 20px 20px 0 0 !important;
        background: rgba(8, 12, 24, 0.98) !important;
        border: 1px solid rgba(0, 240, 255, 0.25) !important;
        border-bottom: none !important;
        box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.9) !important;
        padding: 20px 20px 32px !important;
        z-index: 2000 !important;
        animation: mobileSheetUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    @keyframes mobileSheetUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .settings-menu-header {
        font-size: 15px;
        padding-bottom: 12px;
        margin-bottom: 10px;
    }

    .btn-close-settings {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .settings-opt-btn {
        min-height: 40px;
        font-size: 13.5px;
        padding: 8px 14px;
    }

    .settings-options-row {
        gap: 8px;
    }

    .settings-opt-btn.speed-btn {
        min-height: 38px;
        font-size: 13px;
    }

    /* Big Center Play Button on mobile */
    .player-big-play {
        width: 68px;
        height: 68px;
    }
    .player-big-play svg {
        width: 34px;
        height: 34px;
    }

    /* Channel Header & Tags on mobile */
    .player-channel-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 14px;
        gap: 14px;
    }

    .header-left {
        width: 100%;
        gap: 12px;
    }

    .channel-logo-container {
        width: 48px;
        height: 48px;
        min-width: 48px;
        border-radius: 12px;
    }

    .player-channel-title h1 {
        font-size: 18px;
        line-height: 1.25;
    }

    .player-channel-tags {
        gap: 6px;
        font-size: 11px;
    }

    .header-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .header-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 10px 14px;
        font-size: 13px;
        min-height: 42px;
    }

    .drawer-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    /* Compact Phone Screen Sizing */
    .player-controls-overlay {
        padding: 12px 10px 8px;
        gap: 6px;
    }

    .controls-left, .controls-right {
        gap: 6px;
    }

    .ctrl-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
    }

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

    /* On narrow phones, hide PiP from bottom row so Chromecast, Settings and Fullscreen are prominent */
    #btn-pip {
        display: none !important;
    }

    .quality-badge {
        display: none !important; /* available in settings menu */
    }
}

@media (max-width: 360px) {
    .ctrl-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
    }
    .ctrl-btn svg {
        width: 17px;
        height: 17px;
    }
}

/* ── Chromecast Upgrade & Help Modals ── */
.player-cast-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 12, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

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

.player-cast-modal-card {
    background: rgba(10, 14, 30, 0.98);
    border: 1px solid rgba(0, 240, 255, 0.35);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(0, 240, 255, 0.25);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 28px 24px;
    text-align: center;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-cast-modal-backdrop.active .player-cast-modal-card {
    transform: translateY(0) scale(1);
}

.player-cast-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.35);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 26px;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.25);
}

.player-cast-modal-title {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.player-cast-modal-text {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 22px;
}

.player-cast-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.player-cast-modal-actions .btn {
    flex: 1;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 10px;
}
