:root {
    --bg0: #1a0033;
    --bg1: #0a0a0a;
    --bg2: #000000;

    --accent: #c084fc;
    --accentSoft: rgba(168, 85, 247, 0.22);

    --textSoft: #d8b4fe;
    --glow: rgba(192, 132, 252, 0.4);

    --cursorW: 0.22em;
}

* { box-sizing: border-box; }

/* Fix iOS Safari “white bars” by ensuring the root background is dark */
html {
    height: 100%;
    background: #000;
}

body {
    margin: 0;
    min-height: 100dvh; /* dynamic viewport height (prevents gaps on iOS) */

    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: radial-gradient(circle at center, var(--bg0) 0%, var(--bg1) 60%, var(--bg2) 100%);
    color: #fff;

    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;

    /* prevents rubber-band revealing white */
    overscroll-behavior: none;
}

/* center glow */
body::before {
    content: "";
    position: absolute;
    width: min(650px, 92vw);
    height: min(650px, 92vw);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--accentSoft) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: clamp(1.1rem, 4.2vw, 2rem);
    width: min(900px, 92vw);
}

h1 {
    margin: 0 0 clamp(0.9rem, 3vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    font-size: clamp(3rem, 10.5vw, 7.5rem);

    background: linear-gradient(90deg, #ffffff, #e0bbff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    text-shadow: 0 0 60px var(--glow);
    line-height: 1.02;
}

.subtitle {
    font-size: clamp(1.05rem, 2.7vw, 1.95rem);
    font-weight: 500;
    color: var(--textSoft);
    margin: 0 auto;

    /* reserve space so layout doesn't jump while typing */
    min-height: 3.2em;
    max-width: 48ch;
}

.typing {
    display: inline-block;
    white-space: nowrap;
    border-right: var(--cursorW) solid var(--accent);
    padding-right: 0.15em;
}

.typing.blink {
    animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
    .typing, .typing.blink {
        animation: none !important;
        border-right-color: transparent;
    }
}

/* --- Player card --- */
.player{
    margin: clamp(0.9rem, 3.2vw, 1.2rem) auto 0;
    width: min(720px, 92vw);

    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: clamp(0.75rem, 2.5vw, 1rem);
    align-items: center;

    padding: clamp(0.8rem, 2.8vw, 0.95rem) clamp(0.85rem, 3vw, 1rem);
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(10px);
}

.player__cover{
    width: 72px;
    height: 72px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.player__meta{
    text-align: left;
    min-width: 0;
}

.player__title{
    font-weight: 700;
    font-size: clamp(1rem, 2.2vw, 1.05rem);
    color: #fff;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player__artist{
    margin-top: 0.25rem;
    font-weight: 500;
    color: rgba(216, 180, 254, 0.9);
    font-size: clamp(0.9rem, 2vw, 0.95rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player__bar{
    margin-top: 0.65rem;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    gap: 0.6rem;
    align-items: center;
}

.player__time{
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
}

.player__range{
    width: 100%;
    accent-color: var(--accent);
}

.player__btn{
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(192,132,252,0.18);
    color: #fff;
    padding: 0.65rem 0.95rem;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

.player__btn:hover{
    background: rgba(192,132,252,0.28);
}

/* ---- Phone layout ---- */
@media (max-width: 520px){
    /* allow typing to wrap on small screens instead of overflowing */
    .typing { white-space: normal; }

    .player{
        grid-template-columns: 56px 1fr;
        grid-auto-rows: auto;
        row-gap: 0.75rem;
    }

    .player__cover{
        width: 56px;
        height: 56px;
        border-radius: 12px;
    }

    .player__bar{
        grid-template-columns: 40px 1fr 40px;
        gap: 0.5rem;
    }

    .player__btn{
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* ---- iPad / tablet tuning ---- */
@media (min-width: 768px) and (max-width: 1024px){
    .content { width: min(860px, 92vw); }
    .player { width: min(760px, 92vw); }
}