/* ============================================================
   style.css — Стили биолинка DOGER (guns.lol style)
   ============================================================ */

@font-face {
  font-family: "CustomFont";
  src: url("../assets/fonts/fuente.otf") format("opentype");
  font-display: swap;
}

/* ============================================================
   RESET & BASE STYLES
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary-accent: #acc8ff;
  --primary-glow: rgba(172, 200, 255, 0.4);
  --glass-bg: rgba(14, 16, 24, 0.55);
  --glass-border: rgba(172, 200, 255, 0.12);
  --glass-blur: 16px;
  --text-main: #ffffff;
  --text-dim: rgba(172, 200, 255, 0.75);
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: #05060a;
  color: var(--text-main);
  font-family: "CustomFont", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ============================================================
   ENTRY SCREEN
   ============================================================ */
#entry-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 8, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

#entry-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.entry-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

#entry-symbol {
  font-size: clamp(34px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: 4px;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 0 0 20px #acc8ff, 0 0 45px #3a68ff;
  animation: pulse 2.2s infinite ease-in-out;
}

#entry-text {
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(172, 200, 255, 0.65);
  animation: fadeInOut 2.2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%       { opacity: 1; transform: scale(1.08); filter: drop-shadow(0 0 16px #acc8ff); }
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.9; }
}

/* ============================================================
   TOP FLOATING VOLUME CONTROL
   ============================================================ */
#top-volume-control {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 40px;
  background: rgba(14, 18, 30, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(172, 200, 255, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

#top-volume-control:hover {
  background: rgba(18, 24, 42, 0.85);
  border-color: rgba(172, 200, 255, 0.35);
  box-shadow: 0 6px 25px rgba(58, 104, 255, 0.2);
}

#volume-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #acc8ff;
  transition: transform 0.15s ease;
}

#volume-btn:hover {
  transform: scale(1.15);
}

.volume-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

#volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 75px;
  height: 5px;
  border-radius: 5px;
  background: rgba(172, 200, 255, 0.25);
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease, width 0.2s ease;
}

#volume-slider:hover {
  background: rgba(172, 200, 255, 0.4);
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #acc8ff;
  box-shadow: 0 0 8px #acc8ff;
  cursor: pointer;
  transition: transform 0.15s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

#volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #acc8ff;
  box-shadow: 0 0 8px #acc8ff;
  border: none;
  cursor: pointer;
}

#volume-percent {
  font-size: 11px;
  font-weight: 600;
  color: rgba(172, 200, 255, 0.85);
  min-width: 26px;
}

/* ============================================================
   BACKGROUND LAYERS
   ============================================================ */
#bg-video,
#bg-image {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  object-fit: cover;
  z-index: -2;
  filter: brightness(0.65) contrast(1.05);
  pointer-events: none;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

#cursor-canvas {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
}

/* ============================================================
   MAIN CONTENT CONTAINER (Responsive & Scroll-Safe)
   ============================================================ */
#main-content {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
  z-index: 10;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   PROFILE CARD & TILT WRAPPER
   ============================================================ */
#card-tilt-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  width: min(100%, var(--card-max-width, 480px));
  isolation: isolate;
  z-index: 10;
}

/* Hardware crisp image rendering during 3D tilt & animations */
#avatar,
#discord-avatar,
#track-cover,
.social-icon,
.badge-item img {
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#profile-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  padding: clamp(20px, 5vw, 30px);
  background: var(--card-background, rgba(14, 16, 24, 0.5));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--card-border, 1px solid rgba(172, 200, 255, 0.12));
  border-radius: var(--card-border-radius, 36px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(172, 200, 255, 0.05);
  transform: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  transition: box-shadow 0.3s ease;
}

/* Animation on entry reveal */
@keyframes cardUnfold {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#profile-card > * {
  opacity: 0;
}

#profile-card.revealed > * {
  animation: cardUnfold 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#profile-card.revealed > *:nth-child(1) { animation-delay: 50ms; }
#profile-card.revealed > *:nth-child(2) { animation-delay: 200ms; }
#profile-card.revealed > *:nth-child(3) { animation-delay: 350ms; }
#profile-card.revealed > *:nth-child(4) { animation-delay: 500ms; }

/* ============================================================
   SECTION 1: PROFILE MAIN (Avatar, Name, Badges, Status)
   ============================================================ */
#profile-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

#avatar-wrapper {
  position: relative;
  width: var(--avatar-size, 110px);
  height: var(--avatar-size, 110px);
  flex-shrink: 0;
}

#avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(172, 200, 255, 0.35);
  box-shadow: 0 0 18px rgba(172, 200, 255, 0.2);
  display: block;
}

#avatar-decoration {
  position: absolute;
  inset: -14%;
  width: 128%;
  height: 128%;
  object-fit: contain;
  pointer-events: none;
}

#profile-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 6px;
  overflow: hidden;
  flex: 1;
}

#profile-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

#name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.name-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* DOGER — STRICTLY BOLD */
#name-text,
#profile-status,
#discord-username,
#discord-activity,
.discord-time,
.track-artist {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-stroke: 0.35px currentColor;
}

#name-text {
  display: inline-block;
  width: auto;
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 900 !important;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #acc8ff;
  text-shadow: var(--username-glow, 0 0 20px rgba(172, 200, 255, 0.7));
  filter: url(#name-filter);
  padding: 0 4px;
}

.name-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(10, 12, 20, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(172, 200, 255, 0.2);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #acc8ff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
}

.name-wrapper:hover .name-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Badges */
#badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--badge-container-bg, rgba(172, 200, 255, 0.08));
  border: var(--badge-container-border, 1px solid rgba(172, 200, 255, 0.1));
}

#badges:empty {
  display: none !important;
}

.badge-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.badge-item img {
  width: var(--badge-size, 22px);
  height: var(--badge-size, 22px);
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.badge-item:hover img {
  transform: scale(1.25);
}

.badge-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(10, 12, 20, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(172, 200, 255, 0.2);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: #acc8ff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
}

.badge-item:hover .badge-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Status Typewriter */
#profile-status {
  font-size: 14.5px;
  font-weight: 700 !important;
  color: #acc8ff;
  line-height: 1.4;
  word-break: break-word;
  text-align: center;
}

#profile-status::after {
  content: "|";
  display: inline-block;
  margin-left: 3px;
  color: #acc8ff;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================================
   SECTION 2: MUSIC PLAYER WIDGET
   ============================================================ */
#music-player {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(18, 22, 36, 0.55);
  border: 1px solid rgba(172, 200, 255, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.player-cover-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#track-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  transition: transform 0.3s ease;
}

.playing #track-cover {
  /* Без вращения обложки */
  box-shadow: 0 0 14px rgba(172, 200, 255, 0.35);
}

/* Play/Pause Button on Right side */
.player-side-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(172, 200, 255, 0.12);
  border: 1px solid rgba(172, 200, 255, 0.25);
  color: #acc8ff;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  outline: none;
}

.player-side-btn:hover {
  background: rgba(172, 200, 255, 0.25);
  border-color: rgba(172, 200, 255, 0.5);
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(172, 200, 255, 0.45);
}

.player-side-btn:active {
  transform: scale(0.92);
}

.player-side-btn .play-icon {
  display: block;
  transform: translateX(1px);
}

.player-side-btn .pause-icon {
  display: none;
}

#music-player.playing .player-side-btn .play-icon {
  display: none;
}

#music-player.playing .player-side-btn .pause-icon {
  display: block;
}

.player-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.track-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(210, 225, 255, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  -webkit-text-stroke: 0 !important;
}

.track-artist {
  font-size: 13px;
  font-weight: 800;
  color: #acc8ff;
  white-space: nowrap;
  text-transform: uppercase;
}

/* Seekbar */
.player-progress-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(172, 200, 255, 0.18);
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: height 0.15s ease;
}

.progress-bar-container:hover {
  height: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #638aff, #acc8ff);
  border-radius: 6px;
  box-shadow: 0 0 10px #acc8ff;
  transition: width 0.1s linear;
}

.player-time {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #acc8ff;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

/* ============================================================
   SECTION 3: DISCORD PRESENCE BOX
   ============================================================ */
#discord-presence {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--discord-box-background, rgba(18, 22, 36, 0.45));
  border: var(--discord-box-border, 1px solid rgba(172, 200, 255, 0.1));
  border-radius: var(--discord-box-radius, 20px);
}

#discord-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

#discord-avatar {
  width: var(--discord-avatar-size, 54px);
  height: var(--discord-avatar-size, 54px);
  border-radius: 50%;
  object-fit: cover;
  border: var(--discord-avatar-border, 2px solid rgba(172, 200, 255, 0.25));
  display: block;
}

#discord-status-icon {
  display: none !important;
}

#discord-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
}

/* Discord info */
#discord-username {
  color: #acc8ff;
  font-weight: 700 !important;
  font-size: 16px;
  letter-spacing: 0.8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

#discord-activity {
  color: #acc8ff;
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.8px;
  text-shadow: 0 0 8px rgba(172, 200, 255, 0.3);
  line-height: 1.25;
}

/* Discord Activity Timestamp Bar (77:55:33 ── 77:55:33) */
#discord-timestamp-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  width: 100%;
}

.discord-time {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #acc8ff;
  letter-spacing: 0.8px;
  text-shadow: 0 0 8px rgba(172, 200, 255, 0.3);
  white-space: nowrap;
}

.discord-time-line {
  flex: 1;
  height: 2px;
  background: #acc8ff;
  box-shadow: 0 0 6px rgba(172, 200, 255, 0.4);
  border-radius: 2px;
  opacity: 0.85;
}

/* ============================================================
   SECTION 4: CARD FOOTER (VIEWS COUNTER & SOCIAL LINKS)
   ============================================================ */
#card-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding-top: 4px;
}

#profile-views {
  position: absolute;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(172, 200, 255, 0.75);
  background: rgba(18, 22, 36, 0.45);
  border: 1px solid rgba(172, 200, 255, 0.12);
  padding: 5px 11px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  user-select: none;
  font-variant-numeric: tabular-nums;
  cursor: default;
  transition: all 0.25s ease;
}

#profile-views:hover {
  color: #acc8ff;
  border-color: rgba(172, 200, 255, 0.35);
  background: rgba(24, 30, 48, 0.7);
  box-shadow: 0 0 14px rgba(99, 138, 255, 0.25);
  transform: translateY(-1px);
}

.views-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  opacity: 0.85;
}

#views-count {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

#social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

#social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#social-links a:hover {
  opacity: 1;
  transform: translateY(-3px) scale(1.12);
}

.social-icon {
  display: block;
  width: var(--icon-size, 34px);
  height: var(--icon-size, 34px);
  object-fit: contain;
  border-radius: var(--icon-border-radius, 8px);
  filter: drop-shadow(0 0 6px var(--icon-glow-color, #acc8ff));
  transition: transform 0.2s ease;
}

/* ============================================================
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATIONS
   ============================================================ */
@media (max-width: 540px) {
  #top-volume-control {
    top: 12px;
    left: 12px;
    padding: 6px 10px 6px 8px;
  }

  #volume-slider {
    width: 60px;
  }

  #main-content {
    padding: 60px 12px 24px;
  }

  #profile-card {
    gap: 18px;
    padding: 20px 16px;
    border-radius: 26px;
  }

  #avatar-wrapper {
    width: 85px;
    height: 85px;
  }

  #name-text {
    font-size: 26px;
  }

  #badges {
    padding: 3px 8px;
  }

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

  #profile-status {
    font-size: 13.5px;
  }

  #music-player {
    padding: 10px 14px;
    gap: 12px;
  }

  .player-cover-wrap {
    width: 48px;
    height: 48px;
  }

  .track-title {
    font-size: 13.5px;
  }

  .track-artist {
    font-size: 12px;
  }

  #social-links {
    gap: 12px;
  }

  .social-icon {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 440px) {
  #card-footer {
    justify-content: space-between;
  }

  #profile-views {
    position: static;
  }
}

/* On touch devices: disable cursor canvas, enable smooth behavior */
@media (hover: none) and (pointer: coarse) {
  #cursor-canvas {
    display: none !important;
  }

  * {
    cursor: auto !important;
  }

  #player-play-btn {
    opacity: 0.85;
  }
}
