/* LightFly OS — styled 1:1 after the "I Really Wanna Hug You" music video */
@font-face { font-family: "MSS"; src: url(../fonts/ms_sans_serif.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "MSSB"; src: url(../fonts/ms_sans_serif_bold.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "VT"; src: url(../fonts/vt323-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "PIX"; src: url(../fonts/pixelify-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* colours taken straight from the video's index.html */
  --face: #d4e6e1;
  --face-down: #b9cfca;
  --face-hi: #e3efec;
  --b-light: #ffffff;
  --b-dark: #3c4a48;
  --b-light2: #dfe9e6;
  --b-dark2: #7a8a88;
  --b-black: #0b0b0b;
  --title-a: #0a1e7a;
  --title-b: #8fb6e8;
  --inactive-a: #7d8a96;
  --inactive-b: #c3cfd6;
  --red-a: #7a0b2a;
  --red-b: #f08fb3;
  --sel: #0a1e7a;
  --ink: #141414;
  --muted: #334;
  --lcd: #39ff9c;
  --lcd-bg: #14161f;
  --pink: #ff4f9a;
  --body-grad: linear-gradient(135deg, #cfc4e4, #c2e2dc 50%, #d9efe9);
  --out: inset -1px -1px var(--b-dark), inset 1px 1px var(--b-light), inset -2px -2px var(--b-dark2), inset 2px 2px var(--b-light2);
  --in: inset 1px 1px var(--b-dark2), inset -1px -1px var(--b-light), inset 2px 2px var(--b-black), inset -2px -2px var(--b-light2);
  --taskbar: 40px;
  --ui: "MSS", Tahoma, "Noto Sans CJK JP", "DejaVu Sans", sans-serif;
  --ui-b: "MSSB", "MSS", Tahoma, "Noto Sans CJK JP", "DejaVu Sans", sans-serif;
  --vt: "VT", "Lucida Console", monospace;
  --pix: "PIX", "MSSB", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; max-width: 100vw; }
body {
  margin: 0; overflow: hidden; background: #050816; color: var(--ink);
  font: 16px/1.3 var(--ui); -webkit-font-smoothing: none; font-smooth: never;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
input, textarea, button { font: inherit; color: inherit; }
b, strong, .b { font-family: var(--ui-b); font-weight: 400; }
[hidden] { display: none !important; }
img.px, .px img { image-rendering: pixelated; }

/* ---------- wallpaper (canvas) ---------- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- CRT overlay (approximates the video's WebGL pass) ---------- */
#crt { position: fixed; inset: 0; pointer-events: none; z-index: 99990; }
#crt::before { content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.10) 0 1px, transparent 1px 3px); }
#crt::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,8,.55) 100%); }
#crt .noise { position: absolute; inset: -50%; opacity: .07; animation: grain .5s steps(6) infinite; }
#crt .track { position: absolute; left: 0; right: 0; height: 2.4%; top: -3%;
  background: linear-gradient(transparent, rgba(255,255,255,.07), transparent); animation: track 7.7s linear infinite; }
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-8%,4%)} 40%{transform:translate(6%,-6%)} 60%{transform:translate(-4%,8%)} 80%{transform:translate(8%,2%)} }
@keyframes track { to { top: 103%; } }
body.crt-off #crt { display: none; }
body:not(.crt-off) #windows, body:not(.crt-off) #taskbar, body:not(.crt-off) #desktop, body:not(.crt-off) #startmenu {
  text-shadow: .7px 0 rgba(255,0,60,.28), -.7px 0 rgba(0,170,255,.28);
}
body.glitch #windows, body.glitch #desktop { animation: glitch .32s steps(2) 1; }
@keyframes glitch {
  0% { transform: translate(6px,0); filter: hue-rotate(40deg); clip-path: inset(10% 0 60% 0); }
  25% { transform: translate(-8px,2px); clip-path: inset(50% 0 20% 0); }
  50% { transform: translate(4px,-2px); filter: invert(.15); clip-path: inset(30% 0 40% 0); }
  75% { transform: translate(-3px,0); clip-path: inset(0 0 0 0); }
}

/* ---------- bevel primitives ---------- */
.out { background: var(--face); box-shadow: var(--out); }
.in { background: #fff; box-shadow: var(--in); }
.btn {
  min-width: 96px; min-height: 30px; padding: 4px 16px; border: 0; background: var(--face); cursor: pointer; color: var(--ink);
  box-shadow: var(--out); position: relative;
}
.btn:active, .btn.down { background: var(--face-down); box-shadow: var(--in); padding: 5px 15px 3px 17px; }
.btn.def { outline: 1px solid #000; outline-offset: 0; }
.btn.def::after, .btn:focus-visible::after { content: ""; position: absolute; inset: 5px; border: 1px dotted #111; pointer-events: none; }
.btn:focus { outline-color: #000; }
.btn[disabled] { color: #8a9a98; text-shadow: 1px 1px #fff; cursor: default; }
.field { border: 0; padding: 6px 8px; width: 100%; background: #fff; box-shadow: var(--in); user-select: text; -webkit-user-select: text; font-size: 16px; }
.field:focus { outline: none; }
.hr { height: 2px; margin: 8px 0; box-shadow: inset 0 1px var(--b-dark2), inset 0 -1px var(--b-light); }

/* ---------- desktop (icons laid out like the video: two columns) ---------- */
#desktop { position: fixed; inset: 0 0 var(--taskbar) 0; }
#desktop .col { position: absolute; top: 0; bottom: 0; width: 150px; padding: 18px 0; display: flex; flex-direction: column;
  justify-content: space-between; max-height: 920px; }
#desktop .left { left: 4px; }
#desktop .right { right: 4px; }
.icon { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 150px; padding: 4px 2px; background: none; border: 0;
  cursor: pointer; color: #fff; text-align: center; position: relative; }
.icon .img { width: 48px; height: 48px; position: relative; }
.icon .img img, .icon .img canvas { width: 48px; height: 48px; image-rendering: pixelated; display: block; }
.icon .label { font-size: 15px; line-height: 1.15; padding: 1px 4px; text-shadow: 1px 1px 0 rgba(0,0,0,.85); white-space: nowrap; }
.ex-grid .icon .label { white-space: normal; word-break: break-word; }
.icon.sel .img::after { content: ""; position: absolute; inset: 0; background: rgba(10,30,140,.45); }
.icon.sel .label { background: var(--sel); text-shadow: none; outline: 1px dotted #fff; outline-offset: -1px; }
.icon:focus { outline: none; }

/* ---------- windows ---------- */
#windows { position: fixed; inset: 0 0 var(--taskbar) 0; pointer-events: none; overflow: hidden; }
.win {
  position: absolute; pointer-events: auto; display: flex; flex-direction: column; padding: 4px;
  min-width: 240px; min-height: 120px; background: var(--face);
  box-shadow: var(--out), 5px 5px 0 rgba(0,0,0,.35);
  transform-origin: center; animation: pop .18s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop { from { transform: scale(.6); opacity: .2; } }
.win.min { display: none; }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; box-shadow: var(--out); }
.titlebar { display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 3px 0 8px; flex: none; color: #fff;
  background: linear-gradient(90deg, var(--inactive-a), var(--inactive-b)); touch-action: none; cursor: default; }
.win.active .titlebar { background: linear-gradient(90deg, var(--title-a), var(--title-b)); }
.win.red .titlebar { background: linear-gradient(90deg, var(--red-a), var(--red-b)); }
.titlebar .t-ico img, .titlebar .t-ico canvas { width: 18px; height: 18px; image-rendering: pixelated; display: block; }
.titlebar .t-text { flex: 1; font-family: var(--ui-b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.t-btn { width: 22px; height: 20px; padding: 0; border: 0; background: var(--face); box-shadow: var(--out); cursor: pointer; display: grid; place-items: center; }
.t-btn:active { box-shadow: var(--in); }
.t-btn svg { width: 12px; height: 12px; }
.t-btn.close { margin-left: 2px; }
.wbody { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: auto; margin-top: 3px; }
.wbody.grad { background: var(--body-grad); padding: 14px; }
.wbody.pad { padding: 10px; }
.wbody.dark { background: var(--lcd-bg); }
.grip { position: absolute; right: 3px; bottom: 3px; width: 14px; height: 14px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 45%, var(--b-dark2) 45% 52%, #fff 52% 58%, transparent 58% 68%, var(--b-dark2) 68% 75%, #fff 75% 81%, transparent 81%); }
.menubar { display: flex; gap: 2px; padding: 3px 4px; flex: none; background: var(--face); font-size: 15px; }
.menubar span { padding: 1px 8px; }
.menubar span:hover { background: var(--sel); color: #fff; }
.statusbar { display: flex; gap: 4px; flex: none; padding: 3px 0 0; font-size: 14px; color: var(--muted); }
.statusbar > span { flex: 1; padding: 2px 8px; box-shadow: inset 1px 1px var(--b-dark2), inset -1px -1px var(--b-light); }

/* ---------- taskbar ---------- */
#taskbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--taskbar); z-index: 9000; display: flex; align-items: center; gap: 4px;
  padding: 4px 4px; background: linear-gradient(#bcd8d3, #a2c6c0); box-shadow: inset 0 1px #fff; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
#startbtn { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 7px; border: 0; background: var(--face); box-shadow: var(--out);
  font: 16px var(--ui-b); cursor: pointer; flex: none; }
#startbtn.down { background: var(--face-hi); box-shadow: var(--in); padding: 1px 9px 0 8px; }
.winlogo { display: grid; grid-template-columns: 8px 8px; gap: 1px; transform: skewY(-6deg); }
.winlogo b { width: 8px; height: 8px; display: block; }
.winlogo b:nth-child(1) { background: #e8392b; } .winlogo b:nth-child(2) { background: #36b34a; margin-top: 1px; }
.winlogo b:nth-child(3) { background: #2d63d8; } .winlogo b:nth-child(4) { background: #f5c518; margin-top: 1px; }
.tsep { width: 2px; height: 28px; box-shadow: inset 1px 0 var(--b-dark2), inset -1px 0 #fff; flex: none; margin: 0 2px; }
#tasks { flex: 1; display: flex; gap: 4px; min-width: 0; overflow: hidden; }
.task { flex: 0 1 180px; min-width: 40px; height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 0; cursor: pointer;
  background: var(--face); box-shadow: var(--out); text-align: left; }
.task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task img, .task canvas { width: 18px; height: 18px; image-rendering: pixelated; flex: none; }
.task.active { background: var(--face-hi); box-shadow: var(--in); font-family: var(--ui-b); }
#tray { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 12px 0 8px; background: #b6d2cd; box-shadow: var(--in); flex: none; }
#tray-vol { width: 22px; height: 20px; border: 0; padding: 0; cursor: pointer; background: none; }
#tray-vol svg { display: block; }
#clock { font-size: 16px; white-space: nowrap; }

/* ---------- start menu (video layout) ---------- */
.menu { position: fixed; z-index: 9500; display: flex; padding: 3px; background: var(--face); box-shadow: var(--out), 4px 4px 0 rgba(0,0,0,.35); }
#startmenu { left: 2px; bottom: calc(var(--taskbar) - 3px); }
#startmenu .band { width: 34px; flex: none; background: linear-gradient(0deg, var(--title-a), var(--title-b)); position: relative; }
#startmenu .band span { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%) rotate(180deg); writing-mode: vertical-rl;
  color: #fff; font: 24px var(--ui-b); white-space: nowrap; letter-spacing: .5px; }
#startmenu .band i { font: 24px var(--ui); font-style: normal; color: #cfe3ff; }
.menu ul { list-style: none; margin: 0; padding: 0; min-width: 210px; }
.menu li.sep { height: 2px; margin: 4px 2px; box-shadow: inset 0 1px var(--b-dark2), inset 0 -1px #fff; }
.menu li > button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 3px 26px 3px 6px; border: 0; background: none;
  cursor: pointer; text-align: left; position: relative; font-size: 16px; }
.menu li > button img, .menu li > button canvas { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.menu li > button.has-sub::after { content: ""; position: absolute; right: 9px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-left: 5px solid currentColor; }
.menu li > button:hover, .menu li > button.open, .menu li > button:focus-visible { background: var(--sel); color: #fff; outline: none; }
.submenu ul { min-width: 220px; }

/* ---------- Win98 controls inside windows ---------- */
.dlg { display: flex; gap: 18px; align-items: flex-start; }
.dlg .d-ico { flex: none; width: 40px; height: 40px; }
.dlg p { margin: 2px 0 6px; }
.dlg-actions { display: flex; gap: 14px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.center { text-align: center; }
.kao { font-family: var(--ui); }

/* explorer */
.ex-tools { display: flex; gap: 4px; align-items: center; flex: none; padding: 2px 4px 5px; background: var(--face); }
.ex-tools .btn { min-width: 0; min-height: 26px; padding: 2px 10px; }
.ex-tools .addr { flex: 1; padding: 4px 8px; background: #fff; box-shadow: var(--in); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: text; font-size: 15px; }
.ex-grid { flex: 1; min-height: 160px; overflow: auto; padding: 12px; background: #fff; box-shadow: var(--in);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); align-content: start; gap: 10px 6px; }
.ex-grid .icon { color: var(--ink); width: auto; }
.ex-grid .icon .label { text-shadow: none; font-size: 15px; }
.ex-grid .icon.sel .label { color: #fff; }
.ex-grid .thumb { height: 92px; width: 100%; display: grid; place-items: center; }
.ex-grid .thumb img { max-width: 116px; max-height: 92px; image-rendering: pixelated; outline: 1px solid #9aa3ab; }
.ex-empty { grid-column: 1 / -1; color: #667; padding: 24px 6px; text-align: center; }

/* notepad / viewers */
.np { flex: 1; resize: none; border: 0; margin: 0 2px 2px; padding: 8px 10px; background: #fff; box-shadow: var(--in);
  font: 16px/1.45 var(--ui); white-space: pre-wrap; overflow: auto; user-select: text; -webkit-user-select: text; }
.np:focus { outline: none; }
.iv-stage { flex: 1; min-height: 120px; display: grid; place-items: center; background: #000; box-shadow: var(--in); margin: 6px; overflow: hidden; }
.iv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.iv-bar { display: flex; gap: 6px; align-items: center; padding: 0 6px 6px; flex: none; }
.iv-bar .name { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.iv-bar .btn { min-width: 44px; }
.vp video { width: 100%; height: 100%; background: #000; display: block; }

/* insta_save.jpg (video intro window) */
.insta { background: #fff; margin: 6px; display: flex; flex-direction: column; flex: 1; }
.insta .head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-family: var(--ui-b); color: #333; }
.insta .head i { width: 26px; height: 26px; border-radius: 50%; background: #e5c2d6; display: block; }
.insta img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; display: block; }
.insta .likes { padding: 10px 12px; font-family: var(--ui-b); color: #222; cursor: pointer; }
.insta .likes.on { color: #e0245e; }

/* LightFly Amp — dark skin from the video */
.amp { background: var(--lcd-bg); color: var(--lcd); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; font-family: var(--vt); }
.amp-top { display: flex; gap: 10px; align-items: center; }
.amp-time { font-size: 44px; line-height: 1; min-width: 92px; }
.amp-marq { flex: 1; overflow: hidden; white-space: nowrap; font-size: 22px; }
.amp-marq span { display: inline-block; animation: marq 14s linear infinite; }
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.amp canvas.vis { width: 100%; height: 76px; display: block; image-rendering: pixelated; }
.amp-ctrl { display: flex; gap: 4px; align-items: center; }
.amp-ctrl .btn { min-width: 40px; min-height: 28px; padding: 2px 8px; font-family: var(--ui); }
.amp-ctrl .vol { width: 90px; margin-left: auto; accent-color: #8fb6e8; }
.amp-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; min-height: 60px; font-size: 22px; line-height: 1.25; }
.amp-list li { padding: 1px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--lcd); }
.amp-list li.on { color: #fff; background: #1d3fc4; }
.amp-list li.missing { color: #4e7a66; }
.amp-seek { height: 10px; background: #2a2f44; position: relative; cursor: pointer; }
.amp-seek i { position: absolute; left: 0; top: 0; bottom: 0; background: #8fb6e8; width: 0; }

/* Messenger */
.chat-tools { padding: 4px 10px; font-size: 15px; color: #223; background: var(--face); }
.chat-to { padding: 6px 10px; background: #eef6f4; font-family: var(--ui-b); color: #223; display: flex; align-items: center; gap: 8px; }
.chat-to i { width: 10px; height: 10px; border-radius: 50%; background: #2fa84f; margin-left: auto; }
.chat-log { flex: 1; min-height: 120px; overflow: auto; margin: 6px 8px; padding: 8px 12px; background: #fff; box-shadow: var(--in); user-select: text; }
.chat-log .who { font-size: 14px; }
.chat-log .who.a { color: #9a3a8a; } .chat-log .who.n { color: #1d3fc4; } .chat-log .who.v { color: #2a7d3f; }
.chat-log .msg { margin: 0 0 10px 18px; font-size: 18px; color: #111; }
.chat-log .sys { text-align: center; color: #c4004a; font-family: var(--ui-b); margin: 6px 0 10px; }
.chat-status { padding: 0 10px; font-size: 14px; color: #556; min-height: 18px; }
.chat-in { display: flex; gap: 8px; padding: 6px 8px 8px; }
.chat-in .field { height: 64px; }
.chat-in .btn { min-width: 84px; }

/* Paint */
.paint { display: flex; flex: 1; min-height: 0; background: var(--face); gap: 6px; padding: 4px; }
.paint .tools { display: grid; grid-template-columns: 26px 26px; gap: 2px; align-content: start; }
.paint .tools i { width: 26px; height: 26px; background: var(--face); box-shadow: var(--out); display: block; }
.paint .tools i.on { box-shadow: var(--in); background: var(--face-hi); }
.paint .tools canvas { width: 26px; height: 26px; display: block; }
.paint .cv { flex: 1; background: #7a8a88; padding: 4px; overflow: auto; display: flex; align-items: flex-start; }
.paint .cv canvas { background: #fff; display: block; max-width: 100%; height: auto; }
.palette { display: flex; gap: 8px; padding: 6px 4px; background: var(--face); align-items: center; }
.palette .cur { width: 34px; height: 34px; background: #fff; box-shadow: var(--in); padding: 6px; }
.palette .cur i { display: block; width: 100%; height: 100%; background: #c4004a; }
.palette .sw { display: grid; grid-template-columns: repeat(14, 20px); gap: 2px; }
.palette .sw i { width: 20px; height: 16px; box-shadow: var(--in); display: block; }

/* hug.exe ("Hugging Transmission...") */
.hug { display: flex; flex-direction: column; gap: 12px; }
.hug .swap { text-align: center; font-size: 22px; min-height: 30px; }
.hug .swap b { padding: 0 6px; color: #fff; background: var(--title-a); outline: 1px dashed #fff; outline-offset: -3px; }
.hug .swap b.f { background: #c4004a; }
.hug .row { display: grid; grid-template-columns: 70px 1fr; gap: 8px 10px; align-items: center; }
.hug .row label { text-align: right; }
.hug .hint { font-size: 14px; color: var(--muted); text-align: center; margin: 0; }
.hug .err { color: #b3003a; font-family: var(--ui-b); text-align: center; margin: 0; }
.prog { height: 30px; background: #fff; box-shadow: var(--in); padding: 5px; display: flex; gap: 3px; overflow: hidden; }
.prog i { width: 18px; flex: none; background: var(--title-a); }
.sending .k { font-size: 30px; color: var(--title-a); white-space: nowrap; height: 40px; position: relative; }
.sending .k span { position: absolute; left: 0; transition: left .1s linear; }
.linkbox { display: flex; gap: 8px; }
.linkbox .field { font-size: 15px; }

/* receive scene */
.kaowin .wbody { display: grid; place-items: center; font-size: 34px; color: #1b1b3a; }
.dist-big { font: 46px/1 var(--vt); color: #7a0b2a; margin: 6px 0 10px; }
.pixheart { position: absolute; image-rendering: pixelated; pointer-events: none; z-index: 1; animation: heartpop .5s cubic-bezier(.34,1.56,.64,1) both, beat .43s ease-in-out .5s infinite; }
@keyframes heartpop { from { transform: scale(0); } }
@keyframes beat { 50% { transform: scale(1.18); } }
.typed::after { content: ""; display: inline-block; width: 2px; height: 1.1em; background: #141414; vertical-align: -3px; margin-left: 2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* system info / my computer */
.sysinfo { font: 22px/1.25 var(--vt); padding: 10px 12px; background: #000; color: #d8d8d8; box-shadow: var(--in); white-space: pre; overflow: auto; margin-top: 8px; }
.sysinfo .h { color: #8fb6e8; }
.radio { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 0 6px; }
.radio label { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 17px; }
.radio input { width: 16px; height: 16px; accent-color: #111; }
.links { display: grid; gap: 8px; }
.links a { text-decoration: none; text-align: center; color: var(--ink); display: block; }
.balloon { position: fixed; z-index: 9400; right: 14px; bottom: calc(var(--taskbar) + 14px); max-width: 360px; background: #ffffe1; border: 1px solid #111;
  padding: 10px 14px 12px; box-shadow: 4px 4px 0 rgba(0,0,0,.3); animation: pop .2s cubic-bezier(.34,1.56,.64,1); }
.balloon::after { content: ""; position: absolute; right: 38px; bottom: -12px; border: 12px solid transparent; border-top-color: #111; border-bottom: 0; }
.balloon .bh { display: flex; gap: 8px; align-items: center; font-family: var(--ui-b); }
.balloon .bx { margin-left: auto; cursor: pointer; padding: 0 4px; }

/* ---------- full screens: boot, splash, BSOD-ish, ending ---------- */
.full { position: fixed; inset: 0; z-index: 99980; overflow: hidden; }
#boot { background: #000; color: #d8d8d8; font: clamp(18px, 2.7vw, 34px)/1.12 var(--vt); padding: 6vh 6vw; }
#boot .l0 { color: #8fb6e8; }
#boot .cur { display: inline-block; width: .5em; height: .9em; background: #d8d8d8; vertical-align: -2px; animation: caret .66s steps(1) infinite; }
.splash { background: #04081e center/cover; display: grid; place-content: center; text-align: center; color: #e9fbf6; }
.splash::before { content: ""; position: absolute; inset: 0; background: rgba(4,8,30,.62); }
.splash > * { position: relative; }
.splash .logo { font: 700 clamp(56px, 9vw, 170px)/1 var(--pix); }
.splash .sub { font: clamp(22px, 3.2vw, 62px)/1.2 var(--ui); color: #bfe3dc; margin-top: 2vh; }
.splash .sub.k { color: #ff7fb0; }
.splash .kk { font: clamp(20px, 2.8vw, 54px)/1.2 var(--ui); color: #cfc4e4; margin-top: 1vh; }
.splash .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4vh; max-height: 40px;
  background: linear-gradient(90deg, #0a1e7a, #8fb6e8, #0a1e7a); background-size: 200% 100%; animation: sweep 1.1s linear infinite; }
@keyframes sweep { to { background-position: -200% 0; } }
.poweron { animation: poweron .6s ease-out both; }
@keyframes poweron { 0% { clip-path: inset(49.8% 0 49.8% 0); filter: brightness(4); } 60% { clip-path: inset(0 0 0 0); filter: brightness(2); } 100% { filter: none; } }
.ending { background: #000; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3.2vh; cursor: pointer; padding: 20px; text-align: center; }
.ending p { margin: 0; font: clamp(18px, 2.9vw, 56px)/1.2 var(--ui); color: #ff9a2e; opacity: 0; animation: fadein .3s forwards; }
.ending p.o { color: #ffb766; }
.ending p.k { font-size: clamp(22px, 3.6vw, 70px); margin-top: 2vh; }
.ending small { color: #665; font-size: 15px; margin-top: 4vh; opacity: 0; animation: fadein .3s 2.6s forwards; }
@keyframes fadein { to { opacity: 1; } }
.saver { background: #06081f; cursor: pointer; }
.saver canvas { width: 100%; height: 100%; display: block; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  #desktop { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; padding: 8px 2px; gap: 4px 0; overflow: auto; }
  #desktop .col { display: contents; }
  .icon { width: 86px; }
  .icon .img, .icon .img img, .icon .img canvas { width: 40px; height: 40px; }
  .icon .label { font-size: 13px; white-space: normal; word-break: break-all; }
  .win { left: 3px !important; width: calc(100vw - 6px) !important; max-height: calc(100dvh - var(--taskbar) - 8px); }
  .task { flex-basis: 44px; }
  .task span { display: none; }
  .grip { display: none; }
  .win.kaowin { width: 47vw !important; min-width: 0; }
  .win.kaowin.r { left: auto !important; right: 3px; }
  .kaowin .wbody { font-size: 24px; }
  .palette .sw { grid-template-columns: repeat(14, 14px); }
  .palette .sw i { width: 14px; }
  .hug .row { grid-template-columns: 1fr; }
  .hug .row label { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .win, .amp-marq span, #crt .noise, #crt .track { animation: none !important; }
}

/* ---------- admin.exe ---------- */
.tabs { display: flex; gap: 0; padding: 6px 8px 0; background: var(--face); position: relative; z-index: 1; flex: none; }
.tabs button { border: 0; background: var(--face); padding: 5px 16px 4px; margin-right: -2px; cursor: pointer; font-size: 16px;
  box-shadow: inset 1px 1px #fff, inset -1px 0 var(--b-dark), inset -2px 0 var(--b-dark2); border-radius: 3px 3px 0 0; position: relative; top: 2px; }
.tabs button.on { top: 0; padding: 6px 18px 7px; z-index: 2; font-family: var(--ui-b); }
.tabpanel { flex: 1; min-height: 0; overflow: auto; margin: 0 8px 8px; padding: 12px; background: var(--face); box-shadow: var(--out); position: relative; }
.gbox { border: 0; margin: 0 0 12px; padding: 12px 14px; box-shadow: inset 1px 1px var(--b-dark2), inset -1px -1px #fff, inset 2px 2px #fff, inset -2px -2px var(--b-dark2); }
.gbox legend { padding: 0 6px; font-family: var(--ui-b); }
.gbox .radio { margin-top: 4px; }
.gbox .radio label { font-size: 16px; }
.gbox .radio .field { margin-left: 8px; }
.muted { color: #667; }
.err { color: #b3003a; font-family: var(--ui-b); }
.astatus { position: sticky; bottom: 0; float: right; background: #ffffe1; border: 1px solid #111; padding: 4px 10px; box-shadow: 3px 3px 0 rgba(0,0,0,.25); }
.astatus.bad { background: #ffd8e2; }
.gwrap { overflow: auto; background: #fff; box-shadow: var(--in); max-height: calc(100% - 44px); min-height: 120px; }
.gtab { border-collapse: collapse; width: 100%; font-size: 15px; }
.gtab th { position: sticky; top: 0; background: var(--face); box-shadow: inset -1px -1px var(--b-dark2), inset 1px 1px #fff; text-align: left; padding: 4px 8px; font-weight: 400; white-space: nowrap; }
.gtab td { padding: 3px 8px; border-bottom: 1px solid #eef2f1; white-space: nowrap; vertical-align: top; }
.gtab td.wrap { white-space: normal; word-break: break-word; max-width: 420px; }
.gtab td.num, table.mini td.num { text-align: right; font-variant-numeric: tabular-nums; }
.gtab tr.click { cursor: pointer; }
.gtab tbody tr:hover td { background: #e8eef9; }
.gtab td.muted { text-align: center; padding: 18px; }
.lnk { border: 0; background: none; padding: 0; color: #1d3fc4; text-decoration: underline; cursor: pointer; font: inherit; }
.btn.mini { min-width: 0; min-height: 24px; padding: 1px 10px; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tile { background: #fff; box-shadow: var(--in); padding: 10px 12px; display: flex; flex-direction: column; }
.tile b { font: 34px/1 var(--vt); color: var(--title-a); }
.tile span { font-size: 14px; color: #445; margin-top: 2px; }
canvas.chart { width: 100%; height: 220px; display: block; box-shadow: var(--in); }
.legend { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.legend i { width: 12px; height: 12px; display: inline-block; margin-left: 8px; }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 12px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 15px; }
table.mini td { padding: 2px 4px; border-bottom: 1px solid rgba(0,0,0,.07); word-break: break-word; }
select.field { padding: 4px 6px; }
