* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: sans-serif;
    background: #111;
    color: #fff;
    overflow-x: hidden;
}

header {
    background: #222;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #444;
    position: relative;
    z-index: 100;
    flex-wrap: wrap;
    gap: 10px;
}

header h1 {
    margin: 0;
    font-size: 18px;
}

header .btns {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

header .btns button {
    margin-left: 0;
    padding: 5px 10px;
    cursor: pointer;
    background: #444;
    border: none;
    color: #fff;
    border-radius: 4px;
    transition: 0.2s;
    font-size: 12px;
}

header .btns button:hover {
    background: #666;
}

#shareCurrentBtn {
    background: #e50914 !important;
}

#shareCurrentBtn:hover {
    background: #ff0a16 !important;
}

#deleteFavBtn {
    background: #dc3545 !important;
}
#deleteFavBtn:hover {
    background: #c82333 !important;
}

#timezoneBtn {
    background: #17a2b8 !important;
}
#timezoneBtn:hover {
    background: #138496 !important;
}

/* ----- Menu movil ----- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: white;
    transition: 0.3s;
}

.mobile-menu {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #222;
    padding: 10px;
    z-index: 1000;
    border-top: 2px solid #444;
    justify-content: space-around;
    flex-wrap: wrap;
}

.mobile-menu button {
    flex: 1;
    margin: 0 5px;
    padding: 8px;
    background: #444;
    border: none;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

#mobileShareBtn, #mobileDeleteFavBtn {
    background: #e50914;
}
#mobileTimezoneBtn {
    background: #17a2b8;
}

/* ----- Contenedor principal ----- */
.container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 50px);
    overflow: hidden;
}

/* ----- Lista de eventos escritorio ----- */
.eventos {
    width: 300px;
    background: #111;
    border-right: 2px solid #444;
    overflow-y: auto;
    flex-shrink: 0;
}

#eventList {
    list-style: none;
    margin: 0;
    padding: 0;
}

.event {
    padding: 10px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    position: relative;
}

.event:hover {
    background: #222;
}

.event select {
    margin-top: 5px;
    width: 100%;
    padding: 3px;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    border-radius: 3px;
}

.delete-event-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    background: #dc3545;
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    opacity: 0.7;
}
.delete-event-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ----- Zona del reproductor ----- */
.player-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    overflow: hidden;
    background: #000;
    min-height: 300px;
}

#playerContainer {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

#playerContainer iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
}

#playerContainer.multi {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
}

#playerContainer.multi iframe {
    position: static;
    width: 100%;
    height: 100%;
    border: none;
}

/* ----- Chat ----- */
.chat {
    width: 300px;
    border-left: 2px solid #444;
    flex-shrink: 0;
}

.chat iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ----- Estados ----- */
.eventos.mobile-active,
.chat.mobile-active {
    display: block !important;
}

button.active {
    background: #666 !important;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

/* ----- Modal zona horaria ----- */
.tz-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}
.tz-modal.active {
    display: flex !important;
}
.tz-modal-content {
    background: #1a1e24;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    padding: 20px;
}
.tz-modal-content h3 {
    margin-bottom: 15px;
    color: #e50914;
}
.tz-modal-content select {
    width: 100%;
    padding: 12px;
    background: #222831;
    border: 1px solid #333;
    color: white;
    border-radius: 6px;
    margin-bottom: 20px;
}
.tz-modal-content button {
    width: 100%;
    padding: 12px;
    background: #e50914;
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

/* ----- Modal compartir ----- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}
.modal.active {
    display: flex !important;
}
.modal-content {
    background: #1a1e24;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    border: 1px solid #333;
    overflow: hidden;
}
.modal-header {
    padding: 15px 20px;
    background: #222831;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}
.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #e50914;
}
.close-modal {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}
.modal-body {
    padding: 20px;
}
.share-event-info {
    background: #222831;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #e50914;
}
.share-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.share-tab {
    flex: 1;
    padding: 10px;
    background: #222831;
    border: 1px solid #333;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}
.share-tab.active {
    background: #e50914;
}
.share-panel {
    display: none;
    margin-bottom: 20px;
}
.share-panel.active {
    display: block;
}
.share-input-group {
    display: flex;
    gap: 8px;
}
.share-input-group input {
    flex: 1;
    padding: 12px;
    background: #222831;
    border: 1px solid #333;
    color: #fff;
    border-radius: 6px;
}
.copy-btn {
    padding: 12px 20px;
    background: #2a2f38;
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}
.share-extra {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.share-extra button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}
#shareWhatsAppBtn { background: #25D366; color: white; }
#shareTelegramBtn { background: #0088cc; color: white; }

/* ----- Modo solo reproductor ----- */
.player-only-mode .eventos,
.player-only-mode .chat,
.player-only-mode header .btns button:not(#playerOnlyBtn),
.player-only-mode .mobile-menu,
.player-only-mode .mobile-menu-btn,
.player-only-mode header h1 {
    display: none !important;
}
.player-only-mode .player-area {
    width: 100% !important;
    padding: 0 !important;
}
.player-only-mode #playerContainer {
    height: 100vh !important;
    width: 100vw !important;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}
.player-only-mode header {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 10000;
    background: rgba(0,0,0,0.7);
    border-radius: 8px;
}
#playerOnlyBtn {
    background: #4CAF50;
    color: white;
}
.player-only-mode #playerOnlyBtn {
    background: #f44336;
}
.exit-player-only {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    display: none;
}
.player-only-mode .exit-player-only {
    display: block;
}

/* Responsive */
@media (min-width: 769px) {
    .container {
        flex-direction: row;
        height: calc(100vh - 50px);
    }
    .mobile-menu, .mobile-menu-btn {
        display: none !important;
    }
}
@media (max-width: 768px) {
    header .btns { display: none; }
    .mobile-menu-btn { display: flex; }
    .mobile-menu { display: flex; }
    .container { flex-direction: column; }
    .eventos, .chat {
        width: 100%;
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        bottom: 60px;
        z-index: 90;
        display: none;
    }
    .player-area { min-height: 300px; height: 50vh; }
    #playerContainer.multi {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
    }
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #222; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }