.watch-container {
    max-width: 1180px;
    margin: 0 auto;
}

.watch-navigation {
    margin-bottom: 16px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--btn-bg);
    color: var(--text-primary);
    border-radius: 18px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    cursor: pointer;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.back-button:hover {
    background-color: var(--btn-hover);
}

.player-wrapper {
    width: 100%;
    margin-bottom: 20px;
}

.custom-player {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background-color: #000000;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.custom-player:fullscreen,
.custom-player:-webkit-full-screen {
    border-radius: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #000000;
}

.custom-player:fullscreen .player-aspect-frame,
.custom-player:-webkit-full-screen .player-aspect-frame {
    width: 100%;
    max-height: 100%;
    aspect-ratio: 16 / 9;
}

.player-aspect-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    -webkit-tap-highlight-color: transparent;
}

.player-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background-color: #000000;
}

.player-click-surface {
    position: absolute;
    inset: 0;
    z-index: 8;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.player-tap-hint {
    position: absolute;
    top: 0;
    bottom: 54px;
    width: 38%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 9;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.tap-hint-left {
    left: 0;
    border-radius: 0 100px 100px 0;
    background: radial-gradient(circle at left center, rgba(255, 255, 255, 0.22) 0%, transparent 75%);
    transform: scale(0.9);
}

.tap-hint-right {
    right: 0;
    border-radius: 100px 0 0 100px;
    background: radial-gradient(circle at right center, rgba(255, 255, 255, 0.22) 0%, transparent 75%);
    transform: scale(0.9);
}

.player-tap-hint.animate-tap {
    opacity: 1;
    transform: scale(1);
}

.tap-hint-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}

.tap-hint-icon {
    font-size: 16px;
    letter-spacing: -2px;
}

.player-spinner {
    position: absolute;
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff0000;
    border-radius: 50%;
    animation: playerSpin 0.9s linear infinite;
    z-index: 5;
    pointer-events: none;
}

@keyframes playerSpin {
    to { transform: rotate(360deg); }
}

.player-center-pulse {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.7);
    z-index: 9;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.player-center-pulse.animate-pulse {
    opacity: 1;
    transform: scale(1.15);
}

.pulse-icon svg {
    width: 38px;
    height: 38px;
    fill: #ffffff;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.2) 40%, transparent 65%);
    opacity: 1;
    transition: opacity 0.35s ease;
    z-index: 10;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
}

.custom-player.controls-inactive .player-overlay {
    opacity: 0;
}

.custom-player.controls-inactive {
    cursor: none;
}

.player-progress-container {
    position: relative;
    width: calc(100% - 20px);
    margin: 0 auto 4px auto;
    height: 22px;
    display: flex;
    align-items: center;
    cursor: pointer;
    pointer-events: auto;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.player-progress-track {
    position: relative;
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    transition: height 0.15s ease;
}

.player-progress-container:hover .player-progress-track {
    height: 6px;
}

.player-progress-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: rgba(255, 255, 255, 0.45);
    border-radius: 2px;
}

.player-progress-played {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: #ff0000;
    border-radius: 2px;
}

.player-progress-scrubber {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #ff0000;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s ease;
}

.player-progress-container:hover .player-progress-scrubber {
    transform: translateY(-50%) scale(1);
}

.player-progress-tooltip {
    position: absolute;
    bottom: 26px;
    padding: 3px 8px;
    background-color: rgba(18, 18, 18, 0.95);
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.12s ease;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-progress-container:hover .player-progress-tooltip {
    opacity: 1;
}

.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 8px 10px;
    pointer-events: auto;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ctrl-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.ctrl-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.ctrl-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.ctrl-btn:active {
    transform: scale(0.92);
}

.volume-container {
    display: flex;
    align-items: center;
    position: relative;
}

.volume-slider-box {
    width: 0;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
}

.volume-container:hover .volume-slider-box,
.volume-container:focus-within .volume-slider-box {
    width: 68px;
    margin-right: 4px;
}

.volume-slider {
    width: 64px;
    height: 4px;
    accent-color: #ff0000;
    cursor: pointer;
}

.time-display {
    font-size: 12.5px;
    color: #eeeeee;
    font-feature-settings: "tnum";
    margin-left: 4px;
    white-space: nowrap;
}

.time-sep {
    margin: 0 3px;
    opacity: 0.6;
}

.quality-menu-container,
.speed-menu-container {
    position: relative;
}

.quality-toggle-btn,
.speed-toggle-btn {
    font-size: 12px;
    font-weight: 700;
    width: auto;
    padding: 0 7px;
    border-radius: 12px;
    letter-spacing: 0.3px;
}

.quality-dropdown,
.speed-dropdown {
    position: absolute;
    bottom: 46px;
    right: 0;
    background-color: rgba(22, 22, 22, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    min-width: 95px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 30;
}

.quality-option,
.speed-option {
    border: none;
    background: transparent;
    color: #e0e0e0;
    font-size: 13px;
    padding: 8px 14px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.quality-option:hover,
.speed-option:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.quality-option.is-active,
.speed-option.is-active {
    color: #3ea6ff;
    font-weight: 700;
}

.video-info-box {
    padding: 14px 0;
}

.watch-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 16px;
}

.stream-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.badge-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background-color: var(--btn-bg);
    color: var(--text-primary);
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.badge-link:hover {
    background-color: var(--btn-hover);
}

.badge-youtube {
    color: #ff5555;
}

.player-error-card {
    background-color: #1a1616;
    border: 1px solid #3f2222;
    border-radius: 14px;
    padding: 42px 24px;
    text-align: center;
}

.error-badge {
    font-size: 40px;
    color: #ff4e4e;
    margin-bottom: 12px;
}

.error-heading {
    font-size: 20px;
    margin-bottom: 8px;
}

.error-details {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.error-retry-btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: #272727;
    color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.error-retry-btn:hover {
    background-color: #3a3a3a;
}

@media (max-width: 680px) {
    .watch-container {
        margin: 0 -10px;
    }

    .watch-navigation, .video-info-box {
        padding: 0 14px;
    }

    .player-wrapper {
        margin-bottom: 14px;
    }

    .player-wrapper .custom-player {
        border-radius: 0;
    }

    #rewindBtn,
    #forwardBtn,
    #downloadBtn,
    #pipBtn {
        display: none !important;
    }

    .volume-slider-box {
        display: none !important;
    }

    .player-controls-row {
        padding: 0 6px 8px 6px;
    }

    .controls-left, .controls-right {
        gap: 2px;
    }

    .ctrl-btn {
        width: 36px;
        height: 36px;
    }

    .time-display {
        font-size: 11.5px;
        margin-left: 2px;
    }

    .quality-toggle-btn,
    .speed-toggle-btn {
        font-size: 11px;
        padding: 0 6px;
        border-radius: 10px;
    }

    .watch-title {
        font-size: 17px;
        margin-bottom: 12px;
    }

    .player-progress-scrubber {
        transform: translateY(-50%) scale(1);
    }
}
