@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg0: #0a0a0d;
  --bg1: #101014;
  --card: rgba(22,22,27,0.72);
  --border: rgba(255,255,255,0.08);
  --text: #f3f1ec;
  --muted: #9b9aa3;
  --accent: #ff5c39;
  --accent-soft: rgba(255,92,57,0.18);
}

html[data-theme="light"] {
  --bg0: #eeece6;
  --bg1: #f5f4ef;
  --card: rgba(255,255,255,0.75);
  --border: rgba(20,20,22,0.08);
  --text: #17171a;
  --muted: #65646b;
  --accent: #e04b2a;
  --accent-soft: rgba(224,75,42,0.14);
}

* { box-sizing: border-box; }

/* Enabled by config.php. The JS supplies --custom-cursor from the configured image. */
html.custom-cursor-enabled,
html.custom-cursor-enabled body,
html.custom-cursor-enabled body * {
  cursor: var(--custom-cursor, auto) !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  background: radial-gradient(ellipse at 20% 10%, var(--bg1) 0%, var(--bg0) 60%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  position: relative;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

.bg-blob {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}
.blob1 { background: var(--accent); top: -10%; left: -8%; animation: drift1 14s ease-in-out infinite; }
.blob2 { background: #3b82f6; width: 380px; height: 380px; opacity: 0.1; bottom: -12%; right: -6%; animation: drift2 18s ease-in-out infinite; }

@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-30px) scale(1.1); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,30px) scale(1.15); } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(59,165,93,0.4); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

@media (prefers-reduced-motion: reduce) {
  .bg-blob, .avatar-ring.pulse { animation: none !important; }
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 28px 24px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  cursor: pointer; border-radius: 999px;
}
.theme-btn { width: 32px; height: 32px; margin-left: auto; display: flex; }

.profile { display: flex; flex-direction: column; align-items: center; margin-top: 4px; }

.avatar-ring {
  width: 92px; height: 92px; border-radius: 50%; padding: 3px;
  background: #6b6e76;
}
.avatar-inner { width: 100%; height: 100%; border-radius: 50%; padding: 3px; background: var(--bg0); }
.avatar-inner img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.profile-identity { display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 100%; margin-top: 14px; }
.profile-name-row { display: flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; }
.discord-tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--border); background: var(--accent-soft); color: var(--text); font-size: 11px; font-weight: 700; line-height: 1; }
.discord-tag-icon { width: 14px; height: 14px; object-fit: contain; display: block; }
.tagline { margin-top: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.badges { display: flex; gap: 5px; margin-top: 7px; min-height: 20px; align-items: center; flex-wrap: wrap; justify-content: center; }
.badge-icon { width: 18px; height: 18px; }

/* Respect the HTML hidden attribute even though component styles set display:flex. */
.spotify-card[hidden],
.spotify-link[hidden],
#player[hidden] {
  display: none !important;
}

.spotify-card {
  margin-top: 10px; width: 100%; display: flex; gap: 10px; align-items: center;
  padding: 8px; border-radius: 12px; border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(30,215,96,0.10), rgba(30,215,96,0.02));
  text-align: left;
}
.spotify-art { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--border); }
.spotify-info { flex: 1; min-width: 0; }
.spotify-song { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spotify-artist { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.spotify-progress { height: 3px; border-radius: 2px; background: var(--border); margin-top: 6px; overflow: hidden; }
.spotify-progress-fill { height: 100%; width: 0%; background: #1ed760; transition: width 0.3s linear; }

.spotify-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 11px; font-weight: 600; color: #1ed760; text-decoration: none;
  padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(30,215,96,0.35);
  background: rgba(30,215,96,0.08);
}
.spotify-link:hover { background: rgba(30,215,96,0.16); }

.presence-list {
  width: 100%;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.presence-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--accent-soft); font-size: 12px; max-width: 100%;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b6e76; flex-shrink: 0; }
#presence-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rpc-card {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(127,127,127,0.04);
}
.rpc-logo-wrap {
  width: 54px; height: 54px; border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--bg1); border: 1px solid var(--border);
}
.rpc-logo { width: 100%; height: 100%; object-fit: cover; display: block; }
.rpc-logo-fallback { font-size: 20px; font-weight: 700; color: var(--muted); }
.rpc-content { min-width: 0; text-align: center; }
.rpc-title { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpc-text { margin-top: 9px; font-size: 11px; color: var(--muted); line-height: 1.35; overflow: hidden; }
.rpc-text > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.socials { display: flex; justify-content: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.social-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); color: var(--text);
  background: rgba(127,127,127,0.06);
  transition: transform 0.15s ease, color 0.2s ease;
}
.social-icon:hover { transform: translateY(-2px); }
.social-icon svg { width: 17px; height: 17px; }

.icon-mode-toggle { display: flex; justify-content: center; margin-top: 8px; }
#icon-mode-btn { font-size: 11px; color: var(--muted); background: none; border: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.player { margin-top: 22px; border-radius: 14px; border: 1px solid var(--border); padding: 14px 14px 10px; background: rgba(127,127,127,0.04); }
.player-top { display: flex; align-items: center; gap: 10px; }
.art { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; background: linear-gradient(135deg, var(--accent), #3b82f6); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.track-art-image { width: 100%; height: 100%; object-fit: cover; display: block; }
#track-art-fallback[hidden] { display: none; }
.track-meta { flex: 1; min-width: 0; }
.track-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-artist { font-size: 11px; color: var(--muted); }
#repeat-btn, #shuffle-btn { width: 28px; height: 28px; flex-shrink: 0; }
#repeat-btn.active, #shuffle-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.progress-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 9px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-bar { position: relative; height: 16px; border-radius: 999px; margin-top: 3px; cursor: pointer; }
.progress-fill { position: absolute; left: 0; top: 6px; height: 4px; width: 0%; border-radius: 999px; background: var(--accent); pointer-events: none; transition: width 0.08s linear; }
.seek-input { position: absolute; inset: 0; width: 100%; height: 16px; margin: 0; appearance: none; -webkit-appearance: none; background: linear-gradient(to right, transparent 0%, transparent 100%); outline: none; cursor: pointer; z-index: 2; }
.seek-input::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--progress-level, 0%), var(--border) var(--progress-level, 0%), var(--border) 100%); }
.seek-input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 10px; height: 10px; margin-top: -3px; border: 2px solid var(--bg1); border-radius: 50%; background: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.22); opacity: 0; transition: opacity .15s ease, transform .12s ease; }
.seek-input:hover::-webkit-slider-thumb, .seek-input:focus-visible::-webkit-slider-thumb { opacity: 1; transform: scale(1.1); }
.seek-input::-moz-range-track { height: 4px; border-radius: 999px; background: var(--border); }
.seek-input::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--accent); }
.seek-input::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid var(--bg1); border-radius: 50%; background: var(--text); opacity: 0; }
.seek-input:hover::-moz-range-thumb, .seek-input:focus-visible::-moz-range-thumb { opacity: 1; }

.controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 10px; }
.controls .icon-btn { border: none; background: none; color: var(--text); width: auto; height: auto; }
.play-btn { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }

.volume-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); }
.volume-toggle { width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 6px; transition: color .15s ease, background .15s ease; }
.volume-toggle:hover { color: var(--text); background: rgba(127,127,127,0.08); }
.volume-toggle.muted { color: var(--muted); }
.volume-row input[type="range"] {
  --volume-level: 70%;
  flex: 1; width: 100%; height: 5px; appearance: none; -webkit-appearance: none;
  border-radius: 999px; outline: none; cursor: pointer;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--volume-level), var(--border) var(--volume-level), var(--border) 100%);
  transition: background 120ms ease;
}
.volume-row input[type="range"]::-webkit-slider-runnable-track { height: 5px; background: transparent; border-radius: 999px; }
.volume-row input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border: 2px solid var(--bg1); border-radius: 50%; background: var(--text); box-shadow: 0 1px 5px rgba(0,0,0,.25); transition: transform 120ms ease, box-shadow 120ms ease; }
.volume-row input[type="range"]:hover::-webkit-slider-thumb, .volume-row input[type="range"]:focus-visible::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 0 0 4px var(--accent-soft); }
.volume-row input[type="range"]::-moz-range-track { height: 5px; background: var(--border); border-radius: 999px; }
.volume-row input[type="range"]::-moz-range-progress { height: 5px; background: var(--accent); border-radius: 999px; }
.volume-row input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--bg1); border-radius: 50%; background: var(--text); }

.tracks-btn { width: 100%; margin-top: 10px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.tracks-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.track-list-item {
  cursor: pointer; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks-dialog { max-height: min(70vh, 520px); overflow: hidden; }
.tracks-dialog .contact-links { max-height: min(50vh, 360px); overflow-y: auto; }

.footer { text-align: center; font-size: 10px; color: var(--muted); margin-top: 18px; margin-bottom: 0; }


.contact-btn {
  margin-top: 14px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(127,127,127,0.06);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.contact-btn:hover { background: rgba(127,127,127,0.12); }

.contact-modal[hidden] { display: none; }
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}
.contact-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(5px);
}
.contact-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.contact-dialog h2 { margin: 0 0 14px; font-size: 18px; }
.contact-close {
  position: absolute;
  top: 9px;
  right: 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}
.contact-links { display: grid; gap: 8px; }
.contact-links a {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}
.contact-links a:hover { background: rgba(127,127,127,0.08); }

.badge-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg0);
  font-size: 10px;
  font-weight: 700;
}

/* Optional background: when unset, the original animated background remains untouched. */
body.has-background-image {
  background-image: linear-gradient(rgba(0,0,0,0.18), rgba(0,0,0,0.18)), var(--page-background-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
body.has-background-image::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 20% 10%, var(--bg1) 0%, transparent 60%);
  pointer-events: none;
}

.avatar-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.badges {
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.badge-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  outline: none;
}
.badge-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}
.badge-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translate(-50%, 3px);
  z-index: 100;
  max-width: min(240px, 70vw);
  padding: 7px 10px;
  border-radius: 8px;
  background: #18191c;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 70ms ease-out, transform 70ms ease-out, visibility 0s linear 70ms;
}
.badge-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: #18191c;
  transform: translateX(-50%) rotate(45deg);
}
.badge-wrap:hover .badge-tooltip,
.badge-wrap:focus-visible .badge-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.rpc-card {
  position: relative;
  display: block;
  min-height: 76px;
  padding: 12px 12px 12px 78px;
}
.rpc-logo-wrap {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
}
.rpc-content {
  width: 100%;
  min-width: 0;
  text-align: center;
}
.rpc-title {
  text-align: center;
}
.rpc-text {
  margin-top: 10px;
}

.spotify-time {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
