@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

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

body {
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    color: #d4d4d4;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}


header {
    background: linear-gradient(135deg, #ff9447 0%, #ff7b29 100%);
    border: 3px solid #ffab70;
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 0 15px rgba(255, 148, 71, 0.2),
                inset 0 0 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    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;
}

.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.mascot-logo {
    width: 150px;
    height: 150px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    object-fit: contain;
    margin-bottom: 10px;
}



header h1 {
    font-size: 48px;
    color: #000;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.tagline {
    color: #1a1a1a;
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.credits {
    color: #000;
    font-size: 12px;
    margin-top: 10px;
    opacity: 0.8;
}

.credits a {
    color: #000;
    text-decoration: underline;
    font-weight: bold;
}

.credits a:hover {
    color: #1a1a1a;
}


.controls {
    background: #252525;
    border: 2px solid #ff9447;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 8px rgba(232, 93, 0, 0.15);
}

.game-section {
    margin-bottom: 15px;
}

.game-section label {
    display: block;
    margin-bottom: 8px;
    color: #ffab70;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

.search-section {
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    background: #1c1c1c;
    border: 2px solid #ff9447;
    border-radius: 4px;
    color: #d4d4d4;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #ffab70;
    box-shadow: 0 0 8px rgba(232, 93, 0, 0.25);
}

.filter-section {
    margin-bottom: 15px;
}

.filter-section label {
    display: block;
    margin-bottom: 8px;
    color: #ffab70;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}


.autoplay-section {
    margin-bottom: 15px;
}

.autoplay-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.autoplay-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #3a3a3a;
    border-radius: 13px;
    transition: background 0.3s ease;
    border: 2px solid #555;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #888;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.autoplay-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #ff9447;
    border-color: #ffab70;
}

.autoplay-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    background: #000;
    transform: translateX(24px);
}

.toggle-label {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: bold;
}

.autoplay-toggle:hover .toggle-slider {
    border-color: #ff9447;
}

.autoplay-toggle:hover .toggle-label {
    color: #ffab70;
}


.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    padding: 10px 40px 10px 15px;
    font-size: 14px;
    background: #1a1a1a;
    border: 2px solid #ff6600;
    border-radius: 4px;
    color: #e0e0e0;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.custom-select-trigger:hover {
    border-color: #ff8833;
    background-color: #252525;
}

.custom-select-trigger.active {
    border-color: #ff8833;
    box-shadow: 0 0 8px rgba(255, 102, 0, 0.3);
    background-color: #252525;
}

.custom-select-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
}

.custom-select-trigger.active .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #1c1c1c;
    border: 2px solid #ff9447;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.custom-select-options.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.custom-select-option {
    padding: 12px 15px;
    cursor: pointer;
    color: #d4d4d4;
    transition: all 0.2s ease;
    border-bottom: 1px solid #252525;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background: #252525;
    color: #ffab70;
    padding-left: 20px;
}

.custom-select-option.selected {
    background: #252525;
    color: #ffab70;
    font-weight: bold;
}

.custom-select-option.selected::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 2px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><polygon points="3,2 10,6 3,10" fill="%23ff9447"/></svg>') no-repeat center center;
    background-size: 12px 12px;
}

.custom-select-option.optgroup-label {
    background: #252525;
    color: #ffab70;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    padding: 8px 15px;
    cursor: default;
    letter-spacing: 1px;
    border-bottom: 1px solid #ff9447;
}

.custom-select-option.optgroup-label:hover {
    background: #252525;
    padding-left: 15px;
}

.custom-select-option.optgroup-item {
    padding-left: 25px;
}


.custom-select-options::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: #1c1c1c;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: #ff9447;
    border-radius: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: #ffab70;
}


.filter-select {
    display: none;
}

.stats {
    text-align: center;
    padding: 10px;
    background: #1c1c1c;
    border-radius: 4px;
    color: #ffab70;
    font-weight: bold;
}


.loading, .error {
    text-align: center;
    padding: 40px;
    background: #252525;
    border: 2px solid #ff9447;
    border-radius: 4px;
    margin-bottom: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top: 4px solid #ff9447;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    border-color: #ff3333;
    color: #ff6666;
}


.sound-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 100px;
}

.sound-item {
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 4px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sound-item:hover {
    border-color: #ff9447;
    box-shadow: 0 0 12px rgba(232, 93, 0, 0.25);
    transform: translateY(-2px);
}

.sound-category {
    display: inline-block;
    background: #ff9447;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.sound-name {
    font-weight: bold;
    color: #ffab70;
    margin-bottom: 5px;
    font-size: 14px;
    word-break: break-word;
}

.sound-path {
    font-size: 12px;
    color: #888;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}


.audio-player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.audio-player {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 3px solid #ff9447;
}

.play-pause-btn {
    width: 50px;
    height: 50px;
    background: #ff9447;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

.play-pause-btn:hover {
    background: #ffab70;
    box-shadow: 0 0 12px rgba(232, 93, 0, 0.4);
    transform: scale(1.05);
}

.btn-icon {
    pointer-events: none;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.now-playing-text {
    color: #ffab70;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid #3a3a3a;
}

.progress-bar-container:hover {
    border-color: #ff9447;
}

.progress-bar {
	position: absolute;
	inset: 0;
	height: 100%;
	background: linear-gradient(90deg, #ff6600 0%, #ff8833 100%);
	transform: scale3d(0, 1, 1);
	transform-origin: left;
	
	will-change: transform;
	backface-visibility: hidden;
	-webkit-transform: translateZ(0) scale3d(0,1,1);
	contain: paint;
  }

.progress-bar.seeking {
    transition: none;
}

.time-display {
    color: #888;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    min-width: 85px;
}

#audioPlayer {
    display: none;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.volume-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    color: #ff9447;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.volume-btn:hover {
    background: rgba(255, 148, 71, 0.1);
    color: #ffab70;
}

.volume-slider {
    width: 100px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #ff9447 0%, #ff9447 var(--volume-percent, 100%), #3a3a3a var(--volume-percent, 100%), #3a3a3a 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #ff9447;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-top: -5px;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #ff9447;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.volume-slider::-webkit-slider-thumb:hover {
    border-color: #ffab70;
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(255, 148, 71, 0.6);
}

.volume-slider::-moz-range-thumb:hover {
    border-color: #ffab70;
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(255, 148, 71, 0.6);
}

.volume-slider:hover {
    background: linear-gradient(to right, #ffab70 0%, #ffab70 var(--volume-percent, 100%), #3a3a3a var(--volume-percent, 100%), #3a3a3a 100%);
}

.volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border-radius: 3px;
}

.volume-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border-radius: 3px;
}

.volume-slider::-moz-range-progress {
    background: #ff9447;
    height: 6px;
    border-radius: 3px;
}

.download-btn, .close-btn {
    padding: 10px 20px;
    background: #ff9447;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.download-btn:hover {
    background: #ffab70;
    box-shadow: 0 0 10px rgba(232, 93, 0, 0.4);
}

.close-btn {
    background: #555;
    padding: 10px 12px;
    justify-content: center;
}

.close-btn:hover {
    background: #777;
}


@media (max-width: 768px) {
    header h1 {
        font-size: 32px;
    }
    
    .lambda-logo {
        font-size: 50px;
    }
    
    .sound-list {
        grid-template-columns: 1fr;
    }
    
    .audio-player {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .play-pause-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .player-info {
        flex: 1 1 100%;
        order: -1;
    }
    
    .volume-control {
        flex: 1;
    }
    
    .volume-slider {
        width: 100%;
    }
    
    .download-btn {
        flex: 1;
    }
    
    .close-btn {
        flex: 0;
    }
}


.midi-controls-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.midi-time-display {
    color: #ffab70;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    white-space: nowrap;
}

.visualizer-toggle-btn {
    padding: 10px 12px;
    background: #555;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.visualizer-toggle-btn:hover {
    background: #ff9447;
    box-shadow: 0 0 10px rgba(232, 93, 0, 0.4);
}

.visualizer-toggle-btn.active {
    background: #ff9447;
}


.midi-visualizer-pane {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(10px);
    border: 3px solid #ff9447;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    z-index: 999;
    animation: slideUpFade 0.3s ease;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.visualizer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #252525;
    border-bottom: 2px solid #ff9447;
}

.visualizer-title {
    color: #ffab70;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-visualizer-btn {
    background: transparent;
    border: none;
    color: #ff9447;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.close-visualizer-btn:hover {
    background: rgba(255, 148, 71, 0.2);
    color: #ffab70;
}

.midi-visualizer-wrapper {
    background: #ffffff;
    padding: 20px;
    min-height: 250px;
    max-height: 400px;
    overflow: auto;
}


midi-player {
    display: block;
    width: 100%;
}

midi-visualizer {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 250px;
    border-radius: 4px;
    overflow: hidden;
}


midi-visualizer::part(piano-roll) {
    background-color: #ffffff !important;
}

midi-visualizer {
    --background-color: #ffffff;
    --note-color: #ff9447;
    --active-note-color: #ff6600;
    --grid-color: #e0e0e0;
}

@media (max-width: 768px) {
    .midi-visualizer-pane {
        width: 95%;
        bottom: 80px;
    }
    
    .midi-visualizer-wrapper {
        min-height: 200px;
        max-height: 300px;
        padding: 15px;
    }
    
    midi-visualizer {
        min-height: 200px;
    }
    
    .visualizer-header {
        padding: 12px 15px;
    }
    
    .visualizer-title {
        font-size: 14px;
    }
}



.analytics-disclaimer {
    text-align: center;
    margin: 10px auto 20px;
}

.analytics-disclaimer p {
    margin: 0;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.analytics-disclaimer a {
    color: #ff6600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.analytics-disclaimer a:hover {
    color: #ff9447;
    text-decoration: underline;
}


.loading-more {
    text-align: center;
    padding: 30px;
    color: #888;
}

.loading-more .loading-spinner {
    width: 30px;
    height: 30px;
    margin: 0 auto 15px;
}

.loading-more p {
    margin: 0;
    font-size: 14px;
}

#scroll-sentinel {
    height: 1px;
    margin: 0;
    padding: 0;
}


::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1c1c1c;
}

::-webkit-scrollbar-thumb {
    background: #ff9447;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ffab70;
}

.analytics-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #252525;
    color: #ffab70;
    border-top: 2px solid #ff9447;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    z-index: 2000;
    font-size: 15px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
}
.analytics-banner-text a {
    color: #ff6600;
    text-decoration: underline;
}
.analytics-banner-btn {
    background: #ff9447;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.analytics-banner-btn:hover {
    background: #ffab70;
}
@media (max-width: 600px) {
    .analytics-banner {
        flex-direction: column;
        font-size: 13px;
        padding: 12px 8px;
        gap: 10px;
    }
    .analytics-banner-btn {
        width: 100%;
    }
}

.sourcesfx-button-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 18px;
    margin-bottom: 0;
}
.sourcesfx-button-wrapper img {
    border: none !important;
    box-shadow: none !important;
    background: none;
	width: 88px;
	height: 31px;
}
