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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

html, body, #root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Microsoft Sans Serif", "MS Sans Serif", Tahoma, Geneva, sans-serif;
  font-size: 11px;
}

.crt-mode {
  position: relative;
}
.crt-mode::after {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.03) 0px,
    rgba(0,0,0,0.03) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 999999;
}

/* Windows 95 core styles */
.win95-raised {
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: inset 1px 1px 0 #dfdfdf, 1px 1px 0 #000000;
}

.win95-sunken {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  box-shadow: inset 1px 1px 0 #000000, -1px -1px 0 #dfdfdf;
}

.win95-button {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 1px 1px 0 #000000;
  padding: 2px 12px;
  font-family: "Microsoft Sans Serif", "MS Sans Serif", Tahoma, sans-serif;
  font-size: 11px;
  cursor: pointer;
  outline: none;
  min-width: 75px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.win95-button:active, .win95-button.pressed {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  box-shadow: inset 1px 1px 0 #000000;
  padding: 3px 11px 1px 13px;
}

.win95-button:focus {
  outline: 1px dotted #000000;
  outline-offset: -4px;
}

/* Desktop */
.desktop {
  width: 100%;
  height: 100%;
  background: #008080;
  position: relative;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.desktop-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Desktop Icons */
.desktop-icon {
  position: absolute;
  width: 64px;
  text-align: center;
  cursor: pointer;
  padding: 4px;
}

.desktop-icon:hover .icon-label,
.desktop-icon.selected .icon-label {
  background: #000080;
  color: #ffffff;
}

.desktop-icon.selected .icon-img {
  filter: brightness(0.7) sepia(1) hue-rotate(200deg);
}

.icon-img {
  width: 32px;
  height: 32px;
  margin: 0 auto 2px;
  image-rendering: pixelated;
}

.icon-label {
  font-size: 11px;
  color: #ffffff;
  text-shadow: 1px 1px 1px #000000;
  padding: 1px 2px;
  word-wrap: break-word;
}

/* Taskbar */
.taskbar {
  height: 28px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  display: flex;
  align-items: center;
  padding: 2px;
  z-index: 9000;
}

.start-button {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 1px 1px 0 #000000;
  padding: 1px 6px;
  font-family: "Microsoft Sans Serif", Tahoma, sans-serif;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  margin-right: 4px;
}

.start-button:active, .start-button.pressed {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  box-shadow: inset 1px 1px 0 #000000;
}

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

.taskbar-window-btn {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 1px 1px 0 #000000;
  padding: 1px 8px;
  font-size: 11px;
  cursor: pointer;
  height: 22px;
  min-width: 120px;
  max-width: 160px;
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taskbar-window-btn.active {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  box-shadow: inset 1px 1px 0 #000000;
  background: #bfbfbf;
  font-weight: bold;
}

.system-tray {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 1px 8px;
  font-size: 11px;
  height: 22px;
  display: flex;
  align-items: center;
  margin-left: auto;
}

/* Window */
.win95-window {
  position: absolute;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 1px 1px 0 #000000;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  min-height: 120px;
}

.win95-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #ffffff;
  font-weight: bold;
  font-size: 11px;
  padding: 2px 3px;
  display: flex;
  align-items: center;
  cursor: grab;
  height: 18px;
}

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

.win95-titlebar-text {
  flex: 1;
  padding-left: 2px;
  white-space: nowrap;
  overflow: hidden;
}

.titlebar-buttons {
  display: flex;
  gap: 2px;
}

.titlebar-btn {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 9px;
  font-weight: bold;
  font-family: "Marlett", monospace;
  line-height: 1;
  padding: 0;
}

.titlebar-btn:active {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
}

/* Menu bar */
.win95-menubar {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  display: flex;
  padding: 1px 0;
}

.menu-item {
  padding: 2px 8px;
  cursor: pointer;
  font-size: 11px;
  position: relative;
}

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

.menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 2px 2px 0 #000000;
  z-index: 10000;
  min-width: 160px;
}

.menu-dropdown-item {
  padding: 4px 24px 4px 8px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

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

.menu-separator {
  height: 1px;
  background: #808080;
  margin: 2px 0;
  border-bottom: 1px solid #ffffff;
}

/* Start Menu */
.start-menu {
  position: absolute;
  bottom: 28px;
  left: 0;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 2px 2px 0 #000000;
  z-index: 9500;
  display: flex;
  min-width: 200px;
}

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

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

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

.start-menu-item {
  padding: 6px 24px 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

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

.start-menu-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dialog */
.win95-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50000;
}

.win95-dialog {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  box-shadow: 2px 2px 0 #000000;
  min-width: 320px;
  max-width: 450px;
}

.dialog-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #ffffff;
  font-weight: bold;
  font-size: 11px;
  padding: 2px 3px;
  display: flex;
  align-items: center;
  height: 18px;
}

.dialog-content {
  padding: 16px;
  display: flex;
  gap: 16px;
}

.dialog-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.dialog-text {
  font-size: 11px;
  line-height: 1.4;
  flex: 1;
}

.dialog-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px 12px;
}

/* Progress bar */
.progress-container {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background: #ffffff;
  height: 20px;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  display: flex;
}

.progress-block {
  width: 8px;
  height: 100%;
  background: #000080;
  margin-right: 2px;
}

/* Game area */
.game-area {
  position: relative;
  background: #ffffff;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  overflow: hidden;
  cursor: none;
}

.falling-segment {
  position: absolute;
  width: 20px;
  height: 12px;
  border-radius: 1px;
}

.falling-segment.blue {
  background: linear-gradient(180deg, #4444ff, #000080);
  box-shadow: inset 1px 1px 0 #8888ff;
}

.falling-segment.red {
  background: linear-gradient(180deg, #ff4444, #800000);
  box-shadow: inset 1px 1px 0 #ff8888;
}

.falling-segment.yellow {
  background: linear-gradient(180deg, #ffff44, #808000);
  box-shadow: inset 1px 1px 0 #ffffaa;
}

.player-bar {
  position: absolute;
  bottom: 0;
  height: 20px;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background: #c0c0c0;
  display: flex;
  overflow: hidden;
}

.player-bar-fill {
  height: 100%;
  display: flex;
}

.player-block {
  width: 8px;
  height: 100%;
  background: #000080;
  margin-right: 1px;
}

/* Status bar */
.status-bar {
  background: #c0c0c0;
  display: flex;
  gap: 2px;
  padding: 2px;
}

.status-section {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 1px 6px;
  font-size: 11px;
  flex: 1;
}

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

.boot-logo {
  margin-bottom: 32px;
}

.boot-flag {
  display: grid;
  grid-template-columns: repeat(4, 20px);
  grid-template-rows: repeat(4, 20px);
  gap: 2px;
  margin: 0 auto;
}

.boot-flag-r { background: #ff0000; }
.boot-flag-g { background: #00ff00; }
.boot-flag-b { background: #0000ff; }
.boot-flag-y { background: #ffff00; }

.boot-text {
  font-family: "VT323", monospace;
  font-size: 16px;
  margin-top: 16px;
}

.boot-progress {
  width: 200px;
  height: 4px;
  background: #333;
  margin-top: 16px;
}

.boot-progress-fill {
  height: 100%;
  background: #c0c0c0;
  transition: width 0.1s linear;
}

/* BSOD */
.bsod {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0000aa;
  color: #ffffff;
  font-family: "VT323", "Courier New", monospace;
  font-size: 16px;
  padding: 32px;
  z-index: 200000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1.6;
}

.bsod-title {
  background: #aaaaaa;
  color: #0000aa;
  padding: 2px 8px;
  margin-bottom: 24px;
  font-weight: bold;
}

/* Shutdown screen */
.shutdown-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200000;
  cursor: pointer;
}

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

/* Win flag (small) */
.win-flag-small {
  display: inline-grid;
  grid-template-columns: repeat(2, 5px);
  grid-template-rows: repeat(2, 5px);
  gap: 1px;
  vertical-align: middle;
}

/* Score field */
.score-field {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background: #ffffff;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  display: inline-block;
}

/* Game header */
.game-header {
  background: #c0c0c0;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.file-label {
  font-size: 11px;
  color: #000000;
}

.pct-label {
  font-size: 14px;
  font-weight: bold;
  color: #000080;
  min-width: 36px;
  text-align: right;
}

/* Radio button Win95 style */
.win95-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  cursor: pointer;
  margin: 4px 0;
}

.win95-radio-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #808080;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.win95-radio-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #000000;
}