/* =====================================================
   WebTop Lab — Main Stylesheet
   ===================================================== */

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

:root {
  --font-ui: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 8px 32px rgba(0,0,0,.18);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.12);
  --transition: .18s cubic-bezier(.4,0,.2,1);

  /* Default (Classic) theme vars */
  --bg: #2a5caa;
  --bg2: #3a70cc;
  --taskbar-bg: #1a3a6a;
  --taskbar-text: #e8f0fe;
  --window-bg: #f0f4ff;
  --window-header: #2a5caa;
  --window-header-text: #fff;
  --accent: #5b9cf6;
  --accent2: #ff6b35;
  --text: #1a1a2e;
  --text-muted: #555;
  --icon-bg: rgba(255,255,255,.18);
  --icon-hover: rgba(255,255,255,.32);
  --start-bg: #1a3a6a;
}

/* ===== OS THEMES ===== */
body.os-space {
  --bg: #0a0a1a;
  --bg2: #0d1b3e;
  --taskbar-bg: #050510;
  --taskbar-text: #7df9ff;
  --window-bg: #0f1124;
  --window-header: #1a1a40;
  --window-header-text: #7df9ff;
  --accent: #7df9ff;
  --accent2: #ff00ff;
  --text: #c8d8ff;
  --text-muted: #7890cc;
  --icon-bg: rgba(125,249,255,.1);
  --icon-hover: rgba(125,249,255,.2);
  --start-bg: #0a0a25;
}

body.os-pixel {
  --bg: #5c6bc0;
  --bg2: #7986cb;
  --taskbar-bg: #3949ab;
  --taskbar-text: #fff;
  --window-bg: #e8eaf6;
  --window-header: #3949ab;
  --window-header-text: #fff;
  --accent: #ff5252;
  --accent2: #ffeb3b;
  --text: #1a1a4e;
  --text-muted: #555;
  --icon-bg: rgba(255,255,255,.25);
  --icon-hover: rgba(255,255,255,.4);
  --start-bg: #283593;
  image-rendering: pixelated;
}

body.os-school {
  --bg: #4caf50;
  --bg2: #66bb6a;
  --taskbar-bg: #2e7d32;
  --taskbar-text: #fff;
  --window-bg: #fffde7;
  --window-header: #388e3c;
  --window-header-text: #fff;
  --accent: #ff8f00;
  --accent2: #e53935;
  --text: #1b3a1b;
  --text-muted: #444;
  --icon-bg: rgba(255,255,255,.3);
  --icon-hover: rgba(255,255,255,.5);
  --start-bg: #1b5e20;
}

body.os-creator {
  --bg: linear-gradient(135deg, #f06292 0%, #ba68c8 50%, #64b5f6 100%);
  --bg2: #f06292;
  --taskbar-bg: #4a148c;
  --taskbar-text: #fff;
  --window-bg: #fce4ec;
  --window-header: #880e4f;
  --window-header-text: #fff;
  --accent: #f50057;
  --accent2: #ff6d00;
  --text: #1a0030;
  --text-muted: #555;
  --icon-bg: rgba(255,255,255,.25);
  --icon-hover: rgba(255,255,255,.45);
  --start-bg: #38006b;
}

body.os-hacker {
  --bg: #0a1a0a;
  --bg2: #0d200d;
  --taskbar-bg: #061206;
  --taskbar-text: #00ff41;
  --window-bg: #0d1a0d;
  --window-header: #0a2a0a;
  --window-header-text: #00ff41;
  --accent: #00ff41;
  --accent2: #39ff14;
  --text: #00ff41;
  --text-muted: #3a9a3a;
  --icon-bg: rgba(0,255,65,.1);
  --icon-hover: rgba(0,255,65,.2);
  --start-bg: #040d04;
}

/* ===== PAGES ===== */
html, body { height: 100%; font-family: var(--font-ui); overflow: hidden; }
.page { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: none; overflow: hidden; }
.page.active { display: flex; flex-direction: column; }

/* ===== LANDING PAGE ===== */
#landing-page {
  background: #0a0f1e;
  color: #e8f0ff;
  overflow-y: auto;
  flex-direction: column;
  align-items: center;
}

.landing-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  width: 100%;
  position: sticky;
  top: 0;
  background: rgba(10,15,30,.9);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.logo-mark {
  font-size: 22px;
  background: linear-gradient(135deg, #5b9cf6, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.logo-accent { color: #5b9cf6; }

.landing-main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.hero { text-align: center; margin-bottom: 48px; }

.hero-badge {
  display: inline-block;
  background: rgba(91,156,246,.15);
  border: 1px solid rgba(91,156,246,.3);
  color: #5b9cf6;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(32px, 6vw, 58px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
  color: #fff;
}

.gradient-text {
  background: linear-gradient(135deg, #5b9cf6, #c084fc, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: #94a3c8;
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.btn-launch {
  background: linear-gradient(135deg, #5b9cf6, #7c3aed);
  color: #fff;
  border: none;
  padding: 16px 36px;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-ui);
  border-radius: 50px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 24px rgba(91,156,246,.4);
  min-height: 56px;
  min-width: 200px;
}

.btn-launch:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(91,156,246,.5); }
.btn-launch:active { transform: translateY(0); }

.hero-note { margin-top: 12px; font-size: 13px; color: #5a7090; }

.device-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 56px;
}

.device-pill {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: #94a3c8;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}

.feature-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 24px;
  transition: background var(--transition);
}

.feature-card:hover { background: rgba(255,255,255,.07); }

.feat-icon { font-size: 32px; display: block; margin-bottom: 12px; }

.feature-card h3 { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.feature-card p { font-size: 14px; color: #7890aa; line-height: 1.5; }

.cta-section { text-align: center; }

.landing-footer {
  text-align: center;
  padding: 20px 24px;
  font-size: 13px;
  color: #445;
  border-top: 1px solid rgba(255,255,255,.05);
}

.footer-link { color: #5b9cf6; cursor: pointer; }
.footer-link:hover { text-decoration: underline; }

/* ===== OS SELECT ===== */
#os-select-page {
  background: #0a0f1e;
  color: #e8f0ff;
  overflow-y: auto;
  flex-direction: column;
  align-items: center;
}

.os-select-header {
  text-align: center;
  padding: 32px 24px 20px;
  width: 100%;
}

.os-select-header h2 { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.os-select-header p { color: #7890aa; }

.btn-back {
  position: absolute;
  top: 28px;
  left: 20px;
  background: rgba(255,255,255,.08);
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 14px;
}

.btn-back:hover { background: rgba(255,255,255,.15); }

.os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding: 20px 24px 60px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.os-card {
  background: rgba(255,255,255,.05);
  border: 2px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 0 0 20px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.os-card:hover {
  border-color: #5b9cf6;
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(91,156,246,.2);
}

.os-card h3 { font-size: 17px; font-weight: 700; color: #fff; padding: 14px 16px 4px; }
.os-card p { font-size: 13px; color: #7890aa; padding: 0 16px; line-height: 1.5; }

.os-preview {
  width: 100%;
  height: 110px;
  position: relative;
  margin-bottom: 4px;
  overflow: hidden;
}

.classic-preview { background: linear-gradient(160deg, #3a70cc, #2a5caa); }
.space-preview { background: linear-gradient(160deg, #0a0a1a, #0d1b3e); }
.pixel-preview { background: linear-gradient(160deg, #5c6bc0, #7986cb); image-rendering: pixelated; }
.school-preview { background: linear-gradient(160deg, #4caf50, #66bb6a); }
.creator-preview { background: linear-gradient(160deg, #f06292, #ba68c8, #64b5f6); }
.hacker-preview { background: #0a1a0a; }

.preview-taskbar {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 18px;
  background: rgba(0,0,0,.4);
}

.classic-preview .preview-taskbar { background: #1a3a6a; }
.space-preview .preview-taskbar { background: #050510; }
.pixel-preview .preview-taskbar { background: #3949ab; }
.school-preview .preview-taskbar { background: #2e7d32; }
.creator-preview .preview-taskbar { background: #4a148c; }
.hacker-preview .preview-taskbar { background: #061206; }

.preview-icons {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255,255,255,.25);
}

.space-preview .preview-icon { background: rgba(125,249,255,.2); }
.hacker-preview .preview-icon { background: rgba(0,255,65,.15); }
.pixel-preview .preview-icon { border-radius: 0; }

/* Stars for space preview */
.space-preview::before {
  content: '✦ ✧ ✦ ✧ ✦';
  position: absolute;
  top: 8px; right: 8px;
  font-size: 8px;
  color: rgba(125,249,255,.5);
  letter-spacing: 4px;
}

/* ===== DESKTOP PAGE ===== */
#desktop-page {
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-ui);
}

/* WALLPAPER */
.desktop-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  transition: background .5s;
}

body.os-space .desktop-area {
  background: radial-gradient(ellipse at 30% 40%, #1a1a4e 0%, #0a0a1a 60%);
}

body.os-space .desktop-area::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image: radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 10%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 60%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 50% 50%, rgba(125,249,255,.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 20%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,.3) 0%, transparent 100%);
  pointer-events: none;
}

body.os-creator .desktop-area {
  background: linear-gradient(135deg, #f06292 0%, #ba68c8 50%, #64b5f6 100%);
}

body.os-hacker .desktop-area::after {
  content: 'WEBTOP LAB OS v1.0 // EDUCATIONAL MODE // SAFE TERMINAL ACTIVE';
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(0,255,65,.2);
  white-space: nowrap;
  pointer-events: none;
}

body.os-pixel .desktop-area {
  background-image: repeating-linear-gradient(
    0deg, rgba(0,0,0,.05) 0px, rgba(0,0,0,.05) 1px, transparent 1px, transparent 32px
  ), repeating-linear-gradient(
    90deg, rgba(0,0,0,.05) 0px, rgba(0,0,0,.05) 1px, transparent 1px, transparent 32px
  );
  background-color: var(--bg);
}

body.os-school .desktop-area {
  background-image: repeating-linear-gradient(
    0deg, rgba(255,255,255,.15) 0px, rgba(255,255,255,.15) 1px, transparent 1px, transparent 28px
  );
  background-color: var(--bg);
}

/* TASKBAR */
.taskbar {
  height: 48px;
  background: var(--taskbar-bg);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 8px;
  z-index: 100;
  order: 2;
  flex-shrink: 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,.3);
}

body.os-hacker .taskbar {
  border-top: 1px solid #00ff41;
  font-family: var(--font-mono);
}

.start-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  transition: background var(--transition);
}

body.os-hacker .start-btn { background: transparent; border: 1px solid #00ff41; color: #00ff41; font-family: var(--font-mono); }
body.os-pixel .start-btn { border-radius: 0; }

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

.taskbar-apps {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.taskbar-apps::-webkit-scrollbar { display: none; }

.taskbar-app-btn {
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--taskbar-text);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
  transition: background var(--transition);
}

.taskbar-app-btn.active { background: rgba(255,255,255,.2); }
.taskbar-app-btn:hover { background: rgba(255,255,255,.18); }

.taskbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.taskbar-time {
  color: var(--taskbar-text);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: right;
}

body.os-hacker .taskbar-time { font-family: var(--font-mono); }

.taskbar-icon-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background var(--transition);
}

.taskbar-icon-btn:hover { background: rgba(255,255,255,.15); }

/* ===== START MENU ===== */
.start-menu {
  position: absolute;
  bottom: 56px;
  left: 8px;
  width: 220px;
  background: var(--start-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
}

body.os-hacker .start-menu { border-color: #00ff41; }

.start-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: var(--taskbar-text);
  font-weight: 700;
  font-size: 14px;
}

body.os-hacker .start-menu-header { font-family: var(--font-mono); color: #00ff41; }

.start-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}

.start-close:hover { background: rgba(255,255,255,.1); color: #fff; }

.start-menu-apps { padding: 8px; }

.sm-app {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--taskbar-text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.sm-app:hover { background: rgba(255,255,255,.1); }
body.os-hacker .sm-app { font-family: var(--font-mono); color: #00ff41; }

.start-menu-footer {
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.sm-power {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: none;
  color: rgba(255,255,255,.6);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.sm-power:hover { background: rgba(255,255,255,.12); color: rgba(255,255,255,.9); }

/* ===== DESKTOP ICONS ===== */
.desktop-icons {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
  -webkit-user-select: none;
}

.desktop-icon:hover, .desktop-icon:active { background: var(--icon-hover); }

.di-icon { font-size: 28px; line-height: 1; }
.di-label {
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
  text-align: center;
  word-break: break-word;
  font-weight: 600;
  line-height: 1.2;
}

body.os-hacker .di-label { font-family: var(--font-mono); color: #00ff41; text-shadow: 0 0 8px rgba(0,255,65,.4); }
body.os-pixel .desktop-icon { border-radius: 0; }

/* ===== APP WINDOWS ===== */
.app-window {
  position: absolute;
  background: var(--window-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 280px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  border: 1px solid rgba(0,0,0,.1);
}

body.os-hacker .app-window { border-color: #00ff41; box-shadow: 0 0 20px rgba(0,255,65,.15); }
body.os-pixel .app-window { border-radius: 0; border: 3px solid #3949ab; }

.window-header {
  background: var(--window-header);
  color: var(--window-header-text);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: move;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

body.os-hacker .window-header { font-family: var(--font-mono); }

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

.wc-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 0;
  transition: filter var(--transition);
}

.wc-btn:hover { filter: brightness(1.3); }
.wc-close { background: #ff5f57; }
.wc-min { background: #ffbd2e; }
.wc-max { background: #28ca42; }

body.os-pixel .wc-btn { border-radius: 0; }

.window-title { flex: 1; font-size: 13px; font-weight: 600; }

.window-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
  color: var(--text);
  position: relative;
}

body.os-hacker .window-body { background: #0d1a0d; color: #00ff41; font-family: var(--font-mono); }

/* Resize handle */
.window-resize {
  position: absolute;
  bottom: 0; right: 0;
  width: 20px; height: 20px;
  cursor: se-resize;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 3px;
  z-index: 2;
}

.window-resize::after {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(0,0,0,.2);
  border-bottom: 2px solid rgba(0,0,0,.2);
}

/* ===== APP SPECIFIC STYLES ===== */

/* NOTES */
.notes-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,.1);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.notes-btn {
  background: rgba(0,0,0,.07);
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-ui);
}

.notes-btn:hover { background: rgba(0,0,0,.14); }

#notes-content {
  width: 100%;
  height: calc(100% - 56px);
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text);
  resize: none;
  outline: none;
  line-height: 1.6;
}

body.os-hacker #notes-content { font-family: var(--font-mono); color: #00ff41; background: transparent; }

/* CALCULATOR */
.calc-display {
  background: rgba(0,0,0,.07);
  border-radius: 8px;
  padding: 14px 16px;
  text-align: right;
  margin-bottom: 12px;
}

.calc-expr { font-size: 12px; color: var(--text-muted); min-height: 18px; }
.calc-result { font-size: 28px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

body.os-hacker .calc-result { font-family: var(--font-mono); color: #00ff41; }

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-btn {
  padding: 14px 6px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: filter var(--transition);
  background: rgba(0,0,0,.07);
  color: var(--text);
}

.calc-btn:hover { filter: brightness(.9); }
.calc-btn:active { filter: brightness(.8); }
.calc-btn.op { background: var(--accent); color: #fff; }
.calc-btn.eq { background: var(--accent2); color: #fff; }
.calc-btn.wide { grid-column: span 2; }

body.os-pixel .calc-btn { border-radius: 0; }

/* DRAWING PAD */
.draw-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,.1);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.color-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.2);
  cursor: pointer;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.color-dot:hover, .color-dot.selected { transform: scale(1.25); border-color: #fff; box-shadow: 0 0 0 2px #000; }

.draw-size {
  width: 60px;
  accent-color: var(--accent);
}

.draw-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
}

#draw-canvas {
  border: 2px solid rgba(0,0,0,.1);
  border-radius: 6px;
  cursor: crosshair;
  touch-action: none;
  max-width: 100%;
  background: #fff;
}

body.os-hacker #draw-canvas { background: #0d1a0d; border-color: #00ff41; }

.draw-btn {
  background: rgba(0,0,0,.07);
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-ui);
}

.draw-btn:hover { background: rgba(0,0,0,.14); }

/* FILE EXPLORER */
.file-tree { display: flex; flex-direction: column; gap: 4px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 14px;
  color: var(--text);
}

.file-item:hover { background: rgba(0,0,0,.06); }
.file-item span:first-child { font-size: 18px; }
.file-folder { font-weight: 600; }
.file-path { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }

/* SETTINGS */
.settings-section { margin-bottom: 20px; }
.settings-section h4 { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
  gap: 12px;
}

.setting-label { font-size: 14px; color: var(--text); }

.theme-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform var(--transition), border-color var(--transition);
}

.theme-swatch:hover { transform: scale(1.1); }
.theme-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px #000; }

.settings-select {
  background: rgba(0,0,0,.07);
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

/* TERMINAL */
.terminal-body {
  background: #0d1a0d !important;
  font-family: var(--font-mono) !important;
  font-size: 13px;
  color: #00ff41 !important;
  padding: 12px !important;
}

.term-output { margin-bottom: 10px; }
.term-line { padding: 1px 0; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.term-prompt { color: #00ff41; }
.term-cmd { color: #fff; }
.term-result { color: #7aff9a; }
.term-error { color: #ff4444; }
.term-info { color: #7df9ff; }

.term-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}

.term-ps { color: #00ff41; flex-shrink: 0; }

#term-input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  flex: 1;
  outline: none;
  caret-color: #00ff41;
}

/* BROWSER */
.browser-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,.1);
  margin-bottom: 10px;
}

.browser-url {
  flex: 1;
  background: rgba(0,0,0,.07);
  border: none;
  padding: 7px 12px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text);
  outline: none;
}

.browser-go {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}

.browser-content {
  background: rgba(0,0,0,.03);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  padding: 20px;
  min-height: 180px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

/* ABOUT */
.about-logo { font-size: 48px; text-align: center; margin-bottom: 12px; }
.about-title { font-size: 24px; font-weight: 700; text-align: center; color: var(--text); margin-bottom: 4px; }
.about-version { font-size: 12px; color: var(--text-muted); text-align: center; margin-bottom: 20px; }
.about-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 14px; }
.about-item strong { min-width: 100px; color: var(--text-muted); }

/* ===== MISSIONS PANEL ===== */
.missions-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 280px;
  background: rgba(10,15,30,.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 150;
  overflow: hidden;
}

body.os-hacker .missions-panel { border-color: #00ff41; background: rgba(10,20,10,.95); }

.missions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.missions-header h3 { color: #fff; font-size: 15px; }
.missions-header button { background: transparent; border: none; color: rgba(255,255,255,.5); cursor: pointer; font-size: 16px; }
.missions-header button:hover { color: #fff; }

.missions-list { padding: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }

.mission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05);
  font-size: 13px;
  color: rgba(255,255,255,.7);
  transition: background var(--transition);
}

.mission-item.done { background: rgba(40,200,66,.12); color: rgba(255,255,255,.9); }
.mission-icon { font-size: 16px; flex-shrink: 0; }
.mission-text { flex: 1; }
.mission-check { color: #28ca42; font-size: 16px; }

.missions-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1); }

#missions-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

#missions-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5b9cf6, #28ca42);
  border-radius: 3px;
  transition: width .4s ease;
  width: 0%;
}

#missions-count { font-size: 12px; color: rgba(255,255,255,.5); text-align: center; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  background: #0f1428;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  color: #e8f0ff;
  box-shadow: var(--shadow);
}

.modal-box h3 { font-size: 22px; margin-bottom: 12px; }
.modal-box p { color: #7890aa; font-size: 14px; line-height: 1.6; margin-bottom: 24px; }

.support-tiers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.tier-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  color: rgba(255,255,255,.8);
}

.btn-close-modal {
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  padding: 11px 24px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
  width: 100%;
}

.btn-close-modal:hover { background: rgba(255,255,255,.18); }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: rgba(10,15,30,.95);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  z-index: 2000;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  white-space: nowrap;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .desktop-icons { flex-direction: row; flex-wrap: wrap; gap: 4px; top: 8px; left: 8px; right: 8px; }
  .desktop-icon { width: 64px; }
  .di-icon { font-size: 24px; }

  .app-window {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: calc(100% - 48px) !important;
    border-radius: 0;
    border: none;
  }

  .window-header { cursor: default; }
  .wc-min { display: none; }

  .missions-panel { width: calc(100% - 32px); right: 16px; top: 8px; }

  .features-grid { grid-template-columns: 1fr 1fr; }
  .os-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .os-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 28px; }

  .start-menu { width: calc(100vw - 16px); left: 8px; }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 3px; }
body.os-hacker ::-webkit-scrollbar-thumb { background: rgba(0,255,65,.2); }
