:root {
  --z-font: Inter, system-ui, sans-serif;
  --bg: #000000;
  --card: rgba(16, 16, 18, 0.72);
  --card-border: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: #9ca3af;
  --join: #22c55e;
  --glow: rgba(255, 255, 255, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--z-font);
  overflow-x: hidden;
}

body.cursor-none {
  cursor: none;
}

body.cursor-none a,
body.cursor-none button,
body.cursor-none input[type="range"],
body.cursor-none [role="button"] {
  cursor: none;
}

body.cursor-none .gate {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* background video */
.bg-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.45) saturate(0.85);
}

.bg-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 100% 70% at 50% 0%, #1a0a2e, #000);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 90% at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
}

/* background rain */
#rain-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* cursor trail */
#trail-canvas {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* custom PNG cursor — DOM layer (works where CSS url() fails) */
.cursor-3d {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 120;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform;
}

.cursor-3d img {
  display: block;
  max-width: 52px;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 5px 16px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.2));
  transform-style: preserve-3d;
}

/* gate */
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.gate.is-off {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate p {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

/* 3D tilt container */
.perspective-wrap {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 120px;
  perspective: 1100px;
  perspective-origin: 50% 42%;
}

/* main stack — mouse-tilted in 3D */
.stack {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.card {
  width: 100%;
  max-width: 440px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 22px 20px 18px;
  position: relative;
}

/* profile header */
.hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.hero-av {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.hero-av.hidden {
  display: none;
}

.hero-text h1 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-shadow: 0 0 18px var(--glow), 0 0 36px rgba(255, 255, 255, 0.08);
}

.hero-text .gem {
  font-size: 1rem;
  margin-left: 4px;
  vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  min-height: 0;
}

.badge-row.hidden {
  display: none !important;
}

.badge-row .badge-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  border-radius: 4px;
  opacity: 0.95;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.badge-row a.badge-ico:hover,
.badge-row a.badge-ico:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}

.badge-row .badge-ico img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

.hero-text .bio {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
}

.hero-text .joined {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* subcards */
.subcards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 400px) {
  .subcards {
    grid-template-columns: 1fr;
  }
}

.sub {
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 72px;
}

.pres-av-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.pres-av-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.pres-av-wrap .dnd {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ed4245;
  border: 2px solid #111;
}

.pres-av-wrap.hidden {
  display: none;
}

.sub strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.sub p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.server-card {
  gap: 12px;
  align-items: flex-start;
}

.srv-av {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.srv-av .srv-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.srv-av .srv-icon.hidden {
  display: none !important;
}

.srv-av .srv-fallback {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: #fca5a5;
  font-weight: 800;
  font-size: 15px;
}

.srv-av.has-icon .srv-fallback {
  display: none;
}

.srv-body {
  flex: 1;
  min-width: 0;
}

.srv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.srv-head span.title {
  font-size: 13px;
  font-weight: 600;
}

.disc-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #5865f2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.disc-ico-img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.join-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 14px;
  border-radius: 8px;
  background: var(--join);
  color: #052e16;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.join-btn:hover {
  filter: brightness(1.08);
}

.join-btn.hidden {
  display: none;
}

/* social row */
.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 4px;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.socials a {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s;
}

.socials a:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
}

.socials img {
  width: 22px;
  height: 22px;
  display: block;
  filter: grayscale(1) brightness(1.15) contrast(1.05);
}

.socials a:hover img {
  filter: none;
}

.views {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* player */
.player-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.pb-art {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.pb-main {
  flex: 1;
  min-width: 0;
}

.pb-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-seek {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pb-seek span {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}

.pb-seek span:last-child {
  text-align: right;
}

.pb-seek input[type="range"] {
  flex: 1;
  height: 4px;
  accent-color: #a78bfa;
  cursor: pointer;
}

.pb-btns {
  display: flex;
  gap: 6px;
}

.pb-btns button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pb-btns button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.player-card.hidden {
  display: none;
}

/* hidden host for YouTube IFrame API (audio driven by custom bar) */
.yt-player-host {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 160px;
  height: 90px;
  opacity: 0.02;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
