/* Hématome - univers MSN Messenger (2003). Windows XP Luna, vert MSN. */

:root {
  --xp-blue-1: #0a246a;
  --xp-blue-2: #3a6ea5;
  --xp-blue-3: #6593cf;
  --xp-face: #ece9d8;
  --xp-border: #0831d9;
  --msn-green: #7ebb45;
  --msn-green-dark: #4e8f1e;
  --msn-ink: #1a1a1a;
  --msn-blue-text: #16437c;
  color-scheme: light;
}

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

body {
  min-height: 100dvh;
  /* Colline « Bliss » stylisée */
  background:
    radial-gradient(120% 90% at 50% 118%, #4c8f2f 0%, #63a83e 28%, transparent 56%),
    linear-gradient(180deg, #2f71c8 0%, #6ba7e8 45%, #b9d8f5 70%, #dceefb 100%);
  font-family: Tahoma, Verdana, "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--msn-ink);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 120px;
}

.msn-desktop {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1000px;
}

/* -- Fenêtres XP ------------------------ */
.msn-window {
  background: var(--xp-face);
  border: 3px solid var(--xp-border);
  border-top: none;
  border-radius: 8px 8px 3px 3px;
  box-shadow: 3px 6px 16px rgba(10, 30, 80, 0.45);
  overflow: hidden;
}

.msn-list { width: 340px; }
.msn-chat { width: 460px; }

.msn-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(180deg, var(--xp-blue-3) 0%, var(--xp-blue-1) 14%, var(--xp-blue-2) 55%, var(--xp-blue-1) 100%);
  color: #ffffff;
}

.msn-title {
  font-size: 13px;
  font-weight: 700;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.msn-butterfly { display: inline-flex; flex-shrink: 0; }

.msn-winbtns { display: flex; gap: 3px; flex-shrink: 0; }

.msn-winbtns i {
  width: 21px;
  height: 21px;
  border-radius: 3px;
  background: linear-gradient(180deg, #7ba2e4 0%, #3a6ea5 100%);
  border: 1px solid #ffffff;
  color: #ffffff;
  font-style: normal;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msn-winbtns .msn-x { background: linear-gradient(180deg, #e88b7c 0%, #c1421f 100%); }

.msn-toolbar {
  padding: 4px 10px;
  border-bottom: 1px solid #d4d0be;
  color: #333;
  background: #f5f3e9;
}

/* -- Liste de contacts ------------------ */
.msn-me {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 10px;
  background: linear-gradient(180deg, #ffffff 0%, #e8f2dc 100%);
  border-bottom: 1px solid #c9d8b5;
}

.msn-avatar {
  width: 42px;
  height: 42px;
  border-radius: 5px;
  border: 2px solid var(--msn-green-dark);
  background: linear-gradient(140deg, #b31212 0%, #6e0b0b 100%);
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msn-me-name { font-weight: 700; font-size: 14px; }
.msn-status-online { color: var(--msn-green-dark); font-weight: 400; }
.msn-me-msg { color: #666; font-style: italic; margin-top: 2px; }

.msn-contacts { padding: 8px 6px 14px; background: #ffffff; }

.msn-group {
  color: var(--msn-blue-text);
  font-weight: 700;
  padding: 6px 6px 4px;
}

.msn-contact-list { list-style: none; }

.msn-contact-list a {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  padding: 7px 8px 7px 24px;
  min-height: 44px;
  align-content: center;
  text-decoration: none;
  color: var(--msn-ink);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.msn-contact-list a:hover,
.msn-contact-list a:focus-visible { background: #e8f0fa; }
.msn-contact-list a:focus-visible { outline: 1px dotted var(--msn-blue-text); outline-offset: -1px; }

.msn-dot {
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b8e986 0%, var(--msn-green) 55%, var(--msn-green-dark) 100%);
  border: 1px solid var(--msn-green-dark);
}

.msn-contact-list b { font-weight: 700; }
.msn-contact-list span { color: #777; font-size: 12px; }

.msn-adline { color: #999; font-size: 11px; padding: 4px 8px; font-style: italic; }

/* -- Conversation ----------------------- */
.msn-warn {
  font-size: 10px;
  color: #666;
  background: #fdfceb;
  border-bottom: 1px solid #e3e0c8;
  padding: 4px 10px;
}

.msn-messages { background: #ffffff; padding: 12px 14px; min-height: 300px; }

.msn-said { color: var(--msn-blue-text); margin-top: 10px; }
.msn-said:first-child { margin-top: 0; }

.msn-msg {
  color: var(--msn-ink);
  padding: 2px 0 2px 14px;
  line-height: 1.5;
}

.msn-msg a { color: #1c64c8; }
.msn-msg a:hover { text-decoration: none; }

.msn-typing {
  margin-top: 16px;
  color: #888;
  font-size: 11px;
  font-style: italic;
  animation: msn-typing 2.4s steps(1) infinite;
}

@keyframes msn-typing { 55% { opacity: 0.25; } }

/* Zone de saisie */
.msn-inputzone { border-top: 2px solid #c9c5ad; background: var(--xp-face); padding: 8px 10px 12px; }

.msn-input-tools { display: flex; gap: 6px; padding-bottom: 6px; }

.msn-emote {
  width: 26px;
  height: 26px;
  border: 1px solid #b5b29a;
  border-radius: 3px;
  background: #fdfdf7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #d78a00;
}

.msn-sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

#msn-input {
  width: 100%;
  resize: none;
  border: 1px solid #7f9db9;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  background: #ffffff;
}

#msn-input:focus-visible { outline: 2px solid var(--xp-blue-2); }

.msn-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.msn-btn {
  font-family: inherit;
  font-size: 13px;
  color: var(--msn-ink);
  text-decoration: none;
  background: linear-gradient(180deg, #ffffff 0%, #ece9d8 60%, #d8d4c0 100%);
  border: 1px solid #003c74;
  border-radius: 3px;
  padding: 5px 18px;
  min-height: 28px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #ffffff;
}

.msn-btn:hover { background: linear-gradient(180deg, #fff8e0 0%, #f5e8b8 100%); }
.msn-btn:focus-visible { outline: 1px dotted #003c74; outline-offset: -4px; }
.msn-btn-primary { font-weight: 700; }

/* Wizz ! */
.is-wizzed { animation: msn-wizz 500ms linear; }

@keyframes msn-wizz {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-7px, 3px) rotate(-1deg); }
  25% { transform: translate(6px, -4px) rotate(1deg); }
  40% { transform: translate(-6px, -3px); }
  55% { transform: translate(5px, 4px) rotate(-1deg); }
  70% { transform: translate(-4px, 2px) rotate(1deg); }
  85% { transform: translate(3px, -2px); }
}

@media (max-width: 880px) {
  .msn-desktop { flex-direction: column; align-items: stretch; }
  .msn-list, .msn-chat { width: 100%; }
  body { padding-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .msn-typing { animation: none; }
  .is-wizzed { animation: none; }
}
