:root {
  --desktop: #008080;
  --face: #c0c0c0;
  --title: #000080;
  --title-inactive: #808080;
  --text: #000000;
  --white: #ffffff;
  --black: #000000;
  --shadow: #808080;
  --dark: #404040;
  --light: #dfdfdf;
  --navy: #000080;
  --teal: #008080;
  --yellow: #ffff00;
  --maroon: #800000;
  --green: #008000;
  --silver: #c0c0c0;
  --taskbar-h: 28px;
  font-family: Tahoma, "MS Sans Serif", Geneva, Verdana, sans-serif;
  font-size: 12px;
  color: var(--text);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--desktop);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
  user-select: none;
}

button, a, input { font-family: inherit; font-size: inherit; }

.raised {
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
  background: var(--face);
}

.raised-thin {
  border-top: 1px solid var(--white);
  border-left: 1px solid var(--white);
  border-right: 1px solid var(--dark);
  border-bottom: 1px solid var(--dark);
  background: var(--face);
}

.sunken {
  border-top: 2px solid var(--shadow);
  border-left: 2px solid var(--shadow);
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
}

.sunken-thin {
  border-top: 1px solid var(--dark);
  border-left: 1px solid var(--dark);
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
}

.desktop {
  min-height: 100vh;
  padding: 10px 10px calc(var(--taskbar-h) + 24px);
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 7px,
      rgba(0, 0, 0, 0.04) 7px,
      rgba(0, 0, 0, 0.04) 8px
    ),
    var(--desktop);
}

.notice {
  max-width: 980px;
  margin: 0 auto 10px;
  padding: 4px 8px;
  background: var(--yellow);
  color: var(--black);
  font-weight: bold;
  letter-spacing: 0.2px;
}

.notice a { color: var(--navy); }

.marquee-wrap {
  max-width: 980px;
  margin: 0 auto 10px;
  padding: 2px 4px;
  background: var(--navy);
  color: var(--yellow);
  overflow: hidden;
  white-space: nowrap;
}

.marquee-wrap marquee,
.marquee-text {
  font-weight: bold;
  letter-spacing: 1px;
}

.workspace {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  align-items: start;
}

.window {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 1px 3px;
  background: var(--title);
  color: var(--white);
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 0.3px;
}

.titlebar .icon-sm {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.titlebar .caption { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.title-btns { display: flex; gap: 2px; }

.title-btns button {
  width: 16px;
  height: 14px;
  padding: 0;
  line-height: 10px;
  font-size: 10px;
  font-weight: bold;
  background: var(--face);
  color: var(--black);
  border-top: 1px solid var(--white);
  border-left: 1px solid var(--white);
  border-right: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
  cursor: pointer;
}

.menubar {
  display: flex;
  gap: 2px;
  padding: 2px 4px;
  background: var(--face);
}

.menubar button {
  background: none;
  border: 1px solid transparent;
  padding: 1px 8px;
  cursor: pointer;
}

.menubar button:hover,
.menubar button[aria-expanded="true"] {
  border-top: 1px solid var(--white);
  border-left: 1px solid var(--white);
  border-right: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
}

.toolbar {
  display: flex;
  gap: 6px;
  padding: 4px 6px;
  background: var(--face);
  align-items: center;
}

.path {
  flex: 1;
  padding: 2px 6px;
  background: var(--white);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-body {
  background: var(--white);
  min-height: 280px;
  padding: 8px;
  overflow: auto;
}

.status {
  display: flex;
  background: var(--face);
  font-size: 11px;
}

.status > div {
  padding: 2px 6px;
  flex: 1;
}

.status > div:last-child { flex: 0 0 auto; min-width: 90px; }

.icon-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px 4px;
  align-content: start;
  justify-items: stretch;
  padding: 10px 6px 12px;
}

.cabinet {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  height: 104px;
  padding: 8px 3px 4px;
  border: 1px dotted transparent;
  background: none;
  cursor: pointer;
  color: var(--navy);
  text-decoration: none;
}

.cabinet:hover,
.cabinet:focus-visible,
.cabinet.selected {
  background: var(--navy);
  color: var(--white);
  outline: none;
  border-color: var(--yellow);
}

.cabinet .glyph {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.cabinet .name {
  text-align: center;
  line-height: 1.2;
  font-size: 11px;
  width: 100%;
  height: 2.4em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  word-break: break-word;
}

.badge {
  font-size: 9px;
  font-weight: bold;
  padding: 0 3px;
  background: var(--maroon);
  color: var(--white);
  letter-spacing: 0.4px;
}

.cabinet:hover .badge,
.cabinet.selected .badge { background: var(--yellow); color: var(--black); }

.empty-bay {
  min-height: 280px;
  background:
    repeating-linear-gradient(
      45deg,
      #fff8c0,
      #fff8c0 8px,
      #ffe066 8px,
      #ffe066 16px
    );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 16px;
  color: var(--black);
}

.blink {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.construction {
  font-weight: bold;
  background: var(--black);
  color: var(--yellow);
  padding: 4px 10px;
  border: 3px dashed var(--maroon);
}

.slot-row {
  display: grid;
  grid-template-columns: repeat(2, 72px);
  gap: 10px 12px;
  justify-content: center;
  width: 100%;
}

.ghost-slot {
  width: 72px;
  height: 80px;
  border: 2px dashed var(--shadow);
  background: rgba(255,255,255,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px;
  font-size: 10px;
  color: var(--dark);
}

.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  z-index: 50;
}

.start {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
  padding: 1px 8px 1px 4px;
  height: 22px;
  cursor: pointer;
}

.start .flag {
  width: 16px;
  height: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.start .flag span:nth-child(1) { background: #ff0000; }
.start .flag span:nth-child(2) { background: #008000; }
.start .flag span:nth-child(3) { background: #0000ff; }
.start .flag span:nth-child(4) { background: #ffff00; }

.start[aria-expanded="true"] {
  border-top: 2px solid var(--black);
  border-left: 2px solid var(--black);
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
}

.task-btn {
  height: 22px;
  padding: 0 10px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tray {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 22px;
  padding: 0 8px;
  min-width: 86px;
  justify-content: center;
}

.start-menu {
  position: fixed;
  left: 4px;
  bottom: calc(var(--taskbar-h) + 2px);
  width: 220px;
  z-index: 60;
  display: none;
}

.start-menu.open { display: flex; }

.start-menu .stripe {
  width: 24px;
  background: var(--navy);
  color: var(--white);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: bold;
  letter-spacing: 2px;
  padding: 8px 4px;
  font-size: 13px;
}

.start-menu .items {
  flex: 1;
  padding: 4px 0;
}

.start-menu button,
.start-menu a {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 6px 12px;
  color: var(--black);
  text-decoration: none;
  cursor: pointer;
}

.start-menu button:hover,
.start-menu a:hover {
  background: var(--navy);
  color: var(--white);
}

.hr {
  height: 2px;
  margin: 4px 8px;
  border-top: 1px solid var(--shadow);
  border-bottom: 1px solid var(--white);
}

.modal-root {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 128, 0.18);
  z-index: 80;
  padding: 16px;
}

.modal-root.open { display: flex; }

.dialog {
  width: min(420px, 100%);
}

.dialog .window-body {
  min-height: 0;
  background: var(--face);
  padding: 12px;
}

.dialog-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.dialog-copy h2 {
  margin: 0 0 6px;
  font-size: 14px;
}

.dialog-copy p {
  margin: 0 0 8px;
  line-height: 1.35;
  user-select: text;
}

.meta {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 2px 8px;
  margin: 8px 0 12px;
  user-select: text;
}

.meta dt { color: var(--dark); }
.meta dd { margin: 0; font-weight: bold; }

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  min-width: 88px;
  padding: 3px 12px;
  cursor: pointer;
  background: var(--face);
  color: var(--black);
  text-decoration: none;
  text-align: center;
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
}

.btn:active {
  border-top: 2px solid var(--black);
  border-left: 2px solid var(--black);
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
}

.btn.default { box-shadow: inset 0 0 0 1px var(--black); font-weight: bold; }

.uc-gifs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.uc-banner {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  margin: 4px auto;
}

.hit-counter {
  max-width: 980px;
  margin: 14px auto 0;
}

.hit-body {
  background: #000040;
  color: #ffff66;
  text-align: center;
  padding: 10px 8px 12px;
}

.hit-label {
  margin: 8px 0 4px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
}

.hit-note {
  margin: 6px 0 0;
  font-size: 10px;
  color: #c0c0c0;
}

.odometer {
  display: inline-flex;
  gap: 2px;
  padding: 6px 8px;
  background: #000;
  margin: 0 auto;
}

.odometer .digit {
  width: 18px;
  height: 28px;
  background: #100;
  color: #ff2020;
  font-family: "Courier New", Courier, monospace;
  font-size: 22px;
  font-weight: bold;
  line-height: 28px;
  text-align: center;
  border: 1px solid #400;
  text-shadow: 0 0 6px #ff4444;
}

.webring {
  max-width: 980px;
  margin: 12px auto 0;
  padding: 8px;
  text-align: center;
  background: #000;
  color: #00ff00;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
}

.webring a { color: #00ffff; }
.webring .sep { color: #ffff00; margin: 0 8px; }

.footnote {
  max-width: 980px;
  margin: 8px auto 0;
  color: #e0ffff;
  font-size: 11px;
  line-height: 1.4;
}

.footnote a { color: var(--yellow); }

.hidden { display: none !important; }

@media (max-width: 840px) {
  .workspace { grid-template-columns: 1fr; }
  .desktop { padding-bottom: calc(var(--taskbar-h) + 28px); }
  .icon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

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