/* ===================================================================
   90s PLAYLIST — main stylesheet
   Palette: Sepia cream #EFE1BE · Deep umber #241409 · Rust #C1502E
            Mustard #D8A429 · Maroon #6E1F26 · Warm ink #3A2317
   Display: 'Yeseva One' (Latin retro serif) + 'Tiro Devanagari Hindi'
   Body:    'Poppins'   Mono/labels: 'Space Mono'
   =================================================================== */

:root {
    --umber: #241409;
    --umber-2: #1a0d06;
    --ink: #3a2317;
    --cream: #efe1be;
    --cream-dim: #d9c89f;
    --rust: #c1502e;
    --mustard: #d8a429;
    --maroon: #6e1f26;
    --green: #59c46a;

    --font-display: 'Yeseva One', serif;
    --font-hindi: 'Tiro Devanagari Hindi', serif;
    --font-body: 'Poppins', sans-serif;
    --font-mono: 'Space Mono', monospace;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --radius-lg: 22px;
    --radius-md: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    background: var(--umber-2);
    color: var(--cream);
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------------ */
/* Loading screen                                                     */
/* ------------------------------------------------------------------ */

.loader {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--umber-2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .5s ease, visibility .5s ease;
}
.loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-inner { text-align: center; }
.loader-brand {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2rem, 10vw, 3.2rem);
    letter-spacing: .12em;
    color: var(--cream);
    line-height: 1.15;
}
.loader-brand--accent { color: var(--rust); }
.loader-sub {
    display: block;
    margin-top: .6rem;
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .1em;
    color: var(--cream-dim);
    text-transform: uppercase;
}
.loader-bar {
    width: 140px;
    height: 3px;
    background: rgba(239,225,190,.15);
    margin: 1rem auto 0;
    border-radius: 2px;
    overflow: hidden;
}
.loader-bar span {
    display: block;
    height: 100%;
    width: 40%;
    background: var(--mustard);
    animation: loaderMove 1.1s ease-in-out infinite;
}
@keyframes loaderMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ------------------------------------------------------------------ */
/* App shell / hero                                                   */
/* ------------------------------------------------------------------ */

.app {
    position: relative;
    min-height: 100dvh;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

.hero {
    position: relative;
    min-height: 100dvh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: calc(14px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
    background-image:
        linear-gradient(180deg, rgba(20,11,5,.55) 0%, rgba(20,11,5,.35) 38%, rgba(15,8,4,.75) 78%, rgba(10,5,2,.92) 100%),
        var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: .05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    box-shadow: inset 0 0 22vw rgba(0,0,0,.65);
}

/* ------------------------------------------------------------------ */
/* Topbar: live counter + social                                      */
/* ------------------------------------------------------------------ */

.topbar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(20,11,5,.55);
    border: 1px solid rgba(239,225,190,.18);
    backdrop-filter: blur(6px);
    padding: 7px 13px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .04em;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(89,196,106,.6);
    animation: pulseDot 1.8s ease-out infinite;
}
@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(89,196,106,.55); }
    70% { box-shadow: 0 0 0 8px rgba(89,196,106,0); }
    100% { box-shadow: 0 0 0 0 rgba(89,196,106,0); }
}
.live-count { font-weight: 700; color: var(--mustard); }
.live-label { color: var(--cream-dim); text-transform: uppercase; font-size: .7rem; }

.social-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(20,11,5,.5);
    border: 1px solid rgba(239,225,190,.16);
    backdrop-filter: blur(6px);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 500;
    transition: background .2s ease, transform .2s ease;
}
.social-link:hover, .social-link:focus-visible { background: rgba(193,80,46,.35); transform: translateY(-1px); }
.social-link .link-arrow { font-size: .58rem; opacity: .75; }

/* ------------------------------------------------------------------ */
/* Hero title                                                         */
/* ------------------------------------------------------------------ */

.hero-title {
    position: relative;
    z-index: 3;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8vh 0 2vh;
}
.hero-title h1 {
    margin: 0;
    font-family: var(--font-hindi);
    font-weight: 400;
    line-height: 1.08;
    text-shadow: 0 6px 30px rgba(0,0,0,.55);
}
.hero-title .line {
    display: block;
    font-size: clamp(2.6rem, 15vw, 5.2rem);
    color: var(--cream);
}
.hero-title .line-2 {
    color: var(--mustard);
    margin-top: -2vw;
}
.hero-tagline {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--cream-dim);
    opacity: .85;
}

/* ------------------------------------------------------------------ */
/* Player — vintage cassette / radio deck                             */
/* ------------------------------------------------------------------ */

.player {
    position: relative;
    z-index: 3;
    width: 92%;
    max-width: 700px;
    margin: 0 auto;
}

.player-body {
    position: relative;
    background:
        linear-gradient(160deg, rgba(58,35,23,.92), rgba(36,20,9,.95)),
        repeating-linear-gradient(115deg, rgba(255,255,255,.025) 0 2px, transparent 2px 6px);
    border: 1px solid rgba(216,164,41,.35);
    border-radius: var(--radius-lg);
    padding: 16px 16px 12px;
    box-shadow:
        0 18px 40px rgba(0,0,0,.5),
        inset 0 1px 0 rgba(255,255,255,.06),
        inset 0 0 0 6px rgba(0,0,0,.15);
}

.player-brand {
    font-family: var(--font-mono);
    font-size: .62rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--cream-dim);
    margin-bottom: 4px;
}
.player-brand span { color: var(--mustard); }
.player-brand b { color: var(--rust); font-weight: 700; margin-left: 3px; }

.deck {
    display: flex;
    gap: 14px;
    align-items: center;
}

.artwork-frame {
    position: relative;
    flex: 0 0 auto;
    width: 84px;
    height: 84px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid rgba(216,164,41,.5);
    box-shadow: 0 6px 14px rgba(0,0,0,.4);
    background: var(--ink);
}
.artwork-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.reel {
    position: absolute;
    bottom: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--umber) 40%, var(--mustard) 42%, var(--umber) 55%);
    border: 1px solid rgba(0,0,0,.4);
    display: none; /* subtle detail, hidden on very small artwork to reduce clutter */
}

.track-info { flex: 1; min-width: 0; }
.track-title {
    margin: 2px 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--cream);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-artist {
    margin: 2px 0 0;
    font-size: .78rem;
    color: var(--cream-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eq {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    margin-top: 8px;
}
.eq span {
    width: 3px;
    background: var(--rust);
    border-radius: 2px;
    animation: eqBounce 1s ease-in-out infinite;
    opacity: .5;
}
.app.playing .eq span { opacity: 1; }
.eq span:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq span:nth-child(2) { height: 80%; animation-delay: .1s; }
.eq span:nth-child(3) { height: 55%; animation-delay: .2s; }
.eq span:nth-child(4) { height: 90%; animation-delay: .3s; }
.eq span:nth-child(5) { height: 65%; animation-delay: .4s; }
@keyframes eqBounce {
    0%, 100% { transform: scaleY(.4); }
    50% { transform: scaleY(1); }
}

/* Timeline */
.timeline-wrap { margin-top: 14px; }
.ticks {
    height: 4px;
    background-image: repeating-linear-gradient(90deg, rgba(239,225,190,.35) 0 1px, transparent 1px 8px);
    margin-bottom: 2px;
    border-radius: 2px;
}
.seek {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(239,225,190,.18);
    outline: none;
    cursor: pointer;
}
.seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--mustard);
    border: 2px solid var(--umber);
    box-shadow: 0 2px 6px rgba(0,0,0,.5);
    margin-top: -4.5px;
}
.seek::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--mustard);
    border: 2px solid var(--umber);
}
.seek::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: transparent; }

.time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: .68rem;
    color: var(--cream-dim);
}
.track-labels { letter-spacing: .12em; opacity: .6; }

/* Controls */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(239,225,190,.15);
}
.ctrl-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239,225,190,.06);
    border: 1px solid rgba(239,225,190,.2);
    color: var(--cream);
    font-size: 1rem;
    transition: background .2s ease, transform .15s ease;
}
.ctrl-btn:active { transform: scale(.92); }
.ctrl-btn--play {
    width: 56px;
    height: 56px;
    background: linear-gradient(160deg, var(--rust), var(--maroon));
    border-color: transparent;
    font-size: 1.25rem;
    box-shadow: 0 8px 18px rgba(193,80,46,.4);
}
.ctrl-btn--small { width: 36px; height: 36px; font-size: .85rem; margin-left: 4px; }

.yt-frame-host {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Spotify + empty states */
.player-body--spotify .spotify-note {
    font-size: .74rem;
    color: var(--cream-dim);
    margin: 2px 0 10px;
}
.spotify-frame { border-radius: var(--radius-md); }

.player-body--empty { text-align: center; padding: 26px 16px; }
.empty-note {
    color: var(--cream-dim);
    font-size: .85rem;
    margin-top: 10px;
}
.empty-note i { color: var(--mustard); margin-right: 6px; }

/* ------------------------------------------------------------------ */
/* Responsive                                                         */
/* ------------------------------------------------------------------ */

@media (min-width: 640px) {
    .hero { padding-left: 32px; padding-right: 32px; }
    .artwork-frame { width: 104px; height: 104px; }
    .reel { display: block; }
}

@media (min-width: 900px) {
    .hero-title { padding-top: 6vh; }
    .player-body { padding: 22px 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot, .eq span, .loader-bar span { animation: none !important; }
}
