:root {
  --bg-image: url('/assets/background-elfaria.png');
  --bg-position: center;

  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --faint: rgba(255, 255, 255, 0.45);
  --accent: #9bd7ff;
  --card: rgba(10, 14, 26, 0.45);
  --card-hover: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-2: rgba(255, 255, 255, 0.2);
  --status: #9ca3af;
}

[data-status="online"]  { --status: #23a55a; }
[data-status="idle"]    { --status: #f0b232; }
[data-status="dnd"]     { --status: #f23f43; }
[data-status="offline"] { --status: #80848e; }

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

body {
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: #05070d;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body:not(.entered) { overflow: hidden; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

* {
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
}

/* ---------- Fond ---------- */

#bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: var(--bg-position);
  background-repeat: no-repeat;
}

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

.overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.5));
}

/* ---------- Écran d'entrée ---------- */

.landing {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  cursor: pointer;
  transition: opacity 0.6s ease, visibility 0.6s;
}

body.entered .landing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.landing-content {
  text-align: center;
  animation: fade-up 0.6s ease both;
}

.landing-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
}

.landing-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.landing-hint {
  font-size: 0.9rem;
  color: var(--muted);
  animation: blink-soft 2s ease-in-out infinite;
}

@keyframes blink-soft {
  50% { opacity: 0.4; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Layout ---------- */

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 16px 100px;
}

.layout {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* PC : 3 colonnes — Discord | Profil | Setup */
@media (min-width: 1100px) {
  .layout {
    max-width: 1160px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    gap: 20px;
  }

  .discord-card { order: 1; }
  .profile-card { order: 2; }
  .setup-card   { order: 3; }
}

.card {
  position: relative;
  padding: 22px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid transparent;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: box-shadow 0.4s ease;
}

/* ---------- Neige posée sur le haut des cartes ---------- */

.card::after {
  content: '';
  position: absolute;
  top: -13px;
  left: -5px;
  right: -5px;
  height: 44px;
  pointer-events: none;
  /* coins à taille fixe (suivent l'arrondi de 18px) + milieu étiré */
  background:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2034%2044'%3E%3Cdefs%3E%3ClinearGradient%20id='g'%20x1='0'%20y1='0'%20x2='0'%20y2='28'%20gradientUnits='userSpaceOnUse'%3E%3Cstop%20offset='0'%20stop-color='%23ffffff'/%3E%3Cstop%20offset='0.65'%20stop-color='%23f2f9ff'/%3E%3Cstop%20offset='1'%20stop-color='%23cfe9ff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg%3E%3Cpath%20fill='url%28%23g%29'%20d='M34%209.33%20L22%209.33%20A20.67%2020.67%200%200%200%201.33%2030%20Q1.93%2037%204.6%2043%20Q7%2036%208.00%2030%20A14%2014%200%200%201%2022%2016%20L34%2017.73%20Z'/%3E%3C/g%3E%3C/svg%3E") left top / 34px 44px no-repeat,
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2034%2044'%3E%3Cdefs%3E%3ClinearGradient%20id='g'%20x1='0'%20y1='0'%20x2='0'%20y2='28'%20gradientUnits='userSpaceOnUse'%3E%3Cstop%20offset='0'%20stop-color='%23ffffff'/%3E%3Cstop%20offset='0.65'%20stop-color='%23f2f9ff'/%3E%3Cstop%20offset='1'%20stop-color='%23cfe9ff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg%20transform='translate%2834%200%29%20scale%28-1%201%29'%3E%3Cpath%20fill='url%28%23g%29'%20d='M34%209.33%20L22%209.33%20A20.67%2020.67%200%200%200%201.33%2030%20Q1.93%2037%204.6%2043%20Q7%2036%208.00%2030%20A14%2014%200%200%201%2022%2016%20L34%2017.73%20Z'/%3E%3C/g%3E%3C/svg%3E") right top / 34px 44px no-repeat,
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20400%2030'%20preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient%20id='g'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3E%3Cstop%20offset='0'%20stop-color='%23ffffff'/%3E%3Cstop%20offset='0.65'%20stop-color='%23f2f9ff'/%3E%3Cstop%20offset='1'%20stop-color='%23cfe9ff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath%20fill='url%28%23g%29'%20d='M0%2010%20Q9.7%2010.9%2019.4%2010.0%20Q29.8%207.6%2040.1%2010.1%20Q52.7%207.0%2065.2%2010.5%20Q75.0%207.8%2084.8%2010.9%20Q94.9%205.8%20104.9%2011.7%20Q115.4%205.4%20126.0%2011.3%20Q134.1%205.5%20142.2%2011.3%20Q152.3%205.7%20162.3%2010.6%20Q173.1%203.0%20183.9%2012.0%20Q195.6%203.8%20207.4%2011.4%20Q215.0%206.4%20222.5%2010.5%20Q231.3%206.6%20240.2%2010.1%20Q247.7%204.2%20255.3%2010.8%20Q267.1%203.8%20279.0%2010.8%20Q290.1%203.2%20301.3%2011.7%20Q308.5%208.0%20315.8%2010.4%20Q328.7%203.4%20341.6%2010.9%20Q354.4%203.1%20367.2%2010.8%20Q378.1%2010.5%20389.0%2011.3%20Q394.5%209.5%20400.0%2010.0%20L400%2019%20Q389.1%2020.9%20378.2%2019%20L371.6%2019%20L368.6%2027.9%20L365.6%2019%20L359.0%2019%20Q347.7%2021.1%20336.3%2019%20Q320.6%2020.9%20304.8%2019%20Q290.5%2022.2%20276.2%2019%20Q266.4%2020.7%20256.6%2019%20Q245.9%2020.9%20235.1%2019%20L228.4%2019%20L225.4%2027.1%20L222.4%2019%20L215.7%2019%20Q206.3%2021.1%20196.9%2019%20L185.3%2019%20L182.3%2024.4%20L179.3%2019%20L167.7%2019%20Q157.5%2021.0%20147.2%2019%20Q134.3%2021.2%20121.4%2019%20Q109.3%2022.4%2097.1%2019%20Q86.8%2021.6%2076.5%2019%20Q62.4%2020.9%2048.2%2019%20L41.3%2019%20L38.3%2027.6%20L35.3%2019%20L28.4%2019%20Q14.9%2021.0%201.4%2019%20Q0.7%2022.0%200.0%2019%20Z'/%3E%3C/svg%3E") 34px 0 / calc(100% - 68px) 28px no-repeat;
  filter: drop-shadow(0 3px 3px rgba(10, 40, 80, 0.28)) drop-shadow(0 0 8px rgba(200, 235, 255, 0.4));
}

/* ---------- Cadres : liseré de givre qui fait le tour ---------- */

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

.card::before,
.player::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  background: conic-gradient(
    from var(--border-angle),
    rgba(200, 235, 255, 0.28) 0deg,
    rgba(200, 235, 255, 0.28) 180deg,
    rgba(120, 200, 255, 0.85) 250deg,
    #ffffff 300deg,
    rgba(120, 200, 255, 0.85) 335deg,
    rgba(200, 235, 255, 0.28) 360deg
  );
  -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);
  animation: border-spin 7s linear infinite;
}

/* Chaque carte démarre à un endroit différent du tour */
.discord-card::before { animation-delay: -2.3s; }
.setup-card::before   { animation-delay: -4.6s; }
.player::before       { animation-duration: 5s; }

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

.card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(155, 215, 255, 0.12),
    0 0 32px -6px rgba(155, 215, 255, 0.35);
}


body.entered .card { animation: fade-up 0.6s ease forwards; }
body.entered .discord-card { animation-delay: 0.08s; }
body.entered .setup-card   { animation-delay: 0.16s; }

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}

/* ---------- Profil ---------- */

.profile {
  text-align: center;
  margin-bottom: 20px;
}

.avatar-wrap {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto 14px;
}

.avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

/* ---------- Halo derrière la pp : aura de givre + anneau lumineux ---------- */

/* Aura floue qui tourne et respire */
.avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(#bfe6ff, #ffffff, #9bd7ff, #e6f6ff, #bfe6ff);
  filter: blur(12px);
  opacity: 0.35;
  will-change: transform, opacity;
  animation: halo-spin 8s linear infinite, halo-breathe 4s ease-in-out infinite;
}

/* Anneau fin avec un arc lumineux qui tourne dans l'autre sens */
.avatar-wrap::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  padding: 1.5px;
  background: conic-gradient(
    rgba(155, 215, 255, 0) 0deg,
    rgba(255, 255, 255, 0.1) 120deg,
    rgba(255, 255, 255, 0.75) 200deg,
    rgba(200, 235, 255, 0.5) 230deg,
    rgba(155, 215, 255, 0) 300deg
  );
  -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);
  will-change: transform;
  animation: halo-spin 5s linear infinite reverse;
}

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

@keyframes halo-breathe {
  0%, 100% { opacity: 0.25; scale: 0.98; }
  50%      { opacity: 0.45; scale: 1.02; }
}

.name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

/* Lettres qui tombent comme des flocons, puis une vague de givre continue.
   Seuls translate/opacity sont animés en boucle : rendu fluide par le GPU. */
.name span {
  position: relative;
  display: inline-block;
  opacity: 0;
  will-change: transform, translate, opacity;
}

/* Copie lumineuse de la lettre : on fait varier son opacité, pas le text-shadow */
.name span::after {
  content: attr(data-ch);
  position: absolute;
  inset: 0;
  color: #dff4ff;
  text-shadow: 0 0 10px rgba(155, 215, 255, 0.9), 0 0 22px rgba(155, 215, 255, 0.45);
  opacity: 0;
  will-change: opacity;
}

body.entered .name span {
  animation:
    letter-fall 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    letter-wave 3.6s ease-in-out infinite;
  animation-delay:
    calc(0.35s + var(--i) * 80ms),
    calc(1.4s + var(--i) * 180ms);
}

body.entered .name span::after {
  animation: letter-glow 3.6s ease-in-out infinite;
  animation-delay: calc(1.4s + var(--i) * 180ms);
}

@keyframes letter-fall {
  from { opacity: 0; transform: translateY(-16px) rotate(-10deg); }
  to   { opacity: 1; transform: none; }
}

@keyframes letter-wave {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -3px; }
}

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

.bio {
  min-height: 1.4em;
  font-size: 0.95rem;
  color: var(--muted);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--accent);
  animation: caret 1s steps(1) infinite;
}

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

/* ---------- Liens ---------- */

.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.link:hover {
  background: var(--card-hover);
  border-color: var(--stroke-2);
}

.link-icon {
  width: 20px;
  text-align: center;
  color: var(--accent);
}

.link-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: contain;
}

.brand-discord { color: #5865f2; }
.brand-x { color: #ffffff; }

.setup-card .item-icon img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: contain;
}

.link-label { flex: 1; }

.link-arrow {
  font-size: 0.8rem;
  color: var(--faint);
  transition: transform 0.2s ease, color 0.2s ease;
}

.link:hover .link-arrow {
  color: var(--text);
  transform: translateX(3px);
}

/* ---------- Items (setup + activités) ---------- */

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.item:hover { background: rgba(255, 255, 255, 0.05); }

.setup-card .item-title { flex: 1; }
.setup-card .item:hover .link-arrow {
  color: var(--text);
  transform: translateX(3px);
}

.item-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--accent);
}

.art img:not(.art-small) {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.art-small {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #111522;
  background: #111522;
}

.item-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.item-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.item-sub,
.item-time {
  font-size: 0.8rem;
  color: var(--muted);
}

.item-time {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.item-title,
.item-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Discord ---------- */

.dc-user {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.dc-avatar-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
}

.dc-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.dc-decoration {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  pointer-events: none;
}

.dc-status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--status);
  border: 3px solid #111522;
  z-index: 1;
}

.dc-names {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.dc-display {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 700;
  font-size: 1rem;
}

.dc-display > span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dc-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
}

.dc-tag[hidden] { display: none; }
.dc-tag img { width: 12px; height: 12px; }

.dc-username,
.dc-custom {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dc-custom { color: var(--faint); }
.dc-custom:empty { display: none; }

.dc-custom img {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 3px;
}

.dc-copy {
  color: var(--faint);
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dc-user:hover .dc-copy { opacity: 1; }

.activities {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--stroke);
}


.spotify .item-sub i { color: var(--accent); }

.progress { margin-top: 5px; }

.progress-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.progress-bar {
  width: var(--p, 0%);
  height: 100%;
  background: var(--accent);
  transition: width 1s linear;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-size: 0.68rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--faint);
}

/* ---------- Lecteur ---------- */

.player {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid transparent;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease 0.3s;
}

body.entered .player {
  opacity: 1;
  pointer-events: auto;
}

.player-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  transition: background 0.2s ease;
}

.player-btn:hover { background: rgba(255, 255, 255, 0.2); }

.player-mute {
  width: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}

.player-mute:hover { color: var(--text); }

.volume {
  --val: 15%;
  width: 90px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--text) var(--val), rgba(255, 255, 255, 0.2) var(--val));
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
}

.volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

@media (hover: none), (pointer: coarse) {
  .player-mute,
  .volume { display: none; }
  .player { padding: 6px; }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(10, 14, 26, 0.85);
  border: 1px solid var(--stroke-2);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

@media (max-width: 600px) {
  .toast { bottom: 76px; }
}

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