@import url('https://fonts.googleapis.com/css2?family=VT323&family=Pixelify+Sans:wght@400;600;700&display=swap');

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

:root {
  --w98-face: #c0c0c0;
  --w98-light: #ffffff;
  --w98-shadow: #808080;
  --w98-dark: #000000;
  --w98-blue-a: #000080;
  --w98-blue-b: #1084d0;
  --w98-text: #000000;
  --pixfont: 'Pixelify Sans', 'Tahoma', sans-serif;
}

html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--pixfont);
  font-size: 14px;
  -webkit-user-select: none;
  user-select: none;
  background: #008080;
}

#root { height: 100vh; }

.os-root {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  touch-action: none;
}
.os-root.drag-over { outline: 4px dashed #ffff00; outline-offset: -8px; }

/* ---- CRT effect ---- */
.crt::after {
  content: "";
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.14) 0px, rgba(0,0,0,0.14) 1px, transparent 1px, transparent 3px);
  animation: flicker 0.15s infinite;
}
@keyframes flicker { 0%,100%{opacity:1;} 50%{opacity:0.94;} }

/* ---- Bevel helpers ---- */
.sunken {
  border: 2px solid;
  border-color: var(--w98-shadow) var(--w98-light) var(--w98-light) var(--w98-shadow);
  background: #fff;
}

/* ---- Desktop icons ---- */
.desktop-icons {
  position: absolute; top: 10px; left: 10px;
  display: flex; flex-direction: column; gap: 18px; z-index: 1;
}
.desk-icon {
  width: 76px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.desk-icon-img {
  font-size: 34px; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.4));
}
.desk-icon-label {
  color: #fff; font-size: 12px; line-height: 1.1;
  text-shadow: 1px 1px 1px rgba(0,0,0,.7);
  padding: 1px 2px;
}
.desk-icon:active .desk-icon-label,
.desk-icon:focus .desk-icon-label { background: #000080; }

.drop-hint {
  position: absolute; top: 45%; left: 50%; transform: translateX(-50%);
  background: #ffff00; color: #000; padding: 12px 24px;
  border: 3px solid #000; font-size: 20px; z-index: 500;
  box-shadow: 4px 4px 0 rgba(0,0,0,.4);
}

/* ---- Windows ---- */
.win98-window {
  position: absolute;
  background: var(--w98-face);
  border: 2px solid;
  border-color: var(--w98-light) var(--w98-dark) var(--w98-dark) var(--w98-light);
  box-shadow: 1px 1px 0 var(--w98-shadow);
  display: flex; flex-direction: column;
  min-width: 200px;
}
.win98-window::before {
  content: ""; position: absolute; inset: 0;
  border: 1px solid;
  border-color: var(--w98-face) var(--w98-shadow) var(--w98-shadow) var(--w98-face);
  pointer-events: none;
}

.titlebar {
  height: 24px;
  background: linear-gradient(90deg, #808080, #b5b5b5);
  color: #d8d8d8;
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 3px; cursor: default; flex-shrink: 0;
  font-weight: 700;
}
.titlebar.active {
  background: linear-gradient(90deg, var(--w98-blue-a), var(--w98-blue-b));
  color: #fff; cursor: grab;
}
.title-text { display: flex; align-items: center; gap: 5px; font-size: 13px; padding-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-icon { display: inline-flex; }
.title-btns { display: flex; gap: 2px; }
.tb-btn {
  width: 20px; height: 18px; font-size: 11px; line-height: 1;
  background: var(--w98-face);
  border: 2px solid;
  border-color: var(--w98-light) var(--w98-dark) var(--w98-dark) var(--w98-light);
  color: #000; cursor: pointer; font-family: var(--pixfont); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tb-btn:active { border-color: var(--w98-dark) var(--w98-light) var(--w98-light) var(--w98-dark); }
.tb-btn.close { font-size: 10px; }

.menubar {
  display: flex; gap: 2px; padding: 2px 4px; flex-shrink: 0;
  border-bottom: 1px solid var(--w98-shadow);
}
.menu-item { font-size: 13px; padding: 1px 6px; cursor: pointer; }
.menu-item:hover { background: var(--w98-blue-a); color: #fff; }

.win-content { flex: 1; overflow: auto; padding: 8px; position: relative; }

/* ---- Buttons / inputs ---- */
.w98-btn {
  background: var(--w98-face); padding: 4px 12px; font-size: 13px;
  border: 2px solid;
  border-color: var(--w98-light) var(--w98-dark) var(--w98-dark) var(--w98-light);
  cursor: pointer; font-family: var(--pixfont); min-width: 60px;
}
.w98-btn:active {
  border-color: var(--w98-dark) var(--w98-light) var(--w98-light) var(--w98-dark);
  padding: 5px 11px 3px 13px;
}
.w98-input {
  width: 100%; padding: 4px 6px; font-family: var(--pixfont); font-size: 14px;
  border: 2px solid; border-color: var(--w98-shadow) var(--w98-light) var(--w98-light) var(--w98-shadow);
  background: #fff; margin: 6px 0;
}

/* ---- Notepad ---- */
.notepad-area {
  width: 100%; height: 100%; resize: none; border: none;
  font-family: 'VT323', monospace; font-size: 18px; padding: 6px;
  border: 2px solid; border-color: var(--w98-shadow) var(--w98-light) var(--w98-light) var(--w98-shadow);
  outline: none; background: #fff;
}

/* ---- About ---- */
.about-box { text-align: center; }
.about-box h2 { font-size: 24px; margin-bottom: 8px; }
.about-box p { font-size: 13px; margin: 4px 0; }
.about-motto { font-style: italic; color: #000080; font-weight: 700; }
.remix-link { color: #0000ee; text-decoration: underline; }

/* ---- Program view ---- */
.prog-view { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.prog-header { display: flex; gap: 10px; align-items: center; }
.prog-header h3 { font-size: 18px; }
.prog-size { font-size: 11px; color: #444; }
.prog-desc { padding: 8px; font-size: 14px; min-height: 48px; font-family:'VT323',monospace; font-size:17px; }
.prog-fake-ui { display: flex; gap: 6px; flex-wrap: wrap; }
.prog-footer-note { font-size: 10px; color: #555; margin-top: auto; }

/* ---- My Computer ---- */
.mycomputer { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.mc-path { padding: 3px 6px; font-size: 12px; font-family: monospace; }
.mc-empty { padding: 20px; text-align: center; color: #555; }
.mc-grid { display: flex; flex-wrap: wrap; gap: 12px; align-content: flex-start; }
.mc-file { width: 70px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 3px; }
.mc-file:hover { background: #d8e8ff; }
.mc-name { font-size: 11px; word-break: break-all; line-height: 1.1; }

/* ---- Minesweeper ---- */
.mine-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mine-head { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; font-family: 'VT323', monospace; font-size: 18px; color: #ff0000; background:#c0c0c0; }
.face { min-width: 30px; padding: 2px 6px; font-size: 16px; }
.mine-grid { display: grid; gap: 0; border: 2px solid; border-color: var(--w98-shadow) var(--w98-light) var(--w98-light) var(--w98-shadow); }
.mine-cell {
  width: 22px; height: 22px; font-size: 13px; font-weight: 700; padding: 0;
  background: var(--w98-face);
  border: 2px solid; border-color: var(--w98-light) var(--w98-dark) var(--w98-dark) var(--w98-light);
  cursor: pointer; font-family: var(--pixfont);
}
.mine-cell.open { border: 1px solid var(--w98-shadow); background: #bfbfbf; }
.mine-hint { font-size: 10px; color: #333; }

/* ---- Installer / progress ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.15);
}
.installer { width: 340px; max-width: 90vw; }
.installer-body p { font-size: 13px; margin: 6px 0; }
.installer-step { font-family: 'VT323', monospace; font-size: 16px; color: #000080; }
.installer-pct { text-align: center; }
.prog { height: 22px; padding: 2px; margin: 6px 0; background: #fff; }
.prog-fill {
  height: 100%; transition: width 0.2s;
  background: repeating-linear-gradient(90deg, #000080 0, #000080 10px, transparent 10px, transparent 13px);
  background-color: #000080;
}

/* ---- Error dialog ---- */
.err-dialog { width: 380px; max-width: 92vw; }
.err-title { background: linear-gradient(90deg,#7f0000,#c81919) !important; }
.err-body { display: flex; gap: 12px; align-items: center; padding: 16px; }
.err-icon {
  width: 36px; height: 36px; border-radius: 50%; background: #ff0000; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0;
}
.err-body p { font-size: 13px; }
.err-actions { display: flex; gap: 8px; justify-content: center; padding: 8px 0 12px; }

/* ---- BSOD ---- */
.bsod {
  position: fixed; inset: 0; z-index: 900; background: #0000aa; color: #fff;
  font-family: 'VT323', monospace; font-size: 18px; padding: 40px 30px;
  cursor: pointer; overflow: auto; line-height: 1.5;
}
.bsod-title { background: #c0c0c0; color: #0000aa; display: inline-block; padding: 0 8px; margin-bottom: 20px; font-size: 20px; }
.bsod p { margin: 12px 0; max-width: 700px; }
.bsod-hint { animation: blink 1s step-end infinite; margin-top: 24px; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Boot splash ---- */
.boot-splash {
  position: fixed; inset: 0; background: #000; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
}
.boot-logo { font-size: 56px; font-weight: 700; display:flex; align-items:baseline; gap:2px; }
.boot-logo .boot-98 { color:#f5c518; }
.boot-logo .boot-ver { font-size: 24px; color:#e74c3c; margin-left:6px; }
.boot-bar { width: 220px; height: 16px; border: 1px solid #666; padding: 2px; overflow: hidden; }
.boot-bar-fill {
  height: 100%; width: 40px;
  background: repeating-linear-gradient(90deg,#0f0 0,#0f0 8px,transparent 8px,transparent 12px);
  background-color:#0f0;
  animation: bootslide 1.4s linear infinite;
}
@keyframes bootslide { from { margin-left:-40px; } to { margin-left: 220px; } }
.boot-tag { font-family:'VT323',monospace; font-size: 20px; color:#aaa; }

/* ---- Shutdown ---- */
.shutdown-screen {
  position: fixed; inset: 0; background: #000; color: #ffb700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
  font-family: 'VT323', monospace;
}
.safe-box { text-align: center; font-size: 32px; line-height: 1.4; text-shadow: 0 0 8px #ff8c00; }
.reboot-btn {
  padding: 8px 24px; background: #c0c0c0; color:#000; font-family: var(--pixfont); font-size: 14px;
  border: 2px solid; border-color: var(--w98-light) var(--w98-dark) var(--w98-dark) var(--w98-light); cursor: pointer;
}

/* ---- Winey mascot ---- */
.winey {
  position: fixed; right: 14px; bottom: 46px; z-index: 700;
  display: flex; align-items: flex-end; gap: 4px; max-width: 260px;
  animation: pop 0.3s ease-out;
}
@keyframes pop { from { transform: translateY(20px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.winey-bubble {
  position: relative; background: #ffffcc; border: 2px solid #000;
  padding: 8px 22px 8px 8px; font-size: 12px; line-height: 1.3; border-radius: 6px;
  box-shadow: 2px 2px 0 rgba(0,0,0,.3);
}
.winey-bubble::after {
  content: ""; position: absolute; right: -8px; bottom: 12px;
  border: 6px solid transparent; border-left-color: #000;
}
.winey-x {
  position: absolute; top: 2px; right: 3px; border: none; background: none;
  cursor: pointer; font-size: 10px; color: #333;
}
.winey-glass { font-size: 32px; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0) rotate(-4deg);} 50%{ transform: translateY(-4px) rotate(4deg);} }

/* ---- Start menu ---- */
.start-menu {
  position: fixed; left: 2px; bottom: 34px; z-index: 750;
  background: var(--w98-face); display: flex;
  border: 2px solid; border-color: var(--w98-light) var(--w98-dark) var(--w98-dark) var(--w98-light);
  box-shadow: 2px 2px 4px rgba(0,0,0,.4);
  min-width: 200px;
  animation: startup 0.15s ease-out;
}
@keyframes startup { from { transform: translateY(15px); opacity:0; } to { transform: none; opacity:1; } }
.start-banner {
  width: 30px; background: linear-gradient(180deg, #000080, #1a1a4a 60%, #000);
  writing-mode: vertical-rl; transform: rotate(180deg);
  color: #fff; font-weight: 700; font-size: 17px; text-align: center; padding: 8px 4px;
  display: flex; gap: 3px; justify-content: flex-end; align-items:center;
}
.start-banner b { color: #c0c0c0; }
.start-banner .start-98 { color: #f5c518; font-size: 13px; }
.start-items { flex: 1; padding: 2px; }
.start-item {
  padding: 6px 20px 6px 8px; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.start-item:hover { background: var(--w98-blue-a); color: #fff; }
.start-item-icon { font-size: 16px; width: 18px; text-align:center; }
.start-divider { border-top: 1px solid var(--w98-shadow); margin-top: 4px; padding-top: 8px; }

/* ---- Taskbar ---- */
.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 34px; z-index: 760;
  background: var(--w98-face);
  border-top: 2px solid var(--w98-light);
  display: flex; align-items: center; gap: 4px; padding: 3px 4px;
}
.start-btn {
  display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 14px;
  padding: 3px 10px 3px 6px; height: 26px;
  background: var(--w98-face); cursor: pointer; font-family: var(--pixfont);
  border: 2px solid; border-color: var(--w98-light) var(--w98-dark) var(--w98-dark) var(--w98-light);
}
.start-btn.pressed { border-color: var(--w98-dark) var(--w98-light) var(--w98-light) var(--w98-dark); }
.start-logo { color: #cc0000; font-size: 16px; }
.task-divider { width: 2px; height: 24px; border-left: 1px solid var(--w98-shadow); border-right: 1px solid var(--w98-light); }
.task-windows { flex: 1; display: flex; gap: 4px; overflow: hidden; }
.task-win-btn {
  display: flex; align-items: center; gap: 5px; max-width: 160px; height: 26px;
  padding: 2px 8px; font-size: 12px; cursor: pointer; font-family: var(--pixfont);
  background: var(--w98-face);
  border: 2px solid; border-color: var(--w98-light) var(--w98-dark) var(--w98-dark) var(--w98-light);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 160px;
}
.task-win-btn.active { border-color: var(--w98-dark) var(--w98-light) var(--w98-light) var(--w98-dark); background: #dfdfdf; font-weight:700; }
.twb-icon { display: inline-flex; flex-shrink: 0; }
.systray {
  display: flex; align-items: center; gap: 8px; padding: 2px 6px; height: 26px;
}
.tray-icon { cursor: pointer; font-size: 14px; }
.tray-clock { font-size: 13px; min-width: 60px; text-align: center; }

/* ---- Run / Settings ---- */
.run-dialog { width: 340px; max-width: 92vw; }
.run-body p { font-size: 13px; }
.run-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.settings-box { font-size: 13px; }
.settings-label { font-weight: 700; margin-bottom: 6px; }
.wall-opts { display: flex; flex-direction: column; gap: 6px; }
.wall-opt { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.settings-hr { margin: 12px 0; border: none; border-top: 1px solid var(--w98-shadow); }
.settings-note { font-size: 11px; color: #555; margin-top: 12px; font-style: italic; }

/* ---- Mobile ---- */
@media (max-width: 700px) {
  .desktop-icons { gap: 12px; }
  .desk-icon { width: 64px; }
  .desk-icon-img { font-size: 28px; }
  .task-win-btn { flex: 0 1 90px; max-width: 90px; }
  .boot-logo { font-size: 40px; }
  .winey { max-width: 200px; }
}
</parameter>