:root {
    /* --- FARBPALETTE (NEON & GLASS) --- */
    --color-bg-dark: #020c1b;
    --color-panel: rgba(23, 42, 69, 0.90); /* Etwas deckender für Lesbarkeit */
    --color-primary: #64ffda;              /* Neon Cyan */
    --color-secondary: #8892b0;            /* Grau-Blau */
    --color-text: #e6f1ff;                 /* Weiß */
    --color-danger: #ff5f5f;               /* Rot für Fehler/Löschen */
    
    /* --- GRÖSSEN --- */
    --radius: 16px;
    --player-width: 750px; /* Ein kleines bisschen breiter für den Rahmen */
    --player-height: 320px; /* Kompakte Höhe, die genau für Ext. Player reicht */
    
    --blur-val: 12px;
}

body {
    background: radial-gradient(circle at 50% 50%, #112240 0%, #020c1b 100%);
    color: var(--color-text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

/* =========================================
   1. PLAYER STYLES
   ========================================= */

.rp-compact {
    width: var(--player-width);
    height: var(--player-height);
    background: var(--color-panel);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8);
    display: flex;
    position: relative;
    overflow: hidden; /* Damit nichts übersteht */
}

/* --- COVER BEREICH (LINKS) - NEU: FRAMED LOOK --- */
.rp-side-cover {
    width: 300px; /* Feste Breite für die linke Spalte */
    height: 100%;
    position: relative;
    flex-shrink: 0;
    z-index: 2;
    
    /* Zentriert das Bild in der Spalte */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Leichter Hintergrund für den Rahmen-Effekt */
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Glow Effekt (Hinter dem Bild) */
.cover-glow {
    position: absolute;
    width: 180px; height: 180px; /* Kleiner als das Bild */
    border-radius: 50%;
    background: var(--color-primary);
    filter: blur(50px);
    opacity: 0;
    transition: opacity 0.5s;
    z-index: -1;
}
.rp-compact.playing .cover-glow {
    opacity: 0.3;
    animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(0.9); opacity: 0.2; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

/* Das eigentliche Bild (Quadratisch & Schick) */
.rp-cover-img {
    width: 220px; 
    height: 220px; 
    object-fit: cover;
    
    /* Echte Abrundung, kein Fade-Out mehr */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    
    /* Maske entfernen für den Framed-Look */
    mask-image: none;
    -webkit-mask-image: none;
}

/* --- CONTROLS (RECHTS) --- */
.rp-side-controls {
    flex: 1;
    padding: 20px 30px; /* Etwas weniger Padding für Kompaktheit */
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.info-top { 
    display: flex; 
    align-items: flex-start; 
    justify-content: space-between;
    margin-bottom: 5px;
}

/* SONG TITEL & ARTIST */
.song-title { 
    font-weight: 800; font-size: 1.3rem; color: white;
    text-shadow: 0 0 20px rgba(0,0,0,0.5); margin: 0;
    line-height: 1.3;
}

.artist-name { 
    color: var(--color-primary); font-size: 0.9rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 1px; margin-top: 4px;
    margin: 0; 
}

/* Info Button */
.info-btn-large {
    font-size: 1.2rem; color: var(--color-secondary); cursor: pointer;
    margin-left: 15px; transition: all 0.2s; flex-shrink: 0; margin-top: 5px;
}
.info-btn-large:hover {
    color: var(--color-primary); transform: scale(1.1);
    text-shadow: 0 0 10px var(--color-primary);
}

/* Controls Buttons */
.controls-row {
    display: flex; align-items: center; gap: 20px; margin-top: 15px; margin-bottom: 10px;
}

.btn-main {
    width: 58px; height: 58px; /* Etwas kleiner */
    background: transparent; border: 2px solid var(--color-primary);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; box-shadow: 0 0 15px rgba(100,255,218,0.1);
    flex-shrink: 0;
}
.btn-main:hover {
    background: rgba(100,255,218, 0.1);
    box-shadow: 0 0 25px rgba(100,255,218,0.4); transform: scale(1.05);
}
.btn-main svg { width: 22px; fill: var(--color-primary); }
#icon-play { margin-left: 4px; }

/* Volume Slider & Icon */
.vol-wrap {
    flex: 1; display: flex; align-items: center; gap: 12px;
}
.vol-icon {
    width: 20px; text-align: center; cursor: pointer; font-size: 1rem;
    color: var(--color-secondary); transition: all 0.2s;
}
.vol-icon:hover { color: var(--color-primary); transform: scale(1.1); }
.vol-icon.muted { color: var(--color-danger); }

.vol-slider {
    width: 100%; height: 5px; background: rgba(255,255,255,0.1);
    border-radius: 3px; appearance: none; outline: none;
}
.vol-slider::-webkit-slider-thumb {
    appearance: none; width: 14px; height: 14px;
    background: var(--color-primary); border-radius: 50%;
    cursor: pointer; transition: transform 0.1s;
}
.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* Footer & Viz */
.tech-footer {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-top: 5px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 12px;
}
.stream-select {
    background: transparent; color: var(--color-secondary); border: none;
    font-family: 'Courier New', monospace; font-size: 0.75rem; cursor: pointer; outline: none;
}
.stream-select option { background: #020c1b; } 

/* LAUFZEIT ANZEIGE */
.runtime-display {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(100, 255, 218, 0.3);
}

/* Mini Visualizer */
.mini-viz { display: flex; gap: 3px; height: 16px; align-items: flex-end; }
.v-bar {
    width: 3px; background: var(--color-secondary); border-radius: 2px; height: 3px;
    transition: height 0.1s;
}

.rp-compact.playing .v-bar {
    background: var(--color-primary); 
    animation-name: vizJump;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

.v-bar:nth-child(1) { animation-duration: 0.5s; animation-delay: -0.2s; }
.v-bar:nth-child(2) { animation-duration: 0.7s; animation-delay: -0.5s; }
.v-bar:nth-child(3) { animation-duration: 0.6s; animation-delay: -0.1s; }
.v-bar:nth-child(4) { animation-duration: 0.8s; animation-delay: -0.3s; }

@keyframes vizJump { 
    0%, 100% { height: 3px; opacity: 0.5; } 
    50% { height: 16px; opacity: 1; } 
}

/* =========================================
   EXTERNE PLAYER LINKS (Winamp Style)
   ========================================= */
.ext-players {
    display: flex;
    justify-content: space-between; 
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.ext-btn {
    flex: 1; 
    text-decoration: none;
    color: var(--color-secondary);
    font-size: 0.8rem;
    padding: 8px;
    background: rgba(255,255,255,0.03); 
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.ext-btn i { font-size: 1.1rem; margin-bottom: 2px; }
.ext-btn span { font-size: 0.65rem; font-family: 'Segoe UI', sans-serif; font-weight: 600; opacity: 0.8; }

.ext-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.2);
    color: white;
}
.ext-btn.winamp:hover i { color: #ffcb00; text-shadow: 0 0 10px rgba(255, 203, 0, 0.6); }
.ext-btn.vlc:hover i { color: #ff8800; text-shadow: 0 0 10px rgba(255, 136, 0, 0.6); }
.ext-btn.wmp:hover i { color: #00aaff; text-shadow: 0 0 10px rgba(0, 170, 255, 0.6); }

/* =========================================
   LAUFSCHRIFT & KOPIEREN
   ========================================= */
.meta-wrapper {
    overflow: hidden; 
    position: relative;
    max-width: 340px; 
    cursor: pointer;
}
.scrolling-text { display: inline-block; white-space: nowrap; padding-right: 50px; }
.is-scrolling { animation: scroll-left 12s linear infinite; }
@keyframes scroll-left {
    0% { transform: translateX(0); }
    20% { transform: translateX(0); } 
    100% { transform: translateX(-100%); } 
}
.meta-wrapper:active { transform: scale(0.98); opacity: 0.8; }

.copy-toast {
    position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
    background: var(--color-primary); color: var(--color-bg-dark);
    padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: bold;
    opacity: 0; pointer-events: none; transition: opacity 0.3s, top 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); z-index: 100;
}
.copy-toast.show { opacity: 1; top: -50px; }

/* =========================================
   2. TECH MODAL
   ========================================= */
.rp-modal-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(2, 12, 27, 0.95); z-index: 999; display: flex;
    justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
    border-radius: var(--radius); backdrop-filter: blur(10px);
}
.rp-modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-box {
    background: rgba(10, 25, 47, 0.9); border: 1px solid var(--color-primary);
    padding: 25px; border-radius: 12px; font-family: 'Courier New', monospace;
    width: 320px; box-shadow: 0 0 40px rgba(100,255,218,0.15); text-align: left;
}
.modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px;
    margin-bottom: 10px; color: var(--color-primary); font-weight: bold;
    display: flex; justify-content: space-between;
}
.tech-table { width: 100%; font-size: 0.85rem; color: var(--color-secondary); }
.tech-table td { padding: 4px 0; }
.tech-val { text-align: right; color: white; word-break: break-all; }
.close-tech {
    display: block; width: 100%; margin-top: 15px;
    background: rgba(100,255,218, 0.1); border: none; color: var(--color-primary);
    padding: 8px; cursor: pointer; font-family: 'Courier New', monospace; font-weight: bold;
}
.close-tech:hover { background: var(--color-primary); color: #000; }

/* =========================================
   3. ADMIN PANEL STYLES
   ========================================= */
.rp-admin-nav {
    background: var(--color-panel); padding: 15px 40px; display: flex;
    justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05); margin-bottom: 30px;
}
.rp-admin-nav a { color: var(--color-text); text-decoration: none; margin-left: 20px; font-size: 0.9rem; transition: color 0.2s; }
.rp-admin-nav a:hover, .rp-admin-nav a.active { color: var(--color-primary); }

.rp-card {
    background: var(--color-panel); border-radius: 8px; padding: 20px;
    margin-bottom: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}

.rp-table { width: 100%; border-collapse: collapse; color: var(--color-text); }
.rp-table th { text-align: left; padding: 10px; border-bottom: 2px solid var(--color-primary); color: var(--color-primary); font-weight: 600; }
.rp-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }

.rp-input {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white;
    padding: 10px; border-radius: 4px; width: 100%; box-sizing: border-box; outline: none;
}
.rp-input:focus { border-color: var(--color-primary); }

.rp-btn {
    background: var(--color-primary); color: var(--color-bg-dark); border: none;
    padding: 8px 16px; border-radius: 4px; cursor: pointer; font-weight: bold; text-decoration: none; display: inline-block; transition: opacity 0.2s;
}
.rp-btn:hover { opacity: 0.9; }
.rp-btn-danger { background: var(--color-danger); color: white; }
.rp-badge-on { color: #2ecc71; font-weight: bold; }
.rp-badge-off { color: #e74c3c; font-weight: bold; }

/* Admin Cover Grid */
.rp-cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 15px; margin-top: 20px; }
.rp-cover-item {
    background: rgba(0,0,0,0.2); border-radius: 8px; padding: 5px; text-align: center; position: relative;
    border: 1px solid rgba(255,255,255,0.05); transition: transform 0.2s;
}
.rp-cover-item:hover { transform: translateY(-2px); border-color: var(--color-primary); }
.rp-cover-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; display: block; }
.rp-cover-item .delete-btn {
    position: absolute; top: -8px; right: -8px; background: var(--color-danger); color: white; border-radius: 50%; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center; font-size: 0.8rem; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    text-decoration: none; z-index: 10;
}

/* =========================================
   4. RESPONSIVE (HANDY & TABLET)
   ========================================= */
@media screen and (max-width: 768px) {
    :root {
        --player-width: 90%;
        --player-height: auto; /* Höhe flexibel auf Handy */
    }
    .rp-compact {
        flex-direction: column; height: auto; padding-bottom: 20px; margin: 20px 0;
    }
    
    /* Cover wieder oben und rechteckig, aber kleiner */
    .rp-side-cover { 
        width: 100%; 
        height: 250px; /* Auf dem Handy wieder Standard */
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .rp-cover-img { 
        width: 180px; height: 180px; /* Kleiner auf Handy */
    }
    
    .rp-side-controls { padding: 20px; gap: 20px; }
    
    .meta-wrapper { max-width: 100%; }
    .song-title { font-size: 1.3rem; }
    
    .controls-row { justify-content: space-between; gap: 15px; }
    
    .tech-footer { flex-wrap: wrap; gap: 10px; }
    .stream-select { font-size: 0.7rem; max-width: 150px; }
    
    .runtime-display { width: 100%; text-align: center; order: 3; margin-bottom: 10px; }
    
    .modal-box { width: 85%; }

    /* WICHTIG: EXT PLAYER AUF HANDY AUSBLENDEN */
    .ext-players { display: none !important; }
}

/* --- VOLUME PROZENT ANZEIGE --- */
#vol-value {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: bold;
    min-width: 35px; /* Feste Breite damit es nicht springt */
    text-align: right;
    margin-left: 5px;
    user-select: none;
}