/* MS W98 UI font — conversion of original MS Sans Serif by MARTYR-X-LTD */
@font-face {
  font-family: 'MS W98 UI';
  src: url('https://cdn.jsdelivr.net/gh/MARTYR-X-LTD/ms-w98-ui@main/Web-TT/MSW98UI-Regular.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/gh/MARTYR-X-LTD/ms-w98-ui@main/Web-TT/MSW98UI-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'MS W98 UI';
  src: url('https://cdn.jsdelivr.net/gh/MARTYR-X-LTD/ms-w98-ui@main/Web-TT/MSW98UI-Bold.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/gh/MARTYR-X-LTD/ms-w98-ui@main/Web-TT/MSW98UI-Bold.woff') format('woff');
  font-weight: bold;
  font-style: normal;
}

/* Windows 95/98 Main Styles */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'MS W98 UI', 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  overflow-y: hidden;
  overflow-x: hidden;
}

body {
  height: 100%;
  min-height: 100%;
  background: url("../images/background.jpg") no-repeat center center fixed;
  background-size: cover;
}

/* Hourglass cursor during loading */
body.cursor-wait,
body.cursor-wait * {
  cursor: wait !important;
}

/* Draggable Element Styles */
.grabbable {
  cursor: grab;
  cursor: -moz-grab;
  cursor: -webkit-grab;
}

.grabbable:active {
  cursor: grabbing;
  cursor: -moz-grabbing;
  cursor: -webkit-grabbing;
}

/* Desktop and Icon Styles */
#icon-container {
  top: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'MS W98 UI', 'MS Sans Serif', Arial, sans-serif;
}

.icon {
  width: 64px;
  text-align: center;
}

.icon-text {
  background-color: darkblue;
  color: white;
  padding: 2px 3px;
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
  line-height: 1.2;
}

.icon-image {
  width: 38px;
  max-width: 38px;
}

/* Window Styles — scoped to our container so they don't bleed into Webamp */
#windows-container .window,
#startmenu.window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Neutralise 98.css .window rules inside Webamp — only kill shadow/padding */
#webamp .window {
  box-shadow: none !important;
  padding: 0 !important;
  resize: none !important;
}

/* Neutralise 98.css .title-bar rules inside Webamp — don't touch display */
#webamp .title-bar {
  height: revert !important;
  min-height: unset !important;
  padding: revert !important;
  background: revert !important;
}

.window-start {
  position: absolute;
}

.window-ie {
  overflow: auto;
}

.window-body {
  margin: 2px;
}

/* Footer and Taskbar Styles */
.footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 30px;
  background-color: #c0c0c0;
  border-top: 1px solid #fff;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 2px 2px;
  gap: 2px;
  z-index: 9999;
}

.start-button {
  font-weight: bold;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  height: 22px;
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: 4px;
}

.taskbar-divider {
  width: 2px;
  height: 20px;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  flex-shrink: 0;
}

.task-button {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  height: 22px;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.system-tray {
  display: flex;
  align-items: center;
  height: 22px;
  padding: 0 6px;
  gap: 6px;
  flex-shrink: 0;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
}

.tray-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tray-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  cursor: pointer;
}

/* Content Styles */
iframe {
  display: block;
  width: 100%;
  height: 100%;
}

.homepage {
  text-align: center;
  overflow: hidden;
}

/* IRC Styles */
.irc-container {
  display: grid;
  grid-template-columns: 85% 15%;
  grid-template-rows: 100%;
  gap: 0px 0px;
  grid-auto-flow: row;
  grid-template-areas: ". .";
}

/* Start Menu Styles */
.start-menu-sidebar {
  background-color: #000080;
  display: inline-block;
  vertical-align: bottom;
  height: 400px;
}

/* Task Area */
.task-area {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
}

/* Clock Styles */
#clock {
  font-size: 11px;
  color: black;
  white-space: nowrap;
}

/* Window States */
.window.maximized {
  top: 0 !important;
  left: 0 !important;
  transform: none !important;
}

.window.focused .title-bar {
  background: linear-gradient(90deg, navy, #1084d0);
}

/* ── Resize handles ── */

.resize-handle {
  position: absolute;
  z-index: 10;
}

/* Corners */
.resize-handle[data-dir="nw"] { top: 0; left: 0; width: 8px; height: 8px; cursor: nw-resize; }
.resize-handle[data-dir="ne"] { top: 0; right: 0; width: 8px; height: 8px; cursor: ne-resize; }
.resize-handle[data-dir="sw"] { bottom: 0; left: 0; width: 8px; height: 8px; cursor: sw-resize; }

/* SE corner — transparent click target only; windows with scrollbar corners (e.g. Notepad) provide their own visual grip */
.resize-handle[data-dir="se"] {
  bottom: 0; right: 0; width: 12px; height: 12px; cursor: se-resize;
}

/* Edges */
.resize-handle[data-dir="n"] { top: 0; left: 8px; right: 8px; height: 4px; cursor: n-resize; }
.resize-handle[data-dir="s"] { bottom: 0; left: 8px; right: 8px; height: 4px; cursor: s-resize; }
.resize-handle[data-dir="e"] { top: 8px; right: 0; bottom: 8px; width: 4px; cursor: e-resize; }
.resize-handle[data-dir="w"] { top: 8px; left: 0; bottom: 8px; width: 4px; cursor: w-resize; }

/* Hide handles on maximized windows */
.window.maximized .resize-handle { display: none; }

/* Taskbar button active state (minimized window) */
.task-button.active {
  box-shadow: inset -1px -1px #fff, inset 1px 1px #808080, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}

/* Start Menu */
#startmenu {
  display: flex;
  flex-direction: row;
}

#start-menu-items {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 2px 0;
  overflow-y: auto;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  color: #000;
}

.start-menu-item:hover {
  background-color: #000080;
  color: #fff;
}

.start-menu-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.start-menu-arrow {
  margin-left: auto;
  padding-left: 8px;
  font-size: 9px;
}

.start-menu-separator {
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
  margin: 3px 4px;
}

.start-menu-folder {
  position: relative;
}

.start-menu-submenu {
  display: none;
  position: fixed;
  background-color: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  min-width: 180px;
  z-index: 10001;
  padding: 2px 0;
  box-shadow: 2px 2px 0 #000;
}


/* Desktop area */
.desktop-area {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
}

/* ── Modem tray tooltip ── */
.modem-tray-tooltip {
  position: fixed;
  z-index: 10000;
  background: #ffffe1;
  border: 1px solid #000;
  padding: 4px 6px;
  font-size: 11px;
  font-family: 'MS W98 UI', 'MS Sans Serif', Arial, sans-serif;
  line-height: 1.5;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 1px 1px 0 #000;
}

/* ── Win98 dialog centering ── */
.win98-dialog {
  position: fixed;
  z-index: 9999;
}

/* ── CRT screen overlay ──
 * Scanlines every 2px at ~1/6 the opacity of the reference site.
 * Vignette darkens edges gently. pointer-events:none so nothing is blocked. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  background:
    linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.08) 50%),
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0,0,0,0.12) 100%);
  background-size: 100% 2px, 100% 100%;
}