body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #050510;
    color: white;
    font-family: 'Ubuntu', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

select, input, button {
    font-family: 'Ubuntu', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Glassmorphic Hamburger */
.hamburger {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 20;
    background: rgba(10, 15, 30, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-size: 1.5rem;
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.hamburger:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.hamburger.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* Glassmorphic Container */
#ui-container {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(10, 15, 30, 0.5);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 10;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 340px; /* Fixed width */
    max-height: 85vh;
    overflow-y: auto;
    transform-origin: top left;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#ui-container.hidden {
    opacity: 0;
    transform: scale(0.8) translate(-20px, -20px);
    pointer-events: none;
}

#btn-close-ui {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    color: #aaa;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    outline: none;
}
#btn-close-ui:hover {
    color: #fff;
}

h1 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    color: #fff;
    font-weight: 500;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Glassmorphic Buttons */
.btn-glass {
    background: #081933;
    color: #e0e0e0;
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    flex: 1;
    backdrop-filter: blur(5px);
}
.btn-glass:hover {
    background: #113a7a;
    border-color: rgba(0, 150, 255, 0.5);
    color: #fff;
}
.btn-glass:active {
    background: #0d2854;
}
.btn-glass:disabled {
    color: #666;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
    box-shadow: none;
}

input[type="file"] {
    display: none;
}

/* Range Sliders */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
    width: 100%;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: #081933;
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 4px;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #fff;
    margin-top: -4px;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    cursor: pointer;
}
input[type=range]:disabled::-webkit-slider-thumb {
    background: #555;
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: #081933;
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 4px;
}
input[type=range]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    cursor: pointer;
}
input[type=range]:disabled::-moz-range-thumb {
    background: #555;
}

/* Toggle Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  transition: .4s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #888;
  border-radius: 50%;
  transition: .4s;
}
input:checked + .slider {
  background-color: #8258ff;
  border-color: #ffffff;
}
input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

.color-controls {
    display: flex;
    flex-direction: row;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.9rem;
}
.color-controls label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Glassmorphic Selects */
.color-controls select {
    background: rgba(0, 0, 0, 0.3) url("data:image/svg+xml;utf8,<svg fill='%23cccccc' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") no-repeat right 5px center;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 30px 8px 10px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    width: 150px;
    font-size: 0.9rem;
}

.color-controls select:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.media-controls {
    display: flex;
    flex-direction: row;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

#status-text {
    margin-top: 15px;
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #888;
    text-align: center;
}

#media-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

#media-background img, #media-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

#visualizer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: auto;
    touch-action: none;
}
.custom-dropdown {
    position: relative;
    width: 100%;
    margin-top: 10px;
}
.dropdown-header {
    text-align: center;
    cursor: pointer;
    user-select: none;
}
.dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(8, 25, 51, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    z-index: 100;
    margin-top: 5px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.dropdown-list.show {
    display: block;
}
.dropdown-item {
    padding: 12px 10px;
    color: #fff;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.dropdown-item:hover {
    background: rgba(0, 242, 254, 0.2);
}
.dropdown-item:last-child {
    border-bottom: none;
}
.dropdown-list::-webkit-scrollbar {
    width: 6px;
}
.dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}
#global-loader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #00f2fe;
    transition: opacity 0.3s;
}
#global-loader.hidden {
    display: none;
}
.sci-fi-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}
.sci-fi-spinner::before, .sci-fi-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}
.sci-fi-spinner::before {
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    border: 3px solid transparent;
    border-top-color: #00f2fe;
    border-bottom-color: #00f2fe;
    animation: spin 2s linear infinite;
}
.sci-fi-spinner::after {
    top: -5px; left: -5px; right: -5px; bottom: -5px;
    border: 2px solid transparent;
    border-left-color: #ff007f;
    border-right-color: #ff007f;
    animation: spin-reverse 1.5s linear infinite;
}
#loader-text {
    color: rgba(255,255,255,0.8);
    font-family: 'Ubuntu', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 2px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes spin-reverse { 100% { transform: rotate(-360deg); } }

#orientation-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(8, 25, 51, 0.95);
    backdrop-filter: blur(15px);
    z-index: 10000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    font-family: 'Ubuntu', sans-serif;
    padding: 30px;
}

.orientation-message {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    max-width: 80%;
    line-height: 1.5;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* On mobile screens in portrait mode */
@media screen and (max-width: 900px) and (orientation: portrait) {
    #orientation-overlay {
        display: flex;
    }
}

/* For better mobile experience in landscape, scale down the UI */
@media screen and (max-width: 900px) and (orientation: landscape) {
    #ui-container {
        width: 280px;
        padding: 15px;
        top: 10px;
        left: 10px;
        transform: scale(0.9);
    }
    
    .hamburger {
        top: 10px;
        left: 10px;
        transform: scale(0.9);
    }
    
    .dropdown-list {
        max-height: 120px;
    }
}

#zoom-controls {
    position: absolute;
    bottom: 140px; /* Just above the piano */
    right: 20px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 200;
}
#zoom-controls button {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    padding: 0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* Only show toast on mobile layout initially */
@media screen and (min-width: 901px) {
    #demo-toast {
        display: none !important;
    }
}
#zoom-controls button {
    flex: none; /* override btn-glass */
    aspect-ratio: 1 / 1;
    border-radius: 50% !important;
    padding: 0 !important;
}

@media screen and (min-width: 901px) {
    #zoom-controls {
        display: none !important;
    }
}

@media screen and (max-width: 900px) {
    #btn-close-ui {
        display: none;
    }
}

