body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #000;
    color: #f5f5f5;
}

#mobile-overlay {
    position: fixed;
    inset: 0;
    background-color: #000;
    color: #f5f5f5;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.mobile-message {
    font-size: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid #00ff66;
    padding: 16px 24px;
    border-radius: 4px;
}

#main-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #000;
}

#video-app {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.deck-row {
    flex: 1;
    display: flex;
    flex-direction: row;
    min-height: 0;
}

.hidden {
    display: none;
}

/* Deck containers */

.video-slot {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #1c1c1c;
    /* Keep base black but add a 25% black overlay to make the deck 25% darker visually */
    background-color: #000;
    background-image: linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.25));
    background-blend-mode: multiply;
    min-width: 0;
}

/* URL bar */

.url-loader-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.url-loader-bar input[type="text"] {
    flex-grow: 1;
    padding: 4px 8px;
    box-sizing: border-box;
    font-size: 10px; /* 25% smaller than the previous 13px */
    min-height: 20px;
    border-radius: 2px;
    border: 1px solid #1f1f1f;
    background-color: #000; /* preserve dark background */
    /* Loaded URL text: very dark muted green for visibility without competing with video.
       Use !important to override inline color set by JS while keeping behavior unchanged. */
    color: rgba(0,40,25,0.65) !important;
    outline: none;
}

/* Keep dark UI on all interaction states; URL text stays very dark muted green for consistency */
.url-loader-bar input[type="text"]:focus,
.url-loader-bar input[type="text"]:active,
.url-loader-bar input[type="text"]:hover {
    border-color: #00ff66;
    background-color: #000;
    color: rgba(0,40,25,0.65) !important;
}

/* Placeholder: low-interference very dark muted green */
.url-loader-bar input[type="text"]::placeholder {
    color: rgba(107,108,107,1);
}

.url-loader-bar input[type="text"]:-webkit-autofill,
.url-loader-bar input[type="text"]:-webkit-autofill:focus,
.url-loader-bar input[type="text"]:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0 1000px #000 inset;
    /* Autofill text uses the same very dark muted green as loaded URL, slightly stronger for legibility */
    -webkit-text-fill-color: rgba(0,40,25,0.65) !important;
    border: 1px solid #1f1f1f;
}

.url-loader-bar button {
    flex-shrink: 0;
    padding: 4px 10px;
    box-sizing: border-box;
    font-size: 13px;
    min-height: 20px;
    border-radius: 2px;
    background-color: #000;
    color: #00ff66;
    border: 1px solid #00ff66;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.url-loader-bar button:hover {
    background-color: #031507;
}

.url-loader-bar button:active {
    background-color: #00ff66;
    color: #000;
}

/* Video Info */
.video-info {
    padding: 4px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid #111;
    min-height: 20px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.video-title {
    font-size: 12px; /* ~10% larger than the previous 11px */
    color: #00ff66;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
    /* Align the left edge of the title text to match the URL placeholder's text start */
    padding-left: 8px;
    box-sizing: border-box;
}

/* Middle volume column */

.volume-controls-middle {
    display: none;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-around;
    padding: 8px 4px;
    background-color: #020202;
    min-width: 80px;
    border-left: 1px solid #111;
    border-right: 1px solid #111;
}

.vertical-fader-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: calc(100% - 10px);
    width: 45%;
    padding-top: 6px;
}

.vertical-fader-group .fader-label {
    font-size: 10px;
    color: #777;
    margin: 2px 0;
    text-align: center;
}

/* Vertical sliders */

.individual-volume-fader.vertical-fader {
    -webkit-appearance: slider-vertical;
    writing-mode: bt-lr;
    width: 24px;
    height: 100%;
    margin: 4px 0;
    flex-grow: 1;
}

/* Video frame */

.video-container {
    flex-grow: 1;
    position: relative;
    width: 100%;
    background-color: #000;
    border: 1px solid #111;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Playback controls */

.playback-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 4px 8px;
    gap: 8px;
    background-color: #020202;
    border-radius: 2px;
    border-top: 1px solid #111;
    font-size: 11px;
}

.toggle-btn {
    background: #000;
    border: 1px solid #333;
    color: #777;
    font-size: 9px;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: bold;
}

.toggle-btn:hover {
    border-color: #555;
    color: #aaa;
}

.toggle-btn.active {
    background-color: #00441b;
    color: #00ff66;
    border-color: #00ff66;
}

.playback-controls label {
    font-weight: 500;
    color: #777;
    white-space: nowrap;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center; /* vertically center label within the controls row */
    height: 100%;
}

/* Speed fader */

.speed-fader.horizontal-fader {
    flex-grow: 1;
    height: 20px;
    cursor: pointer;
}

.speed-display {
    flex-shrink: 0;
    width: 52px;
    text-align: right;
    font-size: 12px;
    color: #00ff66;
    display: flex;
    align-items: center; /* vertically center the speed text with the slider and buttons */
    justify-content: flex-end;
    height: 100%;
}

/* Range styling – thin lines + green accent */

/* Ensure no browser-level accent color overrides (removes any default blue) */
input[type="range"] {
    -webkit-appearance: none;
    background: transparent;
    accent-color: transparent;
    /* fallback for browsers using system accent */
    --thumb-color: #ffffff;
}

/* Track */

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: #111;
    border-radius: 999px;
    border: 1px solid #181818;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: #111;
    border-radius: 999px;
    border: 1px solid #181818;
}

/* Thumb */

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    /* knobs set to white */
    background: #ffffff;
    border: 1px solid #000;
    cursor: pointer;
    margin-top: -6px;
}

input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #000;
    cursor: pointer;
}

/* Vertical fader track - Matches horizontal crossfader style */

.individual-volume-fader.vertical-fader::-webkit-slider-runnable-track {
    height: 100%;
    width: 8px;
    background: #111;
    border-radius: 999px;
    border: 1px solid #181818;
}

.individual-volume-fader.vertical-fader::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin-left: -6px;
    border-radius: 50%;
    /* vertical knobs forced to pure white, no accent overrides */
    background: #ffffff;
    border: 1px solid #000;
    cursor: pointer;
}

/* Firefox vertical thumb override */
.individual-volume-fader.vertical-fader::-moz-range-thumb {
    background: #ffffff;
    border: 1px solid #000;
    box-shadow: none;
}

.individual-volume-fader.vertical-fader::-moz-range-track {
    height: 100%;
    width: 8px;
    background: #111;
    border-radius: 999px;
    border: 1px solid #181818;
}

.individual-volume-fader.vertical-fader::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #000;
    cursor: pointer;
}

/* Row Controls (Crossfaders) */

.row-controls {
    padding: 2px 20px;
    background-color: #000;
    color: #f5f5f5;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-top: 1px solid #1c1c1c;
    border-bottom: 1px solid #1c1c1c;
    position: relative;
}

.row-crossfader {
    flex: 1;
    max-width: 400px;
    height: 28px;
    cursor: pointer;
    position: relative;
    z-index: 2; /* ensure the slider thumb renders above the center marker */
}

/* Center marker for crossfaders (slightly longer and visually behind the thumb) */
.row-controls::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 24px; /* made a bit longer */
    background-color: #222;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0; /* keep the marker behind interactive controls */
}

.side-label {
    font-size: 12px;
    letter-spacing: 0.1em;
    color: #555;
    text-transform: uppercase;
    font-weight: bold;
    min-width: 14px;
    text-align: center;
}

/* Mobile – stack decks */

@media (orientation: portrait) {
    #video-app {
        flex-direction: column;
        overflow-y: auto;
    }

    .deck-row {
        flex: none;
        flex-direction: column;
        min-height: auto;
    }

    .video-slot {
        flex: none;
        height: 300px;
    }

    #volume-controls-middle-1,
    #volume-controls-middle-2 {
        display: none;
    }
    
    .row-controls {
        flex: none;
    }
}

/* Landscape – show middle faders */

@media (orientation: landscape), (min-width: 768px) {
    .volume-controls-middle {
        display: flex;
        flex: 0 0 90px;
    }

    .video-slot {
        flex: 1;
    }
}

/* Bottom-left compact logo (four crossed circles) */
#ytmxr-logo {
    position: fixed;
    left: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px; /* reduced so YTMXR sits closer to circles */
    z-index: 10000;
    pointer-events: auto; /* allow clicking the credit link */
    opacity: 0.95;
    transform: translateY(3px); /* bajar todo esto 3 pixeles */
}

#ytmxr-logo svg {
    display: block;
    width: 36px;
    height: 24px;
    transform: translateY(1px); /* visual alignment with text */
}

#ytmxr-logo .logo-text {
    color: #00ff66;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
    margin-right: 2px; /* nudge text slightly closer to the credit */
}

/* credit text next to the logo (near-black, small, clickable) */
#ytmxr-logo .by-text {
    color: rgba(36,36,36,0.95); /* slightly lighter (10% brighter) */
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    opacity: 0.95;
    pointer-events: auto;
}

/* make sure clickable link is tappable without interfering with logo SVG */
#ytmxr-logo a.by-text:focus,
#ytmxr-logo a.by-text:hover {
    text-decoration: underline;
}

/* Slight downscale on very small screens so it never obstructs controls */
@media (max-width: 420px) {
    #ytmxr-logo {
        left: 8px;
        bottom: 8px;
    }
    #ytmxr-logo svg {
        width: 28px;
        height: 18px;
    }
    #ytmxr-logo .logo-text {
        font-size: 11px;
    }
}