/* MyBot — Windows 98 desktop theme (Powered by AustraliaBot)
   Pure CSS, no frameworks. Late-90s chrome. */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --teal: #008080;
  --teal-dark: #006666;
  --beige: #c0c0c0;
  --beige-light: #dfdfdf;
  --beige-dark: #808080;
  --navy: #000080;
  --navy-mid: #1084d0;
  --black: #000000;
  --white: #ffffff;
  --term-bg: #0c0c0c;
  --term-fg: #c0c0c0;
  --term-fg-phosphor: #33ff66;
  --shadow: #000000;
  --font-ui: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, "Segoe UI", sans-serif;
  --font-mono: "Consolas", "Lucida Console", "Courier New", Courier, monospace;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 12px;
  background: var(--teal);
  color: var(--black);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  user-select: none;
}

body.phosphor {
  --term-fg: var(--term-fg-phosphor);
}

/* ========== DESKTOP ========== */
.desktop {
  position: absolute;
  inset: 0 0 28px 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.06) 0%, transparent 50%),
    linear-gradient(180deg, var(--teal) 0%, var(--teal-dark) 100%);
  background-color: var(--teal);
  overflow: hidden;
}

.desktop-icons {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  padding: 12px 8px;
  height: 100%;
  max-width: 100px;
}

.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 74px;
  padding: 4px 2px;
  background: transparent;
  border: 1px dotted transparent;
  cursor: pointer;
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 11px;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
  line-height: 1.2;
}

.desk-icon:hover {
  border-color: rgba(255,255,255,0.45);
  background: rgba(0,0,128,0.28);
  outline: none;
}

.desk-icon:focus {
  outline: none;
}

.desk-icon.selected,
.desk-icon:focus-visible {
  border-color: rgba(255,255,255,0.85);
  background: rgba(0,0,128,0.45);
}

.desk-icon.selected .icon-label,
.desk-icon:focus-visible .icon-label {
  background: var(--navy);
  outline: 1px dotted rgba(255,255,255,0.7);
}

.icon-img {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  image-rendering: pixelated;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Pixel-art icons via CSS gradients / shapes */
.icon-terminal {
  background:
    linear-gradient(#1a1a1a, #1a1a1a) center 6px / 26px 18px no-repeat,
    linear-gradient(#808080, #808080) center 24px / 20px 4px no-repeat,
    linear-gradient(#c0c0c0, #c0c0c0) center / 32px 32px no-repeat;
  border: 1px solid #404040;
  position: relative;
}
.icon-terminal::after {
  content: ">_";
  position: absolute;
  top: 8px;
  left: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: #33ff66;
  letter-spacing: -1px;
}

.icon-computer {
  background:
    linear-gradient(#000080, #000080) center 4px / 22px 14px no-repeat,
    linear-gradient(#a0a0a0, #a0a0a0) center 4px / 26px 18px no-repeat,
    linear-gradient(#c0c0c0, #808080) center 22px / 18px 6px no-repeat,
    linear-gradient(#dfdfdf, #dfdfdf) center / 32px 32px no-repeat;
  border: 1px solid #404040;
}

.icon-about {
  background:
    linear-gradient(#ffffcc, #ffffcc) center 4px / 20px 24px no-repeat,
    linear-gradient(#ffffff, #e8e8e8) center / 28px 30px no-repeat;
  border: 1px solid #808080;
  position: relative;
}
.icon-about::after {
  content: "i";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Times New Roman", serif;
  font-weight: bold;
  font-size: 14px;
  color: #000080;
  font-style: italic;
}

.icon-help {
  background:
    linear-gradient(#ffffcc, #ffffcc) center 4px / 20px 24px no-repeat,
    linear-gradient(#ffffff, #e8e8e8) center / 28px 30px no-repeat;
  border: 1px solid #808080;
  position: relative;
}
.icon-help::after {
  content: "?";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Times New Roman", serif;
  font-weight: bold;
  font-size: 16px;
  color: #000080;
}

.icon-label {
  text-align: center;
  padding: 1px 3px;
  max-width: 70px;
  word-break: break-word;
}

/* ========== WINDOWS ========== */
.win98-window {
  position: absolute;
  background: var(--beige);
  border-top: 2px solid var(--beige-light);
  border-left: 2px solid var(--beige-light);
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow:
    1px 1px 0 var(--white) inset,
    -1px -1px 0 #404040 inset,
    2px 2px 4px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  max-width: 100vw;
  max-height: calc(100vh - 28px);
  z-index: 10;
}

.win98-window[hidden] {
  display: none !important;
}

.win98-window.active {
  z-index: 50;
}

.win98-window.maximized {
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  max-width: none;
  max-height: none;
}

.title-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 3px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: var(--white);
  font-weight: bold;
  font-size: 11px;
  cursor: default;
  min-height: 20px;
  user-select: none;
  flex-shrink: 0;
}

.win98-window:not(.active) .title-bar {
  background: linear-gradient(90deg, #808080 0%, #b5b5b5 100%);
}

.title-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: #1a1a1a;
  border: 1px solid #808080;
  position: relative;
}
.title-icon::after {
  content: ">_";
  font-family: var(--font-mono);
  font-size: 7px;
  color: #33ff66;
  position: absolute;
  top: 1px;
  left: 1px;
  line-height: 1;
}
.title-icon.notepad {
  background: #ffffcc;
}
.title-icon.notepad::after {
  content: "≡";
  color: #000;
  font-size: 10px;
  top: 0;
  left: 2px;
}
.title-icon.computer {
  background: #a0a0a0;
}
.title-icon.computer::after {
  content: "";
  width: 8px;
  height: 5px;
  background: #000080;
  top: 3px;
  left: 2px;
  position: absolute;
}

.title-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
  min-width: 0;
}

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

.tb-btn {
  width: 16px;
  height: 14px;
  padding: 0;
  font-size: 10px;
  line-height: 1;
  font-family: var(--font-ui);
  font-weight: bold;
  background: var(--beige);
  border-top: 1px solid var(--white);
  border-left: 1px solid var(--white);
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  color: var(--black);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tb-btn:active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
}

.tb-btn.close {
  font-size: 12px;
  font-weight: bold;
}

.menu-bar {
  display: flex;
  gap: 2px;
  padding: 1px 4px;
  background: var(--beige);
  border-bottom: 1px solid var(--beige-dark);
  font-size: 11px;
  flex-shrink: 0;
}

.menu-item {
  padding: 2px 6px;
  cursor: default;
}
.menu-item:hover {
  background: var(--navy);
  color: var(--white);
}
.menu-item u {
  text-decoration: underline;
  text-underline-offset: 1px;
}

.window-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Terminal */
.win-terminal {
  top: 40px;
  left: 100px;
  width: min(640px, calc(100vw - 24px));
  height: min(420px, calc(100vh - 80px));
}

.terminal-body {
  background: var(--term-bg);
  border-top: 2px solid var(--beige-dark);
  border-left: 2px solid var(--beige-dark);
  border-right: 2px solid var(--beige-light);
  border-bottom: 2px solid var(--beige-light);
  margin: 2px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.35;
  color: var(--term-fg);
  overflow: hidden;
  min-height: 0;
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: #808080 #1a1a1a;
  min-height: 0;
}

.terminal-output .line-err { color: #ff6666; }
.terminal-output .line-ok { color: #66ff99; }
.terminal-output .line-dim { opacity: 0.75; }
.terminal-output .line-cmd { color: inherit; }

.terminal-input-line {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
}

.prompt {
  flex-shrink: 0;
  margin-right: 4px;
  color: var(--term-fg);
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--term-fg);
  font-family: var(--font-mono);
  font-size: 13px;
  caret-color: transparent;
  min-width: 0;
}

.caret {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--term-fg);
  animation: blink 1.06s step-end infinite;
  flex-shrink: 0;
  margin-left: 1px;
  vertical-align: middle;
}

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

/* Notepad windows */
.win-about {
  top: 80px;
  left: 160px;
  width: min(380px, calc(100vw - 24px));
  height: min(380px, calc(100vh - 80px));
}

.win-help {
  top: 60px;
  left: 200px;
  width: min(390px, calc(100vw - 24px));
  height: min(420px, calc(100vh - 80px));
}

.notepad-body {
  background: var(--white);
  border-top: 2px solid var(--beige-dark);
  border-left: 2px solid var(--beige-dark);
  border-right: 2px solid var(--beige-light);
  border-bottom: 2px solid var(--beige-light);
  margin: 2px;
  overflow: auto;
  min-height: 0;
}

.notepad-text {
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  color: var(--black);
  white-space: pre-wrap;
  user-select: text;
  word-break: break-word;
}

/* My Computer */
.win-computer {
  top: 70px;
  left: 140px;
  width: min(320px, calc(100vw - 24px));
  height: min(260px, calc(100vh - 80px));
}

.computer-body {
  background: var(--white);
  border-top: 2px solid var(--beige-dark);
  border-left: 2px solid var(--beige-dark);
  border-right: 2px solid var(--beige-light);
  border-bottom: 2px solid var(--beige-light);
  margin: 2px;
  padding: 10px;
  overflow: auto;
  min-height: 0;
}

.drive-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drive-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 12px;
  cursor: default;
}
.drive-item:hover {
  background: var(--navy);
  color: var(--white);
}

.drive-icon {
  width: 28px;
  height: 24px;
  border: 1px solid #404040;
  flex-shrink: 0;
}
.drive-icon.hdd {
  background: linear-gradient(#808080, #c0c0c0);
}
.drive-icon.floppy {
  background: linear-gradient(#404040, #808080);
}
.drive-icon.cd {
  background: radial-gradient(circle, #e0e0ff 30%, #8080c0 70%);
}
.drive-icon.net {
  background: linear-gradient(135deg, #008080, #00a0a0);
}

.comp-status {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--beige);
  font-size: 11px;
  color: #404040;
}

/* ========== TASKBAR ========== */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: var(--beige);
  border-top: 2px solid var(--beige-light);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 3px;
  z-index: 1000;
  box-shadow: 0 -1px 0 #808080;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px 0 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: bold;
  background: var(--beige);
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  cursor: pointer;
  color: var(--black);
  flex-shrink: 0;
}

.start-btn:active,
.start-btn.active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  padding: 1px 7px 0 5px;
}

.start-logo {
  width: 16px;
  height: 16px;
  border: 1px solid #000;
  image-rendering: pixelated;
  background:
    linear-gradient(#ff0000 50%, #0000ff 50%) 0 0 / 50% 100% no-repeat,
    linear-gradient(#00ff00 50%, #ffff00 50%) 100% 0 / 50% 100% no-repeat;
  background-color: #000;
  flex-shrink: 0;
}

.task-buttons {
  display: flex;
  gap: 3px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.task-btn {
  height: 22px;
  max-width: 160px;
  min-width: 80px;
  padding: 0 8px;
  font-family: var(--font-ui);
  font-size: 11px;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--beige);
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  cursor: pointer;
  color: var(--black);
}

.task-btn.active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  background: #dfdfdf;
  font-weight: bold;
}

.tray {
  display: flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-top: 1px solid var(--beige-dark);
  border-left: 1px solid var(--beige-dark);
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
  background: var(--beige);
  flex-shrink: 0;
  max-width: 45%;
  overflow: hidden;
}

.clock {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.powered-by {
  font-size: 10px;
  color: #404040;
  margin-right: 8px;
  white-space: nowrap;
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.powered-by::before {
  content: "Powered by ";
  color: #808080;
  font-size: 9px;
}

/* ========== START MENU ========== */
.start-menu {
  position: absolute;
  bottom: 28px;
  left: 2px;
  width: 210px;
  background: var(--beige);
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  display: flex;
  z-index: 2000;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
}

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

.start-banner {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-mid) 55%, #0870b8 100%);
  color: var(--beige-light);
  font-weight: bold;
  font-size: 17px;
  font-family: "Arial Black", Arial, sans-serif;
  padding: 10px 5px;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 30px;
  text-shadow: 1px 0 0 rgba(0,0,0,0.35);
}
.start-banner span {
  color: var(--white);
  margin-top: 6px;
  font-size: 15px;
  letter-spacing: 2px;
}

.start-list {
  list-style: none;
  flex: 1;
  padding: 2px 0;
  background: var(--beige);
  min-width: 0;
}

.start-list li button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  color: var(--black);
}

.start-list li button:hover,
.start-list li button:focus {
  background: var(--navy);
  color: var(--white);
  outline: none;
}

.start-list .divider {
  height: 1px;
  margin: 4px 2px;
  background: var(--beige-dark);
  border-bottom: 1px solid var(--white);
}

.sm-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 1px solid #606060;
  background: #c0c0c0;
}
.sm-icon.terminal { background: #1a1a1a; }
.sm-icon.computer { background: #8080a0; }
.sm-icon.about { background: #ffffcc; }
.sm-icon.help { background: #ffffaa; }
.sm-icon.shutdown { background: #800000; }

/* ========== SHUTDOWN ========== */
.shutdown {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shutdown[hidden] {
  display: none !important;
}

.shutdown-box {
  text-align: center;
  color: #c0c0c0;
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.6;
}

.shutdown-box p {
  margin-bottom: 24px;
}

.win-btn {
  padding: 4px 20px;
  font-family: var(--font-ui);
  font-size: 12px;
  background: var(--beige);
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  cursor: pointer;
  color: var(--black);
}
.win-btn:active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
}

/* ========== MOBILE ========== */
@media (max-width: 600px) {
  .desktop-icons {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 100%;
    height: auto;
    gap: 4px;
    padding: 8px 4px;
  }

  .desk-icon {
    width: 64px;
  }

  .win-terminal,
  .win-about,
  .win-help,
  .win-computer {
    top: 4px !important;
    left: 2px !important;
    right: 2px !important;
    width: calc(100vw - 4px) !important;
    height: calc(100vh - 36px) !important;
    max-width: none;
    max-height: none;
    min-width: 0;
  }

  .terminal-body {
    font-size: 12px;
  }

  #terminal-input {
    font-size: 16px; /* prevent iOS zoom */
  }

  .task-btn {
    min-width: 48px;
    max-width: 90px;
    padding: 0 4px;
    font-size: 10px;
  }

  .powered-by::before {
    content: "";
  }

  .powered-by {
    font-size: 9px;
    margin-right: 4px;
  }

  .tray {
    padding: 0 4px;
    max-width: 40%;
  }

  .start-menu {
    width: min(230px, calc(100vw - 6px));
  }

  .start-banner {
    font-size: 15px;
    min-width: 26px;
  }
}

@media (max-height: 500px) {
  .win-terminal,
  .win-about,
  .win-help,
  .win-computer {
    height: calc(100vh - 36px);
    top: 2px;
  }
}

@media (max-width: 360px) {
  .powered-by {
    display: none;
  }
}
