*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.75);
  --glass: rgba(0, 0, 0, 0.45);
  --glass-border: rgba(255, 255, 255, 0.12);
  --accent: rgba(255, 255, 255, 0.9);
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #0a0a0a;
}

body.loading .main,
body.loading .view-counter,
body.loading .audio-control {
  opacity: 0;
  pointer-events: none;
}

body.ready .main,
body.ready .view-counter,
body.ready .audio-control {
  opacity: 1;
  transition: opacity 0.25s ease;
}

#bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#bg-layer img,
#bg-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1) brightness(0.85);
}

#bg-layer .default-bg {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.15) 0%, transparent 55%),
    linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

.audio-control {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.audio-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.audio-btn:hover {
  opacity: 1;
}

.audio-btn svg {
  width: 20px;
  height: 20px;
}

.volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

.main {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 60px;
  text-align: center;
}

.floating-star {
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
  fill: #0a0a0a;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 0.6;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.25));
  animation: star-float-spin 12s linear infinite;
}

@keyframes star-float-spin {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(180deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
  }
}

.display-name {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.glitch {
  position: relative;
  display: inline-block;
}

.glitch-main {
  position: relative;
  z-index: 2;
  color: #fff;
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.25);
  will-change: transform;
}

.glitch-layer {
  position: absolute;
  inset: 0;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

.glitch-layer--red {
  color: #ff2a6d;
  z-index: 1;
}

.glitch-layer--cyan {
  color: #3cd4ff;
  z-index: 1;
}

.glitch.is-glitching .glitch-layer--red {
  opacity: 0.9;
  clip-path: inset(5% 0 42% 0);
  transform: translate(-6px, 1px);
}

.glitch.is-glitching .glitch-layer--cyan {
  opacity: 0.9;
  clip-path: inset(48% 0 5% 0);
  transform: translate(6px, -1px);
}

.tagline {
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: var(--text-muted);
  font-style: italic;
  max-width: 420px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.location svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.discord-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(380px, 90vw);
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 24px;
  text-align: left;
  transition: opacity 0.3s;
}

.discord-card.hidden {
  display: none;
}

.discord-card.loading {
  opacity: 0.6;
}

.discord-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 54px;
  height: 54px;
}

.discord-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
}

.status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.75);
  box-sizing: border-box;
}

.status-dot.online {
  background: #3ba55d;
}

.status-dot.idle {
  background: #faa81a;
}

.status-dot.dnd {
  background: #ed4245;
}

.status-dot.dnd::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.status-dot.offline {
  background: #747f8d;
}

.discord-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.discord-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.discord-username {
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  line-height: 1.2;
}

.discord-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.badge-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.discord-status {
  font-size: 0.8125rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text);
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}

.social-link:hover {
  opacity: 1;
  transform: scale(1.1);
}

.social-link svg {
  width: 24px;
  height: 24px;
}

.view-counter {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.view-counter svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

@media (max-width: 480px) {
  .audio-control {
    top: 12px;
    left: 12px;
    padding: 8px 10px;
  }

  .volume-slider {
    width: 60px;
  }

  .view-counter {
    bottom: 12px;
    left: 12px;
  }

  .discord-card {
    width: min(380px, 92vw);
    padding: 10px 14px;
    gap: 12px;
  }

  .discord-avatar-wrap,
  .discord-avatar {
    width: 48px;
    height: 48px;
  }

  .badge-icon {
    width: 16px;
    height: 16px;
  }
}
