/* Windows XP replica — all visuals are drawn with CSS, SVG and canvas. */
:root {
  --xp-font: Tahoma, "Lucida Grande", Verdana, Arial, sans-serif;
  --xp-title-1: #3f7ee8;
  --xp-title-2: #245edb;
  --xp-title-3: #0a2a8f;
  --xp-window-border: #0054e3;
  --xp-face: #ece9d8;
  --xp-face-dark: #d4d0c8;
  --xp-face-light: #ffffff;
  --xp-text: #1a1a1a;
  --xp-start-1: #67b747;
  --xp-start-2: #3c9e2d;
  --xp-start-3: #26771c;
  --xp-taskbar-top: #3f7ee8;
  --xp-taskbar-bottom: #1b3f8b;
  --xp-orange-1: #ffc26b;
  --xp-orange-2: #f29b2c;
  --xp-orange-3: #d97a14;
  --xp-selection: #316ac5;
  --xp-taskbar-h: 40px;
  --xp-share-offset: 0px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: #174f9e; color: var(--xp-text); font-family: var(--xp-font); font-size: 12px; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: default; }
[hidden] { display: none !important; }

.xp-os { position: fixed; inset: 0; overflow: hidden; isolation: isolate; }
.xp-wallpaper { position: absolute; inset: 0 0 var(--xp-taskbar-h) 0; width: 100%; height: calc(100% - var(--xp-taskbar-h)); display: block; z-index: 0; }
.xp-desktop { position: absolute; inset: 0 0 var(--xp-taskbar-h) 0; z-index: 1; }
.xp-window-layer, .xp-menu-layer, .xp-balloon-layer, .xp-dialog-layer { position: absolute; inset: 0 0 var(--xp-taskbar-h) 0; pointer-events: none; z-index: 20; }
.xp-menu-layer { z-index: 70; }
.xp-balloon-layer { z-index: 80; }
.xp-dialog-layer { z-index: 90; }
.xp-window-layer > *, .xp-menu-layer > *, .xp-balloon-layer > *, .xp-dialog-layer > * { pointer-events: auto; }

/* Desktop icons */
.xp-desktop-icon {
  position: absolute; width: 78px; min-height: 84px; padding: 5px 3px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center; color: #fff; user-select: none; cursor: default;
  text-shadow: 1px 1px 2px rgba(0,0,0,.85), 0 0 3px rgba(0,0,0,.5);
  border: 1px solid transparent; border-radius: 2px;
}
.xp-desktop-icon .xp-icon-art { width: 40px; height: 40px; filter: drop-shadow(1px 2px 2px rgba(0,0,0,.45)); }
.xp-desktop-icon .xp-icon-label { font-size: 11px; line-height: 1.18; padding: 1px 2px; word-wrap: break-word; max-width: 74px; }
.xp-desktop-icon.selected { border-color: rgba(49,106,197,.9); background: rgba(49,106,197,.55); outline: 1px dotted rgba(255,255,255,.65); outline-offset: -4px; }
.xp-desktop-icon.selected .xp-icon-label { background: #1249a0; text-shadow: none; }
.xp-desktop-icon.renaming .xp-icon-label { background: #fff; color: #000; text-shadow: none; padding: 0; border: 1px solid #0054e3; }
.xp-icon-label-input { width: 72px; font-size: 11px; border: 1px solid #0054e3; padding: 0; text-align: center; }
.xp-marquee { position: absolute; border: 1px dotted #fff; background: rgba(49,106,197,.35); z-index: 5; pointer-events: none; }

/* Window chrome */
.xp-window {
  position: absolute; min-width: 260px; min-height: 160px; display: flex; flex-direction: column;
  background: var(--xp-face); border: 1px solid var(--xp-window-border); border-radius: 8px 8px 3px 3px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.35) inset;
  overflow: hidden; transform-origin: bottom center;
}
.xp-window.inactive { box-shadow: 0 8px 22px rgba(0,0,0,.28); border-color: #7a8ba8; }
.xp-window.inactive .xp-titlebar { background: linear-gradient(180deg,#b6c4d8 0%,#8d9db5 18%,#7486a3 100%); }
.xp-window.inactive .xp-title-text { color: #e8edf5; }
.xp-window.maximized { border-radius: 0; }
.xp-window.minimizing { transform: translateY(28vh) scale(.12); opacity: 0; transition: transform .22s ease-in, opacity .22s ease-in; }
.xp-window.restoring { transition: transform .2s cubic-bezier(.2,.8,.3,1), opacity .2s ease-out; }
.xp-titlebar {
  height: 29px; flex: 0 0 29px; display: flex; align-items: center; gap: 5px; padding: 0 4px 0 6px;
  border-radius: 7px 7px 0 0; color: #fff;
  background: linear-gradient(180deg,var(--xp-title-1) 0%,var(--xp-title-2) 18%,#1645ac 48%,var(--xp-title-3) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -1px 0 rgba(0,0,0,.25);
  user-select: none; touch-action: none;
}
.xp-titlebar .xp-title-icon { width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 18px; }
.xp-titlebar .xp-title-icon svg { width: 16px; height: 16px; }
.xp-title-text { font-weight: 700; font-size: 12px; text-shadow: 1px 1px 1px rgba(0,0,0,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.xp-title-buttons { display: flex; gap: 2px; flex: 0 0 auto; }
.xp-title-button {
  width: 21px; height: 21px; border-radius: 4px; border: 1px solid rgba(0,0,0,.45);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.55), inset -1px -1px 0 rgba(0,0,0,.18);
  position: relative; background: linear-gradient(180deg,#5d96f2,#2d62cb 45%,#1c4aa6);
}
.xp-title-button.close { background: linear-gradient(180deg,#f37b6d,#d33b2e 45%,#a7271d); }
.xp-title-button.maximize { background: linear-gradient(180deg,#5d96f2,#2d62cb 45%,#1c4aa6); }
.xp-title-button::after { content: ""; position: absolute; inset: 0; }
.xp-title-button.minimize::after { width: 8px; height: 2px; background: #fff; top: 9px; left: 6px; box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.xp-title-button.maximize::after { width: 9px; height: 8px; border: 2px solid #fff; border-top-width: 3px; top: 4px; left: 4px; }
.xp-window.maximized .xp-title-button.maximize::after { width: 8px; height: 6px; border-width: 2px; top: 6px; left: 4px; box-shadow: 3px -3px 0 -1px #fff; }
.xp-title-button.close::after { width: 10px; height: 2px; background: #fff; top: 9px; left: 5px; transform: rotate(45deg); box-shadow: 0 0 0 0 #fff; }
.xp-title-button.close::before { content: ""; position: absolute; width: 10px; height: 2px; background: #fff; top: 9px; left: 5px; transform: rotate(-45deg); z-index: 1; }
.xp-title-button:hover { filter: brightness(1.15); }
.xp-title-button:active { filter: brightness(.9); }
.xp-window-body { flex: 1; min-height: 0; overflow: hidden; position: relative; background: #fff; }
.xp-window.inactive .xp-window-body { filter: saturate(.96); }
.xp-statusbar { flex: 0 0 22px; display: flex; gap: 2px; padding: 2px; background: var(--xp-face); border-top: 1px solid #fff; }
.xp-statusbar span { border: 1px solid #a5a395; border-top-color: #808078; box-shadow: inset 1px 1px 0 #fff; padding: 2px 5px; font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-statusbar span.grow { flex: 1; }
.xp-resize { position: absolute; z-index: 5; }
.xp-resize.n { top: -3px; left: 8px; right: 8px; height: 7px; cursor: ns-resize; }
.xp-resize.s { bottom: -3px; left: 8px; right: 8px; height: 7px; cursor: ns-resize; }
.xp-resize.e { right: -3px; top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.xp-resize.w { left: -3px; top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.xp-resize.ne { right: -3px; top: -3px; width: 12px; height: 12px; cursor: nesw-resize; }
.xp-resize.nw { left: -3px; top: -3px; width: 12px; height: 12px; cursor: nwse-resize; }
.xp-resize.se { right: -3px; bottom: -3px; width: 14px; height: 14px; cursor: nwse-resize; }
.xp-resize.sw { left: -3px; bottom: -3px; width: 12px; height: 12px; cursor: nesw-resize; }
.xp-window.maximized .xp-resize { display: none; }

/* Menu bars and popup menus */
.xp-menubar { flex: 0 0 auto; height: 24px; display: flex; align-items: stretch; background: var(--xp-face); border-bottom: 1px solid #d4d0c8; padding-left: 3px; user-select: none; }
.xp-menubar button { border: 0; background: transparent; padding: 0 9px; font-size: 12px; }
.xp-menubar button:hover, .xp-menubar button.open { background: #316ac5; color: #fff; }
.xp-menu {
  position: absolute; min-width: 178px; background: #fff; border: 1px solid #7a7a6e;
  box-shadow: 2px 3px 7px rgba(0,0,0,.35); padding: 3px 2px; z-index: 100;
}
.xp-menu-item { display: flex; align-items: center; gap: 8px; min-height: 22px; padding: 3px 10px 3px 8px; white-space: nowrap; cursor: default; }
.xp-menu-item:hover:not(.disabled) { background: #316ac5; color: #fff; }
.xp-menu-item.disabled { color: #9a9a9a; }
.xp-menu-item .xp-menu-check { width: 14px; flex: 0 0 14px; font-weight: 700; }
.xp-menu-item .xp-menu-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.xp-menu-item .xp-menu-label { flex: 1; }
.xp-menu-item .xp-menu-key { color: #777; margin-left: 20px; }
.xp-menu-item:hover .xp-menu-key { color: #e8e8e8; }
.xp-menu-separator { height: 1px; background: #d4d0c8; border-bottom: 1px solid #fff; margin: 3px 4px; }

/* Taskbar */
.xp-taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--xp-taskbar-h); z-index: 60;
  display: flex; align-items: center; gap: 4px; padding: 3px 4px 3px 3px;
  background: linear-gradient(180deg,var(--xp-taskbar-top) 0%,#2f66d4 22%,#2459bb 50%,var(--xp-taskbar-bottom) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 -2px 8px rgba(0,0,0,.25);
  user-select: none;
}
.xp-start-button {
  height: 34px; min-width: 92px; display: flex; align-items: center; gap: 6px; padding: 0 13px 0 9px;
  border: 1px solid #2a6d1e; border-radius: 0 13px 13px 0; color: #fff;
  background: linear-gradient(180deg,var(--xp-start-1) 0%,var(--xp-start-2) 35%,#2c8b21 62%,var(--xp-start-3) 100%);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.45), inset -1px -1px 0 rgba(0,0,0,.22), 1px 1px 3px rgba(0,0,0,.25);
  font-size: 16px; font-weight: 700; font-style: italic; text-shadow: 1px 1px 1px rgba(0,0,0,.45);
}
.xp-start-button.active, .xp-start-button:active { filter: brightness(.9); }
.xp-start-flag { width: 22px; height: 20px; display: block; background:
  linear-gradient(135deg,#ff3b30 0 46%,transparent 46%) 0 0/12px 10px no-repeat,
  linear-gradient(45deg,#39b54a 0 46%,transparent 46%) 12px 0/12px 10px no-repeat,
  linear-gradient(45deg,#2f7ddd 0 46%,transparent 46%) 0 10px/12px 10px no-repeat,
  linear-gradient(135deg,#ffd23f 0 46%,transparent 46%) 12px 10px/12px 10px no-repeat;
  transform: skewY(-7deg) rotate(-3deg); filter: drop-shadow(1px 1px 0 rgba(0,0,0,.35));
}
.xp-taskbar-divider { width: 3px; height: 28px; border-left: 1px solid #1a3f88; border-right: 1px solid #6c99e8; margin: 0 1px; }
.xp-task-buttons { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; overflow: hidden; }
.xp-taskbutton {
  height: 30px; max-width: 165px; min-width: 74px; flex: 0 1 160px; display: flex; align-items: center; gap: 5px;
  padding: 0 8px; border: 1px solid #14418f; border-radius: 3px; color: #fff; overflow: hidden;
  background: linear-gradient(180deg,#4d84e6,#2c5fc4 48%,#1c469c); box-shadow: inset 1px 1px 0 rgba(255,255,255,.4);
  text-align: left; font-size: 11px; text-shadow: 1px 1px 1px rgba(0,0,0,.35);
}
.xp-taskbutton.inactive { background: linear-gradient(180deg,#356cc9,#2455ac 48%,#17428f); }
.xp-taskbutton.active { background: linear-gradient(180deg,#2b5cb8,#3d78dd 48%,#2456b0); box-shadow: inset 1px 1px 3px rgba(0,0,0,.35); font-weight: 700; }
.xp-taskbutton svg { width: 16px; height: 16px; flex: 0 0 16px; }
.xp-taskbutton span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-taskbutton.grouped { font-weight: 700; }
.xp-tray {
  min-width: 136px; height: 32px; margin-left: auto; padding: 0 7px; display: flex; align-items: center; gap: 7px;
  border: 1px solid #1b448f; border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg,#56a6ff,#3d8ae6 40%,#2c70c8); box-shadow: inset 1px 1px 0 rgba(255,255,255,.45);
}
.xp-tray-icon { width: 16px; height: 16px; display: block; flex: 0 0 16px; background-repeat: no-repeat; background-size: contain; }
.xp-tray-volume { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M2 6h3l4-3v10L5 10H2z'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='1.4' d='M11 5c2 2 2 4 0 6M13 3c3 3 3 7 0 10'/%3E%3C/svg%3E"); }
.xp-tray-network { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M2 11h3v3H2zm4-3h3v6H6zm4-4h3v10h-3z'/%3E%3C/svg%3E"); }
.xp-tray-alert { border: 0; padding: 0; background-color: transparent; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M8 1a5 5 0 0 0-5 5v4l-2 3h14l-2-3V6a5 5 0 0 0-5-5zm-2 13h4a2 2 0 0 1-4 0z'/%3E%3C/svg%3E"); }
.xp-clock { color: #fff; font-size: 11px; text-shadow: 1px 1px 1px rgba(0,0,0,.35); margin-left: 1px; white-space: nowrap; }

/* Start menu */
.xp-start-menu {
  position: absolute; left: 0; bottom: var(--xp-taskbar-h); width: 390px; z-index: 75;
  background: #fff; border: 1px solid #1a4698; border-bottom: 0; border-radius: 7px 7px 0 0; overflow: hidden;
  box-shadow: 3px -4px 12px rgba(0,0,0,.35); transform-origin: bottom left;
}
.xp-start-menu.opening { animation: xp-start-open .16s ease-out; }
@keyframes xp-start-open { from { transform: scale(.94); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.xp-start-banner {
  height: 60px; display: flex; align-items: center; gap: 9px; padding: 6px 10px;
  background: linear-gradient(180deg,#3f7ee8,#1b4bb4 45%,#0e3189); color: #fff;
  border-bottom: 2px solid #ff9d2e; text-shadow: 1px 1px 1px rgba(0,0,0,.4);
}
.xp-start-banner .xp-user-avatar { width: 42px; height: 42px; flex: 0 0 42px; }
.xp-start-banner b { font-size: 15px; }
.xp-start-banner small { font-size: 11px; opacity: .9; }
.xp-start-columns { display: grid; grid-template-columns: 1fr 1fr; min-height: 245px; }
.xp-start-left { background: #fff; padding: 6px 0; border-right: 1px solid #d4d0c8; }
.xp-start-right { background: #d3e5fa; padding: 6px 0; }
.xp-start-item { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 9px 4px 11px; font-size: 12px; cursor: default; }
.xp-start-item:hover { background: #316ac5; color: #fff; }
.xp-start-item svg { width: 24px; height: 24px; flex: 0 0 24px; }
.xp-start-item b { font-size: 12px; }
.xp-start-item.right-item { font-weight: 700; }
.xp-start-separator { height: 1px; margin: 4px 7px; background: #d4d0c8; }
.xp-start-footer {
  height: 38px; display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 0 10px;
  background: linear-gradient(180deg,var(--xp-orange-1),var(--xp-orange-2) 50%,var(--xp-orange-3)); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.xp-start-footer button { border: 0; background: transparent; color: #fff; font-weight: 700; font-size: 11px; padding: 5px 7px; text-shadow: 1px 1px 1px rgba(0,0,0,.3); }
.xp-start-footer button:hover { text-decoration: underline; }
.xp-start-footer svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; }

/* Balloons */
.xp-balloon {
  position: absolute; bottom: 10px; right: 12px; width: 270px; min-height: 82px; padding: 11px 13px 12px 14px;
  background: #fffbe1; border: 1px solid #e8c95b; border-radius: 9px;
  box-shadow: 2px 3px 10px rgba(0,0,0,.35); animation: xp-balloon-in .24s ease-out;
}
.xp-balloon::after { content: ""; position: absolute; right: 26px; bottom: -10px; border-width: 10px 0 0 12px; border-style: solid; border-color: #fffbe1 transparent transparent transparent; }
.xp-balloon h4 { margin: 0 0 4px; font-size: 12px; color: #1545a0; }
.xp-balloon p { margin: 0; font-size: 11px; line-height: 1.35; }
.xp-balloon button { position: absolute; top: 5px; right: 6px; width: 17px; height: 17px; border: 1px solid #b6a76a; background: #fff8d6; line-height: 13px; font-size: 11px; }
@keyframes xp-balloon-in { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Dialogs */
.xp-dialog { position: absolute; min-width: 320px; max-width: 460px; padding: 16px 16px 13px; background: var(--xp-face); border: 1px solid var(--xp-window-border); border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.xp-dialog-body { display: flex; gap: 14px; align-items: flex-start; min-height: 52px; }
.xp-dialog-icon { width: 36px; height: 36px; flex: 0 0 36px; }
.xp-dialog-icon svg { width: 36px; height: 36px; }
.xp-dialog-text { font-size: 12px; line-height: 1.45; padding-top: 2px; white-space: pre-line; }
.xp-dialog-text b { display: block; margin-bottom: 5px; font-size: 13px; }
.xp-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.xp-button {
  min-width: 76px; height: 25px; padding: 0 11px; border: 1px solid #707070; border-radius: 3px;
  background: linear-gradient(180deg,#fff,#f0efe8 45%,#dedbd0); box-shadow: inset 1px 1px 0 #fff, 0 1px 1px rgba(0,0,0,.15); font-size: 12px;
}
.xp-button:hover { border-color: #245edb; background: linear-gradient(180deg,#fff,#e8f0ff 45%,#d6e4ff); }
.xp-button:active { box-shadow: inset 1px 1px 2px rgba(0,0,0,.2); }
.xp-button.primary { border-color: #2359b8; background: linear-gradient(180deg,#eaf2ff,#c7dcff 45%,#a9c6f8); }

/* Shared form controls */
.xp-input, .xp-select, .xp-textarea {
  border: 1px solid #7f9db9; background: #fff; padding: 3px 5px; font-size: 12px; outline: 0;
}
.xp-input:focus, .xp-textarea:focus { border-color: #245edb; box-shadow: 0 0 0 1px #245edb; }
.xp-field-row { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.xp-field-row label { min-width: 68px; }
.xp-check { display: inline-flex; align-items: center; gap: 6px; }
.xp-toolbar { flex: 0 0 auto; height: 34px; display: flex; align-items: center; gap: 5px; padding: 3px 5px; background: linear-gradient(180deg,#fff,#ebe9df); border-bottom: 1px solid #d4d0c8; }
.xp-toolbar button { height: 26px; min-width: 26px; padding: 0 6px; border: 1px solid transparent; background: transparent; display: inline-flex; align-items: center; gap: 5px; }
.xp-toolbar button:hover { border-color: #a5a395; background: linear-gradient(180deg,#fff,#e1dfd5); }
.xp-toolbar button:active { background: #d4d0c8; }
.xp-toolbar .xp-separator { width: 1px; height: 22px; background: #c4c1b5; margin: 0 3px; }
.xp-app-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* Notepad */
.xp-notepad textarea { flex: 1; width: 100%; resize: none; border: 1px solid #7f9db9; background: #fff; padding: 4px 6px; font: 12px/1.45 "Lucida Console", Consolas, monospace; outline: 0; }
.xp-notepad .xp-notepad-wrap { flex: 1; min-height: 0; display: flex; padding: 2px; background: #f4f3ec; }

/* Paint */
.xp-paint-main { flex: 1; min-height: 0; display: flex; }
.xp-paint-tools { width: 58px; flex: 0 0 58px; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 28px; gap: 2px; padding: 5px; background: var(--xp-face); border-right: 1px solid #d4d0c8; }
.xp-paint-tools button { border: 1px solid transparent; background: transparent; font-size: 15px; }
.xp-paint-tools button:hover { border-color: #a5a395; background: #fff; }
.xp-paint-tools button.active { border-color: #245edb; background: #dbe7ff; }
.xp-paint-canvas-wrap { flex: 1; min-width: 0; overflow: auto; padding: 8px; background: #808080; display: grid; place-items: center; }
.xp-paint-canvas { background: #fff; border: 1px solid #444; box-shadow: 1px 1px 4px rgba(0,0,0,.4); cursor: crosshair; touch-action: none; }
.xp-paint-palette { flex: 0 0 62px; padding: 6px 5px; background: var(--xp-face); border-left: 1px solid #d4d0c8; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.xp-paint-swatches { display: grid; grid-template-columns: repeat(2, 22px); gap: 2px; }
.xp-paint-swatch { width: 22px; height: 22px; border: 1px solid #555; padding: 0; }
.xp-paint-swatch.active { outline: 2px solid #fff; outline-offset: -3px; box-shadow: 0 0 0 2px #245edb; }
.xp-paint-current { width: 42px; height: 30px; border: 1px solid #777; background: linear-gradient(135deg,#fff 0 48%,#000 48%); }
.xp-paint-sizes { display: flex; gap: 3px; align-items: center; }

/* Minesweeper */
.xp-mines { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; background: var(--xp-face); padding: 10px; }
.xp-mines-panel { border: 3px solid; border-top-color: #fff; border-left-color: #fff; border-right-color: #808078; border-bottom-color: #808078; padding: 5px; background: var(--xp-face); }
.xp-mines-hud { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 6px; }
.xp-mines-counter { background: #000; color: #ff2a2a; font: 700 24px/1 "Courier New", monospace; letter-spacing: 1px; padding: 2px 4px; border: 1px solid; border-top-color: #808078; border-left-color: #808078; border-right-color: #fff; border-bottom-color: #fff; min-width: 58px; text-align: center; }
.xp-mines-face { width: 28px; height: 28px; border: 2px solid; border-top-color: #fff; border-left-color: #fff; border-right-color: #808078; border-bottom-color: #808078; background: #ffd23f; font-size: 16px; line-height: 22px; }
.xp-mines-grid { display: grid; gap: 0; border: 3px solid; border-top-color: #808078; border-left-color: #808078; border-right-color: #fff; border-bottom-color: #fff; }
.xp-mine-cell { width: 24px; height: 24px; padding: 0; border: 2px solid; border-top-color: #fff; border-left-color: #fff; border-right-color: #808078; border-bottom-color: #808078; background: var(--xp-face-dark); font: 700 14px/1 Tahoma, sans-serif; display: grid; place-items: center; }
.xp-mine-cell.revealed { border: 1px solid #a5a395; background: #d4d0c8; }
.xp-mine-cell.n1 { color: #0000ff; } .xp-mine-cell.n2 { color: #008000; } .xp-mine-cell.n3 { color: #ff0000; }
.xp-mine-cell.n4 { color: #000080; } .xp-mine-cell.n5 { color: #800000; } .xp-mine-cell.n6 { color: #008080; }
.xp-mine-cell.n7 { color: #000000; } .xp-mine-cell.n8 { color: #808080; }
.xp-mine-cell.boom { background: #ff5b5b; }
.xp-mine-cell.flag { color: #e00; }

/* Explorer / My Computer */
.xp-explorer { display: flex; flex-direction: column; height: 100%; background: #fff; }
.xp-explorer-toolbar { flex: 0 0 auto; }
.xp-address-row { flex: 0 0 27px; display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-bottom: 1px solid #d4d0c8; background: var(--xp-face); }
.xp-address-row .xp-label { font-weight: 700; }
.xp-address { flex: 1; height: 21px; display: flex; align-items: center; border: 1px solid #7f9db9; background: #fff; padding: 0 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.xp-explorer-main { flex: 1; min-height: 0; display: flex; }
.xp-taskpane { width: 160px; flex: 0 0 160px; padding: 8px; background: linear-gradient(180deg,#fff,#d9e9fb); border-right: 1px solid #b6c8df; overflow: auto; }
.xp-taskpane h4 { margin: 0 0 5px; color: #1a4b9a; font-size: 12px; }
.xp-taskpane a { display: flex; align-items: center; gap: 5px; color: #1545a0; text-decoration: none; padding: 3px 0; font-size: 11px; }
.xp-taskpane a:hover { text-decoration: underline; }
.xp-taskpane a svg { width: 20px; height: 20px; flex: 0 0 20px; }
.xp-fileview { flex: 1; min-width: 0; overflow: auto; padding: 8px; background: #fff; user-select: none; }
.xp-fileview.icons { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; }
.xp-fileview.list { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); align-content: start; gap: 2px 8px; }
.xp-file { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border: 1px solid transparent; min-width: 0; cursor: default; }
.xp-file.icons { flex-direction: column; width: 82px; text-align: center; gap: 3px; }
.xp-file svg { width: 32px; height: 32px; flex: 0 0 32px; }
.xp-file .xp-file-name { font-size: 11px; overflow: hidden; text-overflow: ellipsis; max-width: 160px; white-space: nowrap; }
.xp-file.icons .xp-file-name { max-width: 78px; white-space: normal; }
.xp-file.selected { background: #316ac5; color: #fff; border-color: #245edb; }
.xp-file.details { display: grid; grid-template-columns: 32px minmax(120px,1fr) 92px 110px; align-items: center; }
.xp-file-header { display: grid; grid-template-columns: 32px minmax(120px,1fr) 92px 110px; padding: 4px 6px; background: var(--xp-face); border-bottom: 1px solid #d4d0c8; font-weight: 700; }

/* Internet Explorer */
.xp-ie-page { flex: 1; min-height: 0; overflow: auto; background: #fff; padding: 18px 22px; font-family: "Times New Roman", Times, serif; color: #111; }
.xp-ie-page h1 { font-size: 25px; color: #1545a0; margin: 0 0 5px; }
.xp-ie-page h2 { font-size: 17px; color: #1545a0; border-bottom: 1px solid #c8d8ee; padding-bottom: 3px; }
.xp-ie-page a { color: #0000cc; text-decoration: underline; cursor: pointer; }
.xp-ie-hero { background: linear-gradient(120deg,#17459a,#3e83d8); color: #fff; padding: 16px 18px; border: 1px solid #0f347a; margin-bottom: 14px; }
.xp-ie-hero h2 { color: #fff; border: 0; margin: 0 0 5px; }
.xp-ie-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.xp-ie-card { border: 1px solid #c8d8ee; padding: 10px 12px; background: #f7faff; }
.xp-ie-card h3 { margin: 0 0 6px; font-size: 14px; color: #1545a0; }
.xp-ie-banner { height: 58px; border: 1px solid #d0b24a; background: linear-gradient(90deg,#fff7cf,#ffe184); display: flex; align-items: center; justify-content: center; font: 700 17px Arial, sans-serif; color: #a05a00; margin: 12px 0; }

/* Media Player */
.xp-media { display: flex; flex-direction: column; height: 100%; background: linear-gradient(180deg,#eaf2ff,#b8d2f7 60%,#8fb5e8); }
.xp-media-visual { flex: 1; min-height: 130px; margin: 7px; border: 2px solid #16418e; border-radius: 3px; background: radial-gradient(circle at 50% 40%,#173b7a,#061a42 70%); overflow: hidden; }
.xp-media-visual canvas { width: 100%; height: 100%; display: block; }
.xp-media-controls { flex: 0 0 auto; padding: 5px 8px 8px; background: linear-gradient(180deg,#d9e8fc,#8fb5e8); border-top: 1px solid #fff; }
.xp-media-seek { height: 12px; background: #fff; border: 1px solid #7f9db9; margin: 4px 0 7px; overflow: hidden; }
.xp-media-seek i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,#3f7ee8,#0b347f); }
.xp-media-buttons { display: flex; align-items: center; gap: 5px; }
.xp-media-buttons button { width: 32px; height: 27px; border: 1px solid #7f9db9; background: linear-gradient(180deg,#fff,#d9e8fc); }
.xp-media-track { flex: 1; text-align: center; font-weight: 700; color: #123c86; }

/* Display properties */
.xp-tabs { display: flex; gap: 2px; padding: 6px 8px 0; background: var(--xp-face); }
.xp-tab { border: 1px solid #8a8a7d; border-bottom: 0; background: #d4d0c8; padding: 5px 12px; border-radius: 4px 4px 0 0; }
.xp-tab.active { background: #fff; font-weight: 700; }
.xp-tab-panel { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; background: #fff; border-top: 1px solid #8a8a7d; }
.xp-wallpaper-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.xp-wallpaper-choice { border: 2px solid transparent; padding: 3px; background: var(--xp-face); text-align: center; }
.xp-wallpaper-choice.selected { border-color: #245edb; background: #dbe7ff; }
.xp-wallpaper-swatch { height: 58px; border: 1px solid #777; margin-bottom: 4px; }
.xp-wallpaper-swatch.bliss { background: linear-gradient(#63a9ee 0 48%,#74b64c 48% 100%), radial-gradient(circle at 30% 80%,#4d9634,#2e6e24); }
.xp-wallpaper-swatch.blue { background: linear-gradient(#1b5fb8,#7cb4ee); }
.xp-wallpaper-swatch.green { background: linear-gradient(#7ec36a,#2c6b26); }
.xp-wallpaper-swatch.none { background: #3a6ea5; }
.xp-scheme-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.xp-scheme-choice { border: 2px solid transparent; padding: 8px; background: var(--xp-face); }
.xp-scheme-choice.selected { border-color: #245edb; background: #dbe7ff; }
.xp-scheme-bar { height: 20px; border: 1px solid #666; margin-bottom: 5px; }

/* Task manager */
.xp-taskmgr { height: 100%; display: flex; flex-direction: column; background: var(--xp-face); }
.xp-taskmgr-tabs { display: flex; padding: 7px 8px 0; gap: 2px; }
.xp-taskmgr-list { flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid #8a8a7d; margin: 0 8px; }
.xp-taskmgr-row { display: grid; grid-template-columns: 1fr 110px 90px; padding: 5px 8px; border-bottom: 1px solid #e5e5e5; cursor: default; }
.xp-taskmgr-row.selected { background: #316ac5; color: #fff; }
.xp-taskmgr-footer { padding: 8px; display: flex; justify-content: flex-end; gap: 7px; }

/* Boot / login / shutdown */
.xp-boot { position: absolute; inset: 0; z-index: 200; background: #000; color: #fff; display: grid; place-items: center; transition: opacity .35s ease; }
.xp-boot.fade { opacity: 0; pointer-events: none; }
.xp-boot-inner { width: min(420px,86vw); text-align: left; }
.xp-boot-logo { display: flex; align-items: center; gap: 15px; margin-bottom: 34px; }
.xp-boot-flag { width: 58px; height: 48px; display: block; flex: 0 0 58px; background:
  linear-gradient(135deg,#ff3b30 0 46%,transparent 46%) 0 0/30px 24px no-repeat,
  linear-gradient(45deg,#39b54a 0 46%,transparent 46%) 30px 0/30px 24px no-repeat,
  linear-gradient(45deg,#2f7ddd 0 46%,transparent 46%) 0 24px/30px 24px no-repeat,
  linear-gradient(135deg,#ffd23f 0 46%,transparent 46%) 30px 24px/30px 24px no-repeat;
  transform: skewY(-7deg) rotate(-4deg); filter: drop-shadow(2px 3px 2px rgba(0,0,0,.6));
}
.xp-boot-logo-text { display: flex; flex-direction: column; line-height: .95; text-shadow: 2px 2px 4px rgba(0,0,0,.7); }
.xp-boot-logo-text b { font-size: 18px; font-weight: 400; }
.xp-boot-logo-text em { font-size: 38px; font-style: normal; font-weight: 700; }
.xp-boot-logo-text strong { color: #ff8a00; font-size: 38px; font-weight: 700; }
.xp-boot-progress { height: 17px; border: 2px solid #a8a8a8; border-radius: 9px; padding: 2px; background: #161616; overflow: hidden; }
.xp-boot-progress i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg,#0b3b9c,#3f8be8,#9fd0ff); box-shadow: 0 0 8px #3f8be8; transition: width .22s linear; }
.xp-boot-caption { margin: 11px 0 3px; font-size: 12px; color: #ddd; }
.xp-boot-copy { margin: 0; font-size: 10px; color: #888; }
.xp-login { position: absolute; inset: 0 0 var(--xp-taskbar-h) 0; z-index: 190; background: linear-gradient(180deg,#153f93 0%,#2c66c2 55%,#5c9be0 100%); color: #fff; }
.xp-login::before { content: ""; position: absolute; left: 8%; top: 18%; width: 46%; height: 56%; border-radius: 50%; background: radial-gradient(circle,rgba(255,255,255,.16),transparent 70%); }
.xp-login-brand { position: absolute; left: 8%; top: 12%; display: flex; align-items: center; gap: 12px; font-size: 16px; text-shadow: 2px 2px 3px rgba(0,0,0,.5); }
.xp-login-brand b { font-size: 22px; }
.xp-login-panel { position: absolute; left: 8%; top: 38%; width: min(340px,80vw); }
.xp-login-panel h1 { margin: 0 0 5px; font-size: 25px; font-weight: 400; text-shadow: 2px 2px 3px rgba(0,0,0,.45); }
.xp-login-panel p { margin: 0 0 16px; font-size: 12px; color: #dce9fb; }
.xp-login-user { display: flex; align-items: center; gap: 11px; padding: 7px 14px 7px 8px; border: 1px solid #163f90; border-radius: 5px; color: #143c88; background: linear-gradient(180deg,#fff,#dce9fa); box-shadow: 2px 3px 7px rgba(0,0,0,.35); font-weight: 700; }
.xp-login-user small { font-weight: 400; color: #666; }
.xp-user-avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 4px; background: linear-gradient(#ffe0bd,#e89b62); border: 2px solid #fff; box-shadow: 0 0 0 1px #8b6a4c; position: relative; display: block; }
.xp-user-avatar::before { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #7b4a2d; left: 11px; top: 6px; }
.xp-user-avatar::after { content: ""; position: absolute; width: 27px; height: 17px; border-radius: 14px 14px 0 0; background: #2f6fc7; left: 5px; bottom: 1px; }
.xp-login-footer { position: absolute; right: 7%; bottom: 8%; text-align: center; font-size: 11px; color: #cfe0f6; }
.xp-shutdown { position: absolute; inset: 0; z-index: 300; background: #000; color: #ddd; display: grid; place-items: center; text-align: center; }
.xp-shutdown-message { font: 18px "Lucida Sans", Tahoma, sans-serif; letter-spacing: .3px; }
.xp-shutdown-action { margin-top: 20px; background: #222; color: #fff; border: 1px solid #777; padding: 7px 18px; }

/* Host share-bar coexistence: keep tray and task buttons clear of it. */
@media (min-width: 641px) {
  .xp-os { --xp-share-offset: 372px; }
  .xp-taskbar { padding-right: calc(4px + var(--xp-share-offset)); }
  .xp-balloon { right: calc(12px + var(--xp-share-offset)); }
}
@media (max-width: 640px) {
  .xp-os { --xp-share-offset: 30px; }
  .xp-taskbar { padding-right: calc(4px + var(--xp-share-offset)); }
  .xp-tray { min-width: 0; }
  .xp-tray-icon:nth-child(-n+2) { display: none; }
  .xp-start-button { min-width: 78px; padding: 0 9px; }
  .xp-start-menu { width: min(390px,100vw); }
  .xp-balloon { right: calc(8px + var(--xp-share-offset)); width: min(260px,calc(100vw - 50px)); }
}

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