:root {
  color-scheme: dark;
  --bg: #000000;
  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.75);
  --fg-faint: rgba(255, 255, 255, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.005);
  --glass-border: rgba(255, 255, 255, 0.08);
  --btn-bg: rgba(255, 255, 255, 0.02);
  --btn-border: rgba(255, 255, 255, 0.08);
  --btn-hover-bg: rgba(255, 255, 255, 0.08);
  --btn-hover-border: rgba(255, 255, 255, 0.25);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
}

/* Reveal Screen */
.reveal-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.reveal-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.reveal-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.reveal-dots span {
  display: inline-block;
  opacity: 0.3;
  animation: dot-glow 2.4s ease-in-out infinite;
}

.reveal-dots span:nth-child(2) {
  animation-delay: 0.3s;
}

.reveal-dots span:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes dot-glow {
  0%, 100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.85;
  }
}

/* Background Media Layer */
.media-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #000000;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

/* Top Right Glass Music Player */
.corner-player {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease;
  user-select: none;
}

.corner-player:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.player-cover {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.player-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 155px;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.68rem;
}

.player-title {
  color: var(--fg);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
  letter-spacing: -0.01em;
}

.player-meta-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.player-eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 9px;
}

.player-eq i {
  display: block;
  width: 2px;
  height: 3px;
  background: var(--fg);
  border-radius: 1px;
  opacity: 0.75;
}

.corner-player.is-playing .player-eq i:nth-child(1) {
  animation: eq-bounce 0.75s ease-in-out infinite alternate;
}

.corner-player.is-playing .player-eq i:nth-child(2) {
  animation: eq-bounce 0.6s 0.2s ease-in-out infinite alternate;
}

.corner-player.is-playing .player-eq i:nth-child(3) {
  animation: eq-bounce 0.85s 0.35s ease-in-out infinite alternate;
}

@keyframes eq-bounce {
  0% { height: 2px; }
  100% { height: 9px; }
}

.player-time {
  color: var(--fg-faint);
  font-size: 0.625rem;
}

/* Smooth Progress Scrubber */
.progress-container {
  width: 100%;
  height: 12px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: visible;
  transition: height 0.15s ease;
}

.progress-container:hover .progress-track {
  height: 4px;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--fg);
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.08s linear;
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  transition: transform 0.15s ease;
}

.progress-container:hover .progress-handle {
  transform: translate(-50%, -50%) scale(1);
}

.player-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.player-toggle:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
  transform: scale(1.05);
}

.player-toggle .icon-play {
  display: block;
  margin-left: 2px;
}

.player-toggle .icon-pause {
  display: none;
}

.corner-player.is-playing .player-toggle .icon-play {
  display: none;
}

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

/* Main Layout */
.main-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  perspective: 1000px;
}

.cards-stack {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Crystal Transparent Glass Tile with 3D Tilt */
.glass-tile {
  width: 100%;
  padding: 2.5rem 2rem;
  border-radius: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, border-color 0.25s ease;
  will-change: transform;
}

.glass-tile:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.user-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.user-pfp-wrap {
  position: relative;
  display: inline-block;
}

.user-pfp {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: border-color 0.25s ease;
}

.glass-tile:hover .user-pfp {
  border-color: rgba(255, 255, 255, 0.25);
}

/* Discord Status Badge on PFP - Shifted to edge & scaled */
.discord-status-badge {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 4px solid #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.discord-status-badge.status-online {
  background: #23a55a;
}

.discord-status-badge.status-idle {
  background: #f0b232;
}

.discord-status-badge.status-dnd {
  background: #f23f43;
}

.discord-status-badge.status-dnd::after {
  content: "";
  display: block;
  width: 10px;
  height: 3px;
  background: #ffffff;
  border-radius: 1.5px;
}

.discord-status-badge.status-offline {
  background: #80848e;
}

.discord-status-badge.status-offline::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  background: #000000;
  border-radius: 50%;
}

.user-titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.title {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--fg);
  text-transform: lowercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.live-clock {
  font-size: 0.72rem;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* Centered Bottom Icon Button Row */
.icon-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--fg-muted);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: all 0.18s ease;
}

.icon-btn svg {
  display: block;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
}

.icon-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
  color: var(--fg);
  transform: translateY(-1px);
}

/* Email Popout Badge with Seamless Hover Bridge */
.mail-popover-wrapper {
  position: relative;
  display: inline-flex;
}

.mail-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 8px;
  background: rgba(14, 14, 18, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 50;
  cursor: pointer;
}

.mail-popover::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}

.mail-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: rgba(14, 14, 18, 0.92) transparent transparent transparent;
}

.mail-popover-wrapper:hover .mail-popover:not(.is-dismissed) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mail-text {
  font-size: 0.72rem;
  color: var(--fg);
  font-family: var(--font-mono);
  user-select: all;
  transition: color 0.15s ease;
}

.mail-popover:hover .mail-text {
  color: #60a5fa;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--fg);
}

.copy-btn .icon-copy {
  display: block;
}

.copy-btn .icon-check {
  display: none;
}

.copy-btn.copied {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.4);
}

.copy-btn.copied .icon-copy {
  display: none;
}

.copy-btn.copied .icon-check {
  display: block;
  color: #4ade80;
}

/* Common Sub-Card Glass Styles (Roblox & Last.fm) */
.roblox-card,
.lastfm-card {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.25s ease, transform 0.15s ease-out;
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  transform-style: preserve-3d;
  will-change: transform;
}

.roblox-card:hover,
.lastfm-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Roblox Left & Right */
.roblox-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.roblox-avatar-wrap {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.roblox-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.roblox-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.roblox-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.roblox-stats {
  font-size: 0.7rem;
  color: var(--fg-muted);
  font-weight: 400;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.roblox-right,
.lastfm-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.roblox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--fg);
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.roblox-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

/* Last.fm Glass Card */
.lastfm-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.lastfm-art-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.lastfm-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lastfm-live-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.9);
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.lastfm-live-dot.is-idle {
  display: none;
}

.lastfm-info {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.lastfm-status-label {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  color: #4ade80;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.lastfm-status-label.is-idle {
  color: var(--fg-faint);
}

/* Animated Typewriter Dots */
.typing-dots {
  display: inline-flex;
  align-items: center;
  margin-left: 1px;
}

.typing-dots span {
  display: inline-block;
  opacity: 0;
  animation: typing-dot 1.5s infinite;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.3s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes typing-dot {
  0%, 20% {
    opacity: 0;
  }
  40%, 80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.lastfm-track {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.lastfm-artist {
  font-size: 0.7rem;
  color: var(--fg-muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.lastfm-btn {
  padding: 0.38rem 0.75rem;
  font-size: 0.7rem;
}

@media (max-width: 580px) {
  .main-wrapper {
    padding: 2rem 1.25rem;
  }

  .glass-tile {
    padding: 1.75rem 1.25rem;
    gap: 1.25rem;
  }

  .user-pfp {
    width: 96px;
    height: 96px;
  }

  .discord-status-badge {
    width: 24px;
    height: 24px;
    border-width: 3px;
  }

  .title {
    font-size: 1.35rem;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .corner-player {
    top: 14px;
    right: 14px;
    padding: 0.5rem 0.7rem;
    gap: 0.65rem;
  }

  .player-details {
    width: 120px;
  }

  .roblox-card,
  .lastfm-card {
    padding: 0.65rem 0.85rem;
  }

  .lastfm-track,
  .lastfm-artist {
    max-width: 130px;
  }
}
