:root {
  --primary: #7c3aed;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --bg-dark: #0f0f1a;
  --bg-light: #e0e7ff;
  --surface-dark: #1a1a2e;
  --surface-light: #f8fafc;
  --text-dark: #e2e8f0;
  --text-light: #1e293b;
  --border-dark: #374151;
  --border-light: #cbd5e1;
}

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

body {
  font-family: 'Space Mono', monospace;
  overflow: hidden;
  user-select: none;
}

/* Boot Screen */
.boot-screen {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #2d1f4e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.boot-content {
  text-align: center;
  color: var(--text-dark);
}

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

.gear-icon {
  font-size: 80px;
  display: inline-block;
}

.spinning {
  animation: spin 2s linear infinite;
}

.spinning-slow {
  animation: spin 4s linear infinite;
}

.spinning-down {
  animation: spinDown 3s ease-out forwards;
}

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

@keyframes spinDown {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); opacity: 0.3; }
}

.boot-title {
  font-family: 'VT323', monospace;
  font-size: 48px;
  color: var(--secondary);
  text-shadow: 0 0 20px var(--secondary);
  margin-top: 10px;
}

.boot-version {
  color: #888;
  font-size: 14px;
}

.boot-progress-container {
  width: 300px;
  height: 8px;
  background: var(--surface-dark);
  border-radius: 4px;
  margin: 30px auto;
  overflow: hidden;
  border: 1px solid var(--border-dark);
}

.boot-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--secondary);
}

.boot-message {
  color: var(--secondary);
  font-size: 14px;
  min-height: 20px;
}

/* Desktop */
.spineer-desktop {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.spineer-desktop.dark {
  --bg: var(--bg-dark);
  --surface: var(--surface-dark);
  --text: var(--text-dark);
  --border: var(--border-dark);
}

.spineer-desktop.light {
  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --text: var(--text-light);
  --border: var(--border-light);
}

/* Wallpapers */
.wallpaper-gradient {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1f4e 30%, #1a3a4a 70%, #1a1a2e 100%);
}

.wallpaper-stars {
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 100%);
}

.wallpaper-grid {
  background: 
    linear-gradient(rgba(124,58,237,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.1) 1px, transparent 1px),
    linear-gradient(135deg, #1a1a2e, #0f0f1a);
  background-size: 40px 40px, 40px 40px, 100% 100%;
}

.wallpaper-waves {
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(124,58,237,0.05) 40px,
      rgba(124,58,237,0.05) 80px
    ),
    linear-gradient(135deg, #1a1a2e, #2d1f4e);
}

.light.wallpaper-gradient {
  background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 30%, #cffafe 70%, #e0e7ff 100%);
}

.light.wallpaper-stars {
  background: radial-gradient(ellipse at center, #f8fafc 0%, #e0e7ff 100%);
}

.light.wallpaper-grid {
  background: 
    linear-gradient(rgba(124,58,237,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.15) 1px, transparent 1px),
    linear-gradient(135deg, #f8fafc, #e0e7ff);
  background-size: 40px 40px, 40px 40px, 100% 100%;
}

.light.wallpaper-waves {
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(124,58,237,0.1) 40px,
      rgba(124,58,237,0.1) 80px
    ),
    linear-gradient(135deg, #f8fafc, #ddd6fe);
}

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

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  width: 80px;
}

.desktop-icon:hover {
  background: rgba(124, 58, 237, 0.2);
}

.desktop-icon.selected {
  background: rgba(124, 58, 237, 0.3);
  outline: 2px solid var(--primary);
}

.icon-image {
  font-size: 40px;
  margin-bottom: 4px;
}

.icon-label {
  font-size: 11px;
  color: var(--text);
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  word-wrap: break-word;
}

/* Windows */
.window {
  position: absolute;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 
    0 4px 20px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.1);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 300px;
  min-height: 200px;
}

.window-closing {
  animation: windowClose var(--spin-duration, 0.5s) ease-in forwards;
}

@keyframes windowClose {
  0% { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(0) rotate(720deg); opacity: 0; }
}

.window-titlebar {
  background: linear-gradient(180deg, var(--primary), #5b21b6);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
}

.window-title {
  color: white;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-icon {
  font-size: 16px;
}

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

.win-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.win-btn:hover {
  transform: scale(1.1);
}

.win-btn.minimize { background: #fbbf24; color: #78350f; }
.win-btn.maximize { background: #34d399; color: #064e3b; }
.win-btn.close { background: #f87171; color: #7f1d1d; }

.window-content {
  flex: 1;
  padding: 16px;
  overflow: auto;
  color: var(--text);
}

/* Taskbar */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  padding: 0 8px;
  z-index: 9999;
}

.start-button {
  background: linear-gradient(180deg, var(--primary), #5b21b6);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: bold;
  transition: all 0.2s;
}

.start-button:hover {
  background: linear-gradient(180deg, #8b5cf6, var(--primary));
  transform: scale(1.02);
}

.start-gear {
  font-size: 18px;
}

.taskbar-windows {
  flex: 1;
  display: flex;
  gap: 4px;
  padding: 0 12px;
  overflow-x: auto;
}

.taskbar-item {
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  color: var(--text-dark);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.2s;
}

.taskbar-item:hover {
  background: rgba(124, 58, 237, 0.3);
}

.taskbar-item.minimized {
  opacity: 0.6;
}

.taskbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 8px;
}

.spin-counter {
  color: var(--secondary);
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

.spin-counter:hover {
  transform: rotate(360deg);
}

.taskbar-clock {
  color: var(--text-dark);
  font-size: 13px;
}

/* Start Menu */
.start-menu {
  position: fixed;
  bottom: 56px;
  left: 8px;
  width: 280px;
  background: rgba(26, 26, 46, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 10000;
  overflow: hidden;
}

.start-header {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-weight: bold;
  font-size: 18px;
}

.start-logo {
  font-size: 28px;
}

.menu-category {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-dark);
}

.category-title {
  color: #888;
  font-size: 11px;
  padding: 4px 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.menu-item:hover {
  background: rgba(124, 58, 237, 0.3);
}

.menu-item:hover .hover-spin {
  animation: spin 0.5s ease-in-out;
}

.menu-icon {
  font-size: 20px;
}

.menu-item.shutdown {
  border-top: 1px solid var(--border-dark);
  color: #f87171;
}

/* Shutdown Screen */
.shutdown-screen {
  position: fixed;
  inset: 0;
  background: #0f0f1a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  cursor: pointer;
}

.shutdown-content {
  text-align: center;
  color: var(--text-dark);
}

.shutdown-content .gear-icon {
  font-size: 100px;
  color: var(--primary);
}

.shutdown-content p {
  margin-top: 20px;
  font-size: 18px;
}

/* App Styles */
.paint-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.paint-toolbar {
  display: flex;
  gap: 10px;
  padding: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.color-picker {
  width: 40px;
  height: 32px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.brush-slider {
  width: 100px;
  accent-color: var(--primary);
}

.paint-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s;
}

.paint-btn:hover {
  transform: scale(1.05);
}

.canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.paint-canvas {
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: crosshair;
}

/* File Explorer */
.file-explorer {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  margin-bottom: 10px;
}

.explorer-toolbar button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

.explorer-toolbar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.path-display {
  color: var(--secondary);
  font-size: 13px;
}

.file-list {
  flex: 1;
  overflow-y: auto;
}

.file-item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.file-item:hover {
  background: rgba(124, 58, 237, 0.2);
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
}

.loading-overlay .spinner {
  font-size: 48px;
  animation: spin 1s linear infinite;
}

.file-message {
  margin-top: 10px;
  padding: 10px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  text-align: center;
}

/* Settings */
.settings-app h3 {
  margin-bottom: 20px;
  color: var(--secondary);
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.setting-item label {
  flex: 1;
}

.setting-item select,
.setting-item input[type="range"] {
  width: 150px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
}

.theme-toggle,
.sound-toggle {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

/* Spin Game */
.spin-game {
  text-align: center;
}

.wheel-container {
  margin: 20px 0;
}

.spin-wheel {
  font-size: 80px;
  display: inline-block;
}

.spin-button {
  background: linear-gradient(180deg, var(--accent), #d97706);
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 50px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.spin-button:hover:not(:disabled) {
  transform: scale(1.05);
}

.spin-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.game-stats {
  margin: 20px 0;
}

.game-stats p {
  font-size: 16px;
  margin: 8px 0;
}

.achievements h4 {
  color: var(--secondary);
  margin-bottom: 10px;
}

.no-achievements {
  color: #888;
  font-style: italic;
}

.achievement-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 20px;
  margin: 4px;
  font-size: 12px;
  color: var(--accent);
}

/* README */
.readme-app {
  line-height: 1.8;
}

.readme-app h2 {
  color: var(--secondary);
  margin-bottom: 8px;
}

.readme-app h3 {
  color: var(--primary);
  margin: 16px 0 8px;
}

.readme-app hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.readme-app ul {
  list-style: none;
  padding-left: 8px;
}

.readme-app li {
  margin: 4px 0;
}

.credits {
  margin-top: 20px;
  color: #888;
  font-size: 12px;
}

.remix-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--secondary);
  text-decoration: none;
  border: 1px solid var(--secondary);
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.2s;
}

.remix-link:hover {
  background: var(--secondary);
  color: var(--bg-dark);
}

/* Floating Particles */
.floating-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.3;
  animation: float linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .desktop-icons-container {
    flex-direction: row;
    flex-wrap: wrap;
    top: 10px;
    left: 10px;
    right: 10px;
  }
  
  .desktop-icon {
    width: 70px;
  }
  
  .icon-image {
    font-size: 32px;
  }
  
  .window {
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 120px) !important;
    left: 10px !important;
    top: 60px !important;
  }
  
  .start-menu {
    width: calc(100vw - 16px);
    left: 8px;
    right: 8px;
  }
  
  .taskbar-windows {
    display: none;
  }
  
  .boot-title {
    font-size: 36px;
  }
  
  .gear-icon {
    font-size: 60px;
  }
}