* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body, #root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
}

/* Aero Glass Wallpaper */
.wallpaper-default {
  background: linear-gradient(135deg, #0a2a4a 0%, #0d4f6e 20%, #1a7a5a 40%, #2d8f6f 50%, #1a6a4a 60%, #0d4f6e 80%, #0a2a4a 100%);
  background-size: 400% 400%;
  animation: auroraShift 30s ease infinite;
}

.wallpaper-dark {
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 30%, #16213e 60%, #0a0a1a 100%);
}

@keyframes auroraShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Aero Glass Effect */
.aero-glass {
  background: rgba(180, 210, 240, 0.25);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.aero-glass-dark {
  background: rgba(20, 30, 50, 0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Taskbar */
.taskbar {
  background: linear-gradient(
    to bottom,
    rgba(120, 160, 220, 0.45) 0%,
    rgba(60, 100, 170, 0.55) 40%,
    rgba(40, 70, 130, 0.65) 100%
  );
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border-top: 1px solid rgba(180, 210, 255, 0.4);
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
}

/* Start Button */
.start-btn {
  width: 54px;
  height: 40px;
  border-radius: 4px 12px 12px 4px;
  background: radial-gradient(ellipse at 50% 40%, rgba(120, 200, 255, 0.8), rgba(50, 120, 200, 0.9), rgba(20, 60, 140, 1));
  border: 2px solid rgba(180, 220, 255, 0.5);
  box-shadow: 0 0 12px rgba(80, 160, 255, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.start-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.35), transparent);
  border-radius: 2px 10px 0 0;
}

.start-btn:hover {
  box-shadow: 0 0 24px rgba(80, 180, 255, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.5);
  background: radial-gradient(ellipse at 50% 40%, rgba(140, 220, 255, 0.9), rgba(70, 140, 220, 0.95), rgba(30, 80, 160, 1));
}

.start-btn:active {
  box-shadow: 0 0 8px rgba(80, 160, 255, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Window */
.window {
  position: absolute;
  border-radius: 8px 8px 4px 4px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.window-titlebar {
  background: linear-gradient(
    to bottom,
    rgba(140, 180, 240, 0.55) 0%,
    rgba(100, 150, 220, 0.5) 40%,
    rgba(80, 120, 200, 0.45) 100%
  );
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  cursor: default;
  flex-shrink: 0;
}

.window-titlebar.inactive {
  background: linear-gradient(
    to bottom,
    rgba(180, 190, 210, 0.4) 0%,
    rgba(160, 170, 190, 0.35) 100%
  );
}

.window-body {
  flex: 1;
  background: rgba(240, 245, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: auto;
}

/* Title bar buttons */
.win-btn {
  width: 28px;
  height: 20px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: all 0.15s;
  margin-left: 2px;
  position: relative;
  overflow: hidden;
}

.win-btn-minimize {
  background: linear-gradient(to bottom, rgba(200, 220, 240, 0.7), rgba(160, 180, 210, 0.7));
}
.win-btn-minimize:hover {
  background: linear-gradient(to bottom, rgba(220, 240, 255, 0.9), rgba(180, 200, 240, 0.9));
}

.win-btn-maximize {
  background: linear-gradient(to bottom, rgba(200, 220, 240, 0.7), rgba(160, 180, 210, 0.7));
}
.win-btn-maximize:hover {
  background: linear-gradient(to bottom, rgba(220, 240, 255, 0.9), rgba(180, 200, 240, 0.9));
}

.win-btn-close {
  background: linear-gradient(to bottom, rgba(230, 140, 130, 0.8), rgba(200, 80, 70, 0.8));
}
.win-btn-close:hover {
  background: linear-gradient(to bottom, rgba(255, 160, 150, 0.95), rgba(230, 60, 50, 0.95));
}

/* Start Menu */
.start-menu {
  position: absolute;
  bottom: 48px;
  left: 0;
  width: 420px;
  max-width: calc(100vw - 10px);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(
    135deg,
    rgba(160, 190, 240, 0.55) 0%,
    rgba(130, 170, 230, 0.5) 50%,
    rgba(100, 140, 210, 0.45) 100%
  );
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: none;
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  animation: startMenuOpen 0.2s ease-out;
}

@keyframes startMenuOpen {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Window animations */
.window-opening {
  animation: windowOpen 0.25s ease-out;
}

@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.window-closing {
  animation: windowClose 0.2s ease-in forwards;
}

@keyframes windowClose {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}

/* Boot screen */
.boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  color: white;
}

.boot-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(100, 180, 255, 0.3);
  border-top: 3px solid rgba(100, 180, 255, 1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

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

/* Desktop icon */
.desktop-icon {
  width: 76px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.desktop-icon:hover {
  background: rgba(100, 160, 255, 0.25);
  border: 1px solid rgba(100, 160, 255, 0.4);
  margin: -1px;
}

.desktop-icon.selected {
  background: rgba(80, 140, 255, 0.35);
  border: 1px solid rgba(80, 140, 255, 0.6);
  margin: -1px;
}

.desktop-icon-img {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 4px;
  filter: drop-shadow(1px 2px 3px rgba(0,0,0,0.4));
}

.desktop-icon-label {
  font-size: 11px;
  color: white;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8), 0 0 5px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
  word-break: break-word;
}

/* Context menu */
.context-menu {
  position: fixed;
  background: rgba(240, 245, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(180, 190, 210, 0.6);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  min-width: 180px;
  z-index: 99998;
  padding: 4px 0;
}

.context-menu-item {
  padding: 6px 24px;
  cursor: pointer;
  font-size: 12px;
  color: #1a1a2e;
  transition: background 0.1s;
}

.context-menu-item:hover {
  background: rgba(60, 120, 220, 0.2);
}

.context-menu-separator {
  height: 1px;
  background: rgba(180, 190, 210, 0.5);
  margin: 4px 8px;
}

/* Taskbar button */
.taskbar-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  font-size: 12px;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.taskbar-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.taskbar-btn.active {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1);
}

.taskbar-btn.minimized {
  background: rgba(255, 255, 255, 0.08);
}

/* System tray */
.systray {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  height: 100%;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 11px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Shutdown screen */
.shutdown-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  color: white;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scrollbar */
.window-body::-webkit-scrollbar {
  width: 8px;
}
.window-body::-webkit-scrollbar-track {
  background: rgba(200, 210, 230, 0.3);
}
.window-body::-webkit-scrollbar-thumb {
  background: rgba(140, 160, 200, 0.5);
  border-radius: 4px;
}

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

/* Calculator */
.calc-btn {
  border: 1px solid rgba(180, 190, 210, 0.6);
  border-radius: 3px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #f0f3f8, #dce1ea);
  color: #1a1a2e;
}
.calc-btn:hover {
  background: linear-gradient(to bottom, #e0e8f5, #c8d0e2);
}
.calc-btn:active {
  background: linear-gradient(to bottom, #c8d0e2, #b0b8cc);
}
.calc-btn-op {
  background: linear-gradient(to bottom, #e8eef8, #d0d8ea);
  color: #2a4080;
}
.calc-btn-eq {
  background: linear-gradient(to bottom, #a0c0f0, #6090d0);
  color: white;
  font-weight: 700;
}
.calc-btn-eq:hover {
  background: linear-gradient(to bottom, #b0d0ff, #70a0e0);
}

/* Minesweeper */
.mine-cell {
  width: 28px;
  height: 28px;
  border: 2px outset #ddd;
  background: linear-gradient(to bottom, #e8e8e8, #c8c8c8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.mine-cell.revealed {
  border: 1px solid #aaa;
  background: #d4d4d4;
  cursor: default;
}
.mine-cell.mine-explode {
  background: #ff4444;
}

/* Mobile styles */
@media (max-width: 640px) {
  .start-menu {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    left: 0;
  }
  .start-btn {
    width: 44px;
    height: 36px;
  }
  .taskbar-btn {
    padding: 0 8px;
    max-width: 120px;
  }
  .desktop-icon {
    width: 70px;
  }
  .desktop-icon-img {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
  .desktop-icon-label {
    font-size: 10px;
  }
}