/* ============================================
   DESIGN SYSTEM – Draconyx Music
   Modern Glassmorphism v2 | SVG Icons
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #050714;
    --bg-light: #0A0D1F;
    --glass: rgba(255,255,255,0.03);
    --glass-hover: rgba(255,255,255,0.055);
    --glass-strong: rgba(255,255,255,0.08);
    --glass-border: rgba(255,255,255,0.06);
    --glass-border-hover: rgba(255,255,255,0.14);
    --blue: #3B82F6;
    --purple: #8B5CF6;
    --pink: #EC4899;
    --green: #10B981;
    --orange: #F59E0B;
    --cyan: #06B6D4;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --text-dark: #64748B;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-xl: 32px;
    --shadow: 0 8px 32px rgba(0,0,0,0.24);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.36);
    --shadow-xl: 0 24px 64px rgba(0,0,0,0.48);
    --shadow-glow-blue: 0 0 32px rgba(59,130,246,0.25);
    --shadow-glow-purple: 0 0 32px rgba(139,92,246,0.25);
    --gradient-primary: linear-gradient(135deg, #3B82F6, #8B5CF6);
    --gradient-secondary: linear-gradient(135deg, #EC4899, #F59E0B);
    --gradient-tertiary: linear-gradient(135deg, #10B981, #06B6D4);
    --gradient-warm: linear-gradient(135deg, #F59E0B, #EC4899);
    --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #050714;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Animated Background ── */
.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 55% 45% at 10% 20%, rgba(59,130,246,0.22) 0%, transparent 65%),
        radial-gradient(ellipse 45% 55% at 90% 80%, rgba(139,92,246,0.20) 0%, transparent 65%),
        radial-gradient(ellipse 35% 35% at 55% 5%,  rgba(236,72,153,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 85% 40%, rgba(16,185,129,0.07) 0%, transparent 60%),
        #050714;
    animation: bgPulse 14s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.03); }
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ── Header ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 40px;
    background: rgba(5,7,20,0.55);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.045);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
}


.header::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59,130,246,0.3) 40%,
        rgba(139,92,246,0.3) 60%,
        transparent 100%
    );
}

.logo {
    font-size: 1.45rem;
    font-weight: 800;
    background: linear-gradient(135deg, #93C5FD 0%, #C4B5FD 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    flex-shrink: 0;
    cursor: default;
}


/* ── Search Box ── */
.search-box {
    flex: 1;
    max-width: 420px;
    min-width: 180px;
    margin: 0 24px;
    position: relative;
    /* Zentriert sich automatisch zwischen Logo und Admin-Btn */
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-dark);
    pointer-events: none;
    transition: color var(--transition-normal);
}

.search-box:focus-within .search-icon {
    color: var(--blue);
}

.search-box input {
    width: 100%;
    padding: 10px 18px 10px 40px;
    background: rgba(255,255,255,0.07);   /* ← heller als vorher */
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    outline: none;
    /* Browser-Autofill-Override */
    -webkit-text-fill-color: var(--text);
}

.search-box input:focus {
    border-color: rgba(59,130,246,0.45);
    background: rgba(255,255,255,0.09);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}


.search-box input::placeholder {
    color: var(--text-dark);
    opacity: 1;
}

.search-box input:-webkit-autofill,
.search-box input:-webkit-autofill:hover,
.search-box input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(255,255,255,0.07) inset;
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
}

/* ── Admin Button ── */
.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    padding: 9px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition-spring);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    letter-spacing: 0.01em;
}

.admin-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.admin-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.admin-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.13);
    color: var(--text);
    transform: none;
    box-shadow: none;
}

.admin-btn:hover::after { opacity: 1; }
.admin-btn:active { transform: translateY(0) scale(0.99); }

/* ── Main Layout ── */
.main {
    padding: 48px 40px;
    max-width: 1280px;
    margin: 0 auto;
    padding-bottom: 160px;
}

/* ── Hero ── */
.hero {
    text-align: center;
    margin-bottom: 48px;
    padding: 90px 48px 80px;
    background: rgba(5, 7, 20, 0.7);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.06);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 32px 80px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.06);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59,130,246,0.7) 30%,
        rgba(139,92,246,0.7) 60%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: gradientSlide 5s linear infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -120px;
    left: -80px;
    width: 500px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(59,130,246,0.18) 0%, transparent 70%);
    pointer-events: none;
    animation: orbDrift 10s ease-in-out infinite;
}

@keyframes gradientSlide {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* Hero floating note decorations */
.hero-decoration {
    position: absolute;
    top: -100px;
    right: -80px;
    width: 450px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(139,92,246,0.16) 0%, transparent 70%);
    pointer-events: none;
    animation: orbDrift 12s ease-in-out infinite reverse;
    z-index: 0;
}

@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0); }
    33%       { transform: translate(25px, -20px); }
    66%       { transform: translate(-15px, 25px); }
}

.hero-note {
    position: absolute;
    opacity: 0;
    animation: noteFloat 8s ease-in-out infinite;
    color: rgba(255,255,255,0.07);
}

.hero-note:nth-child(1)  { top: 12%; left: 5%;  animation-delay: 0s; }
.hero-note:nth-child(2)  { top: 20%; left: 20%; animation-delay: 1.2s; }
.hero-note:nth-child(3)  { top: 10%; left: 40%; animation-delay: 2.4s; }
.hero-note:nth-child(4)  { top: 15%; left: 60%; animation-delay: 0.6s; }
.hero-note:nth-child(5)  { top: 18%; left: 80%; animation-delay: 1.8s; }
.hero-note:nth-child(6)  { top: 8%;  left: 92%; animation-delay: 3s; }
.hero-note:nth-child(7)  { bottom: 18%; left: 8%;  animation-delay: 0.3s; }
.hero-note:nth-child(8)  { bottom: 15%; left: 30%; animation-delay: 1.5s; }
.hero-note:nth-child(9)  { bottom: 20%; left: 55%; animation-delay: 2.7s; }
.hero-note:nth-child(10) { bottom: 12%; left: 75%; animation-delay: 0.9s; }

@keyframes noteFloat {
    0%   { opacity: 0; transform: translateY(0) rotate(0deg) scale(0.8); }
    20%  { opacity: 0.8; }
    50%  { opacity: 0.5; transform: translateY(-30px) rotate(10deg) scale(1.1); }
    80%  { opacity: 0.3; }
    100% { opacity: 0; transform: translateY(-60px) rotate(-5deg) scale(0.9); }
}


.hero-content {
    position: relative;
    z-index: 1;
}

.hero-sub {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 28px;
}

.hero-sub-dot {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--green);
    animation: livePulse 2s ease-in-out infinite;
}


.hero h1 {
    font-size: clamp(2.6rem, 5.5vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 18px;
    background: linear-gradient(
        135deg,
        #FFFFFF 0%,
        #93C5FD 30%,
        #C4B5FD 60%,
        #F9A8D4 85%,
        #FFFFFF 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientAnimation 8s ease infinite;
    line-height: 1.0;
    letter-spacing: -0.04em;
}

@keyframes gradientAnimation {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero p {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 400;
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ── Controls ── */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 32px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.controls select {
    padding: 9px 36px 9px 14px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 100px;
    color: var(--text-dark);
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 0;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2.5' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 12px;
    outline: none;
}

.controls select:hover {
    border-color: rgba(255,255,255,0.12);
    color: var(--text);
    background-color: rgba(255,255,255,0.06);
}

.controls select:focus {
    border-color: rgba(59,130,246,0.4);
    color: var(--text);
    background-color: rgba(59,130,246,0.06);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.controls select option {
    background: #0F1427;
    color: var(--text);
}

/* ── Track Grid ── */
.tracks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
    gap: 16px;
}

/* ── Track Card ── */
.track-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.055);
    border-radius: 16px;
    cursor: pointer;
    transition:
        transform var(--transition-spring),
        box-shadow var(--transition-normal),
        border-color var(--transition-normal),
        background var(--transition-normal);
    position: relative;
    overflow: hidden;
    transform: translateY(16px);
    opacity: 0;
    animation: cardAppear 0.45s ease-out forwards;
    /* Innerer Glanz oben */
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

@keyframes cardAppear {
    to { transform: translateY(0); opacity: 1; }
}

.track-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(59,130,246,0.8),
        rgba(139,92,246,0.8),
        transparent
    );
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 2;
}

.track-card:hover {
    transform: translateY(-6px);
    background: rgba(255,255,255,0.045);
    border-color: rgba(255,255,255,0.1);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 24px 48px rgba(0,0,0,0.45),
        0 0 80px rgba(59,130,246,0.07);
}

.track-card:hover::before,
.track-card.playing::before { opacity: 1; }


.track-card.playing {
    background: rgba(59,130,246,0.07);
    border-color: rgba(59,130,246,0.28);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 0 0 1px rgba(59,130,246,0.15),
        0 24px 48px rgba(0,0,0,0.4),
        0 0 60px rgba(59,130,246,0.14);
}

.track-card.playing::before { opacity: 1; }

/* ── Track Cover ── */
.track-cover-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.track-cover {
    width: 100%;
    height: 190px;
    object-fit: cover;
    object-position: center center;  /* ← explizit setzen */
    display: block;
    transition: transform 0.6s cubic-bezier(0.4,0,0.2,1), filter 0.3s ease;
}
.track-cover { height: 190px; }
.track-cover-placeholder {
    width: 100%;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;  /* ← verhindert dass er zusammengedrückt wird */
}

.track-card:hover .track-cover {
    transform: scale(1.07);
    filter: brightness(0.85);
}

.track-cover-placeholder {
    width: 100%;
    height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    position: relative;
}

.track-cover-placeholder svg {
    width: 64px;
    height: 64px;
    color: rgba(255,255,255,0.75);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

/* Genre-specific gradients */
.track-cover-placeholder[data-genre="electronic"] { background: linear-gradient(135deg, #3B82F6, #06B6D4); }
.track-cover-placeholder[data-genre="rock"]        { background: linear-gradient(135deg, #F59E0B, #EC4899); }
.track-cover-placeholder[data-genre="hip-hop"]     { background: linear-gradient(135deg, #8B5CF6, #EC4899); }
.track-cover-placeholder[data-genre="jazz"]        { background: linear-gradient(135deg, #10B981, #3B82F6); }
.track-cover-placeholder[data-genre="pop"]         { background: linear-gradient(135deg, #EC4899, #8B5CF6); }
.track-cover-placeholder[data-genre="ambient"]     { background: linear-gradient(135deg, #06B6D4, #10B981); }
.track-cover-placeholder[data-genre="classical"]   { background: linear-gradient(135deg, #8B5CF6, #3B82F6); }
.track-cover-placeholder[data-genre="other"]       { background: linear-gradient(135deg, #3B82F6, #8B5CF6); }

/* ── Track Overlay ── */
.track-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.65) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
    backdrop-filter: blur(2px);
    gap: 16px;
}

.track-card:hover .track-overlay { opacity: 1; }

/* Play Button */
.track-play-btn {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 50%;
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-spring);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.track-play-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
    border-radius: 50%;
}

.track-play-btn:hover {
    transform: scale(1.12);
    border-color: white;
    box-shadow: 0 0 24px rgba(255,255,255,0.25);
}

.track-play-btn:hover::before { opacity: 1; }

.track-play-btn svg {
    width: 26px;
    height: 26px;
    color: white;
    position: relative;
    z-index: 1;
    margin-left: 3px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Share Button */
.share-btn {
    background: rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-spring);
    backdrop-filter: blur(12px);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.share-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-tertiary);
    opacity: 0;
    transition: opacity var(--transition-normal);
    border-radius: 50%;
}

.share-btn svg {
    width: 18px;
    height: 18px;
    color: white;
    position: relative;
    z-index: 1;
}

.share-btn:hover {
    transform: scale(1.12);
    border-color: white;
    box-shadow: 0 0 20px rgba(16,185,129,0.35);
}

.share-btn:hover::before { opacity: 1; }

/* ── Track Info ── */
.track-info { padding: 16px 18px 18px; }

.track-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--text);
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.track-artist {
    color: var(--text-dark);
    font-size: 0.77rem;
    margin-bottom: 12px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.track-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.track-genre {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid rgba(255,255,255,0.07);
}

.track-duration {
    font-size: 0.72rem;
    color: var(--text-dark);
    font-variant-numeric: tabular-nums;
}

.track-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-count, .listen-count, .rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-dark);
    font-weight: 500;
}

.play-count svg, .listen-count svg { width: 11px; height: 11px; }
.rating svg { width: 11px; height: 11px; color: #F59E0B; }

/* ── Fixed Player Bar ── */
.player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(7, 9, 26, 0.94);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-top: 1px solid var(--glass-border);
    padding: 20px 40px;
    display: flex;
    align-items: center;
    gap: 32px;
    z-index: 200;
    box-shadow: 0 -1px 0 rgba(255,255,255,0.04), var(--shadow-xl);
    flex-wrap: wrap;
}

.player::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--purple), var(--pink));
    background-size: 300% 100%;
    animation: gradientSlide 5s linear infinite;
}

/* ── Player Info ── */
.player-info {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 260px;
    flex-shrink: 0;
}

.player-thumb {
    position: relative;
    flex-shrink: 0;
}

.player-thumb img {
    width: 62px;
    height: 62px;
    border-radius: var(--radius);
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: transform var(--transition-normal);
    display: block;
    position: relative;
    z-index: 1;
}

.player-thumb::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: calc(var(--radius) + 3px);
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
    animation: rotateBorder 3s linear infinite paused;
}

.player.playing .player-thumb::before {
    opacity: 1;
    animation-play-state: running;
}

@keyframes rotateBorder {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.player.playing .player-thumb img {
    transform: scale(1.04);
}

.player-text {
    overflow: hidden;
}

.player-track-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 3px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.player-track-artist {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ── Player Controls ── */
.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    flex-shrink: 0;
}

.ctrl-btn {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.2);
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-spring);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ctrl-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.ctrl-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-hover);
    opacity: 0;
    transition: opacity var(--transition-normal);
    border-radius: 50%;
}

.ctrl-btn:hover {
    border-color: rgba(255,255,255,0.55);
    transform: scale(1.1);
    box-shadow: 0 0 16px rgba(255,255,255,0.12);
}

.ctrl-btn:hover::before { opacity: 1; }
.ctrl-btn:active { transform: scale(0.95); }

#playBtn {
    background: var(--gradient-primary);
    border: none;
    width: 54px;
    height: 54px;
    box-shadow: 0 4px 20px rgba(59,130,246,0.35);
}

#playBtn svg {
    width: 22px;
    height: 22px;
}

#playBtn:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 28px rgba(59,130,246,0.5);
}

#playBtn.loading {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Progress Bar ── */
.player-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 200px;
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 100px;
    cursor: pointer;
    position: relative;
    transition: height var(--transition-fast);
}

.progress-bar:hover { height: 7px; }

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 100px;
    transition: width 0.1s linear;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(59,130,246,0.5);
    transition: transform var(--transition-fast);
}

.progress-bar:hover .progress-fill::after {
    transform: translateY(-50%) scale(1);
}

.progress-fill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

/* ── Volume Control ── */
.player-volume {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.volume-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.player-volume:hover .volume-icon { color: var(--text); }

/* Custom Range Slider */
.player-volume input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    outline: none;
}

/* Track */
.player-volume input[type="range"]::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 100px;
    background: linear-gradient(
        to right,
        var(--blue) 0%,
        var(--purple) var(--val, 70%),
        rgba(255,255,255,0.12) var(--val, 70%),
        rgba(255,255,255,0.12) 100%
    );
    transition: height var(--transition-fast);
}

.player-volume input[type="range"]::-moz-range-track {
    height: 3px;
    border-radius: 100px;
    background: rgba(255,255,255,0.12);
}

.player-volume input[type="range"]::-moz-range-progress {
    height: 3px;
    border-radius: 100px;
    background: linear-gradient(to right, var(--blue), var(--purple));
}

/* Thumb */
.player-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0px;
    height: 0px;
    border-radius: 50%;
    background: white;
    cursor: grab;
    box-shadow: 0 0 8px rgba(59,130,246,0.6);
    transition: width var(--transition-fast),
                height var(--transition-fast),
                box-shadow var(--transition-fast);
    margin-top: -4px;
}

.player-volume input[type="range"]::-moz-range-thumb {
    width: 0px;
    height: 0px;
    border: none;
    border-radius: 50%;
    background: white;
    cursor: grab;
    box-shadow: 0 0 8px rgba(59,130,246,0.6);
    transition: width var(--transition-fast),
                height var(--transition-fast);
}

/* Thumb erscheint nur beim Hover */
.player-volume:hover input[type="range"]::-webkit-slider-thumb {
    width: 11px;
    height: 11px;
    margin-top: -4px;
}

.player-volume:hover input[type="range"]::-moz-range-thumb {
    width: 11px;
    height: 11px;
}

/* Track wird dicker beim Hover */
.player-volume:hover input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
}

.player-volume:hover input[type="range"]::-moz-range-track,
.player-volume:hover input[type="range"]::-moz-range-progress {
    height: 4px;
}

/* Thumb beim Ziehen */
.player-volume input[type="range"]:active::-webkit-slider-thumb {
    cursor: grabbing;
    box-shadow: 0 0 14px rgba(59,130,246,0.8);
    transform: scale(1.2);
}

/* ── Share Toast ── */
.share-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(16,185,129,0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: var(--radius);
    padding: 14px 18px;
    color: #6ee7b7;
    font-size: 0.875rem;
    font-weight: 500;
    transform: translateX(calc(100% + 24px));
    transition: transform var(--transition-spring);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
    box-shadow: var(--shadow-lg);
}

.share-toast.show { transform: translateX(0); }

.share-toast-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── Generic Toasts ── */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(15, 20, 39, 0.92);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius);
    padding: 14px 18px;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transform: translateX(calc(100% + 24px));
    transition: transform var(--transition-spring);
    z-index: 1001;
    max-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
}

.toast.show { transform: translateX(0); }

.toast-error {
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.08);
    color: #FCA5A5;
}

.toast-success {
    border-color: rgba(16,185,129,0.3);
    background: rgba(16,185,129,0.08);
    color: #6EE7B7;
}

/* ── Loading ── */
.loading {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.08);
    border-top: 3px solid var(--blue);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin: 0 auto 16px;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 100px 40px;
    background: var(--glass);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    grid-column: 1 / -1;
}

.empty-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
    opacity: 0.5;
    animation: bounce 2.5s ease-in-out infinite;
}

.empty-icon svg {
    width: 72px;
    height: 72px;
    color: var(--blue);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    40%       { transform: translateY(-16px); }
    60%       { transform: translateY(-8px); }
}

.empty-state h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 1rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition-spring);
    border: none;
    cursor: pointer;
    letter-spacing: 0.01em;
    margin: 5px;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
}

/* ── Disclaimer ── */
.disclaimer {
    background: transparent;
    border: none;
    padding: 20px 0 0;
    margin: 24px 0 0;
}
.disclaimer::before { display: none; }

.disclaimer-content {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.disclaimer-icon svg {
    width: 14px;
    height: 14px;
    color: var(--text-dark);
    opacity: 0.5;
    animation: none;
}

.disclaimer-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.8;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.1) rotate(5deg); }
}

.disclaimer p {
    font-size: 0.72rem;
    color: var(--text-dark);
    opacity: 0.5;
    line-height: 1.5;
    margin: 0;
}

.disclaimer strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* ── Live Pulse ── */
.track-card.listening::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 9px;
    height: 9px;
    background: var(--green);
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 0 rgba(16,185,129,0.5);
    animation: livePulse 1.8s ease-in-out infinite;
}

@keyframes livePulse {
    0%  { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
    100%{ box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (min-width: 1920px) {
    .tracks { grid-template-columns: repeat(6, 1fr); }
    .main { max-width: 1680px; }
}

@media (min-width: 1440px) and (max-width: 1919px) {
    .tracks { grid-template-columns: repeat(5, 1fr); }
    .main { max-width: 1400px; }
}

@media (min-width: 1024px) and (max-width: 1439px) {
    .tracks { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .tracks { grid-template-columns: repeat(3, 1fr); gap: 22px; }
    .hero { padding: 60px 32px; }
    .header { padding: 15px 28px; }
    .player { padding: 18px 28px; gap: 24px; }
    .main { padding: 30px 28px; padding-bottom: 130px; }
}

@media (min-width: 481px) and (max-width: 767px) {
    .tracks { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .header { padding: 14px 18px; flex-direction: column; }
    .search-box { margin: 0; max-width: none; order: 2; width: 100%; }
    .logo { order: 1; }
    .admin-btn { order: 3; }
    .hero { padding: 44px 20px; margin-bottom: 36px; }
    .controls { flex-direction: column; align-items: center; }
    .controls select { width: 100%; max-width: 280px; }
    .player { padding: 14px 18px; flex-direction: column; gap: 14px; }
    .player-info, .player-controls, .player-progress, .player-volume {
        width: 100%; justify-content: center; min-width: auto;
    }
    .main { padding: 18px; padding-bottom: 200px; }
    .disclaimer-content { flex-direction: column; }
}

@media (max-width: 480px) {
    .tracks { grid-template-columns: 1fr; gap: 18px; }
    .main { padding: 14px; padding-bottom: 220px; }
    .header { padding: 14px; }
    .hero { padding: 36px 18px; margin-bottom: 28px; }
    .track-cover, .track-cover-placeholder { height: 180px; }
    .track-info { padding: 18px; }
    .player { padding: 14px; }
    .player-thumb img { width: 50px; height: 50px; }
    .ctrl-btn { width: 40px; height: 40px; }
    #playBtn { width: 48px; height: 48px; }
    .controls select { font-size: 16px; }
    .player-volume input { width: 70px; }
    .player-track-title, .player-track-artist { max-width: 140px; }
}

@media (max-width: 767px) and (orientation: landscape) {
    .hero { padding: 28px 20px; }
    .hero h1 { font-size: 1.8rem; }
    .player { flex-direction: row; padding: 10px 20px; }
    .main { padding-bottom: 90px; }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .track-card:hover { transform: none; }
    .bg-gradient { animation: none; }
}

@media (hover: none) and (pointer: coarse) {
    .track-overlay {
        opacity: 0.85;
        background: rgba(0,0,0,0.35);
    }
    .track-card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    .ctrl-btn { min-width: 44px; min-height: 44px; }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .track-cover, .player-thumb img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

@media print {
    .player, .header, .controls, .toast, .share-toast { display: none; }
    .main { padding: 0; }
    .tracks { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .track-card {
        background: white; color: black;
        border: 1px solid #ccc; break-inside: avoid;
    }
}