:root {
  --taskbar-height: 48px;
  --accent: #3b82f6;
  --bg-glass: rgba(18, 24, 38, 0.75);
  --border-glass: rgba(255, 255, 255, 0.1);
}

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

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at center, #1e293b, #0f172a, #020617);
  font-family: system-ui, -apple-system, sans-serif;
  color: #f8fafc;
}

/* Bureau & Icônes */
.desktop {
  position: absolute;
  top: 0; left: 0;
  right: 0; bottom: var(--taskbar-height);
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 90px);
  grid-auto-rows: 90px;
  gap: 15px;
  align-content: start;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.08);
}

.desktop-icon .icon-symbol {
  font-size: 36px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.desktop-icon span {
  font-size: 12px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* Fenêtres */
.window {
  position: absolute;
  display: none;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05) inset;
  overflow: hidden;
  z-index: 10;
  min-width: 320px;
  min-height: 200px;
  backdrop-filter: blur(12px);
}

.window.active {
  box-shadow: 0 25px 50px rgba(0,0,0,0.8), 0 0 0 1px rgba(59, 130, 246, 0.4) inset;
}

.window-header {
  height: 38px;
  background: rgba(30, 41, 59, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: grab;
  border-bottom: 1px solid var(--border-glass);
}

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

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

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

.window-controls button {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: rgba(0,0,0,0.7);
  transition: transform 0.1s, opacity 0.2s;
}

.btn-close { background: #ef4444; }
.btn-min { background: #f59e0b; }
.btn-max { background: #10b981; }

.window-controls button:hover { transform: scale(1.1); }

.window-body {
  flex: 1;
  position: relative;
  background: #090d16;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.window-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.resizer {
  width: 16px;
  height: 16px;
  position: absolute;
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.2) 50%);
}

/* Barre des tâches */
.taskbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--taskbar-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 9999;
}

.taskbar-left, .taskbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.start-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  transition: filter 0.2s;
}

.start-btn:hover { filter: brightness(1.1); }

.taskbar-app {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s;
}

.taskbar-app:hover, .taskbar-app.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.tray-clock {
  font-size: 13px;
  color: #cbd5e1;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* Menu Démarrer */
.start-menu {
  position: absolute;
  bottom: calc(var(--taskbar-height) + 8px);
  left: 12px;
  width: 280px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 10000;
}

.start-menu.open { display: flex; }

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
}

.start-menu-item:hover {
  background: rgba(59, 130, 246, 0.2);
}