:root {
  --pink: #f3b4cf;
  --pink-soft: rgba(243, 180, 207, 0.55);
  --text: #f4eef2;
  --muted: rgba(244, 238, 242, 0.55);
  --glass: rgba(14, 10, 14, 0.55);
  --border: rgba(255, 255, 255, 0.08);
}

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

html, body {
  height: 100%;
  background: #050305;
  color: var(--text);
  font-family: "Sora", system-ui, sans-serif;
  overflow: hidden;
}

/* ── background ───────────────────────── */
.bg {
  position: fixed; inset: -30px;
  background: url("background.jpg") center / cover no-repeat;
  filter: saturate(0.9) brightness(0.75) blur(1.5px);
  transform: scale(1.05);
  transition: transform 0.25s ease-out;
  z-index: 0;
}
.bg-shade {
  position: fixed; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.6) 70%, rgba(0,0,0,0.85) 100%);
}
#petals { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.grain {
  position: fixed; inset: -100%; z-index: 3; pointer-events: none;
  opacity: 0.09;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.6s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-5%, 3%); }
  40% { transform: translate(4%, -6%); } 60% { transform: translate(-3%, 7%); }
  80% { transform: translate(6%, 2%); } 100% { transform: translate(0, 0); }
}
.vignette {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  box-shadow: inset 0 0 180px 40px rgba(0,0,0,0.9);
}

/* ── enter screen ─────────────────────── */
.enter {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: opacity 0.9s ease, visibility 0.9s;
}
.enter span {
  font-family: "Space Mono", monospace;
  letter-spacing: 0.5em;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: lowercase;
  animation: pulse 2.4s ease-in-out infinite;
}
.enter.hidden { opacity: 0; visibility: hidden; }
@keyframes pulse { 50% { opacity: 0.35; text-shadow: 0 0 18px var(--pink); } }

/* ── main card ────────────────────────── */
.card {
  position: relative; z-index: 10;
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  opacity: 0; transform: translateY(18px);
  transition: opacity 1.2s ease 0.2s, transform 1.2s ease 0.2s;
}
body.entered .card { opacity: 1; transform: none; }

.avatar-wrap { position: relative; width: 124px; height: 124px; margin-bottom: 1.1rem; }
.avatar {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  background: #1a1118;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 0 40px rgba(243, 180, 207, 0.25);
}
.decoration {
  position: absolute; inset: -12%; width: 124%; height: 124%;
  pointer-events: none; display: none;
}
.status {
  position: absolute; right: 6px; bottom: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 4px solid #0b070a;
  background: #747f8d;
}
.status.online  { background: #23a55a; }
.status.idle    { background: #f0b232; }
.status.dnd     { background: #f23f43; }

.name {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 3.2rem;
  line-height: 1;
  text-shadow: 0 0 22px rgba(243, 180, 207, 0.45);
}
.handle {
  margin-top: 0.35rem;
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--pink-soft);
}
.custom-status {
  margin-top: 0.8rem;
  font-size: 0.82rem; color: var(--muted);
  display: none; align-items: center; gap: 0.4rem;
}
.custom-status img { width: 18px; height: 18px; }

.bio {
  margin-top: 0.9rem; min-height: 1.4em;
  font-family: "Space Mono", monospace;
  font-size: 0.82rem; color: var(--text); opacity: 0.85;
}
.caret { color: var(--pink); animation: blink 1s steps(1) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }

/* ── activity ─────────────────────────── */
.activity { margin-top: 1.4rem; width: min(330px, 90vw); display: flex; flex-direction: column; gap: 0.6rem; }
.act {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: var(--glass); border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  animation: fadeUp 0.6s ease both;
}
.act img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.act .meta { min-width: 0; flex: 1; }
.act .kind {
  font-family: "Space Mono", monospace; font-size: 0.6rem;
  letter-spacing: 0.25em; text-transform: uppercase; color: var(--pink-soft);
}
.act .title, .act .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act .title { font-size: 0.86rem; font-weight: 600; margin-top: 2px; }
.act .sub { font-size: 0.74rem; color: var(--muted); }
.act .bar { margin-top: 6px; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.act .bar div { height: 100%; background: var(--pink); width: 0; }

/* ── links ────────────────────────────── */
.links { margin-top: 1rem; width: min(330px, 90vw); display: flex; flex-direction: column; gap: 0.6rem; }
.link {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: var(--glass); border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  color: var(--text); text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: fadeUp 0.6s ease both;
}
.link:hover {
  transform: translateY(-2px);
  border-color: rgba(243, 180, 207, 0.35);
  box-shadow: 0 8px 30px rgba(243, 180, 207, 0.12);
}
.link svg { width: 20px; height: 20px; fill: currentColor; opacity: 0.85; flex-shrink: 0; }
.link .l-label {
  font-family: "Space Mono", monospace; font-size: 0.6rem;
  letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted);
}
.link .l-value { font-family: "Space Mono", monospace; font-size: 0.85rem; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* ── music player ─────────────────────── */
.player {
  position: fixed; top: 18px; right: 18px; z-index: 20;
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--glass); border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  opacity: 0; transition: opacity 1s ease 0.6s;
}
body.entered .player { opacity: 1; }
.pbtn {
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.2s;
}
.pbtn:hover { background: rgba(255,255,255,0.08); }
.pbtn svg { width: 14px; height: 14px; fill: currentColor; }
.track { width: 120px; margin: 0 0.3rem; }
.track-title {
  font-family: "Space Mono", monospace; font-size: 0.66rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted);
}
.track-bar { margin-top: 4px; height: 2px; background: rgba(255,255,255,0.12); border-radius: 2px; overflow: hidden; }
.track-bar div { height: 100%; width: 0; background: var(--pink); }
.track-count { font-family: "Space Mono", monospace; font-size: 0.62rem; color: var(--muted); }
#volume {
  -webkit-appearance: none; appearance: none;
  width: 70px; height: 3px; margin-left: 0.4rem;
  background: rgba(255,255,255,0.2); border-radius: 3px; cursor: pointer;
}
#volume::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 8px var(--pink);
}
#volume::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: #fff; }

/* ── footer ───────────────────────────── */
.footer {
  position: fixed; bottom: 16px; left: 0; right: 0; z-index: 10;
  text-align: center;
  font-family: "Space Mono", monospace; font-size: 0.7rem;
  letter-spacing: 0.15em; color: var(--muted);
}

@media (max-width: 560px) {
  .track { display: none; }
  .player { top: 10px; right: 10px; }
  .name { font-size: 2.7rem; }
}
