:root {
    --bg-body: #000000;
    --bg-sidebar: #0a0a0a;
    --bg-stage: #000000;
    --text-main: #ffffff;
    --text-dim: #444444;
    --text-muted: #666666;
    --accent: #ff5e00;
    /* Vivid Orange */
    --accent-glow: rgba(255, 94, 0, 0.2);
    --border: #1a1a1a;

    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    /* App like feel */
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* SIDEBAR */
.sidebar {
    width: 320px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    flex-shrink: 0;
    z-index: 10;
    transition: all 0.3s ease;
}

.brand h1 {
    font-size: 1.8rem;
    line-height: 0.9;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.brand .version {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 3rem;
}

.control-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.panel-block label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.status-msg {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--accent);
    min-height: 2.8em;
}

.btn {
    background: transparent;
    border: 1px solid #333;
    color: var(--text-main);
    padding: 0.85rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0;
}

.btn:hover {
    border-color: var(--accent);
    background: rgba(255, 94, 0, 0.05);
    /* Slight orange tint on hover */
    color: var(--accent);
}

.btn.full-width {
    width: 100%;
    margin-bottom: 0.75rem;
}

#upload-btn,
#process-btn {
    background: var(--text-main);
    color: #000;
    border: 1px solid var(--text-main);
}

#upload-btn:hover,
#process-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn.secondary {
    border-color: #222;
    color: #666;
}

.btn.secondary:hover {
    border-color: #444;
    color: #fff;
    background: rgba(255, 255, 255, 0.02);
}

.btn.disabled {
    opacity: 0.1;
    pointer-events: none;
    background: transparent !important;
    border-color: #111 !important;
    color: #333 !important;
}

.credits {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* MAIN STAGE */
.stage {
    flex-grow: 1;
    background: var(--bg-stage);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.view-state {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease-out;
}

/* Drop Window */
.drop-window {
    width: 100%;
    max-width: 480px;
    background: #000;
    border: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    margin: auto;
}

.drop-window.dragover {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
}

.window-header {
    background: #000;
    border-bottom: 1px solid #1a1a1a;
    padding: 0.8rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.window-header .dot {
    width: 8px;
    height: 8px;
    border: 1px solid #222;
}

.window-title {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: #333;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.window-body {
    padding: clamp(2rem, 8vh, 4rem) 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    color: var(--text-dim);
    text-align: center;
}

.window-body svg {
    opacity: 0.3;
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

.window-body p {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #fff;
    line-height: 1.5;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}

.limitation {
    font-size: 0.6rem;
    color: #222;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.window-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    justify-content: center;
}

@media (min-width: 480px) {
    .window-actions {
        flex-direction: row;
        justify-content: center;
    }
}

.window-actions span {
    font-size: 0.5rem;
    color: #222;
    font-family: var(--font-mono);
    font-weight: 800;
}

.link-btn {
    background: transparent;
    border: none;
    color: #444;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #222;
    padding-bottom: 2px;
    transition: all 0.2s;
}

.link-btn:hover {
    color: #000;
    border-color: #000;
}

/* Global Buttons */
.btn.primary-outline {
    border: 1px solid #333;
    background: transparent;
    color: #fff;
    padding: 0.8rem 2rem;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    letter-spacing: 2px;
    box-shadow: inset 0 0 0 1px transparent;
    transition: all 0.3s ease;
}

.btn.primary-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 94, 0, 0.05);
}

.btn.primary-outline.disabled {
    opacity: 0.3;
    pointer-events: none;
    border-color: #222;
    color: #444;
}

/* Selection View */
.selection-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
}

.view-instruction {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    text-align: center;
    padding: 0 1rem;
    min-height: 1.5em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Canvas / Image */
.canvas-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    border: 1px solid var(--border);
    line-height: 0;
    overflow: hidden;
    cursor: crosshair;
}

#first-frame {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    /* Full color content */
}

/* Markers - Keep colored? User said "make it shacn b;lacl and white" but usually markers need contrast. 
Let's try white and inverse for high contrast B&W. Or keep slight color if functional. 
User said "no emois", "black and white ui". 
I will update markers to be High Contrast White vs Black or Patterned if they want STRICT B&W.
But for now, I'll keep them functionally distinct (Circle vs Square?) or just Shades?
Let's stick to the previous request's colors for markers unless strictly forbidden, 
as "black and white ui" usually refers to the Chrome/Shell. 
The video itself is color. 
Wait, the video is color. So markers can be*/
.marker {
    position: absolute;
    width: 6px;
    height: 6px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 20;
}

@media (max-width: 768px) {
    .marker {
        width: 6px;
        height: 6px;
    }
}

.marker.player {
    background: #ff0000;
    /* Red */
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.marker.ball {
    background: #0066ff;
    /* Blue */
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.5);
}

/* Video */
video {
    width: 100%;
    height: auto;
    max-height: 80vh;
}

/* Loader */
.loader-wrapper {
    text-align: center;
}

.spinner-square {
    width: 40px;
    height: 40px;
    background: #fff;
    animation: flip 1.2s infinite ease-in-out;
    margin: 0 auto 2rem;
}

@keyframes flip {
    0% {
        transform: perspective(120px) rotateX(0deg) rotateY(0deg);
    }

    50% {
        transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
    }

    100% {
        transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
    }
}

#loading-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 2rem;
}

.nav-hint {
    font-family: var(--font-mono);
    font-size: 0.45rem;
    color: #444;
    letter-spacing: 0.5px;
    opacity: 0.5;
    margin-top: 1.5rem;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Mobile Layout */
@media (max-width: 768px) {
    body {
        overflow: hidden;
        height: 100vh;
        width: 100vw;
        position: fixed;
    }

    .app-container {
        flex-direction: column;
        height: 100%;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem 1.5rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .brand h1 {
        font-size: 1.2rem;
        margin-bottom: 0;
    }

    .control-panel {
        display: none;
        /* Hide status msg in header to save space */
    }

    .credits {
        margin-top: 0;
        font-size: 0.5rem;
    }

    .stage {
        padding: 0.5rem;
        min-height: calc(100vh - 60px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        /* Centering fix */
    }

    .selection-container {
        width: 100%;
        height: 100%;
        justify-content: center;
    }

    .drop-window {
        max-width: 100%;
        width: 100%;
        margin: auto;
    }

    .window-body {
        padding: 2.5rem 1rem;
    }

    .btn.primary-outline {
        width: auto;
        min-width: 160px;
        padding: 0.5rem 1rem;
        font-size: 0.6rem;
        margin: 0 auto;
    }

    #selection-actions {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    /* Video & Canvas mobile adjustments */
    #first-frame,
    video {
        max-height: 85vh;
        width: 100%;
        object-fit: contain;
    }

    .canvas-wrapper {
        width: 100%;
        max-width: 100vw;
    }

    .window-header .dot {
        display: none;
    }

    .window-title {
        margin-left: 0;
        font-size: 0.6rem;
    }
}