:root{
  --bg: #0b0d12;
  --card: rgba(255,255,255,.06);
  --border: rgba(255,255,255,.10);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.60);
  --muted2: rgba(255,255,255,.45);
  --accent: #a78bfa;
  --accent2:#60a5fa;
  --good:#34d399;
  --bad:#fb7185;
  --shadow: 0 20px 70px rgba(0,0,0,.45);
  --radius: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  overflow-x:hidden;
}

a{color:inherit; text-decoration:none}

.container{
  width:min(1100px, 92vw);
  margin-inline:auto;
}

/* Background FX */
.bg{position:fixed; inset:0; z-index:-2; overflow:hidden}
.blob{
  position:absolute;
  width:650px; height:650px;
  filter: blur(45px);
  opacity:.45;
  border-radius: 999px;
  transform: translate3d(0,0,0);
  animation: float 10s ease-in-out infinite;
}
.blob-1{
  top:-220px; left:-160px;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 60%);
}
.blob-2{
  bottom:-260px; right:-160px;
  background: radial-gradient(circle at 70% 70%, var(--accent2), transparent 60%);
  animation-duration: 12s;
}
.noise{
  position:absolute; inset:0;
  opacity:.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.20'/%3E%3C/svg%3E");
}

@keyframes float{
  0%,100%{transform: translateY(0) translateX(0) scale(1)}
  50%{transform: translateY(18px) translateX(12px) scale(1.02)}
}

/* Header */
.header{
  position:sticky;
  top:0;
  backdrop-filter: blur(14px);
  background: rgba(10,12,18,.55);
  border-bottom: 1px solid rgba(255,255,255,.06);
  z-index:10;
}
.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 0;
}
.brand{
  display:flex;
  gap:12px;
  align-items:center;
  animation: enterUp .7s ease both;
}
.brand-avatar{
  width:42px;
  height:42px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
  transition: transform .25s ease;
}
.brand:hover .brand-avatar{
  transform: rotate(-2deg) scale(1.04);
}
.brand-text{
  display:flex;
  flex-direction:column;
  line-height:1.05;
}
.brand-name{
  font-weight:800;
  letter-spacing:.2px;
}
.brand-tag{
  font-size:12px;
  color: var(--muted2);
  margin-top:4px;
}

/* Hero */
.hero{padding: 42px 0 22px;}
.hero-content{
  padding: 26px 24px;
  border-radius: 24px;
  background: linear-gradient(90deg, rgba(167,139,250,.22), rgba(96,165,250,.18));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  animation: enterUp .85s ease both;
}
.hero-badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  font-size: 12px;
  color: var(--muted);
}
.hero-title{
  margin: 14px 0 8px;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: .2px;
}
.hero-subtitle{
  margin:0;
  color: var(--muted);
  max-width: 70ch;
}

/* Layout */
.main{padding: 20px 0 40px;}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items:start;
}
@media (max-width: 900px){
  .grid{grid-template-columns: 1fr;}
}

/* Cards */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: enterUp .9s ease both;
}
.card:nth-child(2){animation-delay:.08s}

.card-title{
  margin:0 0 14px;
  font-size: 18px;
  letter-spacing:.2px;
}

.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.status-pill{
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  color: var(--muted);
  background: rgba(255,255,255,.08);
}
.status-pill.ok{
  color: rgba(52,211,153,.95);
  border-color: rgba(52,211,153,.25);
}
.status-pill.bad{
  color: rgba(251,113,133,.95);
  border-color: rgba(251,113,133,.25);
}
.status-pill.loading{
  color: rgba(96,165,250,.95);
  border-color: rgba(96,165,250,.25);
}

/* Form */
.form-group{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.form-label{
  font-size:12px;
  color: var(--muted2);
  letter-spacing:.6px;
}
.hint{
  font-size:12px;
  color: var(--muted2);
}

.input-row{
  display:flex;
  gap: 10px;
  align-items:stretch;
}
@media (max-width: 520px){
  .input-row{flex-direction:column}
}

.input-field{
  flex:1;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,12,18,.55);
  color: var(--text);
  outline:none;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.input-field:focus{
  border-color: rgba(167,139,250,.55);
  box-shadow: 0 0 0 6px rgba(167,139,250,.12);
  transform: translateY(-1px);
}

/* Buttons */
.btn{
  position:relative;
  border:none;
  cursor:pointer;
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  transition: transform .18s ease, filter .18s ease, background .18s ease, box-shadow .18s ease;
  user-select:none;
  white-space:nowrap;
}
.btn:active{transform: translateY(1px) scale(.99)}
.btn:disabled{opacity:.55; cursor:not-allowed}

.btn-primary{
  background: linear-gradient(135deg, rgba(167,139,250,.95), rgba(96,165,250,.95));
  box-shadow: 0 14px 32px rgba(96,165,250,.22);
  overflow:hidden;
}
.btn-primary:hover{filter: brightness(1.05)}
.btn-glow{
  position:absolute;
  inset:-40%;
  background: radial-gradient(circle, rgba(255,255,255,.35), transparent 55%);
  transform: translateX(-30%) rotate(10deg);
  animation: sheen 2.2s ease-in-out infinite;
  pointer-events:none;
}
@keyframes sheen{
  0%,100%{opacity:.0; transform: translateX(-50%) rotate(10deg)}
  35%{opacity:.35}
  60%{opacity:.0; transform: translateX(60%) rotate(10deg)}
}
.btn-secondary{
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
}
.btn-secondary:hover{background: rgba(255,255,255,.14)}

.btn-download{
  background: rgba(52,211,153,.18);
  border: 1px solid rgba(52,211,153,.24);
}
.btn-download:hover{background: rgba(52,211,153,.22)}

.btn-ghost{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--muted);
}
.btn-ghost:hover{
  background: rgba(255,255,255,.10);
  color: var(--text);
}

/* Errors */
.error-message{
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(251,113,133,.14);
  border: 1px solid rgba(251,113,133,.22);
  color: rgba(255,255,255,.92);
  animation: shake .32s ease-in-out;
}
@keyframes shake{
  0%,100%{transform: translateX(0)}
  25%{transform: translateX(-6px)}
  75%{transform: translateX(6px)}
}
.hidden{display:none !important}

/* Empty state */
.empty{
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  text-align:center;
  color: var(--muted);
}
.empty-icon{font-size:34px; margin-bottom:8px}
.empty-title{font-weight:800; margin-bottom:6px}
.empty-subtitle{color: var(--muted2)}

.avatar-container{
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.userline{
  display:flex;
  align-items:center;
  gap: 12px;
}
.mini-avatar{
  width:42px;
  height:42px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  overflow:hidden;
}
.mini-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.user-meta{display:flex; flex-direction:column}
.username-display{font-weight:900}
.userid-display{font-size:12px; color: var(--muted2)}

/* Avatar stage */
.avatar-stage{
  position:relative;
  display:flex;
  justify-content:center;
  padding: 6px 0 2px;
}

.avatar-wrapper{
  width:min(280px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  overflow:hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 55px rgba(0,0,0,.45);
  transform: translateZ(0);
  animation: pop .5s ease both;
}
@keyframes pop{
  from{transform: scale(.96); opacity:.0}
  to{transform: scale(1); opacity:1}
}

.avatar-image{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  transform: scale(1.02);
  transition: transform .25s ease;
}
.avatar-wrapper:hover .avatar-image{
  transform: scale(1.06);
}

.ring{
  position:absolute;
  width:min(280px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
  pointer-events:none;
}

/* Skeleton loading */
.skeleton{
  position:absolute;
  width:min(280px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.12), rgba(255,255,255,.06));
  background-size: 200% 100%;
  animation: shimmer 1.05s linear infinite;
}
@keyframes shimmer{
  0%{background-position: 200% 0}
  100%{background-position: -200% 0}
}

/* Button group */
.button-group{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.url-display{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.url-label{
  font-size:12px;
  color: var(--muted2);
}
.url-input{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,12,18,.55);
  color: var(--text);
}

/* ✅ Guide section (remplit le vide en bas) */
.guide-card{
  grid-column: 1 / -1;
  margin-top: 6px;
  position:relative;
  overflow:hidden;
}
.guide-card::before{
  content:"";
  position:absolute;
  inset:-1px;
  background: linear-gradient(90deg, rgba(167,139,250,.22), rgba(96,165,250,.18));
  opacity:.65;
  filter: blur(35px);
  pointer-events:none;
}
.guide-card > *{
  position:relative;
  z-index:1;
}

.guide-list{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}
.guide-list li{
  margin: 6px 0;
  transition: transform .2s ease;
}
.guide-list li:hover{
  transform: translateX(4px);
  color: rgba(255,255,255,.82);
}

.guide-note{
  margin-top: 12px;
  color: var(--muted2);
  font-size: 13px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  padding: 12px;
  border-radius: 14px;
}

/* Footer */
.footer{
  padding: 16px 0 22px;
  color: var(--muted2);
}
.foot{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
}
.dot{opacity:.5}
.muted{opacity:.85}

/* Animations */
@keyframes enterUp{
  from{opacity:0; transform: translateY(10px)}
  to{opacity:1; transform: translateY(0)}
}

.views-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border-radius:999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.75);
  font-size:12px;
  white-space:nowrap;
  animation: viewsIn .6s ease both;
}

.views-eye{
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
  opacity:.95;
}

.views-text{
  color: rgba(255,255,255,.65);
}

.views-count{
  font-weight:900;
  color: rgba(255,255,255,.92);
}

@keyframes viewsIn{
  from{opacity:0; transform: translateY(-4px) scale(.98)}
  to{opacity:1; transform: translateY(0) scale(1)}
}

@media (max-width: 520px){
  .views-pill{
    padding:6px 10px;
    gap:6px;
  }
  .views-text{
    display:none;
  }
}