* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #000; color: #00ff00; font-family: 'Courier New', monospace; height: 100vh; overflow: hidden; }

/* ── Terminal ─────────────────────────────────────────────────────── */
#boot-screen { padding: 40px; font-size: 16px; line-height: 2; }
#desktop { display: flex; flex-direction: column; height: 100vh; background: #000; }
#taskbar { background: #111; padding: 8px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #00ff00; font-size: 13px; letter-spacing: 1px; flex-shrink: 0; }
#terminal-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
#terminal { width: 68%; max-width: 820px; background: #050505; border: 1px solid #00ff00; padding: 0; height: 62vh; display: flex; flex-direction: column; position: relative; }
#terminal::before { content: '[ DLSUDos Terminal v1.0 ]'; display: block; background: #00ff00; color: #000; font-size: 12px; font-weight: bold; letter-spacing: 2px; text-align: center; padding: 5px 0; flex-shrink: 0; }
#output { flex: 1; overflow-y: auto; margin-bottom: 0; line-height: 1.8; padding: 14px 20px; font-size: 14px; }
#output::-webkit-scrollbar { width: 6px; }
#output::-webkit-scrollbar-track { background: #0a0a0a; }
#output::-webkit-scrollbar-thumb { background: #00ff00; }
#output::-webkit-scrollbar-thumb:hover { background: #00cc00; }
#input-line { display: flex; align-items: center; border-top: 1px solid #003300; padding: 10px 20px; background: #0a0a0a; flex-shrink: 0; }
#cmd-input { background: transparent; border: none; color: #00ff00; font-family: inherit; font-size: 14px; flex: 1; outline: none; }

/* ── GUI Desktop ──────────────────────────────────────────────────── */
#gui-desktop { position: fixed; inset: 0; flex-direction: column; background: #0f172a; font-family: system-ui, Arial, sans-serif; z-index: 9000; overflow: hidden; user-select: none; }
#gui-desktop-area { flex: 1; position: relative; overflow: hidden; }
#desktop-logo { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 320px; opacity: 0.15; pointer-events: none; user-select: none; }

/* ── Desktop icons ────────────────────────────────────────────────── */
.desktop-icon { position: absolute; display: flex; flex-direction: column; align-items: center; width: 76px; padding: 8px 4px; border-radius: 4px; cursor: pointer; text-align: center; }
.desktop-icon:hover   { background: rgba(255,255,255,0.2); }
.desktop-icon.selected { background: rgba(255,255,255,0.3); outline: 1px dashed rgba(255,255,255,0.8); }
.icon-img   { font-size: 38px; line-height: 1; margin-bottom: 4px; }
.icon-label { color: #fff; font-size: 11px; text-shadow: 0 1px 3px rgba(0,0,0,0.7); word-break: break-word; }

/* ── Taskbar ──────────────────────────────────────────────────────── */
#gui-taskbar { background: #1e293b; height: 40px; display: flex; align-items: center; padding: 0 6px; gap: 4px; flex-shrink: 0; }
#start-btn { background: #22c55e; color: #fff; border: none; padding: 0 14px; height: 30px; border-radius: 3px; font-weight: bold; font-size: 13px; cursor: pointer; flex-shrink: 0; }
#start-btn:hover { background: #16a34a; }
#taskbar-windows { flex: 1; display: flex; gap: 3px; overflow: hidden; }
.taskbar-btn { background: #334155; color: #fff; border: none; padding: 0 10px; height: 28px; border-radius: 3px; font-size: 12px; cursor: pointer; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taskbar-btn:hover  { background: #475569; }
.taskbar-btn.active { background: #2563eb; }
#color-btn { background: #334155; border: none; color: #fff; font-size: 16px; width: 32px; height: 30px; border-radius: 3px; cursor: pointer; flex-shrink: 0; }
#color-btn:hover { background: #475569; }
#gui-clock { color: #fff; font-size: 12px; padding: 0 10px; background: #0f172a; border-radius: 3px; height: 30px; display: flex; align-items: center; flex-shrink: 0; }

/* ── Color picker ─────────────────────────────────────────────────── */
#color-picker { position: fixed; bottom: 44px; right: 6px; background: #1e293b; border: 1px solid #334155; border-radius: 6px; padding: 10px; display: none; flex-wrap: wrap; gap: 6px; width: 156px; z-index: 99999; }
.cp-swatch { width: 30px; height: 30px; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.cp-swatch:hover { border-color: #fff; }

/* ── Windows ──────────────────────────────────────────────────────── */
.gui-window { position: absolute; min-width: 240px; min-height: 160px; background: #f8fafc; border: 1px solid #cbd5e1; display: flex; flex-direction: column; overflow: hidden; }
.gui-window.maximized { top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; }
.window-titlebar { background: #2563eb; color: #fff; padding: 6px 8px; display: flex; align-items: center; cursor: move; flex-shrink: 0; gap: 6px; }
.wtitle { flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-controls { display: flex; gap: 3px; }
.win-btn { width: 22px; height: 22px; border: none; border-radius: 3px; cursor: pointer; font-size: 11px; font-weight: bold; background: rgba(255,255,255,0.2); color: #fff; }
.win-btn:hover { background: rgba(255,255,255,0.4); }
.wclose:hover { background: #ef4444 !important; }
.window-body { flex: 1; overflow: auto; background: #fff; display: flex; flex-direction: column; }
.resize-handle { position: absolute; bottom: 0; right: 0; width: 12px; height: 12px; cursor: se-resize; background: #94a3b8; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

/* ── Explorer ─────────────────────────────────────────────────────── */
.exp-bar { background: #f1f5f9; padding: 5px 8px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }
.exp-addr { width: 100%; background: #fff; border: 1px solid #cbd5e1; padding: 3px 7px; font-size: 12px; border-radius: 2px; outline: none; }
.file-grid { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; align-content: flex-start; }
.file-item { display: flex; flex-direction: column; align-items: center; width: 78px; cursor: pointer; padding: 6px 4px; border-radius: 3px; text-align: center; }
.file-item:hover { background: #dbeafe; }
.fi { font-size: 32px; }
.file-item div:last-child { font-size: 11px; margin-top: 3px; color: #334155; word-break: break-word; }

/* ── Notepad ──────────────────────────────────────────────────────── */
.np-bar { background: #f1f5f9; padding: 4px 10px; border-bottom: 1px solid #e2e8f0; display: flex; gap: 14px; font-size: 12px; flex-shrink: 0; }
.np-bar span { cursor: pointer; padding: 2px 5px; border-radius: 2px; color: #334155; }
.np-bar span:hover { background: #2563eb; color: #fff; }
.np-ta { flex: 1; border: none; outline: none; padding: 8px; font-family: 'Courier New', monospace; font-size: 13px; resize: none; background: #fff; color: #000; }

/* ── Tic-Tac-Toe ──────────────────────────────────────────────────── */
.ttt-wrap { display: flex; flex-direction: column; align-items: center; padding: 16px; gap: 12px; height: 100%; background: #fff; }
.ttt-status { font-size: 15px; font-weight: 600; color: #1e293b; }
.ttt-board { display: grid; grid-template-columns: repeat(3, 72px); grid-template-rows: repeat(3, 72px); gap: 4px; }
.ttt-cell { width: 72px; height: 72px; background: #f1f5f9; border: 2px solid #e2e8f0; border-radius: 4px; font-size: 28px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ttt-cell:hover:not([data-p]) { background: #dbeafe; }
.ttt-cell[data-p="X"] { color: #2563eb; }
.ttt-cell[data-p="O"] { color: #dc2626; }
.ttt-cell.ttt-win { background: #fef08a; border-color: #ca8a04; }
.ttt-reset { background: #2563eb; color: #fff; border: none; padding: 7px 22px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.ttt-reset:hover { background: #1d4ed8; }

/* ── Browser window ───────────────────────────────────────────────── */
.win-browser { display: flex; flex-direction: column; height: 100%; background: #fff; }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }
.browser-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.browser-addr { flex: 1; border: 1px solid #cbd5e1; border-radius: 3px; padding: 3px 8px; font-size: 12px; outline: none; background: #fff; color: #334155; margin: 0 4px; }
.browser-go { background: #2563eb; color: #fff; border: none; padding: 3px 8px; border-radius: 3px; cursor: pointer; font-size: 14px; }
.browser-go:hover { background: #1d4ed8; }
.browser-frame { flex: 1; border: none; width: 100%; }
.browser-blocked { display: none; flex: 1; align-items: center; justify-content: center; flex-direction: column; color: #334155; font-size: 14px; text-align: center; padding: 20px; }

/* ── GUI Terminal window ──────────────────────────────────────────── */
.win-term { display: flex; flex-direction: column; height: 100%; background: #0a0a0a; font-family: 'Courier New', monospace; }
.win-term-output { flex: 1; overflow-y: auto; padding: 10px 14px; font-size: 13px; color: #00ff00; line-height: 1.7; }
.win-term-output::-webkit-scrollbar { width: 5px; }
.win-term-output::-webkit-scrollbar-track { background: #0a0a0a; }
.win-term-output::-webkit-scrollbar-thumb { background: #00ff00; }
.win-term-input-row { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-top: 1px solid #003300; background: #050505; flex-shrink: 0; }
.win-term-prompt { color: #00ff00; font-size: 13px; white-space: nowrap; }
.win-term-input { flex: 1; background: transparent; border: none; outline: none; color: #00ff00; font-family: 'Courier New', monospace; font-size: 13px; }

/* ── Start menu ───────────────────────────────────────────────────── */
#start-menu { position: fixed; bottom: 44px; left: 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: 4px; z-index: 99999; display: none; width: 210px; overflow: hidden; }
.start-header { background: #2563eb; color: #fff; padding: 12px 16px; font-size: 17px; font-weight: bold; }
.start-item { padding: 8px 16px; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: #1e293b; }
.start-item:hover { background: #dbeafe; }
.start-sep { border-top: 1px solid #e2e8f0; margin: 3px 0; }

/* ── Context menu ─────────────────────────────────────────────────── */
#context-menu { position: fixed; background: #fff; border: 1px solid #e2e8f0; border-radius: 4px; padding: 4px 0; z-index: 99999; display: none; min-width: 170px; }
.ctx-item { padding: 7px 18px; font-size: 13px; cursor: pointer; color: #1e293b; }
.ctx-item:hover { background: #dbeafe; }
.ctx-sep { border-top: 1px solid #e2e8f0; margin: 3px 0; }
