* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #050a12; font-family: 'Segoe UI', sans-serif; overflow: hidden; height: 100vh; }

#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.star { position: absolute; background: white; border-radius: 50%; animation: twinkle var(--d) infinite; opacity: 0; }
@keyframes twinkle { 0%,100%{opacity:0} 50%{opacity:var(--o)} }

/* ── BOOT ── */
#boot {
  position: fixed; inset: 0; z-index: 50;
  background: #050a12; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-family: monospace;
}
.boot-line { font-size: 13px; color: #00ff88; margin: 2px 0; opacity: 0; animation: fadein 0.3s forwards; }
@keyframes fadein { to { opacity: 1; } }
.boot-bar-wrap { margin-top: 24px; width: 300px; height: 3px; background: #1a2030; border-radius: 2px; overflow: hidden; }
.boot-bar { height: 100%; width: 0; background: #7eb8f7; border-radius: 2px; transition: width 1.8s ease; }

/* ── AUTH ── */
#auth { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; }
.auth-card {
  background: rgba(8,12,22,0.92); border: 1px solid #1e2a3a;
  border-radius: 16px; padding: 44px 40px;
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; align-items: center;
  backdrop-filter: blur(16px);
}
.auth-logo {
  width: 56px; height: 56px; border: 2px solid #7eb8f7; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #7eb8f7; margin-bottom: 28px;
}
.auth-title {
  font-size: 20px; font-weight: 700; letter-spacing: 4px;
  color: #7eb8f7; margin-bottom: 6px; text-align: center;
  -webkit-text-fill-color: #7eb8f7;
}
.auth-sub { font-size: 12px; color: #556677; margin-bottom: 28px; letter-spacing: 1px; }
.auth-input {
  width: 100%; background: rgba(255,255,255,0.03);
  border: 1px solid #1e2a3a; border-radius: 8px;
  padding: 12px 16px; color: #ccd6e0; font-size: 14px;
  margin-bottom: 10px; outline: none; transition: border 0.2s;
}
.auth-input:focus { border-color: #3a6a9a; }
.auth-input::placeholder { color: #334455; }
.auth-btn {
  width: 100%; padding: 12px; background: rgba(126,184,247,0.08);
  border: 1px solid #2a4a6a; border-radius: 8px;
  color: #7eb8f7; font-size: 14px; cursor: pointer;
  margin-top: 8px; transition: background 0.2s; letter-spacing: 1px;
}
.auth-btn:hover { background: rgba(126,184,247,0.15); }
.auth-switch { font-size: 12px; color: #445566; margin-top: 20px; text-align: center; }
.auth-switch span { color: #7eb8f7; cursor: pointer; }
.auth-switch span:hover { text-decoration: underline; }
.auth-error { font-size: 12px; color: #ff5f57; min-height: 16px; margin: 6px 0; text-align: center; }

/* ── LANDING ── */
#landing {
  position: fixed; inset: 0; z-index: 10;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.8s ease;
}
.landing-logo {
  width: 64px; height: 64px; border: 2px solid #7eb8f7; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: #7eb8f7; margin-bottom: 32px;
}
h1 {
  font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 700;
  background: linear-gradient(135deg, #7eb8f7 0%, #c8e8ff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 12px; letter-spacing: -1px;
}
.tagline { color: #445566; font-size: 12px; letter-spacing: 4px; text-transform: uppercase; margin-bottom: 52px; }
.btn-start {
  background: transparent; border: 1px solid #2a4a6a;
  color: #7eb8f7; padding: 13px 40px; border-radius: 6px; font-size: 14px;
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 12px;
  letter-spacing: 1px;
}
.btn-start:hover { background: rgba(126,184,247,0.08); border-color: #7eb8f7; }
.arrow { transition: transform 0.2s; }
.btn-start:hover .arrow { transform: translateX(5px); }
.funfact { position: absolute; bottom: 32px; text-align: center; }
.funfact span:first-child { display: block; font-size: 9px; letter-spacing: 3px; color: #2a3a4a; margin-bottom: 5px; text-transform: uppercase; }
.funfact span:last-child { font-size: 12px; color: #445566; }

/* ── OS ── */
#os { position: fixed; inset: 0; z-index: 20; display: none; flex-direction: column; }
#os.active { display: flex; }

/* WALLPAPER — swap this URL to change your background */
#desktop {
  flex: 1; position: relative; overflow: hidden;
  background-image: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920&q=80');
  background-size: cover; background-position: center;
}
#desktop-overlay {
  position: absolute; inset: 0;
  background: rgba(5,10,18,0.45);
}

/* ── TASKBAR ── */
#taskbar {
  height: 38px; background: rgba(5,8,16,0.96);
  border-bottom: 1px solid rgba(126,184,247,0.08);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  flex-shrink: 0; z-index: 100; backdrop-filter: blur(10px);
}
.tb-logo { font-size: 12px; font-weight: 600; color: #7eb8f7; letter-spacing: 2px; text-transform: uppercase; }
.tb-sep { width: 1px; height: 14px; background: #1a2a3a; }
.tb-user { font-size: 11px; color: #445566; letter-spacing: 1px; }
.tb-time { margin-left: auto; font-size: 12px; color: #7eb8f7; font-family: 'Courier New', monospace; letter-spacing: 1px; }
.tb-date { font-size: 11px; color: #334455; margin-left: 10px; }

/* ── DESKTOP ICONS ── */
.desktop-icon {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  gap: 7px; cursor: pointer; padding: 10px; border-radius: 10px;
  transition: background 0.15s; z-index: 2; user-select: none;
}
.desktop-icon:hover { background: rgba(126,184,247,0.07); }
.icon-img {
  width: 52px; height: 52px; border-radius: 12px;
  background-size: cover; background-position: center;
  border: 1px solid rgba(126,184,247,0.15);
  /* APP ICON — swap background-image per icon in JS below */
}
.icon-label { font-size: 11px; color: #aabbcc; text-shadow: 0 1px 6px #000; letter-spacing: 0.3px; }

/* ── DOCK ── */
#dock {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(5,8,16,0.82); border: 1px solid rgba(126,184,247,0.08);
  border-radius: 16px; padding: 10px 18px;
  display: flex; gap: 18px; align-items: center;
  backdrop-filter: blur(16px); z-index: 2;
}
.dock-item { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; position: relative; }
.dock-icon {
  width: 46px; height: 46px; border-radius: 11px;
  background-size: cover; background-position: center;
  border: 1px solid rgba(126,184,247,0.12);
  transition: transform 0.15s;
}
.dock-item:hover .dock-icon { transform: translateY(-7px) scale(1.12); }
.dock-label { font-size: 10px; color: #556677; letter-spacing: 0.3px; }

/* ── WINDOWS ── */
.window {
  position: absolute; background: rgba(8,11,20,0.96);
  border: 1px solid rgba(126,184,247,0.1);
  border-radius: 10px; min-width: 340px; display: flex; flex-direction: column;
  overflow: hidden; backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}
.window-titlebar {
  height: 34px; background: rgba(5,8,16,0.98);
  border-bottom: 1px solid rgba(126,184,247,0.07);
  display: flex; align-items: center; padding: 0 12px; gap: 7px;
  cursor: move; user-select: none; flex-shrink: 0;
}
.win-btn { width: 11px; height: 11px; border-radius: 50%; cursor: pointer; flex-shrink: 0; }
.win-close { background: #ff5f57; }
.win-min { background: #febc2e; }
.win-max { background: #28c840; }
.window-title { font-size: 11px; color: #445566; margin-left: 6px; letter-spacing: 1px; text-transform: uppercase; }
.window-body { flex: 1; padding: 16px; overflow-y: auto; }
.window-body::-webkit-scrollbar { width: 4px; }
.window-body::-webkit-scrollbar-thumb { background: #1a2a3a; border-radius: 2px; }

/* ── TESTAPP ── */
.testapp-header { font-size: 16px; font-weight: 600; color: #7eb8f7; margin-bottom: 10px; letter-spacing: 1px; }
.testapp-body { color: #556677; font-size: 13px; line-height: 1.8; }
.testapp-btn {
  margin-top: 16px; padding: 8px 20px; background: transparent;
  border: 1px solid #2a4a6a; color: #7eb8f7; border-radius: 6px;
  cursor: pointer; font-size: 12px; transition: background 0.2s; letter-spacing: 1px;
}
.testapp-btn:hover { background: rgba(126,184,247,0.08); }

/* ── SETTINGS ── */
.settings-wrap { display: flex; height: 100%; gap: 0; }
.settings-nav {
  width: 160px; flex-shrink: 0; border-right: 1px solid rgba(126,184,247,0.07);
  padding: 8px 0;
}
.settings-nav-item {
  padding: 9px 16px; font-size: 12px; color: #445566; cursor: pointer;
  letter-spacing: 0.5px; transition: all 0.15s; border-left: 2px solid transparent;
}
.settings-nav-item:hover { color: #7eb8f7; background: rgba(126,184,247,0.04); }
.settings-nav-item.active { color: #7eb8f7; border-left-color: #7eb8f7; background: rgba(126,184,247,0.06); }
.settings-panel { flex: 1; padding: 16px; overflow-y: auto; }
.settings-panel::-webkit-scrollbar { width: 3px; }
.settings-panel::-webkit-scrollbar-thumb { background: #1a2a3a; }
.settings-panel > div { display: none; }
.settings-panel > div.active { display: block; }
.s-title { font-size: 11px; color: #334455; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 16px; border-bottom: 1px solid rgba(126,184,247,0.06); padding-bottom: 8px; }
.s-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.s-label { font-size: 12px; color: #7eb8f7; letter-spacing: 0.5px; }
.s-desc { font-size: 11px; color: #334455; margin-top: 1px; }
.s-val { font-size: 12px; color: #445566; }
.s-btn {
  padding: 6px 14px; background: transparent; border: 1px solid #1e2a3a;
  color: #7eb8f7; border-radius: 5px; font-size: 11px; cursor: pointer;
  transition: background 0.15s; letter-spacing: 0.5px;
}
.s-btn:hover { background: rgba(126,184,247,0.08); }
.s-btn.danger { border-color: #3a1a1a; color: #ff5f57; }
.s-btn.danger:hover { background: rgba(255,95,87,0.08); }
.s-toggle {
  width: 36px; height: 20px; background: #1a2030; border-radius: 10px;
  position: relative; cursor: pointer; transition: background 0.2s; border: 1px solid #2a3a4a;
  flex-shrink: 0;
}
.s-toggle.on { background: rgba(126,184,247,0.25); border-color: #3a6a9a; }
.s-toggle::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  background: #445566; border-radius: 50%; top: 2px; left: 2px; transition: all 0.2s;
}
.s-toggle.on::after { left: 18px; background: #7eb8f7; }
.s-input {
  background: rgba(255,255,255,0.03); border: 1px solid #1e2a3a;
  border-radius: 5px; padding: 6px 10px; color: #7eb8f7; font-size: 12px;
  outline: none; width: 140px;
}
.s-input:focus { border-color: #3a6a9a; }
.s-divider { height: 1px; background: rgba(126,184,247,0.05); margin: 16px 0; }
.s-info { font-size: 11px; color: #2a3a4a; margin-top: 4px; }

/* ── SPOTIFY APP ── */
.sp-wrap { display: flex; flex-direction: column; height: 100%; gap: 0; background: #0a0a0a; margin: -16px; border-radius: 0 0 10px 10px; overflow: hidden; }
.sp-login { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 32px; text-align: center; }
.sp-login-logo { font-size: 48px; margin-bottom: 16px; }
.sp-login-title { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.sp-login-sub { font-size: 12px; color: #555; margin-bottom: 24px; }
.sp-login-btn { background: #1DB954; border: none; color: #000; font-size: 13px; font-weight: 700; padding: 12px 32px; border-radius: 24px; cursor: pointer; letter-spacing: 1px; transition: transform 0.15s, background 0.15s; }
.sp-login-btn:hover { background: #1ed760; transform: scale(1.04); }
.sp-login-note { font-size: 10px; color: #333; margin-top: 16px; line-height: 1.6; max-width: 260px; }
.sp-main { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.sp-top { display: flex; gap: 0; flex: 1; overflow: hidden; }
.sp-sidebar { width: 180px; flex-shrink: 0; background: #000; padding: 12px 8px; border-right: 1px solid #111; overflow-y: auto; }
.sp-sidebar-title { font-size: 9px; color: #444; letter-spacing: 2px; text-transform: uppercase; padding: 4px 8px 8px; }
.sp-nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: #aaa; font-size: 12px; transition: all 0.15s; }
.sp-nav-item:hover, .sp-nav-item.active { background: #1a1a1a; color: #fff; }
.sp-nav-icon { font-size: 14px; width: 18px; text-align: center; }
.sp-content { flex: 1; overflow-y: auto; padding: 16px; background: linear-gradient(180deg, #1a1a2e 0%, #0a0a0a 40%); }
.sp-content::-webkit-scrollbar { width: 3px; }
.sp-content::-webkit-scrollbar-thumb { background: #222; }
.sp-section-title { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 14px; }
.sp-search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.sp-search-input { flex: 1; background: #1a1a1a; border: 1px solid #222; border-radius: 20px; padding: 8px 14px; color: #fff; font-size: 12px; outline: none; }
.sp-search-input:focus { border-color: #1DB954; }
.sp-search-input::placeholder { color: #444; }
.sp-search-btn { background: #1DB954; border: none; border-radius: 20px; color: #000; font-size: 11px; font-weight: 700; padding: 8px 14px; cursor: pointer; }
.sp-track-list { display: flex; flex-direction: column; gap: 2px; }
.sp-track { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; transition: background 0.15s; }
.sp-track:hover { background: #1a1a1a; }
.sp-track.playing { background: #1a2a1a; }
.sp-track-num { width: 16px; font-size: 11px; color: #555; text-align: center; flex-shrink: 0; }
.sp-track-num.playing-icon { color: #1DB954; }
.sp-track-art { width: 36px; height: 36px; border-radius: 4px; background: #222; flex-shrink: 0; object-fit: cover; }
.sp-track-info { flex: 1; min-width: 0; }
.sp-track-name { font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-track-name.playing { color: #1DB954; }
.sp-track-artist { font-size: 11px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-track-duration { font-size: 11px; color: #555; flex-shrink: 0; }
.sp-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-bottom: 20px; }
.sp-card { background: #161616; border-radius: 8px; padding: 12px; cursor: pointer; transition: background 0.15s; }
.sp-card:hover { background: #222; }
.sp-card-art { width: 100%; aspect-ratio: 1; border-radius: 6px; background: #222; margin-bottom: 8px; object-fit: cover; font-size: 32px; display: flex; align-items: center; justify-content: center; }
.sp-card-name { font-size: 11px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-card-desc { font-size: 10px; color: #666; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-player { height: 72px; background: #0a0a0a; border-top: 1px solid #1a1a1a; display: flex; align-items: center; padding: 0 14px; gap: 12px; flex-shrink: 0; }
.sp-now-art { width: 44px; height: 44px; border-radius: 4px; background: #1a1a1a; flex-shrink: 0; object-fit: cover; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.sp-now-info { flex: 1; min-width: 0; }
.sp-now-name { font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-now-artist { font-size: 11px; color: #666; }
.sp-controls { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1.5; }
.sp-ctrl-btns { display: flex; align-items: center; gap: 14px; }
.sp-btn { background: none; border: none; color: #aaa; cursor: pointer; font-size: 14px; transition: color 0.15s; padding: 2px; }
.sp-btn:hover { color: #fff; }
.sp-btn.play { width: 28px; height: 28px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #000; font-size: 12px; }
.sp-btn.play:hover { transform: scale(1.06); background: #fff; color: #000; }
.sp-progress { display: flex; align-items: center; gap: 6px; width: 100%; }
.sp-time { font-size: 10px; color: #555; width: 28px; }
.sp-time.right { text-align: right; }
.sp-bar { flex: 1; height: 3px; background: #333; border-radius: 2px; cursor: pointer; position: relative; }
.sp-bar-fill { height: 100%; background: #fff; border-radius: 2px; transition: width 0.5s linear; }
.sp-bar:hover .sp-bar-fill { background: #1DB954; }
.sp-vol { display: flex; align-items: center; gap: 6px; flex: 0.8; justify-content: flex-end; }
.sp-vol-bar { width: 60px; height: 3px; background: #333; border-radius: 2px; cursor: pointer; }
.sp-vol-fill { height: 100%; background: #aaa; border-radius: 2px; width: 70%; }
.sp-loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: #444; font-size: 12px; }
.sp-error { color: #ff5f57; font-size: 11px; text-align: center; padding: 20px; }
.sp-empty { color: #444; font-size: 12px; text-align: center; padding: 30px; }
.sp-sources { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.sp-source { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; border-radius: 5px; font-size: 11px; color: #555; transition: all 0.15s; }
.sp-source.active { background: #1a2a1a; color: #1DB954; }
.sp-source-count { font-size: 10px; font-weight: 700; color: #333; min-width: 18px; text-align: right; }
.sp-source.active .sp-source-count { color: #1DB954; }
.sp-api-stats { font-size: 10px; color: #1DB954; margin-bottom: 10px; min-height: 14px; letter-spacing: 0.3px; }
.sp-filters { margin-bottom: 10px; }
.sp-filter { font-size: 11px; color: #888; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.sp-filter input { accent-color: #1DB954; }
.sp-src-tag { color: #1DB954; font-size: 9px; margin-left: 4px; opacity: 0.85; }
.sp-badge { font-size: 8px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; }
.sp-badge.full { background: #1DB954; color: #000; }
.sp-badge.prev { background: #333; color: #aaa; }
.sp-status-bar { position: absolute; bottom: 78px; left: 0; right: 0; text-align: center; font-size: 10px; color: #1DB954; pointer-events: none; padding: 2px 8px; }
.sp-mood-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sp-back { font-size: 16px !important; padding: 4px 10px !important; border: 1px solid #333 !important; border-radius: 6px !important; }
.sp-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid #333; border-top-color: #1DB954; border-radius: 50%; animation: sp-spin 0.7s linear infinite; margin-right: 8px; vertical-align: middle; }
@keyframes sp-spin { to { transform: rotate(360deg); } }
.sp-no-preview { opacity: 0.4; cursor: not-allowed; }
.sp-wrap { position: relative; }