:root {
  --rose:        #c084a0;
  --rose-glow:   rgba(192,132,160,0.55);
  --rose-dim:    rgba(192,132,160,0.18);
  --rose-subtle: rgba(192,132,160,0.09);
  --surface:     rgba(255,255,255,0.03);
  --border:      rgba(255,255,255,0.07);
  --border-hover:rgba(192,132,160,0.3);
  --text-main:   #f0e6ec;
  --text-muted:  #c4a0b2;
  --text-dim:    #7a5868;
  --red:         #e05555;
  --green:       #1ed760;
  --font: 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

@keyframes blink       { 0%,100%{opacity:1} 50%{opacity:0.2} }
@keyframes spin-disk   { to{transform:rotate(360deg)} }
@keyframes pulse-enter { 0%,100%{opacity:0.3} 50%{opacity:1;color:var(--rose);} }
@keyframes fade-in     { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

/* ── background layers ── */
#stars-canvas {
  position: fixed; inset: 0; z-index: -3;
  pointer-events: none; background: var(--bg);
}
#bg-video {
  position: fixed; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -2; opacity: 0.2;
  transition: opacity 0s ease;
  filter: brightness(0.5) contrast(1.05) saturate(1.2);
  background: #000;
}
#vignette {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 20%, rgba(5,1,3,0.88) 100%);
}

/* ── overlay ── */
#overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,1,3,0.97);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  cursor: pointer; transition: opacity 0.1s ease;
  text-align: center; gap: 0;
}
#overlay::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px,
    rgba(192,132,160,0.01) 3px, rgba(192,132,160,0.01) 4px);
}
.ov-name    { font-size:2.2rem; color:var(--text-muted); letter-spacing:1px; margin-bottom:24px; opacity:0.5; font-style:italic; }
.ov-prompt  { color:var(--text-dim); letter-spacing:5px; font-size:0.7rem; text-transform:lowercase; animation:pulse-enter 2.8s ease-in-out infinite; }
.ov-warn    { color:var(--red); font-size:0.58rem; margin-top:28px; letter-spacing:1.5px; text-transform:lowercase; opacity:0.4; max-width:260px; line-height:1.7; }

/* ── app shell ── */
#app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity 0s ease;
}
#app.visible { opacity: 1; pointer-events: auto; }

/* ── nav ── */
#nav {
  display: flex; align-items: center; gap: 0;
  padding: 18px 24px 0;
  flex-shrink: 0; position: relative; z-index: 10;
}
.nav-link {
  font-size: 0.82rem; font-weight: 400; letter-spacing: 0.3px;
  color: var(--text-dim); text-transform: lowercase;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  transition: color 0.2s, background 0.2s;
  border: none; background: none;
  text-decoration: none; user-select: none; -webkit-user-select: none;
}
.nav-link:hover  { color: var(--text-muted); }
.nav-link.active { color: var(--text-main); font-weight: 600; }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.viewer-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 11px;
}
.viewer-badge .vdot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--rose); flex-shrink: 0;
  animation: blink 2s ease-in-out infinite;
}
#nav-count { color: var(--text-main); font-weight: 600; }

/* ── pages ── */
#pages { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.page {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px 24px 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.page.active { opacity: 1; pointer-events: auto; }

/* ── card base (replaces .glass) ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-hover); }

/* ── home page ── */
#page-home .home-inner {
  width: min(420px, 94vw);
  display: flex; flex-direction: column; gap: 10px;
  animation: fade-in 0.5s ease both;
}
.profile-card { padding: 24px 22px 18px; position: relative; }
.profile-top  { display: flex; align-items: flex-start; gap: 16px; }

.pfp-wrap  { position: relative; flex-shrink: 0; }
.pfp {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; display: block;
  border: 2px solid var(--rose);
  transition: border-color 0.2s;
}
.pfp:hover { border-color: var(--rose-dim); }

.status-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--bg); background: #4f545c;
  transition: background 0.2s;
}
.status-dot[data-status="online"] { background: #3ba55c; }
.status-dot[data-status="idle"]   { background: #faa61a; }
.status-dot[data-status="dnd"]    { background: #ed4245; }

.status-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.6rem; letter-spacing: 0.8px;
  padding: 4px 10px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s, transform 0.18s; text-transform: lowercase;
}
.pfp-wrap:hover .status-tip { opacity: 1; transform: translateX(-50%) translateY(-2px); }

.profile-info { min-width: 0; padding-top: 4px; }
.username     { font-size: 1.35rem; font-weight: 700; color: var(--text-main); display: block; letter-spacing: -0.2px; }
.discord-tag  { font-size: 0.64rem; color: var(--text-dim); letter-spacing: 0.8px; display: block; margin-top: 2px; }
.bio          { font-size: 0.78rem; color: var(--text-muted); line-height: 1.7; margin-top: 6px; opacity: 0.85; }

/* activity */
.activity-row {
  display: none; align-items: center; gap: 10px;
  background: var(--rose-subtle); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; margin-top: 12px;
}
.activity-row.show { display: flex; }
.act-art-wrap { position: relative; flex-shrink: 0; width: 38px; height: 38px; }
.act-img-large { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; border: 1px solid var(--border); display: block; }
.act-img-small {
  position: absolute; bottom: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--bg); display: none;
}
.act-img-small.show { display: block; }
.act-info  { min-width: 0; flex: 1; }
.act-label { font-size: 0.54rem; letter-spacing: 1.4px; color: var(--rose); text-transform: lowercase; display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.act-adot  { width: 3px; height: 3px; background: var(--rose); border-radius: 50%; animation: blink 1.8s ease-in-out infinite; }
.act-name  { font-size: 0.76rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-detail  { font-size: 0.64rem; color: var(--text-muted); opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-elapsed { font-size: 0.58rem; color: var(--text-dim); margin-top: 1px; }

/* spotify */
.spotify-row {
  display: none; align-items: center; gap: 10px;
  background: rgba(30,215,96,0.05); border: 1px solid rgba(30,215,96,0.16);
  border-radius: 10px; padding: 8px 10px; margin-top: 12px;
}
.spotify-row.show { display: flex; }
.spotify-row img { width: 34px; height: 34px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.sp-info   { min-width: 0; flex: 1; }
.sp-label  { font-size: 0.54rem; letter-spacing: 1.4px; color: var(--green); text-transform: lowercase; display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.sp-sdot   { width: 3px; height: 3px; background: var(--green); border-radius: 50%; animation: blink 1.6s ease-in-out infinite; }
.sp-song   { font-size: 0.76rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-artist { font-size: 0.63rem; color: var(--text-muted); opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-progress-track { width: 100%; height: 2px; border-radius: 2px; background: rgba(30,215,96,0.15); margin-top: 5px; overflow: hidden; }
.sp-progress-fill  { height: 100%; width: 0%; background: var(--green); border-radius: 2px; transition: width 1s linear; }
.sp-time   { display: flex; justify-content: space-between; font-size: 0.52rem; color: var(--text-dim); margin-top: 2px; }

/* discs */
.discs-row { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 14px 0 4px; }
.disc-wrap { position: relative; cursor: pointer; }
.disc-wrap img {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--border);
  display: block;
  animation: spin-disk 8s linear infinite;
  animation-play-state: paused;
  transition: border-color 0.2s;
}
.disc-wrap.spinning img { animation-play-state: running; }
.disc-wrap:hover img    { border-color: var(--rose); }
.disc-tip {
  position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%);
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.6rem; letter-spacing: 0.8px;
  padding: 3px 9px; border-radius: 7px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.18s;
}
.disc-wrap:hover .disc-tip { opacity: 1; }

/* ── socials page ── */
#page-socials .socials-inner {
  width: min(420px, 94vw);
  display: flex; flex-direction: column; gap: 10px;
  animation: fade-in 0.5s ease both;
}
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.3px; margin-bottom: 6px; }
.social-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; cursor: pointer;
  text-decoration: none; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.2s;
  margin-bottom: 1px;
}
.social-card:hover { border-color: var(--border-hover); }
.social-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  background: var(--rose-subtle); border: 1px solid var(--border);
  overflow: hidden;
}
.social-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.social-info   { min-width: 0; flex: 1; }
.social-name   { font-size: 0.85rem; font-weight: 600; color: var(--text-main); display: block; }
.social-handle { font-size: 0.68rem; color: var(--text-dim); display: block; margin-top: 1px; }
.social-arrow  { color: var(--text-dim); font-size: 0.75rem; opacity: 0.5; flex-shrink: 0; transition: color 0.2s; }
.social-card:hover .social-arrow { opacity: 1; color: var(--rose); }

/* ── music page ── */
#page-music .music-inner {
  width: min(420px, 94vw);
  display: flex; flex-direction: column; gap: 10px;
  animation: fade-in 0.5s ease both;
}
.np-panel {
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; position: relative;
}
.np-art {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border); flex-shrink: 0;
  background: var(--rose-dim); transition: border-color 0.2s;
}
.np-panel:hover .np-art { border-color: var(--rose); }
.np-text    { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.np-label   { font-size: 0.54rem; letter-spacing: 2px; color: var(--text-dim); text-transform: lowercase; display: flex; align-items: center; gap: 5px; }
.np-dot     { display: none; }
.np-dot.idle{ display: none; }
.np-track   { font-size: 0.82rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist  { font-size: 0.68rem; color: var(--text-muted); opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-chevron { margin-left: auto; flex-shrink: 0; color: var(--text-dim); font-size: 0.58rem; transition: transform 0.28s, opacity 0.2s; opacity: 0.4; }
.np-panel:hover .np-chevron { opacity: 0.75; }
.np-panel.open .np-chevron  { transform: rotate(180deg); opacity: 0.75; }

.top-tracks { padding: 14px 18px 10px; display: none; }
.top-tracks.show { display: block; }
.tt-label {
  font-size: 0.54rem; letter-spacing: 2.5px; color: var(--text-dim);
  text-transform: lowercase; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.track-row      { display: flex; align-items: center; gap: 9px; padding: 5px 0; border-bottom: 1px solid rgba(192,132,160,0.06); }
.track-row:last-child { border-bottom: none; }
.track-rank     { font-size: 0.54rem; font-weight: 700; color: var(--rose); opacity: 0.5; width: 12px; text-align: right; flex-shrink: 0; }
.track-art      { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; background: var(--rose-dim); }
.track-info     { flex: 1; min-width: 0; }
.track-name     { font-size: 0.72rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta     { font-size: 0.6rem; color: var(--text-muted); opacity: 0.65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-plays    { font-size: 0.54rem; color: var(--text-dim); opacity: 0.5; flex-shrink: 0; }

/* ── setup page ── */
#page-setup .setup-inner {
  width: min(640px, 94vw);
  display: flex; flex-direction: column; gap: 22px;
  animation: fade-in 0.5s ease both;
  max-height: 100%; overflow-y: auto; padding: 2px 2px 12px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
#page-setup { align-items: center; justify-content: flex-start; padding-top: 32px; overflow-y: auto; }
.setup-header  { display: flex; flex-direction: column; gap: 6px; }
.setup-sub     { font-size: 0.78rem; color: var(--text-muted); line-height: 1.6; opacity: 0.85; max-width: 48ch; }
.setup-section { display: flex; flex-direction: column; gap: 10px; }
.setup-eyebrow { font-size: 0.62rem; letter-spacing: 1px; color: var(--text-dim); text-transform: lowercase; }
.setup-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.setup-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px; text-decoration: none; border-radius: 14px;
  color: inherit;
}
.setup-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--rose-subtle); border: 1px solid var(--border);
}
.setup-icon svg   { width: 17px; height: 17px; stroke: var(--rose); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.setup-info       { min-width: 0; flex: 1; }
.setup-title      { font-size: 0.78rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-meta       { font-size: 0.62rem; color: var(--text-dim); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-chevron    { margin-left: auto; flex-shrink: 0; color: var(--text-dim); font-size: 0.75rem; opacity: 0.45; }
.setup-taskbar    { display: flex; flex-wrap: wrap; gap: 8px; }
.taskbar-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px 6px 11px;
  font-size: 0.72rem; color: var(--text-muted); text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.taskbar-pill:hover { border-color: var(--border-hover); color: var(--text-main); }
.taskbar-pill svg   { width: 14px; height: 14px; stroke: var(--rose); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── volume control ── */
#volume-control {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  right: calc(18px + env(safe-area-inset-right));
  display: flex; align-items: center; gap: 9px; padding: 7px 14px;
  z-index: 60; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16,1,0.3,1);
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
}
#volume-control.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.vol-btn {
  background: none; border: none; color: var(--text-muted); font-size: 0.95rem;
  cursor: pointer; padding: 0; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.25s, transform 0.2s;
}
.vol-btn:hover { color: var(--rose); transform: scale(1.12); }
.vol-slider {
  -webkit-appearance: none; appearance: none;
  width: 72px; height: 3px; border-radius: 3px;
  background: var(--border); outline: none; cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--rose); cursor: pointer; transition: transform 0.15s;
}
.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.vol-slider::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%;
  border: none; background: var(--rose); cursor: pointer;
}

/* ── credit ── */
.credit-pill {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 50px;
  padding: 4px 14px; font-size: 0.6rem; color: var(--text-dim);
  letter-spacing: 0.7px; white-space: nowrap; z-index: 50; pointer-events: none;
  opacity: 0; transition: opacity 0.6s ease 0.1s;
}
.credit-pill.show { opacity: 1; }

/* ── responsive ── */
@media (max-width: 500px) {
  #nav { padding: 14px 16px 0; }
  .nav-link { padding: 5px 10px; font-size: 0.78rem; }
  .page { padding: 14px 16px 20px; }
  #page-home .home-inner,
  #page-socials .socials-inner,
  #page-music .music-inner { width: min(360px, 94vw); }
  #page-setup .setup-inner { width: min(360px, 94vw); }
  .setup-grid { grid-template-columns: 1fr; }
}
@media (max-height: 640px) {
  .profile-card { padding: 16px 18px 12px; }
  .pfp { width: 58px; height: 58px; }
  .username { font-size: 1.15rem; }
  .discs-row { padding: 8px 0 2px; }
}
