/* ==========================================================================
   Fiche de design — Système visuel Dark Minimal (interfacing.md)
   Guns.lol Web Page — Lecteur agrandissable
   ========================================================================== */

:root {
  --bg: #080808;
  --bg-secondary: #0e0e0e;
  --bg-card: #111111;
  --bg-card-hover: #161616;

  --card-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 255, 255, 0.10);
  --card-shadow-hover: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 50px rgba(255, 255, 255, 0.18);

  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.18);
  --glass-bg: rgba(20, 20, 20, 0.55);
  --glass-border: rgba(255, 255, 255, 0.11);
  --glass-highlight: rgba(255, 255, 255, 0.09);
  --glass-blur: blur(24px) saturate(160%);
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #444444;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --t: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ts: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --grow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --cursor-color: #ffffff;
  --tooltip-bg: #181818;
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-secondary: #e8e8ed;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f4;

  --card-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  --card-shadow-hover: 0 24px 60px rgba(0, 0, 0, 0.18);

  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-highlight: rgba(255, 255, 255, 0.95);
  --glass-blur: blur(24px) saturate(150%);
  --text-primary: #1d1d1f;
  --text-secondary: #515154;
  --text-muted: #86868b;
  --overlay-bg: rgba(245, 245, 247, 0.96);
  --cursor-color: #1d1d1f;
  --tooltip-bg: #e8e8ed;
}

body, 
.profile-card, 
.audio-player-card, 
.social-btn, 
.tag, 
.entry-overlay, 
.cursor-dot {
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

/* --------------------------------------------------------------------------
   Reset & Zero Scrollbar
   -------------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Background Silk (WebGL) & Glow
   -------------------------------------------------------------------------- */
.silk-background {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg);
}

.silk-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Repli si WebGL2 n'est pas disponible */
.silk-background.silk-fallback {
  background-image:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.06), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.04), transparent 60%);
}

[data-theme="light"] .silk-background.silk-fallback {
  background-image:
    radial-gradient(circle at 30% 20%, rgba(0, 0, 0, 0.06), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.04), transparent 60%);
}

.ambient-glow {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Entry Overlay
   -------------------------------------------------------------------------- */
.entry-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.96);
  backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.entry-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

.entry-text {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: pulseOpacity 2s infinite ease-in-out;
}

.entry-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

@keyframes pulseOpacity {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* --------------------------------------------------------------------------
   Main Container
   -------------------------------------------------------------------------- */
.main-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   Profile Card
   -------------------------------------------------------------------------- */
.profile-card {
  width: 100%;
  max-width: 440px;
  /* Glassmorphism : surface translucide + flou du fond (Silk) */
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px 26px 22px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  box-shadow: var(--card-shadow), inset 0 1px 0 var(--glass-highlight);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  will-change: transform;
}

.profile-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--card-shadow-hover), inset 0 1px 0 var(--glass-highlight);
}

/* --------------------------------------------------------------------------
   Avatar & Status Icon Indicator
   -------------------------------------------------------------------------- */
.avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  margin-top: -4px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: var(--t);
  filter: brightness(0.95);
}

.avatar-wrapper:hover .avatar-img {
  border-color: var(--border-hover);
  transform: scale(1.04);
  filter: brightness(1.05);
}

.status-indicator {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 22px;
  height: 22px;
  background-color: var(--bg-card);
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: color 0.3s ease, transform 0.2s ease;
  z-index: 5;
}

.status-indicator i {
  line-height: 1;
}

.status-indicator.online  { color: #22c55e; }
.status-indicator.idle    { color: #eab308; }
.status-indicator.dnd     { color: #ef4444; }
.status-indicator.offline { color: #6b7280; }

/* --------------------------------------------------------------------------
   User Info
   -------------------------------------------------------------------------- */
.user-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.username-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.username {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  cursor: pointer;
  transition: text-shadow 0.2s ease;
}

.username:hover {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.scramble-char {
  color: #a0a0a0;
  font-weight: 400;
  opacity: 0.8;
}

.verified-badge {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
}

.bio-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 340px;
}

.badges-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--t);
}

.tag:hover {
  color: var(--text-secondary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
   Social Links
   -------------------------------------------------------------------------- */
.social-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 2px 0 28px 0;
  flex-wrap: wrap;
}

.social-btn {
  position: relative;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-secondary);
  font-size: 1.15rem;
  text-decoration: none;
  transition: var(--t);
  cursor: pointer;
}

.social-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
}

.social-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: var(--tooltip-bg);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--t);
  z-index: 100;
}

.social-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* --------------------------------------------------------------------------
   Audio Player Card
   -------------------------------------------------------------------------- */
.audio-player-card {
  position: relative;
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition:
    padding var(--grow),
    gap var(--grow),
    background var(--grow),
    border-color var(--grow),
    box-shadow var(--grow);
}

.audio-player-card:hover {
  border-color: var(--border-hover);
}

.audio-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.cover-wrapper {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition:
    width var(--grow),
    height var(--grow),
    border-radius var(--grow),
    border-color var(--grow),
    box-shadow var(--grow);
}

.track-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-wrapper.playing .track-cover-img {
  animation: pulseCover 2s infinite ease-in-out;
}

@keyframes pulseCover {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

.disc-icon {
  font-size: 1.4rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.disc-icon.spinning {
  animation: spinDisc 3s linear infinite;
}

@keyframes spinDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.track-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.track-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  transition: font-size var(--grow), font-weight var(--grow);
}

.track-artist {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  transition: font-size var(--grow);
}

.audio-controls-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: gap var(--grow);
}

.control-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition:
    width var(--grow), height var(--grow), font-size var(--grow),
    color 0.2s ease, background 0.2s ease;
}

.control-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.play-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition:
    width var(--grow), height var(--grow), font-size var(--grow),
    background 0.2s ease, transform 0.2s ease;
}

.play-btn:hover {
  background: var(--text-primary);
  color: var(--bg);
  transform: scale(1.06);
}

/* MODE EXPANDED */
.audio-player-card.expanded {
  padding: 16px 16px;
  gap: 12px;
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.audio-player-card.expanded .cover-wrapper {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.audio-player-card.expanded .track-title {
  font-size: 1rem;
  font-weight: 700;
}

.audio-player-card.expanded .track-artist {
  font-size: 0.8rem;
}

.audio-player-card.expanded .play-btn {
  width: 42px;
  height: 42px;
  font-size: 0.95rem;
}

.audio-player-card.expanded .control-btn {
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
}

.audio-player-card.expanded .audio-controls-main {
  gap: 8px;
}

/* Progress bar & sub-controls */
.progress-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.player-controls-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.volume-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-box input[type="range"] {
  width: 60px;
  height: 3px;
  accent-color: var(--text-primary);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Card Footer
   -------------------------------------------------------------------------- */
.card-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: var(--ts);
  z-index: 10000;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   Typing Effect Cursor
   -------------------------------------------------------------------------- */
.cursor {
  display: inline-block;
  margin-left: 2px;
  font-weight: 300;
  color: var(--text-secondary);
  animation: blinkCursor 0.8s infinite;
}

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

/* --------------------------------------------------------------------------
   Custom Minimal Cursor
   -------------------------------------------------------------------------- */
@media (pointer: fine) {
  *, *::before, *::after {
    cursor: none !important;
  }
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  background-color: var(--cursor-color);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px var(--cursor-color);
  transition: opacity 0.2s ease, transform 0.15s ease, width 0.15s ease, height 0.15s ease, background-color 0.4s ease;
}

body.cursor-hover .cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--cursor-color);
  box-shadow: 0 0 10px var(--cursor-color);
}

/* --------------------------------------------------------------------------
   Theme Toggle Button
   -------------------------------------------------------------------------- */
.theme-toggle-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: var(--t);
  z-index: 10;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(15deg);
}

[data-theme="light"] .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ========================================================================== */

/* 1. Écrans mobiles standards et petits smartphones (jusqu'à 480px) */
@media (max-width: 480px) {
  .main-container {
    padding: 12px;
    align-items: center;
  }

  .profile-card {
    width: 100%;
    max-width: 100%;
    padding: 24px 18px 18px 18px;
    gap: 14px;
  }

  .avatar-wrapper {
    width: 80px;
    height: 80px;
  }

  .username {
    font-size: 1.35rem;
  }

  .bio-text {
    font-size: 0.8rem;
    max-width: 100%;
  }

  .social-links {
    gap: 8px;
    padding-bottom: 16px;
  }

  .social-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .social-btn::after {
    display: none;
  }

  .audio-player-card {
    padding: 12px;
    gap: 10px;
  }

  .audio-info {
    gap: 10px;
  }

  .cover-wrapper {
    width: 38px;
    height: 38px;
  }

  .track-title {
    font-size: 0.75rem;
  }

  .track-artist {
    font-size: 0.68rem;
  }

  .play-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .control-btn {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }

  .audio-player-card.expanded .cover-wrapper {
    width: 56px;
    height: 56px;
  }

  .audio-player-card.expanded .track-title {
    font-size: 0.88rem;
  }

  .card-footer {
    font-size: 0.68rem;
  }
}

/* 2. Écrans très courts en hauteur (paysage mobile ou pc compacts) */
@media (max-height: 680px) {
  .main-container {
    padding-bottom: 0;
  }

  .profile-card {
    padding: 18px 20px 14px 20px;
    gap: 10px;
  }

  .avatar-wrapper {
    width: 70px;
    height: 70px;
  }

  .social-links {
    padding-bottom: 10px;
  }

  .audio-player-card {
    padding: 10px 12px;
  }
}