* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; width: 100%; overflow: hidden; }
body { font-family: 'Bricolage Grotesque', sans-serif; -webkit-user-select: none; user-select: none; }

/* ---- Boot ---- */
.boot-screen {
  position: fixed; inset: 0; background: #000814;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; z-index: 9999;
}
.boot-logo { font-size: 72px; animation: pulse 1.4s ease-in-out infinite; filter: drop-shadow(0 0 20px #4fa3ff); }
.boot-title { font-size: 32px; font-weight: 300; margin-top: 16px; letter-spacing: 1px; }
.boot-12 { font-weight: 800; background: linear-gradient(90deg,#4fa3ff,#a97bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot-spinner {
  width: 34px; height: 34px; margin-top: 34px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.15); border-top-color: #4fa3ff;
  animation: spin .8s linear infinite;
}
.boot-msg { margin-top: 22px; font-size: 13px; color: #9db4d0; font-family: 'JetBrains Mono', monospace; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .8; } }

/* ---- Desktop ---- */
.desktop { position: fixed; inset: 0; overflow: hidden; }
.fade-in { animation: fadeIn .6s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.icon-grid {
  position: absolute; top: 16px; left: 12px;
  display: flex; flex-direction: column; flex-wrap: wrap; gap: 6px;
  max-height: calc(100% - 90px);
}
.desktop-icon {
  width: 78px; padding: 8px 4px; border-radius: 8px; cursor: default;
  display: flex; flex-direction: column; align-items: center;
  transition: background .12s;
}
.desktop-icon:hover { background: rgba(255,255,255,.12); }
.desktop-icon.selected { background: rgba(90,150,255,.35); outline: 1px solid rgba(255,255,255,.4); }

.watermark {
  position: absolute; right: 22px; bottom: 62px; text-align: right;
  color: rgba(255,255,255,.35); font-size: 22px; font-weight: 300; pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* ---- Windows ---- */
.os-window {
  position: absolute; background: #fff; border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.4);
  animation: winOpen .18s ease;
}
@keyframes winOpen { from { transform: scale(.95); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.os-window.focused { box-shadow: 0 12px 55px rgba(0,0,0,.55); }
.win-titlebar {
  height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 4px 0 10px;
  background: rgba(240,244,250,.85); backdrop-filter: blur(10px);
  cursor: move; border-bottom: 1px solid rgba(0,0,0,.06);
}
.win-btn {
  width: 34px; height: 30px; border: none; background: transparent; cursor: pointer;
  font-size: 13px; color: #333; border-radius: 4px;
}
.win-btn:hover { background: rgba(0,0,0,.08); }
.win-btn.close:hover { background: #e81123; color: #fff; }
.win-body { flex: 1; overflow: hidden; }

/* ---- Taskbar ---- */
.taskbar {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  height: 46px; min-width: 260px; max-width: calc(100% - 16px);
  display: flex; align-items: center; gap: 4px; padding: 0 8px;
  background: rgba(30,40,60,.55); backdrop-filter: blur(22px);
  border: 1px solid rgba(255,255,255,.15); border-radius: 12px;
  box-shadow: 0 6px 26px rgba(0,0,0,.35); z-index: 5000;
}
.start-btn {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px 0 10px; border: none; background: transparent;
  cursor: pointer; border-radius: 8px; transition: background .12s, transform .12s;
  color: #fff;
}
.start-btn:hover { background: rgba(255,255,255,.18); }
.start-btn:active { transform: scale(.94); }
.start-btn.active {
  background: rgba(120,170,255,.32);
  box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset, 0 0 14px rgba(110,176,255,.35);
}
.start-logo { font-size: 22px; line-height: 1; filter: drop-shadow(0 0 6px rgba(110,176,255,.6)); }
.start-label {
  font-size: 13px; font-weight: 600; letter-spacing: .2px;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
@media (max-width: 640px) {
  .start-label { display: none; }
  .start-btn { padding: 0 10px; }
}
.taskbar-apps { display: flex; gap: 2px; align-items: center; }
.task-app {
  font-size: 20px; width: 40px; height: 36px; border: none; background: transparent;
  cursor: pointer; border-radius: 8px; position: relative; transition: background .12s;
}
.task-app:hover { background: rgba(255,255,255,.15); }
.task-app.active { background: rgba(255,255,255,.22); }
.task-app.active::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 3px; border-radius: 3px; background: #6ab0ff;
}
.tray { display: flex; align-items: center; gap: 8px; margin-left: auto; color: #fff; font-size: 14px; padding-left: 8px; }
.tray-clock { font-family: 'JetBrains Mono', monospace; font-size: 10px; line-height: 1.25; text-align: right; }

/* ---- Start Menu ---- */
.start-menu {
  position: absolute; bottom: 62px; left: 50%; transform: translateX(-50%);
  width: 340px; max-width: calc(100% - 20px); padding: 16px;
  background: rgba(35,45,68,.82); backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,.18); border-radius: 14px;
  box-shadow: 0 12px 50px rgba(0,0,0,.5); z-index: 5001;
  animation: winOpen .2s ease;
}
.start-search {
  width: 100%; padding: 8px 12px; border-radius: 18px; border: none;
  background: rgba(255,255,255,.9); outline: none; font-size: 13px;
}
.start-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px; border: none; background: rgba(255,255,255,.06);
  border-radius: 8px; cursor: pointer; transition: background .12s;
}
.start-tile:hover { background: rgba(255,255,255,.16); }
.start-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.15);
}

/* ---- Context Menu ---- */
.context-menu {
  position: absolute; min-width: 190px; padding: 6px;
  background: rgba(40,50,70,.92); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.15); border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); z-index: 6000;
}
.ctx-item { padding: 8px 12px; font-size: 13px; color: #fff; border-radius: 6px; cursor: pointer; }
.ctx-item:hover { background: rgba(255,255,255,.15); }

/* ---- Toast ---- */
.toast {
  position: absolute; right: 12px; bottom: 62px; width: 250px; padding: 14px;
  background: rgba(30,40,60,.92); backdrop-filter: blur(20px); color: #fff;
  border: 1px solid rgba(255,255,255,.15); border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); z-index: 5500;
  animation: slideUp .35s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---- Shutdown ---- */
.shutdown {
  position: fixed; inset: 0; background: #0a1020; color: #fff; z-index: 9998;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px; animation: fadeIn .5s ease;
}

@media (max-width: 640px) {
  .icon-grid { max-height: calc(100% - 130px); }
  .desktop-icon { width: 68px; }
  .watermark { display: none; }
}