:root{
  --bg: #09090a;
  --bg-elevated: #0f0f11;
  --surface: #17171a;
  --surface-hover: #1e1e22;
  --border: #262629;
  --border-strong: #38383d;
  --text-primary: #eaeaec;
  --text-secondary: #9a9aa3;
  --text-tertiary: #59595f;
}
*{ margin:0; padding:0; box-sizing:border-box; }
html, body{ height:100%; overflow:hidden; }
html{ scroll-behavior:smooth; }
html{ scrollbar-width: thin; scrollbar-color: var(--border-strong) var(--bg); }
::-webkit-scrollbar{ width:4px; height:4px; }
::-webkit-scrollbar-track{ background: var(--bg); }
::-webkit-scrollbar-thumb{ background: var(--border-strong); border-radius:8px; }
::-webkit-scrollbar-thumb:hover{ background: var(--text-tertiary); }
::-webkit-scrollbar-corner{ background: var(--bg); }
body{
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  display:flex;
  align-items:center;
  justify-content:center;
}
::selection{ background: var(--border-strong); color: var(--text-primary); }
.no-select{
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none;
  user-select: none; cursor: default; -webkit-touch-callout: none;
}
#bg-canvas{
  position: fixed; top:0; left:0; width:100%; height:100%;
  z-index:0; pointer-events:none;
}
.noise{
  position: fixed; inset:0; z-index:1; pointer-events:none;
  opacity:.035;
  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");
}
main{ position:relative; z-index:2; max-width: 680px; width:100%; margin: 0 auto; padding: 24px; }
@keyframes rowIn{ from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:translateY(0); } }
@keyframes avatarIn{ from{ opacity:0; transform:scale(.82); } to{ opacity:1; transform:scale(1); } }
@keyframes badgeIn{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:translateY(0); } }
@media (prefers-reduced-motion: reduce){
  .activity-row, .presence-avatar, .presence-badge{ animation:none; }
}
section{ position:relative; }
#presence{ margin-top: 0; }
#links{ margin-top: 32px; }
.presence-card{
  position:relative;
  background: var(--surface);
  border:1px solid var(--border);
  border-radius:18px;
  overflow:visible;
  display:flex; flex-direction:column;
}
.presence-offline-msg{
  display:none;
  padding: 48px 32px;
  text-align:center;
  font-family:'Space Grotesk', sans-serif;
  font-weight:600;
  font-size:17px;
  color: var(--text-secondary);
}
.presence-card.is-offline .presence-banner,
.presence-card.is-offline .presence-main,
.presence-card.is-offline .presence-activities{ display:none; }
.presence-card.is-offline .presence-offline-msg{ display:block; }
.presence-banner{
  height:110px;
  width:100%;
  border-radius:18px 18px 0 0;
  overflow:hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.05), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.04), transparent 50%),
    linear-gradient(135deg, #17171a 0%, #0f0f11 100%);
  position:relative;
}
.presence-banner::before{
  content:'';
  position:absolute; inset:0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity:.35;
  mask-image: linear-gradient(to bottom, black, transparent);
}
.presence-main{
  position:relative;
  z-index:2;
  display:flex; align-items:flex-start; flex-wrap:wrap; gap:18px;
  padding: 0 36px;
  margin-top:0;
}
.presence-avatar-wrap{ position:relative; flex-shrink:0; align-self:flex-start; margin-top:-32px; }
.presence-avatar{
  width:88px; height:88px; border-radius:50%;
  object-fit:cover;
  background: var(--bg-elevated);
  border:4px solid var(--surface);
  display:block;
  animation: avatarIn .6s cubic-bezier(.19,.72,.26,1) both;
}
.presence-status-dot{
  position:absolute; right:1px; bottom:1px;
  width:18px; height:18px; border-radius:50%;
  border:2.5px solid var(--surface);
  background: var(--text-tertiary);
  transition: background .3s ease;
  cursor: default;
}
.presence-status-dot.online{ background:#23a55a; }
.presence-status-dot.idle{ background:#f0b232; }
.presence-status-dot.dnd{ background:#f23f43; }
.presence-status-dot.offline{ background:#80848e; }
.status-tooltip{
  position:absolute;
  bottom: calc(100% + 10px);
  left:50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface);
  border:1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size:12px;
  font-weight:500;
  font-family:'Inter', sans-serif;
  white-space:nowrap;
  padding:6px 10px;
  border-radius:8px;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  z-index:5;
}
.status-tooltip::after{
  content:"";
  position:absolute;
  top:100%; left:50%;
  transform: translateX(-50%);
  border:5px solid transparent;
  border-top-color: var(--surface);
}
.status-tooltip:empty{ display:none; }
.presence-status-dot:hover .status-tooltip{
  opacity:1; visibility:visible; transform: translateX(-50%) translateY(0);
}
.presence-badges{
  display:flex; flex-wrap:wrap; gap:7px; margin-top:5px;
}
.presence-badges:empty{ display:none; margin-top:0; }
.presence-badge{
  position:relative; display:inline-flex;
  width:21px; height:21px; cursor: default;
  animation: badgeIn .45s cubic-bezier(.19,.72,.26,1) both;
}
.presence-badge:nth-of-type(1){ animation-delay:.08s; }
.presence-badge:nth-of-type(2){ animation-delay:.16s; }
.presence-badge:nth-of-type(3){ animation-delay:.24s; }
.presence-badge:nth-of-type(4){ animation-delay:.32s; }
.presence-badge:nth-of-type(n+5){ animation-delay:.4s; }
.presence-badge img{
  width:100%; height:100%; object-fit:contain; display:block;
  opacity:.85; transition: opacity .2s ease, transform .2s ease;
}
.presence-badge:hover img{ opacity:1; transform: translateY(-1px); }
.presence-badge .status-tooltip{ bottom: calc(100% + 8px); }
.presence-badge:hover .status-tooltip{ opacity:1; visibility:visible; transform: translateX(-50%) translateY(0); }
.presence-info{ padding-top:4px; min-width:0; }
.presence-handle{
  display:block;
  font-family:'Inter', sans-serif; font-weight:500; font-size:14px;
  color: var(--text-tertiary);
}
.presence-handle:empty{ display:none; }
.presence-status-label{ margin-top:6px; font-size:13px; color: var(--text-secondary); }
.presence-status-label:empty{ display:none; }
.presence-custom-status{ margin-top:4px; font-size:13px; color: var(--text-secondary); }
.presence-custom-status:empty{ display:none; }
.presence-brand{
  margin-left:auto;
  align-self:flex-start;
  padding-top:8px;
  text-align:right;
}
.presence-quote{
  font-size:13px;
  font-style:italic;
  color: var(--text-secondary);
  white-space:nowrap;
}
.presence-activities{
  display:flex; flex-direction:column; gap:14px;
  padding: 24px 36px 32px;
  border-top:1px solid var(--border);
  margin-top:22px;
}
.presence-activities:empty{ padding:0; }
#spotifySlot, #gamesSlot{ display:flex; flex-direction:column; gap:14px; }
#spotifySlot:empty, #gamesSlot:empty{ display:none; }
.activity-row{
  display:flex; align-items:center; gap:14px;
  background: var(--bg-elevated);
  border:1px solid var(--border);
  border-radius:12px;
  padding:16px 18px;
  transition: background .2s ease, border-color .2s ease;
  animation: rowIn .5s cubic-bezier(.19,.72,.26,1) both;
}
.activity-row:nth-of-type(1){ animation-delay:.05s; }
.activity-row:nth-of-type(2){ animation-delay:.15s; }
.activity-row:nth-of-type(3){ animation-delay:.25s; }
.activity-row:hover{ background: var(--surface); border-color: var(--border-strong); }
.activity-icon-wrap{ position:relative; flex-shrink:0; }
.activity-icon{
  width:58px; height:58px; border-radius:10px;
  object-fit:cover; flex-shrink:0;
  background: var(--surface-hover);
}
.activity-small-icon{
  position:absolute; right:-6px; bottom:-6px;
  width:26px; height:26px; border-radius:50%;
  border:3px solid var(--bg-elevated);
  background: var(--surface-hover);
  object-fit:cover;
}
.lyrics-panel{
  position:absolute;
  right: calc(100% + 14px);
  top:50%;
  transform: translateY(-50%);
  width:220px;
  height:84px;
  overflow:hidden;
  pointer-events:none;
  opacity:0;
  visibility:hidden;
  transition: opacity .25s ease, visibility .25s ease;
  background: var(--surface);
  border:1px solid var(--border-strong);
  border-radius:12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 22%, black 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 22%, black 78%, transparent);
  z-index:6;
}
.activity-icon-wrap:hover .lyrics-panel{ opacity:1; visibility:visible; }
.lyrics-panel::after{
  content:'';
  position:absolute; top:50%; right:-6px;
  width:12px; height:12px;
  background: var(--surface);
  border-right:1px solid var(--border-strong);
  border-bottom:1px solid var(--border-strong);
  transform: translateY(-50%) rotate(-45deg);
}
.lyrics-scroll{
  position:absolute;
  top:0; left:0; width:100%;
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.lyrics-line{
  height:26px;
  display:flex; align-items:center; justify-content:center;
  text-align:center;
  font-size:11.5px; font-weight:600; line-height:1.25;
  padding:0 16px;
  color: var(--text-tertiary);
  filter: blur(1.5px);
  opacity:.4;
  transition: color .25s ease, opacity .25s ease, filter .25s ease, font-size .25s ease;
}
.lyrics-line.active{
  color: var(--text-primary);
  font-size:13.5px;
  filter: blur(0);
  opacity:1;
  text-shadow: 0 0 14px rgba(255,255,255,.35);
}
.lyrics-panel.no-lyrics{ display:flex; align-items:center; justify-content:center; }
.lyrics-panel .lyrics-empty{
  font-size:12px; color: var(--text-tertiary); padding:0 14px; text-align:center;
}
@media (max-width:600px){
  .lyrics-panel{
    right:auto; left:50%; top:auto; bottom:calc(100% + 10px);
    transform: translateX(-50%);
  }
  .lyrics-panel::after{ display:none; }
}
.activity-body{ flex:1; min-width:0; }
.activity-title{ font-size:15px; font-weight:600; color: var(--text-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.spotify-link{
  flex-shrink:0; width:34px; height:34px; border-radius:9px;
  border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  color: var(--text-secondary);
  transition: all .2s ease;
}
.spotify-link:hover{ color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-elevated); }
.activity-subtitle{ font-size:13px; color: var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.activity-time{ font-size:12px; color: var(--text-tertiary); margin-top:4px; }
.activity-progress{ margin-top:8px; height:3px; border-radius:2px; background: var(--border); overflow:hidden; }
.activity-progress-bar{ height:100%; background: var(--text-secondary); width:0%; transition: width .3s linear; }
.presence-empty{ font-size:13px; color: var(--text-tertiary); }
@media (max-width:600px){
  .presence-main{ padding:0 20px; }
  .presence-brand{ margin-left:0; width:100%; text-align:left; padding-top:12px; }
  .presence-quote{ white-space:normal; }
  .presence-activities{ padding:20px 20px 24px; }
}
.logo-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 30px;
}
.logo-link{
  display:flex; align-items:center; justify-content:center;
  width: 44px; height: 44px;
  text-decoration:none;
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.logo-link:hover{ transform: scale(1.18); }
.logo-mask{
  display:inline-block;
  width: 26px; height: 26px;
  background-color: var(--text-secondary);
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
  -webkit-mask-position:center; mask-position:center;
  -webkit-mask-size:contain; mask-size:contain;
  transition: background-color .22s ease;
}
.logo-link:hover .logo-mask{ background-color: var(--text-primary); }
.logo-mask-fallback{ color: var(--text-secondary); display:flex; transition: color .22s ease; }
.logo-mask-fallback svg{ width:26px; height:26px; }
.logo-link:hover .logo-mask-fallback{ color: var(--text-primary); }
footer{
  text-align:center; padding: 28px 0 0;
  color: var(--text-tertiary); font-size:12px;
  border-top:1px solid var(--border);
  margin-top: 32px;
}
.reveal{
  opacity:0;
  transition: opacity 1.2s cubic-bezier(.19,.72,.26,1), transform 1.2s cubic-bezier(.19,.72,.26,1);
}
.reveal.up{ transform: translateY(28px); }
.reveal.down{ transform: translateY(-20px); }
.reveal.visible{ opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1; transform:none; transition:none; }
}
@media (max-width:600px){
  .logo-row{ gap: 24px; }
}
