/* =========================================================================
 * Authentic Windows 95 OSR2 Desktop & Window Chrome for SimSafari WASM
 * ========================================================================= */

@font-face {
  font-family: 'Marlett';
  src: url('./win95/marlett.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --w95-teal: #008080;
  --w95-face: #c0c0c0;
  --w95-light: #dfdfdf;
  --w95-white: #ffffff;
  --w95-shadow: #808080;
  --w95-dark: #000000;
  --w95-navy: #000080;
  --w95-inactive: #808080;
  --w95-inactive-text: #c0c0c0;
  --w95-font: 'MS Sans Serif', 'Microsoft Sans Serif', Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--w95-font);
  font-size: 11px;
  line-height: 13px;
  color: var(--w95-dark);
  user-select: none;
  font-smooth: never;
  -webkit-font-smoothing: none;
}

/* ---------- Classic Win95 Bevels ---------- */
.w95-raised {
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
}

.w95-sunken {
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow),
    inset -2px -2px var(--w95-light),
    inset 2px 2px var(--w95-dark);
}

.w95-sunken-thin {
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow);
}

.w95-window-frame {
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-light),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-white);
  padding: 3px;
}

/* ---------- Desktop ---------- */
#desktop {
  position: relative;
  width: 100vw;
  height: calc(100vh - 28px);
  background-color: var(--w95-teal);
  overflow: hidden;
}

#desktop.wallpaper-clouds {
  background-color: #5b8ec4;
  background-image: url('./win95/clouds.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ---------- Desktop Icons ---------- */
#desktop-icons {
  position: absolute;
  top: 10px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1;
}

.desktop-icon {
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 3px 2px;
  background: transparent;
  border: none;
  cursor: default;
  text-align: center;
  outline: none;
}

.desktop-icon .icon-img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  display: block;
}

.desktop-icon .icon-label {
  color: #ffffff;
  font-family: var(--w95-font);
  font-size: 11px;
  line-height: 1.2;
  padding: 1px 3px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.75);
  word-wrap: break-word;
  max-width: 72px;
}

.desktop-icon.selected .icon-img {
  filter: drop-shadow(0 0 0 #000080) brightness(0.82) saturate(1.4);
}

.desktop-icon.selected .icon-label {
  background: var(--w95-navy);
  color: #ffffff;
  text-shadow: none;
  outline: 1px dotted #ffff00;
}

/* ---------- Win95 Windows ---------- */
.w95-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.w95-window.active {
  z-index: 20;
}

.w95-window.hidden {
  display: none !important;
}

.w95-titlebar {
  height: 19px;
  background: var(--w95-navy);
  color: var(--w95-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 3px;
  gap: 4px;
  cursor: default;
  flex-shrink: 0;
}

.w95-window:not(.active) .w95-titlebar {
  background: var(--w95-inactive);
  color: var(--w95-inactive-text);
}

.w95-titlebar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.w95-titlebar-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.w95-titlebar-text {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w95-caption-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.w95-cap-btn {
  width: 16px;
  height: 14px;
  padding: 0;
  border: none;
  background: var(--w95-face);
  color: var(--w95-dark);
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  font-family: 'Marlett', var(--w95-font);
  font-size: 9px;
  line-height: 1;
}

.w95-cap-btn:active {
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-dark),
    inset -2px -2px var(--w95-light),
    inset 2px 2px var(--w95-shadow);
  padding: 1px 0 0 1px;
}

.w95-cap-btn.btn-close {
  margin-left: 2px;
}

/* ---------- Win95 Buttons & Inputs ---------- */
.w95-btn,
#vm-controls-window button:not(.w95-cap-btn),
#halted-overlay button:not(.w95-cap-btn) {
  font-family: var(--w95-font);
  font-size: 11px;
  color: var(--w95-dark);
  background: var(--w95-face);
  border: none;
  padding: 4px 10px;
  min-height: 23px;
  cursor: default;
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
  outline: none;
}

.w95-btn:active:not(:disabled),
#vm-controls-window button:not(.w95-cap-btn):active:not(:disabled),
#halted-overlay button:not(.w95-cap-btn):active:not(:disabled),
#vm-controls-window button:not(.w95-cap-btn).active {
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-dark),
    inset -2px -2px var(--w95-light),
    inset 2px 2px var(--w95-shadow);
  padding: 5px 9px 3px 11px;
}

#vm-controls-window button:not(.w95-cap-btn).active {
  background-image: repeating-conic-gradient(#ffffff 0% 25%, #c0c0c0 0% 50%);
  background-size: 2px 2px;
  font-weight: 700;
}

.w95-btn:focus-visible,
#vm-controls-window button:not(.w95-cap-btn):focus-visible {
  outline: 1px dotted var(--w95-dark);
  outline-offset: -4px;
}

.w95-btn:disabled,
#vm-controls-window button:not(.w95-cap-btn):disabled {
  color: var(--w95-shadow);
  text-shadow: 1px 1px 0 var(--w95-white);
}

.w95-btn.default-btn {
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-dark),
    inset -2px -2px var(--w95-dark),
    inset 2px 2px var(--w95-white),
    inset -3px -3px var(--w95-shadow),
    inset 3px 3px var(--w95-light);
}

/* Authentic Win95 ComboBox (sunken white field + raised 16x18 Marlett '6' button) */
.w95-combobox {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 140px;
  height: 22px;
}

.w95-select,
.w95-input,
#vm-controls-window select {
  font-family: var(--w95-font);
  font-size: 11px;
  color: var(--w95-dark);
  background: var(--w95-white);
  border: none;
  border-radius: 0;
  padding: 2px 5px;
  height: 22px;
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow),
    inset -2px -2px var(--w95-light),
    inset 2px 2px var(--w95-dark);
  outline: none;
}

.w95-combobox select {
  width: 100%;
  height: 22px;
  padding: 2px 22px 2px 5px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: default;
}

.w95-combobox select:focus {
  outline: 1px dotted var(--w95-dark);
  outline-offset: -3px;
}

.w95-combo-btn {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 16px;
  height: 18px;
  background: var(--w95-face);
  color: var(--w95-dark);
  font-family: 'Marlett', var(--w95-font);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
}

/* ---------- SimSafari Main Application Window ---------- */
#simsafari-window {
  left: 96px;
  top: 16px;
}

#simsafari-window.zoomed-fit {
  left: 88px !important;
  top: 8px !important;
}

/* Authentic Docked Win95 Menu Bar inside SimSafari window */
#game-menu-bar {
  display: flex;
  align-items: center;
  height: 20px;
  background: var(--w95-face);
  border-bottom: 1px solid var(--w95-shadow);
  box-shadow: 0 1px 0 var(--w95-white);
  padding: 1px 2px;
  gap: 1px;
  position: relative;
  z-index: 30;
  flex-shrink: 0;
}

#game-menu-bar.hidden {
  display: none;
}

.menu-group {
  position: relative;
}

.menu-trigger {
  background: transparent;
  border: none;
  color: var(--w95-dark);
  font-family: var(--w95-font);
  font-size: 11px;
  padding: 2px 6px;
  cursor: default;
  outline: none;
}

.menu-trigger:hover,
.menu-group.open .menu-trigger {
  background: var(--w95-navy);
  color: var(--w95-white);
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 176px;
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-light),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-white),
    2px 2px 4px rgba(0, 0, 0, 0.35);
  padding: 3px;
  z-index: 40;
}

.menu-group.open .menu-dropdown {
  display: flex;
  flex-direction: column;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 3px 14px 3px 4px;
  font-family: var(--w95-font);
  font-size: 11px;
  color: var(--w95-dark);
  cursor: default;
}

.menu-item:hover:not(:disabled) {
  background: var(--w95-navy);
  color: var(--w95-white);
}

.menu-item:disabled {
  color: var(--w95-shadow);
  text-shadow: 1px 1px 0 var(--w95-white);
}

.menu-check {
  display: inline-block;
  width: 12px;
  text-align: center;
  font-weight: 700;
}

.menu-sep {
  height: 2px;
  margin: 3px 2px;
  border-top: 1px solid var(--w95-shadow);
  border-bottom: 1px solid var(--w95-white);
}

.menu-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--w95-dark);
  font-family: var(--w95-font);
  font-size: 11px;
  padding: 1px 6px;
  cursor: default;
}

.menu-close:hover {
  background: var(--w95-navy);
  color: var(--w95-white);
}

/* Stage inside SimSafari window */
.stage-wrap {
  position: relative;
  margin-top: 2px;
  padding: 2px;
  background: #000000;
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow),
    inset -2px -2px var(--w95-light),
    inset 2px 2px var(--w95-dark);
  line-height: 0;
}

.canvas-box {
  position: relative;
  display: block;
  line-height: 0;
  background: #000000;
}

canvas#screen {
  position: relative;
  z-index: 2;
  width: 640px;
  height: 480px;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
  background: transparent;
}

/* Pixel-locked CQueryCloseupCommander Smacker video BEHIND canvas cutout: (161, 127, 320, 240) on 640x480 */
#smack-overlay {
  display: none;
  position: absolute;
  left: 25.15625%;
  top: 26.458333%;
  width: 50%;
  height: 50%;
  object-fit: fill;
  background: #000000;
  pointer-events: none;
  z-index: 1;
}

#simsafari-window.zoomed-fit canvas#screen {
  width: min(800px, calc(100vw - 120px));
  height: auto;
  aspect-ratio: 4 / 3;
}

.stage-overlay {
  position: absolute;
  inset: 2px;
  background: rgba(0, 0, 0, 0.84);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  z-index: 15;
  line-height: 1.4;
}

.stage-overlay.hidden {
  display: none;
}

.w95-progress-dialog {
  width: 340px;
  padding: 3px;
}

.w95-progress-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.load-bar {
  width: 100%;
  height: 16px;
  padding: 2px;
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow);
}

#load-bar-fill {
  width: 0%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--w95-navy) 0px,
    var(--w95-navy) 8px,
    var(--w95-face) 8px,
    var(--w95-face) 10px
  );
  transition: width 0.12s linear;
}

#load-status {
  font-size: 11px;
  color: var(--w95-dark);
}

.sim-statusbar {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
}

.sim-status-pane {
  padding: 2px 6px;
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-status-pane.grow {
  flex: 1;
}

/* ---------- Floating Win95 VM Control Panel ---------- */
#vm-controls-window {
  left: 756px;
  top: 16px;
  width: 304px;
}

.vm-panel-body {
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Authentic Win95 GroupBox (1px etched groove) */
.w95-fieldset {
  margin: 0;
  padding: 5px 7px 7px;
  border: 1px solid var(--w95-shadow);
  box-shadow:
    inset 1px 1px 0 var(--w95-white),
    1px 1px 0 var(--w95-white);
}

.w95-fieldset legend {
  padding: 0 3px;
  font-size: 11px;
  color: var(--w95-dark);
  background: var(--w95-face);
}

.w95-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.w95-row.stretch > select,
.w95-row.stretch > .w95-combobox {
  flex: 1;
  min-width: 140px;
}

.w95-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

.w95-stat-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 5px;
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow);
  font-variant-numeric: tabular-nums;
}

.w95-stat-cell .k {
  color: var(--w95-dark);
}

.w95-stat-cell .v {
  font-weight: 400;
  color: var(--w95-dark);
}

/* Authentic Win95 Trackbar (msctls_trackbar32 / SNDVOL32) */
.w95-trackbar-wrap {
  flex: 1;
  min-width: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 2px;
}

input[type="range"].w95-trackbar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: default;
  outline: none;
}

input[type="range"].w95-trackbar::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--w95-face);
  border: none;
  border-radius: 0;
  box-shadow:
    inset 1px 1px var(--w95-shadow),
    inset 2px 2px var(--w95-dark),
    inset -1px -1px var(--w95-white),
    inset -2px -2px var(--w95-light);
}

input[type="range"].w95-trackbar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 21px;
  margin-top: -9px;
  border-radius: 0;
  border: none;
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
}

input[type="range"].w95-trackbar::-moz-range-track {
  height: 4px;
  background: var(--w95-face);
  border: none;
  border-radius: 0;
  box-shadow:
    inset 1px 1px var(--w95-shadow),
    inset 2px 2px var(--w95-dark),
    inset -1px -1px var(--w95-white),
    inset -2px -2px var(--w95-light);
}

input[type="range"].w95-trackbar::-moz-range-thumb {
  width: 11px;
  height: 21px;
  border-radius: 0;
  border: none;
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
}

input[type="range"].w95-trackbar:focus-visible {
  outline: 1px dotted var(--w95-dark);
}

.w95-trackbar-ticks {
  height: 4px;
  margin: 1px 5px 0 5px;
  background-image: repeating-linear-gradient(
    to right,
    var(--w95-dark) 0px,
    var(--w95-dark) 1px,
    transparent 1px,
    transparent 14px
  );
}

/* Authentic Win95 Tree [+] / [-] Toggle for Console Log */
details.w95-logs summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: default;
  font-size: 11px;
  padding: 2px 0;
  color: var(--w95-dark);
}

details.w95-logs summary::-webkit-details-marker {
  display: none;
}

details.w95-logs summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 9px;
  height: 9px;
  font-family: 'Courier New', monospace;
  font-size: 9px;
  line-height: 9px;
  background: var(--w95-white);
  color: var(--w95-dark);
  border: 1px solid var(--w95-shadow);
}

details.w95-logs[open] summary::before {
  content: '-';
}

pre#log-output {
  margin: 4px 0 0;
  padding: 4px 5px;
  background: var(--w95-white);
  color: var(--w95-dark);
  font-family: 'Courier New', monospace;
  font-size: 10px;
  line-height: 12px;
  max-height: 110px;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow),
    inset -2px -2px var(--w95-light),
    inset 2px 2px var(--w95-dark);
}

/* Authentic Windows 95 Scrollbars */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  background-color: var(--w95-face);
  background-image: repeating-conic-gradient(#ffffff 0% 25%, #c0c0c0 0% 50%);
  background-size: 2px 2px;
}

::-webkit-scrollbar-thumb {
  background: var(--w95-face);
  border: none;
  border-radius: 0;
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
}

::-webkit-scrollbar-button {
  width: 16px;
  height: 16px;
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
}

::-webkit-scrollbar-corner {
  background: var(--w95-face);
}

/* ---------- Windows 95 Taskbar (28px) ---------- */
#taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: var(--w95-face);
  border-top: 1px solid var(--w95-light);
  box-shadow: inset 0 1px 0 var(--w95-white);
  display: flex;
  align-items: center;
  padding: 2px 3px;
  gap: 4px;
  z-index: 100;
}

#btn-start {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px 0 5px;
  font-family: var(--w95-font);
  font-size: 11px;
  font-weight: 700;
  color: var(--w95-dark);
  background: var(--w95-face);
  border: none;
  cursor: default;
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
}

#btn-start.open,
#btn-start:active {
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-dark),
    inset -2px -2px var(--w95-light),
    inset 2px 2px var(--w95-shadow);
  padding: 1px 6px 0 6px;
}

#btn-start img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.taskbar-divider {
  width: 2px;
  height: 20px;
  border-left: 1px solid var(--w95-shadow);
  border-right: 1px solid var(--w95-white);
}

#taskbar-windows {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.taskbar-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  min-width: 120px;
  max-width: 168px;
  padding: 0 6px;
  font-family: var(--w95-font);
  font-size: 11px;
  color: var(--w95-dark);
  background: var(--w95-face);
  border: none;
  cursor: default;
  text-align: left;
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
}

.taskbar-btn.active {
  font-weight: 700;
  background-image: repeating-conic-gradient(#ffffff 0% 25%, #c0c0c0 0% 50%);
  background-size: 2px 2px;
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-dark),
    inset -2px -2px var(--w95-light),
    inset 2px 2px var(--w95-shadow);
  padding-top: 1px;
}

.taskbar-btn.hidden {
  display: none;
}

.taskbar-btn img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.taskbar-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* System Tray */
#system-tray {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 7px;
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow);
  flex-shrink: 0;
}

#tray-speaker-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

#tray-speaker-btn img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

#tray-speed {
  font-size: 11px;
  font-weight: 700;
  color: var(--w95-dark);
  cursor: default;
}

#tray-clock {
  font-size: 11px;
  color: var(--w95-dark);
  font-variant-numeric: tabular-nums;
  cursor: default;
  min-width: 52px;
  text-align: right;
}

/* Tray Volume Popup */
#tray-volume-popup {
  position: fixed;
  right: 68px;
  bottom: 30px;
  width: 90px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 120;
}

#tray-volume-popup.hidden {
  display: none;
}

#tray-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  height: 92px;
  width: 24px;
  background: transparent;
  outline: none;
  cursor: default;
}

#tray-vol-slider::-webkit-slider-runnable-track {
  width: 4px;
  background: var(--w95-face);
  border-radius: 0;
  box-shadow:
    inset 1px 1px var(--w95-shadow),
    inset 2px 2px var(--w95-dark),
    inset -1px -1px var(--w95-white),
    inset -2px -2px var(--w95-light);
}

#tray-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 21px;
  height: 11px;
  margin-left: -9px;
  border-radius: 0;
  border: none;
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-white),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-light);
}

/* ---------- Authentic Win95 Start Menu ---------- */
#start-menu {
  position: fixed;
  left: 2px;
  bottom: 28px;
  display: flex;
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-light),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-white),
    2px 2px 6px rgba(0, 0, 0, 0.45);
  padding: 3px;
  z-index: 110;
}

#start-menu.hidden {
  display: none;
}

.start-sidebar {
  width: 22px;
  background: var(--w95-navy);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  flex-shrink: 0;
}

.start-sidebar-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #c0c0c0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.start-sidebar-text strong {
  color: #ffffff;
  font-weight: 400;
}

.start-items {
  display: flex;
  flex-direction: column;
  min-width: 175px;
  padding: 2px 0;
}

.start-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 5px 18px 5px 8px;
  font-family: var(--w95-font);
  font-size: 11px;
  color: var(--w95-dark);
  text-align: left;
  cursor: default;
}

.start-item:hover {
  background: var(--w95-navy);
  color: var(--w95-white);
}

.start-item img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.start-arrow {
  margin-left: auto;
  font-size: 9px;
}

.start-sep {
  height: 2px;
  margin: 3px 4px;
  border-top: 1px solid var(--w95-shadow);
  border-bottom: 1px solid var(--w95-white);
}

.start-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: -3px;
  min-width: 210px;
  background: var(--w95-face);
  box-shadow:
    inset -1px -1px var(--w95-dark),
    inset 1px 1px var(--w95-light),
    inset -2px -2px var(--w95-shadow),
    inset 2px 2px var(--w95-white),
    2px 2px 6px rgba(0, 0, 0, 0.45);
  padding: 3px;
  flex-direction: column;
  z-index: 115;
}

.start-item:hover > .start-submenu {
  display: flex;
}

.start-sub-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 4px 10px;
  font-family: var(--w95-font);
  font-size: 11px;
  color: var(--w95-dark);
  text-align: left;
  cursor: default;
}

.start-sub-btn:hover {
  background: var(--w95-navy);
  color: var(--w95-white);
}

/* ---------- In-Page Win95 Modal Dialogs ---------- */
#win95-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

#win95-modal-backdrop.hidden {
  display: none;
}

.w95-modal-box {
  min-width: 310px;
  max-width: 440px;
  display: flex;
  flex-direction: column;
}

.w95-modal-box.hidden {
  display: none;
}

.w95-modal-body {
  padding: 14px 14px 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.w95-modal-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.w95-modal-text {
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.w95-modal-actions {
  padding: 6px 14px 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.w95-modal-actions button {
  min-width: 75px;
}

/* Win95 Open / Save File Dialog */
#win95-filedlg {
  width: 440px;
}

.filedlg-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filedlg-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filedlg-row label {
  width: 74px;
  flex-shrink: 0;
}

.filedlg-row input,
.filedlg-row .filedlg-lookin {
  flex: 1;
}

.filedlg-lookin {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  background: var(--w95-white);
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow),
    inset -2px -2px var(--w95-light),
    inset 2px 2px var(--w95-dark);
}

.filedlg-list {
  height: 156px;
  overflow-y: auto;
  background: var(--w95-white);
  padding: 3px;
  box-shadow:
    inset -1px -1px var(--w95-white),
    inset 1px 1px var(--w95-shadow),
    inset -2px -2px var(--w95-light),
    inset 2px 2px var(--w95-dark);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.filedlg-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 5px;
  cursor: default;
  font-size: 11px;
}

.filedlg-entry img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.filedlg-entry.selected {
  background: var(--w95-navy);
  color: var(--w95-white);
  outline: 1px dotted #ffff00;
}

.filedlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.filedlg-actions button {
  min-width: 78px;
}

/* Responsive fallback for smaller viewports */
@media (max-width: 1090px) {
  #vm-controls-window {
    left: auto;
    right: 12px;
    top: 38px;
  }
}
