/* --- CORE VARIABLES --- */
:root {
    --bg-deep: #050505;
    --glass-surface: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-green: #1DB954;
    --accent-purple: #5865F2; 
    --font-serif: 'Instrument Serif', serif;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --x: 50%; --y: 50%;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-deep); color: var(--text-primary); font-family: var(--font-sans); overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column; align-items: center; }

/* --- BACKGROUND FX --- */
#particle-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0.6; }
.spotlight-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at 50% 0%, #1f1f1f 0%, #050505 80%); z-index: -5; pointer-events: none; }
.noise-overlay { position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; opacity: 0.2; z-index: -3; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.2'/%3E%3C/svg%3E"); animation: noise 0.4s steps(10) infinite; }
@keyframes noise { 0% { background-position: 0 0; } 100% { background-position: 100% 100%; } }
body::before { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; background: radial-gradient(600px circle at var(--x) var(--y), rgba(255, 255, 255, 0.08) 0%, transparent 60%); mix-blend-mode: screen; }

/* --- BACKGROUND TYPOGRAPHY --- */
.bg-typography-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2; pointer-events: none; overflow: hidden;
}
.bg-text {
    position: absolute;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 13vw; 
    color: rgba(255, 255, 255, 0.03); 
    white-space: nowrap;
    filter: blur(4px); 
    user-select: none;
    line-height: 1;
}

/* --- UI ELEMENTS --- */
/* Status Pill - Centered */
.status-pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); padding: 6px 14px; border-radius: 30px; font-size: 0.8rem; margin-bottom: 20px; color: var(--text-secondary); letter-spacing: 0.5px; font-weight: 500; margin-left: auto; margin-right: auto; }
.status-dot { width: 6px; height: 6px; background: #00ff41; border-radius: 50%; box-shadow: 0 0 8px rgba(0,255,65,0.4); }

.nav-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); color: var(--text-secondary); padding: 12px 30px; border-radius: 50px; font-family: var(--font-sans); font-weight: 600; cursor: pointer; transition: 0.3s ease; backdrop-filter: blur(10px); letter-spacing: 1px; font-size: 0.85rem; text-transform: uppercase; margin-top: 25px; display: inline-block; }
.nav-btn:hover { background: #fff; color: #000; border-color: #fff; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255,255,255,0.1); }

/* --- OVERLAYS --- */
.about-overlay, .lyrics-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(5, 5, 5, 0.96); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1); padding: 20px; }
.about-overlay.active, .lyrics-overlay.active { opacity: 1; pointer-events: all; }

/* ABOUT CONTENT */
.about-content { max-width: 700px; text-align: center; transform: translateY(20px); transition: 0.5s; opacity: 0; position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
.about-overlay.active .about-content { transform: translateY(0); opacity: 1; transition-delay: 0.1s; }
.about-title { font-family: var(--font-serif); font-size: 5rem; margin-bottom: 20px; color: #fff; line-height: 1; font-style: italic; }
.about-text { font-size: 1.2rem; color: #aaa; line-height: 1.7; margin-bottom: 40px; font-weight: 300; }
.about-img { width: 100px; height: 100px; border-radius: 50%; background: #333; margin: 0 auto 30px; border: 2px solid rgba(255,255,255,0.1); background-image: url('icon.jpg'); background-size: cover; }

/* CLOSE BUTTON (FIXED TO SCREEN FOR ABOUT) */
.close-btn { 
    position: fixed; /* CHANGED FROM ABSOLUTE TO FIXED */
    top: 30px; 
    right: 30px; 
    background: transparent; 
    border: none; 
    color: var(--text-secondary); 
    font-size: 2rem; 
    cursor: pointer; 
    transition: 0.4s ease;
    z-index: 205; /* Higher than overlay */
}
.close-btn:hover { transform: rotate(90deg); color: #fff; background: rgba(255,255,255,0.1); border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; }

/* --- LYRICS POPUP (FIXED) --- */
.lyrics-overlay { z-index: 300; background: rgba(0,0,0,0.7); }
.lyrics-container { width: 100%; max-width: 450px; height: 70vh; background: rgba(20,20,20,0.95); border: 1px solid var(--glass-border); border-radius: 24px; display: flex; flex-direction: column; padding: 0; position: relative; transform: scale(0.95); transition: 0.3s ease; box-shadow: 0 20px 50px rgba(0,0,0,0.6); overflow: hidden; }
.lyrics-overlay.active .lyrics-container { transform: scale(1); }

.lyrics-header { padding: 40px 25px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: center; background: rgba(20,20,20,0.98); z-index: 5; }
#lyrics-song-title { font-family: var(--font-sans); font-weight: 800; font-size: 1.5rem; color: #fff; margin-bottom: 5px; line-height: 1.2; }
#lyrics-artist-name { font-size: 1rem; color: var(--accent-green); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; font-family: var(--font-serif); font-style: italic; }

.lyrics-scroll-area { flex: 1; overflow-y: auto; padding: 30px 25px; font-size: 1.2rem; line-height: 1.8; color: #ddd; white-space: pre-wrap; text-align: center; font-weight: 500; mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%); scroll-behavior: smooth; }
.lyrics-scroll-area::-webkit-scrollbar { width: 4px; }
.lyrics-scroll-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

/* Synced Lines */
.lyric-line { font-size: 1.1rem; line-height: 1.8; color: #666; margin-bottom: 15px; transition: 0.3s; font-weight: 500; cursor: default; }
.lyric-line.active { color: #fff; font-size: 1.3rem; font-weight: 700; text-shadow: 0 0 10px rgba(255,255,255,0.4); transform: scale(1.05); }

.lyrics-close-btn { position: absolute; top: 15px; right: 15px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.1); border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; z-index: 10; font-size: 1rem; }
.lyrics-close-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.1); }

/* --- LAYOUT --- */
.container { width: 100%; max-width: 1000px; padding: 60px 20px; display: flex; flex-direction: column; gap: 60px; z-index: 10; }
.hero { text-align: center; margin-bottom: 20px; display: flex; flex-direction: column; align-items: center; } 
.hero h1 { font-family: var(--font-sans); font-weight: 800; font-size: 5rem; line-height: 1.1; margin-bottom: 10px; background: linear-gradient(180deg, #fff 0%, #999 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; width: 100%; }
.bento-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.card { background: var(--glass-surface); border: 1px solid var(--glass-border); border-radius: 24px; padding: 25px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: 0.3s; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.card:hover { border-color: var(--glass-highlight); transform: translateY(-2px); background: rgba(255,255,255,0.05); }
.section-label { grid-column: span 12; font-family: var(--font-serif); font-size: 2rem; font-style: italic; margin-top: 20px; margin-bottom: 5px; color: var(--text-primary); opacity: 0.9; }

/* --- PLAYER --- */
.card-player { grid-column: span 12; display: flex; flex-direction: row; align-items: center; gap: 30px; padding: 35px; }
.player-meta { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 8px; }
.live-tag { font-size: 0.75rem; letter-spacing: 2px; color: #555; text-transform: uppercase; font-weight: 700; display: flex; align-items: center; gap: 10px; transition: color 0.3s; }
.card-player.is-playing .live-tag { color: var(--accent-green); text-shadow: 0 0 15px rgba(29,185,84,0.6); }
.lyrics-btn { color: var(--text-secondary); font-size: 1.1rem; background: rgba(255,255,255,0.05); width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.3s; opacity: 0; pointer-events: none; border: none; cursor: pointer; }
.card-player.is-playing .lyrics-btn { opacity: 1; pointer-events: all; }
.lyrics-btn:hover { background: #fff; color: #000; transform: scale(1.1); }
.audio-wave { display: flex; gap: 3px; align-items: flex-end; height: 15px; opacity: 0; }
.card-player.is-playing .audio-wave { opacity: 1; }
.audio-wave span { display: block; width: 3px; background: var(--accent-green); animation: wave 1s infinite ease-in-out; border-radius: 2px; }
.audio-wave span:nth-child(1) { height: 6px; animation-delay: 0s; }
.audio-wave span:nth-child(2) { height: 12px; animation-delay: 0.2s; } 
.audio-wave span:nth-child(3) { height: 8px; animation-delay: 0.4s; }
.audio-wave span:nth-child(4) { height: 5px; animation-delay: 0.1s; }
@keyframes wave { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.album-cover { width: 110px; height: 110px; border-radius: 12px; background: #111; background-size: cover; background-position: center; flex-shrink: 0; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.player-info { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; min-width: 0; }
.song-title { font-family: var(--font-serif); font-size: 2.2rem; line-height: 1.1; color: #fff; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-name { color: var(--text-secondary); font-size: 1.1rem; }
.progress-shell { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 10px; overflow: hidden; position: relative; }
.progress-fill { height: 100%; background: var(--accent-green); width: 0%; border-radius: 10px; transition: width 0.1s linear; position: relative; }
.progress-glow { position: absolute; top: 0; right: 0; width: 10px; height: 100%; background: #fff; box-shadow: 0 0 10px #fff; opacity: 0.7; }
.time-display { display: flex; justify-content: space-between; margin-top: 10px; font-size: 0.8rem; color: #666; font-family: monospace; }

/* --- OTHER CARDS --- */
.card-stat { grid-column: span 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 30px 20px; }
.stat-val { font-family: var(--font-sans); font-weight: 700; font-size: 2.5rem; line-height: 1; }
.stat-lbl { font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

.card-list { grid-column: span 6; padding: 0; }
.list-header { padding: 20px 25px; border-bottom: 1px solid var(--glass-border); font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); display: flex; justify-content: space-between; align-items: center; letter-spacing: 0.5px; }
.list-content { padding: 10px 0; }
/* TRACK ROW ALIGNMENT */
.track-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 15px; padding: 15px 25px; transition: 0.2s; }
.track-row:hover { background: rgba(255,255,255,0.03); }
.idx { font-weight: 600; font-size: 1.2rem; color: #555; text-align: center; }
.t-info { display: flex; flex-direction: column; min-width: 0; }
.t-name { font-size: 1rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { font-size: 0.85rem; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-meta { font-size: 0.75rem; color: #555; border: 1px solid #333; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }

.card-active-game { grid-column: span 12; display: none; flex-direction: row; align-items: center; gap: 25px; padding: 30px; background: linear-gradient(90deg, rgba(88, 101, 242, 0.08) 0%, rgba(0,0,0,0) 100%); border: 1px solid rgba(88, 101, 242, 0.3); animation: slideIn 0.5s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.active-game-thumb { width: 90px; height: 120px; border-radius: 8px; background: #222; background-size: cover; background-position: center; flex-shrink: 0; }
.active-game-badge { font-size: 0.75rem; font-weight: 800; color: var(--accent-purple); text-transform: uppercase; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dot-pulse { width: 8px; height: 8px; background: var(--accent-purple); border-radius: 50%; box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.7); animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(88, 101, 242, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(88, 101, 242, 0); } }
.card-game-container { grid-column: span 12; padding: 0; display: flex; flex-direction: column; max-height: 600px; }
.game-stats-bar { display: flex; gap: 30px; padding: 25px 30px; border-bottom: 1px solid var(--glass-border); overflow-x: auto; white-space: nowrap; }
.g-stat-item { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; transition: 0.2s; opacity: 0.5; position: relative; flex-shrink: 0; }
.g-stat-item.active { opacity: 1; transform: translateY(-2px); }
.g-stat-item.active::after { content: ''; position: absolute; bottom: -26px; width: 100%; height: 2px; background: #fff; }
.g-stat-num { font-family: var(--font-sans); font-weight: 800; font-size: 1.4rem; color: #fff; }
.g-stat-label { font-size: 0.7rem; color: #bbb; text-transform: uppercase; font-weight: 600; }
.game-scroll-box { flex: 1; overflow-y: auto; padding: 10px 0; }
.game-row { display: flex; align-items: center; padding: 15px 30px; gap: 20px; transition: 0.2s; border-bottom: 1px solid rgba(255,255,255,0.02); }
.game-row:hover { background: rgba(255,255,255,0.03); }
.game-thumb-wrapper { width: 45px; height: 60px; border-radius: 4px; overflow: hidden; background: #222; border: 1px solid rgba(255,255,255,0.05); }
.game-thumb-img { width: 100%; height: 100%; object-fit: cover; }
.game-name { font-size: 1rem; font-weight: 600; color: #fff; margin-bottom: 4px; }
.game-status-badge { display: inline-block; font-size: 0.65rem; padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,0.08); color: #aaa; text-transform: uppercase; }
.game-rating { font-size: 1.1rem; font-weight: 700; color: var(--accent-green); margin-left: auto; }
.card-social { grid-column: span 2; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; min-height: 100px; color: var(--text-secondary); text-decoration: none; }
.card-social:hover { color: #fff; background: rgba(255,255,255,0.08); }
.card-form { grid-column: span 12; padding: 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 20px; }
.input-group { display: flex; flex-direction: column; gap: 10px; }
input, textarea { background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); padding: 18px; border-radius: 12px; color: #fff; font-family: var(--font-sans); outline: none; transition: 0.3s; }
input:focus, textarea:focus { border-color: #fff; background: rgba(255,255,255,0.05); }
.submit-btn { margin-top: 30px; background: #fff; color: #000; border: none; padding: 18px 45px; border-radius: 50px; font-weight: 700; cursor: pointer; transition: transform 0.2s; }
.submit-btn:hover { transform: scale(1.02); }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .container { padding: 40px 15px; }
    .hero h1 { font-size: 3rem; }
    .card-player { flex-direction: column; text-align: center; padding: 25px; }
    .player-meta { justify-content: center; position: relative; margin-bottom: 15px; }
    .lyrics-btn { position: absolute; right: 0; top: 0; }
    .card-stat { grid-column: span 12; }
    .card-list { grid-column: span 12; }
    .card-social { grid-column: span 4; font-size: 1.3rem; min-height: 80px; width: 100%; justify-content: center; } 
    .social-spacer { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .bg-text { font-size: 25vw; opacity: 0.04; }
    
    /* MOBILE MODAL SCROLLING FIX */
    .about-overlay, .lyrics-overlay { align-items: flex-start; overflow-y: auto; padding: 60px 20px; }
    
    /* Ensure Close button stays fixed on mobile too */
    .close-btn { position: fixed; top: 20px; right: 20px; } 
    .about-title { font-size: 3rem; }
}
