@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

html, body, #root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'MS Sans Serif', 'Tahoma', 'Arial', sans-serif;
  font-size: 11px;
  cursor: default;
  user-select: none;
}

/* Boot Screen */
.boot-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  color: #fff;
}

.boot-logo {
  font-family: 'VT323', monospace;
  font-size: 48px;
  color: #fff;
  margin-bottom: 8px;
}

.boot-subtitle {
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: #aaa;
  margin-bottom: 40px;
}

.boot-progress-container {
  width: 300px;
  height: 20px;
  background: #222;
  border: 2px solid #555;
  padding: 2px;
}

.boot-progress-bar {
  height: 100%;
  background: #008080;
  transition: width 0.3s ease;
}

.boot-text {
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: #888;
  margin-top: 16px;
}

/* Shutdown Screen */
.shutdown-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.shutdown-text {
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: #f90;
  text-align: center;
  line-height: 1.6;
}

.shutdown-sub {
  font-family: 'VT323', monospace;
  font-size: 16px;
  color: #888;
  margin-top: 30px;
  cursor: pointer;
}

.shutdown-sub:hover {
  color: #fff;
}

/* Desktop */
.desktop {
  width: 100%;
  height: 100%;
  background: #008080;
  position: relative;
  overflow: hidden;
}

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

.desktop-icon {
  width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}

.desktop-icon:hover {
  background: rgba(0,0,128,0.3);
  border: 1px dotted #fff;
}

.desktop-icon.selected {
  background: #000080;
  border: 1px dotted #fff;
}

.desktop-icon .icon-img {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 2px;
  image-rendering: pixelated;
}

.desktop-icon .icon-label {
  font-size: 11px;
  color: #fff;
  text-align: center;
  text-shadow: 1px 1px 1px #000;
  word-wrap: break-word;
  max-width: 68px;
}

.desktop-icon.selected .icon-label {
  background: #000080;
  color: #fff;
}

/* Taskbar */
.taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  display: flex;
  align-items: center;
  padding: 2px 2px;
  z-index: 10000;
}

.start-btn {
  height: 24px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 3px;
  background: #c0c0c0;
  border: 2px outset #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.start-btn:active, .start-btn.active {
  border-style: inset;
}

.start-btn .berry-logo {
  font-size: 14px;
}

.taskbar-windows {
  flex: 1;
  display: flex;
  gap: 2px;
  margin-left: 4px;
  overflow: hidden;
}

.taskbar-window-btn {
  height: 24px;
  min-width: 100px;
  max-width: 160px;
  padding: 0 8px;
  font-size: 11px;
  background: #c0c0c0;
  border: 2px outset #fff;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.taskbar-window-btn.active {
  border-style: inset;
  background: #b0b0b0;
}

.taskbar-clock {
  height: 24px;
  padding: 0 8px;
  border: 2px inset #888;
  display: flex;
  align-items: center;
  font-size: 11px;
  background: #c0c0c0;
  flex-shrink: 0;
  margin-left: auto;
}

/* Start Menu */
.start-menu {
  position: absolute;
  bottom: 30px;
  left: 0;
  background: #c0c0c0;
  border: 2px outset #fff;
  display: flex;
  z-index: 10001;
  min-width: 200px;
}

.start-menu-sidebar {
  width: 24px;
  background: linear-gradient(to top, #000080, #0000c0);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
}

.start-menu-sidebar-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
}

.start-menu-items {
  flex: 1;
  padding: 2px 0;
}

.start-menu-item {
  padding: 4px 20px 4px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 11px;
  position: relative;
  white-space: nowrap;
}

.start-menu-item:hover {
  background: #000080;
  color: #fff;
}

.start-menu-item .item-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.start-menu-item .submenu-arrow {
  position: absolute;
  right: 6px;
  font-size: 9px;
}

.start-menu-separator {
  height: 1px;
  margin: 2px 4px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
}

/* Submenu */
.start-submenu {
  position: absolute;
  left: 100%;
  top: -2px;
  background: #c0c0c0;
  border: 2px outset #fff;
  z-index: 10002;
  min-width: 180px;
  padding: 2px 0;
}

/* Window */
.win96-window {
  position: absolute;
  background: #c0c0c0;
  border: 2px outset #fff;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  min-height: 100px;
}

.win96-window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100% - 30px) !important;
}

.window-titlebar {
  height: 20px;
  background: linear-gradient(90deg, #000080, #1084d0);
  display: flex;
  align-items: center;
  padding: 0 2px;
  cursor: grab;
  flex-shrink: 0;
}

.window-titlebar.inactive {
  background: linear-gradient(90deg, #808080, #b0b0b0);
}

.window-titlebar .title-icon {
  font-size: 12px;
  margin-right: 4px;
}

.window-titlebar .title-text {
  flex: 1;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex;
  gap: 1px;
}

.window-control-btn {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  border: 1px outset #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  font-family: 'MS Sans Serif', 'Tahoma', 'Arial', sans-serif;
}

.window-control-btn:active {
  border-style: inset;
}

/* Window Menubar */
.window-menubar {
  height: 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #808080;
  padding: 0 2px;
  flex-shrink: 0;
}

.window-menu-item {
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
}

.window-menu-item:hover {
  background: #000080;
  color: #fff;
}

.window-body {
  flex: 1;
  overflow: auto;
  position: relative;
}

.window-statusbar {
  height: 18px;
  border-top: 1px solid #808080;
  display: flex;
  align-items: center;
  padding: 0 4px;
  font-size: 11px;
  flex-shrink: 0;
}

/* Notepad */
.notepad-textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 2px 4px;
  background: #fff;
}

/* Dropdown menu for notepad File menu etc */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #c0c0c0;
  border: 2px outset #fff;
  z-index: 100;
  min-width: 150px;
  padding: 2px 0;
}

.dropdown-item {
  padding: 3px 20px 3px 8px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: #000080;
  color: #fff;
}

.dropdown-separator {
  height: 1px;
  margin: 2px 4px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
}

/* Calculator */
.calc-display {
  width: 100%;
  height: 28px;
  background: #c8e0c8;
  border: 2px inset #808080;
  text-align: right;
  font-family: 'VT323', monospace;
  font-size: 22px;
  padding: 0 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.calc-body {
  padding: 6px;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-top: 4px;
}

.calc-btn {
  height: 26px;
  font-size: 12px;
  font-weight: bold;
  background: #c0c0c0;
  border: 2px outset #fff;
  cursor: pointer;
  font-family: 'MS Sans Serif', 'Tahoma', 'Arial', sans-serif;
}

.calc-btn:active {
  border-style: inset;
}

.calc-btn.op {
  background: #d4d0c8;
  color: #800000;
}

.calc-btn.eq {
  background: #d4d0c8;
  color: #000080;
}

/* Minesweeper */
.mine-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  background: #c0c0c0;
}

.mine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px;
  border: 2px inset #808080;
  margin-bottom: 6px;
  background: #c0c0c0;
}

.mine-counter {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: #f00;
  background: #000;
  padding: 0 4px;
  min-width: 46px;
  text-align: center;
  border: 1px inset #808080;
}

.mine-face-btn {
  width: 28px;
  height: 28px;
  font-size: 18px;
  border: 2px outset #fff;
  background: #c0c0c0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mine-face-btn:active {
  border-style: inset;
}

.mine-grid {
  display: inline-grid;
  border: 2px inset #808080;
  gap: 0;
}

.mine-cell {
  width: 20px;
  height: 20px;
  border: 2px outset #fff;
  background: #c0c0c0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  font-family: 'MS Sans Serif', 'Tahoma', 'Arial', sans-serif;
}

.mine-cell.revealed {
  border: 1px solid #808080;
  background: #d0d0d0;
}

.mine-cell.mine-exploded {
  background: #f00;
}

.mine-cell .flag {
  color: #f00;
  font-size: 12px;
}

.mine-cell .mine {
  font-size: 14px;
}

/* Number colors */
.mine-num-1 { color: #0000ff; }
.mine-num-2 { color: #008000; }
.mine-num-3 { color: #ff0000; }
.mine-num-4 { color: #000080; }
.mine-num-5 { color: #800000; }
.mine-num-6 { color: #008080; }
.mine-num-7 { color: #000000; }
.mine-num-8 { color: #808080; }

/* Internet Exploder */
.ie-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-bottom: 1px solid #808080;
  background: #c0c0c0;
}

.ie-address-label {
  font-size: 11px;
  white-space: nowrap;
}

.ie-address-bar {
  flex: 1;
  height: 20px;
  border: 2px inset #808080;
  padding: 0 4px;
  font-size: 11px;
  background: #fff;
  font-family: 'MS Sans Serif', 'Tahoma', 'Arial', sans-serif;
}

.ie-go-btn {
  height: 20px;
  padding: 0 8px;
  font-size: 11px;
  background: #c0c0c0;
  border: 2px outset #fff;
  cursor: pointer;
}

.ie-go-btn:active {
  border-style: inset;
}

.ie-content {
  background: #fff;
  padding: 10px;
  height: 100%;
  overflow: auto;
  font-size: 12px;
}

.ie-content h1 {
  font-family: 'Times New Roman', serif;
  color: #000080;
  font-size: 20px;
}

.ie-content h2 {
  font-family: 'Times New Roman', serif;
  color: #800080;
  font-size: 16px;
}

.ie-content a {
  color: #0000ff;
  text-decoration: underline;
  cursor: pointer;
}

.ie-content a:hover {
  color: #ff0000;
}

.ie-marquee {
  color: #ff0000;
  font-size: 16px;
  font-weight: bold;
  animation: marqueeScroll 8s linear infinite;
  white-space: nowrap;
  overflow: hidden;
}

@keyframes marqueeScroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.ie-construction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #ffff00;
  color: #000;
  font-weight: bold;
  animation: blink 1s step-end infinite;
  margin: 8px 0;
}

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

.ie-visitor-counter {
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: #008000;
  background: #000;
  display: inline-block;
  padding: 2px 8px;
  margin: 8px 0;
}

.ie-hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, #808080, transparent);
  margin: 10px 0;
}

.ie-guestbook {
  border: 1px solid #808080;
  padding: 8px;
  margin: 8px 0;
  background: #ffe0e0;
}

/* About Dialog */
.about-dialog {
  padding: 16px;
  text-align: center;
}

.about-logo {
  font-size: 48px;
  margin-bottom: 8px;
}

.about-title {
  font-family: 'VT323', monospace;
  font-size: 28px;
  font-weight: bold;
  color: #000080;
}

.about-version {
  font-size: 11px;
  color: #808080;
  margin: 4px 0;
}

.about-specs {
  font-size: 11px;
  margin: 12px 0;
  text-align: left;
  border: 2px inset #808080;
  padding: 8px;
  background: #fff;
}

.about-ok-btn {
  width: 80px;
  height: 24px;
  background: #c0c0c0;
  border: 2px outset #fff;
  font-size: 11px;
  cursor: pointer;
  margin-top: 8px;
}

.about-ok-btn:active {
  border-style: inset;
}

/* Error Dialog */
.error-dialog {
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.error-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.error-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.error-text {
  font-size: 11px;
  line-height: 1.5;
}

.error-ok-btn {
  width: 80px;
  height: 24px;
  background: #c0c0c0;
  border: 2px outset #fff;
  font-size: 11px;
  cursor: pointer;
}

.error-ok-btn:active {
  border-style: inset;
}

/* Berry Assistant (Clippy) */
.berry-assistant {
  position: absolute;
  bottom: 40px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.berry-bubble {
  background: #ffffcc;
  border: 2px solid #000;
  padding: 8px 12px;
  font-size: 11px;
  max-width: 220px;
  margin-bottom: 4px;
  position: relative;
  border-radius: 0;
}

.berry-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 16px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #000;
}

.berry-bubble::before {
  content: '';
  position: absolute;
  bottom: -7px;
  right: 18px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #ffffcc;
  z-index: 1;
}

.berry-character {
  font-size: 36px;
  cursor: pointer;
  animation: berryBounce 2s ease-in-out infinite;
}

@keyframes berryBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.berry-dismiss {
  position: absolute;
  top: 2px;
  right: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: bold;
  color: #808080;
}

.berry-dismiss:hover {
  color: #000;
}

/* BSOD */
.bsod {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000080;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 40px;
}

.bsod-content {
  font-family: 'VT323', monospace;
  color: #fff;
  font-size: 16px;
  line-height: 1.6;
  max-width: 600px;
  text-align: center;
}

.bsod-title {
  background: #c0c0c0;
  color: #000080;
  padding: 2px 12px;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 16px;
}

/* Resize handle */
.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}

/* File dialog */
.file-dialog-list {
  border: 2px inset #808080;
  background: #fff;
  margin: 8px;
  padding: 4px;
  height: 120px;
  overflow-y: auto;
}

.file-dialog-item {
  padding: 2px 4px;
  font-size: 11px;
  cursor: pointer;
}

.file-dialog-item:hover, .file-dialog-item.selected {
  background: #000080;
  color: #fff;
}

.file-dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 4px 8px 8px;
}

.file-dialog-btn {
  width: 70px;
  height: 22px;
  background: #c0c0c0;
  border: 2px outset #fff;
  font-size: 11px;
  cursor: pointer;
}

.file-dialog-btn:active {
  border-style: inset;
}

.file-dialog-input {
  margin: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.file-dialog-input input {
  flex: 1;
  height: 20px;
  border: 2px inset #808080;
  padding: 0 4px;
  font-size: 11px;
  font-family: 'MS Sans Serif', 'Tahoma', 'Arial', sans-serif;
}

/* Remix footer */
.remix-footer {
  position: absolute;
  bottom: 32px;
  right: 4px;
  z-index: 1;
}

.remix-footer a {
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  font-size: 10px;
  text-decoration: none;
  opacity: 0.5;
}

.remix-footer a:hover {
  opacity: 1;
}