/* --- RESET & BASICS --- */
body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background-color: black;
    font-family: 'Courier New', Courier, monospace;
}

/* --- BACKGROUND VIDEOS --- */
#video-layer {
    position: relative;
    width: 100%;
    height: 100%;
}

.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    z-index: 0;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    background-color: black;
}

.bg-video.active {
    opacity: 1;
    z-index: 1;
}

/* --- START SCREEN --- */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    cursor: pointer;
}

#logo-container {
    width: 500px;
    height: 500px;
    max-width: 80vw;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#raglan-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: pulse 4s infinite ease-in-out, glowCycle 8s infinite linear;
}

@keyframes pulse {
    0%, 100% { transform: scale(1.0); }
    50%       { transform: scale(1.05); }
}

@keyframes glowCycle {
    0%   { filter: sepia(1) saturate(20) hue-rotate(0deg)   drop-shadow(0 0 15px currentColor); color: #00f2ff; }
    33%  { filter: sepia(1) saturate(20) hue-rotate(90deg)  drop-shadow(0 0 20px currentColor); color: #7000ff; }
    66%  { filter: sepia(1) saturate(20) hue-rotate(240deg) drop-shadow(0 0 25px currentColor); color: #ff00c8; }
    100% { filter: sepia(1) saturate(20) hue-rotate(360deg) drop-shadow(0 0 15px currentColor); color: #00f2ff; }
}


/* --- LOADING SCREEN --- */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 15;
    pointer-events: none;
}

#loading-logo {
    width: 220px;
    height: 220px;
    object-fit: contain;
    animation: pulse 4s infinite ease-in-out, glowCycle 8s infinite linear;
}

/* --- PLAYER CONTROLS --- */
#player-container {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 10;
    display: none !important;
    /* Hidden, handled by shell player */

    text-align: center;
    min-width: 240px;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s;
}

#player-container:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

#track-title {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 12px;
    letter-spacing: 1px;
    font-weight: normal;
    display: block;
    text-shadow: 1px 1px 2px black;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    margin: 0 auto 12px auto;
}

.controls-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.ctrl-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    height: 40px;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translateY(-2px);
}

.ctrl-btn.active-random {
    background: rgba(255, 255, 255, 0.9);
    color: black;
    border-color: black;
}

/* --- VOLUME SLIDER --- */
.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    margin-top: -4px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

input[type=range]::-moz-range-thumb {
    height: 14px;
    width: 14px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 600px) {
    #player-container {
        bottom: 25px;
        left: 0;
        right: 0;
        margin-left: auto;
        margin-right: auto;
        min-width: 280px;
        width: calc(100% - 40px);
        max-width: 340px;
        padding: 12px;
    }

    #track-title {
        font-size: 0.85rem;
        margin-bottom: 10px;
        max-width: 100%;
    }

    .controls-row {
        gap: 10px;
        margin-bottom: 12px;
    }

    .ctrl-btn {
        padding: 6px;
        font-size: 1rem;
        min-width: 36px;
        height: 36px;
    }

    .volume-container {
        padding: 0 5px;
    }
}
