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

:root {
  --bg:         #0d0f14;
  --taskbar:    #111520ee;
  --surface:    #161b25;
  --titlebar:   #1e2535;
  --border:     #252d3d;
  --accent:     #6e8efb;
  --accent2:    #a777e3;
  --text:       #e8eaf0;
  --muted:      #7a849a;
  --radius:     10px;
  --shadow:     0 16px 48px rgba(0,0,0,.55);
  --font-ui:    'Space Grotesk', sans-serif;
  --font-body:  'Inter', sans-serif;
}

html, body { height: 100%; overflow: hidden; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 25% 15%, rgba(110,142,251,.14) 0%, transparent 70%),
    radial-gradient(ellipse 50% 45% at 80% 85%, rgba(167,119,227,.11) 0%, transparent 65%);
  font-family: var(--font-body);
  color: var(--text);
  user-select: none;
}

#desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#taskbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 44px;
  background: var(--taskbar);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 9999;
}

#os-name {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: 8px;
}

#taskbar-apps { display: flex; gap: 6px; flex: 1; }

.taskbar-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.taskbar-btn:hover,
.taskbar-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

#taskbar-clock {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 52px;
  text-align: right;
}

.window {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 220px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s;
}
.window.focused {
  box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 1px var(--accent);
  z-index: 100;
}
.window.hidden {
  display: none;
}

.win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--titlebar);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 10px;
  height: 36px;
  cursor: grab;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.win-titlebar:active { cursor: grabbing; }

.win-title {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

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

.win-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 0.6rem;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.win-close { background: #ff5f57; color: #7a0000; }
.win-btn:hover { opacity: .8; }

.win-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  user-select: text;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  align-self: center;
}

.os-title {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.win-body p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
}
.win-body p strong { color: var(--text); }
.win-body p s      { text-decoration: line-through; opacity: .5; }
.win-body p abbr   { text-decoration: underline dotted; cursor: help; }
.win-body p dfn    { font-style: italic; color: var(--accent2); }

.link-btn {
  display: block;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background .15s, border-color .15s;
}
.link-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

#search-input{
  display: block;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #a777e322;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background .15s, border-color .15s;
}

#search-input:active{
  background-color: #a777e344;
}

#note-area{
  height: 200px;
  background-color: var(--bg);
  color: var(--text);
  font-size: larger;
}