/* =========================================================
   Retro desktop OS, early-2000s. The kitten is the operating system.
   Single committed look (no dark/light switch): PCB-blue desktop,
   blue title bars, beige window chrome, green "charge" button.
   ========================================================= */
:root {
  color-scheme: light;

  /* desktop */
  --desk-hi: #2a6fe0;
  --desk-mid: #0d3f9e;
  --desk-lo: #061f57;

  /* window chrome */
  --bar-hi: #3d95ff;
  --bar: #0a5bd6;
  --bar-lo: #0841a8;
  --frame: #0831d9;
  --chrome: #ece9d8;
  --chrome-hi: #f8f7f1;
  --chrome-lo: #c9c4b0;
  --paper: #ffffff;
  --field-edge: #7f9db9;

  /* ink */
  --ink: #1b1b1b;
  --ink-soft: #4a4a44;
  --ink-mute: #807d72;
  --link: #0b3fb0;
  --on-blue: #ffffff;

  /* signals */
  --go-hi: #6fd35f;
  --go: #3a9b30;
  --go-lo: #24711c;
  --close: #e0461c;
  --close-lo: #b12d0b;
  --led-red: #e2382d;
  --led-blue: #4f9bff;
  --select: #316ac5;

  /* boot */
  --boot-bg: #000000;
  --boot-fg: #c9d7ee;
  --boot-dim: #5d6b85;

  /* type */
  --f-display: "Trebuchet MS", "Ubuntu", "Segoe UI", sans-serif;
  --f-ui: Tahoma, Verdana, "Ubuntu", "Segoe UI", sans-serif;
  --f-term: "VT323", "Lucida Console", "Courier New", monospace;

  --col: 950px;
  --taskbar-h: 40px;
}

/* =========================================================
   Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--desk-lo);
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  scroll-padding-bottom: calc(var(--taskbar-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--desk-lo);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 13px;
  line-height: 1.5;
  overflow-x: hidden;
}
body.is-booting { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: var(--link); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
svg { flex-shrink: 0; }

::selection { background: var(--select); color: var(--on-blue); }
:focus-visible { outline: 1px dotted var(--ink); outline-offset: 2px; }

/* =========================================================
   Wallpaper
   ========================================================= */
#wallpaper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 20%, var(--desk-hi), var(--desk-mid) 55%, var(--desk-lo));
}

/* =========================================================
   Boot screen
   ========================================================= */
#boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--boot-bg);
  color: var(--boot-fg);
  padding: 16px;
}
.boot-center {
  align-self: center;
  justify-self: center;
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.boot-kitten {
  width: auto;
  height: 130px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 22px rgba(79, 155, 255, .25));
  animation: bob 1.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-7px); } }
.boot-kitten.is-hop { animation: hop .55s cubic-bezier(.3, 0, .3, 1) both; }
@keyframes hop {
  0%   { transform: translateY(0) scale(1, 1); }
  18%  { transform: translateY(3px) scale(1.06, .92); }
  50%  { transform: translateY(-24px) scale(.96, 1.05); }
  78%  { transform: translateY(0) scale(1.05, .94); }
  100% { transform: translateY(0) scale(1, 1); }
}

.boot-name {
  margin-bottom: 26px;
  font-family: var(--f-display);
  font-weight: 700;
  font-style: italic;
  font-size: 34px;
  line-height: 1;
  color: var(--on-blue);
  text-align: center;
  overflow-wrap: anywhere;
}
.boot-name sup {
  margin-left: 6px;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--led-blue);
  vertical-align: top;
}

.batt-row { width: 100%; display: flex; align-items: center; }
.battery {
  flex: 1;
  padding: 3px;
  border: 2px solid #b9c3d6;
  border-radius: 5px;
  background: #05070c;
  transition: border-color .3s, box-shadow .3s;
}
.battery.is-full { border-color: #e9eef8; box-shadow: 0 0 14px rgba(79, 155, 255, .45); }
.battery-nub { width: 5px; height: 12px; border-radius: 0 2px 2px 0; background: #b9c3d6; }
.cells { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; }
.cell {
  height: 14px;
  border-radius: 1px;
  background: #0f1828;
}
.cell.is-on {
  background: linear-gradient(180deg, #8cc1ff 0%, #2f7bff 45%, #0b45c4 100%);
}
.cell.is-new {
  background: linear-gradient(180deg, #ffffff, #9fd0ff);
  box-shadow: 0 0 8px rgba(143, 195, 255, .9);
  animation: flicker .16s steps(2) infinite;
}
@keyframes flicker { 50% { opacity: .45; } }

.boot-line {
  width: 100%;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-term);
  font-size: 20px;
  line-height: 1;
  letter-spacing: .04em;
}
#status { min-width: 0; }
.caret { animation: blink 1s steps(1) infinite; color: var(--boot-dim); }
@keyframes blink { 50% { opacity: 0; } }
#pct { margin-left: auto; color: var(--on-blue); font-variant-numeric: tabular-nums; }

.led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--led-red);
  box-shadow: 0 0 6px 1px rgba(226, 56, 45, .85);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .5; } }
.led.is-full { background: var(--led-blue); box-shadow: 0 0 8px 2px rgba(79, 155, 255, .8); animation: none; }

.boot-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--boot-dim);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Welcome screen */
#welcome {
  position: fixed;
  inset: 0;
  z-index: 79;
  display: grid;
  grid-template-rows: 14vh 1fr 14vh;
  background: linear-gradient(180deg, #5a7edc 0%, #3c64c8 100%);
}
.welcome-band--top {
  background: #00309c;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, #9cc0ff 30%, #ffffff 50%, #9cc0ff 70%, transparent) 1;
}
.welcome-band--bot {
  background: #00309c;
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, #f59a3b 25%, #ffd08a 50%, #f59a3b 75%, transparent) 1;
}
.welcome-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 16px;
  background: radial-gradient(ellipse 60% 70% at 30% 50%, rgba(255, 255, 255, .22), transparent 70%);
}
.welcome-mid img { width: 62px; height: auto; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.welcome-word {
  font-family: var(--f-display);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(44px, 9vw, 78px);
  line-height: 1;
  color: var(--on-blue);
  text-shadow: 2px 3px 6px rgba(0, 0, 0, .35);
}

/* =========================================================
   Desktop
   ========================================================= */
.desktop { position: relative; z-index: 2; }
body.is-booting .desktop,
body.is-booting .taskbar { visibility: hidden; }

.wrap {
  max-width: calc(var(--col) + 32px);
  margin: 0 auto;
  padding: 28px 16px calc(var(--taskbar-h) + 36px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Desktop shortcuts (wide screens) */
.desk-icons {
  position: fixed;
  top: 24px;
  left: 20px;
  z-index: 1;
  display: none;
  flex-direction: column;
  gap: 18px;
  width: 84px;
}
@media (min-width: 1260px) { .desk-icons { display: flex; } }
.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--on-blue);
  font-size: 12px;
  text-align: center;
}
.desk-icon svg { width: 40px; height: 40px; filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .45)); }
.desk-icon span { padding: 0 3px; text-shadow: 1px 1px 1px #000; }
.desk-icon:hover span,
.desk-icon:focus-visible span { background: var(--select); text-shadow: none; }
.desk-icon:focus-visible { outline: none; }
.desk-icon:focus-visible span { outline: 1px dotted var(--on-blue); }
.desk-icon[aria-disabled="true"] { opacity: .55; cursor: default; }

/* =========================================================
   Window chrome
   ========================================================= */
.win {
  position: relative;
  background: var(--chrome);
  border: 3px solid var(--frame);
  border-top-width: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4), 0 2px 6px rgba(0, 0, 0, .3);
  transition: max-width .25s ease, width .25s ease;
}
.win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 4px 0 7px;
  margin: 0 -3px;
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .35) 0%, rgba(255, 255, 255, 0) 18%),
    linear-gradient(180deg, var(--bar-hi) 0%, var(--bar) 12%, var(--bar) 70%, var(--bar-lo) 100%);
  border: 1px solid var(--bar-lo);
  border-bottom: 0;
  color: var(--on-blue);
  user-select: none;
}
.win-ico { width: 16px; height: 16px; }
.win-title {
  flex: 1;
  min-width: 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 #0a246a;
}
.win-ctrl { display: flex; gap: 2px; }
.wc {
  position: relative;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #ffffff;
  border-radius: 3px;
  background: linear-gradient(180deg, #5a9cff 0%, #2667e8 60%, #1a4fc4 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
  cursor: pointer;
}
.wc:hover { filter: brightness(1.15); }
.wc:active { filter: brightness(.9); }
.wc::before, .wc::after { content: ""; position: absolute; background: #ffffff; }
.wc-min::before { left: 5px; bottom: 5px; width: 7px; height: 3px; }
.wc-max::before { left: 4px; top: 4px; width: 12px; height: 12px; background: transparent; border: 2px solid #ffffff; border-top-width: 3px; }
.wc-close { background: linear-gradient(180deg, #f59a7c 0%, var(--close) 55%, var(--close-lo) 100%); }
.wc-close::before, .wc-close::after { left: 50%; top: 50%; width: 12px; height: 2px; }
.wc-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.wc-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.win-menu {
  display: flex;
  gap: 2px;
  padding: 2px 4px;
  border-bottom: 1px solid var(--chrome-lo);
  font-size: 12px;
  user-select: none;
}
.win-menu span { padding: 1px 7px; }

.win-address {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--chrome-lo);
  font-size: 12px;
  color: var(--ink-mute);
}
.addr {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  color: var(--ink);
}
.addr svg { width: 16px; height: 16px; }
.addr span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.win-body { padding: 14px; }
.win-body--flush { padding: 0; }
.win-body--white {
  background: var(--paper);
  margin: 0;
  border-top: 1px solid var(--chrome-lo);
}

.win-status {
  display: flex;
  gap: 2px;
  padding: 3px 3px 4px;
  font-size: 11px;
  color: var(--ink-soft);
  border-top: 1px solid var(--chrome-hi);
}
.st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border: 1px solid;
  border-color: var(--chrome-lo) var(--chrome-hi) var(--chrome-hi) var(--chrome-lo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st svg { width: 15px; height: 15px; filter: drop-shadow(0 0 1px #000); }
.st--end { margin-left: auto; }

/* window states */
.win.is-min .win-menu,
.win.is-min .win-address,
.win.is-min .win-body,
.win.is-min .win-status { display: none; }
.win.is-min { border-bottom-width: 0; }
.win.is-max {
  width: min(1400px, calc(100vw - 48px));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}
.win.is-shake { animation: shake .36s; }
@keyframes shake {
  20%, 60% { translate: -6px 0; }
  40%, 80% { translate: 6px 0; }
}

/* =========================================================
   Controls
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  min-width: 84px;
  padding: 0 14px;
  font-family: var(--f-ui);
  font-size: 13px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffffff 0%, #f3f2ec 60%, #e2ddd0 92%, #d6d0c1 100%);
  border: 1px solid #003c74;
  border-radius: 3px;
  box-shadow: inset -1px -1px 0 rgba(0, 0, 0, .06);
  cursor: pointer;
  user-select: none;
}
.btn:hover { box-shadow: inset 0 0 0 2px #f8b636, inset 0 -3px 0 1px #e59700; }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #95b8ec, inset 0 -2px 0 1px #6b97e0; }
.btn:active { background: linear-gradient(180deg, #d9d4c6, #ecebe5); box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .2); }
.btn[aria-disabled="true"] {
  color: #a19f97;
  border-color: #c9c7ba;
  background: #f4f3ee;
  box-shadow: none;
  cursor: default;
}

.btn--go {
  color: var(--on-blue);
  font-weight: 700;
  background: linear-gradient(180deg, var(--go-hi) 0%, var(--go) 55%, var(--go-lo) 100%);
  border-color: #1d5a16;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .35);
}
.btn--go:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); filter: brightness(1.06); }
.btn--go:active { background: linear-gradient(180deg, var(--go-lo), var(--go)); }

.field {
  background: var(--paper);
  border: 1px solid var(--field-edge);
  border-radius: 0;
}

.ca { display: flex; flex-direction: column; gap: 4px; }
.ca-label { font-size: 12px; color: var(--ink-soft); }
.ca-row { display: flex; gap: 8px; }
.ca-text {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  font-family: var(--f-term);
  font-size: 20px;
  line-height: 1.1;
  color: var(--ink);
  outline: none;
}
.ca-text:focus { border-color: var(--select); }
.btn-copy { min-width: 96px; }
.btn-copy.is-copied { font-weight: 700; color: var(--go-lo); }

/* =========================================================
   Hero window
   ========================================================= */
.win--hero .win-body { padding: 0; }
.hero-screen {
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 16px;
  border-bottom: 1px solid var(--chrome-lo);
  overflow: hidden;
  /* hero.jpg wins when present; otherwise the kitten on a PCB-blue screen */
  background:
    url("assets/hero.jpg") center / cover no-repeat,
    url("assets/kitten-transparent.png") 50% 98% / auto 54% no-repeat,
    radial-gradient(ellipse 45% 55% at 50% 78%, rgba(143, 195, 255, .45), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 24px 100%,
    linear-gradient(180deg, #1d5fd0 0%, #0b3a94 100%);
}
.hero-screen::after {         /* gentle top shade so the title always reads */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 45%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 20, 70, .45), transparent);
}
.hero-title {
  position: relative;
  z-index: 1;
  font-family: var(--f-display);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(44px, 9vw, 84px);
  line-height: 1;
  color: var(--on-blue);
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 2px 3px 0 #0a246a, 0 6px 24px rgba(0, 0, 0, .45);
}
.hero-ticker {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  padding: 2px 10px;
  font-family: var(--f-term);
  font-size: 22px;
  line-height: 1.1;
  color: var(--on-blue);
  background: rgba(0, 20, 70, .55);
  border: 1px solid rgba(143, 195, 255, .5);
}
.hero-tag {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  font-family: var(--f-ui);
  font-size: 13px;
  letter-spacing: .02em;
  color: #dbe8ff;
  text-shadow: 1px 1px 0 #0a246a;
}
.hero-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* =========================================================
   Ticker
   ========================================================= */
.ticker {
  margin-top: -10px;
  padding: 4px;
  background: var(--chrome);
  border: 1px solid #ffffff;
  border-right-color: #8c8a80;
  border-bottom-color: #8c8a80;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.ticker-field {
  overflow: hidden;
  background: #0a246a;
  border: 1px solid;
  border-color: #8c8a80 #ffffff #ffffff #8c8a80;
  padding: 4px 0;
}
.ticker-track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.ticker-group { display: flex; flex-shrink: 0; }
.ticker-group span {
  padding: 0 20px;
  font-family: var(--f-display);
  font-weight: 700;
  font-style: italic;
  font-size: 16px;
  line-height: 1.3;
  color: var(--on-blue);
  white-space: nowrap;
}
.ticker-group span:nth-child(even) { color: #8fc3ff; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Dialog icon */
.dlg-ico { width: 32px; height: 32px; }

/* =========================================================
   Lore window
   ========================================================= */
.lore {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.lore-pic {
  margin: 0;
  padding: 6px;
  background: var(--paper);
  border: 1px solid;
  border-color: #8c8a80 #ffffff #ffffff #8c8a80;
}
.lore-pic img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.lore-pic figcaption { margin-top: 6px; font-size: 11px; color: var(--ink-mute); text-align: center; }

.lore-text {
  list-style: none;
  margin: 0;
  padding: 14px 16px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--field-edge);
  font-family: var(--f-term);
  font-size: 20px;
  line-height: 1.2;
}
.lore-text h3 { font-weight: 400; font-size: 22px; color: var(--link); }
.lore-text .n { color: var(--ink-mute); margin-right: 6px; }
.lore-text p { max-width: 62ch; padding-left: 34px; color: var(--ink); }

/* =========================================================
   Memes window
   ========================================================= */
.carousel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.car-viewport { overflow: hidden; touch-action: pan-y; cursor: grab; padding: 4px 2px; }
.car-viewport:active { cursor: grabbing; }
.car-track {
  display: flex;
  gap: 12px;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
  will-change: transform;
}
.slide {
  flex: 0 0 calc((100% - 24px) / 3);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.slide-img {
  width: 100%;
  aspect-ratio: 1;
  max-width: 100%;
  padding: 4px;
  background: var(--paper);
  border: 1px solid #c3c1b5;
  box-shadow: 1px 1px 0 #e7e5da;
  overflow: hidden;
}
.slide-img img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.slide figcaption { font-size: 12px; padding: 0 3px; }
.ph {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background:
    linear-gradient(rgba(10, 91, 214, .07) 1px, transparent 1px) 0 0 / 100% 16px,
    linear-gradient(90deg, rgba(10, 91, 214, .07) 1px, transparent 1px) 0 0 / 16px 100%,
    #f1f5fc;
  color: var(--ink-mute);
  font-size: 12px;
}
.ph svg { width: 40px; height: 40px; opacity: .8; }
.ph b { font-family: var(--f-display); font-size: 18px; color: var(--link); }

.car-btn { min-width: 0; width: 32px; height: 48px; padding: 0; }
.car-btn span {
  width: 9px;
  height: 9px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(135deg);
  margin-left: 4px;
}
.car-next span { transform: rotate(-45deg); margin: 0 4px 0 0; }

.car-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.dot {
  width: 11px;
  height: 11px;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--field-edge);
  cursor: pointer;
}
.dot:hover { border-color: var(--select); }
.dot.is-active { background: var(--select); border-color: #1d4a9a; }

/* =========================================================
   Setup wizard
   ========================================================= */
.wizard {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  padding: 0;
}
.wizard-side {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 10px 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(143, 195, 255, .5), transparent),
    linear-gradient(180deg, #2a6fe0 0%, #0b3a94 100%);
  border-right: 1px solid var(--chrome-lo);
}
.wizard-side img { width: 140px; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.wizard-main {
  min-width: 0;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--paper);
}
.wizard-h {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  text-wrap: balance;
}
.wizard-sub { color: var(--ink-soft); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.step-n {
  flex: 0 0 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
  color: var(--on-blue);
  background: radial-gradient(circle at 35% 30%, #8cc1ff, var(--bar) 60%, var(--bar-lo));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.steps h4 { font-size: 13px; }
.steps p { color: var(--ink-soft); }
.wizard-foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #d5d2c4;
}

.desk-note {
  align-self: center;
  max-width: 60ch;
  font-size: 12px;
  color: #cfe0ff;
  text-align: center;
  text-shadow: 1px 1px 1px #000;
}

/* =========================================================
   Taskbar + start menu + tray
   ========================================================= */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  height: calc(var(--taskbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: linear-gradient(180deg, #3f8cf3 0%, #245edb 9%, #1f56d0 50%, #1941a5 100%);
  border-top: 1px solid #0c3fb8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.start-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 22px 0 10px;
  border: 0;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, #6fd35f 0%, #3a9b30 30%, #2f8a25 70%, #24711c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset -2px 0 3px rgba(0, 0, 0, .25), 2px 0 4px rgba(0, 0, 0, .3);
  color: var(--on-blue);
  font-family: var(--f-display);
  font-weight: 700;
  font-style: italic;
  font-size: 19px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, .5);
  cursor: pointer;
}
.start-btn img { width: 18px; height: auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.start-btn:hover { filter: brightness(1.08); }
.start-btn[aria-expanded="true"] { filter: brightness(.88); }

.tasks {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  overflow: hidden;
}
.task {
  flex: 0 1 150px;
  min-width: 0;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 3px;
  background: linear-gradient(180deg, #5b9bf7 0%, #3c81f3 50%, #2f6be0 100%);
  border: 1px solid #1c4fbf;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  color: var(--on-blue);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.task svg { width: 16px; height: 16px; }
.task span { overflow: hidden; text-overflow: ellipsis; }
.task:hover { filter: brightness(1.1); }
.task.is-active {
  background: linear-gradient(180deg, #1c4bb5, #1e52c4);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .45);
}
.task.is-min { opacity: .75; font-style: italic; }

.tray {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 0 8px;
  background: linear-gradient(180deg, #19a1f0 0%, #0f8be0 50%, #0c79c9 100%);
  border-left: 1px solid #0a5aa8;
  box-shadow: inset 1px 0 1px rgba(255, 255, 255, .35);
  color: var(--on-blue);
}
.tray-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.tray-btn svg { width: 18px; height: 18px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.tray-btn[aria-pressed="false"] svg { opacity: .6; }
.clock { padding-left: 4px; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.start-menu {
  position: fixed;
  left: 0;
  bottom: calc(var(--taskbar-h) + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: min(400px, 100vw);
  border: 1px solid var(--frame);
  border-radius: 8px 8px 0 0;
  background: var(--paper);
  box-shadow: 4px -4px 16px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.sm-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #2a6fe0 0%, #1c5ad0 70%, #0f45ad 100%);
  color: var(--on-blue);
  font-family: var(--f-display);
  font-size: 17px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, .4);
}
.sm-head img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  padding: 2px;
  background: #e8f1ff;
  border: 2px solid #ffffff;
  border-radius: 4px;
}
.sm-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-cols {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border-top: 2px solid #f59a3b;
}
.sm-cols ul { list-style: none; margin: 0; padding: 6px 4px; display: flex; flex-direction: column; gap: 1px; }
.sm-right { background: #d3e5fa; border-left: 1px solid #95bdee; }
.sm-cols a, .sm-cols button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.sm-left svg { width: 30px; height: 30px; }
.sm-right svg { width: 22px; height: 22px; }
.sm-left span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sm-left small { color: var(--ink-mute); font-size: 11px; }
.sm-right a, .sm-right button { font-weight: 700; color: #0a246a; }
.sm-cols a:hover, .sm-cols button:hover,
.sm-cols a:focus-visible, .sm-cols button:focus-visible { background: var(--select); color: var(--on-blue); outline: none; }
.sm-cols a:hover small, .sm-cols a:focus-visible small { color: #dbe6fb; }
.sm-cols a[aria-disabled="true"] { opacity: .5; cursor: default; }
.sm-foot {
  display: flex;
  justify-content: flex-end;
  padding: 6px 8px;
  background: linear-gradient(180deg, #2a6fe0, #0f45ad);
}
.sm-restart {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--on-blue);
  font-size: 12px;
  cursor: pointer;
}
.sm-restart svg {
  width: 22px;
  height: 22px;
  padding: 2px;
  border-radius: 3px;
  background: linear-gradient(180deg, #6fd35f, #24711c);
  border: 1px solid #ffffff;
}
.sm-restart:hover { background: rgba(255, 255, 255, .15); }

/* Notification balloon */
.balloon {
  position: fixed;
  right: 10px;
  bottom: calc(var(--taskbar-h) + 12px + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  width: min(280px, calc(100vw - 20px));
  padding: 10px 28px 10px 12px;
  background: #ffffe1;
  color: var(--ink);
  border: 1px solid #000000;
  border-radius: 8px;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, .35);
  font-size: 12px;
  animation: balloon-in .25s ease-out;
}
.balloon::after {
  content: "";
  position: absolute;
  right: 44px;
  bottom: -11px;
  width: 0;
  height: 0;
  border: 11px solid transparent;
  border-top-color: #000000;
  border-bottom: 0;
}
.balloon::before {
  content: "";
  position: absolute;
  right: 45px;
  bottom: -9px;
  z-index: 1;
  border: 10px solid transparent;
  border-top-color: #ffffe1;
  border-bottom: 0;
}
@keyframes balloon-in { from { opacity: 0; transform: translateY(6px); } }
.balloon-h { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 4px; }
.balloon-h svg { width: 16px; height: 16px; }
.balloon-x {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 16px;
  height: 16px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #b9b7a6;
  border-radius: 2px;
  background: #ffffe1;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

/* Dialog */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 10, 40, .25);
}
.dlg { width: min(360px, 100%); }
.dlg-body { display: flex; gap: 14px; align-items: center; padding: 18px 16px 8px; }
.dlg-foot { display: flex; justify-content: center; padding: 10px 0 14px; }

/* =========================================================
   Entrance (after welcome)
   ========================================================= */
.desktop.is-entering .win,
.desktop.is-entering .ticker {
  animation: win-in .45s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--n, 0) * 70ms);
}
@keyframes win-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 760px) {
  .lore { grid-template-columns: minmax(0, 1fr); }
  .lore-pic { width: min(300px, 100%); justify-self: center; }
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .wizard-side { justify-content: center; padding-top: 10px; border-right: 0; border-bottom: 1px solid var(--chrome-lo); }
  .wizard-side img { width: 96px; }
  .hero-screen { min-height: 370px; }
  .win-status .st:not(:first-child):not(.st--end) { display: none; }
}

@media (max-width: 600px) {
  .slide { flex-basis: 100%; }
  .ca-row { flex-direction: column; }
  .btn-copy { width: 100%; min-height: 36px; }
  .btn-row .btn { flex: 1 1 auto; min-width: 0; }
  .task { flex: 0 0 auto; padding: 0 7px; }
  .task span { display: none; }
  .start-btn { padding: 0 16px 0 10px; font-size: 17px; }
  .lore-text p { padding-left: 0; }
  .wizard-foot .btn { flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .win-menu span:nth-child(n+4) { display: none; }
  .clock { display: none; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .ticker-track { animation: none; }
}
