/* ============================================================
   Infini XP — bureau, icônes, barre des tâches, menu démarrer
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font: 11px Tahoma, "Trebuchet MS", Verdana, Arial, sans-serif;
  color: #1b1b1b;
  background: #3a6ea5;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

.img-fail { opacity: 0 !important; }

button { font: inherit; color: inherit; }
input, textarea { user-select: text; -webkit-user-select: text; }

/* ------------------------------------------------------------
   Barres de défilement fines, style XP
   ------------------------------------------------------------ */
* {
  scrollbar-width: thin;
  scrollbar-color: #93aecb #f1efe2;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #f3f1e7;
  border-left: 1px solid #d9d6c9;
  box-shadow: inset 1px 0 0 #fff;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #ffffff 0%, #e4edf9 42%, #b9cde8 100%);
  border: 1px solid #7f9db9;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #ffffff 0%, #edf5ff 42%, #a9c8ec 100%);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(90deg, #dbe9fb 0%, #c3d9f5 55%, #9dbfe4 100%);
}

::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
::-webkit-scrollbar-corner { background: #ece9d8; }

/* ------------------------------------------------------------
   Papier peint « Bliss » (Windows XP)
   ------------------------------------------------------------ */
.desktop {
  position: fixed;
  inset: 0 0 30px 0;
  overflow: hidden;
  background: #3a6ea5 url("https://archive.org/download/windows-xp-bliss-wallpaper/windows-xp-bliss-4k-lu-1920x1080.jpg") center center / cover no-repeat;
  box-shadow: inset 0 0 140px rgba(0, 0, 0, .22);
}

/* ------------------------------------------------------------
   Icônes du bureau
   ------------------------------------------------------------ */
.desktop-icons {
  position: absolute;
  top: 12px;
  left: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px;
}

.dicon {
  width: 86px;
  padding: 4px 2px 3px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-radius: 3px;
  cursor: default;
}

.dicon-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55));
}

.dicon-label {
  color: #fff;
  font-size: 11px;
  text-align: center;
  line-height: 1.15;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, .9), 0 0 4px rgba(0, 0, 0, .7);
  padding: 1px 3px;
  border-radius: 2px;
}

.dicon.sel .dicon-img { filter: brightness(.8) saturate(1.25) drop-shadow(0 0 3px #fff); outline: 1px dotted #fff; outline-offset: 2px; }
.dicon.sel .dicon-label { background: #2b6fd6; }

/* ------------------------------------------------------------
   Barre des tâches
   ------------------------------------------------------------ */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  gap: 3px;
  padding: 0 3px 0 0;
  background: linear-gradient(180deg, #3f8cf3 0%, #245edb 8%, #2a6fe0 40%, #2f7bf0 82%, #17408f 100%);
  border-top: 1px solid #0b3a8c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
  font-size: 11px;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 22px 0 10px;
  border: 0;
  border-radius: 0 14px 14px 0;
  background: linear-gradient(180deg, #57b83d 0%, #3f9c26 12%, #2f8820 45%, #237018 88%, #1a5a12 100%);
  color: #fff;
  font: italic bold 15px/1 "Trebuchet MS", Tahoma, sans-serif;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 2px 0 6px rgba(0, 0, 0, .25);
  cursor: pointer;
}

.start-btn:hover { filter: brightness(1.1); }
.start-btn.open { filter: brightness(.9); box-shadow: inset 2px 2px 6px rgba(0, 0, 0, .45); }
.start-btn .flag { width: 19px; height: 19px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }

.quick {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  border-left: 1px solid rgba(0, 0, 0, .18);
  border-right: 1px solid rgba(255, 255, 255, .22);
}

.quick button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
}

.quick button:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .35); }
.quick-img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .55));
}

.tasks {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 3px;
  min-width: 0;
  overflow: hidden;
}

.task {
  flex: 0 1 168px;
  min-width: 96px;
  height: 23px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid #1a4fb0;
  border-radius: 3px;
  background: linear-gradient(180deg, #5f9bf8, #3d7ce8 45%, #2a62cf);
  color: #fff;
  font-size: 11px;
  text-align: left;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}

.task.active {
  background: linear-gradient(180deg, #1d4fb8, #2a63d0 55%, #1a49a4);
  box-shadow: inset 1px 2px 4px rgba(0, 0, 0, .4);
}

.task-label { overflow: hidden; text-overflow: ellipsis; }

.task-ic {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45));
}

.tray {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px 0 8px;
  border-left: 1px solid rgba(0, 0, 0, .25);
  background: linear-gradient(180deg, #17a0ee, #0b64c9 45%, #0a4f9f);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .55);
  cursor: pointer;
}

.tray-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa7b5;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, .6);
}

.tray-led.on { background: #5cff8a; box-shadow: 0 0 6px #5cff8a; }
.tray-led.off { background: #ff7b6b; box-shadow: 0 0 5px rgba(255, 80, 60, .8); }
.tray-led.wait { background: #ffd76a; box-shadow: 0 0 5px rgba(255, 210, 80, .8); }

#tray-tip { font-size: 10px; opacity: .92; }
#clock { font-size: 11px; padding-left: 4px; }

/* ------------------------------------------------------------
   Menu démarrer
   ------------------------------------------------------------ */
.startmenu {
  position: fixed;
  left: 0;
  bottom: 30px;
  z-index: 1100;
  width: 392px;
  max-width: calc(100vw - 8px);
  background: #fff;
  border: 1px solid #0a3fa8;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 3px -3px 16px rgba(0, 0, 0, .45);
  overflow: hidden;
}

.sm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #1f7bff, #0a4fd6 55%, #083ec0);
  border-bottom: 2px solid #f4a300;
  color: #fff;
  font: bold 15px "Trebuchet MS", Tahoma, sans-serif;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, .55);
}

.sm-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 2px solid #ffe9a8;
  background: #1a56c4;
  font: bold 18px Tahoma, sans-serif;
  box-shadow: 0 0 5px rgba(0, 0, 0, .5);
}

.sm-cols { display: flex; background: #fff; }
.sm-left { flex: 1; padding: 6px; border-right: 1px solid #d6e3f5; background: #fff; }
.sm-right { width: 152px; flex: 0 0 152px; padding: 6px; background: linear-gradient(180deg, #dbe9fb, #c3d9f5); }

.sm-right-title {
  font-size: 10px;
  font-weight: bold;
  color: #1b4c9c;
  padding: 2px 6px 6px;
}

.sm-right button {
  display: block;
  width: 100%;
  padding: 4px 6px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  text-align: left;
  font-size: 11px;
  cursor: default;
}

.sm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 6px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  text-align: left;
  font-size: 11px;
  cursor: default;
}

.sm-left .sm-item b { display: block; font-size: 11px; }
.sm-left .sm-item small { display: block; font-size: 10px; color: #666; }

.sm-item:hover, .sm-right button:hover { background: #316ac5; color: #fff; }
.sm-item:hover small { color: #dbe7ff; }

.sm-ico {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3));
}

.sm-sep { height: 1px; margin: 5px 4px; background: #d5d2c4; }

.sm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #2a72e8, #0d4bc4);
  border-top: 1px solid #f4a300;
}

.sm-footer button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 11px;
  padding: 3px 5px;
  border-radius: 3px;
  cursor: pointer;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, .5);
}

.sm-footer button:hover { background: rgba(255, 255, 255, .18); }

.sm-fico {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(160deg, #ffd98a, #c77700);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}

.sm-fico.power { background: linear-gradient(160deg, #ff9a8a, #b3260d); }

/* ------------------------------------------------------------
   Écran de démarrage
   ------------------------------------------------------------ */
.boot {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: radial-gradient(80% 80% at 50% 40%, #0b1a34, #000 70%);
  color: #fff;
  transition: opacity .45s ease;
}

.boot.hide { opacity: 0; pointer-events: none; }

.boot-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  font: bold 40px/1 "Trebuchet MS", Tahoma, sans-serif;
  letter-spacing: -.5px;
  text-shadow: 0 0 18px rgba(120, 180, 255, .55);
}

.boot-logo em { font-style: italic; color: #7fc3ff; }
.boot-logo .flag { width: 42px; height: 42px; }

.boot-bar {
  width: min(280px, 60vw);
  height: 12px;
  border: 1px solid #3f5f8a;
  border-radius: 6px;
  padding: 2px;
  background: #06101f;
  overflow: hidden;
}

.boot-bar i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, #2a6fe0 0 8px, #6fb0ff 8px 16px);
  animation: bootslide 1.1s linear infinite;
}

@keyframes bootslide {
  from { transform: translateX(-100%); }
  to { transform: translateX(260%); }
}

.boot-note { font-size: 11px; color: #9fb6d4; letter-spacing: .5px; }

/* ------------------------------------------------------------
   Arrêt / verrouillage
   ------------------------------------------------------------ */
.shutdown {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(90% 90% at 50% 35%, #4d7fbf, #16305c 65%, #071427);
  color: #fff;
}

.shutdown-box { text-align: center; max-width: 560px; padding: 24px; }
.shutdown-box .flag-lg { width: 56px; height: 56px; margin-bottom: 14px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }

.shutdown h1 {
  margin: 0 0 8px;
  font: bold 24px/1.25 "Trebuchet MS", Tahoma, sans-serif;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, .6);
}

.shutdown p { margin: 0; color: #cfe1ff; font-size: 12px; }

.shutdown-bar {
  width: 220px;
  height: 10px;
  margin: 22px auto 6px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 5px;
  padding: 2px;
  overflow: hidden;
}

.shutdown-bar i {
  display: block;
  height: 100%;
  width: 34%;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, #cfe1ff 0 7px, #6fa4ff 7px 14px);
  animation: bootslide 1s linear infinite;
}

.shutdown.done .shutdown-bar { display: none; }

.shutdown-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.shutdown-actions .xp-btn { min-width: 110px; }

/* ------------------------------------------------------------
   Notifications
   ------------------------------------------------------------ */
.toasts {
  position: fixed;
  right: 10px;
  bottom: 40px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  width: 260px;
  padding: 8px 10px;
  background: #ffffe1;
  border: 1px solid #000;
  border-radius: 4px 10px 10px 10px;
  box-shadow: 2px 3px 10px rgba(0, 0, 0, .45);
  color: #222;
  transition: opacity .3s, transform .3s;
  animation: toasin .25s ease;
}

.toast.out { opacity: 0; transform: translateX(20px); }
.toast-title { font-weight: bold; font-size: 11px; margin-bottom: 2px; }
.toast-body { font-size: 11px; line-height: 1.35; color: #333; }

@keyframes toasin {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   Divers
   ------------------------------------------------------------ */
.xp-btn {
  padding: 3px 12px;
  min-width: 64px;
  border: 1px solid #7f9db9;
  border-radius: 3px;
  background: linear-gradient(#fff, #f2f0e6 45%, #e2decb);
  box-shadow: inset 0 1px 0 #fff;
  cursor: pointer;
  font-size: 11px;
  color: #1b1b1b;
}

.xp-btn:hover { border-color: #e0a00c; background: linear-gradient(#fff, #fff6dc 45%, #f4e2a6); }
.xp-btn:active { background: #ded8c8; box-shadow: inset 1px 1px 3px rgba(0, 0, 0, .25); }

.xp-input {
  flex: 1;
  min-width: 0;
  padding: 3px 5px;
  border: 1px solid #7f9db9;
  background: #fff;
  font: 11px Tahoma, "Segoe UI", sans-serif;
  outline: none;
  border-radius: 0;
  color: #1b1b1b;
}

.xp-input:focus { border-color: #275ecb; }

@media (max-width: 720px) {
  .desktop-icons { flex-direction: row; flex-wrap: wrap; width: 100%; gap: 6px; }
  .dicon { width: 76px; }
  .dicon-img { width: 38px; height: 38px; }
  .startmenu { width: 100vw; max-width: none; border-radius: 0; }
  .sm-cols { flex-direction: column; }
  .sm-right { width: auto; flex-basis: auto; }
  #tray-tip { display: none; }
  .task { flex-basis: 112px; min-width: 84px; }
}
