@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Share Tech Mono', monospace;
    background: #000;
    color: #0f0;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Scanline effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

.container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#knotCanvas {
    width: 100%;
    height: 100%;
    background: #050505;
    cursor: grab;
    display: block;
}

#knotCanvas:active {
    cursor: grabbing;
}

.controls-panel {
    width: 280px;
    min-width: 280px;
    background: rgba(0, 10, 0, 0.95);
    border-left: 2px solid #0f0;
    padding: 15px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: -5px 0 30px rgba(0, 255, 0, 0.1);
    position: absolute;
    right: 0;
    top: 0;
    height: 100vh;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.controls-panel h2 {
    font-size: 1rem;
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #030;
    font-weight: normal;
    letter-spacing: 2px;
}

.control-section {
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(0, 20, 0, 0.5);
    border: 1px solid #020;
    border-left: 3px solid #0a0;
}

.control-section h3 {
    font-size: 0.8rem;
    color: #0a0;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: normal;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.75rem;
}

.control-row label {
    min-width: 80px;
    color: #060;
}

.control-row input[type="range"] {
    flex: 1;
    height: 4px;
    background: #020;
    border-radius: 2px;
    cursor: pointer;
    accent-color: #0f0;
}

.control-row input[type="range"]::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    background: #0f0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px #0f0;
}

.control-row span {
    min-width: 35px;
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
    text-align: right;
}

.control-row select {
    flex: 1;
    padding: 5px 8px;
    background: rgba(0, 20, 0, 0.8);
    border: 1px solid #030;
    color: #0f0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
}

.control-row select:hover {
    border-color: #0f0;
}

.control-row select option {
    background: #000;
    color: #0f0;
}

.music-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.music-btn {
    flex: 1;
    padding: 8px 12px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    background: transparent;
    border: 1px solid #030;
    color: #0a0;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.music-btn:hover:not(:disabled) {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0f0;
    color: #0f0;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.music-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.now-playing {
    font-size: 0.7rem;
    color: #060;
    margin-top: 8px;
    padding: 5px;
    background: rgba(0, 10, 0, 0.5);
    border-left: 2px solid #030;
    min-height: 20px;
    word-break: break-all;
}

.now-playing.active {
    color: #0f0;
    border-left-color: #0f0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    margin-top: 10px;
    background: rgba(0, 10, 0, 0.8);
    border: 1px solid #020;
    font-size: 0.7rem;
    color: #050;
}

.instructions {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #040;
    z-index: 100;
    text-align: center;
}

/* Back link */
.back-link {
    position: fixed;
    top: 15px;
    left: 15px;
    color: #0f0;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 8px 16px;
    border: 1px solid #030;
    border-left: 3px solid #0f0;
    transition: all 0.2s ease;
    background: rgba(0, 10, 0, 0.9);
    z-index: 100;
}

.back-link:hover {
    border-color: #0f0;
    background: rgba(0, 40, 0, 0.8);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    transform: translateX(3px);
}

/* Hide controls class */
.controls-panel.hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* Scrollbar */
.controls-panel::-webkit-scrollbar {
    width: 6px;
}

.controls-panel::-webkit-scrollbar-track {
    background: #010;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: #030;
    border: 1px solid #050;
}

.controls-panel::-webkit-scrollbar-thumb:hover {
    background: #050;
}

/* Responsive */
@media (max-width: 700px) {
    .controls-panel {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 250px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    
    .back-link {
        font-size: 0.7rem;
        padding: 6px 12px;
    }
}

