body {
    margin: 0;
    padding: 0;
    background: #0a0a0a;
    color: #fff;
    font-family: 'Segoe UI', system-ui, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#canvas {
    border-radius: 50%;
    box-shadow: 0 0 100px rgba(255,255,255,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
    max-width: 90vw;
    max-height: 90vh;
    /* Prevent mobile touch selection highlights */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

#canvas:hover {
    transform: scale(1.02);
}

.controls {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.8);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 20px;
    z-index: 10;
    max-height: 80vh;
    overflow-y: auto;
}

.control-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tab-button {
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.control-group {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.control-group.active {
    display: flex;
}

.control-group h3 {
    margin: 0 0 10px 0;
    font-size: 12px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    width: 100%;
    text-align: left;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

button:active {
    transform: translateY(0);
}

button.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.info {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: rgba(0,0,0,0.7);
    padding: 15px 25px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.note-display {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 0 0 20px currentColor;
}

.frequency {
    font-size: 14px;
    opacity: 0.7;
}

.legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    padding: 15px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    max-width: 200px;
}

.legend h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #a78bfa;
}

.legend div {
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-sample {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
}

.github-link {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

.github-link a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 12px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.github-link a:hover {
    color: white;
    background: rgba(0,0,0,0.7);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.github-link svg {
    opacity: 0.8;
}

.github-link a:hover svg {
    opacity: 1;
}

/* Mobile Menu Buttons */
.mobile-controls-btn, .mobile-legend-btn {
    position: fixed;
    z-index: 20;
    background: rgba(0,0,0,0.9);
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    width: 44px;
    height: 44px;
}

.mobile-controls-btn {
    top: 20px;
    left: 20px;
    flex-direction: column;
    gap: 3px;
}

.mobile-legend-btn {
    top: 20px;
    right: 20px;
}

.mobile-controls-btn span {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
    display: block;
}

.legend-icon {
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.mobile-controls-btn:hover, .mobile-legend-btn:hover {
    background: rgba(0,0,0,0.95);
    border-color: rgba(255,255,255,0.7);
}

.mobile-controls-btn.active span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.mobile-controls-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-controls-btn.active span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.mobile-legend-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

/* Mobile Styles - covers both portrait and landscape */
@media (max-width: 1024px), (max-height: 768px) {
    body {
        overflow: auto;
    }
    
    .mobile-controls-btn, .mobile-legend-btn {
        display: flex !important;
    }
    
    .controls {
        position: fixed;
        left: -100%;
        top: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        transform: none;
        transition: left 0.3s ease;
        padding: 80px 20px 0;
        z-index: 15;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }
    
    .control-tabs {
        flex-shrink: 0;
        margin-bottom: 15px;
    }
    
    .control-group {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 20px;
    }
    
    .controls.mobile-open {
        left: 0;
    }
    
    .legend {
        position: fixed;
        right: -100%;
        top: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        transition: right 0.3s ease;
        z-index: 15;
        padding: 80px 20px 20px;
        box-sizing: border-box;
    }
    
    .legend.mobile-open {
        right: 0;
    }
    
    #canvas {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .info {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        max-width: calc(100vw - 40px);
    }
    
    button {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .tab-button {
        padding: 12px 16px;
        font-size: 16px;
        min-height: 44px;
    }
}