:root {
    --primary-color: #1a202c;
    --secondary-color: #2d3748;
    --accent-color: #4a5568;
    --text-color: #ffffff;
    --sidebar-width: 22vw;
    --bottom-height: 10vh;
    --safe-area: 0vmin;
    /* Initial, changed by JS */
    --ui-spacing: 1.5vmin;
    --border-radius: 1vmin;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: #000;
    color: var(--text-color);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.screen-container {
    display: none;
    position: fixed;
    /* Bind container to safe area to fix overscan on all 4 sides */
    top: var(--safe-area-y, var(--safe-area));
    left: var(--safe-area-x, var(--safe-area));
    right: var(--safe-area-x, var(--safe-area));
    bottom: var(--safe-area-y, var(--safe-area));
    grid-template-areas:
        "video sidebar"
        "footer sidebar";
    grid-template-columns: 1fr var(--sidebar-width);
    grid-template-rows: 1fr var(--bottom-height);
    background: #000;
    overflow: hidden;
}

.video-background {
    grid-area: video;
    background: #000;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ui-overlay {
    grid-area: sidebar;
    background: var(--sidebar-bg, var(--primary-color));
    border-left: 2px solid var(--accent-color);
    display: flex;
    flex-direction: column;
    padding: var(--ui-spacing);
    padding: var(--ui-spacing);
    z-index: 100 !important;
    position: relative;
    height: 100%;
    overflow: hidden;
    color: var(--sidebar-text, #fff);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    /* Visual separation */
}

.header {
    display: flex;
    align-items: center;
    gap: 1vw;
    margin-bottom: 2vh;
}

#company-logo {
    width: 5vw;
    height: 5vw;
    object-fit: contain;
}

#company-name {
    font-size: 3vmin;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.promo-item {
    background: var(--secondary-color);
    padding: 1.5vmin;
    border-radius: var(--border-radius);
    margin-bottom: 2vmin;
    animation: fadeIn 0.5s ease-out;
}

.footer {
    grid-area: footer;
    background: var(--bottom-bg, var(--accent-color));
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 100%;
    width: 100%;
    z-index: 10 !important;
    position: relative;
}

#ticker-wrapper {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    height: 100%;
    will-change: transform;
    contain: layout;
    animation: ticker linear infinite;
    animation-duration: 20s;
    /* Default, overridden by JS */
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    flex-shrink: 0;
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

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

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

/* Global Overlays */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding: var(--safe-area);
    background: #000c1d;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    text-align: center;
    color: #fff;
}

/* Registration Box */
.registration-box {
    background: #001529;
    padding: 5vmin;
    border-radius: 3vmin;
    border: 1px solid rgba(0, 157, 255, 0.3);
    box-shadow: 0 0 5vmin rgba(0, 0, 0, 0.8);
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.8s ease-out;
}

.code-input-container input {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    letter-spacing: 5px;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.code-input-container button:hover {
    transform: scale(1.05) !important;
    background: #34d399 !important;
}

.hidden {
    display: none !important;
}

.red-text {
    color: #f87171;
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.info-text {
    font-size: 1.2rem;
    color: #cbd5e0;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

/* Alert Overlay Specifics */
#alert-overlay {
    background: rgba(0, 0, 0, 0.8);
}

.alert-box {
    background: #fff;
    color: #000;
    padding: 2rem;
    border-radius: 20px;
    max-width: 80%;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.2);
}

.alert-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: #e53e3e;
}

.alert-body {
    font-size: 1.5rem;
}

/* Suspended Screen */
.suspended-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.suspended-msg {
    text-align: center;
    color: #f56565;
}

.uuid-label {
    margin-top: 20px;
    font-family: monospace;
    opacity: 0.5;
    color: #fff;
}

.hidden {
    display: none !important;
}