[hidden] {
    display: none !important;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1s ease;
}

.video-player.active {
    opacity: 1;
}

/* Načítání */
.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 5px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 30;
    display: none;
}

.spinner.visible {
    display: block;
}

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

/* Chybový stav */
.error-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    text-align: center;
    padding: 24px 32px;
    border-radius: 10px;
    font-family: system-ui, sans-serif;
}

.error-overlay p {
    margin: 0 0 14px;
}

.error-overlay button {
    background: #fff;
    color: #000;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

/* Šipky vlevo/vpravo */
.navigation-buttons {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    z-index: 20;
    pointer-events: none;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.3s ease;
    opacity: 0.7;
    pointer-events: auto;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
}

/* Spodní lišta s ovládáním */
.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 25;
    background: rgba(0, 0, 0, 0.55);
    padding-top: 6px;
    font-family: system-ui, sans-serif;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
}

.ctl-btn {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.ctl-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

#menuToggleButton {
    margin-left: auto;
}

.description {
    color: white;
    flex: 1;
    text-align: center;
    font-size: 17px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

/* Menu kapitol */
.chapter-menu {
    position: absolute;
    right: 12px;
    bottom: calc(100% + 6px);
    background: rgba(0, 0, 0, 0.92);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 50vh;
    overflow-y: auto;
    min-width: 220px;
}

.chapter-item {
    background: transparent;
    color: white;
    border: none;
    text-align: left;
    padding: 10px 14px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
}

.chapter-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.chapter-item.current {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* Mobil: delší názvy se zalamují, tlačítka menší */
@media (max-width: 600px) {
    .description {
        white-space: normal;
        font-size: 15px;
    }

    .ctl-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .nav-btn {
        padding: 24px 10px;
        font-size: 22px;
    }

    .chapter-menu {
        left: 12px;
        right: 12px;
        min-width: 0;
    }
}
