:root {
    --theme-color: #00ff00;
    --theme-glow: rgba(0, 255, 0, 0.5);
    --theme-r: 0;
    --theme-g: 255;
    --theme-b: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent mobile zoom on double-tap */
    touch-action: manipulation;
}

body {
    font-family: 'Courier New', monospace;
    overflow: hidden;
    background: #000;
    color: #fff;
}

/* Canvas - full screen */
#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
}

/* Remote Container (Top-Left) */
.remote-container {
    position: fixed;
    top: 60px;
    left: 60px;
    z-index: 100;
}

/* Right column - Remote Toggle Button */
.remote-toggle {
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 11px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Courier New', monospace;
    position: relative;
    flex: 1;
}

/* Idle state - becomes VERY transparent after 2 seconds */
.remote-toggle-container.idle {
    opacity: 0.1;
}

/* Remote toggle container - holds both columns */
.remote-toggle-container {
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease, opacity 0.5s ease;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Left column - Channel navigation arrows */
.channel-nav-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: transparent;
    border: none;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

.arrow-btn {
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    width: 48px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

#channel-down {
    border-bottom: none;
}

.remote-toggle-container.idle .channel-nav-column {
    opacity: 0.4;
}

.arrow-btn:hover {
    background: var(--theme-color);
    color: #000;
}

.arrow-btn:active {
    background: linear-gradient(145deg, #0a0a0a, #000000);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}
    /* 3D Button Effect */
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-weight: bold;
    opacity: 0.5;
    position: relative;
    z-index: 101;
}

.remote-toggle:hover {
    background: rgba(0, 0, 0, 0.75);
    border-color: var(--theme-glow);
    /* 3D Hover Effect - lifts up */
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.5), 0 0 20px var(--theme-glow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: #fff;
    opacity: 1;
}

.remote-toggle:active {
    /* 3D Press Effect - pushes down */
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.remote-toggle.open {
    background: rgba(0, 0, 0, 0.95);
    opacity: 1;
    color: #fff;
}

.channel-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.channel-number {
    font-size: 20px;
    color: var(--theme-color);
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--theme-glow);
    display: flex;
    align-items: center;
}

.channel-name {
    font-size: 11px;
    color: #fff;
    letter-spacing: 1px;
    opacity: 0.9;
}

.chevron {
    font-size: 14px;
    color: var(--theme-color);
    transition: transform 0.3s ease;
    display: inline-block;
    margin-left: 8px;
}

.remote-toggle.open .chevron {
    transform: rotate(180deg);
}


/* Remote Dropdown */
.remote-dropdown {
    position: fixed;
    top: 140px;
    left: 60px;
    right: 60px;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    overflow-x: visible;
    display: flex;
    flex-direction: column;
}

.remote-dropdown.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Remote Header - Title + Globe Button Row */
.remote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.remote-title {
    text-align: left;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 0;
    color: var(--theme-color);
    text-shadow: 0 0 10px var(--theme-glow);
    flex: 1;
}

/* Globe Container and Tooltip */
.globe-container {
    position: relative;
}

.globe-info-tooltip {
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(var(--theme-r), var(--theme-g), var(--theme-b), 0.2);
    border: 1.5px solid rgba(var(--theme-r), var(--theme-g), var(--theme-b), 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: rgba(var(--theme-r), var(--theme-g), var(--theme-b), 0.8);
    cursor: help;
    transition: all 0.2s ease;
}

.globe-info-tooltip:hover {
    background: rgba(var(--theme-r), var(--theme-g), var(--theme-b), 0.3);
    border-color: rgb(var(--theme-r), var(--theme-g), var(--theme-b));
    color: rgb(var(--theme-r), var(--theme-g), var(--theme-b));
    box-shadow: 0 0 10px rgba(var(--theme-r), var(--theme-g), var(--theme-b), 0.4);
}

.globe-info-tooltip::after {
    content: 'your tv channel changes will share with others connected.';
    position: absolute;
    right: 25px;
    top: 0;
    transform: none;
    background: linear-gradient(145deg, #2a2a2a, #151515);
    border: 2px solid rgba(var(--theme-r), var(--theme-g), var(--theme-b), 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    white-space: normal;
    word-wrap: break-word;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 20px rgba(var(--theme-r), var(--theme-g), var(--theme-b), 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    letter-spacing: 0.5px;
    line-height: 1.4;
    backdrop-filter: blur(10px);
    z-index: 100001;
}

.globe-info-tooltip:hover::after {
    opacity: 1;
}

/* Globe Button */
.globe-btn {
    flex-shrink: 0;
    min-width: 120px;
    font-size: 10px;
}

.globe-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.globe-btn.connected {
    background: linear-gradient(145deg, #00cc00, #009900);
    border-color: #00ff00;
    color: #000;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.globe-btn.connected:hover {
    background: linear-gradient(145deg, #00dd00, #00aa00);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 255, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.globe-btn.connected:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.remote-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.channel-btn {
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 16px 12px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.3;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 3D Button Effect */
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.channel-btn:hover {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-color: rgba(0, 255, 0, 0.5);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.channel-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.channel-btn.active {
    border-color: var(--theme-color);
    box-shadow: 0 0 20px var(--theme-glow);
    background: rgba(0, 0, 0, 0.3);
}

.channel-btn .btn-number {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--theme-color);
}

.channel-btn.active .btn-number {
    color: var(--theme-color);
}

.channel-btn .btn-name {
    display: block;
    font-size: 10px;
    opacity: 0.8;
    text-align: center;
}

/* Action Buttons (Clear Color, Fullscreen, Moth Mode) */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 10px;
}

.action-btn {
    background: linear-gradient(145deg, #2a2a2a, #151515);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 14px 12px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    line-height: 1.2;
    /* 3D Button Effect */
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.action-btn:hover {
    background: linear-gradient(145deg, #3a3a3a, #252525);
    border-color: var(--theme-color);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.5), 0 0 20px var(--theme-glow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: #fff;
}

.action-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Loading Overlay */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--theme-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--theme-color);
    text-shadow: 0 0 10px var(--theme-glow);
}


/* Responsive adjustments */
@media (max-width: 768px) {
    /* Keep arrows on mobile but adjust positioning */
    .channel-nav-column {
        /* Don't hide - keep visible! */
    }
    
    /* Add spacing under button for dropdown */
    .remote-toggle-container {
        margin-bottom: 12px;
    }
    
    .remote-container {
        top: 30px;
        left: 20px;
        right: 20px;
        width: calc(100vw - 40px);
    }
    
    .remote-toggle {
        padding: 10px 14px;
        font-size: 12px;
        width: 100%;
    }
    
    .remote-dropdown {
        position: fixed;
        left: 20px;
        right: 20px;
        max-width: none;
        top: 110px;
        margin-top: 10px;
        max-height: calc(100vh - 130px);
        padding-bottom: 30px;
        -webkit-overflow-scrolling: touch;
    }
    
    .remote-dropdown.hidden {
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
    }
    
    .remote-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .channel-btn {
        min-width: 60px;
        padding: 14px 10px;
        font-size: 10px;
    }
    
    .channel-number {
        font-size: 16px;
    }
    
    .channel-name {
        font-size: 9px;
    }
}

