/* ========================================================
   CRUNCHCORE PLAYER (CrunchPlayer) — STYLES
   Ultra-modern, dark editorial gaming theme with neon accents
   ======================================================== */

.crunch-player {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #05080c;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #ffffff;
    user-select: none;
    -webkit-user-select: none;
    margin: 28px 0;
    transition: box-shadow 0.3s ease;
}

.crunch-player:hover {
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 212, 0, 0.25);
}

.crunch-player:fullscreen {
    border-radius: 0;
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    margin: 0;
}

.crunch-player:-webkit-full-screen {
    border-radius: 0;
    width: 100%;
    height: 100%;
}

/* Video element */
.crunch-player video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000000;
}

/* Watermark */
.crunch-player .cp-watermark {
    position: absolute;
    top: 18px;
    left: 20px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(13, 22, 33, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffd400;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.crunch-player .cp-watermark-dot {
    width: 6px;
    height: 6px;
    background: #ffd400;
    border-radius: 50%;
    box-shadow: 0 0 8px #ffd400;
    animation: cp-pulse 2s infinite;
}

@keyframes cp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Center Big Play/Pause Button */
.crunch-player .cp-center-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 76px;
    height: 76px;
    background: rgba(13, 22, 33, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 212, 0, 0.6);
    border-radius: 50%;
    color: #ffd400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 212, 0, 0.2);
}

.crunch-player .cp-center-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: #ffd400;
    color: #05080c;
    border-color: #ffd400;
    box-shadow: 0 10px 35px rgba(255, 212, 0, 0.4);
}

.crunch-player.playing .cp-center-btn {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    pointer-events: none;
}

.crunch-player .cp-center-btn svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
    margin-left: 4px;
}

/* Spinner / Loader */
.crunch-player .cp-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 212, 0, 0.15);
    border-top-color: #ffd400;
    border-radius: 50%;
    animation: cp-spin 0.8s linear infinite;
    z-index: 7;
    pointer-events: none;
    display: none;
}

.crunch-player.buffering .cp-spinner {
    display: block;
}

@keyframes cp-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Click Overlay */
.crunch-player .cp-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: pointer;
}

/* Toast Message */
.crunch-player .cp-toast {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(13, 22, 33, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 212, 0, 0.35);
    color: #ffd400;
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.crunch-player .cp-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Controls Bar */
.crunch-player .cp-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding: 30px 20px 14px;
    background: linear-gradient(to top, rgba(5, 8, 12, 0.96) 0%, rgba(5, 8, 12, 0.6) 60%, transparent 100%);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crunch-player.playing.controls-hidden .cp-controls,
.crunch-player.playing.controls-hidden .cp-watermark {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.crunch-player.playing.controls-hidden {
    cursor: none;
}

/* Scrubber / Progress Bar */
.crunch-player .cp-progress-container {
    position: relative;
    width: 100%;
    height: 18px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.crunch-player .cp-progress-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: visible;
    transition: height 0.15s ease;
}

.crunch-player .cp-progress-container:hover .cp-progress-track {
    height: 7px;
}

.crunch-player .cp-progress-buffer {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    transition: width 0.2s ease;
}

.crunch-player .cp-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, #e6be00, #ffd400);
    border-radius: 4px;
}

.crunch-player .cp-progress-thumb {
    position: absolute;
    top: 50%;
    right: -7px;
    transform: translateY(-50%) scale(0);
    width: 14px;
    height: 14px;
    background: #ffd400;
    border: 2px solid #05080c;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 212, 0, 0.8);
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.crunch-player .cp-progress-container:hover .cp-progress-thumb,
.crunch-player.dragging .cp-progress-thumb {
    transform: translateY(-50%) scale(1);
}

.crunch-player .cp-time-tooltip {
    position: absolute;
    bottom: 24px;
    transform: translateX(-50%);
    background: rgba(13, 22, 33, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 212, 0, 0.3);
    color: #ffd400;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.crunch-player .cp-progress-container:hover .cp-time-tooltip {
    opacity: 1;
}

/* Bottom Controls Row */
.crunch-player .cp-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.crunch-player .cp-controls-left,
.crunch-player .cp-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crunch-player .cp-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.1s ease;
    outline: none;
    padding: 0;
}

.crunch-player .cp-btn:hover {
    color: #ffd400;
    background: rgba(255, 255, 255, 0.08);
}

.crunch-player .cp-btn:active {
    transform: scale(0.92);
}

.crunch-player .cp-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Volume */
.crunch-player .cp-volume-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.crunch-player .cp-volume-slider-wrapper {
    width: 0;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
}

.crunch-player .cp-volume-group:hover .cp-volume-slider-wrapper,
.crunch-player .cp-volume-group.active .cp-volume-slider-wrapper {
    width: 72px;
}

.crunch-player input[type="range"].cp-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 68px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin: 0 4px;
}

.crunch-player input[type="range"].cp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #ffd400;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(255, 212, 0, 0.6);
}

.crunch-player .cp-time-display {
    font-size: 13px;
    font-weight: 500;
    color: #aeb8c5;
    font-variant-numeric: tabular-nums;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.crunch-player .cp-time-current {
    color: #ffffff;
}

/* Speed Button */
.crunch-player .cp-speed-container {
    position: relative;
}

.crunch-player .cp-speed-btn {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    width: auto;
    padding: 0 10px;
    letter-spacing: 0.5px;
}

.crunch-player .cp-speed-btn:hover {
    color: #ffd400;
}

.crunch-player .cp-speed-menu {
    position: absolute;
    bottom: 44px;
    right: 0;
    background: rgba(13, 22, 33, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 6px 0;
    display: none;
    flex-direction: column;
    min-width: 90px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 25;
}

.crunch-player .cp-speed-menu.open {
    display: flex;
}

.crunch-player .cp-speed-option {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #aeb8c5;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.crunch-player .cp-speed-option:hover {
    background: rgba(255, 212, 0, 0.1);
    color: #ffd400;
}

.crunch-player .cp-speed-option.active {
    color: #ffd400;
    background: rgba(255, 212, 0, 0.15);
}

/* ========================================================
   PRE-ROLL AD SYSTEM
   ======================================================== */

.crunch-player .cp-ad-overlay {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: none;
    pointer-events: none;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.crunch-player.ad-active .cp-ad-overlay {
    display: flex;
    pointer-events: none;
}

.crunch-player .cp-ad-sponsor-info,
.crunch-player .cp-ad-cta-btn,
.crunch-player .cp-ad-skip-card,
.crunch-player .cp-ad-skip-btn {
    pointer-events: auto;
}

.crunch-player .cp-ad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.crunch-player .cp-ad-sponsor-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(13, 22, 33, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 24px;
}

.crunch-player .cp-ad-badge {
    background: #ffd400;
    color: #05080c;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.crunch-player .cp-ad-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.crunch-player .cp-ad-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 212, 0, 0.15);
    border: 1px solid #ffd400;
    color: #ffd400;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.crunch-player .cp-ad-cta-btn:hover {
    background: #ffd400;
    color: #05080c;
    box-shadow: 0 0 15px rgba(255, 212, 0, 0.5);
}

.crunch-player .cp-ad-cta-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.crunch-player .cp-ad-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

.crunch-player .cp-ad-skip-card {
    background: rgba(13, 22, 33, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.crunch-player .cp-ad-countdown {
    color: #aeb8c5;
}

.crunch-player .cp-ad-countdown span {
    color: #ffd400;
    font-weight: 700;
}

.crunch-player .cp-ad-skip-btn {
    background: #ffd400;
    color: #05080c;
    border: none;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.crunch-player .cp-ad-skip-btn:hover {
    background: #ffe033;
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(255, 212, 0, 0.6);
}

.crunch-player .cp-ad-skip-card.can-skip .cp-ad-countdown {
    display: none;
}

.crunch-player .cp-ad-skip-card.can-skip .cp-ad-skip-btn {
    display: inline-flex;
}

.crunch-player.ad-active .cp-controls {
    display: none;
}

.crunch-player.ad-active .cp-watermark {
    display: none;
}

.crunch-player .cp-ad-progress-line {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: #ffd400;
    width: 0%;
    z-index: 12;
    display: none;
    box-shadow: 0 0 8px #ffd400;
}

.crunch-player.ad-active .cp-ad-progress-line {
    display: block;
}

@media (max-width: 640px) {
    .crunch-player .cp-center-btn {
        width: 58px;
        height: 58px;
    }
    .crunch-player .cp-center-btn svg {
        width: 24px;
        height: 24px;
    }
    .crunch-player .cp-controls {
        padding: 20px 12px 10px;
    }
    .crunch-player .cp-ad-overlay {
        padding: 12px;
    }
    .crunch-player .cp-ad-sponsor-info {
        padding: 4px 10px;
    }
    .crunch-player .cp-ad-title {
        display: none;
    }
    .crunch-player .cp-volume-slider-wrapper {
        display: none;
    }
}
