/* Zoidworks OS 2000 — original retro desktop UI, no third-party OS assets. */
:root {
  color-scheme: dark;
  --desktop-blue: #066e7f;
  --desktop-deep: #062d56;
  --zoid-coral: #ff705f;
  --zoid-coral-dark: #b64237;
  --chrome: #c5c5c5;
  --chrome-light: #eeeeee;
  --chrome-mid: #a2a2a2;
  --chrome-dark: #414141;
  --chrome-black: #161616;
  --title-a: #033b78;
  --title-b: #1471c9;
  --title-inactive-a: #657483;
  --title-inactive-b: #8795a2;
  --paper: #fffdf1;
  --ink: #171b1f;
  --muted: #555b61;
  --taskbar-h: 46px;
  --font: Tahoma, Verdana, Geneva, system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0, 180, 182, 0.18), rgba(0, 21, 70, 0.48)),
    url('/assets/zoidos/wallpaper.webp') center / cover no-repeat fixed,
    linear-gradient(135deg, var(--desktop-blue), var(--desktop-deep));
  color: white;
  font: 13px/1.45 var(--font);
  cursor: default;
  user-select: none;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
  opacity: 0.35;
}

button,
a {
  font: inherit;
}

a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.desktop-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  min-height: 520px;
  overflow: hidden;
}

.desktop {
  position: absolute;
  inset: 0 0 var(--taskbar-h) 0;
  overflow: hidden;
}

.desktop-icons {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 10;
  pointer-events: none;
}

.desktop-icon {
  position: absolute;
  width: 94px;
  min-height: 100px;
  padding: 5px 4px 4px;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  text-align: center;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.9), 0 0 5px rgba(0,0,0,0.7);
  cursor: grab;
  border-radius: 2px;
  pointer-events: auto;
  touch-action: none;
}

.desktop-icon:focus-visible,
.desktop-icon.is-selected {
  outline: 1px dotted #fff;
  outline-offset: 1px;
  background: rgba(0, 52, 120, 0.38);
  border-color: rgba(255,255,255,0.42);
}

.desktop-icon:hover {
  background: rgba(255,255,255,0.08);
}

.desktop-icon.is-dragging {
  z-index: 16;
  background: rgba(0, 52, 120, 0.44);
  cursor: grabbing;
  opacity: 0.92;
}

.icon-label {
  display: inline-block;
  max-width: 88px;
  margin-top: 4px;
  padding: 1px 3px 2px;
  line-height: 1.15;
  border-radius: 2px;
  word-break: break-word;
}

.desktop-icon:focus-visible .icon-label,
.desktop-icon.is-selected .icon-label {
  background: rgba(3, 59, 120, 0.85);
}

.pixel-svg,
.task-icon,
.menu-icon,
.file-icon {
  shape-rendering: crispEdges;
  image-rendering: pixelated;
  object-fit: contain;
  user-select: none;
}

.pixel-svg {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.34));
}

.desktop-brand {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 2;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(3, 18, 39, 0.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 10px 30px rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.86);
  backdrop-filter: blur(2px);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.7);
}

.desktop-brand strong {
  display: block;
  color: white;
  font-size: 15px;
  letter-spacing: 0.03em;
}

.desktop-brand span {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,0.72);
  font-size: 12px;
}

.window-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.window {
  position: absolute;
  min-width: 290px;
  min-height: 230px;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - var(--taskbar-h) - 16px);
  overflow: hidden;
  color: var(--ink);
  background: var(--chrome);
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #303030;
  border-bottom: 2px solid #303030;
  box-shadow: 1px 1px 0 #000, 9px 12px 0 rgba(0,0,0,0.28);
  pointer-events: auto;
}

.window.is-active {
  box-shadow: 1px 1px 0 #000, 11px 14px 0 rgba(0,0,0,0.32);
}

.window.is-minimized {
  display: none;
}

.window.is-maximized {
  left: 8px !important;
  top: 8px !important;
  width: calc(100vw - 16px) !important;
  height: calc(100dvh - var(--taskbar-h) - 16px) !important;
}

.titlebar {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 3px 3px 7px;
  color: #fff;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  font-weight: 700;
  cursor: move;
}

.window:not(.is-active) .titlebar {
  background: linear-gradient(90deg, var(--title-inactive-a), var(--title-inactive-b));
}

.titlebar-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.titlebar-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.65);
}

.window-controls {
  display: flex;
  gap: 3px;
}

.chrome-button,
.window-control,
.raised-button {
  min-width: 24px;
  min-height: 22px;
  padding: 2px 7px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #505050;
  border-bottom: 2px solid #505050;
  background: var(--chrome);
  color: #111;
  line-height: 1;
  text-decoration: none;
  box-shadow: inset -1px -1px 0 var(--chrome-mid), inset 1px 1px 0 var(--chrome-light);
  cursor: default;
}

.window-control {
  width: 22px;
  height: 20px;
  padding: 0;
  display: grid;
  place-items: center;
  font-family: "Arial Black", Tahoma, sans-serif;
  font-size: 12px;
  font-weight: 900;
}

.chrome-button:active,
.window-control:active,
.raised-button:active,
.chrome-button.is-pressed,
.task-button.is-active,
.zoid-button[aria-expanded="true"] {
  border-top-color: #505050;
  border-left-color: #505050;
  border-right-color: #fff;
  border-bottom-color: #fff;
  box-shadow: inset 1px 1px 0 #858585;
  transform: translate(1px, 1px);
}

.window-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-left: 1px solid #858585;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #858585;
  background: var(--chrome);
}

.address-bar {
  min-width: 180px;
  flex: 1;
  padding: 3px 6px;
  border-top: 2px solid #505050;
  border-left: 2px solid #505050;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  background: #fff;
  color: #1f2933;
  font-family: "Courier New", monospace;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-body {
  position: relative;
  height: calc(100% - 28px);
  max-height: none;
  overflow: auto;
  padding: 14px;
  border-top: 1px solid #fff;
  background: var(--paper);
  user-select: text;
}

.window-body.with-toolbar {
  height: calc(100% - 61px);
}

.resize-handle {
  position: absolute;
  z-index: 4;
  background: transparent;
  user-select: none;
}

.resize-n,
.resize-s {
  left: 8px;
  right: 8px;
  height: 7px;
  cursor: ns-resize;
}

.resize-e,
.resize-w {
  top: 31px;
  bottom: 8px;
  width: 7px;
  cursor: ew-resize;
}

.resize-n { top: -2px; }
.resize-s { bottom: -2px; }
.resize-e { right: -2px; }
.resize-w { left: -2px; }

.resize-ne,
.resize-se,
.resize-sw,
.resize-nw {
  width: 14px;
  height: 14px;
}

.resize-ne { top: -2px; right: -2px; cursor: nesw-resize; }
.resize-se { right: -2px; bottom: -2px; cursor: nwse-resize; }
.resize-sw { left: -2px; bottom: -2px; cursor: nesw-resize; }
.resize-nw { left: -2px; top: -2px; cursor: nwse-resize; }

.resize-se::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 10px;
  height: 10px;
  content: "";
  background:
    linear-gradient(135deg, transparent 0 45%, #6b6b6b 46% 54%, transparent 55% 100%),
    linear-gradient(135deg, transparent 0 63%, #f6f6f6 64% 72%, transparent 73% 100%);
  opacity: 0.78;
  pointer-events: none;
}

.window.is-maximized .resize-handle,
.window.is-minimized .resize-handle {
  display: none;
}

.window.is-resizing iframe {
  pointer-events: none;
}

.window-status {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 6px;
  border-top: 1px solid #858585;
  background: var(--chrome);
  color: #222;
  font-size: 11px;
  user-select: none;
}

.doc h2,
.folder h2,
.app-panel h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.05;
}

.doc p,
.app-panel p,
.folder p,
.system-table {
  margin: 0 0 12px;
  color: #252b30;
}

.doc .lede,
.app-panel .lede {
  color: #111820;
  font-size: 15px;
  line-height: 1.5;
}

.app-panel {
  display: grid;
  gap: 14px;
}

.app-header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dotted #8f8f8f;
}

.app-header .pixel-svg {
  width: 72px;
  height: 72px;
}

.logo-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 2px;
}

.logo-strip img {
  max-width: 150px;
  max-height: 46px;
  object-fit: contain;
  image-rendering: auto;
}

.pill-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #878787;
  border-bottom: 1px solid #878787;
  background: #eee;
  color: #1c242b;
  font-size: 12px;
}

.raised-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 12px;
  color: #111;
  text-decoration: none;
  font-weight: 700;
}

.raised-button.primary {
  background: #f3d6d2;
  color: #42120f;
}

.raised-button.dark {
  background: #22303b;
  color: #fff;
  border-top-color: #4d5b66;
  border-left-color: #4d5b66;
  border-right-color: #071017;
  border-bottom-color: #071017;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.info-card {
  padding: 10px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #9a9a9a;
  border-bottom: 2px solid #9a9a9a;
  background: #f6f1df;
}

.readme-link-card {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease;
}

.readme-link-card:hover {
  transform: translate(-1px, -1px);
}

.readme-link-card:focus-visible {
  outline: 1px dotted #111;
  outline-offset: -5px;
}

.info-card strong {
  display: block;
  margin-bottom: 4px;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.file-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #111;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: default;
}

.file-link:hover,
.file-link:focus-visible {
  border-color: #0a54ad;
  background: #d9ecff;
  outline: none;
}

.file-link small {
  display: block;
  margin-top: 1px;
  color: #4c5258;
  font-size: 11px;
}

.game-body,
.webapp-body {
  padding: 0;
  overflow: hidden;
  background: #101720;
  user-select: none;
}

.monitor-frame-body {
  background: #071018;
}

.game-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #101720;
  color: #fff;
}

.game-launch-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #3c4650;
  background: linear-gradient(180deg, #1e2a36, #111821);
}

.game-launch-strip small {
  display: block;
  margin-top: 2px;
  color: #cbd5df;
  font-size: 11px;
}

.game-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.game-frame-wrap {
  min-height: 0;
  background: #000;
}

.game-frame,
.zoid-app-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.system-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  background: #fff;
}

.system-table th,
.system-table td {
  padding: 6px 8px;
  border: 1px solid #aaa;
  text-align: left;
  vertical-align: top;
}

.system-table th {
  width: 35%;
  background: #e8e8e8;
}

.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  background: var(--chrome);
  border-top: 2px solid #fff;
  box-shadow: inset 0 1px 0 #fff;
  color: #101010;
}

.zoid-button {
  min-width: 88px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 3px 7px;
  font-weight: 900;
}

.zoid-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--zoid-coral), #d9493f);
  border: 1px solid #8c211d;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.48);
  transform: skewX(-8deg);
  font-size: 11px;
  letter-spacing: -0.07em;
}

.task-buttons {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.task-button {
  width: min(190px, 26vw);
  height: 32px;
  justify-content: flex-start;
  gap: 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 700;
}

.task-icon,
.menu-icon,
.file-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.tray {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-top: 2px solid #777;
  border-left: 2px solid #777;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  background: #bababa;
  font-size: 12px;
  white-space: nowrap;
}

.tray-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #27d070;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.6), 0 0 8px rgba(39,208,112,0.85);
}

.start-menu {
  position: absolute;
  left: 7px;
  bottom: calc(var(--taskbar-h) - 1px);
  z-index: 2500;
  width: min(338px, calc(100vw - 14px));
  min-height: 376px;
  display: grid;
  grid-template-columns: 42px 1fr;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #303030;
  border-bottom: 2px solid #303030;
  background: var(--chrome);
  color: #111;
  box-shadow: 8px 10px 0 rgba(0,0,0,0.28);
}

.start-menu[hidden] { display: none; }

.start-rail {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px 0;
  background: linear-gradient(#064a72, #001a3e);
  color: white;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-shadow: 1px 1px 0 #000;
}

.start-panel {
  padding: 7px;
}

.start-user {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
  padding: 8px;
  color: #fff;
  background: linear-gradient(90deg, #0d3771, #1474cf);
}

.start-user strong {
  display: block;
  font-size: 15px;
}

.start-user span {
  color: rgba(255,255,255,0.78);
  font-size: 12px;
}

.start-list {
  display: grid;
  gap: 2px;
}

.start-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: #111;
  text-align: left;
  text-decoration: none;
  cursor: default;
}

.start-item:hover,
.start-item:focus-visible {
  background: #0a54ad;
  color: white;
  outline: none;
}

.start-separator {
  height: 1px;
  margin: 6px 2px;
  background: #8a8a8a;
  border-bottom: 1px solid #fff;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(0, 0, 0, 0.05), rgba(0,0,0,0.42)),
    url('/assets/zoidos/boot-bg-20260626.webp') center / cover no-repeat,
    #002c34;
  color: #bffdf7;
  animation: boot-auto-hide 2650ms ease forwards;
}

.boot-card {
  width: min(560px, calc(100vw - 36px));
  padding: 18px;
  border: 1px solid rgba(82, 255, 241, 0.42);
  background: rgba(0, 22, 28, 0.72);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.42), 0 0 40px rgba(255,112,95,0.18);
  text-align: left;
}

.boot-title {
  margin: 0 0 12px;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(255,112,95,0.45);
}

.boot-log {
  min-height: 72px;
  margin: 0 0 12px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: #98fff2;
  white-space: pre-line;
}

.boot-progress {
  height: 16px;
  padding: 2px;
  border: 1px solid #42cdbf;
  background: rgba(0,0,0,0.45);
}

.boot-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(90deg, var(--zoid-coral) 0 14px, transparent 14px 18px);
  transform-origin: left;
  animation: boot-fill 1900ms steps(18) forwards;
}

.boot.skip,
.boot.is-done {
  animation: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

html.skip-boot .boot {
  display: none;
  animation: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes boot-fill {
  from { transform: scaleX(0.06); }
  to { transform: scaleX(1); }
}

@keyframes boot-auto-hide {
  0%, 82% { opacity: 1; visibility: visible; pointer-events: auto; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

.fallback {
  max-width: 680px;
  margin: 40px auto;
  padding: 24px;
  background: white;
  color: #111;
}

@media (max-width: 820px) {
  body {
    overflow: hidden;
    background-position: 42% center;
  }

  .desktop-shell { min-height: 0; }

  .desktop-icons {
    left: 8px;
    top: 8px;
    right: 8px;
    bottom: auto;
    width: auto;
    height: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(70px, 1fr));
    grid-auto-rows: 92px;
    gap: 6px;
    pointer-events: auto;
  }

  .desktop-icon {
    position: static;
    width: auto;
    min-height: 88px;
    padding-top: 4px;
    font-size: 11px;
    cursor: default;
    touch-action: manipulation;
  }

  .pixel-svg {
    width: 54px;
    height: 54px;
  }

  .desktop-brand {
    display: none;
  }

  .window,
  .window.is-maximized {
    left: 8px !important;
    right: 8px !important;
    top: 98px !important;
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - var(--taskbar-h) - 106px) !important;
    max-width: none;
    min-width: 0;
  }

  .titlebar { cursor: default; }

  .resize-handle { display: none; }

  .window-body {
    max-height: none;
    height: calc(100% - 28px);
    padding: 11px;
  }

  .window-body.with-toolbar {
    height: calc(100% - 65px);
  }

  .two-col,
  .app-header {
    grid-template-columns: 1fr;
  }

  .app-header .pixel-svg {
    margin: 0;
  }

  .folder-grid {
    grid-template-columns: 1fr;
  }

  .game-launch-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-actions {
    justify-content: flex-start;
  }

  .start-menu {
    min-height: min(420px, calc(100dvh - var(--taskbar-h) - 10px));
    left: 6px;
    right: 6px;
    width: auto;
  }

  .task-button {
    width: 120px;
  }

  .tray {
    padding: 0 5px;
    gap: 5px;
  }

  .tray span:first-of-type {
    display: none;
  }
}

@media (max-width: 460px) {
  :root { --taskbar-h: 44px; }

  .desktop-icons {
    grid-template-columns: repeat(3, minmax(64px, 1fr));
    grid-auto-rows: 88px;
  }

  .window,
  .window.is-maximized {
    top: 188px !important;
    height: calc(100dvh - var(--taskbar-h) - 196px) !important;
  }

  .zoid-button {
    min-width: 74px;
    padding-right: 7px;
  }

  .task-button {
    width: 96px;
    font-size: 11px;
  }

  .tray {
    font-size: 11px;
  }
}

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

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