/* ==========================================================
   TeezyParty — early-2000s desktop
   ========================================================== */
:root {
  --font: Tahoma, Verdana, "Segoe UI", Geneva, sans-serif;
  --title-font: "Trebuchet MS", "Franklin Gothic Medium", Tahoma, sans-serif;

  /* login */
  --login-dark: #00309c;
  --login-mid: #5a7edc;
  --login-light: #7ea2ee;

  /* window chrome */
  --title-1: #0a5ce8;
  --title-2: #3d95ff;
  --title-3: #0841c4;
  --title-inactive-1: #7c9be0;
  --title-inactive-2: #a8c0f0;
  --win-face: #ece9d8;
  --win-border: #0831d9;
  --win-border-inactive: #7a96df;
  --select: #316ac5;

  /* taskbar */
  --task-1: #1f5fd6;
  --task-2: #3a81f3;
  --task-3: #1941a5;
  --start-1: #3c9a3c;
  --start-2: #5fc55f;
  --tray-1: #0f8ef5;
  --tray-2: #14a0f9;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-size: 12px;
  color: #000;
  background: #000;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}
input, textarea, button, select { font-family: var(--font); font-size: 12px; }
textarea, input[type=text], input[type=password], [contenteditable] { user-select: text; -webkit-user-select: text; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; }

/* ==========================================================
   LOGIN
   ========================================================== */
#login {
  display: flex; flex-direction: column;
  background: var(--login-mid);
  color: #fff;
  transition: opacity .6s ease;
}
.login-bar {
  height: 84px; flex: none;
  background: var(--login-dark);
  position: relative;
}
.login-bar.top::after, .login-bar.bottom::before {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #f0a060 20%, #ffd2a6 50%, #f0a060 80%, transparent);
}
.login-bar.top::after { bottom: 0; background: linear-gradient(90deg, #3a6bd8, #b8d0ff 50%, #3a6bd8); }
.login-bar.bottom::before { top: 0; }
.login-bar.bottom {
  height: 92px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  background: linear-gradient(#2a50c0, var(--login-dark) 30%);
}
.login-main {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 60% 70% at 18% 30%, rgba(255,255,255,.28), transparent 70%),
    linear-gradient(180deg, #6d8fe6, var(--login-mid) 45%, #4a6fd4);
  position: relative;
  overflow: hidden;
}
.login-inner { display: flex; align-items: center; width: min(920px, 100%); padding: 0 24px; }
.login-left { flex: 1; text-align: right; padding-right: 40px; }
.login-sep {
  width: 2px; align-self: stretch; min-height: 340px;
  background: linear-gradient(transparent, rgba(255,255,255,.75) 50%, transparent);
}
.login-right { flex: 1; padding-left: 40px; display: flex; flex-direction: column; gap: 8px; }

.brand { display: inline-flex; flex-direction: column; align-items: flex-end; }
.brand-logo { width: 84px; height: 84px; margin-bottom: 6px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.brand-name {
  font-family: var(--title-font); font-weight: bold; font-style: italic;
  font-size: 46px; letter-spacing: -1px; line-height: 1;
  text-shadow: 1px 2px 3px rgba(0,0,0,.35);
}
.brand-name sup { font-size: 16px; font-style: normal; vertical-align: top; margin-left: 2px; }
.brand-ed { font-size: 15px; font-weight: bold; color: #ffb347; letter-spacing: .5px; margin-top: 2px; text-shadow: 0 1px 1px rgba(0,0,0,.3); }
.login-hint { font-size: 17px; margin-top: 28px; text-shadow: 0 1px 2px rgba(0,0,0,.3); }

.user {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 10px 12px; border-radius: 8px;
  cursor: pointer; position: relative;
  border: 1px solid transparent;
}
.user:hover:not(.selected) .avatar { border-color: #ffcf5a; }
.user.selected {
  background: linear-gradient(90deg, rgba(0,40,140,.55), rgba(0,40,140,0) 95%);
  border-left-color: rgba(255,255,255,.3);
  cursor: default;
}
.avatar {
  width: 62px; height: 62px; flex: none;
  border-radius: 6px; border: 3px solid rgba(255,255,255,.85);
  display: grid; place-items: center;
  font-size: 34px; line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,.35);
  transition: border-color .15s;
}
.user.selected .avatar { border-color: #ffcf5a; }
.user-name { font-size: 20px; padding-top: 6px; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.user-pass { display: none; margin-top: 8px; align-items: center; gap: 6px; }
.user.selected .user-pass { display: flex; }
.user-pass label { display: block; font-size: 12px; margin-bottom: 4px; }
.user-pass input {
  width: 170px; height: 26px; padding: 2px 8px;
  border: 1px solid #1c3a8c; border-radius: 3px; outline: none;
  font-size: 15px;
}
.go-btn, .hint-btn {
  width: 26px; height: 26px; border-radius: 4px; border: 1px solid #fff;
  cursor: pointer; color: #fff; font-weight: bold;
  display: grid; place-items: center; padding: 0;
}
.go-btn { background: linear-gradient(#5fd05f, #2a9a2a); font-size: 16px; }
.go-btn:hover { background: linear-gradient(#7ae07a, #33b033); }
.hint-btn { background: linear-gradient(#3d7aea, #1d4cbd); font-size: 13px; }

.balloon {
  position: absolute; z-index: 5;
  background: #ffffe1; color: #000; border: 1px solid #000;
  border-radius: 8px; padding: 8px 26px 8px 10px; max-width: 260px;
  box-shadow: 2px 3px 6px rgba(0,0,0,.35);
  font-size: 11px; line-height: 1.4;
}
.balloon b { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; }
.balloon .x { position: absolute; top: 4px; right: 6px; cursor: pointer; font-weight: bold; }
.balloon::before {
  content: ""; position: absolute; left: 24px; top: -11px;
  border: 10px solid transparent; border-top: 0; border-bottom-color: #000;
}
.balloon::after {
  content: ""; position: absolute; left: 25px; top: -9px;
  border: 9px solid transparent; border-top: 0; border-bottom-color: #ffffe1;
}
#login .balloon { left: 90px; top: 108px; }

.power-btn {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: none; border: 0; color: #fff; font-size: 15px; padding: 0;
}
.power-btn .ico {
  width: 28px; height: 28px; border-radius: 4px; border: 1px solid #fff;
  background: linear-gradient(#ee6a3c, #c4300c);
  display: grid; place-items: center; font-size: 15px;
}
.power-btn:hover .ico { filter: brightness(1.15); }
.login-foot { font-size: 12px; text-align: right; color: #dbe5ff; max-width: 320px; line-height: 1.5; }

/* ==========================================================
   WELCOME / LOADING
   ========================================================== */
#welcome {
  display: grid; place-items: center;
  background: var(--login-mid);
  color: #fff;
}
#welcome .login-main { position: absolute; inset: 84px 0 92px; }
#welcome .welcome-text {
  position: relative; z-index: 2; text-align: center;
  font-family: var(--title-font); font-style: italic; font-weight: bold;
  font-size: clamp(48px, 9vw, 84px);
  text-shadow: 2px 3px 6px rgba(0,0,0,.4);
  animation: welcomeIn 1s ease both;
}
#welcome .welcome-sub { font-family: var(--font); font-style: normal; font-weight: normal; font-size: 15px; margin-top: 10px; opacity: .9; }
#welcome .login-bar { position: absolute; left: 0; right: 0; }
#welcome .login-bar.top { top: 0; }
#welcome .login-bar.bottom { bottom: 0; }
@keyframes welcomeIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* ==========================================================
   SHUTDOWN
   ========================================================== */
#shutdown {
  z-index: 9000; background: #000; color: #f6a43a;
  display: grid; place-items: center; text-align: center;
  font-family: "Courier New", monospace; font-size: 22px;
}
#shutdown small { display: block; color: #888; font-size: 13px; margin-top: 18px; cursor: pointer; }
#shutdown small:hover { color: #ccc; }

/* ==========================================================
   DESKTOP
   ========================================================== */
#desktop { overflow: hidden; }
.wallpaper { position: absolute; inset: 0; transition: opacity .8s; }

/* Wallpapers — all drawn in CSS */
.wall-hills {
  background:
    radial-gradient(ellipse 18% 8% at 22% 22%, rgba(255,255,255,.95), transparent 70%),
    radial-gradient(ellipse 12% 5% at 28% 19%, rgba(255,255,255,.8), transparent 70%),
    radial-gradient(ellipse 22% 7% at 70% 14%, rgba(255,255,255,.85), transparent 70%),
    radial-gradient(ellipse 10% 4% at 78% 18%, rgba(255,255,255,.7), transparent 70%),
    radial-gradient(ellipse 90% 55% at 35% 108%, #7cc23a 0 60%, transparent 61%),
    radial-gradient(ellipse 80% 45% at 95% 110%, #5aa52a 0 60%, transparent 61%),
    linear-gradient(#2b6fe0 0%, #5c9bf0 45%, #a9d2fb 70%, #cfe6ff 100%);
}
.wall-hills::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 35% 108%, rgba(255,255,160,.25), transparent 60%),
    radial-gradient(ellipse 70% 40% at 30% 75%, rgba(255,255,255,.12), transparent 60%);
}
.wall-aqua {
  background:
    radial-gradient(circle at 15% 25%, rgba(255,255,255,.45) 0 3%, rgba(255,255,255,.08) 3.4% 6%, transparent 6.2%),
    radial-gradient(circle at 72% 62%, rgba(255,255,255,.35) 0 5%, rgba(255,255,255,.06) 5.4% 9%, transparent 9.2%),
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.3) 0 2%, rgba(255,255,255,.06) 2.3% 4%, transparent 4.2%),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,.3) 0 2.5%, rgba(255,255,255,.05) 2.8% 5%, transparent 5.2%),
    radial-gradient(ellipse at 50% 0%, #6fd1ff, #1279c9 55%, #063d7a);
}
.wall-sunset {
  background:
    radial-gradient(circle at 50% 72%, #fff6c0 0 4%, #ffd56a 6%, rgba(255,140,60,.6) 18%, transparent 40%),
    linear-gradient(transparent 72%, #3b1d4a 72.3%, #1c0d2b),
    linear-gradient(#2a1050 0%, #8a2a7a 35%, #f0603c 60%, #ffb347 72%);
}
.wall-space {
  background:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 30% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 35%, #fff, transparent),
    radial-gradient(1px 1px at 80% 15%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 90% 80%, #fff, transparent),
    radial-gradient(1px 1px at 65% 90%, #fff, transparent),
    radial-gradient(1px 1px at 20% 50%, #cde, transparent),
    radial-gradient(1px 1px at 45% 10%, #fff, transparent),
    radial-gradient(ellipse 40% 30% at 70% 40%, rgba(120,60,200,.45), transparent 70%),
    radial-gradient(ellipse 30% 25% at 25% 70%, rgba(40,120,220,.35), transparent 70%),
    #05051a;
  background-size: 220px 220px, 300px 300px, 260px 260px, 180px 180px, 340px 340px, 240px 240px, 200px 200px, 280px 280px, 100% 100%, 100% 100%, auto;
}
.wall-teal { background: #008080; }

/* Desktop icons */
.icons {
  position: absolute; top: 8px; left: 8px; bottom: 38px;
  display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start;
  gap: 4px;
}
.dicon {
  width: 84px; padding: 4px 2px; text-align: center;
  color: #fff; cursor: default; border: 1px dotted transparent;
  opacity: 0; transform: scale(.6);
}
.dicon.show { opacity: 1; transform: none; transition: opacity .3s, transform .3s cubic-bezier(.3,1.6,.6,1); }
.dicon .gly {
  font-size: 34px; line-height: 44px; height: 44px;
  filter: drop-shadow(1px 2px 1px rgba(0,0,0,.35));
}
.dicon .lbl {
  display: inline-block; margin-top: 2px; padding: 0 3px;
  font-size: 11px; line-height: 1.3;
  text-shadow: 1px 1px 1px #000, 0 0 2px #000;
  word-break: break-word;
}
.dicon.sel .gly { filter: drop-shadow(1px 2px 1px rgba(0,0,0,.35)) brightness(.75) sepia(1) hue-rotate(180deg) saturate(3); }
.dicon.sel .lbl { background: var(--select); text-shadow: none; }
.dicon.sel { border-color: #ffffff88; }

/* ==========================================================
   WINDOWS
   ========================================================== */
.win {
  position: absolute;
  min-width: 240px; min-height: 120px;
  display: flex; flex-direction: column;
  background: var(--win-face);
  border: 3px solid var(--win-border);
  border-top: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 2px 4px 14px rgba(0,0,0,.45);
  animation: winOpen .18s ease-out;
  resize: both; overflow: hidden;
}
@keyframes winOpen { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.win.closing { animation: winClose .15s ease-in forwards; }
@keyframes winClose { to { transform: scale(.85); opacity: 0; } }
.win.minimized { display: none; }
.win.maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - 30px) !important; border-radius: 0; resize: none; }
.win.inactive { border-color: var(--win-border-inactive); }

.titlebar {
  height: 30px; flex: none;
  display: flex; align-items: center; gap: 5px;
  padding: 0 4px 0 6px;
  margin: 0 -3px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #3d95ff 0%, var(--title-1) 12%, #0a5ce8 40%, var(--title-2) 85%, var(--title-3) 100%);
  color: #fff; font-weight: bold; font-size: 13px;
  font-family: var(--title-font);
  text-shadow: 1px 1px 1px #0a1f5c;
  cursor: default;
  touch-action: none;
}
.win.inactive .titlebar { background: linear-gradient(180deg, var(--title-inactive-2), var(--title-inactive-1) 40%, var(--title-inactive-2)); color: #d8e4f8; text-shadow: none; }
.titlebar .t-ico { font-size: 15px; flex: none; }
.titlebar .t-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctrl {
  width: 22px; height: 22px; flex: none; padding: 0;
  border: 1px solid #fff; border-radius: 3px;
  background: linear-gradient(135deg, #5c9aff, #2a64e0 60%, #1b4fd0);
  color: #fff; font-weight: bold; font-size: 12px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
}
.ctrl:hover { filter: brightness(1.2); }
.ctrl.close { background: linear-gradient(135deg, #f28a6a, #d8471f 60%, #c23812); }
.win.inactive .ctrl { opacity: .7; }

.menubar { display: flex; flex: none; background: var(--win-face); border-bottom: 1px solid #cfcbb8; padding: 1px 2px; }
.menubar button { background: none; border: 0; padding: 3px 7px; cursor: pointer; }
.menubar button:hover { background: var(--select); color: #fff; }
.toolbar { display: flex; flex: none; gap: 4px; align-items: center; padding: 4px 6px; border-bottom: 1px solid #cfcbb8; flex-wrap: wrap; }
.win-body { flex: 1; overflow: auto; position: relative; background: #fff; min-height: 0; }
.win-body > .explorer, .win-body > .paint, .win-body > .tunes, .win-body > .im,
.win-body > .buddies, .win-body > .snake, .win-body > .cpanel, .win-body > textarea, .win-body > iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.win-body > .buddies { overflow: auto; }
.win-body.face { background: var(--win-face); }
.statusbar { flex: none; border-top: 1px solid #cfcbb8; padding: 3px 8px; font-size: 11px; color: #333; }

/* Classic buttons & fields */
.btn {
  min-width: 75px; height: 23px; padding: 0 10px;
  border: 1px solid #003c74; border-radius: 3px;
  background: linear-gradient(#fff, #ecebe6 85%, #d6d0c5);
  cursor: pointer;
}
.btn:hover { box-shadow: inset 0 0 0 2px #fbc860; }
.btn:active { background: linear-gradient(#e3e2da, #f2f1ec); }
.btn.small { min-width: 0; padding: 0 7px; }
.field {
  height: 22px; border: 1px solid #7f9db9; padding: 2px 5px; background: #fff; outline: none;
}
.field:focus { border-color: #316ac5; }

/* Dialogs */
.dialog .win-body { flex: none; overflow: visible; }
.dialog .d-row { display: flex; gap: 14px; padding: 16px; align-items: flex-start; }
.dialog .d-ico { font-size: 30px; line-height: 1; }
.dialog .d-msg { line-height: 1.5; padding-top: 4px; }
.dialog .d-btns { display: flex; justify-content: center; gap: 8px; padding: 0 16px 14px; background: var(--win-face); }
.win.dialog { resize: none; }

/* ==========================================================
   TASKBAR
   ========================================================== */
.taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 30px; z-index: 5000;
  display: flex; align-items: stretch;
  background: linear-gradient(180deg, #3168d5 0%, #4993e6 4%, var(--task-2) 8%, var(--task-1) 40%, var(--task-1) 88%, var(--task-3) 100%);
  transform: translateY(100%);
  transition: transform .45s cubic-bezier(.2,.9,.3,1);
}
.taskbar.show { transform: none; }
.start-btn {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 0 22px 0 10px; margin-right: 8px;
  border: 0; border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, #4ca64c 0%, var(--start-2) 10%, var(--start-1) 50%, #2f8a2f 85%, #1d6b1d 100%);
  box-shadow: inset -2px 0 3px rgba(0,0,0,.3), 2px 0 3px rgba(0,0,0,.25);
  color: #fff; font-family: var(--title-font); font-style: italic; font-weight: bold; font-size: 17px;
  text-shadow: 1px 1px 2px rgba(0,0,0,.6);
  cursor: pointer;
}
.start-btn:hover, .start-btn.open { filter: brightness(1.1); }
.start-btn.open { box-shadow: inset 2px 2px 4px rgba(0,0,0,.45); }
.start-btn .logo { width: 20px; height: 20px; filter: drop-shadow(1px 1px 1px rgba(0,0,0,.4)); }
.quick { display: flex; align-items: center; gap: 2px; padding: 0 8px 0 0; border-right: 1px solid rgba(0,0,0,.25); margin-right: 6px; }
.quick button { background: none; border: 0; font-size: 16px; padding: 2px 4px; cursor: pointer; border-radius: 3px; }
.quick button:hover { background: rgba(255,255,255,.2); }
.tasks { flex: 1; display: flex; gap: 3px; align-items: center; overflow: hidden; }
.task {
  height: 24px; width: 160px; min-width: 40px; flex: 0 1 160px;
  display: flex; align-items: center; gap: 5px; padding: 0 8px;
  border-radius: 3px; border: 1px solid rgba(0,0,0,.3);
  background: linear-gradient(#5aa0f8, #3c81f0 30%, #3a7ce8);
  color: #fff; font-size: 11px; cursor: pointer;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.35);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task span:last-child { overflow: hidden; text-overflow: ellipsis; }
.task:hover { background: linear-gradient(#6fb0ff, #4f93fa 30%, #4b8cf3); }
.task.active { background: linear-gradient(#1e52c2, #1a49b8); box-shadow: inset 1px 1px 2px rgba(0,0,0,.5); }
.tray {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 0 12px 0 14px; margin-left: 6px;
  background: linear-gradient(180deg, #0c59b9 0%, var(--tray-2) 8%, var(--tray-1) 50%, #0b77e0 90%, #0a5cbd 100%);
  border-left: 1px solid #0a3d8a;
  box-shadow: inset 1px 0 1px rgba(255,255,255,.3);
  color: #fff; font-size: 11px; position: relative;
}
.tray .t-ico { cursor: pointer; font-size: 13px; }
.tray .clock { min-width: 52px; text-align: center; }
.tray .balloon { position: absolute; right: 8px; bottom: 40px; width: 250px; max-width: none; animation: welcomeIn .3s ease both; }
.tray .balloon::before { left: auto; right: 30px; top: auto; bottom: -11px; border: 10px solid transparent; border-bottom: 0; border-top-color: #000; }
.tray .balloon::after { left: auto; right: 31px; top: auto; bottom: -9px; border: 9px solid transparent; border-bottom: 0; border-top-color: #ffffe1; }

/* ==========================================================
   START MENU
   ========================================================== */
.startmenu {
  position: absolute; left: 0; bottom: 30px; z-index: 5001;
  width: 390px; max-width: 100vw;
  border: 1px solid #0b3ea8; border-radius: 8px 8px 0 0;
  background: #fff; overflow: hidden;
  box-shadow: 3px -2px 10px rgba(0,0,0,.45);
  animation: menuUp .15s ease-out;
}
@keyframes menuUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.sm-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: linear-gradient(180deg, #1868ce, #0e60cb 20%, #0f5cc4 70%, #1a4fb0);
  color: #fff; font-family: var(--title-font); font-weight: bold; font-size: 15px;
  text-shadow: 1px 1px 2px rgba(0,0,0,.5);
  border-bottom: 2px solid #f39c3e;
}
.sm-head .avatar { width: 46px; height: 46px; font-size: 26px; border-width: 2px; }
.sm-cols { display: flex; }
.sm-left { flex: 1; padding: 6px 0; background: #fff; }
.sm-right { flex: 1; padding: 6px 0; background: #d3e5fa; border-left: 1px solid #95bdee; }
.sm-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 4px 10px; background: none; border: 0; text-align: left; cursor: pointer;
}
.sm-item .gly { font-size: 22px; width: 28px; text-align: center; }
.sm-right .sm-item .gly { font-size: 16px; width: 22px; }
.sm-item b { display: block; font-size: 11px; }
.sm-item small { color: #777; font-size: 10px; }
.sm-left .sm-item b { font-size: 12px; }
.sm-right .sm-item { color: #0a246a; font-weight: bold; }
.sm-item:hover { background: var(--select); color: #fff; }
.sm-item:hover small { color: #dde; }
.sm-sep { height: 1px; margin: 4px 10px; background: linear-gradient(90deg, transparent, #b5b5b5, transparent); }
.sm-foot {
  display: flex; justify-content: flex-end; gap: 6px; padding: 6px 10px;
  background: linear-gradient(180deg, #1868ce, #0f5cc4 70%, #1a4fb0);
}
.sm-foot button { display: flex; align-items: center; gap: 6px; background: none; border: 0; color: #fff; cursor: pointer; padding: 4px 6px; border-radius: 3px; }
.sm-foot button:hover { background: rgba(255,255,255,.15); }
.sm-foot .ico { width: 22px; height: 22px; border-radius: 3px; border: 1px solid #fff; display: grid; place-items: center; font-size: 12px; }
.sm-foot .logoff .ico { background: linear-gradient(#f9c34a, #e0901a); }
.sm-foot .off .ico { background: linear-gradient(#ee6a3c, #c4300c); }

/* Context menu */
.ctx {
  position: absolute; z-index: 6000; min-width: 170px;
  background: #fff; border: 1px solid #aca899; padding: 2px;
  box-shadow: 2px 2px 4px rgba(0,0,0,.35);
}
.ctx button { display: block; width: 100%; padding: 4px 20px; border: 0; background: none; text-align: left; cursor: pointer; }
.ctx button:hover { background: var(--select); color: #fff; }
.ctx hr { border: 0; border-top: 1px solid #aca899; margin: 3px 1px; }

/* ==========================================================
   APPS
   ========================================================== */
/* Explorer-style file view */
.explorer { display: flex; height: 100%; }
.ex-side {
  width: 180px; flex: none; padding: 10px;
  background: linear-gradient(#7ba2e7, #6375d6);
  overflow: auto;
}
.ex-panel { background: #d6dff7; border-radius: 4px 4px 0 0; margin-bottom: 10px; overflow: hidden; }
.ex-panel h4 { margin: 0; padding: 5px 8px; font-size: 11px; color: #215dc6; background: linear-gradient(90deg, #fff, #c6d3f7); }
.ex-panel div { padding: 6px 8px; font-size: 11px; line-height: 1.8; color: #215dc6; }
.ex-panel a { cursor: pointer; display: block; }
.ex-panel a:hover { text-decoration: underline; color: #428eff; }
.ex-main { flex: 1; padding: 10px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; overflow: auto; }
.fitem { width: 92px; text-align: center; padding: 4px; border: 1px solid transparent; cursor: default; }
.fitem .gly { font-size: 32px; }
.fitem .lbl { font-size: 11px; word-break: break-word; }
.fitem.sel { background: #c1d2ee; border-color: #316ac5; }
.ex-empty { color: #777; padding: 20px; }

/* Notepad */
.notepad textarea {
  width: 100%; height: 100%; border: 0; resize: none; outline: none;
  font-family: "Lucida Console", "Courier New", monospace; font-size: 13px; padding: 4px;
}

/* Browser */
.browser .addr { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-bottom: 1px solid #cfcbb8; }
.browser .addr .field { flex: 1; }
.browser iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.homepage {
  min-height: 100%; padding: 16px;
  background: #000 repeating-linear-gradient(45deg, #0a0a2a 0 10px, #000 10px 20px);
  color: #0f0; font-family: "Comic Sans MS", "Chalkboard SE", cursive; text-align: center;
}
.homepage h1 { color: #ff0; font-size: 30px; margin: 6px 0; text-shadow: 3px 3px 0 #f0f; }
.homepage .rainbow { background: linear-gradient(90deg, red, orange, yellow, lime, cyan, blue, magenta); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: bold; font-size: 18px; }
.homepage .blink { animation: blink 1s steps(2) infinite; color: #f33; font-weight: bold; }
@keyframes blink { 50% { visibility: hidden; } }
.homepage .marquee { overflow: hidden; white-space: nowrap; background: #00f; color: #fff; padding: 4px; margin: 10px 0; border: 2px ridge #888; }
.homepage .marquee span { display: inline-block; padding-left: 100%; animation: marquee 14s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
.homepage .uc { display: inline-block; background: repeating-linear-gradient(45deg, #fc0 0 12px, #000 12px 24px); padding: 4px; margin: 8px; }
.homepage .uc span { display: block; background: #fc0; color: #000; padding: 6px 12px; font-weight: bold; font-family: Arial, sans-serif; }
.homepage table { margin: 10px auto; border: 3px outset #888; background: #222; color: #fff; }
.homepage td { border: 2px inset #888; padding: 6px 10px; }
.homepage a { color: #0ff; cursor: pointer; text-decoration: underline; }
.homepage a:hover { color: #f0f; }
.counter { display: inline-flex; gap: 2px; background: #000; padding: 3px; border: 2px inset #666; }
.counter span { background: #111; color: #f00; font-family: "Courier New", monospace; font-size: 18px; padding: 0 4px; border: 1px solid #333; }
.guestbook { max-width: 420px; margin: 14px auto; text-align: left; background: #fff; color: #000; border: 3px ridge #c0c0c0; padding: 10px; font-family: "Times New Roman", serif; }
.guestbook h3 { margin: 0 0 6px; color: #800080; }
.guestbook .entry { border-bottom: 1px dashed #999; padding: 4px 0; font-size: 12px; }
.guestbook textarea { width: 100%; height: 50px; margin: 4px 0; font-family: inherit; }

/* Paint */
.paint { display: flex; flex-direction: column; height: 100%; }
.paint-main { flex: 1; display: flex; min-height: 0; }
.paint-tools { width: 54px; flex: none; padding: 4px; display: flex; flex-direction: column; gap: 3px; background: var(--win-face); }
.paint-tools button { height: 24px; border: 1px solid #aaa; background: var(--win-face); cursor: pointer; font-size: 13px; padding: 0; }
.paint-tools button.on { border: 1px inset #888; background: #fff; }
.paint-canvas-wrap { flex: 1; overflow: auto; background: #808080; padding: 4px; }
.paint canvas { background: #fff; display: block; cursor: crosshair; touch-action: none; }
.palette { display: flex; align-items: center; gap: 6px; padding: 4px 6px; background: var(--win-face); border-top: 1px solid #cfcbb8; flex-wrap: wrap; }
.palette .cur { width: 30px; height: 30px; border: 2px inset #888; }
.swatches { display: grid; grid-template-columns: repeat(14, 15px); gap: 1px; }
.swatches span { width: 15px; height: 15px; border: 1px inset #888; cursor: pointer; }

/* Tunes */
.tunes { background: linear-gradient(#2d2d44, #13131f); color: #9fe870; height: 100%; padding: 10px; display: flex; flex-direction: column; gap: 8px; font-family: "Lucida Console", monospace; }
.tunes .lcd { background: #000; border: 2px inset #444; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.tunes .now { white-space: nowrap; overflow: hidden; font-size: 12px; color: #00ff66; }
.tunes .now span { display: inline-block; animation: marquee 9s linear infinite; padding-left: 100%; }
.tunes canvas { width: 100%; height: 60px; display: block; }
.tunes .controls { display: flex; gap: 4px; justify-content: center; }
.tunes .controls button { width: 36px; height: 24px; border: 1px solid #666; background: linear-gradient(#5a5a70, #33334a); color: #ddd; cursor: pointer; border-radius: 2px; }
.tunes .controls button:hover { color: #fff; filter: brightness(1.2); }
.tunes .vol { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.tunes .vol input { flex: 1; accent-color: #9fe870; }
.tunes ol { margin: 0; padding: 4px 4px 4px 28px; background: #000; border: 2px inset #444; flex: 1; overflow: auto; font-size: 12px; }
.tunes li { padding: 2px 4px; cursor: pointer; color: #6c6; }
.tunes li:hover { color: #fff; }
.tunes li.on { color: #fff; background: #0000a0; }

/* Buddy list / IM */
.buddies { padding: 0; height: 100%; display: flex; flex-direction: column; background: #fff; }
.buddies .me { display: flex; align-items: center; gap: 8px; padding: 8px; background: linear-gradient(#fff8d0, #ffe680); border-bottom: 1px solid #d0b040; }
.buddies .me .avatar { width: 36px; height: 36px; font-size: 20px; border-width: 2px; border-color: #fff; }
.buddies .me select { margin-top: 2px; font-size: 11px; }
.buddies h5 { margin: 0; padding: 6px 8px 2px; font-size: 11px; color: #444; }
.buddy { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 16px; cursor: pointer; }
.buddy:hover { background: #e8f0ff; }
.buddy .dot { width: 9px; height: 9px; border-radius: 50%; background: #2bbd2b; box-shadow: inset 0 -1px 2px rgba(0,0,0,.3); }
.buddy .dot.away { background: #f0b020; }
.buddy .dot.off { background: #aaa; }
.buddy small { color: #888; display: block; font-size: 10px; }
.im { display: flex; flex-direction: column; height: 100%; background: var(--win-face); }
.im-log { flex: 1; overflow: auto; background: #fff; margin: 6px; border: 1px solid #7f9db9; padding: 6px; font-size: 13px; line-height: 1.5; font-family: Arial, sans-serif; user-select: text; -webkit-user-select: text; }
.im-log .me { color: #d00; font-weight: bold; }
.im-log .them { color: #00d; font-weight: bold; }
.im-log .sys { color: #888; font-style: italic; font-size: 11px; }
.im-send { display: flex; gap: 6px; padding: 0 6px 6px; }
.im-send textarea { flex: 1; height: 46px; resize: none; border: 1px solid #7f9db9; font-family: Arial, sans-serif; font-size: 13px; padding: 4px; }

/* Snake */
.snake { background: #9bbc0f; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; font-family: "Courier New", monospace; color: #0f380f; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.snake .msg { text-align: center; }
.snake canvas { background: #8bac0f; border: 3px solid #306230; image-rendering: pixelated; max-width: 100%; }
.snake .score { font-weight: bold; font-size: 14px; display: flex; gap: 20px; }
.snake .record { font-weight: bold; font-size: 13px; background: #306230; color: #9bbc0f; padding: 2px 10px; }

/* Paper Plane (reuses the Snake layout) */
.snake.plane { background: #cfe9ff; color: #1b2a4a; }
.snake.plane canvas { background: #7cc8ff; border-color: #1b2a4a; touch-action: none; cursor: pointer; image-rendering: auto; }
.snake.plane .record { background: #1b2a4a; color: #ffe27a; }
.snake.plane .msg { text-align: center; }

/* Control panel */
.cpanel { padding: 12px; background: var(--win-face); height: 100%; overflow: auto; }
.cpanel .preview { width: 200px; height: 140px; margin: 0 auto 12px; border: 10px solid #444; border-bottom-width: 16px; border-radius: 6px; position: relative; overflow: hidden; }
.cpanel .preview > div { position: absolute; inset: 0; }
.cpanel select { width: 100%; height: 120px; }
.cpanel fieldset { border: 1px solid #d0d0bf; border-radius: 4px; margin: 0 0 10px; padding: 8px 10px; }
.cpanel legend { color: #0046d5; padding: 0 4px; }
.cpanel label { display: flex; align-items: center; gap: 6px; margin: 4px 0; }

/* My Computer drives */
.drive { width: 200px; display: flex; gap: 8px; align-items: center; text-align: left; }
.drive .gly { font-size: 30px; }
.drive .bar { height: 10px; background: #e6e6e6; border: 1px solid #999; margin-top: 3px; }
.drive .bar i { display: block; height: 100%; background: linear-gradient(#5ea0ff, #2a64e0); }
.ex-section { width: 100%; font-weight: bold; color: #215dc6; border-bottom: 1px solid #b8c8e8; padding: 4px 0; margin: 6px 0 2px; font-size: 11px; }

/* ==========================================================
   Small screens
   ========================================================== */
@media (max-width: 760px) {
  .login-inner { flex-direction: column; align-items: stretch; gap: 20px; padding: 0 16px; }
  .login-left { flex: none; text-align: center; padding: 0; }
  .login-right { flex: none; margin: 0 auto; }
  .user-pass { flex-wrap: wrap; }
  .brand { align-items: center; }
  .brand-name { font-size: 36px; }
  .login-hint { margin-top: 12px; font-size: 15px; }
  .login-sep { display: none; }
  .login-right { padding: 0; width: 100%; max-width: 360px; }
  .login-bar.top { height: 40px; }
  .login-bar.bottom { height: 64px; padding: 0 16px; }
  .login-foot { display: none; }
  .avatar { width: 50px; height: 50px; font-size: 28px; }
  .user-name { font-size: 17px; }
  .user-pass input { width: 140px; }
  #login .balloon { left: 20px; }
  .startmenu { width: 100vw; }
  .task { width: 40px; flex-basis: 40px; }
  .task span:last-child { display: none; }
  .quick { display: none; }
  .ex-side { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
