/* ══════════════════════════════════════════════════════════════
   Cateract — Amber CRT aesthetic
   Warm amber palette · Pixelify Sans · pixel-perfect borders
   ══════════════════════════════════════════════════════════════ */

:root {
  --olive:    #2B3D10;   /* dark — text, borders (replaces black) */
  --cream:    #F2E9C2;   /* light surface (replaces white) */
  --amber:    #C09A28;   /* desktop background */
  --amber-lt: #D4B040;   /* menu bar, title bars */
  --amber-dk: #8C6E10;   /* subtle dark accents */
  --orange:   #B07A18;   /* play icon box / active label */
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Pixelify Sans', system-ui, sans-serif;
  font-size: 13px;
  background: var(--olive);
  color: var(--olive);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hidden { display: none !important; }

/* ── Menu Bar ─────────────────────────────────────────────── */

#menu-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 22px;
  background: var(--amber-lt);
  border-bottom: 1.5px solid var(--olive);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 18px;
  font-size: 14px;
  z-index: 200;
  user-select: none;
}

.menu-apple {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--olive);
  border: 1.5px solid var(--olive);
  flex-shrink: 0;
}

.menu-item {
  cursor: default;
  padding: 1px 3px;
}

.menu-item:hover {
  background: var(--olive);
  color: var(--cream);
}

.menu-clock {
  margin-left: auto;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* ── Desktop ────────────────────────────────────────────────── */

#desktop {
  position: fixed;
  top: 22px; left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

/* Solid amber base layer */
#wallpaper-checker {
  position: absolute;
  inset: 0;
  background: var(--amber);
}

/* Paw-print overlay in olive on amber (mask animated by JS) */
#wallpaper-paw {
  position: absolute;
  inset: -20%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Crect width='8' height='8' fill='%23C09A28'/%3E%3Crect x='3' y='3' width='2' height='2' fill='%232B3D10'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='3' y='5' width='2' height='1' fill='%232B3D10'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='5' y='0' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%232B3D10'/%3E%3C/svg%3E");
  background-size: 8px 8px;
}

/* ── Desktop Icons ────────────────────────────────────────── */

.desktop-icon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--olive);
  width: 96px;
  text-align: center;
}

.desktop-icon:focus { outline: none; }

.icon-box {
  width: 64px;
  height: 64px;
  border: 1.5px solid var(--olive);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 var(--olive);
}

.icon-box-white { background: var(--cream); }
.icon-box-black { background: var(--orange); }

.icon-label {
  font-size: 13px;
  background: var(--cream);
  color: var(--olive);
  padding: 1px 4px;
  border: 1px solid var(--olive);
  display: inline-block;
  line-height: 1.3;
}

.icon-label-inv {
  background: var(--orange);
  color: var(--cream);
}

.desktop-icon:active .icon-box,
.desktop-icon.selected .icon-box {
  outline: 1.5px solid var(--olive);
  outline-offset: 3px;
}

/* Icon positions on the desktop */
#icon-meet { top: 60px; left: 60px; }
#icon-play { top: 60px; left: 200px; }
#icon-profile { top: 60px; left: 340px; }

/* ── Ambient Widgets ──────────────────────────────────────── */

.ambient-label {
  margin-top: 4px;
  font-size: 11px;
  background: var(--cream);
  color: var(--olive);
  padding: 0 4px;
  border: 1px solid var(--olive);
  display: inline-block;
}

/* Shelter disk (top-right) */
.ambient-disk {
  position: absolute;
  top: 60px;
  right: 24px;
  width: 64px;
  text-align: center;
}

.disk-body {
  width: 48px;
  height: 56px;
  background: var(--cream);
  border: 1.5px solid var(--olive);
  margin: 0 auto;
  position: relative;
}

.disk-label-slot {
  position: absolute;
  top: 4px; left: 4px; right: 4px;
  height: 18px;
  background: var(--amber-lt);
  border: 1.5px solid var(--olive);
}

.disk-data-area {
  position: absolute;
  bottom: 4px; left: 8px; right: 8px; top: 28px;
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%232B3D10'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%232B3D10'/%3E%3C/svg%3E");
  background-size: 2px 2px;
}

/* About widget (bottom-right) */
.about-widget {
  position: absolute;
  bottom: 16px;
  right: 24px;
  width: 200px;
  background: var(--cream);
  border: 1.5px solid var(--olive);
  box-shadow: 2px 2px 0 var(--olive);
  font-size: 12px;
  color: var(--olive);
}

.about-titlebar {
  background: var(--amber-lt);
  border-bottom: 1.5px solid var(--olive);
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.about-closebox {
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--olive);
  flex-shrink: 0;
}

.about-body {
  padding: 6px;
  line-height: 1.4;
}

/* Help button (bottom-left) — opens the tutorial */
.help-icon {
  position: absolute;
  bottom: 16px;
  left: 24px;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--olive);
  padding: 0;
}

.help-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--olive);
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--olive);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.help-icon:hover .help-circle { background: var(--amber-lt); }
.help-icon:active .help-circle { background: var(--amber-dk); color: var(--cream); }
.help-icon:focus-visible .help-circle { outline: 2px solid var(--olive); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════════
   Mac Window Chrome
   ══════════════════════════════════════════════════════════════ */

.mac-window {
  position: absolute;
  background: var(--cream);
  border: 1.5px solid var(--olive);
  box-shadow: 2px 2px 0 var(--olive);
  display: none;
  z-index: 10;
}

/* Title bar */
.win-titlebar {
  height: 19px;
  border-bottom: 1.5px solid var(--olive);
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 6px;
  background: var(--amber-lt);
  cursor: grab;
  user-select: none;
}

.win-titlebar:active { cursor: grabbing; }

/* Close box */
.win-closebox {
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--olive);
  background: var(--cream);
  flex-shrink: 0;
  cursor: pointer;
}

.win-closebox:hover {
  background: var(--olive);
}

.win-closebox-spacer {
  width: 11px;
  flex-shrink: 0;
}

/* Title area: stripes + title text */
.win-title-area {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
  min-width: 0;
}

.win-stripe {
  flex: 1;
  height: 1px;
  background: var(--olive);
  max-width: 48px;
  min-width: 4px;
}

.win-title-text {
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  padding: 0 8px;
  flex-shrink: 0;
}

/* Vertical scrollbar (right edge) */
.win-vscroll {
  position: absolute;
  top: 19px; right: 0; bottom: 13px;
  width: 13px;
  border-left: 1.5px solid var(--olive);
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%232B3D10'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%232B3D10'/%3E%3C/svg%3E");
  background-size: 2px 2px;
  display: flex;
  flex-direction: column;
}

.vscroll-arrow {
  width: 100%;
  height: 13px;
  background: var(--cream);
  flex-shrink: 0;
}

.vscroll-up  { border-bottom: 1.5px solid var(--olive); }
.vscroll-down { border-top: 1.5px solid var(--olive); }

.vscroll-thumb {
  position: absolute;
  top: 22px; left: 1px; right: 1px;
  height: 36px;
  background: var(--cream);
  border: 1.5px solid var(--olive);
}

/* Horizontal scrollbar (bottom edge) */
.win-hscroll {
  position: absolute;
  bottom: 0; left: 0; right: 13px;
  height: 13px;
  border-top: 1.5px solid var(--olive);
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%232B3D10'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%232B3D10'/%3E%3C/svg%3E");
  background-size: 2px 2px;
  display: flex;
  flex-direction: row;
}

.hscroll-arrow {
  height: 100%;
  width: 13px;
  background: var(--cream);
  flex-shrink: 0;
}

.hscroll-left  { border-right: 1.5px solid var(--olive); }
.hscroll-right { border-left:  1.5px solid var(--olive); }

.hscroll-thumb {
  position: absolute;
  left: 22px; top: 1px; bottom: 1px;
  width: 36px;
  background: var(--cream);
  border: 1.5px solid var(--olive);
}

/* Resize corner (bottom-right) */
.win-resize {
  position: absolute;
  right: 0; bottom: 0;
  width: 13px; height: 13px;
  background: var(--cream);
  border-left: 1.5px solid var(--olive);
  border-top: 1.5px solid var(--olive);
}

.win-resize::after {
  content: '';
  display: block;
  position: absolute;
  inset: 2px;
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%232B3D10'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%232B3D10'/%3E%3C/svg%3E");
  background-size: 2px 2px;
}

/* Window body (inset from titlebar + scrollbars) */
.win-body {
  position: absolute;
  top: 19px; left: 0;
  right: 13px;
  bottom: 13px;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   Play Window  (460 × 310)
   ══════════════════════════════════════════════════════════════ */

#win-play {
  width: 66vw;
  min-width: 600px;
  height: calc(100vh - 60px);
  top: 36px;
  left: 60px;
}

.play-body {
  display: flex;
  gap: 10px;
  padding: 10px;
  height: 100%;
}

/* Left: camera + live status */
.play-left {
  flex: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.camera-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 280px;
  border: 1.5px solid var(--olive);
  background: #1a1a1a;
  overflow: hidden;
}

.video-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-offline {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  background: #111;
}

.live-badge {
  position: absolute;
  top: 5px; left: 5px;
  background: var(--olive);
  color: var(--cream);
  font-size: 11px;
  padding: 1px 6px;
  letter-spacing: 0.05em;
}

.play-meta-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 12px;
}

.play-timer {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.play-timer-label {
  font-size: 11px;
  opacity: 0.8;
}

.play-viewers-row {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.viewers-badge {
  border: 1.5px solid var(--olive);
  padding: 0 5px;
  font-size: 12px;
  line-height: 1.4;
}

/* Right: pattern selector + controls */
.play-right {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-label {
  font-size: 12px;
  margin-bottom: 2px;
}

/* ── Pattern Grid ──────────────────────────────────────────── */

.pattern-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.pattern-btn {
  border: 1.5px solid var(--olive);
  background: var(--cream);
  color: var(--olive);
  font-family: inherit;
  font-size: 12px;
  padding: 5px 4px;
  text-align: center;
  cursor: pointer;
  line-height: 1;
  transition: none;
}

.pattern-btn.active,
.pattern-btn.server-active {
  background: var(--olive);
  color: var(--cream);
  outline: 1.5px solid var(--olive);
  outline-offset: 2px;
}

.pattern-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.pattern-btn:not(:disabled):hover {
  background: var(--amber-lt);
  color: var(--olive);
}

.pattern-btn.active:not(:disabled):hover,
.pattern-btn.server-active:not(:disabled):hover {
  background: var(--amber-dk);
  color: var(--cream);
}

/* ── Pix Buttons ───────────────────────────────────────────── */

.pix-btn {
  display: inline-block;
  padding: 4px 14px;
  border: 1.5px solid var(--olive);
  background: var(--cream);
  color: var(--olive);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: 10px;
  line-height: 1.3;
  text-decoration: none;  /* so <a class="pix-btn"> matches buttons */
}

.pix-btn.pix-primary {
  outline: 1.5px solid var(--olive);
  outline-offset: 3px;
  box-shadow: 0 0 0 1.5px var(--cream) inset;
}

.pix-btn:hover:not(:disabled) { background: var(--amber-lt); color: var(--olive); }
.pix-btn:active:not(:disabled) { background: var(--amber-dk); color: var(--cream); }

.pix-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Servo start/stop row */
.servo-row {
  display: flex;
  gap: 6px;
}

/* Queue section inside play window */
.queue-section {
  border-top: 1px dashed var(--olive);
  padding-top: 5px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-status-text {
  font-size: 11px;
  line-height: 1.3;
}

.queue-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.play-tip {
  font-size: 10px;
  opacity: 0.7;
  line-height: 1.35;
  border-top: 1px dashed var(--olive);
  padding-top: 4px;
  margin-top: auto;
}

/* ══════════════════════════════════════════════════════════════
   Queue Sub-Window  (160 × 120)
   ══════════════════════════════════════════════════════════════ */

#win-queue {
  width: 250px;
  height: 140px;
  top: 280px;
  right: 20px;
  left: auto;
}

/* Queue has no scrollbars — override win-body insets */
#win-queue .win-body {
  right: 0;
  bottom: 0;
}

.queue-body {
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.queue-cats-row {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.queue-headline {
  font-size: 14px;
  font-weight: 600;
}

.queue-subtext {
  font-size: 10px;
  opacity: 0.75;
  line-height: 1.3;
}

/* ══════════════════════════════════════════════════════════════
   Meet the Cats Window  (360 × 280)
   ══════════════════════════════════════════════════════════════ */

#win-meet {
  width: 380px;
  height: 420px;
  top: 60px;
  left: 120px;
}

/* Meet body: no horizontal scrollbar, has vertical scrollbar */
#win-meet .win-body {
  bottom: 36px;
}

.meet-vscroll {
  bottom: 36px !important;
}

.meet-resize {
  bottom: 36px !important;
}

.meet-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.meet-note {
  font-size: 11px;
  opacity: 0.75;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--olive);
}

.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cat-card {
  border: 1.5px solid var(--olive);
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--olive);
  padding: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  font-family: inherit;
  color: var(--olive);
  overflow: hidden;
}

.cat-card:hover { background: var(--amber-lt); }
.cat-card:active { transform: translate(1px, 1px); }
.cat-card:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }

.cat-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-bottom: 1.5px solid var(--olive);
  background: var(--amber-lt);
  image-rendering: auto;   /* override the desktop-wide pixelated rendering */
}

.cat-card-name {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 4px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cat detail overlay */
.cat-detail-body {
  position: static;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.cat-detail-img {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1.5px solid var(--olive);
  box-shadow: 2px 2px 0 var(--olive);
  image-rendering: auto;
  display: block;
}
.cat-detail-caption { font-size: 20px; font-weight: 600; text-align: center; }

.win-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 36px;
  border-top: 1.5px solid var(--olive);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: var(--cream);
}

.meet-footer-hint {
  font-size: 10px;
  opacity: 0.65;
}

/* ══════════════════════════════════════════════════════════════
   Landing overlay — hub entry
   ══════════════════════════════════════════════════════════════ */

#landing-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background-color: var(--amber);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Crect width='8' height='8' fill='%23C09A28'/%3E%3Crect x='3' y='3' width='2' height='2' fill='%232B3D10'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='3' y='5' width='2' height='1' fill='%232B3D10'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='5' y='0' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%232B3D10'/%3E%3C/svg%3E");
  background-size: 8px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 20px;
}

.landing-window {
  position: relative;
  display: block;
  width: 420px;
  max-width: 92vw;
}

.landing-body {
  position: static;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.landing-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-brand {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.landing-tagline {
  font-size: 13px;
  opacity: 0.8;
}

.landing-purpose {
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  border-top: 1px dashed var(--olive);
  border-bottom: 1px dashed var(--olive);
  padding: 10px 2px;
}

.landing-steps {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.landing-step {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}

.landing-step-num {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--olive);
  background: var(--amber-lt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.landing-cta {
  align-self: center;
  margin-top: 4px;
  font-size: 15px;
  padding: 7px 22px;
}

.landing-foot {
  font-size: 10px;
  opacity: 0.65;
}

/* ══════════════════════════════════════════════════════════════
   Chooser overlay — unit selection
   ══════════════════════════════════════════════════════════════ */

#chooser-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background-color: var(--amber);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Crect width='8' height='8' fill='%23C09A28'/%3E%3Crect x='3' y='3' width='2' height='2' fill='%232B3D10'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='3' y='5' width='2' height='1' fill='%232B3D10'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='5' y='0' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='6' y='2' width='1' height='1' fill='%232B3D10'/%3E%3C/svg%3E");
  background-size: 8px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chooser-window {
  position: relative;
  display: block;
  width: 480px;
  max-width: 92vw;
}

.chooser-body {
  position: static;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chooser-cols {
  display: flex;
  gap: 8px;
}

.chooser-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chooser-col-label {
  font-size: 12px;
  font-weight: 600;
}

.chooser-list {
  border: 1.5px solid var(--olive);
  background: var(--cream);
  height: 180px;
  overflow-y: auto;
}

.chooser-item {
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--amber-lt);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.chooser-item:hover { background: var(--amber-lt); }

.chooser-item.selected {
  background: var(--olive);
  color: var(--cream);
}

.chooser-item.offline {
  opacity: 0.5;
  cursor: default;
}

.chooser-item.offline:hover { background: var(--cream); }
.chooser-item.offline.selected { background: var(--olive); }

/* Status dot: online = filled olive, offline = hollow, checking = amber */
.chooser-dot {
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--olive);
  flex-shrink: 0;
}
.chooser-dot.online   { background: var(--olive); }
.chooser-dot.offline  { background: var(--cream); }
.chooser-dot.checking { background: var(--amber-lt); }
.chooser-item.selected .chooser-dot { border-color: var(--cream); }
.chooser-item.selected .chooser-dot.online { background: var(--cream); }

.chooser-empty {
  padding: 8px;
  font-size: 11px;
  opacity: 0.7;
}

.chooser-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed var(--olive);
  padding-top: 8px;
}

.chooser-status {
  font-size: 11px;
  opacity: 0.8;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   Responsive: shrink gracefully on small screens
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  #win-play  { width: 95vw; height: auto; left: 2.5vw; }
  #win-queue { left: 2.5vw; top: auto; bottom: 16px; }
  #win-meet  { width: 95vw; left: 2.5vw; top: 60px; }
  .play-body { flex-direction: column; }
  .camera-wrap { width: 100%; height: auto; aspect-ratio: 4/3; }
  .video-feed { width: 100%; height: 100%; }
  .chooser-window { width: 92vw; }
  .chooser-list { height: 140px; }
  #icon-meet { left: 20px; } #icon-play { left: 128px; } #icon-profile { left: 236px; }
  .acc-window { width: 94vw; }
  #win-profile { width: 94vw !important; left: 3vw !important; }
  #onboard-overlay { padding-top: 132px; }
  .onboard-bg { gap: 10px; }
  .ob-desk-icon { width: 80px; font-size: 12px; }
  .ob-desk-icon .icon-box { width: 52px; height: 52px; }
}

/* ══════════════════════════════════════════════════════════════
   Accounts — onboarding, account dialog, profile, nudge
   ══════════════════════════════════════════════════════════════ */

.acc-overlay {
  position: fixed;
  inset: 0;
  z-index: 520;
  background-color: var(--amber);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Crect width='8' height='8' fill='%23C09A28'/%3E%3Crect x='3' y='3' width='2' height='2' fill='%232B3D10'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='3' y='5' width='2' height='1' fill='%232B3D10'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='3' y='0' width='1' height='1' fill='%232B3D10'/%3E%3Crect x='5' y='0' width='1' height='1' fill='%232B3D10'/%3E%3C/svg%3E");
  background-size: 8px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}

.acc-window { position: relative; display: block; width: 440px; max-width: 94vw; z-index: 1; }

/* Onboarding background: the three real desktop icons, behind the tour window */
#onboard-overlay { align-items: flex-start; padding-top: 168px; }
.onboard-bg {
  position: absolute;
  top: 40px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 40px;
  z-index: 0;
  pointer-events: none;
}
.ob-desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 92px;
  text-align: center;
  color: var(--olive);
}
.ob-desk-icon .icon-box { width: 60px; height: 60px; }
.acc-window-sm { position: relative; display: block; width: 340px; max-width: 92vw; }

.acc-skip {
  margin-left: auto;
  background: none;
  border: none;
  text-decoration: underline;
  font-family: inherit;
  font-size: 12px;
  color: var(--olive);
  cursor: pointer;
  padding-right: 2px;
}

/* Feedback sub-window (opens beside Play, like the Queue window) */
#win-feedback {
  width: 250px;
  height: 132px;
  top: 440px;
  right: 20px;
  left: auto;
}
#win-feedback .win-body { right: 0; bottom: 0; }

.feedback-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.feedback-text { font-size: 11px; line-height: 1.45; }

/* Language toggle (tour + help) */
.ob-lang { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
.ob-lang-btn {
  font-family: inherit;
  font-size: 12px;
  padding: 2px 10px;
  border: 1.5px solid var(--olive);
  background: var(--cream);
  color: var(--olive);
  cursor: pointer;
}
.ob-lang-btn.on { background: var(--olive); color: var(--cream); }

/* Menu-bar language toggle */
.menu-lang { display: flex; gap: 4px; align-items: center; }
.menu-lang-btn {
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 1px 6px;
  border: 1.5px solid var(--olive);
  background: var(--cream);
  color: var(--olive);
  cursor: pointer;
}
.menu-lang-btn.on { background: var(--olive); color: var(--cream); }

/* The zh toggle buttons render their label in a clean CJK face. */
[data-langset="zh"] {
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}

/* Mandarin: swap the whole app to a clean CJK font (Pixelify Sans has no CJK). */
body[data-lang="zh"] {
  font-family: "PingFang TC", "PingFang SC", "Microsoft JhengHei",
               "Microsoft YaHei", "Noto Sans TC", "Noto Sans CJK TC", system-ui, sans-serif;
}

/* Onboarding carousel */
.onboard-body {
  position: static;
  padding: 16px 18px 14px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
}
.onboard-card { display: none; flex-direction: column; gap: 10px; flex: 1; }
.onboard-card.on { display: flex; }
.onboard-card h3 { font-size: 18px; }
.onboard-card p { font-size: 13px; line-height: 1.5; }
.onboard-card ol, .onboard-card ul { font-size: 13px; line-height: 1.6; padding-left: 20px; }
.onboard-sub { font-size: 11px; opacity: 0.72; line-height: 1.4; }
.landing-phone-tip {
  font-size: 12px;
  line-height: 1.4;
  border: 1px dashed var(--olive);
  padding: 6px 10px;
}
.perk { display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 1.4; }
.perk-g { width: 18px; flex-shrink: 0; text-align: center; }
.ob-cta { display: flex; flex-direction: column; gap: 8px; }
.ob-cta .pix-btn, #ob-close .pix-btn { text-align: center; }
.onboard-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--olive);
}
.ob-nav { padding: 4px 12px; }
.ob-dots { display: flex; gap: 6px; margin: 0 auto; }
.ob-dot { width: 8px; height: 8px; border: 1.5px solid var(--olive); background: var(--cream); }
.ob-dot.on { background: var(--olive); }

/* Account dialog */
.acc-body { position: static; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.acc-field label { font-size: 12px; display: block; margin-bottom: 4px; }
.acc-field input[type="text"] {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 5px 8px;
  border: 1.5px solid var(--olive);
  background: var(--cream);
  color: var(--olive);
}
.acc-pins { display: flex; gap: 8px; }
.acc-pins input {
  width: 44px;
  height: 48px;
  text-align: center;
  font-family: inherit;
  font-size: 20px;
  border: 1.5px solid var(--olive);
  background: var(--cream);
  color: var(--olive);
}
.acc-field input:focus-visible, .acc-pins input:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 1px;
}
.acc-error { font-size: 12px; min-height: 15px; color: var(--olive); }
.acc-actions { display: flex; gap: 8px; }
.acc-actions .pix-btn { flex: 1; text-align: center; }
.acc-guestlink {
  background: none;
  border: none;
  text-decoration: underline;
  font-family: inherit;
  font-size: 12px;
  color: var(--olive);
  cursor: pointer;
  opacity: 0.8;
}
.nudge-body {
  position: static;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

/* Profile window */
#win-profile { width: 300px; top: 70px; left: 130px; z-index: 20; }
.profile-body {
  position: static;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pf-head { display: flex; gap: 12px; align-items: center; }
.pf-avatar {
  width: 60px; height: 60px;
  border: 1.5px solid var(--olive);
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--olive);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pf-name { font-size: 20px; line-height: 1.1; }
.pf-level { font-size: 13px; opacity: 0.9; margin-top: 3px; }
.pf-xpwrap { display: flex; flex-direction: column; gap: 4px; }
.pf-xpmeta { font-size: 12px; font-variant-numeric: tabular-nums; }
.pf-xpbar { height: 14px; border: 1.5px solid var(--olive); background: var(--cream); padding: 1.5px; }
.pf-xpfill {
  height: 100%;
  width: 0%;
  background-color: var(--olive);
  background-image: linear-gradient(90deg, var(--olive) 0 3px, var(--amber-dk) 3px 4px);
  background-size: 4px 4px;
  transition: width 0.4s;
}
.pf-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 13px;
  border-top: 1px dashed var(--olive);
  padding-top: 10px;
}
.pf-stat b { display: block; font-size: 17px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pf-stat span { font-size: 11px; opacity: 0.75; }
.pf-stat i { font-style: normal; opacity: 0.8; }
.pf-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--olive);
  padding-top: 8px;
}
.pf-since { font-size: 11px; opacity: 0.7; }

/* Toast */
#acc-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--olive);
  color: var(--cream);
  font-size: 13px;
  padding: 8px 16px;
  border: 1.5px solid var(--olive);
  box-shadow: 2px 2px 0 rgba(43, 61, 16, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 900;
}
#acc-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .pf-xpfill, #acc-toast { transition: none; }
}
