:root {
  --bg: #05070d;
  --panel: rgba(7, 11, 20, .96);
  --panel-2: rgba(10, 16, 28, .97);
  --line: #8ea0bd;
  --line-soft: rgba(197, 214, 239, .24);
  --text: #f4f7fb;
  --muted: #a7b0c1;
  --cyan: #22e7dc;
  --blue: #40a8ff;
  --purple: #9a5cff;
  --pink: #e84bf8;
  --green: #24f3a9;
  --shadow: 0 20px 60px rgba(0,0,0,.38);
  --taskbar-h: 54px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body {
  color: var(--text);
  font-family: "Courier New", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 9999; background: #fff; color: #000; padding: 10px 14px; border-radius: 4px; }
.skip-link:focus { top: 12px; }

.desktop-shell {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(rgba(3, 5, 10, .15), rgba(3, 5, 10, .28)),
    url('./assets/wallpaper-desktop.webp') center / cover no-repeat;
  isolation: isolate;
}
.desktop-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 45%, transparent 0 22%, rgba(1, 3, 8, .15) 52%, rgba(1, 3, 8, .62) 100%);
  pointer-events: none;
}
.desktop-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  mix-blend-mode: soft-light;
}

.desktop-icons {
  position: absolute;
  top: 22px;
  left: 18px;
  bottom: calc(var(--taskbar-h) + 14px);
  width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  z-index: 2;
}
.desktop-icon {
  width: 112px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: default;
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 3px 5px;
  text-align: center;
  line-height: 1.05;
  font-size: 13px;
  text-shadow: 0 2px 3px #000, 0 0 6px #000;
  border-radius: 5px;
}
.desktop-icon:hover { background: rgba(59, 215, 255, .12); box-shadow: inset 0 0 0 1px rgba(78, 228, 255, .22); }
.desktop-icon:active { transform: translateY(1px); }
.icon-tile { width: 48px; height: 48px; display: grid; place-items: center; position: relative; }
.icon-tile img { max-width: 42px; max-height: 42px; width: auto; height: auto; object-fit: contain; }
.icon-pump { background: linear-gradient(135deg, rgba(58,233,220,.12), rgba(154,92,255,.16)); border: 1px solid rgba(154,92,255,.4); border-radius: 5px; }

.file-icon { width: 39px; height: 46px; background: #edf4ff; border: 2px solid #7657ff; box-shadow: 3px 3px 0 #4027a9; }
.file-fold { position: absolute; top: -2px; right: -2px; width: 12px; height: 12px; background: #bdc9ff; clip-path: polygon(0 0,100% 100%,0 100%); }
.file-lines, .file-lines::before, .file-lines::after { position: absolute; width: 23px; height: 3px; background: #8d6dff; left: 6px; top: 17px; content: ""; }
.file-lines::before { left: 0; top: 8px; }
.file-lines::after { left: 0; top: 16px; width: 16px; }
.chart-icon { border: 2px solid #3edbef; background: #0a1420; display:flex; align-items:flex-end; justify-content:center; gap:4px; padding:8px; box-shadow: 3px 3px 0 #522d98; }
.chart-icon i { width: 7px; background: linear-gradient(#26e3d5,#8b5cf6); }
.chart-icon i:nth-child(1){height:32%}.chart-icon i:nth-child(2){height:58%}.chart-icon i:nth-child(3){height:90%}
.folder-icon { width: 49px; height: 34px; margin-top: 8px; background: linear-gradient(135deg,#4ee2ff,#ac50ff); border: 2px solid #dfdcff; border-radius: 3px; box-shadow: 3px 3px 0 #492ba6; }
.folder-icon::before { content:""; position:absolute; width:22px; height:8px; left:2px; top:-7px; border:2px solid #dfdcff; border-bottom:0; background:#4ee2ff; border-radius:3px 3px 0 0; }
.trash-icon { width: 34px; height: 41px; border: 2px solid #e8edff; border-top: 5px solid #e8edff; background: linear-gradient(90deg,#9199af 0 14%,#dfe4f3 14% 28%,#9199af 28% 42%,#dfe4f3 42% 56%,#9199af 56% 70%,#dfe4f3 70% 84%,#9199af 84%); box-shadow: 3px 3px 0 #5c526e; }
.trash-icon::before { content:""; position:absolute; left:-5px; top:-9px; width:40px; height:5px; background:#e8edff; border:2px solid #777f95; }
.terminal-icon { width: 48px; height: 38px; border: 2px solid #3ce4e8; background: #080d15; color:#fff; font-size:20px; font-weight:bold; box-shadow: 3px 3px 0 #522b8f; }

.status-chip {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(5, 8, 15, .78);
  border: 1px solid rgba(111, 230, 255, .22);
  padding: 8px 10px;
  font-size: 12px;
  color: #dce7f3;
  backdrop-filter: blur(5px);
}
.status-light { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.window {
  --x: 20vw;
  --y: 12vh;
  --w: 420px;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: min(var(--w), calc(100vw - 32px));
  display: none;
  border: 1px solid rgba(195, 209, 239, .76);
  background: var(--panel);
  box-shadow: 0 0 0 2px rgba(4,7,12,.94), 0 0 0 3px rgba(105,130,172,.55), var(--shadow);
  z-index: 10;
}
.window.is-open { display: block; }
.window.is-minimized { display: none; }
.window.active { box-shadow: 0 0 0 2px rgba(4,7,12,.94), 0 0 0 3px rgba(64,231,226,.68), 0 0 28px rgba(77,190,255,.12), var(--shadow); }
.window-bar {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 0 8px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(90deg,#1325a8 0%,#0278c5 42%,#16b6cc 65%,#8155df 100%);
  border-bottom: 2px solid #070b14;
  user-select: none;
  cursor: grab;
}
.window-bar:active { cursor: grabbing; }
.window-title { display: flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 rgba(0,0,0,.5); }
.window-controls { display: flex; gap: 5px; }
.window-controls button {
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid #d8e6ff;
  color: #fff;
  background: #202766;
  box-shadow: inset -2px -2px 0 #0b103a, inset 2px 2px 0 rgba(255,255,255,.35);
  cursor: pointer;
  line-height: 18px;
}
.window-controls button:hover { background: #39409a; }
.window-body { border: 2px solid #0d1220; min-height: 110px; }

.about-body { padding: 24px 26px 22px; background: radial-gradient(circle at 75% 10%,rgba(35,230,214,.08),transparent 36%), #070b13; }
.brand-wordmark { font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(42px, 4.8vw, 64px); letter-spacing: -1px; line-height: .95; color: #38e3e0; text-shadow: 3px 3px 0 #2a45c6; }
.brand-wordmark span { color: #d65cf3; }
.mono-line { margin-top: 18px; font-size: 16px; color: #dfe7f5; }
.ascii-rule { color: #6b768b; margin: 6px 0 12px; overflow: hidden; white-space: nowrap; }
.about-body p { margin: 0; color: #f5f7fb; font-size: 17px; line-height: 1.55; }
.about-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.retro-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #8f9bb4;
  background: #101827;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.12), inset -2px -2px 0 rgba(0,0,0,.4);
  font-weight: 700;
}
.retro-button:hover { background: #17233a; border-color: #52dfe5; }
.retro-button:active { box-shadow: inset 2px 2px 0 rgba(0,0,0,.5); transform: translateY(1px); }
.service-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background:#fff; border-radius:3px; overflow:hidden; }
.service-icon img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.x-link .service-icon { background:#fff; padding:4px; }
.dex-link .service-icon { background:#fff; }

.chart-body { padding: 16px; background:#07101a; }
.chart-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:14px; }
.chart-head div { display:grid; gap:2px; }
.chart-head b { font-size:22px; }
.chart-head span { font-size:11px; color:#8d9aad; }
.chart-head strong { font-size:12px; color:var(--green); font-weight:700; }
.chart-grid { height: 230px; position:relative; overflow:hidden; border:1px solid rgba(123,148,179,.28); background-image: linear-gradient(rgba(86,112,143,.12) 1px, transparent 1px),linear-gradient(90deg,rgba(86,112,143,.12) 1px, transparent 1px); background-size: 100% 46px, 56px 100%; }
.candles { position:absolute; inset:18px 15px 16px; display:flex; align-items:flex-end; gap:6px; }
.candles i { flex:1; height:var(--h); margin-bottom:var(--o); min-width:5px; background:linear-gradient(180deg,#24f1da,#8b5cf6); box-shadow:0 0 9px rgba(35,223,226,.2); position:relative; }
.candles i:nth-child(4n+2), .candles i:nth-child(7n) { background:linear-gradient(180deg,#ef58f8,#9358ff); }
.candles i::before { content:""; position:absolute; width:1px; height:calc(100% + 18px); left:50%; top:-9px; background:currentColor; opacity:.8; }
.chart-footer { display:flex; justify-content:space-between; margin-top:12px; color:#98a4b8; font-size:12px; }
.chart-footer .active { color:#061015; background:#2ce6db; padding:2px 8px; font-weight:700; }

.clients-body, .trash-body { min-height: 145px; display:grid; place-items:center; align-content:center; gap:10px; text-align:center; background:#080d16; padding:18px; }
.clients-body p, .trash-body p { margin:0; font-size:17px; }
.clients-body small, .trash-body small { color:#8f99aa; }
.people { width:84px; height:48px; position:relative; }
.people i { position:absolute; bottom:0; width:28px; height:24px; background:#8f98b4; clip-path: polygon(50% 0,78% 15%,78% 40%,100% 68%,100% 100%,0 100%,0 68%,22% 40%,22% 15%); }
.people i:nth-child(1){left:2px;transform:scale(.78)} .people i:nth-child(2){left:28px;height:34px;background:#c3c8da} .people i:nth-child(3){right:2px;transform:scale(.78)}
.trash-big { width:40px;height:50px;border:3px solid #a9b2c9;border-top:7px solid #dfe5f3;background:repeating-linear-gradient(90deg,#252d3f 0 5px,#8892a8 5px 9px); position:relative; }
.trash-big::before{content:"";position:absolute;left:-7px;top:-12px;width:48px;height:5px;background:#dfe5f3}

.terminal-body { padding: 17px 20px 18px; background:radial-gradient(circle at 85% 50%,rgba(34,231,220,.06),transparent 32%),#050a11; min-height:235px; font-size:15px; line-height:1.45; }
.terminal-body p { margin:0 0 12px; }
.terminal-body p:last-child { margin-bottom:0; }
.terminal-body span { color:#33f0c0; font-weight:700; }
.terminal-prompt i { display:inline-block; width:9px;height:16px;background:#d9ccff;vertical-align:-3px;animation:blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity:0; } }

.mini-doc { width:12px;height:15px;background:#eff4ff;border:1px solid #8a70ff; display:inline-block; }
.mini-folder { width:15px;height:10px;background:#8f62ff;border:1px solid #d1c4ff;display:inline-block; }
.mini-terminal { display:inline-grid; place-items:center; min-width:19px;height:17px;border:1px solid #55e9dc;background:#061019;font-size:10px; }
.mini-trash { width:11px;height:13px;border:1px solid #d7dded;display:inline-block; }

.taskbar {
  position: fixed;
  z-index: 500;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-h);
  background: rgba(9, 13, 23, .97);
  border-top: 1px solid #52617a;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: stretch;
  box-shadow: 0 -10px 30px rgba(0,0,0,.24);
  backdrop-filter: blur(10px);
}
.start-button { display:flex;align-items:center;gap:8px;border:0;border-right:1px solid #303a4d;background:#101723;color:#fff;padding:0 16px;cursor:pointer;font-weight:700; }
.start-button:hover { background:#182438; }
.tiny-s { width:27px;height:27px;display:grid;place-items:center;background:linear-gradient(135deg,var(--purple),var(--cyan));color:#050712;font-weight:900;border:1px solid #c6eefe;box-shadow:inset 1px 1px 0 rgba(255,255,255,.4); }
.task-items { display:flex;min-width:0;overflow-x:auto;scrollbar-width:none; }
.task-items::-webkit-scrollbar{display:none}
.task-item { min-width:120px;max-width:190px;border:0;border-right:1px solid #2a3344;background:#0f1622;color:#dfe8f5;padding:0 12px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-size:12px; }
.task-item:hover,.task-item.active{background:#1b293e}.task-item.active{box-shadow:inset 0 2px 0 var(--cyan)}
.tray { display:flex;align-items:center;gap:6px;padding:0 10px;border-left:1px solid #2a3344; }
.tray-icon { width:35px;height:34px;display:grid;place-items:center;border:1px solid transparent;background:transparent;padding:0;color:inherit;cursor:pointer; }
.tray-icon:hover { border-color:#3e506c;background:#152237; }
.tray-icon img { max-width:21px;max-height:21px;width:auto;height:auto;object-fit:contain; }
.tray-icon.x-link img { background:#fff;border-radius:2px;padding:2px; }
.tray-icon.dex-link img { background:#fff;border-radius:2px; }
#clock { font-size:12px;min-width:76px;text-align:center;color:#dce4f0; }

.start-menu { position:fixed;z-index:700;left:8px;bottom:calc(var(--taskbar-h) + 8px);width:280px;background:#0c1320;border:1px solid #8b9ab5;box-shadow:0 20px 60px rgba(0,0,0,.5);padding:8px; }
.start-head{display:flex;gap:10px;align-items:center;padding:10px;background:#101c2d;border-bottom:1px solid #2d3a50;margin-bottom:6px}.start-head div{display:grid}.start-head small{color:#8f9aad;font-size:10px;margin-top:2px}
.start-menu button,.start-menu a{width:100%;min-height:42px;border:0;background:transparent;color:#fff;display:flex;align-items:center;gap:10px;padding:8px 10px;text-align:left;cursor:pointer}.start-menu button:hover,.start-menu a:hover{background:#17273d}.start-menu img{width:24px;height:24px;object-fit:contain}.start-menu .x-link img{background:#fff;padding:3px;border-radius:3px}.start-menu .dex-link img{background:#fff;border-radius:3px}
.noscript { position:fixed;left:20px;right:20px;bottom:70px;background:#fff;color:#000;padding:12px;z-index:9999; }

@media (max-width: 1100px) {
  .desktop-icons { width: 94px; }
  .desktop-icon { width: 90px; font-size: 11px; }
  .icon-tile { transform: scale(.9); }
  .window { max-width: calc(100vw - 120px); }
  .about-window { --x: 12vw !important; }
  .terminal-window { --x: 48vw !important; }
  .chart-window { --x: 46vw !important; }
}

@media (max-width: 900px) {
  body { overflow:auto; background:#05070d; }
  .desktop-shell {
    min-height:100dvh;
    overflow-y:auto;
    overflow-x:hidden;
    padding: 94px 12px calc(var(--taskbar-h) + 18px);
    background:
      linear-gradient(rgba(3,5,10,.28),rgba(3,5,10,.46)),
      url('./assets/wallpaper-mobile.webp') center top / cover fixed no-repeat;
  }
  .desktop-shell::before { position:fixed; }
  .desktop-icons {
    position:relative;
    inset:auto;
    width:100%;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    margin-bottom:16px;
    z-index:2;
  }
  .desktop-icon { width:100%; min-height:92px; background:rgba(6,11,19,.72); border:1px solid rgba(107,204,239,.18); cursor:pointer; padding:8px 4px; }
  .desktop-icon span:last-child{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-tile{transform:scale(.82)}
  .status-chip { top:12px; left:12px; right:auto; }
  .window, .window.is-open {
    position:relative;
    left:auto !important;
    top:auto !important;
    width:100% !important;
    max-width:none;
    margin:0 0 14px;
    transform:none !important;
    display:none;
  }
  .window.is-open:not(.is-minimized){ display:block; }
  .window-bar { cursor:default; }
  .about-body { padding:20px 17px; }
  .about-body p { font-size:15px; }
  .brand-wordmark { font-size:42px; }
  .about-actions { display:grid;grid-template-columns:1fr 1fr; }
  .about-actions .retro-button:first-child { grid-column:1 / -1; justify-content:center; }
  .retro-button { justify-content:center; }
  .chart-grid { height:210px; }
  .taskbar { grid-template-columns:auto minmax(0,1fr) auto; }
  .start-button { padding:0 10px; }
  .start-button span:last-child { display:none; }
  .task-item { min-width:48px; width:48px; padding:0 6px; text-indent:-9999px; position:relative; }
  .task-item::after { content:"■"; position:absolute; inset:0; display:grid;place-items:center;text-indent:0;color:#46dfde;font-size:13px; }
  .tray .tray-icon { display:none; }
  #clock { min-width:60px;font-size:11px; }
  .start-menu { left:8px; right:8px; width:auto; }
}

@media (max-width: 390px) {
  .desktop-shell { padding-left:8px;padding-right:8px; }
  .desktop-icons { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .brand-wordmark { font-size:38px; }
  .window-title { font-size:12px; }
  .window-controls button { width:25px;height:25px; }
}

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