/* Le Wizz (wizz.js) : l'écran tremble, comme la fenêtre de MSN. Pour qui demande moins
   d'animations, un éclair au bord de l'écran à la place. */
@keyframes wizz-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  10% {
    transform: translate(-7px, 3px);
  }
  20% {
    transform: translate(6px, -4px);
  }
  30% {
    transform: translate(-6px, -3px);
  }
  40% {
    transform: translate(7px, 4px);
  }
  50% {
    transform: translate(-5px, 2px);
  }
  60% {
    transform: translate(5px, -3px);
  }
  70% {
    transform: translate(-4px, 3px);
  }
  80% {
    transform: translate(3px, -2px);
  }
  90% {
    transform: translate(-2px, 1px);
  }
}
@keyframes wizz-flash {
  from {
    box-shadow: inset 0 0 0 6px #30b0c7;
  }
  to {
    box-shadow: inset 0 0 0 0 transparent;
  }
}
html.wizz-shake body {
  animation: wizz-shake 650ms linear;
}
@media (prefers-reduced-motion: reduce) {
  html.wizz-shake body {
    animation: none;
  }
  html.wizz-shake::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    animation: wizz-flash 650ms ease-out forwards;
  }
}

/* Le vieux PC du sous-sol (vieux-pc.js) : un écran cathodique beige, un bureau des années 2000.
   La fenêtre de Smapville s'efface : on ne voit que le moniteur. */
.modal.vieux-pc {
  width: min(940px, 100%, calc((100vh - 120px) * 4 / 3 + 88px));
  max-height: none;
  padding: 0;
  overflow: visible;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.modal.vieux-pc::before,
.modal.vieux-pc::after {
  display: none;
}
.vpc-monitor {
  padding: 26px 30px 0;
  border-radius: 22px 22px 18px 18px;
  background: linear-gradient(180deg, #ece6d4, #d9d1bb 40%, #bdb49b);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}
.vpc-bezel {
  padding: 14px;
  border-radius: 16px;
  background: #2b2a30;
  box-shadow:
    inset 0 0 0 3px #1c1b20,
    inset 0 6px 18px rgba(0, 0, 0, 0.6);
}
.vpc-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px / 14px;
  background: #000;
  color: #000;
  font: 12px/1.3 Tahoma, Verdana, "Segoe UI", sans-serif;
  user-select: none;
}
/* Les lignes du balayage et le bord plus sombre d'un tube. */
.vpc-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.35) 100%);
}
.vpc-on {
  animation: vpc-on 520ms ease-out;
}
.vpc-off {
  animation: vpc-off 380ms ease-in forwards;
}
@keyframes vpc-on {
  0%,
  45% {
    transform: scale(1, 0.004);
    filter: brightness(4);
  }
  70% {
    transform: scale(1, 1);
    filter: brightness(2);
  }
  100% {
    transform: none;
    filter: none;
  }
}
@keyframes vpc-off {
  0% {
    transform: none;
    filter: none;
  }
  55% {
    transform: scale(1, 0.004);
    filter: brightness(4);
  }
  100% {
    transform: scale(0, 0.004);
    filter: brightness(6);
  }
}
.vpc-px,
.vpc-wallpaper {
  image-rendering: pixelated;
}
.vpc-wallpaper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.vpc-chin {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 6px 0 10px;
}
.vpc-brand {
  flex: 1;
  color: #8a8270;
  font: bold 12px/1 Verdana, sans-serif;
  letter-spacing: 0.25em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.vpc-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5fe35a;
  box-shadow: 0 0 6px #5fe35a;
}
.vpc-power {
  position: relative;
  width: 26px;
  height: 26px;
  border: 1px solid #a39b84;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f3eee0, #cfc6ad);
  cursor: pointer;
}
.vpc-power::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid #8a8270;
  border-top-color: transparent;
  border-radius: 50%;
}

/* Le bureau : les icônes, puis les fenêtres par-dessus. */
.vpc-icons {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  display: grid;
  gap: 10px;
}
.vpc-icon,
.vpc-file {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 4px 2px;
  border: 1px dotted transparent;
  background: none;
  font: inherit;
  text-align: center;
  cursor: default;
}
.vpc-icon {
  width: 84px;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
}
.vpc-icon canvas,
.vpc-file canvas {
  width: 32px;
  height: 32px;
}
.vpc-icon:focus,
.vpc-file:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
}
.vpc-file:focus {
  border-color: #316ac5;
}
.vpc-icon:focus span,
.vpc-file:focus span {
  background: #316ac5;
  color: #fff;
}
.vpc-desk {
  position: absolute;
  inset: 0 0 30px;
  z-index: 2;
  pointer-events: none;
}
.vpc-desk > * {
  pointer-events: auto;
}

/* Les fenêtres : barre de titre bleue, boutons, corps beige. */
.vpc-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  max-height: 92%;
  border: 3px solid #2d5fcf;
  border-top: 0;
  border-radius: 8px 8px 2px 2px;
  background: #efebde;
  box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.45);
}
.vpc-window[hidden] {
  display: none;
}
.vpc-titlebar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  margin: 0 -3px;
  padding: 0 3px 0 6px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #4f8ff2 0%, #2d65d8 18%, #2a5ccc 80%, #1f4fb4 100%);
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 0 #10306e;
  cursor: move;
  touch-action: none;
}
.vpc-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vpc-winbtn {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 3px;
  background: linear-gradient(180deg, #5d9cf7, #2f67d9);
  color: #fff;
  font: bold 13px/1 Tahoma, Verdana, sans-serif;
  cursor: pointer;
}
.vpc-winbtn.close {
  background: linear-gradient(180deg, #e9806a, #c8452c);
}
.vpc-winbody {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}
.vpc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 12px;
  border: 1px solid #003c74;
  border-radius: 3px;
  background: linear-gradient(180deg, #fff, #ece9d8);
  font: inherit;
  cursor: pointer;
}
.vpc-btn.primary {
  font-weight: bold;
}
.vpc-btn:disabled {
  color: #999;
  cursor: default;
}
.vpc-shake {
  animation: wizz-shake 650ms linear;
}
/* Le faux virus : des fenêtres d'alerte, barre de titre orange, une icône et un bouton. */
.vpc-virus {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px 10px;
  padding: 4px;
}
.vpc-virus p {
  margin: 0;
}
.vpc-virus-icon {
  font-size: 26px;
  line-height: 1;
}
.vpc-virus-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
}
.vpc-virus-win {
  border-color: #d5582a;
}
.vpc-virus-win .vpc-titlebar {
  background: linear-gradient(180deg, #f6a25a 0%, #e4743a 18%, #d5582a 100%);
  text-shadow: 1px 1px 0 #7a2a0e;
}

/* Les petites fenêtres de MSN, en bas à droite de l'écran : les notifications de Smapville restent
   sous le moniteur. */
.vpc-popups {
  position: absolute;
  right: 8px;
  bottom: 38px;
  z-index: 960;
  display: grid;
  justify-items: end;
  gap: 6px;
}
.vpc-popup {
  display: grid;
  gap: 6px;
  width: 210px;
  padding: 0 0 8px;
  overflow: hidden;
  border: 1px solid #2d5fcf;
  border-radius: 4px;
  background: linear-gradient(180deg, #fff, #e8f1fc);
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.35);
  font: inherit;
  text-align: left;
  cursor: pointer;
  animation: vpc-popup 300ms ease-out;
}
.vpc-popup-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: linear-gradient(180deg, #4f8ff2, #2a5ccc);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
}
.vpc-popup-text {
  padding: 0 8px;
}
@keyframes vpc-popup {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* La barre des tâches, le bouton démarrer et son menu, l'horloge. */
.vpc-taskbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  background: linear-gradient(180deg, #3a7be6, #245edb 15%, #2257d4 85%, #1941a5);
}
.vpc-start {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  padding: 0 14px 0 8px;
  border: 0;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, #4fb64a, #3a9a36 30%, #2f8a2c);
  box-shadow: inset -2px 0 3px rgba(0, 0, 0, 0.25);
  color: #fff;
  font: italic bold 15px/1 Tahoma, Verdana, sans-serif;
  text-shadow: 1px 1px 1px #1b4d18;
  cursor: pointer;
}
.vpc-tasks {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.vpc-task {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 160px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #1c49b0;
  border-radius: 3px;
  background: #3c81f3;
  color: #fff;
  font: 11px Tahoma, Verdana, sans-serif;
  cursor: pointer;
}
.vpc-task span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vpc-clock {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 0 12px;
  border-left: 1px solid #0b5fa8;
  background: linear-gradient(180deg, #1aa1ed, #0f8bd8);
  color: #fff;
  font: 11px Tahoma, Verdana, sans-serif;
}
.vpc-start-menu {
  position: absolute;
  bottom: 30px;
  left: 0;
  z-index: 950;
  width: min(240px, 70%);
  overflow: hidden;
  border: 2px solid #1d55c8;
  border-radius: 8px 8px 0 0;
  background: #fff;
  box-shadow: 2px -2px 10px rgba(0, 0, 0, 0.4);
}
.vpc-start-head,
.vpc-start-foot {
  background: linear-gradient(180deg, #2f6fe0, #1f56c8);
  color: #fff;
}
.vpc-start-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  font-size: 13px;
}
.vpc-start-pic {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #e8eefc;
  border-radius: 4px;
  background: #fff;
}
.vpc-start-list {
  display: grid;
  padding: 6px;
}
.vpc-start-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 2px;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.vpc-start-item:hover,
.vpc-start-item:focus-visible {
  outline: none;
  background: #316ac5;
  color: #fff;
}
.vpc-start-foot {
  display: flex;
  justify-content: flex-end;
  padding: 6px;
}
.vpc-start-off {
  padding: 4px 6px;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

/* Mes documents, la corbeille, le Bloc-notes. */
/* La page blanche remplit la fenêtre, et c'est son contenu qui défile (comme dans le Bloc-notes). */
.vpc-files {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 120px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #7f9db9;
  background: #fff;
}
.vpc-file span {
  overflow-wrap: anywhere;
}
.vpc-status {
  padding: 2px 4px;
  border-top: 1px solid #d6d2c2;
  color: #444;
  font-size: 11px;
}
.vpc-notepad {
  flex: 1 1 auto;
  min-height: 140px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  border: 1px solid #7f9db9;
  background: #fff;
  font: 13px/1.4 "Lucida Console", Monaco, monospace;
  white-space: pre-wrap;
  user-select: text;
}

/* MSN : connexion, contacts, conversation. */
.vpc-msn .vpc-winbody {
  background: linear-gradient(180deg, #e8f1fc, #fff 40%);
}
.msn {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
}
.msn-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 8px;
}
.msn-brand canvas,
.msn-connecting canvas {
  width: 48px;
  height: 48px;
}
.msn-logo {
  color: #2d5fcf;
  font-size: 18px;
}
.msn-logo b {
  color: #3a9a36;
  font-size: 22px;
  font-style: italic;
}
.msn-field {
  display: grid;
  gap: 3px;
  color: #333;
  font-size: 11px;
}
.msn-input {
  padding: 4px 6px;
  border: 1px solid #7f9db9;
  background: #fff;
  font-size: 12px;
}
.msn-error {
  padding: 6px;
  border: 1px solid #e0b74c;
  background: #fff3cd;
  font-size: 11px;
}
.msn-connecting {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 0;
  color: #2d5fcf;
}
.msn-connecting canvas {
  animation: msn-bob 0.8s ease-in-out infinite alternate;
}
@keyframes msn-bob {
  to {
    transform: translateY(-6px);
  }
}
.msn-dots::after {
  content: "...";
  display: inline-block;
  width: 0;
  overflow: hidden;
  vertical-align: bottom;
  animation: msn-dots 1.2s steps(4) infinite;
}
@keyframes msn-dots {
  to {
    width: 1.25em;
  }
}
.msn-me {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid #b6c9e8;
  border-radius: 4px;
  background: #fff;
}
.msn-pic {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid #9ec3f0;
  border-radius: 4px;
  background: #fff;
}
.msn-me-text {
  display: grid;
  min-width: 0;
}
.msn-me-text b,
.msn-me-text .msn-perso {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msn-state,
.msn-perso {
  color: #555;
  font-size: 11px;
}
.msn-perso {
  font-style: italic;
}
.msn-banner {
  padding: 6px 8px;
  border: 1px solid #e6cf6a;
  border-radius: 4px;
  background: #fffbe0;
  font-size: 11px;
}
.msn-groups {
  display: grid;
  gap: 1px;
  max-height: 300px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #b6c9e8;
  background: #fff;
}
.msn-group {
  padding: 4px 2px 2px;
  color: #1f4fb4;
  font-size: 11px;
  font-weight: bold;
}
.msn-empty {
  padding: 2px 6px;
  color: #777;
  font-size: 11px;
}
.msn-contact {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  padding: 2px 6px;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: default;
}
.msn-contact:hover {
  background: #e3edfb;
}
.msn-contact:focus {
  outline: none;
  background: #316ac5;
  color: #fff;
}
.msn-contact:focus .msn-state,
.msn-contact:focus .msn-perso {
  color: #e8eefc;
}
.msn-mark {
  flex: none;
  width: 1em;
  text-align: center;
}
.msn-contact.available .msn-mark {
  color: #2f9a2f;
}
.msn-contact.busy .msn-mark {
  color: #d23a2a;
}
.msn-contact.away .msn-mark {
  color: #c48f00;
}
.msn-contact.offline {
  color: #6f6f6f;
}
.msn-contact .msn-perso {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vpc-conv .vpc-winbody {
  background: #f4f7fc;
}
.msn-conv {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 280px;
}
.msn-to {
  padding: 4px 6px;
  border: 1px solid #b6c9e8;
  background: #fff;
  font-size: 11px;
}
.msn-log {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 4px;
  min-height: 140px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #b6c9e8;
  background: #fff;
  user-select: text;
}
.msn-who {
  color: #666;
}
.msn-said {
  padding-left: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msn-notice {
  padding: 2px 0;
  border-bottom: 1px dotted #ccd8ea;
  color: #555;
  font-size: 11px;
}
.msn-tools {
  display: flex;
  gap: 4px;
}
.msn-wizz svg {
  width: 14px;
  height: 14px;
}
.msn-compose {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.msn-text {
  flex: 1;
  min-width: 0;
  padding: 4px;
  border: 1px solid #7f9db9;
  font: inherit;
  resize: none;
}

@media (max-width: 640px) {
  .vpc-monitor {
    padding: 12px 12px 0;
    border-radius: 14px;
  }
  .vpc-bezel {
    padding: 8px;
  }
}
