:root {
  --text-colour: rgb(252, 237, 242);
  --shadow-colour: rgb(160, 122, 135);
}

@font-face {
  font-family: "Arial";
}

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

body {
  min-height: 100vh;
  background: rgba(225, 225, 225, 0.95);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  position: relative;
}

body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.1),
      rgba(0, 0, 0, 0.1) 1px,
      transparent 1px,
      transparent 20px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.1),
      rgba(0, 0, 0, 0.1) 1px,
      transparent 1px,
      transparent 20px
    );
  pointer-events: none;
  z-index: -1;
}

.main-container {
  position: fixed;
  top: 50px;
  left: 200px;
  right: 100px;
  bottom: 30px;
  background: #008080;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #fff, 4px 4px 0 #000;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.window-title {
  flex: 1;
}

.desktop-content {
  flex: 1;
  background: #008080;
  padding: 20px;
  overflow-y: auto;
  position: relative;
}

.desktop-icons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 20px;
  max-width: 300px;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  padding: 5px;
  transition: background 0.1s;
}

.desktop-icon:active {
  background: rgba(0, 0, 0, 0.2);
}

.icon-image {
  font-size: 32px;
  line-height: 1;
}

.icon-label {
  font-size: 11px;
  color: #fff;
  text-align: center;
  font-family: "MS Sans Serif", "Arial", sans-serif;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  word-break: break-word;
  width: 70px;
}

.taskbar {
  height: 28px;
  background: linear-gradient(180deg, #c0c0c0, #808080);
  border-top: 2px solid #dfdfdf;
  border-bottom: 2px solid #808080;
  display: flex;
  align-items: center;
  padding: 2px;
  gap: 4px;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #000;
}

.start-button {
  background: linear-gradient(135deg, #c0c0c0, #808080);
  border: 2px solid #000;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  font-family: "MS Sans Serif", "Arial", sans-serif;
  cursor: default;
  user-select: none;
}

.start-button:active {
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #fff;
}

.taskbar-spacer {
  flex: 1;
  border-left: 2px solid #fff;
  border-right: 2px solid #808080;
}

.system-tray {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  padding-right: 4px;
}

.window-header {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  padding: 4px;
  font-size: 12px;
  font-family: "orbitron", "Arial", sans-serif;
  position: relative;
}

/* Make window header show grab cursor and disable native touch scrolling while dragging */
.window-header {
  cursor: grab;
  touch-action: none;
}

.window-header:active {
  cursor: grabbing;
}

/* The playground's outer window header is not draggable; don't show grab cursor */
.main-container > .window-header {
  cursor: default;
  touch-action: auto;
}

.main-container > .window-header:active {
  cursor: default;
}

.floating-back-button {
  position: fixed;
  top: 10px;
  left: 10px;
  font-size: 20px;
  cursor: pointer;
  padding: 0px 12px 3px 12px;
  transition: all 0.1s;
  user-select: none;
  background: linear-gradient(135deg, #c0c0c0, #808080);
  border: 2px solid #000;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  color: #000;
  z-index: 2000;
  font-weight: bold;
  font-family: "MS Sans Serif", "Arial", sans-serif;
}

.floating-back-button:hover {
  filter: brightness(1.2);
}

.floating-back-button:active {
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #fff;
}

.window-content {
  height: 80%;
  padding: 10px;
  font-size: 10px;
  color: #000;
  background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
  border-top: 1px solid #000;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
}

.btn {
  display: inline-block;
  font-family: "orbitron", "Arial", sans-serif;
  font-size: 16px;
  color: #000;
  background: linear-gradient(45deg, rgb(200, 255, 0), #00ffff);
  padding: 5px 10px;
  text-decoration: none;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
  animation: glitch 0.3s infinite;
}

@keyframes glitch {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-0.75px, 0.75px);
  }
  40% {
    transform: translate(-0.75px, -0.75px);
  }
  60% {
    transform: translate(0.75px, 0.75px);
  }
  80% {
    transform: translate(0.75px, -0.75px);
  }
  100% {
    transform: translate(0);
  }
}

.window-close {
  position: absolute;
  top: 4px;
  right: 4px;
  font-family: "Arial", sans-serif;
  font-weight: bold;
  font-size: 12px;
  color: #fff;
  background: #ff0000;
  width: 14px;
  height: 14px;
  text-align: center;
  line-height: 14px;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  cursor: default;
}

.pathfinder-window .window-close,
.recipes-window .window-close,
.easter-egg-window .window-close {
  cursor: pointer;
  transition: background 0.1s;
}

.pathfinder-window .window-close:hover,
.recipes-window .window-close:hover,
.easter-egg-window .window-close:hover {
  background: #ff6666;
}

.pathfinder-window .window-close:active,
.recipes-window .window-close:active,
.easter-egg-window .window-close:active {
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #fff;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1);
  }
}

/* Pathfinder Window Styles */
.pathfinder-window {
  position: fixed;
  width: 650px;
  height: 750px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #fff, 4px 4px 0 #000;
  top: 80px;
  left: 250px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.pathfinder-window.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.pathfinder-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
  border-top: 1px solid #000;
  padding: 10px;
  overflow: auto;
}

.pathfinder-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px;
  background: #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-group label {
  font-size: 11px;
  font-weight: bold;
  font-family: "MS Sans Serif", "Arial", sans-serif;
  color: #000;
}

.mode-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.mode-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-family: "MS Sans Serif", "Arial", sans-serif;
  background: linear-gradient(135deg, #c0c0c0, #808080);
  border: 2px solid #000;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  cursor: pointer;
  user-select: none;
  transition: all 0.1s;
}

.mode-btn:active {
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #fff;
}

.mode-btn.active {
  background: linear-gradient(135deg, #00ff00, #00cc00);
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #fff;
}

.algorithm-select {
  padding: 4px;
  font-size: 11px;
  font-family: "MS Sans Serif", "Arial", sans-serif;
  background: #fff;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #808080;
}

.run-btn,
.clear-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-family: "MS Sans Serif", "Arial", sans-serif;
  background: linear-gradient(135deg, #00ffff, #00cccc);
  border: 2px solid #000;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  cursor: pointer;
  user-select: none;
  transition: all 0.1s;
  font-weight: bold;
}

.run-btn:active,
.clear-btn:active {
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #fff;
}

.clear-btn {
  background: linear-gradient(135deg, #ff6b6b, #cc5555);
  color: #fff;
}

.pathfinder-grid {
  flex: 1;
  display: grid;
  gap: 2px;
  background: #fff;
  border: 2px solid #000;
  padding: 8px;
  overflow: auto;
}

.grid-cell {
  background: #fff;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: background 0.1s;
  aspect-ratio: 1;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1);
}

.grid-cell:hover {
  background: #f0f0f0;
}

.grid-cell.start {
  background: #00ff00;
  border-color: #00cc00;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
}

.grid-cell.end {
  background: #ff0000;
  border-color: #cc0000;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
}

.grid-cell.wall {
  background: #000;
  border-color: #000;
}

.grid-cell.path {
  background: #ffff00;
  border-color: #cccc00;
}

.grid-cell.visited {
  background: #87ceeb;
  border-color: #6fb3d9;
}

/* Under Construction Window Styles */
.construction-window {
  position: fixed;
  width: 400px;
  height: 300px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #fff, 4px 4px 0 #000;
  top: 150px;
  right: 150px;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

.construction-window.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.construction-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
  border-top: 1px solid #000;
  padding: 20px;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.construction-content h2 {
  font-family: "MS Sans Serif", "Arial", sans-serif;
  font-size: 16px;
  color: #000;
  margin-bottom: 10px;
}

.construction-content p {
  font-family: "MS Sans Serif", "Arial", sans-serif;
  font-size: 12px;
  color: #000;
  margin-bottom: 20px;
}

.construction-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

/* Easter Egg Window Styles */
.easter-egg-window {
  position: fixed;
  width: 500px;
  height: 400px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #fff, 4px 4px 0 #000;
  top: 200px;
  left: 400px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.easter-egg-window.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.easter-egg-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
  border-top: 1px solid #000;
  padding: 20px;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: auto;
}

.easter-egg-image {
  max-width: 100%;
  max-height: 100%;
}

/* Recipes Window Styles */
.recipes-window {
  position: fixed;
  width: 600px;
  height: 500px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #fff, 4px 4px 0 #000;
  top: 150px;
  left: 300px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.recipes-window.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.recipes-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
  border-top: 1px solid #000;
  padding: 15px;
  overflow: hidden;
}

.recipes-search {
  margin-bottom: 15px;
}

.recipe-search-input {
  width: 100%;
  padding: 8px;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #fff;
  font-family: "MS Sans Serif", "Arial", sans-serif;
  font-size: 12px;
}

.recipe-search-input:focus {
  outline: none;
}

.recipes-list {
  flex: 1;
  overflow-y: auto;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #808080;
  background: #fff;
}

.recipes-sort {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.sort-btn {
  flex: 1;
  padding: 6px 8px;
  border: 2px solid #000;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  background: linear-gradient(135deg, #c0c0c0, #808080);
  font-family: "MS Sans Serif", "Arial", sans-serif;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.1s;
  color: #000;
  font-weight: bold;
}

.sort-btn:hover {
  filter: brightness(1.15);
}

.sort-btn.active {
  background: linear-gradient(135deg, #ffffff, #b0b0b0);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #000;
  filter: brightness(1.3);
  text-decoration: underline;
}

.sort-btn:active:not(.active) {
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #fff;
}

.recipe-item {
  padding: 10px 12px;
  border-bottom: 1px solid #c0c0c0;
  cursor: pointer;
  transition: background 0.1s;
  font-family: "MS Sans Serif", "Arial", sans-serif;
  font-size: 14px;
  color: #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recipe-name {
  flex: 1;
}

.recipe-rating {
  margin-left: 12px;
  white-space: nowrap;
  color: #ff6b00;
  font-weight: bold;
  font-size: 20px;
  width: 80px;
  text-align: center;
  flex-shrink: 0;
}

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

.recipe-item:hover .recipe-rating {
  color: #ffd700;
}

.recipe-item:active {
  background: #1084d0;
}

.recipes-list::-webkit-scrollbar {
  width: 16px;
}

.recipes-list::-webkit-scrollbar-track {
  background: #c0c0c0;
  border: 1px solid #dfdfdf;
}

.recipes-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #dfdfdf, #808080);
  border: 1px solid #000;
  border-radius: 2px;
}
