/* ============ KhaiOS ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --accent: #4fd1a5;
  --glass: rgba(18, 24, 38, 0.72);
  --glass-lite: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8edf5;
  --dim: #9aa7bd;
  --radius: 14px;
  --mono: "Cascadia Code", Consolas, "Courier New", monospace;
}
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #070a12;
  user-select: none;
}
.hidden { display: none !important; }

/* ---------- wallpapers ---------- */
body.wp-aurora  { background: radial-gradient(120% 90% at 15% 10%, #10331f 0%, transparent 50%), radial-gradient(110% 90% at 85% 15%, #0d2b4d 0%, transparent 55%), radial-gradient(120% 100% at 50% 100%, #1d1040 0%, transparent 60%), #070a12; }
body.wp-sunset  { background: radial-gradient(120% 90% at 20% 15%, #4d1a2b 0%, transparent 55%), radial-gradient(110% 90% at 85% 20%, #4d2a0d 0%, transparent 55%), radial-gradient(130% 100% at 50% 110%, #2a0d33 0%, transparent 60%), #0d0710; }
body.wp-ocean   { background: radial-gradient(120% 90% at 20% 10%, #062c3d 0%, transparent 55%), radial-gradient(110% 90% at 85% 25%, #0a1a4d 0%, transparent 55%), radial-gradient(130% 100% at 50% 110%, #06333d 0%, transparent 60%), #060a14; }
body.wp-mono    { background: radial-gradient(120% 90% at 25% 15%, #1c2230 0%, transparent 55%), radial-gradient(130% 100% at 60% 110%, #141926 0%, transparent 65%), #0a0d14; }

.blob { position: absolute; width: 45vw; height: 45vw; border-radius: 50%; filter: blur(90px); opacity: 0.16; pointer-events: none; }
.b1 { background: var(--accent); top: -12vw; left: -8vw; animation: drift1 26s ease-in-out infinite alternate; }
.b2 { background: #7c6cff; bottom: -15vw; right: -10vw; animation: drift2 32s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(12vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vw, -12vh) scale(0.9); } }

/* ---------- boot ---------- */
#boot { position: fixed; inset: 0; background: #05070c; z-index: 999; display: flex; align-items: center; justify-content: center; cursor: pointer; }
#bios { position: absolute; top: 28px; left: 32px; right: 32px; font-family: var(--mono); font-size: 13px; line-height: 1.75; color: #9fb6a8; white-space: pre-wrap; }
#bios .ok { color: var(--accent); }
#bootlogo { text-align: center; }
.blogo { font-size: clamp(48px, 9vw, 96px); font-weight: 200; letter-spacing: 0.04em; background: linear-gradient(120deg, var(--accent), #7c6cff); -webkit-background-clip: text; background-clip: text; color: transparent; animation: fadeup 0.9s ease both; }
.bsub { color: var(--dim); margin-top: 6px; font-size: 15px; letter-spacing: 0.25em; text-transform: uppercase; animation: fadeup 0.9s 0.25s ease both; }
.bbar { width: 220px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 3px; margin: 34px auto 0; overflow: hidden; animation: fadeup 0.9s 0.4s ease both; }
.bbar i { display: block; height: 100%; width: 0; background: var(--accent); animation: load 1.3s 0.45s ease-in-out forwards; }
.bskip { position: absolute; bottom: 22px; width: 100%; text-align: center; color: #3d4a5e; font-size: 12px; letter-spacing: 0.1em; }
@keyframes load { to { width: 100%; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- desktop ---------- */
#desktop { position: fixed; inset: 0; animation: deskin 0.6s ease both; }
@keyframes deskin { from { opacity: 0; } }
#icons { position: absolute; top: 18px; left: 14px; bottom: 74px; display: flex; flex-direction: column; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.dicon { width: 88px; padding: 10px 4px; border-radius: 10px; text-align: center; cursor: pointer; border: 1px solid transparent; }
.dicon:hover { background: rgba(255,255,255,0.07); }
.dicon.sel { background: rgba(255,255,255,0.1); border-color: var(--border); }
.dicon .tile { width: 52px; height: 52px; margin: 0 auto 7px; border-radius: 14px; background: linear-gradient(145deg, var(--glass-lite), rgba(255,255,255,0.02)); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.dicon .lbl { font-size: 12px; text-shadow: 0 1px 3px rgba(0,0,0,0.8); line-height: 1.25; }

/* ---------- windows ---------- */
.win { position: absolute; min-width: 280px; min-height: 160px; border-radius: var(--radius); background: var(--glass); backdrop-filter: blur(28px) saturate(1.3); -webkit-backdrop-filter: blur(28px) saturate(1.3); border: 1px solid var(--border); box-shadow: 0 18px 60px rgba(0,0,0,0.5); display: flex; flex-direction: column; overflow: hidden; animation: winin 0.22s ease both; }
.win.focus { box-shadow: 0 24px 80px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.08); }
.win.maxed { border-radius: 0; }
@keyframes winin { from { opacity: 0; transform: scale(0.96) translateY(8px); } }
.tbar { height: 40px; display: flex; align-items: center; padding: 0 12px; gap: 10px; background: rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.07); cursor: grab; flex: none; touch-action: none; }
.tbar:active { cursor: grabbing; }
.dots { display: flex; gap: 8px; }
.dot { width: 13px; height: 13px; border-radius: 50%; border: none; cursor: pointer; padding: 0; }
.dot.close { background: #ff5f57; } .dot.min { background: #febc2e; } .dot.max { background: #28c840; }
.dot:hover { filter: brightness(1.2); }
.ttitle { font-size: 13px; color: var(--dim); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.win.focus .ttitle { color: var(--text); }
.wbody { flex: 1; overflow: auto; position: relative; }
.wbody.nopad iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.rsz { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; }

/* ---------- taskbar ---------- */
#taskbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 16px; background: var(--glass); backdrop-filter: blur(28px) saturate(1.3); -webkit-backdrop-filter: blur(28px) saturate(1.3); border: 1px solid var(--border); box-shadow: 0 10px 40px rgba(0,0,0,0.45); max-width: calc(100vw - 24px); }
#startbtn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border); background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02)); cursor: pointer; display: flex; align-items: center; justify-content: center; }
#startbtn:hover { background: rgba(255,255,255,0.14); }
.klogo { font-weight: 700; font-size: 19px; color: var(--accent); font-family: "Segoe UI", sans-serif; }
#tasks { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.taskbtn { height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--text); font-size: 12px; display: flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; }
.taskbtn .ti { font-size: 17px; }
.taskbtn:hover { background: rgba(255,255,255,0.08); }
.taskbtn.active { background: rgba(255,255,255,0.1); border-color: var(--border); }
.taskbtn.minned { opacity: 0.55; }
#clockbox { text-align: center; padding: 0 10px 0 6px; line-height: 1.2; border-left: 1px solid rgba(255,255,255,0.08); margin-left: 2px; }
#clock { font-size: 14px; font-weight: 600; }
#dateline { font-size: 10.5px; color: var(--dim); }

/* ---------- start menu / context menu ---------- */
#startmenu { position: absolute; bottom: 76px; left: 50%; transform: translateX(-50%); width: 420px; max-width: calc(100vw - 24px); border-radius: 18px; background: var(--glass); backdrop-filter: blur(30px) saturate(1.3); -webkit-backdrop-filter: blur(30px) saturate(1.3); border: 1px solid var(--border); box-shadow: 0 24px 80px rgba(0,0,0,0.6); padding: 18px; animation: menuin 0.18s ease both; z-index: 5000; }
@keyframes menuin { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }
.smgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.smitem { border: none; background: transparent; color: var(--text); padding: 12px 4px 10px; border-radius: 12px; cursor: pointer; text-align: center; font-family: inherit; }
.smitem:hover { background: rgba(255,255,255,0.09); }
.smitem .tile { width: 46px; height: 46px; margin: 0 auto 7px; border-radius: 12px; background: linear-gradient(145deg, var(--glass-lite), rgba(255,255,255,0.02)); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 23px; }
.smitem .lbl { font-size: 11.5px; }
.smfoot { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--dim); }
.smfoot a { color: var(--accent); text-decoration: none; }
.smfoot a:hover { text-decoration: underline; }

#ctxmenu { position: absolute; min-width: 190px; border-radius: 12px; background: var(--glass); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 1px solid var(--border); box-shadow: 0 16px 50px rgba(0,0,0,0.55); padding: 5px; z-index: 6000; animation: menuin2 0.14s ease both; }
@keyframes menuin2 { from { opacity: 0; transform: scale(0.97); } }
.ctxitem { display: block; width: 100%; text-align: left; border: none; background: transparent; color: var(--text); font-family: inherit; font-size: 13px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.ctxitem:hover { background: rgba(255,255,255,0.1); }

/* ---------- terminal ---------- */
.term { height: 100%; padding: 12px 14px; font-family: var(--mono); font-size: 13px; line-height: 1.55; overflow-y: auto; cursor: text; }
.term .out { white-space: pre-wrap; word-break: break-word; }
.term .ln { display: flex; }
.term .prompt { color: var(--accent); white-space: nowrap; margin-right: 8px; }
.term input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font: inherit; }
.term .err { color: #ff7b72; }
.term .dir { color: #79b8ff; }
.term .art { color: var(--accent); }

/* ---------- files ---------- */
.filesapp { display: flex; flex-direction: column; height: 100%; }
.ftoolbar { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.07); flex: none; }
.ftoolbar button { border: 1px solid var(--border); background: var(--glass-lite); color: var(--text); font-family: inherit; font-size: 12px; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.ftoolbar button:hover { background: rgba(255,255,255,0.12); }
.fpath { flex: 1; font-family: var(--mono); font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; }
.fgrid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px; padding: 12px; align-content: start; }
.fitem { padding: 10px 4px; border-radius: 10px; text-align: center; cursor: pointer; border: 1px solid transparent; }
.fitem:hover { background: rgba(255,255,255,0.07); }
.fitem.sel { background: rgba(255,255,255,0.1); border-color: var(--border); }
.fitem .fic { font-size: 30px; }
.fitem .fnm { font-size: 11.5px; margin-top: 5px; word-break: break-all; line-height: 1.25; }
.fempty { grid-column: 1/-1; color: var(--dim); font-size: 13px; text-align: center; padding: 30px 0; }

/* ---------- notepad ---------- */
.notepad { display: flex; flex-direction: column; height: 100%; }
.notepad textarea { flex: 1; resize: none; border: none; outline: none; background: transparent; color: var(--text); font-family: var(--mono); font-size: 13.5px; line-height: 1.6; padding: 14px 16px; user-select: text; }
.npbar { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid rgba(255,255,255,0.07); align-items: center; flex: none; }
.npbar button { border: 1px solid var(--border); background: var(--glass-lite); color: var(--text); font-family: inherit; font-size: 12px; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.npbar button:hover { background: rgba(255,255,255,0.12); }
.npstatus { font-size: 11.5px; color: var(--dim); margin-left: auto; }

/* ---------- about ---------- */
.about { padding: 28px 30px 34px; user-select: text; }
.about .hero { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; }
.avatar { width: 70px; height: 70px; border-radius: 20px; background: linear-gradient(135deg, var(--accent), #7c6cff); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; color: #0a0f18; flex: none; }
.about h1 { font-size: 24px; font-weight: 650; }
.about .role { color: var(--dim); font-size: 13.5px; margin-top: 3px; }
.about h2 { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin: 26px 0 12px; }
.projgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.projcard { border: 1px solid var(--border); border-radius: 13px; padding: 14px; background: var(--glass-lite); display: block; color: inherit; text-decoration: none; transition: background 0.15s, transform 0.15s; }
.projcard:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }
.projcard .pt { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.projcard .pt .live { font-size: 9.5px; letter-spacing: 0.08em; color: #0a0f18; background: var(--accent); border-radius: 20px; padding: 2px 7px; font-weight: 700; }
.projcard .pd { font-size: 12.5px; color: var(--dim); margin-top: 6px; line-height: 1.5; }
.aboutfoot { margin-top: 26px; display: flex; gap: 10px; }
.abtn { border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; font-size: 13px; color: var(--text); text-decoration: none; background: var(--glass-lite); }
.abtn:hover { background: rgba(255,255,255,0.12); }
.abtn.primary { background: var(--accent); color: #0a0f18; font-weight: 600; border-color: transparent; }

/* ---------- settings ---------- */
.settings { padding: 22px 24px; }
.settings h2 { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin: 18px 0 12px; }
.settings h2:first-child { margin-top: 0; }
.wprow { display: flex; gap: 10px; flex-wrap: wrap; }
.wpthumb { width: 92px; height: 58px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.wpthumb.sel { border-color: var(--accent); }
.wpthumb[data-wp="wp-aurora"] { background: linear-gradient(135deg, #10331f, #0d2b4d, #1d1040); }
.wpthumb[data-wp="wp-sunset"] { background: linear-gradient(135deg, #4d1a2b, #4d2a0d, #2a0d33); }
.wpthumb[data-wp="wp-ocean"]  { background: linear-gradient(135deg, #062c3d, #0a1a4d, #06333d); }
.wpthumb[data-wp="wp-mono"]   { background: linear-gradient(135deg, #1c2230, #141926, #0a0d14); }
.accrow { display: flex; gap: 10px; }
.accdot { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.accdot.sel { border-color: #fff; }
.dangerbtn { border: 1px solid rgba(255,95,87,0.4); background: rgba(255,95,87,0.12); color: #ff8a84; font-family: inherit; font-size: 13px; padding: 8px 16px; border-radius: 10px; cursor: pointer; }
.dangerbtn:hover { background: rgba(255,95,87,0.2); }
.sethint { font-size: 12px; color: var(--dim); margin-top: 8px; }

/* ---------- snake ---------- */
.snakewrap { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 10px; padding: 12px; }
.snakewrap canvas { border-radius: 10px; background: rgba(0,0,0,0.35); border: 1px solid var(--border); max-width: 100%; }
.snakehud { font-family: var(--mono); font-size: 13px; color: var(--dim); }
.snakehud b { color: var(--accent); }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
