/* ============================================================
   Millennials OS – XP Edition
   Capa de mejoras: shell, menú Inicio, taskbar, diálogos, responsive
   ============================================================ */

:root {
  --xp-blue: #245dda;
  --xp-blue-dark: #0a246a;
  --xp-blue-deep: #003399;
  --xp-face: #ece9d8;
  --xp-border: #0055ea;
  --xp-selection: #316ac5;
  --xp-text: #1e395b;
  --xp-taskbar-h: 35px;
}

/* ---------- Base / accesibilidad ---------- */
body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body ::selection {
  background: var(--xp-selection);
  color: #fff;
}

:focus-visible {
  outline: 1px dotted #000;
  outline-offset: 1px;
}

button:focus-visible,
.desktop-icon:focus-visible,
.folder-icon:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* Scrollbars con onda XP */
* {
  scrollbar-width: auto;
  scrollbar-color: #8bb4e8 #f1f1f1;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-left: 1px solid #d7d7d7;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #dbe8fb 0%, #a9c8f0 45%, #7fa9e2 100%);
  border: 1px solid #7f9db9;
  border-radius: 2px;
  box-shadow: inset 1px 1px 0 #fff;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #eaf2ff 0%, #b9d3f5 45%, #8db7ea 100%);
}

/* ---------- Intro ---------- */
#time-travel-layer {
  cursor: pointer;
}

#time-travel-layer.intro-running::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

#travel-text {
  animation: xp-pulse 1.8s ease-in-out infinite;
}

@keyframes xp-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ---------- Escritorio ---------- */
#desktop {
  gap: 6px;
  padding: 10px 10px 44px;
  overflow-x: hidden;
  overflow-y: auto;
}

.desktop-column {
  gap: 12px;
}

.desktop-icon,
.folder-icon {
  border-radius: 4px;
  transition: background-color 0.12s ease, transform 0.12s ease;
}

.desktop-icon:active,
.desktop-icon.selected {
  background-color: rgba(49, 106, 197, 0.55);
  border-color: rgba(255, 255, 255, 0.65);
}

.desktop-icon img,
.folder-icon img {
  image-rendering: auto;
}

#desktop-logo {
  max-width: 60%;
  max-height: 60%;
  opacity: 0.8;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
  transition: opacity 0.3s ease;
}

#desktop.xp-icons-compact .desktop-column {
  gap: 2px;
}

/* ---------- Ventanas ---------- */
.window-container .window {
  box-shadow: 3px 3px 14px rgba(0, 0, 0, 0.42);
}

.window-container.xp-opening .window {
  animation: xp-window-in 0.16s ease-out;
}

@keyframes xp-window-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.title-bar {
  cursor: default;
  user-select: none;
  touch-action: none;
}

.title-bar-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.title-bar-controls button {
  margin-left: 0;
  font-family: "Marlett", "Tahoma", sans-serif;
  line-height: 1;
  cursor: pointer;
}

.title-bar-controls button[aria-label="Minimize"] {
  background: linear-gradient(to bottom, #4b9bf6 0%, #1d6fdc 55%, #1455b4 100%);
}

.title-bar-controls button:hover {
  filter: brightness(1.15);
}

.title-bar-controls button:active {
  filter: brightness(0.9);
}

/* ---------- Taskbar ---------- */
.taskbar {
  height: var(--xp-taskbar-h);
  gap: 0;
  z-index: 9000;
}

#xp-task-buttons {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 5px;
  overflow: hidden;
}

.xp-task-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  min-width: 66px;
  max-width: 168px;
  flex: 0 1 158px;
  padding: 0 7px;
  border: 1px solid #1247b8;
  border-radius: 3px;
  background: linear-gradient(to bottom, #4a9af5 0%, #2f7de1 45%, #1e63c6 55%, #1a55ad 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.45), inset -1px -1px 0 rgba(0, 0, 0, 0.18);
  color: #fff;
  font: 11px/1 Tahoma, sans-serif;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  overflow: hidden;
}

.xp-task-btn:hover {
  filter: brightness(1.12);
}

.xp-task-btn.xp-task-active {
  background: linear-gradient(to bottom, #1b5bbb 0%, #1a53a9 45%, #164a9b 55%, #123f88 100%);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.45), inset -1px -1px 0 rgba(255, 255, 255, 0.15);
}

.xp-task-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.xp-task-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Bandeja del sistema ---------- */
.xp-tray {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 100%;
  padding: 0 4px;
  background: linear-gradient(to bottom, #22a3ef 0%, #1290e3 45%, #0d74c4 100%);
  border-left: 1px solid #0b5e9e;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.28);
}

.xp-tray-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
}

.xp-tray-btn:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.18);
}

.xp-tray-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.xp-tray-btn svg {
  width: 15px;
  height: 15px;
  fill: #fff;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.tray-clock {
  margin-left: 0;
  padding: 0 11px 0 9px;
  border-left: 1px solid #0b5e9e;
  cursor: default;
  user-select: none;
}

/* Popup de volumen */
.xp-volume-popup {
  position: fixed;
  right: 8px;
  bottom: calc(var(--xp-taskbar-h) + 6px);
  width: 164px;
  z-index: 9600;
  background: var(--xp-face);
  border: 1px solid var(--xp-border);
  border-radius: 5px 5px 1px 1px;
  box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.45);
  font: 11px Tahoma, sans-serif;
  color: #000;
}

.xp-volume-popup .xp-popup-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
  padding: 0 4px 0 7px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(to right, #0058ee 0%, #2f8cf5 55%, #0058ee 100%);
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 1px #000;
}

.xp-volume-popup .xp-popup-title button {
  width: 16px;
  height: 14px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 2px;
  background: linear-gradient(to bottom, #f0907c, #d7432f);
  color: #fff;
  font: bold 9px/1 Tahoma, sans-serif;
  cursor: pointer;
}

.xp-volume-popup .xp-popup-body {
  padding: 10px 12px 12px;
}

.xp-volume-popup .xp-volume-slider {
  display: flex;
  align-items: center;
  gap: 9px;
}

.xp-volume-popup .xp-volume-slider svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: #4d4d4d;
}

.xp-volume-popup input[type="range"] {
  width: 100%;
  accent-color: #245dda;
  cursor: pointer;
}

.xp-volume-popup .xp-volume-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #d5d2ca;
}

.xp-volume-popup .xp-volume-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.xp-volume-popup input[type="checkbox"] {
  margin: 0;
}

/* Cuando el volumen está abierto, los avisos suben para no taparlo */
body.xp-volume-open #xp-toasts {
  bottom: calc(var(--xp-taskbar-h) + 108px);
}

/* ---------- Menú Inicio ---------- */
.xp-start-menu {
  position: fixed;
  left: 0;
  bottom: var(--xp-taskbar-h);
  width: 392px;
  max-height: min(560px, calc(100dvh - var(--xp-taskbar-h) - 8px));
  display: none;
  flex-direction: column;
  z-index: 9500;
  border: 1px solid #1a47a8;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--xp-face);
  box-shadow: 4px -2px 18px rgba(0, 0, 0, 0.45);
  font-family: Tahoma, sans-serif;
  overflow: hidden;
}

.xp-start-menu.open {
  display: flex;
  animation: xp-start-in 0.14s ease-out;
}

@keyframes xp-start-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.xp-start-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  min-height: 54px;
  background: linear-gradient(to bottom, #1b63d6 0%, #1857c2 45%, #0d3f9d 100%);
  border-bottom: 2px solid #f5a623;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #fff;
}

.xp-start-avatar {
  width: 38px;
  height: 38px;
  border: 2px solid #fff;
  border-radius: 4px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.xp-start-user {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.55);
}

.xp-start-user strong {
  font-size: 15px;
  font-weight: bold;
}

.xp-start-user span {
  font-size: 10px;
  opacity: 0.85;
}

.xp-start-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.xp-start-left {
  width: 58%;
  display: flex;
  flex-direction: column;
  padding: 5px;
  background: #fff;
  border-right: 1px solid #a8bdd6;
  overflow-y: auto;
}

.xp-start-right {
  width: 42%;
  display: flex;
  flex-direction: column;
  padding: 5px;
  background: linear-gradient(to right, #d3e5fa 0%, #c4dcf8 100%);
  overflow-y: auto;
}

.xp-start-item,
.xp-start-right button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--xp-text);
  font: 11px Tahoma, sans-serif;
  text-align: left;
  cursor: pointer;
}

.xp-start-item img,
.xp-start-right button img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

.xp-start-right button img {
  width: 18px;
  height: 18px;
}

.xp-start-item span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.xp-start-item b {
  font-size: 11px;
  font-weight: bold;
  color: #1e395b;
}

.xp-start-item small {
  font-size: 9px;
  color: #6b7f96;
}

.xp-start-item:hover,
.xp-start-item:focus-visible,
.xp-start-right button:hover,
.xp-start-right button:focus-visible {
  background: var(--xp-selection);
  border-color: #245edb;
  color: #fff;
  outline: none;
}

.xp-start-item:hover b,
.xp-start-item:hover small,
.xp-start-item:focus-visible b,
.xp-start-item:focus-visible small {
  color: #fff;
}

.xp-start-right button {
  padding: 4px 5px;
  font-weight: bold;
  color: #0a246a;
}

.xp-start-right hr {
  width: 100%;
  margin: 5px 0;
  border: 0;
  border-top: 1px solid #a8bdd6;
}

.xp-all-programs {
  border-top: 1px solid #cfd8e3 !important;
  margin-top: 6px;
  font-weight: bold;
}

.xp-all-programs .xp-arrow {
  margin-left: auto;
  color: #1e395b;
  font-size: 12px;
  transition: transform 0.15s ease;
}

.xp-all-programs.expanded .xp-arrow {
  transform: rotate(90deg);
}

.xp-programs {
  display: flex;
  flex-direction: column;
  padding-left: 8px;
  border-left: 2px solid #d7e2f0;
  margin-left: 8px;
}

.xp-programs[hidden] {
  display: none;
}

.xp-programs .xp-start-item img {
  width: 18px;
  height: 18px;
}

.xp-programs .xp-start-item {
  padding: 3px 6px;
  font-size: 10px;
}

.xp-programs .xp-start-item b {
  font-size: 10px;
}

.xp-start-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 6px 10px;
  background: linear-gradient(to bottom, #1b63d6 0%, #134aa9 100%);
  border-top: 1px solid #4a80e4;
}

.xp-start-footer button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font: 11px Tahoma, sans-serif;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.xp-start-footer button:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
}

.xp-start-footer img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

#startButton[aria-expanded="true"] {
  filter: brightness(0.88);
}

/* ---------- Diálogos XP ---------- */
.xp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
  animation: xp-fade-in 0.12s ease-out;
}

@keyframes xp-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.xp-modal {
  width: min(420px, calc(100vw - 20px));
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--xp-face);
  border: 1px solid var(--xp-border);
  border-radius: 7px 7px 3px 3px;
  box-shadow: 5px 5px 22px rgba(0, 0, 0, 0.55);
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  color: #000;
  overflow: hidden;
  animation: xp-dialog-in 0.14s ease-out;
}

@keyframes xp-dialog-in {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.xp-modal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 27px;
  padding: 4px 5px 4px 8px;
  background: linear-gradient(to bottom, #0058ee 0%, #3593ff 8%, #288efb 20%, #1978e5 55%, #0050d0 100%);
  border-radius: 5px 5px 0 0;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  text-shadow: 1px 1px 1px #000;
}

.xp-modal-close {
  width: 21px;
  height: 21px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 3px;
  background: linear-gradient(to bottom, #f28b7d, #d7432f 55%, #b52e1e);
  color: #fff;
  font: bold 12px/1 Tahoma, sans-serif;
  cursor: pointer;
}

.xp-modal-close:hover {
  filter: brightness(1.12);
}

.xp-modal-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 18px 12px;
  overflow-y: auto;
}

.xp-modal-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
  margin-top: 2px;
}

.xp-modal-message {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
}

.xp-modal-input {
  width: 100%;
  margin-top: 12px;
  padding: 4px 6px;
  border: 1px solid #7f9db9;
  font: 12px Tahoma, sans-serif;
  box-sizing: border-box;
}

.xp-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid #d3d0c3;
  background: linear-gradient(to bottom, #f7f5ec, #ece9d8);
}

.xp-btn {
  min-width: 82px;
  padding: 4px 14px;
  border: 1px solid #003c74;
  border-radius: 3px;
  background: linear-gradient(to bottom, #fff 0%, #f3f3f3 45%, #e5e5e5 55%, #dcdcdc 100%);
  box-shadow: inset 0 0 0 1px #fff;
  color: #000;
  font: 11px Tahoma, sans-serif;
  cursor: pointer;
}

.xp-btn:hover {
  border-color: #2f71cd;
  box-shadow: inset 0 0 0 1px #fff, 0 0 4px rgba(47, 113, 205, 0.55);
}

.xp-btn:active {
  background: #dcdcdc;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.25);
}

.xp-btn.xp-btn-primary {
  border-color: #2f5c9e;
  box-shadow: inset 0 0 0 1px #fff, 0 0 0 1px #6fa4e8;
}

/* ---------- Menú contextual ---------- */
.xp-context-menu {
  position: fixed;
  min-width: 198px;
  z-index: 9600;
  padding: 2px;
  border: 1px solid #aca899;
  background: #fff;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.35);
  font: 11px Tahoma, sans-serif;
  color: #000;
  animation: xp-fade-in 0.08s ease-out;
}

.xp-context-menu button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 4px 22px 4px 6px;
  border: none;
  background: transparent;
  color: #000;
  font: 11px Tahoma, sans-serif;
  text-align: left;
  cursor: pointer;
}

.xp-context-menu button:hover:not(:disabled) {
  background: var(--xp-selection);
  color: #fff;
}

.xp-context-menu button:disabled {
  color: #9a9a9a;
  cursor: default;
}

.xp-context-menu img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.xp-context-menu .xp-sep {
  height: 1px;
  margin: 3px 2px;
  background: #d7d7d7;
}

/* ---------- Toasts / globos ---------- */
#xp-toasts {
  position: fixed;
  right: 12px;
  bottom: calc(var(--xp-taskbar-h) + 10px);
  z-index: 9400;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  transition: bottom 0.18s ease;
}

.xp-toast {
  width: 300px;
  max-width: calc(100vw - 24px);
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #000;
  border-radius: 2px;
  background: #ffffe1;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.35);
  font: 11px Tahoma, sans-serif;
  color: #000;
  pointer-events: auto;
  animation: xp-toast-in 0.22s ease-out;
}

@keyframes xp-toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.xp-toast-icon {
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.xp-toast-content {
  flex: 1;
  min-width: 0;
}

.xp-toast-title {
  font-weight: bold;
  margin-bottom: 2px;
}

.xp-toast-body {
  line-height: 1.4;
  color: #333;
}

.xp-toast-close {
  align-self: flex-start;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: #666;
  font: bold 12px/1 Tahoma, sans-serif;
  cursor: pointer;
}

.xp-toast-close:hover {
  color: #000;
}

/* ---------- Wallpapers ---------- */
.xp-wall-bliss {
  background-color: #3a6ea5 !important;
  background-image: url("bliss.jpg"), linear-gradient(180deg, #4a90e2 0%, #7ec8f0 55%, #4c8c3a 100%) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.xp-wall-azul {
  background-color: #245dda !important;
  background-image:
    radial-gradient(circle at 50% 120%, rgba(120, 210, 255, 0.55) 0%, transparent 55%),
    linear-gradient(180deg, #1b4fbf 0%, #2d74e0 48%, #0f2f7a 100%) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.xp-wall-atardecer {
  background-color: #2b1a4a !important;
  background-image:
    radial-gradient(circle at 74% 34%, #fff2b8 0 6.5%, rgba(255, 220, 120, 0.45) 7%, transparent 13%),
    radial-gradient(ellipse at 20% 100%, #1f3d2b 0 32%, transparent 33%),
    radial-gradient(ellipse at 85% 100%, #142c20 0 38%, transparent 39%),
    linear-gradient(180deg, #ff9a5a 0%, #ff6b6b 32%, #9d4e8f 62%, #2b1a4a 100%) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.xp-wall-matrix {
  background-color: #020a03 !important;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 255, 70, 0.09) 0 2px, transparent 2px 5px),
    radial-gradient(circle at 50% 40%, rgba(0, 255, 70, 0.16) 0%, transparent 60%),
    linear-gradient(180deg, #000 0%, #021208 100%) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.xp-wall-negro {
  background-color: #000 !important;
  background-image: radial-gradient(circle at 50% 40%, #111 0%, #000 70%) !important;
  background-size: cover !important;
}

body.xp-wall-bliss,
body.xp-wall-azul,
body.xp-wall-atardecer,
body.xp-wall-matrix,
body.xp-wall-negro {
  background-attachment: fixed !important;
}

/* ---------- Propiedades de pantalla ---------- */
.xp-display-modal {
  width: min(520px, calc(100vw - 20px));
}

.xp-display-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 10px 0;
  background: var(--xp-face);
  border-bottom: 1px solid #919b9c;
}

.xp-display-tab {
  padding: 4px 10px;
  border: 1px solid #919b9c;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  background: #f1efe2;
  color: #555;
  font: 11px Tahoma, sans-serif;
  cursor: default;
}

.xp-display-tab.active {
  position: relative;
  top: 1px;
  background: var(--xp-face);
  color: #000;
  font-weight: bold;
}

.xp-display-body {
  display: flex;
  gap: 16px;
  padding: 14px;
  background: var(--xp-face);
}

.xp-monitor {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.xp-monitor-screen {
  width: 178px;
  height: 118px;
  border: 8px solid #d6d2c2;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px #8a877a, 0 2px 4px rgba(0, 0, 0, 0.25);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.xp-monitor-stand {
  width: 58px;
  height: 14px;
  background: linear-gradient(to bottom, #e8e4d4, #b9b4a4);
  border: 1px solid #8a877a;
  border-top: none;
  border-radius: 0 0 4px 4px;
}

.xp-monitor-base {
  width: 96px;
  height: 6px;
  background: #b9b4a4;
  border: 1px solid #8a877a;
  border-radius: 3px;
}

.xp-wall-list {
  flex: 1;
  min-width: 0;
}

.xp-wall-list h4 {
  margin: 0 0 8px;
  font: bold 11px Tahoma, sans-serif;
  color: #1e395b;
}

.xp-wall-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.xp-wall-option {
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  font: 10px Tahoma, sans-serif;
  color: #000;
}

.xp-wall-option:hover {
  border-color: #7f9db9;
  background: #f5f8fc;
}

.xp-wall-option.selected {
  border-color: #245dda;
  background: #dbe8fb;
  box-shadow: inset 0 0 0 1px #fff;
}

.xp-wall-thumb {
  height: 46px;
  border: 1px solid #7f9db9;
  margin-bottom: 3px;
  background-size: cover;
  background-position: center;
}

/* ---------- Pantallas de apagado ---------- */
.xp-shutdown-screen {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background: #000;
  color: #ff9a00;
  font: bold 20px Tahoma, sans-serif;
  text-align: center;
}

.xp-shutdown-screen.xp-shutdown-blue {
  background: linear-gradient(180deg, #0b3f8f 0%, #0a2f6b 100%);
  color: #fff;
}

.xp-shutdown-screen p {
  margin: 0;
  max-width: 520px;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.6;
  color: #d8d8d8;
}

.xp-shutdown-screen button {
  padding: 6px 18px;
  border: 1px solid #fff;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: 12px Tahoma, sans-serif;
  cursor: pointer;
}

.xp-shutdown-screen button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.xp-shutdown-screen a {
  color: #9fc7ff;
  font-size: 12px;
}

.xp-suspend-screen {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  font: 16px Tahoma, sans-serif;
  text-align: center;
  cursor: pointer;
}

/* ---------- Logros ---------- */
.xp-achievements-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.xp-achievement {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #cfd8e3;
  border-radius: 3px;
  background: #fff;
}

.xp-achievement.locked {
  opacity: 0.48;
  filter: grayscale(1);
}

.xp-achievement-icon {
  font-size: 20px;
}

.xp-achievement strong {
  display: block;
  font-size: 11px;
  color: #1e395b;
}

.xp-achievement span {
  font-size: 10px;
  color: #666;
}

/* ---------- Ajustes responsive ---------- */
@media (max-width: 900px) {
  .xp-task-btn {
    max-width: 130px;
    flex-basis: 120px;
  }
}

@media (max-width: 760px) {
  :root {
    --xp-taskbar-h: 36px;
  }

  #desktop {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 2px;
    padding: 6px 4px 42px;
    overflow-y: auto;
  }

  .desktop-column {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
  }

  .desktop-icon,
  .folder-icon {
    width: 74px;
    padding: 4px;
  }

  .desktop-icon img,
  .folder-icon img {
    width: 40px;
    height: 40px;
    margin-bottom: 3px;
  }

  .icon-text {
    font-size: 11px;
    line-height: 1.15;
  }

  #desktop-logo {
    max-width: 70%;
    max-height: 45%;
    opacity: 0.32;
  }

  /* Las apps ocupan la pantalla, como en un XP de bolsillo */
  .window-container:not(.maximized) {
    width: calc(100vw - 8px) !important;
    height: calc(100dvh - var(--xp-taskbar-h) - 12px) !important;
    left: 4px !important;
    top: 4px !important;
  }

  #window-mipc.window-container {
    height: auto !important;
    max-height: calc(100dvh - var(--xp-taskbar-h) - 12px) !important;
  }

  .window-container.maximized {
    width: 100vw !important;
    height: calc(100dvh - var(--xp-taskbar-h)) !important;
  }

  #dialup-window {
    width: calc(100vw - 20px);
  }

  .title-bar {
    height: 28px;
  }

  .title-bar-controls button {
    width: 23px;
    height: 23px;
  }

  .start-button {
    font-size: 13px;
    padding: 0 11px 0 8px;
  }

  .start-button img {
    height: 18px;
  }

  #xp-task-buttons {
    padding: 0 3px;
    gap: 2px;
  }

  .xp-task-btn {
    min-width: 34px;
    max-width: 48px;
    flex-basis: 38px;
    padding: 0 4px;
    font-size: 10px;
  }

  .xp-task-btn img {
    width: 16px;
    height: 16px;
  }

  .xp-task-btn span {
    display: none !important;
  }

  .xp-tray {
    padding: 0 2px;
  }

  .xp-tray-btn:not(.xp-tray-essential) {
    display: none;
  }

  .tray-clock {
    padding: 0 7px;
    font-size: 11px;
  }

  .xp-start-menu {
    width: calc(100vw - 8px);
    left: 4px;
    max-height: calc(100dvh - var(--xp-taskbar-h) - 6px);
  }

  .xp-start-left {
    width: 56%;
  }

  .xp-start-right {
    width: 44%;
  }

  .xp-start-item img {
    width: 22px;
    height: 22px;
  }

  .msn-sidebar {
    display: none !important;
  }

  #window-icq {
    max-width: 100vw;
  }

  .msn-toolbar {
    gap: 4px;
    padding: 3px 5px;
  }

  .msn-btn {
    font-size: 8px;
  }

  #messageInput {
    height: 34px;
  }

  .paint-toolbar {
    width: 40px;
  }

  .paint-tool {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  #paint-canvas {
    max-width: none;
  }

  /* El solitario entra escalado; los clics siguen funcionando */
  #solitaire-board {
    transform: scale(0.62);
    transform-origin: top left;
    width: 161%;
    height: 161%;
  }

  .msn-actions {
    flex-wrap: wrap;
  }

  .xp-display-body {
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
  }

  .xp-monitor {
    flex: 0 0 auto;
  }

  .xp-wall-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .xp-display-tabs {
    overflow-x: auto;
  }

  .xp-display-tab {
    white-space: nowrap;
  }

  #xp-toasts {
    left: 8px;
    right: 8px;
    align-items: center;
  }

  .xp-toast {
    width: 100%;
    max-width: 420px;
  }
}

@media (max-width: 430px) {
  .xp-wall-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #solitaire-board {
    transform: scale(0.5);
    width: 200%;
    height: 200%;
  }

  .xp-start-user span {
    display: none;
  }

  .xp-start-header {
    min-height: 46px;
  }

  .xp-start-avatar {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #time-travel-layer {
    display: none !important;
  }
}
