* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05060f;
  font-family: "Outfit", system-ui, sans-serif;
  color: #e6e9ff;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #1b2140 0%, #05060f 75%);
}

.bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.bg img.hidden {
  display: none;
}

#rain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.45) 100%);
}

.box {
  background: rgba(12, 14, 28, 0.32);
  -webkit-backdrop-filter: blur(34px) saturate(150%);
  backdrop-filter: blur(34px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: 26px;
}

.profile {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, 92vw);
  min-height: 560px;
  z-index: 10;
  padding: 42px 36px 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInUp 0.9s ease-out both;
}

.avatar-wrap {
  width: 84px;
  height: 84px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #8b5cf6, #06b6d4, #f43f5e, #8b5cf6);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.35);
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #0b0d1c;
}

.name {
  margin-top: 18px;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ffffff, #cfd4ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.12);
}

.tagline {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 300;
  color: #aab1e0;
  text-align: center;
  max-width: 300px;
  line-height: 1.5;
}

.time-area {
  margin-top: 34px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.my-time {
  font-size: 30px;
  font-weight: 600;
  color: #6b7296;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  min-width: 92px;
  text-align: center;
}

.my-time.live {
  color: #e6e9ff;
  text-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

.tag-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #bfc6ea;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.circle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(6, 182, 212, 0.5));
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.circle-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.7);
}

.views {
  position: absolute;
  right: 22px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #cdd3f5;
  font-weight: 500;
}

.views i {
  font-size: 17px;
  color: #9aa2cf;
}

.view-inc {
  position: absolute;
  right: 0;
  bottom: 130%;
  font-size: 16px;
  font-weight: 700;
  color: #22d3ee;
  pointer-events: none;
  animation: riseFade 1.2s ease-out forwards;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.8);
}

.socials {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 2;
}

.soc {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.soc:hover {
  transform: scale(1.14) translateX(3px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}

.soc svg {
  width: 19px;
  height: 19px;
}

.soc.discord { color: #5865f2; }
.soc.discord:hover { background: rgba(88, 101, 242, 0.22); box-shadow: 0 0 20px rgba(88, 101, 242, 0.55); }

.soc.website { color: #38bdf8; }
.soc.website:hover { background: rgba(56, 189, 248, 0.2); box-shadow: 0 0 20px rgba(56, 189, 248, 0.55); }

.soc.github { color: #e6edf3; }
.soc.github:hover { background: rgba(230, 237, 243, 0.12); box-shadow: 0 0 20px rgba(230, 237, 243, 0.4); }

.soc.youtube { color: #ff0000; }
.soc.youtube:hover { background: rgba(255, 0, 0, 0.18); box-shadow: 0 0 20px rgba(255, 0, 0, 0.55); }

.soc.instagram {
  background-image: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.soc.instagram:hover { box-shadow: 0 0 20px rgba(220, 39, 67, 0.5); background-color: rgba(220, 39, 67, 0.14); }

.soc.spotify { color: #1db954; }
.soc.spotify:hover { background: rgba(29, 185, 84, 0.18); box-shadow: 0 0 20px rgba(29, 185, 84, 0.55); }

.soc.roblox { color: #e2231a; }
.soc.roblox:hover { background: rgba(226, 35, 26, 0.18); box-shadow: 0 0 20px rgba(226, 35, 26, 0.55); }

.leaderboard {
  position: fixed;
  top: 24px;
  right: 24px;
  width: min(300px, 88vw);
  max-height: 420px;
  z-index: 12;
  padding: 18px 18px 14px;
  overflow-y: auto;
  animation: fadeInSlide 1s ease-out both;
}

.lb-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.lb-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #dfe4ff;
}

.hint-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
  cursor: help;
  display: inline-block;
}

.hint-pop {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 18, 36, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #e6e9ff;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.hint-dot:hover + .hint-pop,
.lb-head:hover .hint-pop {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#lbList {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#lbList li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
}

#lbList .rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  flex: none;
}

#lbList .rank.r1 { background: linear-gradient(135deg, #ffd700, #b8860b); color: #191200; }
#lbList .rank.r2 { background: linear-gradient(135deg, #d7dde8, #8f9bb3); color: #10131a; }
#lbList .rank.r3 { background: linear-gradient(135deg, #d08a4b, #8a4b1f); color: #1b1005; }

#lbList .lb-user {
  flex: 1;
  font-weight: 600;
  color: #e6e9ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#lbList .lb-time {
  font-weight: 500;
  color: #9aa2cf;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

#lbList .lb-empty {
  justify-content: center;
  color: #8b93bf;
  font-style: italic;
  font-size: 12px;
}

.music-btn {
  position: fixed;
  z-index: 15;
  bottom: 22px;
  left: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 14, 28, 0.4);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #cdd3f5;
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.music-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.music-btn.playing {
  color: #22d3ee;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
  animation: pulseGlow 2.4s ease-in-out infinite;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  background: rgba(3, 4, 10, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal.open {
  display: grid;
}

.modal-card {
  position: relative;
  width: min(360px, 92vw);
  padding: 30px 28px 26px;
  text-align: center;
  animation: popIn 0.3s ease-out both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #cdd3f5;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.modal-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #e6e9ff;
}

.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 18px 0 26px;
}

.tab {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #9aa2cf;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.6), rgba(6, 182, 212, 0.6));
  border-color: transparent;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin-bottom: 16px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: #9aa2cf;
  letter-spacing: 0.4px;
}

.field input {
  font-family: inherit;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e6e9ff;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.auth-msg {
  font-size: 12px;
  min-height: 18px;
  color: #f87171;
  margin-bottom: 6px;
}

.auth-msg.ok {
  color: #4ade80;
}

.auth-submit {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  padding: 13px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(139, 92, 246, 0.5);
}

.auth-submit:disabled {
  opacity: 0.55;
  transform: none;
  cursor: not-allowed;
}

.leaderboard::-webkit-scrollbar {
  width: 6px;
}

.leaderboard::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes riseFade {
  0% { opacity: 0; transform: translateY(6px); }
  20% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-34px); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(34, 211, 238, 0.35); }
  50% { box-shadow: 0 0 26px rgba(34, 211, 238, 0.7); }
}

@media (max-width: 640px) {
  .profile {
    padding-bottom: 84px;
    min-height: 520px;
  }
  .socials {
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    bottom: 14px;
    flex-direction: row;
    gap: 10px;
  }
  .soc:hover {
    transform: scale(1.12);
  }
  .leaderboard {
    top: 14px;
    right: 14px;
    width: min(280px, 86vw);
    max-height: 300px;
  }
  .name {
    font-size: 34px;
  }
}