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

body {
  font-family: 'Press Start 2P', monospace;
  background: #000;
  color: #0ff;
  overflow: hidden;
  height: 100vh;
  font-size: 12px;
}

.screen {
  display: none;
  width: 100vw;
  height: 100vh;
}

.screen.active {
  display: block;
}

#boot-screen {
  display: none;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: radial-gradient(circle at center, #0a0a1a 0%, #000 100%);
  cursor: pointer;
}

#boot-screen.active {
  display: flex;
}

.boot-content {
  text-align: center;
}

.gears {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  font-size: 40px;
}

.gear {
  color: #0ff;
  text-shadow: 0 0 15px #0ff;
  animation: spin 3s linear infinite;
}

.gear-2 {
  color: #f0f;
  text-shadow: 0 0 15px #f0f;
  animation: spin-reverse 2s linear infinite;
}

.gear-3 {
  color: #ff0;
  text-shadow: 0 0 15px #ff0;
  animation: spin 4s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-reverse {
  to {
    transform: rotate(-360deg);
  }
}

.lightbulb {
  margin-bottom: 20px;
  font-size: 50px;
  animation: flicker 1.5s infinite;
}

@keyframes flicker {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 30px #ff0;
  }

  50% {
    opacity: 0.3;
    text-shadow: 0 0 5px #ff0;
  }
}

.os-title {
  margin-bottom: 10px;
  color: #0ff;
  font-size: 32px;
  text-shadow: 0 0 20px #0ff;
}

.os-tagline {
  margin-bottom: 5px;
  color: #f0f;
  text-shadow: 0 0 10px #f0f;
}

.version {
  margin-bottom: 30px;
  color: #666;
  font-size: 10px;
}

.progress-bar {
  width: 300px;
  height: 15px;
  margin: 0 auto 15px;
  border: 2px solid #0ff;
  box-shadow: 0 0 10px #0ff;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #0ff, #f0f);
  box-shadow: 0 0 10px #f0f;
  animation: fill 4.5s linear forwards;
}

@keyframes fill {
  to {
    width: 100%;
  }
}

.boot-status {
  margin-bottom: 10px;
  color: #0f0;
  font-size: 10px;
}

.skip-hint {
  color: #555;
  font-size: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }
}

#login-screen {
  display: none;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 100vh;
  background: radial-gradient(circle, #0a0a2a, #000);
}

#login-screen.active {
  display: flex;
}

.login-box {
  z-index: 2;
  padding: 40px;
  border: 2px solid #0ff;
  background: rgba(0, 20, 40, 0.9);
  box-shadow: 0 0 30px #0ff;
  text-align: center;
}

.login-box h2 {
  margin-bottom: 25px;
  color: #0ff;
  font-size: 14px;
  text-shadow: 0 0 10px #0ff;
}

#username-input {
  width: 280px;
  margin-bottom: 20px;
  padding: 12px;
  border: 2px solid #f0f;
  outline: none;
  background: #000;
  color: #0ff;
  font-family: inherit;
  font-size: 12px;
  box-shadow: 0 0 10px #f0f;
}

#login-btn,
.popup button,
#win-snake button,
#win-notes button {
  border: none;
  background: #0ff;
  color: #000;
  font-family: inherit;
  cursor: pointer;
}

#login-btn {
  padding: 12px 30px;
  font-size: 12px;
  box-shadow: 0 0 15px #0ff;
}

#login-btn:hover {
  background: #f0f;
  box-shadow: 0 0 20px #f0f;
}

.floating-gadgets {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floating-gadgets span {
  position: absolute;
  opacity: 0.4;
  font-size: 30px;
  animation: float 6s infinite ease-in-out;
}

.floating-gadgets span:nth-child(1) { top: 10%; left: 10%; }
.floating-gadgets span:nth-child(2) { top: 20%; right: 15%; animation-delay: 1s; }
.floating-gadgets span:nth-child(3) { bottom: 15%; left: 20%; animation-delay: 2s; }
.floating-gadgets span:nth-child(4) { right: 10%; bottom: 20%; animation-delay: 3s; }
.floating-gadgets span:nth-child(5) { top: 50%; left: 5%; animation-delay: 1.5s; }
.floating-gadgets span:nth-child(6) { top: 60%; right: 5%; animation-delay: 2.5s; }
.floating-gadgets span:nth-child(7) { top: 35%; left: 50%; animation-delay: 0.5s; }
.floating-gadgets span:nth-child(8) { bottom: 5%; left: 50%; animation-delay: 3.5s; }

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-30px) rotate(20deg);
  }
}

#desktop {
  position: relative;
  height: 100vh;
  background-color: #050510;
  background-image: url("default%20background.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

#desktop.wallpaper-grid {
  background-image: url("grid%20background.png");
}

#desktop.wallpaper-stars {
  background-image: url("star%20background.jpg");
}

#desktop.wallpaper-circuit {
  background-image: url("circuit%20background.jpg");
}

.popup {
  position: absolute;
  top: 40%;
  left: 50%;
  z-index: 999;
  width: max-content;
  max-width: 320px;
  padding: 25px 30px;
  transform: translate(-50%, -50%);
  border: 2px solid #0ff;
  background: rgba(0, 20, 40, 0.95);
  box-shadow: 0 0 25px #0ff;
  text-align: center;
}

.popup h3 {
  margin-bottom: 12px;
  color: #0ff;
  font-size: 13px;
}

.popup p {
  margin-bottom: 15px;
  color: #ccc;
  font-size: 10px;
  line-height: 1.6;
}

.popup button {
  padding: 10px 20px;
  font-size: 10px;
}

.popup button:hover,
#win-snake button:hover,
#win-notes button:hover {
  background: #f0f;
}

.desktop-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, 90px);
  gap: 15px;
  padding: 25px;
}

.icon {
  padding: 8px;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
}

.icon:hover {
  background: rgba(0, 255, 255, 0.1);
}

.icon-img {
  margin-bottom: 5px;
  font-size: 32px;
}

.icon p {
  color: #0ff;
  font-size: 8px;
  overflow-wrap: break-word;
}

.taskbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 45px;
  padding: 0 15px;
  border-top: 2px solid #0ff;
  background: rgba(0, 10, 20, 0.95);
}

.start-btn {
  color: #0ff;
  font-size: 10px;
  cursor: pointer;
  text-shadow: 0 0 8px #0ff;
}

.taskbar-info {
  display: flex;
  gap: 20px;
  color: #f0f;
  font-size: 10px;
}

.window {
  display: none;
  position: absolute;
  top: 80px;
  left: 80px;
  z-index: 100;
  width: 420px;
  max-width: 90vw;
  border: 2px solid #0ff;
  background: rgba(5, 10, 25, 0.97);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
}

.window.active {
  display: block;
}

.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 2px solid #0ff;
  background: linear-gradient(90deg, #001a2a, #0a0028);
  font-size: 10px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

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

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

.window-header button {
  padding: 2px 8px;
  border: 1px solid #f0f;
  background: transparent;
  color: #f0f;
  font-family: inherit;
  cursor: pointer;
}

.window-header button:hover {
  background: #f0f;
  color: #000;
}

.window-body {
  max-height: 65vh;
  padding: 18px;
  overflow-y: auto;
  font-size: 10px;
  line-height: 1.7;
}

.window-body iframe {
  margin-bottom: 8px;
  border: 1px solid #0ff;
}

.window-body a {
  color: #f0f;
}

.browser-launch,
.gallery-launch {
  padding: 28px 18px;
  border: 1px solid #0ff;
  background: rgba(0, 255, 255, 0.06);
  text-align: center;
}

.browser-icon,
.gallery-launch-icon {
  margin-bottom: 14px;
  font-size: 42px;
}

.browser-launch p,
.gallery-launch p {
  margin-bottom: 18px;
  color: #ccc;
}

.browser-link,
.gallery-link,
.music-link {
  display: inline-block;
  padding: 11px 14px;
  background: #0ff;
  color: #000 !important;
  text-decoration: none;
}

.browser-link:hover,
.gallery-link:hover,
.music-link:hover {
  background: #f0f;
}

.gallery-link {
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.6);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.gallery-item {
  padding: 20px 0;
  border: 1px solid #0ff;
  background: rgba(0, 255, 255, 0.08);
  font-size: 30px;
  text-align: center;
}

.hint {
  color: #666;
  font-size: 8px;
}

.music-display {
  text-align: center;
}

.track-name {
  margin-bottom: 15px;
  color: #0f0;
}

.music-label {
  display: block;
  margin-bottom: 8px;
  color: #0ff;
  font-size: 9px;
}

#music-select {
  width: 100%;
  margin-bottom: 12px;
  padding: 9px;
  border: 1px solid #0ff;
  background: #000;
  color: #0ff;
  font-family: inherit;
  font-size: 9px;
}

.music-player {
  display: block;
  width: 100%;
  height: 40px;
  margin-bottom: 12px;
  border: 1px solid #0ff;
}

.music-link {
  background: #f0f;
  cursor: pointer;
}

.music-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.music-controls button {
  padding: 8px 12px;
  border: 1px solid #0ff;
  background: transparent;
  color: #0ff;
  font-size: 14px;
  cursor: pointer;
}

.music-controls button:hover {
  background: #0ff;
  color: #000;
}

.visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 40px;
}

.visualizer span {
  width: 6px;
  background: #0ff;
  animation: bounce 0.8s infinite ease-in-out;
}

.visualizer span:nth-child(1) { height: 10px; animation-delay: 0s; }
.visualizer span:nth-child(2) { height: 25px; animation-delay: 0.1s; }
.visualizer span:nth-child(3) { height: 40px; animation-delay: 0.2s; }
.visualizer span:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.visualizer span:nth-child(5) { height: 15px; animation-delay: 0.4s; }

@keyframes bounce {
  0%, 100% {
    transform: scaleY(0.3);
  }

  50% {
    transform: scaleY(1);
  }
}

.visualizer.paused span {
  animation-play-state: paused;
}

#snake-canvas {
  display: block;
  margin: 0 auto 10px;
  border: 1px solid #0ff;
  background: #000;
}

#win-snake button,
#win-ttt button,
#win-notes button {
  margin-top: 8px;
  padding: 8px 14px;
  font-size: 9px;
}

#ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 60px);
  grid-template-rows: repeat(3, 60px);
  gap: 4px;
  width: fit-content;
  margin: 0 auto 12px;
}

.ttt-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0ff;
  background: rgba(0, 255, 255, 0.05);
  font-size: 22px;
  cursor: pointer;
}

.ttt-cell:hover {
  background: rgba(0, 255, 255, 0.15);
}

#win-ttt button {
  margin-top: 0;
  background: #f0f;
}

#calc-display {
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid #0ff;
  background: #000;
  color: #0f0;
  font-family: inherit;
  font-size: 16px;
  text-align: right;
}

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

.calc-buttons button {
  padding: 12px 0;
  border: 1px solid #0ff;
  background: rgba(0, 255, 255, 0.08);
  color: #0ff;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

.calc-buttons button:hover {
  background: #0ff;
  color: #000;
}

#notes-area {
  width: 100%;
  height: 140px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid #0ff;
  background: #000;
  color: #0f0;
  font-family: inherit;
  font-size: 10px;
  resize: none;
}

#notes-status {
  margin-left: 10px;
  color: #0f0;
  font-size: 9px;
}

.wallpaper-options,
.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.wallpaper-options button {
  padding: 8px 10px;
  border: 1px solid #0ff;
  background: transparent;
  color: #0ff;
  font-family: inherit;
  font-size: 8px;
  cursor: pointer;
}

.wallpaper-options button:hover {
  background: #0ff;
  color: #000;
}

.color-options button {
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  cursor: pointer;
}

@media (max-width: 500px) {
  .window {
    top: 60px;
    left: 5vw;
    width: 90vw;
  }

  .desktop-icons {
    grid-template-columns: repeat(auto-fill, 70px);
  }
}
