/* ============================================================
   Self-Hosted Bio – Glass Card
   ============================================================ */

:root{
    --accent: #f27db3;
    --dim: 0.45;
    --bg-blur: 0px;
    --card-bg: rgba(14, 14, 18, 0.55);
    --card-border: rgba(255,255,255,0.10);
    --text: #f4f4f6;
    --text-dim: rgba(244,244,246,0.62);
    --radius: 20px;
}

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

html, body{ height: 100%; }

body{
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: #0a0a0c;
    display: grid;
    place-items: center;
    min-height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Hintergrund ---------- */
.bg{ position: fixed; inset: 0; z-index: -2; }
.bg-media{
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    filter: blur(var(--bg-blur));
    transform: scale(1.04);
}
.bg-overlay{
    position: absolute; inset: 0;
    background: rgba(0,0,0,var(--dim));
}

/* ---------- Enter-Splash ---------- */
.enter{
    position: fixed; inset: 0; z-index: 50;
    display: grid; place-items: center;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    transition: opacity .6s ease, backdrop-filter .6s ease;
}
.enter.leaving{ opacity: 0; pointer-events: none; backdrop-filter: blur(0); }
.enter-text{
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    letter-spacing: .35em;
    text-transform: lowercase;
    color: var(--text);
    padding-left: .35em;
    animation: pulse 2.2s ease-in-out infinite;
    text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 60%, transparent);
}
@keyframes pulse{ 0%,100%{ opacity:.55; } 50%{ opacity:1; } }

/* ---------- Karte ---------- */
.wrap{ padding: 24px; width: 100%; display: grid; place-items: center; }
.wrap[hidden]{ display: none; }

.card{
    position: relative;
    width: min(420px, 92vw);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow: 0 24px 60px -20px rgba(0,0,0,.7),
                0 0 0 1px rgba(255,255,255,.03) inset;
    overflow: hidden;
    padding-bottom: 22px;
    animation: rise .7s cubic-bezier(.16,1,.3,1) both;
}
@keyframes rise{ from{ opacity:0; transform: translateY(16px) scale(.985); } }

/* ---------- Banner ---------- */
.banner{ height: 116px; overflow: hidden; }
.banner img{ width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Avatar ---------- */
.avatar-shell{
    display: flex; justify-content: center;
    margin-top: -46px;
}
.avatar-shell.no-banner{ margin-top: 26px; }
.avatar{
    position: relative;
    width: 92px; height: 92px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 30%, #fff));
    box-shadow: 0 0 26px -4px color-mix(in srgb, var(--accent) 70%, transparent);
}
.avatar img{
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid rgba(10,10,12,.9);
}
/* Sparkles */
.avatar.sparkle::before,
.avatar.sparkle::after{
    content: "";
    position: absolute;
    width: 10px; height: 10px;
    background:
      radial-gradient(circle, #fff 0 22%, transparent 24%) no-repeat,
      radial-gradient(circle, #fff 0 22%, transparent 24%) no-repeat;
    background-size: 100% 2px, 2px 100%;
    background-position: center;
    filter: drop-shadow(0 0 4px #fff);
    animation: twinkle 2.6s ease-in-out infinite;
}
.avatar.sparkle::before{ top: 2px; right: 4px; }
.avatar.sparkle::after{ bottom: 8px; left: 0; width: 7px; height: 7px; animation-delay: 1.1s; }
@keyframes twinkle{
    0%,100%{ opacity: 0; transform: scale(.4) rotate(0); }
    50%{ opacity: 1; transform: scale(1) rotate(45deg); }
}

/* ---------- Identität ---------- */
.identity{ text-align: center; margin-top: 12px; padding: 0 22px; }
.name{
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 1.4rem; font-weight: 700; letter-spacing: .2px;
}
.name-text{
    background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--accent) 45%, #fff));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.badge{
    display: inline-grid; place-items: center;
    width: 20px; height: 20px;
    color: var(--accent);
}
.badge svg{ width: 18px; height: 18px; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 60%, transparent)); }
.bio{ margin-top: 8px; color: var(--text-dim); font-size: .9rem; line-height: 1.5; }

/* ---------- Meta ---------- */
.meta{
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 8px;
    margin-top: 14px; padding: 0 22px;
    color: var(--text-dim); font-size: .82rem;
}
.meta-item{ display: inline-flex; align-items: center; gap: 5px; }
.meta-item b{ color: var(--text); font-weight: 600; }
.meta-ico{ width: 15px; height: 15px; opacity: .8; }
.meta-sep{ opacity: .3; }

/* ---------- Uhr ---------- */
.clock{
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 12px auto 0; padding: 6px 14px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    font-size: .82rem; color: var(--text-dim);
    width: fit-content;
}
.clock .meta-ico{ color: var(--accent); }

/* ---------- Socials ---------- */
.socials{
    display: flex; justify-content: center; flex-wrap: wrap;
    gap: 10px; margin-top: 18px; padding: 0 22px;
}
.social{
    position: relative;
    display: grid; place-items: center;
    width: 42px; height: 42px;
    border-radius: 12px;
    color: var(--text-dim);
    background: rgba(255,255,255,.05);
    border: 1px solid var(--card-border);
    padding: 0; font: inherit; cursor: pointer;
    transition: transform .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease;
}
.social svg{ width: 20px; height: 20px; display: block; }
.social:hover{
    transform: translateY(-3px);
    color: #fff;
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
/* Copy-Feedback: Icon <-> Häkchen deterministisch umschalten */
.social-ico, .social-check{ display: grid; place-items: center; }
.social .social-check{ display: none; }
.social.copied .social-ico{ display: none; }
.social.copied .social-check{ display: grid; color: var(--accent); }
.copy-tip{
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--accent); color: #0a0a0c;
    font-size: .68rem; font-weight: 700; letter-spacing: .2px;
    padding: 3px 8px; border-radius: 6px; white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}
.social.copied .copy-tip{ opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Player ---------- */
.player{
    display: flex; align-items: center; gap: 12px;
    margin: 20px 22px 0;
    padding: 10px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--card-border);
    border-radius: 14px;
}
.player-cover{
    width: 46px; height: 46px; border-radius: 9px;
    object-fit: cover; flex-shrink: 0;
    box-shadow: 0 4px 14px -4px rgba(0,0,0,.6);
}
.player-body{ flex: 1; min-width: 0; }
.player-meta{ display: flex; flex-direction: column; line-height: 1.25; margin-bottom: 6px; }
.player-title{ font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist{ font-size: .72rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-controls{ display: flex; align-items: center; gap: 9px; }
.player-btn{
    display: grid; place-items: center;
    width: 28px; height: 28px; flex-shrink: 0;
    border: none; cursor: pointer;
    border-radius: 50%;
    color: #0a0a0c; background: var(--accent);
    transition: transform .15s ease, box-shadow .15s ease;
}
.player-btn:hover{ transform: scale(1.08); box-shadow: 0 0 16px -2px var(--accent); }
.player-btn svg{ width: 15px; height: 15px; display: block; }
/* Deterministische Umschaltung: genau ein Icon sichtbar */
.player-btn .ico-play  { display: block; }
.player-btn .ico-pause { display: none; }
.player-btn.playing .ico-play  { display: none; }
.player-btn.playing .ico-pause { display: block; }

.player-nav{
    display: grid; place-items: center;
    width: 26px; height: 26px; flex-shrink: 0;
    border: none; cursor: pointer; padding: 0;
    background: transparent;
    color: var(--text-dim);
    border-radius: 8px;
    transition: color .15s ease, transform .15s ease;
}
.player-nav:hover{ color: #fff; transform: scale(1.12); }
.player-nav svg{ width: 16px; height: 16px; display: block; }

/* Versteckter YouTube-Player (spielt nur den Ton) */
#yt-holder{
    position: fixed; left: -9999px; top: 0;
    width: 320px; height: 180px;
    opacity: 0; pointer-events: none;
}

/* ---------- Lautstärke ---------- */
.player-vol{ display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.player-vol .ico-mute{ display: none; }
.player-vol.muted .ico-vol{ display: none; }
.player-vol.muted .ico-mute{ display: block; }

.vol-slider{
    width: 56px; height: 4px;
    accent-color: var(--accent);
    cursor: pointer;
    background: transparent;
}
/* Auf Desktop (Hover verfügbar) erst beim Hovern ausklappen -> spart Platz */
@media (hover: hover) and (pointer: fine){
    .vol-slider{ width: 0; opacity: 0; transition: width .2s ease, opacity .2s ease; }
    .player-vol:hover .vol-slider,
    .player-vol:focus-within .vol-slider{ width: 56px; opacity: 1; }
}
@media (max-width: 380px){ .vol-slider{ display: none; } }
.player-bar{
    flex: 1; height: 5px; border-radius: 999px;
    background: rgba(255,255,255,.14);
    cursor: pointer; position: relative; overflow: hidden;
}
.player-fill{
    position: absolute; inset: 0 auto 0 0;
    width: 0%;
    background: var(--accent);
    border-radius: 999px;
}
.player-time{ font-size: .7rem; color: var(--text-dim); font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 30px; text-align: right; }

/* ---------- Responsive ---------- */
@media (max-width: 480px){
    .card{ width: 94vw; }
    .banner{ height: 100px; }
}

/* ---------- A11y ---------- */
@media (prefers-reduced-motion: reduce){
    *{ animation: none !important; transition: none !important; }
}
a:focus-visible, button:focus-visible{
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
