* { box-sizing: border-box; }

:root {
  --bg: #020204;
  --panel: rgba(17, 17, 24, .88);
  --panel2: rgba(28, 28, 38, .9);
  --line: rgba(255,255,255,.12);
  --text: #f4f1ff;
  --muted: #aaa3bf;
  --accent: #b68cff;
  --accent2: #67e8f9;
  --danger: #ff6b9a;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 50% 20%, rgba(130, 67, 255, .15), transparent 35%),
              radial-gradient(circle at 20% 80%, rgba(103, 232, 249, .08), transparent 30%),
              var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#desktop {
  min-height: 100vh;
  padding: 28px 18px 92px;
  position: relative;
  overflow: hidden;
}

#boot {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  opacity: .26;
}

.sigil {
  letter-spacing: .55em;
  font-weight: 800;
  font-size: clamp(34px, 8vw, 96px);
  color: white;
  text-shadow: 0 0 40px rgba(182, 140, 255, .42);
}

.sub {
  margin-top: 18px;
  color: var(--muted);
  letter-spacing: .08em;
}

#windows {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  align-items: start;
}

.window {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel), rgba(8,8,12,.9));
  box-shadow: 0 28px 80px rgba(0,0,0,.45);
  backdrop-filter: blur(16px);
  overflow: hidden;
  min-height: 260px;
}

.window-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.045);
}

.window-title {
  font-size: 14px;
  letter-spacing: .04em;
}

.close-btn, .dock-btn, .primary, .ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}

.close-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
}

.close-btn:hover, .dock-btn:hover, .primary:hover, .ghost:hover {
  border-color: rgba(182,140,255,.65);
  box-shadow: 0 0 0 4px rgba(182,140,255,.09);
}

.window-body {
  padding: 18px;
}

#dock {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12,12,18,.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 70px rgba(0,0,0,.55);
}

.dock-btn {
  min-width: 96px;
  font-weight: 700;
}

.primary {
  background: linear-gradient(135deg, rgba(182,140,255,.45), rgba(103,232,249,.18));
  font-weight: 800;
}

.ghost {
  color: var(--muted);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

input[type="url"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.35);
  color: var(--text);
  border-radius: 14px;
  padding: 12px;
}

.browser-frame, .app-frame {
  width: 100%;
  height: min(62vh, 680px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.dropzone {
  border: 1px dashed rgba(182,140,255,.65);
  border-radius: 18px;
  padding: 20px;
  background: rgba(182,140,255,.08);
}

.note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.app-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  padding: 14px;
  min-height: 128px;
  display: grid;
  gap: 10px;
}

.app-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(182,140,255,.42), rgba(103,232,249,.18));
  font-weight: 900;
}

pre {
  white-space: pre-wrap;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  color: #d8ccff;
}

.error { color: var(--danger); }
.ok { color: var(--accent2); }


.glyph { display: inline-block; vertical-align: middle; }
.dock-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; margin: 14px 0; }
.icon-choice { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: rgba(255,255,255,.05); display: flex; gap: 9px; align-items: center; cursor: pointer; }
.icon-choice:hover, .icon-choice.active { border-color: rgba(182,140,255,.75); background: rgba(182,140,255,.12); }
.icon-big { width: 58px; height: 58px; border-radius: 18px; display: grid; place-content: center; background: rgba(255,255,255,.06); }
.app-icon { font-size: 0; }
