:root {
  --black: #000;
  --panel: rgba(4, 4, 4, 0.58);
  --panel-strong: rgba(10, 10, 10, 0.86);
  --line: rgba(255, 255, 255, 0.13);
  --white: #f6f6f6;
  --muted: rgba(255, 255, 255, 0.62);
  --soft: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0, 0, 0, 0.82);
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --move-x: 0px;
  --move-y: 0px;
  --bg-x: 0px;
  --bg-y: 0px;
  --layer-x: 0px;
  --layer-y: 0px;
  --bg-blur: 0px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--white);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  color: inherit;
}

.background {
  position: fixed;
  inset: -30px;
  z-index: 0;
  background-image: url("assets/background.jpg");
  background-position: center right;
  background-size: cover;
  filter: blur(var(--bg-blur)) brightness(0.7) contrast(1.18) grayscale(1);
  transform: translate3d(var(--bg-x), var(--bg-y), 0) scale(1.06);
  transition: transform 180ms ease-out;
  pointer-events: none;
}

.shade {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 52% 43%, rgba(255, 255, 255, 0.06), transparent 25%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.34) 54%, rgba(0, 0, 0, 0.58)),
    rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.scene {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  perspective: 820px;
  transition: filter 260ms ease, transform 260ms ease;
}

.profile-card {
  width: min(800px, 100%);
  min-height: 340px;
  margin-right: 0;
  padding: 38px 40px 30px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--panel);
  box-shadow: 0 42px 120px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(74%);
  transform:
    translate3d(var(--move-x), var(--move-y), 0)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform 110ms ease-out, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.profile-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(4, 4, 4, 0.66);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 22px;
}

.avatar-frame {
  width: 124px;
  height: 124px;
  flex: 0 0 124px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  padding: 3px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 34px rgba(255, 255, 255, 0.13);
  transform: translate3d(calc(var(--layer-x) * 1.15), calc(var(--layer-y) * 1.15), 76px);
  transition: transform 110ms ease-out;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.profile-copy {
  min-width: 0;
  transform: translate3d(calc(var(--layer-x) * 0.7), calc(var(--layer-y) * 0.7), 54px);
  transition: transform 110ms ease-out;
}

.name-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.profile-copy h1 {
  margin: 0;
  font-family: "Old English Text MT", Georgia, "Times New Roman", serif;
  font-size: 3rem;
  line-height: 1;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.55);
  letter-spacing: 0;
}

.badge-strip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.badge-item {
  position: relative;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  outline: none;
}

.badge-item::after {
  content: attr(data-badge);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.86);
  color: var(--white);
  font: 700 0.72rem "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.badge-item::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  z-index: 5;
  width: 8px;
  height: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.86);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px) rotate(45deg);
  transition: opacity 140ms ease, transform 140ms ease;
}

.badge-item:hover::after,
.badge-item:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.badge-item:hover::before,
.badge-item:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0) rotate(45deg);
}

.badge-item img {
  width: 23px;
  height: 23px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.18));
}

.profile-copy p {
  margin: 7px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--white);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
}

.typewriter-text::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 3px;
  background: rgba(255, 255, 255, 0.82);
  vertical-align: -0.12em;
  animation: caretBlink 780ms steps(1) infinite;
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

.profile-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.view-count {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  line-height: 1;
}

.view-count[hidden] {
  display: none;
}

.link-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 56px 0 34px;
  transform: translate3d(calc(var(--layer-x) * 1.5), calc(var(--layer-y) * 1.5), 96px);
  transition: transform 110ms ease-out;
}

.icon-link {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.42), 0 0 24px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.icon-link:hover,
.icon-link:focus-visible {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.55), 0 0 34px rgba(255, 255, 255, 0.18);
  transform: translateY(-6px) scale(1.07);
}

.icon-link img {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.24));
  pointer-events: none;
}

.icon-link svg {
  width: 39px;
  height: 39px;
  fill: none;
  stroke: var(--white);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.24));
  pointer-events: none;
}

.icon-link svg circle {
  fill: rgba(255, 255, 255, 0.96);
  stroke: none;
}

.icon-link svg circle + path,
.icon-link svg circle ~ path {
  stroke: var(--black);
}

.icon-link:first-child svg {
  fill: var(--white);
  stroke: none;
}

.roblox-card {
  min-height: 96px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 0 18px 26px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translate3d(calc(var(--layer-x) * 1.1), calc(var(--layer-y) * 1.1), 66px);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.roblox-card:hover,
.roblox-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.105);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), 0 0 26px rgba(255, 255, 255, 0.1);
  outline: none;
}

.roblox-avatar {
  width: 76px;
  height: 76px;
  display: block;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.4);
}

.roblox-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.roblox-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.roblox-meta strong {
  overflow: hidden;
  font-size: 1.35rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roblox-meta span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-bar {
  min-height: 62px;
  display: grid;
  grid-template-columns: 44px 150px minmax(120px, 1fr) 145px;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 0;
  border-top: 1px solid var(--line);
  transform: translate3d(calc(var(--layer-x) * 0.9), calc(var(--layer-y) * 0.9), 44px);
  transition: transform 110ms ease-out;
}

.round-control {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.round-control:hover,
.round-control:focus-visible {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
  transform: scale(1.03);
  outline: none;
}

.round-control svg {
  width: 21px;
  height: 21px;
  fill: var(--white);
}

.icon-pause,
.is-playing .icon-play {
  display: none;
}

.is-playing .icon-pause {
  display: block;
}

.track-meta {
  min-width: 0;
}

.track-meta strong,
.track-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-meta strong {
  font-size: 0.92rem;
}

.track-meta span {
  color: var(--muted);
  font-size: 0.76rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--white);
  cursor: pointer;
}

.seek {
  min-width: 120px;
}

.volume {
  display: grid;
  grid-template-columns: 22px minmax(74px, 1fr);
  align-items: center;
  gap: 9px;
}

.volume svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--white);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 6;
  min-width: 130px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--white);
  font-size: 0.86rem;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.enter-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(0, 0, 0, 0.2);
  color: var(--white);
  cursor: pointer;
  font: 700 1.2rem "Segoe UI", Arial, sans-serif;
  backdrop-filter: blur(18px) brightness(0.55);
  transition: opacity 260ms ease, visibility 260ms ease;
}

.enter-gate span {
  min-width: 112px;
  padding: 15px 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 34px rgba(255, 255, 255, 0.14);
}

.enter-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body:not(.entered) {
  cursor: pointer;
}

body:not(.entered) {
  --bg-blur: 8px;
}

body:not(.entered) .scene {
  filter: blur(10px) brightness(0.54);
  transform: scale(0.985);
}

@media (max-width: 720px) {
  .scene {
    padding: 22px 14px;
  }

  .profile-card {
    margin-right: 0;
    padding: 28px 20px 22px;
  }

  .avatar-frame,
  .profile-copy,
  .link-row,
  .roblox-card,
  .music-bar {
    transform: none;
  }

  .profile-top {
    flex-direction: column;
    text-align: center;
  }

  .name-line {
    justify-content: center;
    flex-wrap: wrap;
  }

  .profile-meta-line {
    justify-content: center;
  }

  .profile-copy h1 {
    font-size: 2.65rem;
  }

  .link-row {
    flex-wrap: wrap;
    gap: 12px;
    margin: 38px 0 28px;
  }

  .music-bar {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .roblox-card {
    margin: 0 0 24px;
  }

  .seek,
  .volume {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .profile-card {
    padding: 24px 16px 20px;
  }

  .avatar-frame {
    width: 104px;
    height: 104px;
    flex-basis: 104px;
  }

  .profile-copy h1 {
    font-size: 2.35rem;
  }

  .badge-strip {
    min-height: 32px;
    padding: 5px 7px;
  }

  .badge-item img {
    width: 21px;
    height: 21px;
  }

  .icon-link {
    width: 58px;
    height: 58px;
    border-radius: 20px;
  }

  .icon-link img,
  .icon-link svg {
    width: 35px;
    height: 35px;
  }

  .roblox-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
    border-radius: 23px;
  }

  .roblox-avatar {
    width: 64px;
    height: 64px;
    border-radius: 19px;
  }

  .roblox-meta strong {
    font-size: 1.08rem;
  }

  .roblox-meta span:last-child {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }

  .profile-card,
  .background {
    transform: none !important;
  }
}
