/* ============================================================
   iyoahsOS — desktop shell
   boot · wallpaper · icons · taskbar · start menu · toasts
   ============================================================ */

/* ---------------- boot / lock ---------------- */
.boot,
.lock {
  position: fixed;
  inset: 0;
  z-index: var(--z-boot);
  display: flex;
  flex-direction: column;
  background: #05070d;
  color: #b9ffc8;
  font-family: var(--font-en);
  overflow: hidden;
}

.boot::after,
.lock::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .35) 0 1px, transparent 1px 3px);
  opacity: .5;
}

.boot__inner {
  width: min(780px, 88vw);
  margin: auto;
  padding: 6vh 0;
}

.boot__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  line-height: 2;
  opacity: .7;
  margin-bottom: 26px;
}

.boot__lines {
  min-height: 132px;
  font-size: 10px;
  line-height: 2.1;
}

.boot__line {
  opacity: 0;
  animation: boot-line .01s linear forwards;
  animation-delay: calc(var(--i) * .14s);
  white-space: pre-wrap;
}

.boot__line b {
  color: #ffffff;
  font-weight: 400;
}

@keyframes boot-line {
  to { opacity: 1; }
}

.boot__bar {
  height: 18px;
  margin: 20px 0 8px;
  border: 2px solid #b9ffc8;
  padding: 2px;
}

.boot__fill {
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(90deg, #b9ffc8 0 7px, transparent 7px 10px);
  animation: boot-fill 2.1s steps(21) .2s forwards;
}

.boot__pct {
  font-size: 9px;
  text-align: right;
  opacity: .7;
}

@keyframes boot-fill {
  to { width: 100%; }
}

.boot__logo {
  margin-top: clamp(24px, 5vh, 52px);
  font-family: var(--font-en);
  font-size: clamp(34px, 7.4vw, 78px);
  line-height: 1;
  color: #ffffff;
  letter-spacing: .02em;
  text-shadow: 6px 6px 0 #1058c5, 12px 12px 0 rgba(16, 88, 197, .25);
}

.boot__logo span {
  color: #ffd36b;
  text-shadow: none;
}

.boot__tag {
  margin-top: 16px;
  font-family: var(--font-zh);
  font-size: 14px;
  letter-spacing: .18em;
  color: #8fb8ff;
}

.boot__hint {
  margin-top: 34px;
  font-size: 9px;
  color: #ffffff;
  animation: blink 1.1s steps(1) infinite;
}

.boot.is-done {
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s var(--ease);
}

.lock {
  z-index: var(--z-lock);
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #dfe8ff;
}

.lock__inner {
  width: min(620px, 88vw);
}

.lock__icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 22px;
  color: #8fb8ff;
}

.lock__title {
  font-size: clamp(16px, 3vw, 24px);
  line-height: 1.8;
  text-shadow: 4px 4px 0 #1058c5;
}

.lock__sub {
  margin-top: 14px;
  font-family: var(--font-zh);
  font-size: 13px;
  color: #8a96ad;
}

.lock__btn {
  margin-top: 34px;
  min-height: 44px;
  padding: 10px 22px;
  background: #1058c5;
  color: #fff;
  border: 3px solid #dfe8ff;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .4), inset -2px -2px 0 rgba(0, 0, 0, .4);
  font-family: var(--font-en);
  font-size: 10px;
}

.lock__btn:hover {
  background: #2f7fd8;
}

/* ---------------- wallpaper ---------------- */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: var(--z-wallpaper);
  overflow: hidden;
  background: linear-gradient(180deg, var(--wall-2), var(--wall-1));
}

.wallpaper svg,
.wallpaper__art {
  width: 100%;
  height: 100%;
  display: block;
}

.wallpaper__art {
  object-fit: cover;
  image-rendering: pixelated;
}

.wallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 42%, rgba(4, 14, 26, .22) 100%),
    linear-gradient(180deg, rgba(4, 14, 26, .12), transparent 22%, transparent 72%, rgba(4, 14, 26, .24));
}

.wallpaper .wl-sky,
.wallpaper .wl-far,
.wallpaper .wl-mid,
.wallpaper .wl-near,
.wallpaper .wl-front {
  transform: translate3d(calc(var(--mx, 0) * var(--depth-x, 0px)),
                        calc(var(--my, 0) * var(--depth-y, 0px)), 0);
  transition: transform .35s ease-out;
}

.wallpaper .wl-sky   { --depth-x: 4px;  --depth-y: 2px; }
.wallpaper .wl-far   { --depth-x: -7px; --depth-y: -3px; }
.wallpaper .wl-mid   { --depth-x: -12px; --depth-y: -5px; }
.wallpaper .wl-near  { --depth-x: -18px; --depth-y: -7px; }
.wallpaper .wl-front { --depth-x: -26px; --depth-y: -9px; }

.wallpaper .wl-star {
  animation: twinkle 3.2s steps(2) infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: .18; }
}

.wallpaper .wl-cloud {
  animation: cloud-drift 90s linear infinite;
}

@keyframes cloud-drift {
  0% { transform: translateX(0); }
  50% { transform: translateX(10px); }
  100% { transform: translateX(0); }
}

.wallpaper .wl-sun-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: sun-breathe 8s ease-in-out infinite;
}

@keyframes sun-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

.wallpaper .wl-bird {
  animation: bird-fly 14s linear infinite;
}

@keyframes bird-fly {
  0% { transform: translate(0, 0); }
  50% { transform: translate(8px, -4px); }
  100% { transform: translate(0, 0); }
}

.wallpaper .wl-wave {
  animation: wave-drift 9s ease-in-out infinite alternate;
}

@keyframes wave-drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(9px); }
}

.wallpaper .wl-firefly {
  animation: firefly 4.5s ease-in-out infinite;
}

@keyframes firefly {
  0%, 100% { opacity: .25; transform: translate(0, 0); }
  50% { opacity: 1; transform: translate(2px, -3px); }
}

.wallpaper .wl-tram {
  animation: tram-move 22s ease-in-out infinite alternate;
}

@keyframes tram-move {
  0% { transform: translateX(0); }
  100% { transform: translateX(64px); }
}

.wallpaper .wl-beam {
  animation: beam-pulse 4s ease-in-out infinite;
}

@keyframes beam-pulse {
  0%, 100% { opacity: .08; }
  50% { opacity: .32; }
}

.wallpaper .wl-shooting {
  animation: shooting 7s ease-in infinite;
}

@keyframes shooting {
  0%, 72% { opacity: 0; transform: translate(0, 0); }
  76% { opacity: .85; }
  100% { opacity: 0; transform: translate(-86px, 30px); }
}

/* invisible hotspot over the sun / moon for a small easter egg */
.sun-spot {
  position: fixed;
  z-index: 4;
  width: 76px;
  height: 76px;
  border: 0;
  background: transparent;
  cursor: default;
}

/* ---------------- top bar ---------------- */
.desk-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: var(--px-thin) solid var(--line);
  backdrop-filter: blur(3px);
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: .04em;
}

.desk-topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  white-space: nowrap;
}

.desk-topbar__brand i {
  display: block;
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 3px 0 0 var(--accent-2), 0 3px 0 var(--accent-2), 3px 3px 0 var(--accent-3);
}

.desk-topbar__sys {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink-soft);
  font-family: var(--font-zh);
  font-size: 12px;
}

.desk-topbar__sys .dot {
  width: 6px;
  height: 6px;
  background: var(--ok);
  box-shadow: 0 0 0 2px var(--paper);
  flex: none;
}

.desk-topbar__sys span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-btn {
  height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
  font-family: var(--font-en);
  font-size: 7px;
  letter-spacing: .04em;
  color: var(--ink);
}

.pill-btn:hover {
  background: var(--paper-3);
}

.pill-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------------- brand + note ---------------- */
.desk-brand {
  position: fixed;
  right: 4.5vw;
  top: 11vh;
  z-index: 5;
  text-align: right;
  cursor: pointer;
  user-select: none;
  border: 0;
  background: none;
  color: #fff;
}

.desk-brand__word {
  display: block;
  font-family: var(--font-en);
  font-size: clamp(34px, 6vw, 82px);
  line-height: 1;
  letter-spacing: .01em;
  color: #ffffff;
  text-shadow:
    4px 0 0 var(--line),
    -4px 0 0 var(--line),
    0 4px 0 var(--line),
    0 -4px 0 var(--line),
    8px 8px 0 var(--line),
    12px 12px 0 rgba(0, 0, 0, .18);
}

.desk-brand__word::after {
  content: "_";
  color: var(--sun);
  animation: blink 1.2s steps(1) infinite;
}

.desk-brand__sub {
  display: block;
  margin-top: 16px;
  font-family: var(--font-zh);
  font-size: 13px;
  letter-spacing: .3em;
  color: #fff;
  text-shadow: 2px 2px 0 var(--line), -1px -1px 0 var(--line);
}

.desk-brand:hover .desk-brand__word {
  text-shadow:
    4px 0 0 var(--line),
    -4px 0 0 var(--line),
    0 4px 0 var(--line),
    0 -4px 0 var(--line),
    8px 8px 0 var(--accent);
}

.desk-note {
  position: fixed;
  right: 5vw;
  top: calc(11vh + clamp(120px, 15vw, 190px));
  z-index: 5;
  width: min(300px, 34vw);
  padding: 18px 16px 14px;
  background: var(--note);
  color: var(--note-ink);
  border: 2px solid #6b5410;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .28);
  transform: rotate(-1.4deg);
  font-size: 13px;
  line-height: 1.85;
}

.desk-note::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 84px;
  height: 20px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(0, 0, 0, .18);
  transform: translateX(-50%) rotate(1.5deg);
}

.desk-note__title {
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: .08em;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.desk-note__close {
  width: 22px;
  height: 22px;
  border: 1px solid #6b5410;
  font-family: var(--font-en);
  font-size: 9px;
  line-height: 1;
  background: transparent;
}

.desk-note p + p {
  margin-top: 4px;
}

.desk-note .sig {
  text-align: right;
  font-family: var(--font-en);
  font-size: 9px;
  margin-top: 8px;
}

body.note-hidden .desk-note {
  display: none;
}

/* ---------------- desktop icons ---------------- */
.desk-icons {
  position: fixed;
  left: 12px;
  top: calc(var(--topbar-h) + 16px);
  bottom: calc(var(--taskbar-h) + 16px);
  z-index: var(--z-icons);
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 2px 8px;
}

.desk-icon {
  width: 88px;
  min-height: 82px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: 2px solid transparent;
  background: transparent;
  color: #fff;
  user-select: none;
  cursor: pointer;
  transition: transform 90ms steps(2);
}

.desk-icon__tile {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--icon-bg);
  border: var(--px-thin) solid var(--line);
  box-shadow:
    inset 2px 2px 0 var(--hi),
    inset -2px -2px 0 var(--lo),
    3px 3px 0 rgba(0, 0, 0, .28);
  color: var(--accent);
}

.desk-icon__tile svg {
  width: 30px;
  height: 30px;
}

.desk-icon__label {
  font-family: var(--font-en);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: .02em;
  text-align: center;
  text-shadow:
    2px 0 0 var(--line), -2px 0 0 var(--line),
    0 2px 0 var(--line), 0 -2px 0 var(--line),
    2px 2px 0 var(--line);
}

.desk-icon__zh {
  font-family: var(--font-zh);
  font-size: 11px;
  line-height: 1.2;
  color: #fff;
  opacity: .92;
  text-shadow: 0 1px 0 var(--line), 1px 0 0 var(--line);
  margin-top: -3px;
}

.desk-icon:hover .desk-icon__tile,
.desk-icon:focus-visible .desk-icon__tile {
  transform: translateY(-2px);
  background: var(--accent-3);
}

.desk-icon.is-selected {
  border-color: #fff;
  outline: 2px dashed var(--line);
  outline-offset: -4px;
  background: rgba(255, 255, 255, .12);
}

.desk-icon.is-selected .desk-icon__tile {
  background: var(--accent);
  color: var(--accent-ink);
}

.desk-icon.is-new .desk-icon__tile {
  animation: unlock-pop .5s steps(4) 3;
}

@keyframes unlock-pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ---------------- taskbar ---------------- */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-h);
  z-index: var(--z-taskbar);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--paper);
  border-top: var(--px) solid var(--line);
  box-shadow: 0 -4px 0 rgba(0, 0, 0, .18);
}

.start-btn {
  height: 40px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: .04em;
  flex: none;
}

.start-btn:hover,
.start-btn[aria-expanded="true"] {
  background: var(--accent-2);
}

.start-btn svg {
  width: 16px;
  height: 16px;
}

.tasks {
  flex: 1;
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px;
  scrollbar-width: none;
}

.tasks::-webkit-scrollbar {
  display: none;
}

.task {
  height: 38px;
  min-width: 112px;
  max-width: 205px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
  font-family: var(--font-zh);
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: none;
}

.task svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
  flex: none;
}

.task span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.task:hover {
  background: var(--paper-3);
}

.task.is-active {
  background: var(--paper-3);
  box-shadow: inset 2px 2px 0 var(--lo), inset -2px -2px 0 var(--hi);
  border-color: var(--accent);
}

.task.is-min {
  opacity: .62;
}

.tray {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.tray-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
  font-family: var(--font-en);
  font-size: 7px;
  color: var(--ink);
}

.tray-btn:hover {
  background: var(--paper-3);
}

.tray-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

#tray-theme {
  min-width: 74px;
}

.tray-swatch {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 1px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--hi);
}

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 0 6px 0 4px;
  font-family: var(--font-en);
  font-size: 9px;
  line-height: 1.7;
  color: var(--ink);
  white-space: nowrap;
}

.clock small {
  font-family: var(--font-zh);
  font-size: 10px;
  color: var(--ink-soft);
}

/* ---------------- start menu ---------------- */
.start-menu {
  position: fixed;
  left: 10px;
  bottom: calc(var(--taskbar-h) + 8px);
  z-index: var(--z-menu);
  width: min(640px, calc(100vw - 20px));
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  background: var(--paper);
  border: var(--px) solid var(--line);
  box-shadow: 8px 8px 0 var(--shadow);
  transform-origin: bottom left;
  animation: menu-in .16s steps(3);
}

@keyframes menu-in {
  from { opacity: 0; transform: scaleY(.86) translateY(8px); }
  to { opacity: 1; transform: scaleY(1) translateY(0); }
}

.start-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-bottom: var(--px) solid var(--line);
}

.start-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--paper);
  flex: none;
}

.start-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.start-id {
  min-width: 0;
  flex: 1;
}

.start-id b {
  display: block;
  font-family: var(--font-en);
  font-size: 11px;
  line-height: 1.6;
}

.start-id span {
  display: block;
  font-family: var(--font-zh);
  font-size: 12px;
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.start-progress {
  width: 132px;
  flex: none;
}

.start-progress small {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-en);
  font-size: 7px;
  margin-bottom: 4px;
}

.start-progress__bar {
  height: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .18);
  padding: 1px;
}

.start-progress__fill {
  height: 100%;
  background: var(--sun);
  transition: width .3s var(--ease);
}

.start-apps {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  align-content: start;
}

.start-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 11px 3px 9px;
  border: 2px solid transparent;
  color: var(--ink);
  font-family: var(--font-zh);
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
}

.start-app svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.start-app:hover,
.start-app:focus-visible {
  background: var(--paper-2);
  border-color: var(--line);
}

.start-app small {
  display: block;
  font-family: var(--font-en);
  font-size: 6px;
  color: var(--ink-soft);
  letter-spacing: .04em;
}

.start-side {
  border-left: var(--px-thin) solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: var(--paper-2);
}

.start-side__title {
  font-family: var(--font-en);
  font-size: 7px;
  letter-spacing: .08em;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.start-themes {
  display: flex;
  gap: 6px;
}

.theme-dot {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
  position: relative;
  flex: none;
}

.theme-dot::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 8px;
  height: 8px;
  background: var(--dot-accent);
  border: 1px solid var(--line);
}

.theme-dot[aria-pressed="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.theme-dot[data-locked="true"] {
  filter: grayscale(1) brightness(.6);
}

.start-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
}

.start-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 2px solid transparent;
  font-family: var(--font-zh);
  font-size: 12px;
  color: var(--ink);
  text-align: left;
}

.start-action svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.start-action:hover {
  background: var(--paper);
  border-color: var(--line);
}

.start-quote {
  padding: 9px 10px;
  background: var(--paper);
  border: 2px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
  box-shadow: inset 2px 2px 0 var(--lo);
}

/* ---------------- context menu ---------------- */
.ctx-menu {
  position: fixed;
  z-index: var(--z-menu);
  min-width: 196px;
  padding: 4px;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--shadow);
  animation: pop-in .1s steps(2);
}

.ctx-menu button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 7px 9px;
  color: var(--ink);
  font-family: var(--font-zh);
  font-size: 13px;
  text-align: left;
}

.ctx-menu button:hover,
.ctx-menu button:focus-visible {
  background: var(--accent);
  color: var(--accent-ink);
  outline: 0;
}

.ctx-menu kbd {
  font-family: var(--font-en);
  font-size: 7px;
  opacity: .7;
}

.ctx-menu hr {
  height: 1px;
  margin: 4px 2px;
  border: 0;
  background: var(--line);
  opacity: .3;
}

/* ---------------- toasts ---------------- */
.toasts {
  position: fixed;
  right: 14px;
  bottom: calc(var(--taskbar-h) + 14px);
  z-index: var(--z-toast);
  width: min(340px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-left: 8px solid var(--accent);
  box-shadow: 5px 5px 0 var(--shadow);
  animation: slide-in-right .2s steps(4);
}

.toast__icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--accent-3);
  border: 2px solid var(--line);
  color: var(--accent);
  flex: none;
}

.toast__icon svg {
  width: 18px;
  height: 18px;
}

.toast__body {
  min-width: 0;
}

.toast__body b {
  display: block;
  font-family: var(--font-en);
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: .03em;
}

.toast__body p {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
}

body[data-menu="open"] .toasts {
  opacity: 0;
  pointer-events: none;
}

.toast.is-out {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .25s, transform .25s;
}

.toast--achievement {
  border-left-color: var(--sun);
}

.toast--achievement .toast__icon {
  background: var(--sun);
  color: var(--note-ink);
}

.toast--error {
  border-left-color: var(--err);
}

/* ---------------- CRT + glitch ---------------- */
.crt {
  position: fixed;
  inset: 0;
  z-index: var(--z-crt);
  pointer-events: none;
  display: none;
  background: repeating-linear-gradient(0deg,
      rgba(0, 0, 0, .14) 0 1px,
      transparent 1px 3px);
  mix-blend-mode: multiply;
  opacity: .55;
}

body[data-crt="on"] .crt {
  display: block;
}

.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, .24) 100%);
}

body.is-glitching .wallpaper,
body.is-glitching .taskbar,
body.is-glitching .desk-icons {
  animation: glitch-shift .1s steps(2) 10;
}

@keyframes glitch-shift {
  0% { filter: none; transform: translate(0, 0); }
  25% { filter: hue-rotate(18deg) saturate(1.5); transform: translate(-2px, 1px); }
  50% { filter: invert(.08); transform: translate(2px, -1px); }
  75% { filter: hue-rotate(-12deg); transform: translate(-1px, -2px); }
  100% { filter: none; transform: translate(0, 0); }
}

/* ---------------- noscript ---------------- */
.nojs {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #05070d;
  color: #c8ffd4;
  font-family: var(--font-en);
  font-size: 11px;
  line-height: 2;
  text-align: center;
}

.nojs a {
  color: #ffd36b;
}
/* overlay dialog + small fixes */
.ask-overlay {
  position: fixed;
  inset: 0;
  z-index: 980;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 16, .58);
  backdrop-filter: blur(2px);
}

.ask-box {
  width: min(440px, 100%);
  background: var(--paper);
  border: var(--px) solid var(--line);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 0 18px 18px;
  animation: pop-in .14s steps(3);
}

.ask-box__title {
  margin: 0 -18px 14px;
  padding: 9px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom: var(--px-thin) solid var(--line);
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: .05em;
}

.ask-box__msg {
  font-size: 14px;
  line-height: 1.85;
}

.ask-box__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn--danger {
  background: var(--err);
  color: #fff;
}

.btn--danger:hover {
  filter: brightness(1.1);
}

.win__body:focus {
  outline: none;
}

.room__light {
  transition: opacity .35s var(--ease);
}

.room--dim .room__scene {
  filter: brightness(.55) saturate(.8);
}

.room--dim .room__light {
  opacity: 0;
}

.room__scene {
  transition: filter .35s var(--ease);
}

@media (max-width: 760px) {
  .win__btn[data-act="max"] {
    display: none;
  }

  .ask-box__actions .btn {
    flex: 1;
    min-height: 44px;
  }

  .wallpaper__art {
    filter: brightness(.8) saturate(.9);
  }

  .wallpaper::after {
    background:
      radial-gradient(ellipse at 50% 42%, transparent 30%, rgba(4, 14, 26, .3) 100%),
      linear-gradient(180deg, rgba(4, 14, 26, .36), transparent 24%, transparent 66%, rgba(4, 14, 26, .48));
  }
}

/* Shown by a classic inline script when index.html is opened via file://.
   ES modules and JSON fetches are blocked by the browser there. */
.file-warning {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 70% 10%, rgba(16, 88, 197, .3), transparent 55%),
    #05070d;
  color: #dbeafe;
}

.file-warning[hidden] {
  display: none;
}

.file-warning__box {
  width: min(680px, 100%);
  padding: clamp(22px, 4vw, 36px);
  background: #07120b;
  border: 3px solid #b9ffc8;
  box-shadow: 8px 8px 0 #1058c5;
  font-family: var(--font-zh);
  line-height: 1.9;
}

.file-warning__kicker {
  margin-bottom: 12px;
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: .14em;
  color: #5cff9d;
}

.file-warning h1 {
  margin-bottom: 14px;
  font-family: var(--font-zh);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.45;
  color: #ffffff;
}

.file-warning p {
  margin: 8px 0;
  font-size: 14px;
  color: #b9c8de;
}

.file-warning code {
  padding: 1px 5px;
  border: 1px solid #2d5b3b;
  background: #0f1b14;
  color: #b9ffc8;
  font-family: var(--font-en);
  font-size: 11px;
}

.file-warning pre {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #2d5b3b;
  background: #0b1710;
  color: #b9ffc8;
  font-family: var(--font-en);
  font-size: 11px;
  overflow-x: auto;
}

.file-warning a {
  color: #ffd36b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.file-warning__hint {
  padding-top: 10px;
  border-top: 1px dashed #2d5b3b;
  color: #7f9bb2 !important;
  font-size: 12px !important;
}
