:root {
  --bg: #060202;
  --card-bg: rgba(15, 6, 6, 0.72);
  --accent: #ff1b3d;
  --accent-dim: #7a0f1f;
  --accent-glow: rgba(255, 27, 61, 0.55);
  --text: #f5e9ea;
  --text-dim: #b98d92;
}

* { box-sizing: border-box; }

html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}

#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.6s ease;
}
#bg-video.active { opacity: 0.7; }

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(122, 15, 31, 0.25) 0%, rgba(6, 2, 2, 0.9) 70%);
  pointer-events: none;
  transition: background 0.4s ease;
}
/* A custom background video should actually be visible, undimmed - the
   vignette above is tuned for the plain particle background and would
   otherwise wash out real video content. */
body.has-bg-video::before {
  background: transparent;
}

.card {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 40px 20px;
  padding: 44px 28px 24px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: card-in 0.6s ease-out;
  transition: padding-top 0.2s ease;
}

/* Tighter top spacing once the Discord status widget adds content below -
   keeps the card from feeling bottom-heavy; more top padding (above) centers
   the name better when the widget isn't shown at all. */
.card.has-discord {
  padding-top: 30px;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.avatar-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  margin-bottom: 16px;
}

.avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a0a0d;
  border: 2px solid transparent;
}

.name {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
  text-shadow: 0 0 14px var(--accent-glow);
  min-height: 1.3em;
}

.name .cursor {
  display: inline-block;
  width: 2px;
  margin-left: 2px;
  background: var(--accent);
  animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.name.glitch {
  animation: glitch 0.35s linear 2;
}
@keyframes glitch {
  0% { transform: translate(0); text-shadow: 0 0 14px var(--accent-glow); }
  20% { transform: translate(-2px, 1px); text-shadow: -2px 0 var(--accent); }
  40% { transform: translate(2px, -1px); text-shadow: 2px 0 #4fd1ff; }
  60% { transform: translate(-1px, 0); text-shadow: -1px 0 var(--accent); }
  80% { transform: translate(1px, 1px); text-shadow: 1px 0 #4fd1ff; }
  100% { transform: translate(0); text-shadow: 0 0 14px var(--accent-glow); }
}

.tagline {
  margin: 4px 0 20px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Liquid-glass technique ported from
   github.com/polidario/Frontend-Projects/tree/main/liquid-glass-vue
   (AppCard.vue) - an SVG feDisplacementMap (defined in index.html as
   #glass-distortion) referenced inside backdrop-filter for real refraction,
   plus an inset-shadow ::before for the bright edge highlight. Firefox/Chrome
   get the full distortion via the unprefixed property; the prefixed
   -webkit-backdrop-filter is a plain-blur fallback for engines that don't
   support an SVG filter reference inside backdrop-filter. */
.discord-widget {
  position: relative;
  width: 100%;
  background: rgba(20, 8, 9, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
  display: flex;
  gap: 14px;
  overflow: hidden;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: brightness(1.08) blur(3px) url(#glass-distortion);
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.4));
}

.discord-widget::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 3px 3px 0px -3px rgba(255, 255, 255, 0.7),
    inset 0 0 5px 1px rgba(255, 255, 255, 0.35);
}

.discord-avatar-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  transition: width 0.15s ease, height 0.15s ease;
}
.discord-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #1a0a0d;
}
/* Grow the avatar to match the taller row when there's activity art, so it
   still reaches the bottom of the box instead of looking undersized. */
.discord-widget:has(.discord-activity.has-image) .discord-avatar-wrap {
  width: 76px;
  height: 76px;
}
.discord-status-icon {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  padding: 1px;
  animation: dot-pop 0.25s ease;
}
.discord-status-icon svg { width: 100%; height: 100%; display: block; }
@keyframes dot-pop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.discord-card-body { flex: 1; min-width: 0; }

.discord-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.discord-username {
  font-weight: 600;
  font-size: 0.95rem;
}

.badge-chip {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--text);
}
.clan-chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--accent-dim);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.clan-badge-img { width: 14px; height: 14px; border-radius: 3px; object-fit: cover; }

.discord-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.badge-icon-chip {
  --badge-color: var(--accent);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 27, 61, 0.15);
  background: color-mix(in srgb, var(--badge-color) 22%, rgba(0,0,0,0.4));
  color: var(--badge-color);
  cursor: default;
}
.badge-icon-chip svg { width: 13px; height: 13px; }
.badge-icon-chip--img { background: none; padding: 0; }
.badge-icon-img { width: 20px; height: 20px; object-fit: contain; display: block; }

.discord-activity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  transition: margin-top 0.15s ease;
}

.activity-image {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  flex-shrink: 0;
  transition: width 0.15s ease, height 0.15s ease;
}

/* When there's real art (album cover / game icon) to show, give the row
   more room so it reads like Discord's own rich-presence card. */
.discord-activity.has-image {
  margin-top: 10px;
}
.discord-activity.has-image .activity-image {
  width: 52px;
  height: 52px;
  border-radius: 8px;
}
.discord-activity.has-image .activity-text {
  font-size: 0.85rem;
}

.activity-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--text-dim);
  overflow: hidden;
  min-width: 0;
}
.activity-title {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-timer {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.socials {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.social-link {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.social-link:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 0 10px var(--accent-glow));
}
.social-link svg { width: 42px; height: 42px; }
.social-link svg path { transition: fill 0.15s ease; }

/* Reveal each brand's real color on hover instead of the theme color. */
.social-link[data-icon="twitter"]:hover svg path { fill: #ffffff; }
.social-link[data-icon="discord"]:hover svg path { fill: #5865F2; }
.social-link[data-icon="steam"]:hover svg .steam-circle { mask: none; fill: url(#steam-badge-grad); }
.social-link[data-icon="steam"]:hover svg .steam-glyph { fill: #ffffff; }

.view-count {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}
.view-count svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.music-control {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.music-toggle {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  padding: 0;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, filter 0.15s ease;
}
.music-toggle:not(:disabled):hover {
  color: var(--text);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.music-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}
.music-toggle .icon { width: 24px; height: 24px; }

/* Hidden until the control is hovered/focused, then drops down above the
   button as a vertical slider (a horizontal <input type=range>, rotated). */
.volume-slider-wrap {
  height: 0;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  transition: height 0.18s ease, opacity 0.18s ease, margin-bottom 0.18s ease;
}
.music-control:hover .volume-slider-wrap,
.music-control:focus-within .volume-slider-wrap {
  height: 90px;
  opacity: 1;
  margin-bottom: 6px;
}

.volume-slider {
  width: 80px;
  height: 20px;
  margin: 0;
  transform: rotate(-90deg);
  cursor: pointer;
  accent-color: var(--accent);
}
.volume-slider:disabled { cursor: not-allowed; }

.hidden { display: none !important; }

#bg-shield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background: transparent;
}

@media (max-width: 480px) {
  .card { margin: 24px 16px; padding: 26px 20px 20px; }
}
