/* =========================================================
   Vúan Dev - style.css
   Thème clair par défaut, html.dark = thème sombre
   ========================================================= */

@property --vd-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  --bg: #ffffff;
  --surface-solid: #ffffff;
  --border: rgba(0, 0, 0, .07);
  --shadow-sm: 0 2px 8px rgba(60, 80, 140, .07), 0 1px 2px rgba(0, 0, 0, .04);
  --radius: 22px;
  --accent: #4a6cf7;
  --accent2: #b983ff;
  --text: #1a1a2e;
  --muted: #7c8ca8;
  --nav-h: calc(60px + env(safe-area-inset-top));
  --font: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: light;
}

html.dark {
  --bg: #030c18;
  --surface-solid: #071120;
  --border: rgba(255, 255, 255, .08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .25);
  --text: #eef0f7;
  --muted: #8892aa;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; scrollbar-width: none; }
::-webkit-scrollbar { display: none; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; }

/* ---------- Fond + ciel étoilé ---------- */
.vd-bg,
.vd-sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.vd-bg {
  background:
    radial-gradient(70% 55% at 15% 8%, rgba(74, 108, 247, .10) 0, transparent 60%),
    radial-gradient(55% 45% at 85% 15%, rgba(185, 131, 255, .08) 0, transparent 55%),
    radial-gradient(60% 40% at 50% 95%, rgba(74, 108, 247, .06) 0, transparent 55%),
    radial-gradient(40% 35% at 90% 75%, rgba(255, 107, 157, .05) 0, transparent 50%);
}

html.dark .vd-bg {
  background:
    radial-gradient(100% 45% at 40% 0, rgba(50, 80, 220, .18) 0, transparent 65%),
    radial-gradient(70% 35% at 78% 12%, rgba(90, 30, 170, .14) 0, transparent 58%),
    radial-gradient(50% 30% at 10% 60%, rgba(30, 90, 180, .10) 0, transparent 52%),
    radial-gradient(40% 25% at 85% 75%, rgba(60, 20, 140, .09) 0, transparent 50%),
    radial-gradient(1.5px 1.5px at 7% 11%, #fff 0, transparent 100%),
    radial-gradient(2px 2px at 21% 4%, #fff 0, transparent 100%),
    radial-gradient(1px 1px at 34% 17%, rgba(255, 255, 255, .75) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 49% 9%, #fff 0, transparent 100%),
    radial-gradient(1px 1px at 61% 5%, rgba(255, 255, 255, .8) 0, transparent 100%),
    radial-gradient(2px 2px at 72% 15%, #fff 0, transparent 100%),
    radial-gradient(1px 1px at 85% 7%, rgba(255, 255, 255, .7) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 94% 22%, #fff 0, transparent 100%),
    radial-gradient(1px 1px at 13% 36%, rgba(255, 255, 255, .6) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 28% 43%, rgba(255, 255, 255, .75) 0, transparent 100%),
    radial-gradient(1px 1px at 42% 37%, rgba(255, 255, 255, .55) 0, transparent 100%),
    radial-gradient(1px 1px at 54% 49%, rgba(255, 255, 255, .65) 0, transparent 100%),
    radial-gradient(2px 2px at 67% 30%, rgba(255, 255, 255, .8) 0, transparent 100%),
    radial-gradient(1px 1px at 78% 45%, rgba(255, 255, 255, .55) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 91% 38%, rgba(255, 255, 255, .7) 0, transparent 100%),
    radial-gradient(1px 1px at 5% 63%, rgba(255, 255, 255, .5) 0, transparent 100%),
    radial-gradient(1px 1px at 19% 76%, rgba(255, 255, 255, .65) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 31% 67%, rgba(255, 255, 255, .75) 0, transparent 100%),
    radial-gradient(1px 1px at 47% 83%, rgba(255, 255, 255, .55) 0, transparent 100%),
    radial-gradient(2px 2px at 58% 72%, rgba(255, 255, 255, .8) 0, transparent 100%),
    radial-gradient(1px 1px at 74% 89%, rgba(255, 255, 255, .5) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 87% 64%, rgba(255, 255, 255, .7) 0, transparent 100%),
    radial-gradient(1px 1px at 96% 81%, rgba(255, 255, 255, .6) 0, transparent 100%);
}

.vd-sky { overflow: hidden; display: none; }
html.dark .vd-sky { display: block; }

.vd-star {
  position: absolute;
  border-radius: 50%;
  animation: vd-twinkle 3s ease-in-out infinite;
}

.vd-meteor {
  position: absolute;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(to right, #fff 0, rgba(180, 210, 255, .55) 55%, transparent 100%);
  filter: drop-shadow(0 0 4px rgba(160, 200, 255, .9));
  animation: vd-meteor 2.6s ease-out forwards;
}

@keyframes vd-twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  35% { opacity: .1; transform: scale(.4); }
  65% { opacity: .55; transform: scale(.75); }
}

@keyframes vd-meteor {
  0% { transform: rotate(var(--angle, -35deg)) translateX(0); opacity: 0; }
  6% { opacity: 1; }
  80% { opacity: .75; }
  100% { transform: rotate(var(--angle, -35deg)) translateX(-1000px); opacity: 0; }
}

/* ---------- Barre du haut ---------- */
.vd-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  padding: env(safe-area-inset-top) 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .65);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  box-shadow: var(--shadow-sm);
}

html.dark .vd-nav {
  background: rgba(3, 10, 22, .72);
  border-bottom-color: rgba(255, 255, 255, .06);
}

.vd-nav-btn {
  appearance: none;
  background: none;
  border: 0;
  outline: 0;
  cursor: pointer;
  font-size: 20px;
  padding: 6px 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .3s, transform .15s;
}

.vd-nav-btn:active { transform: scale(.88); }
.vd-nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.vd-bell {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(74, 108, 247, .4);
}

html.dark .vd-bell { text-shadow: 0 0 10px rgba(74, 108, 247, .55); }
.vd-bell i { transform-origin: center top; transition: transform .2s; }
.vd-bell:hover i { transform: scale(1.1); }

.vd-theme {
  overflow: hidden;
  color: #ff9f0a;
  text-shadow: 0 0 10px rgba(255, 159, 10, .45);
}

html.dark .vd-theme {
  color: #f5c518;
  text-shadow: 0 0 10px rgba(245, 197, 24, .5);
}

.vd-theme i {
  --rot: 0deg;
  display: inline-block;
  transform: rotate(var(--rot));
  transition: transform .55s cubic-bezier(.34, 1.56, .64, 1);
}

.vd-theme i.flip { --rot: 180deg; }
.vd-theme:hover i { transform: scale(1.12) rotate(var(--rot)); }

/* ---------- Notifications ---------- */
.vd-notif-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, .25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s, visibility 0s linear .2s;
}

.vd-notif-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.vd-notif {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 101;
  width: calc(100% - 32px);
  max-width: 400px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 12px 40px rgba(60, 80, 140, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -44%) scale(.97);
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), opacity .18s, visibility 0s linear .22s;
}

.vd-notif.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0s;
}

html.dark .vd-notif {
  background: linear-gradient(160deg, rgba(20, 30, 55, .78) 0, rgba(8, 16, 34, .7) 55%, rgba(12, 20, 40, .78) 100%);
  -webkit-backdrop-filter: blur(34px) saturate(190%) brightness(1.1);
  backdrop-filter: blur(34px) saturate(190%) brightness(1.1);
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 2px 10px rgba(0, 0, 0, .4), inset 0 1px 1px rgba(255, 255, 255, .18), inset 0 -2px 12px rgba(255, 255, 255, .05);
}

.vd-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.vd-notif-close {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}

.vd-notif-close:hover { color: var(--text); background: var(--border); }
.vd-notif-body { overflow-y: auto; padding: 8px 0; }

.vd-notif-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

/* ---------- Contenu ---------- */
.vd-main,
.vd-footer {
  position: relative;
  z-index: 1;
}

.vd-main { padding-top: calc(var(--nav-h) + 10px); }

/* ---------- Profil ---------- */
.vd-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 46px auto 20px;
}

.vd-avatar img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 120%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.vd-iam {
  margin: 0 0 6px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--muted);
}

.vd-name {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
}

.vd-verify {
  width: 27px;
  height: 27px;
  flex-shrink: 0;
}

.vd-headline {
  margin: 10px 0 24px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

.vd-gradient {
  background: linear-gradient(135deg, #4a6cf7, #b983ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 800;
}

/* ---------- Réseaux ---------- */
.vd-socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 20px;
}

.vd-social {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px;
  border-radius: 20px;
  text-decoration: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, .2) 46%, rgba(255, 255, 255, .08) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(200%) brightness(1.08);
  backdrop-filter: blur(18px) saturate(200%) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 6px 20px rgba(60, 80, 140, .14), 0 1px 3px rgba(0, 0, 0, .05), inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -2px 6px rgba(255, 255, 255, .18);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s, border-color .3s;
}

.vd-social::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(rgba(255, 255, 255, .45) 0, rgba(255, 255, 255, .1) 38%, transparent 62%);
  pointer-events: none;
}

.vd-social > svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .12));
}

.vd-social:hover {
  border-color: rgba(255, 255, 255, .85);
  box-shadow: 0 14px 34px rgba(60, 80, 140, .22), 0 3px 8px rgba(0, 0, 0, .07), inset 0 1px 1px #fff, inset 0 -2px 8px rgba(255, 255, 255, .3);
}

.vd-social:active { transform: scale(.94); }
.vd-social:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

html.dark .vd-social {
  background: linear-gradient(155deg, rgba(255, 255, 255, .16) 0, rgba(255, 255, 255, .06) 46%, rgba(255, 255, 255, .02) 100%);
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .22), inset 0 -2px 6px rgba(255, 255, 255, .05);
}

html.dark .vd-social::before {
  background: linear-gradient(rgba(255, 255, 255, .22) 0, rgba(255, 255, 255, .05) 40%, transparent 64%);
}

html.dark .vd-social:hover {
  border-color: rgba(255, 255, 255, .3);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .6), 0 3px 8px rgba(0, 0, 0, .4), inset 0 1px 1px rgba(255, 255, 255, .28), inset 0 -2px 8px rgba(255, 255, 255, .08);
}

/* ---------- Cartes "verre" (app, musique, YouTube) ---------- */
.vd-glass {
  background: linear-gradient(155deg, rgba(255, 255, 255, .88) 0, rgba(255, 255, 255, .74) 55%, rgba(255, 255, 255, .8) 100%);
  -webkit-backdrop-filter: blur(28px) saturate(190%) brightness(1.04);
  backdrop-filter: blur(28px) saturate(190%) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: 0 16px 44px rgba(60, 80, 140, .16), 0 2px 8px rgba(0, 0, 0, .04), inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -2px 10px rgba(255, 255, 255, .25);
}

html.dark .vd-glass {
  background: rgba(3, 10, 22, .88);
  border-color: rgba(255, 255, 255, .1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .07);
}

/* ---------- Apps ---------- */
.vd-apps { padding: 56px 0 24px; }

.vd-app-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 460px));
  justify-content: center;
  gap: 16px;
  margin: 0 16px;
}

@media (min-width: 900px) {
  .vd-app-list { gap: 20px; }
}

.vd-app {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: 18px;
  border-radius: var(--radius);
  overflow: hidden;
  transition: background .25s;
}

.vd-app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(rgba(255, 255, 255, .4) 0, rgba(255, 255, 255, .06) 26%, transparent 48%);
  pointer-events: none;
}

.vd-app:hover { background: linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, .2)); }
html.dark .vd-app:hover { background: rgba(10, 20, 36, .92); }

html.dark .vd-app::before {
  background: linear-gradient(rgba(255, 255, 255, .12) 0, rgba(255, 255, 255, .03) 28%, transparent 50%);
}

.vd-app-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d0d10;
}

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

.vd-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vd-badge {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, .3);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), inset 0 -1px 1px rgba(255, 255, 255, .12), 0 1px 2px rgba(0, 0, 0, .05);
}

.vd-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(rgba(255, 255, 255, .32) 0, rgba(255, 255, 255, .08) 45%, rgba(255, 255, 255, .02) 100%);
  pointer-events: none;
}

.vd-badge i { font-size: 12px; }
.vd-badge-ios { background: linear-gradient(135deg, #2c2c2e, #0b0b0d); color: #fff; }
.vd-badge-android { background: linear-gradient(135deg, #123a24, #07170e); color: #30d158; }

.vd-app-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
}

.vd-app-icon {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 78px;
  height: 78px;
  margin-top: -34px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(60, 80, 140, .18), 0 1px 3px rgba(0, 0, 0, .1);
}

html.dark .vd-app-icon { box-shadow: 0 4px 12px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .35); }

.vd-app-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  background: linear-gradient(160deg, rgba(255, 255, 255, .45) 0, rgba(255, 255, 255, .12) 22%, transparent 45%);
}

html.dark .vd-app-icon::after {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  background: linear-gradient(160deg, rgba(255, 255, 255, .3) 0, rgba(255, 255, 255, .08) 22%, transparent 45%);
}

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

.vd-app-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.vd-app-desc {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
}

.vd-app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 18px 0;
}

.vd-cta {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5b6cff, #c44dff);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .3);
  transition: transform .2s, box-shadow .2s;
}

.vd-cta:active { transform: scale(.97); }
.vd-cta:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }

.vd-cta i {
  font-size: 17px;
  -webkit-text-stroke: .4px currentColor;
}

/* Reflet blanc qui tourne autour du bouton */
.vd-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(from var(--vd-angle), transparent 0 55%, rgba(255, 255, 255, .35) 70%, #fff 88%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  animation: vd-border-run 3.2s ease-in-out infinite alternate;
}

@keyframes vd-border-run {
  to { --vd-angle: 360deg; }
}

/* ---------- Musique + YouTube ---------- */
.vd-widgets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .vd-widgets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
    max-width: 1232px;
    margin: 22px auto 24px;
    padding: 0 16px;
  }

  .vd-widgets .vd-music,
  .vd-widgets .vd-yt { margin: 0; }
}

.vd-music {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 22px 16px;
  padding: 18px;
  border-radius: var(--radius);
}

.vd-music-art-wrap {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.vd-music-art-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#00d555, #00863a, #00d555);
  animation: vd-spin 4s linear infinite;
}

.vd-music-art-wrap::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--surface-solid);
}

.vd-music-art {
  position: absolute;
  inset: 5px;
  z-index: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #00d555;
  animation: vd-spin 8s linear infinite paused;
}

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

.vd-music.playing .vd-music-art { animation-play-state: running; }

@keyframes vd-spin {
  to { transform: rotate(360deg); }
}

.vd-music-info { flex: 1; min-width: 0; }

.vd-music-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 8px;
}

.vd-music-text { flex: 1; min-width: 0; }

.vd-music-title {
  display: block;
  margin: 0;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vd-music-title:hover { text-decoration: underline; }
.vd-music-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.vd-music-artist {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vd-music-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vd-music-toggle {
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s, background .2s, color .2s;
  width: 40px;
  height: 40px;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .3);
}

.vd-music-toggle .fa-play { margin-left: 3px; }
.vd-music-toggle:active { transform: scale(.92); }

.vd-music-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vd-music-bar {
  position: relative;
  flex: 1;
  height: 14px;
  cursor: pointer;
  touch-action: none;
  outline: 0;
}

.vd-music-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 4px;
  background: var(--border);
}

.vd-music-bar:focus-visible::before { box-shadow: 0 0 0 2px var(--accent); }

.vd-music-fill {
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .7s;
}

.vd-music-bar.seeking .vd-music-fill { transition: none; }

.vd-music-fill::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 5px 1px rgba(255, 255, 255, .9);
  transform: translateY(-50%);
}

.vd-music-time {
  flex-shrink: 0;
  min-width: 30px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.vd-music-time:last-child { text-align: right; }

/* Lecteur Spotify officiel, caché : c'est lui qui joue la musique */
.vd-music-frame {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.vd-music-frame iframe {
  display: block;
  width: 300px;
  height: 80px;
  border: 0;
}

/* Si le navigateur bloque la lecture (souvent sur iPhone),
   le lecteur Spotify s'affiche dans la carte pour lancer la musique */
.vd-music.show-embed { flex-wrap: wrap; }

.vd-music.show-embed .vd-music-frame {
  position: static;
  flex: 1 0 100%;
  height: 80px;
  border-radius: 12px;
  opacity: 1;
  pointer-events: auto;
}

.vd-music.show-embed .vd-music-frame iframe { width: 100%; }

@media (max-width: 560px) {
  .vd-music { gap: 14px; padding: 14px; }
  .vd-music-title { font-size: 14px; }
  .vd-music-artist { font-size: 11px; }
  .vd-music-toggle { width: 36px; height: 36px; font-size: 13px; }
  .vd-music-time { min-width: 26px; font-size: 10px; }
}

@media (max-width: 380px) {
  .vd-music-toggle { width: 34px; height: 34px; font-size: 12px; }
}

.vd-yt {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 16px 24px;
  padding: 20px;
  border-radius: var(--radius);
}

.vd-yt-main { min-width: 0; }

.vd-yt-head {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.vd-yt-avatar {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
}

.vd-yt-avatar img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 120%;
  transform: translate(-50%, -50%);
  display: block;
}

.vd-yt-text { min-width: 0; }

.vd-yt-title {
  margin: 0;
  font-weight: 800;
  font-size: 22px;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vd-yt-handle {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vd-yt-meta {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transform-origin: left center;
}

/* Petit flash quand le nombre d'abonnés change */
.vd-yt-meta.vd-bump { animation: vd-bump 1s ease-out; }

@keyframes vd-bump {
  0% { color: #fe2c55; transform: scale(1.08); }
  100% { color: var(--muted); transform: none; }
}

.vd-yt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #0f0f0f;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .2px;
  text-decoration: none;
  transition: background .15s, transform .15s;
}

.vd-yt-btn:hover { background: #272727; }
.vd-yt-btn:active { transform: scale(.98); }
.vd-yt-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
html.dark .vd-yt-btn { background: #f1f1f1; color: #0f0f0f; }
html.dark .vd-yt-btn:hover { background: #d9d9d9; }

@media (min-width: 640px) {
  .vd-yt {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 22px 26px;
  }

  .vd-yt-main { flex: 1; }

  .vd-yt-btn {
    width: auto;
    min-width: 130px;
    padding: 0 24px;
  }
}

/* ---------- Page du code Discord (download.html) ---------- */
.vd-gate-page {
  display: flex;
  flex-direction: column;
}

.vd-back {
  color: var(--accent);
  text-decoration: none;
  text-shadow: 0 0 10px rgba(74, 108, 247, .4);
}

html.dark .vd-back { text-shadow: 0 0 10px rgba(74, 108, 247, .55); }
.vd-back i { transition: transform .2s; }
.vd-back:hover i { transform: translateX(-2px); }

.vd-gate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 28px) 16px 40px;
}

.vd-gate-card {
  width: 100%;
  max-width: 440px;
  padding: 22px 20px 24px;
  border-radius: var(--radius);
}

.vd-gate-app {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.vd-gate-app .vd-app-icon {
  width: 64px;
  height: 64px;
  margin-top: 0;
  border-radius: 15px;
}

.vd-gate-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.2px;
  color: var(--text);
}

.vd-gate-sub {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--muted);
}

.vd-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vd-step {
  position: relative;
  display: flex;
  gap: 14px;
}

/* Petite ligne qui relie les étapes */
.vd-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 36px;
  bottom: -16px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--accent), var(--accent2));
  opacity: .22;
}

.vd-step-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 4px 12px rgba(74, 108, 247, .3), inset 0 1px 1px rgba(255, 255, 255, .35);
}

.vd-step-body {
  flex: 1;
  min-width: 0;
  padding-top: 5px;
}

.vd-step-title {
  display: block;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.vd-step-text {
  margin: -4px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--muted);
}

.vd-step-text b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.vd-nowrap { white-space: nowrap; }

/* "#code" façon salon Discord */
.vd-chan {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(88, 101, 242, .14);
  color: #5865f2;
  white-space: nowrap;
}

html.dark .vd-chan { background: rgba(88, 101, 242, .28); color: #c9cdfb; }

.vd-discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  background: #5865f2;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(88, 101, 242, .35), inset 0 1px 1px rgba(255, 255, 255, .25);
  transition: background .2s, transform .2s;
}

.vd-discord-btn i { font-size: 18px; }
.vd-discord-btn:hover { background: #4752c4; }
.vd-discord-btn:active { transform: scale(.97); }
.vd-discord-btn:focus-visible { outline: 2px solid #5865f2; outline-offset: 3px; }

.vd-code-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vd-code-input {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(0, 0, 0, .1);
  background: rgba(255, 255, 255, .7);
  color: var(--text);
  font: 700 22px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  letter-spacing: .32em;
  text-indent: .32em;
  text-align: center;
  outline: 0;
  transition: border-color .2s, box-shadow .2s;
}

html.dark .vd-code-input {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .14);
}

.vd-code-input::placeholder { color: var(--muted); opacity: .45; }
.vd-code-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(74, 108, 247, .16); }

.vd-code-input.is-bad {
  border-color: #ff453a;
  box-shadow: 0 0 0 4px rgba(255, 69, 58, .14);
  animation: vd-shake .4s;
}

.vd-code-input.is-good {
  border-color: #30d158;
  box-shadow: 0 0 0 4px rgba(48, 209, 88, .16);
}

@keyframes vd-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

button.vd-cta {
  flex: none;
  width: 100%;
  border: 0;
  cursor: pointer;
}

button.vd-cta:disabled { cursor: default; opacity: .75; }

.vd-code-msg {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.vd-code-msg.is-bad { color: #d93025; }
.vd-code-msg.is-good { color: #1e8e3e; }
html.dark .vd-code-msg.is-bad { color: #ff6961; }
html.dark .vd-code-msg.is-good { color: #30d158; }

/* ---------- Pied de page ---------- */
.vd-footer {
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ---------- Moins d'animations si l'appareil le demande ---------- */
@media (prefers-reduced-motion: reduce) {
  .vd-star,
  .vd-cta::before,
  .vd-music-art-wrap::before,
  .vd-music-art { animation: none; }
  .vd-meteor { display: none; }
  .vd-theme i { transition: none; }
  .vd-code-input.is-bad { animation: none; }
  .vd-yt-meta.vd-bump { animation: none; }
}
