/* =========================================================================
   Windows 250 — authentic Windows 95 styling
   ========================================================================= */

@font-face {
  font-family: "MS Sans Serif";
  src: url("../fonts/ms_sans_serif.woff") format("woff");
  font-weight: normal;
  font-display: swap;
}
@font-face {
  font-family: "MS Sans Serif";
  src: url("../fonts/ms_sans_serif_bold.woff") format("woff");
  font-weight: bold;
  font-display: swap;
}

:root {
  --silver: #c0c0c0;
  --silver-light: #dfdfdf;
  --gray: #808080;
  --dark: #0a0a0a;
  --white: #ffffff;
  --desktop: #008080;          /* classic Win95 teal */
  --title-active-1: #000080;   /* navy */
  --title-active-2: #1084d0;   /* lighter blue */
  --title-inactive-1: #808080;
  --title-inactive-2: #b5b5b5;
  --selection: #000080;
  --font: "MS Sans Serif", "Pixelated MS Sans Serif", Tahoma, "Segoe UI", sans-serif;
}

/* Beveled border systems (Win95 3D edges) */
.bevel-out {
  box-shadow:
    inset -1px -1px 0 var(--dark),
    inset 1px 1px 0 var(--white),
    inset -2px -2px 0 var(--gray),
    inset 2px 2px 0 var(--silver-light);
}
.bevel-in {
  box-shadow:
    inset -1px -1px 0 var(--white),
    inset 1px 1px 0 var(--gray),
    inset -2px -2px 0 var(--silver-light),
    inset 2px 2px 0 var(--dark);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%; width: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 12px;
  color: #000;
  background: #000;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  touch-action: manipulation;
}

.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hidden { display: none !important; }

/* ========================= BOOT: BIOS / DOS ========================= */
.boot-screen {
  background: #000;
  color: #c8c8c8;
  font-family: "Consolas", "Courier New", monospace;
  padding: 22px 26px;
  overflow: hidden;
}
.bios-text {
  margin: 0;
  font-family: "Consolas", "Lucida Console", "Courier New", monospace;
  font-size: 15px;
  line-height: 1.35;
  color: #d6d6d6;
  white-space: pre-wrap;
  text-shadow: 0 0 1px rgba(200,200,200,.35);
}
.bios-text .cursor {
  display: inline-block;
  width: 9px; height: 15px;
  background: #d6d6d6;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.starting-text {
  color: #c8c8c8;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 15px;
  padding: 22px 26px;
}
.dots::after {
  content: "";
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}

/* ============================ BOOT: SPLASH ============================ */
#screen-splash, #screen-shutdown-wait {
  background:
    radial-gradient(ellipse at 50% 40%, #2a2f6b 0%, #0b0d33 70%, #050616 100%);
  display: flex; align-items: center; justify-content: center;
}
.splash {
  width: min(560px, 86vw);
  text-align: center;
  color: #e8e8ff;
}
.splash-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 22px; margin-bottom: 64px;
}
.splash-flag {
  width: 92px; height: 92px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 5px;
  transform: perspective(300px) rotateY(-12deg);
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,.5));
}
.splash-flag .pane { border-radius: 2px; }
.pane.red    { background: #ff3b30; }
.pane.green  { background: #34c759; }
.pane.blue   { background: #0a84ff; }
.pane.yellow { background: #ffcc00; }
.splash-wordmark { text-align: left; }
.splash-microsoft {
  font-family: var(--font);
  font-size: 15px; font-style: italic; color: #c9c9e8;
  margin-bottom: 2px; letter-spacing: .3px;
}
.splash-windows {
  font-family: "Franklin Gothic Medium", "Arial Narrow", var(--font);
  font-weight: bold; font-size: 46px; line-height: .95;
  color: #fff; letter-spacing: -1px;
}
.splash-250 {
  display: block;
  font-size: 64px; color: #fff;
  text-shadow: 2px 2px 0 rgba(10,132,255,.55);
}
.splash-progress {
  width: 280px; height: 22px; margin: 0 auto;
  background: #1a1c3a;
  border: 2px solid #0a0b22;
  padding: 3px;
  display: flex; gap: 3px; overflow: hidden;
}
.splash-progress-bar {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg, #0a84ff 0 14px, transparent 14px 17px);
  background-size: 17px 100%;
  transition: none;
}
.splash-copyright {
  margin-top: 40px; font-family: var(--font);
  font-size: 12px; color: #9a9ac4;
}

/* ============================ DESKTOP ============================ */
#desktop { background: var(--desktop); overflow: hidden; }

.icon-layer {
  position: absolute;
  inset: 0 0 30px 0;
  padding: 6px;
}
.desktop-icon {
  position: absolute;
  width: 76px;
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 2px 5px;
  cursor: default;
  text-align: center;
}
.desktop-icon .icon-img {
  width: 32px; height: 32px;
  margin-bottom: 4px;
  image-rendering: pixelated;
  pointer-events: none;
}
.desktop-icon .icon-label {
  color: #fff;
  font-size: 11px;
  line-height: 1.15;
  padding: 1px 2px;
  max-width: 74px;
  word-wrap: break-word;
  text-shadow: 1px 1px 0 rgba(0,0,0,.55);
}
.desktop-icon.selected .icon-img {
  filter: drop-shadow(0 0 0 #00008a);
  background: rgba(0,0,128,.45);
}
.desktop-icon.selected .icon-label {
  background: var(--selection);
  outline: 1px dotted #fff;
  outline-offset: -1px;
  text-shadow: none;
}

/* ============================ TASKBAR ============================ */
.taskbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 30px;
  background: var(--silver);
  box-shadow: inset 0 1px 0 var(--white), inset 0 2px 0 var(--silver-light);
  display: flex; align-items: center;
  padding: 2px 3px;
  gap: 4px;
  z-index: 9000;
}
.start-button {
  height: 23px;
  min-width: 54px;
  display: flex; align-items: center; gap: 4px;
  padding: 0 6px 0 4px;
  font-family: var(--font);
  font-size: 12px; font-weight: bold;
  background: var(--silver);
  border: none;
  cursor: default;
}
.start-button.bevel-out, .start-button:not(.pressed) {
  box-shadow:
    inset -1px -1px 0 var(--dark),
    inset 1px 1px 0 var(--white),
    inset -2px -2px 0 var(--gray),
    inset 2px 2px 0 var(--silver-light);
}
.start-button.pressed {
  box-shadow:
    inset -1px -1px 0 var(--white),
    inset 1px 1px 0 var(--gray),
    inset -2px -2px 0 var(--silver-light),
    inset 2px 2px 0 var(--dark);
}
.start-button.pressed .start-flag,
.start-button.pressed .start-label { transform: translate(1px, 1px); }

.start-flag, .splash-flag.mini {
  width: 16px; height: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  transform: skewX(-6deg);
}
.start-flag .pane { border-radius: 1px; }
.start-label { line-height: 1; }

.taskbar-divider {
  width: 0; height: 22px;
  border-left: 1px solid var(--gray);
  border-right: 1px solid var(--white);
  margin: 0 1px;
}
.taskbar-apps {
  flex: 1;
  display: flex; align-items: center; gap: 3px;
  overflow: hidden;
  height: 23px;
}
.taskbar-app {
  height: 23px;
  min-width: 0;
  flex: 0 1 160px;
  display: flex; align-items: center; gap: 5px;
  padding: 0 6px;
  font-size: 11px;
  background: var(--silver);
  cursor: default;
  overflow: hidden;
  white-space: nowrap;
}
.taskbar-app .ta-img { width: 16px; height: 16px; flex: 0 0 16px; image-rendering: pixelated; }
.taskbar-app .ta-label { overflow: hidden; text-overflow: ellipsis; }
.taskbar-app.active {
  box-shadow:
    inset -1px -1px 0 var(--white),
    inset 1px 1px 0 var(--gray),
    inset -2px -2px 0 var(--silver-light),
    inset 2px 2px 0 var(--dark);
  background: repeating-conic-gradient(#bdbdbd 0% 25%, #c0c0c0 0% 50%) 0 0/2px 2px;
  font-weight: bold;
}
.taskbar-app:not(.active) {
  box-shadow:
    inset -1px -1px 0 var(--dark),
    inset 1px 1px 0 var(--white),
    inset -2px -2px 0 var(--gray),
    inset 2px 2px 0 var(--silver-light);
}
.taskbar-app.active .ta-label { transform: translate(1px,1px); }

.systray {
  height: 23px;
  display: flex; align-items: center; gap: 4px;
  padding: 0 4px 0 6px;
  box-shadow:
    inset -1px -1px 0 var(--white),
    inset 1px 1px 0 var(--gray),
    inset -2px -2px 0 var(--silver-light),
    inset 2px 2px 0 var(--dark);
}
.tray-icons { display: flex; align-items: center; gap: 3px; }
.tray-icon { font-size: 13px; line-height: 1; cursor: default; filter: grayscale(.1); }
.clock {
  font-size: 11px;
  padding: 0 4px;
  min-width: 52px;
  text-align: center;
}

/* ============================ START MENU ============================ */
.start-menu {
  position: absolute;
  left: 3px; bottom: 31px;
  display: flex;
  background: var(--silver);
  padding: 3px;
  z-index: 9500;
  box-shadow:
    inset -1px -1px 0 var(--dark),
    inset 1px 1px 0 var(--white),
    inset -2px -2px 0 var(--gray),
    inset 2px 2px 0 var(--silver-light);
}
.start-menu-sidebar {
  width: 30px;
  background: linear-gradient(180deg, #000080, #1a1a6b);
  margin-right: 3px;
  position: relative;
}
.sidebar-text {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: rotate(-90deg) translateX(0);
  transform-origin: left bottom;
  white-space: nowrap;
  color: #c0c0c0;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: .5px;
}
.sidebar-text b { color: #fff; }
.start-menu-items { min-width: 184px; padding: 1px; }

.start-item, .menu-item {
  display: flex; align-items: center;
  height: 24px;
  padding: 0 22px 0 4px;
  font-size: 12px;
  position: relative;
  cursor: default;
}
.start-item-icon {
  width: 24px; height: 24px;
  margin-right: 7px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex: 0 0 24px;
}
.start-item-label u, .menu-item u, .start-item-label, .menu-item { pointer-events: none; }
.start-item:hover, .start-item.open,
.menu-item:not(.disabled):hover {
  background: var(--selection);
  color: #fff;
}
.start-menu-sep, .menu-sep {
  height: 0; margin: 3px 2px;
  border-top: 1px solid var(--gray);
  border-bottom: 1px solid var(--white);
}
.has-arrow::after {
  content: "";
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  border-left: 4px solid #000;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.start-item:hover.has-arrow::after,
.menu-item:hover.has-arrow::after { border-left-color: #fff; }

/* ============================ CONTEXT MENU ============================ */
.context-menu {
  position: absolute;
  background: var(--silver);
  padding: 2px;
  min-width: 150px;
  z-index: 9600;
  box-shadow:
    inset -1px -1px 0 var(--dark),
    inset 1px 1px 0 var(--white),
    inset -2px -2px 0 var(--gray),
    inset 2px 2px 0 var(--silver-light);
}
.context-menu .menu-item { height: 21px; padding: 0 24px 0 22px; }
.menu-item.disabled { color: var(--gray); text-shadow: 1px 1px 0 var(--white); }

/* ============================ WINDOWS ============================ */
.window {
  position: absolute;
  background: var(--silver);
  padding: 3px;
  display: flex; flex-direction: column;
  min-width: 140px; min-height: 80px;
  box-shadow:
    inset -1px -1px 0 var(--dark),
    inset 1px 1px 0 var(--white),
    inset -2px -2px 0 var(--gray),
    inset 2px 2px 0 var(--silver-light);
}
.window.maximized {
  left: 0 !important; top: 0 !important;
  width: 100% !important;
  height: calc(100% - 30px) !important;
}
.title-bar {
  height: 20px;
  display: flex; align-items: center;
  padding: 0 2px 0 3px;
  background: linear-gradient(90deg, var(--title-inactive-1), var(--title-inactive-2));
  color: #d6d6d6;
  cursor: default;
  flex: 0 0 auto;
}
.window.focused .title-bar {
  background: linear-gradient(90deg, var(--title-active-1), var(--title-active-2));
  color: #fff;
}
.title-bar-icon { width: 16px; height: 16px; margin-right: 4px; image-rendering: pixelated; flex: 0 0 16px; }
.title-bar-text {
  flex: 1; font-weight: bold; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: .2px;
}
.title-bar-controls { display: flex; gap: 2px; }
.tbc {
  width: 16px; height: 14px;
  background: var(--silver);
  border: none; padding: 0;
  position: relative;
  cursor: default;
  box-shadow:
    inset -1px -1px 0 var(--dark),
    inset 1px 1px 0 var(--white),
    inset -2px -2px 0 var(--gray),
    inset 2px 2px 0 var(--silver-light);
}
.tbc:active {
  box-shadow:
    inset -1px -1px 0 var(--white),
    inset 1px 1px 0 var(--gray),
    inset -2px -2px 0 var(--silver-light),
    inset 2px 2px 0 var(--dark);
}
.tbc .glyph { position: absolute; inset: 0; }
/* minimize glyph */
.tbc.min .glyph::after {
  content: ""; position: absolute;
  left: 3px; bottom: 3px; width: 7px; height: 2px; background: #000;
}
/* maximize glyph */
.tbc.max .glyph::after {
  content: ""; position: absolute;
  left: 3px; top: 3px; width: 9px; height: 8px;
  border: 1px solid #000; border-top-width: 2px;
}
/* close glyph (X) */
.tbc.close .glyph {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='7' viewBox='0 0 8 7'%3E%3Cpath fill='%23000' d='M0 0h2v1h1v1h2V1h1V0h2v1H7v1H6v1H5v1h1v1h1v1h1v1H6V6H5V5H3v1H2v1H0V6h1V5h1V4h1V3H2V2H1V1H0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.tbc.close { margin-left: 2px; }

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

/* Menu bar inside apps */
.menu-bar {
  display: flex; gap: 0;
  font-size: 12px;
  padding: 1px 0;
  flex: 0 0 auto;
}
.menu-bar .mb-item {
  padding: 1px 7px;
  cursor: default;
}
.menu-bar .mb-item u { text-decoration: underline; }
.menu-bar .mb-item:hover { background: var(--selection); color: #fff; }

/* Sunken content panel (e.g. notepad text, folder view) */
.sunken {
  flex: 1;
  background: var(--white);
  margin: 0;
  box-shadow:
    inset -1px -1px 0 var(--white),
    inset 1px 1px 0 var(--gray),
    inset -2px -2px 0 var(--silver-light),
    inset 2px 2px 0 var(--dark);
  overflow: auto;
  min-height: 0;
}

/* Notepad */
.notepad-text {
  width: 100%; height: 100%;
  border: none; outline: none; resize: none;
  font-family: var(--font);
  font-size: 13px;
  padding: 4px 6px;
  background: #fff;
  color: #000;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow: auto;
}

/* Folder / My Computer view */
.folder-view {
  padding: 8px;
  display: flex; flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px 4px;
  background: #fff;
  min-height: 100%;
}
.folder-item {
  width: 78px;
  display: flex; flex-direction: column; align-items: center;
  padding: 5px 2px; cursor: default; text-align: center;
}
.folder-item .fi-img { width: 32px; height: 32px; margin-bottom: 4px; image-rendering: pixelated; }
.folder-item .fi-label { font-size: 11px; line-height: 1.15; }
.folder-item.selected .fi-label { background: var(--selection); color: #fff; }
.folder-item.selected .fi-img { background: rgba(0,0,128,.35); }

/* status bar */
.status-bar {
  display: flex; gap: 2px; margin-top: 3px;
  flex: 0 0 auto;
}
.status-field {
  flex: 1;
  font-size: 11px;
  padding: 1px 5px;
  box-shadow:
    inset -1px -1px 0 var(--white),
    inset 1px 1px 0 var(--gray);
}

/* Buttons inside windows / dialogs */
.btn {
  min-width: 70px; height: 23px;
  padding: 0 12px;
  font-family: var(--font); font-size: 12px;
  background: var(--silver); border: none;
  cursor: default;
  box-shadow:
    inset -1px -1px 0 var(--dark),
    inset 1px 1px 0 var(--white),
    inset -2px -2px 0 var(--gray),
    inset 2px 2px 0 var(--silver-light);
}
.btn:active {
  box-shadow:
    inset -1px -1px 0 var(--white),
    inset 1px 1px 0 var(--gray),
    inset -2px -2px 0 var(--silver-light),
    inset 2px 2px 0 var(--dark);
}
.btn:active span, .btn:active { }
.btn.default { outline: 1px solid #000; outline-offset: -3px; font-weight: bold; }

.dialog-body {
  padding: 14px 14px 10px;
  display: flex; flex-direction: column; gap: 14px;
  flex: 1;
  background: var(--silver);
}
.dialog-row { display: flex; gap: 14px; align-items: flex-start; }
.dialog-icon { width: 32px; height: 32px; flex: 0 0 32px; }
.dialog-msg { font-size: 12px; line-height: 1.5; }
.dialog-buttons { display: flex; gap: 8px; justify-content: center; }
.dialog-input {
  flex: 1; height: 21px;
  font-family: var(--font); font-size: 12px;
  padding: 2px 4px; border: none;
  background: #fff;
  box-shadow:
    inset -1px -1px 0 var(--white),
    inset 1px 1px 0 var(--gray),
    inset -2px -2px 0 var(--silver-light),
    inset 2px 2px 0 var(--dark);
}

/* About / generic text content */
.pad { padding: 14px 16px; font-size: 12px; line-height: 1.6; background: var(--silver); flex:1; }
.pad h2 { margin: 0 0 8px; font-size: 14px; }
.pad p { margin: 0 0 10px; }
.pad .small { color: #404040; font-size: 11px; }

/* ====================== SHUTDOWN / SAFE OFF ====================== */
#screen-shutdown-safe {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #000;
}
.safe-off {
  color: #e0a020;
  font-family: var(--font);
  font-size: 26px; font-weight: bold;
  text-align: center; line-height: 1.5;
  text-shadow: 0 0 8px rgba(224,160,32,.4);
}
.safe-restart {
  margin-top: 40px;
  background: transparent; border: none;
  color: #777; font-family: var(--font); font-size: 13px;
  cursor: pointer; text-decoration: underline;
}
.shutdown-text { color: #e8e8ff; font-size: 22px; font-family: var(--font); }

/* ============================ SELECTION BOX ============================ */
#selbox {
  position: absolute;
  border: 1px dotted #fff;
  background: rgba(255,255,255,.08);
  z-index: 50;
  pointer-events: none;
}

/* ============================ RESIZE HANDLE ============================ */
.resize-handle {
  position: absolute;
  right: 1px; bottom: 1px;
  width: 16px; height: 16px;
  cursor: nwse-resize;
  z-index: 5;
}
.resize-handle::after {
  content: "";
  position: absolute; right: 2px; bottom: 2px;
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-bottom: 9px solid transparent;
  background:
    linear-gradient(135deg, transparent 45%, var(--gray) 45% 55%, transparent 55%) no-repeat,
    linear-gradient(135deg, transparent 70%, var(--gray) 70% 80%, transparent 80%) no-repeat;
}

/* ============================ MS-DOS PROMPT ============================ */
.dos-screen {
  height: 100%;
  background: #000;
  color: #c8c8c8;
  font-family: "Consolas", "Lucida Console", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.3;
  padding: 4px 6px;
  overflow: auto;
  cursor: text;
}
.dos-out { white-space: pre-wrap; word-break: break-word; }
.dos-out > div { min-height: 1em; }
.dos-line { display: flex; align-items: center; }
.dos-prompt { white-space: pre; }
.dos-input {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  color: #c8c8c8;
  font-family: inherit; font-size: inherit;
  caret-color: #c8c8c8;
  padding: 0 0 0 1px;
}

/* ============================ MOBILE TWEAKS ============================ */
@media (max-width: 640px) {
  html, body { font-size: 13px; }
  .desktop-icon { width: 70px; }
  .splash-windows { font-size: 36px; }
  .splash-250 { font-size: 48px; }
  .bios-text { font-size: 12px; }
}
