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

html, body {
  background: transparent;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══ CARTE D'ALERTE ══════════════════════════════ */
.alert-box {
  position: relative;
  width: 520px;
  background: linear-gradient(135deg, rgba(8,6,0,0.97) 0%, rgba(20,15,0,0.97) 100%);
  border: 1px solid rgba(234,179,8,0.5);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transform: translateX(-30px) scale(0.97);
  box-shadow: 0 0 0 1px rgba(234,179,8,0.15), 0 0 30px rgba(234,179,8,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color 0.3s, box-shadow 0.3s;
  --accent: #eab308;
}
.alert-box::before {
  content: '';
  position: absolute; top: 0; left: 15%; right: 15%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px var(--accent);
  border-radius: 2px;
}
.corner-tl {
  position: absolute; top: 8px; left: 8px; width: 10px; height: 10px;
  border-top: 2px solid rgba(234,179,8,0.3);
  border-left: 2px solid rgba(234,179,8,0.3);
}
.alert-box::after {
  content: '';
  position: absolute; bottom: 8px; right: 8px; width: 10px; height: 10px;
  border-bottom: 2px solid rgba(234,179,8,0.3);
  border-right: 2px solid rgba(234,179,8,0.3);
}

/* Accent dynamique par catégorie/tier (posé en style inline via --accent + classe .legendary) */
.alert-box.legendary {
  border-color: rgba(251,191,36,0.7);
  box-shadow: 0 0 0 1px rgba(251,191,36,0.3), 0 0 40px rgba(251,191,36,0.5), 0 0 80px rgba(251,191,36,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: rainbow-border 2s linear infinite;
}
@keyframes rainbow-border {
  0%   { box-shadow: 0 0 40px rgba(251,191,36,0.6); }
  17%  { box-shadow: 0 0 40px rgba(239,68,68,0.6); }
  33%  { box-shadow: 0 0 40px rgba(236,72,153,0.6); }
  50%  { box-shadow: 0 0 40px rgba(147,51,234,0.6); }
  67%  { box-shadow: 0 0 40px rgba(59,130,246,0.6); }
  83%  { box-shadow: 0 0 40px rgba(34,197,94,0.6); }
  100% { box-shadow: 0 0 40px rgba(251,191,36,0.6); }
}

.alert-box.show { animation: alert-in 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.alert-box.hide { animation: alert-out 0.4s ease-in forwards; }
@keyframes alert-in  { 0%{opacity:0;transform:translateX(-30px) scale(0.97)} 60%{opacity:1;transform:translateX(4px) scale(1.01)} 100%{opacity:1;transform:translateX(0) scale(1)} }
@keyframes alert-out { 0%{opacity:1;transform:translateX(0) scale(1)} 100%{opacity:0;transform:translateX(30px) scale(0.97)} }

/* ══ AVATAR + BADGE TYPE ══════════════════════════ */
.alert-logo-wrap { width: 74px; height: 74px; flex-shrink: 0; position: relative; z-index: 2; }
.alert-logo-wrap img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: logo-pulse 1.5s ease-in-out infinite;
}
@keyframes logo-pulse { 0%,100%{box-shadow:0 0 12px var(--accent)} 50%{box-shadow:0 0 24px var(--accent), 0 0 48px color-mix(in srgb, var(--accent) 40%, transparent)} }
.type-badge {
  position: absolute; bottom: -4px; right: -4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(8,6,0,0.95); border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; z-index: 3;
  animation: icon-bounce 1.2s ease-in-out infinite;
}
@keyframes icon-bounce { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }

/* ══ TEXTE ══════════════════════════════════════ */
.alert-content { flex: 1; z-index: 2; min-width: 0; }
.alert-type {
  font-family: 'Orbitron', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--accent); opacity: 0.85;
  margin-bottom: 3px;
}
.alert-name {
  font-family: 'Orbitron', sans-serif; font-size: 22px; font-weight: 900;
  color: #fff; line-height: 1.2;
  text-shadow: 0 0 14px var(--accent), 0 0 28px color-mix(in srgb, var(--accent) 40%, transparent);
  margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}
.alert-msg {
  font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 600;
  color: rgba(255,255,255,0.65); letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}

.alert-media { display: none; }
.alert-media.has-media {
  display: block; width: 56px; height: 56px; flex-shrink: 0; z-index: 2;
}
.alert-media img, .alert-media video {
  width: 100%; height: 100%; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--accent);
}

/* ══ TIMER ══════════════════════════════════════ */
.timer-bar { position: absolute; bottom: 0; left: 3px; right: 0; height: 2px; background: rgba(255,255,255,0.04); overflow: hidden; border-radius: 0 0 12px 12px; }
.timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, black), var(--accent), white); transform-origin: left; }
.alert-box.show .timer-fill { animation: timer-drain linear forwards; }
@keyframes timer-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
