body { margin: 0; overflow: hidden; font-family: 'Helvetica Neue', Arial, sans-serif; background: #fff; color: #333; }
#cy { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }

#top-ui { position: absolute; top: 15px; left: 15px; right: 15px; z-index: 100; display: flex; gap: 15px; pointer-events: none; }
#ui-layer { display: flex; flex-direction: column; gap: 8px; width: 280px; pointer-events: auto; }

#legend-layer { margin-left: auto; width: 220px; background: rgba(255, 255, 255, 0.9); padding: 10px; border-radius: 8px; border: 1px solid #ccc; max-height: 200px; overflow-y: auto; pointer-events: auto; }
.legend-title { font-size: 12px; font-weight: bold; margin-bottom: 5px; border-bottom: 1px solid #eee; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; cursor: pointer; }
.legend-item input { cursor: pointer; }

.info-link { display: inline-flex; align-items: center; gap: 6px; color: #555; text-decoration: none; font-size: 13px; font-weight: bold; transition: 0.2s; width: fit-content; }
.info-icon { width: 18px; height: 18px; background: #333; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; }

.search-container { position: relative; }
#node-search { width: 100%; padding: 10px; border: 2px solid #333; border-radius: 8px; font-size: 14px; box-sizing: border-box; outline: none; background: rgba(255, 255, 255, 0.9); }
#search-results { position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #ccc; max-height: 200px; overflow-y: auto; display: none; z-index: 101; border-radius: 0 0 8px 8px; }
.search-item { padding: 10px; cursor: pointer; border-bottom: 1px solid #eee; }
.search-item:hover { background: #f0f0f0; }

.btn { padding: 8px; background: #333; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 12px; }
.btn-toggle { background: #666; }
.btn-toggle.on { background: #FF4500; }
.btn-analyze { background: #1DB954; display: none; }

.quick-ui-container { display: flex; gap: 4px; align-items: center; }
.quick-selector { display: flex; gap: 2px; }
.quick-status-btn { width: 28px; height: 28px; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.quick-status-btn.active { border-color: #333; background: #eee; box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }

#analysis-panel { position: absolute; bottom: 40px; left: 15px; width: 240px; background: rgba(255, 255, 255, 0.95); border: 2px solid #333; border-radius: 12px; padding: 12px; z-index: 150; display: none; flex-direction: column; gap: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.analysis-title { font-weight: bold; font-size: 14px; border-bottom: 1px solid #ccc; padding-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.analysis-row { display: flex; justify-content: space-between; font-size: 12px; }
.analysis-val { font-weight: bold; color: #FF4500; }

.spinner { display: none; width: 14px; height: 14px; border: 2px solid rgba(0,0,0,0.1); border-top-color: #FF4500; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#side-panel { position: absolute; right: -400px; top: 0; width: 350px; height: calc(100% - 100px); background: rgba(255, 255, 255, 0.98); box-shadow: -5px 0 15px rgba(0,0,0,0.1); z-index: 200; transition: 0.4s; padding: 20px; box-sizing: border-box; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; }
#side-panel.open { right: 0; }
.panel-close { align-self: flex-end; cursor: pointer; font-size: 28px; color: #999; padding: 5px; line-height: 1; }

.mark-btn { width: 80px; height: 80px; padding: 5px; border: 2px solid #ccc; border-radius: 12px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; flex: 0 0 auto; font-size: 40px; }
.mark-btn img { max-height: 65px; max-width: 100%; object-fit: contain; }
.mark-btn.active { border-color: #333; background: #e0e0e0; box-shadow: inset 0 2px 5px rgba(0,0,0,0.1); }

.button-container { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

.play-this-btn { flex: 1; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1DB954, #148C3D); color: white; text-decoration: none; border-radius: 25px; font-weight: bold; min-height: 48px; border: none; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.15); transition: 0.1s; font-size: 14px; }
.play-this-btn:active { transform: translateY(3px); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.play-this-btn[disabled] { background: #ccc; cursor: not-allowed; box-shadow: none; transform: none; color: #666; }

.lastfm-btn { flex: 1; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #d51007, #a00000); color: white; text-decoration: none; border-radius: 25px; font-weight: bold; min-height: 48px; box-shadow: 0 4px 6px rgba(0,0,0,0.15); transition: 0.1s; font-size: 14px; }
.lastfm-btn:active { transform: translateY(3px); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }

#fixed-player { position: absolute; bottom: 15px; right: 15px; width: 350px; min-height: 80px; z-index: 300; background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); overflow: hidden; display: none; }
#fixed-player.visible { display: block; }

@media screen and (max-width: 768px) {
    #top-ui { gap: 10px; padding: 10px; top: 10px; left: 10px; right: 10px; }
    #ui-layer { width: 42%; }
    .btn { padding: 6px 4px; font-size: 11px; letter-spacing: -0.5px; }
    #analysis-panel { bottom: 110px; width: 180px; }

    #side-panel { right: 10px; left: 10px; bottom: -100%; top: auto; width: calc(100% - 20px); height: auto; max-height: 40vh; transition: 0.4s; padding: 6px 12px !important; gap: 2px !important; }
    #side-panel.open { bottom: 20px; }
    #fixed-player { width: calc(100% - 20px); left: 10px; bottom: 10px; }

    .panel-close { font-size: 18px; padding: 0; margin-bottom: -12px; align-self: flex-end; }
    #panel-title { font-size: 14px !important; margin: 0 !important; padding: 0 !important; line-height: 1.2; }
    .mark-btn { width: 48px !important; height: 48px !important; font-size: 22px !important; border-radius: 6px; }
    .mark-btn img { max-height: 32px !important; }
    .button-container { margin-top: 2px !important; margin-bottom: 2px !important; gap: 6px !important; }
    .play-this-btn, .lastfm-btn { min-height: 32px !important; font-size: 11px !important; border-radius: 16px; }
}
