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

:root {
    --pinguino-orange: #ff8800;
    --pinguino-orange-dark: #cc6d00;
    --bg-dark: #0d1b2a;
    --bg-darker: #050d17;
    --bg-controls: rgba(5, 13, 23, 0.92);
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --progress-bg: #333;
    --progress-buffer: #555;
    --hover-bg: rgba(255, 136, 0, 0.15);
    --border-color: #1f3a52;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-darker);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
}

.menu-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-dark); border-bottom: 1px solid var(--border-color);
    padding: 6px 16px; height: 40px; flex-shrink: 0; z-index: 100;
}

.menu-logo { font-weight: 700; font-size: 14px; color: var(--pinguino-orange); letter-spacing: 0.3px; }
.menu-items { display: flex; gap: 4px; }
.menu-item {
    padding: 5px 12px; font-size: 13px; cursor: pointer; border-radius: 4px; transition: background 0.2s;
}
.menu-item:hover { background: var(--hover-bg); color: var(--pinguino-orange); }

.player-wrapper {
    flex: 1; position: relative; background: #000;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}

.drop-zone {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 10;
    background: var(--bg-darker); transition: opacity 0.3s;
}
.drop-zone.hidden { opacity: 0; pointer-events: none; }
.drop-zone.drag-over { background: rgba(255, 136, 0, 0.1); border: 3px dashed var(--pinguino-orange); }
.drop-icon { font-size: 80px; margin-bottom: 16px; animation: float 3s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.drop-zone p { font-size: 18px; }
.drop-sub { font-size: 13px !important; color: var(--text-secondary) !important; margin-top: 6px; }

#videoPlayer, #pipVideo { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }

#pipVideo {
    position: absolute; width: 480px; height: 270px; background: #000;
    border: 3px solid var(--pinguino-orange); border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 136, 0, 0.3);
    z-index: 25; display: none; transition: all 0.4s ease;
}
#pipVideo.active { display: block; animation: pipAppear 0.5s ease; }
@keyframes pipAppear { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }
#pipVideo.pos-bottom-right { bottom: 80px; right: 20px; }
#pipVideo.pos-bottom-left { bottom: 80px; left: 20px; }
#pipVideo.pos-top-right { top: 20px; right: 20px; }
#pipVideo.pos-top-left { top: 20px; left: 20px; }
#pipVideo.size-small { width: 320px; height: 180px; }
#pipVideo.size-medium { width: 480px; height: 270px; }
#pipVideo.size-large { width: 640px; height: 360px; }

#videoPlayer::cue {
    color: var(--sub-color, #ffffff); background-color: var(--sub-bg, rgba(0, 0, 0, 0.75));
    font-size: var(--sub-size, 1.2em); font-family: var(--sub-font, 'Segoe UI', sans-serif);
    padding: 4px 8px; border-radius: 4px; text-shadow: var(--sub-shadow, 1px 1px 3px rgba(0,0,0,0.9));
    white-space: pre-wrap;
}

.loading-overlay {
    position: absolute; inset: 0; background: rgba(0, 0, 0, 0.85);
    display: none; align-items: center; justify-content: center; flex-direction: column; z-index: 15;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
    width: 60px; height: 60px; border: 4px solid #333; border-top-color: var(--pinguino-orange);
    border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { color: var(--pinguino-orange); font-size: 15px; font-weight: 600; }

.play-overlay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0);
    font-size: 72px; color: rgba(255, 255, 255, 0.8); pointer-events: none; z-index: 5;
    transition: transform 0.15s ease-out, opacity 0.3s; opacity: 0; text-shadow: 0 0 20px rgba(0,0,0,0.7);
}
.play-overlay.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }

.crossfade-indicator {
    position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
    background: var(--pinguino-orange); color: #000; padding: 6px 16px; border-radius: 20px;
    font-size: 13px; font-weight: 700; z-index: 30; display: none; animation: pulse 2s ease-in-out infinite;
}
.crossfade-indicator.show { display: block; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 136, 0, 0.5); }
    50% { box-shadow: 0 4px 25px rgba(255, 136, 0, 0.9); }
}

.controls {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, var(--bg-controls));
    padding: 40px 12px 10px; z-index: 20; opacity: 1; transition: opacity 0.3s;
}
.controls.auto-hide { opacity: 0; }

.progress-container {
    position: relative; height: 6px; background: var(--progress-bg);
    border-radius: 3px; cursor: pointer; margin-bottom: 8px; transition: height 0.15s;
}
.progress-container:hover { height: 10px; }
.progress-buffered {
    position: absolute; top: 0; left: 0; height: 100%;
    background: var(--progress-buffer); border-radius: 3px; width: 0%;
}
.progress-bar {
    position: absolute; top: 0; left: 0; height: 100%;
    background: var(--pinguino-orange); border-radius: 3px; width: 0%; z-index: 2;
}
.progress-thumb {
    position: absolute; top: 50%; left: 0%; width: 14px; height: 14px;
    background: var(--pinguino-orange); border-radius: 50%;
    transform: translate(-50%, -50%) scale(0); z-index: 3; transition: transform 0.15s;
}
.progress-container:hover .progress-thumb { transform: translate(-50%, -50%) scale(1); }
.progress-tooltip {
    position: absolute; top: -30px; left: 0; background: rgba(0, 0, 0, 0.85);
    color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 4px;
    pointer-events: none; opacity: 0; transition: opacity 0.15s; z-index: 10; white-space: nowrap;
}
.progress-container:hover .progress-tooltip { opacity: 1; }

.controls-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.controls-left, .controls-right { display: flex; align-items: center; gap: 4px; }

.ctrl-btn {
    background: none; border: none; color: var(--text-primary); font-size: 18px;
    cursor: pointer; padding: 6px 8px; border-radius: 4px; transition: background 0.2s, color 0.2s; line-height: 1;
}
.ctrl-btn:hover { background: var(--hover-bg); color: var(--pinguino-orange); }

.volume-group { display: flex; align-items: center; gap: 4px; }
.volume-slider {
    -webkit-appearance: none; appearance: none; width: 80px; height: 4px;
    background: var(--progress-bg); border-radius: 2px; outline: none; cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px;
    background: var(--pinguino-orange); border-radius: 50%; cursor: pointer;
}
.volume-slider::-moz-range-thumb {
    width: 12px; height: 12px; background: var(--pinguino-orange);
    border-radius: 50%; border: none; cursor: pointer;
}
.volume-value { font-size: 11px; color: var(--text-secondary); min-width: 32px; text-align: center; }
.time-display { font-size: 12px; color: var(--text-secondary); margin-left: 8px; font-variant-numeric: tabular-nums; }

.speed-group { position: relative; }
.speed-btn { font-size: 13px !important; font-weight: 600; min-width: 42px; }
.speed-menu {
    position: absolute; bottom: 100%; right: 0; background: var(--bg-dark);
    border: 1px solid var(--border-color); border-radius: 6px; padding: 4px 0;
    display: none; min-width: 90px; box-shadow: 0 -4px 20px rgba(0,0,0,0.5); z-index: 50;
}
.speed-menu.show { display: block; }
.speed-option { padding: 6px 14px; font-size: 13px; cursor: pointer; transition: background 0.15s; }
.speed-option:hover { background: var(--hover-bg); color: var(--pinguino-orange); }
.speed-option.active { color: var(--pinguino-orange); font-weight: 700; }

.playlist-panel {
    position: fixed; top: 40px; right: -320px; width: 300px; height: calc(100vh - 40px);
    background: var(--bg-dark); border-left: 1px solid var(--border-color);
    z-index: 90; transition: right 0.3s ease; display: flex; flex-direction: column;
}
.playlist-panel.open { right: 0; }
.playlist-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--border-color);
}
.playlist-header h3 { font-size: 14px; color: var(--pinguino-orange); }
.playlist-items { list-style: none; overflow-y: auto; flex: 1; padding: 6px 0; }
.playlist-items li {
    padding: 10px 14px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--border-color);
    transition: background 0.15s; display: flex; align-items: center; gap: 8px;
}
.playlist-items li:hover { background: var(--hover-bg); }
.playlist-items li.active { color: var(--pinguino-orange); font-weight: 600; background: rgba(255, 136, 0, 0.08); }
.playlist-items li .track-num { color: var(--text-secondary); font-size: 11px; min-width: 20px; }
.playlist-empty { color: var(--text-secondary) !important; justify-content: center; font-style: italic; }

.playlist-toggle-btn {
    position: fixed; bottom: 80px; right: 16px; background: var(--bg-dark);
    border: 1px solid var(--border-color); color: var(--text-primary); font-size: 20px;
    padding: 8px 10px; border-radius: 6px; cursor: pointer; z-index: 80;
}
.playlist-toggle-btn:hover { background: var(--hover-bg); }

.modal {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
    display: none; align-items: center; justify-content: center; z-index: 200;
}
.modal.show { display: flex; }
.modal-content {
    background: var(--bg-dark); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 28px 32px; max-width: 420px; width: 90%; text-align: center;
}
.modal-content h2 { color: var(--pinguino-orange); margin-bottom: 10px; }
.modal-content p { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.modal-content ul { text-align: left; list-style: none; margin: 10px 0 18px; }
.modal-content li { font-size: 13px; padding: 3px 0; }
kbd {
    background: #333; padding: 2px 7px; border-radius: 3px;
    font-size: 12px; border: 1px solid #555; font-family: monospace;
}
.modal-close {
    background: var(--pinguino-orange); color: #000; border: none;
    padding: 8px 24px; border-radius: 5px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.modal-close:hover { background: var(--pinguino-orange-dark); }

.player-wrapper:fullscreen { background: #000; }
.player-wrapper:fullscreen .menu-bar { display: none; }

@media (max-width: 600px) {
    .menu-items { gap: 0; }
    .menu-item { padding: 5px 6px; font-size: 11px; }
    .volume-slider { width: 50px; }
    .volume-value { display: none; }
    .time-display { font-size: 11px; }
    #pipVideo.size-large { width: 280px; height: 158px; }
    #pipVideo.size-medium { width: 220px; height: 124px; }
    #pipVideo.size-small { width: 160px; height: 90px; }
}

.browser-modal {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.9);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; overflow-y: auto; padding: 20px;
}
.browser-modal.show { display: flex; }
.browser-modal-content {
    background: var(--bg-dark); border: 2px solid var(--pinguino-orange);
    border-radius: 12px; padding: 30px; max-width: 700px; width: 100%; max-height: 90vh; overflow-y: auto;
}
.browser-icon { font-size: 60px; text-align: center; margin-bottom: 16px; }
.browser-modal-content h2 { color: var(--pinguino-orange); text-align: center; margin-bottom: 12px; font-size: 20px; }
.warning-text {
    background: rgba(255, 136, 0, 0.1); border: 1px solid var(--pinguino-orange);
    border-radius: 6px; padding: 14px; text-align: center; margin-bottom: 24px; font-size: 14px; line-height: 1.6;
}
.browser-options h3 { color: var(--text-primary); margin-bottom: 16px; font-size: 16px; }
.option-box {
    display: flex; gap: 16px; background: var(--bg-darker);
    border: 1px solid var(--border-color); border-radius: 8px; padding: 16px; margin-bottom: 16px;
}
.option-number {
    background: var(--pinguino-orange); color: #000; width: 32px; height: 32px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.option-content { flex: 1; }
.option-content strong { color: var(--pinguino-orange); font-size: 15px; display: block; margin-bottom: 6px; }
.option-content p { color: var(--text-secondary); font-size: 13px; margin-bottom: 10px; }
.btn-primary, .btn-secondary {
    border: none; padding: 8px 16px; border-radius: 5px; font-size: 13px;
    font-weight: 600; cursor: pointer; transition: all 0.2s; margin-right: 8px; margin-top: 6px;
}
.btn-primary { background: var(--pinguino-orange); color: #000; }
.btn-primary:hover { background: var(--pinguino-orange-dark); }
.btn-secondary { background: var(--border-color); color: var(--text-primary); }
.btn-secondary:hover { background: #2a4a62; }
.firefox-steps { background: rgba(0, 0, 0, 0.3); border-radius: 4px; padding: 10px 14px; margin: 10px 0; font-size: 12px; line-height: 1.8; }
.firefox-steps li { margin-bottom: 4px; }
.firefox-steps code { background: #333; padding: 2px 6px; border-radius: 3px; font-family: 'Courier New', monospace; color: var(--pinguino-orange); }
.dont-show-again { display: block; text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.dont-show-again input { margin-right: 6px; cursor: pointer; }

@media (max-width: 600px) {
    .browser-modal-content { padding: 20px; }
    .option-box { flex-direction: column; }
    .option-number { align-self: flex-start; }
}

.subtitle-settings-content { text-align: left; max-width: 450px; }
.setting-group { margin-bottom: 18px; }
.setting-group label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text-primary); font-weight: 600; }
.setting-group select {
    width: 100%; padding: 8px 10px; background: var(--bg-darker);
    border: 1px solid var(--border-color); color: var(--text-primary);
    border-radius: 6px; font-size: 14px; cursor: pointer; outline: none;
}
.setting-group select:focus { border-color: var(--pinguino-orange); }
.color-options { display: flex; gap: 10px; flex-wrap: wrap; }
.color-btn {
    width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent;
    cursor: pointer; transition: transform 0.2s, border-color 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.color-btn:hover { transform: scale(1.15); }
.color-btn.active { border-color: var(--pinguino-orange); box-shadow: 0 0 10px var(--pinguino-orange); }
.setting-group input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--pinguino-orange); cursor: pointer; }

.crossfade-settings-content { text-align: left; max-width: 800px; width: 95%; max-height: 90vh; overflow-y: auto; }
.crossfade-description {
    background: rgba(255, 136, 0, 0.08); border-left: 3px solid var(--pinguino-orange);
    padding: 10px 14px; border-radius: 4px; font-size: 13px; line-height: 1.5; margin-bottom: 20px;
}
.crossfade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.crossfade-col { background: var(--bg-darker); border: 1px solid var(--border-color); border-radius: 8px; padding: 16px; }
.col-title { color: var(--pinguino-orange); font-size: 15px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.crossfade-col .setting-group { margin-bottom: 14px; }
.crossfade-col .setting-group:last-child { margin-bottom: 0; }
.setting-hint { font-size: 11px; color: var(--text-secondary); margin-top: 6px; font-style: italic; line-height: 1.4; }
.crossfade-preview {
    position: relative; background: #000; border: 2px solid var(--border-color);
    border-radius: 8px; height: 160px; margin-top: 10px; overflow: hidden;
}
.preview-main {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: var(--pinguino-orange); font-weight: 600; font-size: 14px;
    background: linear-gradient(135deg, #0d1b2a, #050d17);
}
.preview-pip {
    position: absolute; bottom: 10px; right: 10px; width: 120px; height: 68px;
    background: linear-gradient(135deg, #1f3a52, #0d1b2a); border: 2px solid var(--pinguino-orange);
    border-radius: 4px; display: flex; align-items: center; justify-content: center;
    color: var(--pinguino-orange); font-size: 10px; font-weight: 600; box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

@media (max-width: 700px) {
    .crossfade-grid { grid-template-columns: 1fr; }
    .crossfade-settings-content { max-width: 95%; }
}

/* ============================================
   TV EN VIVO - ESTILOS
============================================ */
.tv-sidebar {
    position: absolute; left: 0; top: 0; bottom: 0; width: 300px;
    background: var(--bg-dark); border-right: 2px solid var(--pinguino-orange);
    z-index: 40; display: flex; flex-direction: column; box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
}
.tv-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--bg-darker); border-bottom: 1px solid var(--border-color);
}
.tv-header h3 { color: var(--pinguino-orange); font-size: 15px; margin: 0; }
.tv-close-btn { font-size: 20px !important; padding: 2px 8px !important; }
.tv-filters {
    padding: 12px; border-bottom: 1px solid var(--border-color);
    display: flex; flex-direction: column; gap: 10px;
}
.tv-filter-group { display: flex; flex-direction: column; gap: 4px; }
.tv-filter-group label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.tv-filter-group select {
    width: 100%; padding: 8px; background: var(--bg-darker);
    border: 1px solid var(--border-color); color: var(--text-primary);
    border-radius: 4px; font-size: 13px; cursor: pointer; outline: none;
}
.tv-filter-group select:focus { border-color: var(--pinguino-orange); }
.tv-nav-controls {
    display: flex; gap: 6px; padding: 0 12px 10px; align-items: center;
}
.nav-btn {
    padding: 8px 12px !important; font-size: 16px !important; min-width: 40px;
}
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tv-search { padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
.tv-search input {
    width: 100%; padding: 8px; background: var(--bg-darker);
    border: 1px solid var(--border-color); color: var(--text-primary);
    border-radius: 4px; outline: none; font-size: 13px;
}
.tv-search input:focus { border-color: var(--pinguino-orange); }
.tv-channels { flex: 1; overflow-y: auto; list-style: none; padding: 0; margin: 0; }
.tv-channel-item {
    padding: 10px 12px; border-bottom: 1px solid var(--border-color);
    cursor: pointer; display: flex; align-items: center; gap: 10px; transition: background 0.2s;
}
.tv-channel-item:hover { background: var(--hover-bg); }
.tv-channel-item.active { background: rgba(255, 136, 0, 0.15); border-left: 3px solid var(--pinguino-orange); }
.fav-btn {
    background: none; border: none; font-size: 18px;
    cursor: pointer; padding: 4px; opacity: 0.3; transition: all 0.2s; flex-shrink: 0;
}
.fav-btn:hover { opacity: 1; transform: scale(1.2); }
.fav-btn.active { opacity: 1; filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.8)); }
.tv-channel-logo {
    width: 36px; height: 36px; object-fit: contain; background: #000;
    border-radius: 4px; flex-shrink: 0;
}
.tv-channel-name { font-size: 13px; font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-empty { padding: 30px 20px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.tv-custom-url {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-darker);
}
.custom-url-row { display: flex; gap: 6px; }
.custom-number-input {
    width: 50px; padding: 8px; background: var(--bg-dark);
    border: 1px solid var(--border-color); color: var(--pinguino-orange);
    border-radius: 4px; font-size: 13px; font-weight: 700; text-align: center; outline: none;
}
.custom-name-input {
    flex: 1; padding: 8px; background: var(--bg-dark);
    border: 1px solid var(--border-color); color: var(--text-primary);
    border-radius: 4px; font-size: 13px; outline: none;
}
.custom-url-input {
    flex: 1; padding: 8px; background: var(--bg-dark);
    border: 1px solid var(--border-color); color: var(--text-primary);
    border-radius: 4px; font-size: 12px; outline: none;
}
.custom-number-input:focus, .custom-name-input:focus, .custom-url-input:focus { border-color: var(--pinguino-orange); }
.custom-hint { font-size: 10px; color: var(--text-secondary); text-align: center; font-style: italic; }
.tv-btn {
    background: var(--pinguino-orange); color: #000; border: none;
    padding: 8px 12px; border-radius: 4px; cursor: pointer;
    font-weight: 600; font-size: 12px; white-space: nowrap; transition: background 0.2s;
}
.tv-btn:hover { background: var(--pinguino-orange-dark); }

.player-wrapper.tv-active .drop-zone { display: none !important; }
.player-wrapper.tv-active #videoPlayer,
.player-wrapper.tv-active #pipVideo { width: calc(100% - 300px); margin-left: 300px; background: #000 !important; }
.player-wrapper.tv-active .controls { left: 300px; width: calc(100% - 300px); }
.player-wrapper.tv-active .playlist-toggle-btn { display: none !important; }

@media (max-width: 768px) {
    .tv-sidebar, .movies-sidebar {
        width: 100%; height: 50%; bottom: auto;
        border-right: none; border-bottom: 2px solid var(--pinguino-orange);
    }
    .player-wrapper.tv-active .drop-zone { display: none !important; }
    .player-wrapper.tv-active #videoPlayer,
    .player-wrapper.tv-active #pipVideo,
    .player-wrapper.tv-active .controls {
        left: 0; width: 100%; margin-left: 0; top: 50%; height: 50%;
    }
}

/* ============================================
   ESTILOS CATÁLOGO DE PELÍCULAS (PAGINACIÓN + TMDB)
============================================ */
.movies-sidebar {
    position: absolute; left: 0; top: 0; bottom: 0; width: 340px;
    background: var(--bg-dark); border-right: 2px solid var(--pinguino-orange);
    z-index: 40; display: flex; flex-direction: column; box-shadow: 4px 0 20px rgba(0,0,0,0.5);
}

.movies-counter {
    padding: 8px 12px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
    flex-shrink: 0;
}

.movies-grid {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
    width: 100%;
}

.movies-grid::-webkit-scrollbar { width: 6px; }
.movies-grid::-webkit-scrollbar-track { background: var(--bg-darker); }
.movies-grid::-webkit-scrollbar-thumb { background: var(--pinguino-orange); border-radius: 3px; }

.movie-card {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}
.movie-card:hover {
    transform: translateY(-3px);
    border-color: var(--pinguino-orange);
    box-shadow: 0 4px 12px rgba(255, 136, 0, 0.2);
}

.movie-card-poster,
.movie-card-placeholder {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: linear-gradient(135deg, #1a2a3a, #0d1b2a);
    display: block;
    flex-shrink: 0;
}

.movie-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--pinguino-orange);
}

.movie-card-info {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.movie-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.movie-card-year {
    font-size: 10px;
    color: var(--pinguino-orange);
    margin-top: 4px;
}

/* BOTONES DE PAGINACIÓN */
.movies-pagination {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-darker);
}

.pagination-btn {
    flex: 1;
    padding: 10px 8px;
    background: var(--pinguino-orange);
    color: #000;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}
.pagination-btn:hover:not(:disabled) {
    background: var(--pinguino-orange-dark);
}
.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   MODAL DE DETALLES (CON SINOPSIS Y ACTORES)
============================================ */
.movie-modal-content {
    max-width: 650px; width: 92%; padding: 0; overflow-y: auto; overflow-x: hidden;
    position: relative; text-align: left; border: 1px solid var(--pinguino-orange);
    max-height: 90vh;
}
.movie-backdrop {
    width: 100%; height: 160px; background-size: cover;
    background-position: center; position: relative; filter: brightness(0.6);
    background-color: var(--bg-darker);
}
.movie-modal-close {
    position: absolute; top: 10px; right: 10px; z-index: 10;
    background: rgba(0,0,0,0.7); border-radius: 50%; color: #fff; width: 32px; height: 32px;
}
.movie-modal-body {
    display: flex; gap: 20px; padding: 20px; margin-top: -50px; position: relative; z-index: 5;
}
.movie-modal-poster {
    width: 130px; height: 195px; object-fit: cover; border-radius: 8px;
    border: 2px solid var(--pinguino-orange); box-shadow: 0 4px 15px rgba(0,0,0,0.8); flex-shrink: 0;
    background: var(--bg-darker);
}
.movie-modal-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.movie-modal-info h2 { font-size: 20px; color: #fff; margin-bottom: 6px; word-wrap: break-word; }
.movie-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.rating-badge { background: var(--pinguino-orange); color: #000; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.type-badge { background: var(--border-color); color: var(--text-primary); padding: 2px 6px; border-radius: 4px; text-transform: uppercase; font-size: 10px; }
.movie-genres { font-size: 11px; color: var(--pinguino-orange); margin-bottom: 10px; font-weight: 600; }
.movie-overview {
    font-size: 12px; color: var(--text-secondary); line-height: 1.5;
    max-height: 140px; overflow-y: auto; margin-bottom: 14px;
}

/* SECCIÓN DE ACTORES */
.cast-section { margin-top: 4px; margin-bottom: 14px; }
.cast-section h3 {
    font-size: 13px; color: var(--pinguino-orange); margin-bottom: 8px;
}
.cast-list {
    display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px;
}
.cast-list::-webkit-scrollbar { height: 4px; }
.cast-list::-webkit-scrollbar-track { background: var(--bg-darker); }
.cast-list::-webkit-scrollbar-thumb { background: var(--pinguino-orange); border-radius: 2px; }
.cast-item {
    min-width: 80px; max-width: 80px; text-align: center; flex-shrink: 0;
}
.cast-item img {
    width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border-color); background: var(--bg-darker);
    display: block; margin: 0 auto 4px;
}
.cast-avatar-fallback {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--bg-darker); border: 2px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin: 0 auto 4px;
}
.cast-name {
    font-size: 11px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cast-character {
    font-size: 10px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.movie-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 600px) {
    .movies-sidebar { width: 100%; height: 50%; bottom: auto; }
    .movies-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px; }
    .movie-modal-body { flex-direction: column; align-items: center; margin-top: 0; }
    .movie-modal-poster { width: 110px; height: 165px; }
    .movie-backdrop { height: 100px; }
}
/* ============================================
   REPRODUCTOR DE PELÍCULAS FULLSCREEN (NUEVO)
============================================ */
#contenedor-reproductor {
    position: absolute;
    inset: 0;
    z-index: 60;
    background: #000;
}

.server-select-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1b2a, #050d17);
}

.server-select-content {
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.server-select-content h2 {
    color: #fff;
    font-size: 26px;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.server-select-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.server-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.server-btn {
    background: var(--pinguino-orange);
    color: #000;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.server-btn:hover {
    background: var(--pinguino-orange-dark);
    transform: translateY(-2px);
}

.no-servers {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 20px 0;
}

.server-cancel-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.server-cancel-btn:hover {
    color: var(--text-primary);
    border-color: var(--pinguino-orange);
}

#iframe-reproductor {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

.floating-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 70;
}

.floating-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(5, 13, 23, 0.8);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.floating-btn:hover {
    background: var(--pinguino-orange);
    color: #000;
}
/* ============================================
   MANUAL DE USO (MODAL ACERCA CON PESTAÑAS)
============================================ */
.about-modal-content {
    max-width: 620px;
    width: 92%;
    text-align: center;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.about-subtitle {
    margin-bottom: 16px;
    font-size: 13px;
}

.help-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 14px;
}
.help-tab-btn {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.help-tab-btn:hover { color: var(--pinguino-orange); border-color: var(--pinguino-orange); }
.help-tab-btn.active {
    background: var(--pinguino-orange);
    color: #000;
    border-color: var(--pinguino-orange);
}

.help-tab-content {
    display: none;
    text-align: left;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}
.help-tab-content.active { display: block; }
.help-tab-content h3 {
    color: var(--pinguino-orange);
    font-size: 15px;
    margin: 16px 0 8px;
}
.help-tab-content h3:first-child { margin-top: 0; }
.help-tab-content p {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 6px;
}
.help-tab-content ul {
    margin: 6px 0 10px 20px;
    list-style: disc;
    text-align: left;
}
.help-tab-content li {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.7;
    padding: 1px 0;
}
.help-tab-content .tip {
    background: rgba(255, 136, 0, 0.08);
    border-left: 3px solid var(--pinguino-orange);
    padding: 9px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin: 12px 0 4px;
    color: var(--text-primary);
}
/* ============================================
   MANUAL DE USO (MODAL ACERCA CON PESTAÑAS)
============================================ */
.about-modal-content {
    max-width: 620px;
    width: 92%;
    text-align: center;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.about-subtitle {
    margin-bottom: 16px;
    font-size: 13px;
}

.help-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 14px;
}
.help-tab-btn {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.help-tab-btn:hover { color: var(--pinguino-orange); border-color: var(--pinguino-orange); }
.help-tab-btn.active {
    background: var(--pinguino-orange);
    color: #000;
    border-color: var(--pinguino-orange);
}

.help-tab-content {
    display: none;
    text-align: left;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}
.help-tab-content.active { display: block; }
.help-tab-content h3 {
    color: var(--pinguino-orange);
    font-size: 15px;
    margin: 16px 0 8px;
}
.help-tab-content h3:first-child { margin-top: 0; }
.help-tab-content p {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 6px;
}
.help-tab-content ul {
    margin: 6px 0 10px 20px;
    list-style: disc;
    text-align: left;
}
.help-tab-content li {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.7;
    padding: 1px 0;
}
.help-tab-content .tip {
    background: rgba(255, 136, 0, 0.08);
    border-left: 3px solid var(--pinguino-orange);
    padding: 9px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin: 12px 0 4px;
    color: var(--text-primary);
}