/* Earthtown OS — design tokens & components (exact values from the design handoff) */

:root {
  --void: #070908;
  --surface: rgba(13, 15, 14, 0.94);
  --surface-solid: rgba(13, 15, 14, 0.98);
  --chrome: rgba(7, 9, 8, 0.85);
  --dock: rgba(9, 11, 10, 0.9);
  --popover: rgba(12, 14, 13, 0.97);
  --sidebar: rgba(7, 9, 8, 0.5);
  --ink: #eef3ec;
  --ink-dim: #dbe4da;
  --ink-muted: rgba(238, 243, 236, 0.4);
  --ink-faint: rgba(238, 243, 236, 0.28);
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-soft: rgba(255, 255, 255, 0.06);
  --citrine: #c39a58;
  --citrine-bright: #e9b44c;
  --garnet: #b8564a;
  --amethyst: #8f76bd;
  --signal: #5cd9a3;
  --error: #c96a5c;
  --syne: 'Syne', sans-serif;
  --mono: 'Syne Mono', monospace;
  --ease-win: cubic-bezier(.2, .9, .25, 1);
  --ease-ui: cubic-bezier(.2, .85, .3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--void); color: var(--ink); font-family: var(--mono); height: 100%; overflow: hidden;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* only real, readable/editable text is selectable — UI chrome isn't (also kills swipe/drag highlight jank) */
input, textarea, [contenteditable], .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.selectable { cursor: text; }
a { color: #8fb8f7; text-decoration: none; }
a:hover { color: var(--ink); }
input, textarea, button { font-family: inherit; }
::selection { background: rgba(92, 217, 163, 0.3); color: var(--ink); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(238, 243, 236, .15); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 1px solid rgba(92, 217, 163, 0.6); outline-offset: 1px; }

@keyframes sheetup { from { transform: translateY(28px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes gatein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drift { 0% { transform: translateY(0); opacity: 0; } 10%, 90% { opacity: .8; } 100% { transform: translateY(-110vh); opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- desktop layers ---------- */
#desk { position: fixed; inset: 0; overflow: hidden; background: var(--void); }
.desk-gradient { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(ellipse 130% 110% at 50% 42%, transparent 55%, rgba(2, 3, 3, 0.5) 100%),
  radial-gradient(ellipse 65% 50% at 18% 6%, rgba(124, 86, 220, 0.15), transparent 62%),
  radial-gradient(ellipse 55% 45% at 86% 28%, rgba(64, 110, 220, 0.11), transparent 60%),
  radial-gradient(ellipse 95% 60% at 50% 110%, rgba(24, 150, 96, 0.2), transparent 66%),
  linear-gradient(180deg, #080a0a 0%, #060808 50%, #050707 100%); }
.wall-img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.wall-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.wall-dim { position: absolute; inset: 0; pointer-events: none; }
#spores { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
#spores i { position: absolute; top: 100%; border-radius: 50%; animation: drift linear infinite; }
#scanlines { position: fixed; inset: 0; z-index: 9000; pointer-events: none; opacity: 0.22;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0px, rgba(0, 0, 0, 0.16) 1px, transparent 1px, transparent 4px); }
#vignette { position: fixed; inset: 0; z-index: 9001; pointer-events: none;
  background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.35) 100%); }

/* ---------- menu bar ---------- */
#menubar { position: absolute; top: 0; left: 0; right: 0; height: 30px; display: flex; align-items: center; gap: 2px;
  padding: 0 10px; background: var(--chrome); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255, 255, 255, 0.07); z-index: 5000; }
.menu-wrap { position: relative; }
.menu-btn { font-family: var(--mono); font-size: 13px; letter-spacing: 0.01em; color: rgba(238, 243, 236, 0.7);
  padding: 2px 10px; border-radius: 7px; cursor: pointer; user-select: none; background: transparent; }
.menu-btn.logo { font-family: var(--syne); font-weight: 800; font-size: 13.5px; color: var(--ink); }
.menu-btn.open { background: rgba(238, 243, 236, 0.1); }
.menu-pop { position: absolute; top: 36px; left: 0; min-width: 210px; background: var(--popover); backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 6px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65); z-index: 20; }
.menu-item { font-family: var(--mono); font-size: 13px; letter-spacing: 0.01em; color: var(--ink-dim);
  padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.menu-item:hover { background: rgba(238, 243, 236, 0.08); color: var(--ink); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bar-date { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: rgba(238, 243, 236, 0.5); }
.bar-clock { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.02em; color: var(--ink); }
.glyph { font-family: var(--mono); font-size: 15px; line-height: 1; padding: 2px 5px; cursor: pointer; user-select: none;
  color: rgba(238, 243, 236, 0.5); }
.glyph:hover { color: var(--ink); }
.glyph.on { color: var(--signal); text-shadow: 0 0 10px rgba(92, 217, 163, 0.7); }
.edit-toggle { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; padding: 1px 10px; border-radius: 10px;
  cursor: pointer; user-select: none; color: var(--citrine-bright); background: transparent; border: 1px solid rgba(233, 180, 76, 0.6); }
.edit-toggle.on { color: var(--void); background: var(--citrine-bright); }
.signal-pop { position: fixed; top: 34px; right: 10px; z-index: 8600; background: var(--popover); backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 14px 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65); }

/* mobile menu bar */
@media (max-width: 820px) {
  #menubar { height: auto; flex-direction: column; align-items: stretch; gap: 0; padding: 0; background: rgba(7, 9, 8, 0.88); }
  .bar-row { display: flex; align-items: center; height: 30px; padding: 0 14px; gap: 4px; }
  .bar-row + .bar-row { border-top: 1px solid rgba(238, 243, 236, 0.07); padding: 0 10px; }
}

/* ---------- desktop icons ---------- */
#deskicons { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.dicon { position: absolute; width: 88px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  cursor: grab; touch-action: none; user-select: none; pointer-events: auto; padding: 6px 3px; border-radius: 10px; }
.dicon-glyph { display: flex; align-items: center; justify-content: center; pointer-events: none; border-radius: 11px; }
.dicon-label { font-size: 11.5px; text-align: center; color: var(--ink-dim); pointer-events: none; max-width: 88px;
  border-radius: 4px; padding: 1px 7px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85); word-break: break-word; line-height: 1.3; }
.dicon.sel .dicon-label { background: #3f6497; color: #f2f6fb; text-shadow: none; }

/* ---------- windows ---------- */
.win { position: absolute; border-radius: 12px; }
.win-body { display: flex; flex-direction: column; width: 100%; height: 100%; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 12px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  overflow: hidden; backdrop-filter: blur(22px); }
.win-title { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 14px; background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--hairline-soft); cursor: grab; touch-action: none; flex: none; user-select: none; }
.tl { width: 12px; height: 12px; border-radius: 50%; cursor: pointer; flex: none; opacity: 0.9; transition: opacity 0.15s ease; }
.tl:hover { opacity: 1; }
.tl.close { background: #a8544b; }
.tl.zoom { background: #5b8d78; }
.win-name { font-family: var(--syne); font-weight: 800; font-size: 12.5px; letter-spacing: 0.01em; color: var(--ink); }
.win-meta { margin-left: auto; font-family: var(--mono); font-size: 11px; color: rgba(238, 243, 236, 0.35);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-rs { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; cursor: nwse-resize; }
.sb-btn { font-family: var(--mono); font-size: 12px; line-height: 1; padding: 3px 7px; border-radius: 6px; cursor: pointer;
  user-select: none; flex: none; color: rgba(238, 243, 236, 0.6); background: rgba(238, 243, 236, 0.05);
  border: 1px solid rgba(238, 243, 236, 0.12); transition: color .15s ease, background .15s ease, border-color .15s ease; }
.sb-btn.on { color: var(--ink); background: rgba(238, 243, 236, 0.14); border-color: rgba(238, 243, 236, 0.2); }
/* window content is a container so apps reflow to their OWN width/height, not the viewport's */
.win-content { container-type: size; }
/* sidebar width is class-driven (--sb-w per app) so a container query can override it */
.sb-wrap { flex: none; overflow: hidden; width: 0; opacity: 0;
  transition: width .28s var(--ease-ui), opacity .2s ease; }
.sb-wrap.on { width: var(--sb-w, 168px); opacity: 1; }
/* below ~520px of window width, the sidebar stops splitting the row and becomes an overlay drawer */
@container (max-width: 520px) {
  .sb-wrap.on { position: absolute; top: 0; left: 0; height: 100%; z-index: 6; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
  .sb-wrap.on .sidebar { background: var(--popover); backdrop-filter: blur(20px); }
}
.win-flex { flex: 1; display: flex; min-height: 0; position: relative; }
.win-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* spaces: mode switcher + tiled panes */
.mode-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; flex: none; border-bottom: 1px solid rgba(238, 243, 236, 0.08); }
.mode-chip { font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; padding: 3px 12px; border-radius: 999px;
  cursor: pointer; user-select: none; color: var(--ink-muted); border: 1px solid transparent; transition: color .12s ease, background .12s ease; }
.mode-chip:hover { color: var(--ink); }
.mode-chip.on { color: var(--ink); background: rgba(238, 243, 236, 0.1); border-color: rgba(238, 243, 236, 0.14); }
.pane-area { flex: 1; display: flex; min-height: 0; }
.pane { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.pane + .pane { border-left: 1px solid rgba(238, 243, 236, 0.08); }
.mu-list { flex: 1 1 0; min-height: 0; overflow: auto; }
/* when the window is too short for the full player, the whole music surface scrolls as one */
@container (max-height: 560px) {
  .pane[data-pane="music"] { overflow-y: auto; }
  .pane[data-pane="music"] > * { flex: none; }
  .pane[data-pane="music"] .mu-list { overflow: visible; min-height: auto; }
}

/* account panel + confirm prompt (inside the spaces window) */
.acct-scrim { position: absolute; inset: 0; z-index: 10; background: rgba(4, 6, 5, 0.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 18px; animation: fadein 0.15s ease; }
.acct-card { width: 290px; max-width: 100%; max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 16px;
  background: var(--popover); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px; padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65); }
.acct-card.wide { width: min(720px, 96%); height: min(560px, 96%); padding: 20px 22px; }
.acct-body { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: 1fr; gap: 22px; align-content: start; }
@container (min-width: 620px) { .acct-body { grid-template-columns: 220px 1fr; } }
.arch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.arch-card { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: rgba(238, 243, 236, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); transition: background .12s ease, border-color .12s ease; }
.arch-card:hover { background: rgba(238, 243, 236, 0.08); }
.arch-card.on { border-color: rgba(92, 217, 163, 0.55); background: rgba(92, 217, 163, 0.08); }
.sidebar { flex: none; background: var(--sidebar); border-right: 1px solid rgba(238, 243, 236, 0.08);
  padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; height: 100%; }
.section-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; color: rgba(238, 243, 236, 0.38);
  text-transform: uppercase; }
.step-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(238, 243, 236, 0.38); }

/* ---------- shared controls ---------- */
.btn-prim { font-family: var(--syne); font-weight: 800; font-size: 13px; letter-spacing: 0.01em; background: var(--ink);
  color: var(--void); border: none; border-radius: 9px; padding: 11px 18px; text-align: center; cursor: pointer;
  user-select: none; transition: opacity .15s ease; }
.btn-prim:hover { opacity: 0.86; }
.btn-prim:active { opacity: 0.75; }
.btn-ghost { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em; color: rgba(238, 243, 236, 0.6);
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 9px; padding: 10px 18px;
  text-align: center; cursor: pointer; user-select: none; }
.btn-ghost:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }
.input { width: 100%; min-width: 0; background: rgba(238, 243, 236, 0.06); border: 1px solid rgba(238, 243, 236, 0.16);
  border-radius: 8px; color: var(--ink); padding: 9px 12px; font-family: var(--mono); font-size: 12px; outline: none; }
.input:focus { border-color: rgba(92, 217, 163, 0.5); }
.chip { font-family: var(--mono); font-size: 11px; border-radius: 7px; padding: 2px 8px; cursor: pointer; border: 1px solid; background: transparent; }
.chip.green { color: var(--signal); border-color: rgba(92, 217, 163, 0.4); }
.chip.green:hover { background: rgba(92, 217, 163, 0.12); }
.chip.blue { color: #8fb8f7; border-color: rgba(143, 184, 247, 0.4); }
.chip.blue:hover { background: rgba(143, 184, 247, 0.12); }
.chip.gold { color: var(--citrine-bright); border-color: rgba(233, 180, 76, 0.4); }
.chip.gold:hover { background: rgba(233, 180, 76, 0.12); }

/* ---------- files ---------- */
.side-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--ink-dim); }
.side-row.on { background: rgba(238, 243, 236, 0.08); }
.crumb-head { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.02em; color: rgba(238, 243, 236, 0.42); white-space: nowrap; flex: none; }
.crumb-tail { font-family: var(--syne); font-weight: 800; font-size: 10.5px; letter-spacing: 0.005em; color: rgba(238, 243, 236, 0.93);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ficon { position: absolute; width: 88px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 8px 3px; border-radius: 10px; cursor: grab; touch-action: none; user-select: none; }
.ficon-label { font-size: 11.5px; text-align: center; word-break: break-word; line-height: 1.3; max-width: 86px;
  color: var(--ink-dim); border-radius: 4px; padding: 1px 7px; }
.ficon.sel .ficon-label { background: #3f6497; color: #f2f6fb; }

/* Rubber-band selection box, drawn on the desktop and in the files canvas.
   z-index 3 puts it over the icons (#deskicons is 2) but under any window
   (.win starts at 20), so dragging on the desktop never paints over a window. */
.marquee { position: absolute; z-index: 3; pointer-events: none; border-radius: 2px;
  border: 1px solid rgba(143, 184, 247, 0.85); background: rgba(143, 184, 247, 0.15); }
.back-btn { font-family: var(--mono); font-size: 16px; line-height: 1; padding: 0 8px; border-radius: 7px; user-select: none; }

/* ---------- dock ---------- */
#dock { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); max-width: 96vw; display: flex;
  flex-wrap: wrap; justify-content: center; gap: 14px; align-items: flex-end; padding: 10px 16px 7px;
  background: var(--dock); backdrop-filter: blur(22px); border: 1px solid var(--hairline); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); z-index: 6000; }
.dock-item { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer; user-select: none; flex: none; }
.dock-ico { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; transition: transform 0.16s ease; }
.dock-item:hover .dock-ico { transform: translateY(-7px); }
.dock-tip { position: absolute; bottom: calc(100% + 14px); left: 50%; background: #0c0e0d; border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px; padding: 4px 12px; font-family: var(--syne); font-weight: 800; font-size: 14px; letter-spacing: 0.01em;
  color: var(--ink); white-space: nowrap; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); z-index: 20;
  opacity: 0; transform: translate(-50%, 6px); transition: opacity .12s ease, transform .12s ease; pointer-events: none; }
.dock-item:hover .dock-tip { opacity: 1; transform: translate(-50%, 0); }
.dock-bar { width: 12px; height: 2px; border-radius: 1px; margin-top: 3px; background: transparent; }

/* mobile dock: pill + sheet */
#dock-pill { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 6100; display: none;
  align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 26px; background: rgba(9, 11, 10, 0.92);
  backdrop-filter: blur(22px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); cursor: pointer; user-select: none; touch-action: none;
  transition: padding .18s ease, border-color .18s ease, box-shadow .18s ease; }
#dock-pill.switching { padding: 0 20px; border-color: rgba(92, 217, 163, 0.28); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); }
.pill-switch { display: flex; align-items: center; gap: 9px;
  transition: transform .18s cubic-bezier(.2, .85, .3, 1), opacity .18s ease; }
#sheet-scrim { position: fixed; inset: 0; z-index: 5900; background: rgba(0, 0, 0, 0.4); }
#sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6000; padding: 14px 14px 84px; background: rgba(10, 12, 11, 0.96);
  backdrop-filter: blur(26px); border-top: 1px solid var(--hairline); border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.65); animation: sheetup 0.22s var(--ease-ui); }
.sheet-handle { width: 38px; height: 4px; border-radius: 2px; background: rgba(238, 243, 236, 0.2); margin: 0 auto 14px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 8px; }
.sheet-app { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 6px 2px; border-radius: 14px;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.sheet-app:active { background: rgba(238, 243, 236, 0.07); }
.sheet-tile { width: 60px; height: 60px; border-radius: 17px; background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline); display: flex; align-items: center; justify-content: center; }
@media (max-width: 820px) { #dock { display: none; } #dock-pill { display: flex; } }

/* ---------- entry gate ---------- */
#gate { position: fixed; inset: 0; z-index: 9800; overflow: auto; display: flex; padding: 24px;
  background: rgba(5, 7, 6, 0.86); backdrop-filter: blur(28px); }
.gate-col { width: 330px; max-width: 100%; margin: auto; text-align: center; animation: gatein 0.4s var(--ease-ui); }
.wordmark { font-family: var(--syne); font-weight: 800; letter-spacing: 0.005em; color: var(--ink); line-height: 1; }
.gate-rule { height: 1px; margin: 12px auto;
  background: linear-gradient(90deg, transparent, rgba(195, 154, 88, 0.7), rgba(184, 86, 74, 0.7), rgba(143, 118, 189, 0.7), transparent); }
.gate-card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }
.gate-input { width: 100%; background: rgba(238, 243, 236, 0.05); border: 1px solid rgba(238, 243, 236, 0.14); border-radius: 9px;
  color: var(--ink); padding: 12px 14px; font-family: var(--mono); font-size: 13px; outline: none; text-align: center; letter-spacing: 0.06em; }
.gate-input:focus { border-color: rgba(92, 217, 163, 0.5); background: rgba(238, 243, 236, 0.07); }

/* ---------- spaces ---------- */
.room-row { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.room-row.on { background: rgba(238, 243, 236, 0.08); }
.room-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.char { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center;
  gap: 3px; cursor: grab; touch-action: none; user-select: none; }
.char-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.02em; line-height: 1.2; color: #c9d4cd;
  background: rgba(8, 8, 9, 0.7); border: 1px solid transparent; border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.char.me { z-index: 4; }
.char.me .char-tag { color: var(--ink); }
.char.podded { opacity: 0.6; transform: translate(-50%, -100%) scale(0.9); filter: grayscale(0.5); transition: opacity .3s ease, transform .3s ease, filter .3s ease; }
.status-pill { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  border-radius: 999px; padding: 1px 8px; border: 1px solid rgba(238, 243, 236, 0.16); color: var(--ink-muted); }
.status-pill.in { color: var(--signal); border-color: rgba(92, 217, 163, 0.4); }
.auth-err { font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; color: var(--error); text-align: center; animation: shake .3s ease; }

/* spaces music strip */
.music-strip { display: flex; align-items: center; gap: 9px; padding: 6px 14px; border-top: 1px solid rgba(238, 243, 236, 0.08); flex: none; }
.music-btn { font-family: var(--mono); font-size: 11px; color: rgba(238, 243, 236, 0.6); cursor: pointer; user-select: none; line-height: 1; padding: 3px 6px; border-radius: 6px; }
.music-btn:hover { color: var(--ink); }
.music-btn.play { background: var(--ink); color: var(--void); padding: 3px 12px; border-radius: 7px; font-size: 12px; }
.queue-tab { font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; padding: 5px 10px;
  border-radius: 7px; cursor: pointer; user-select: none; color: var(--ink-muted); }
.queue-tab.on { color: var(--ink); background: rgba(238, 243, 236, 0.1); }
.track-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer; color: #c9d4cd;
  border-bottom: 1px solid rgba(238, 243, 236, 0.04); }
.track-row.on { background: rgba(165, 131, 232, 0.2); color: var(--ink); }

/* ---------- context menu / popovers ---------- */
.ctx { min-width: 170px; background: var(--popover); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px; padding: 5px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65); }
.ctx-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.01em;
  color: var(--ink-dim); padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.ctx-row:hover { background: rgba(238, 243, 236, 0.08); color: var(--ink); }
.ctx-sw { width: 11px; height: 11px; border-radius: 2px; flex: none; border: 1px solid rgba(238, 243, 236, 0.25); }

/* ---------- admin panel ---------- */
#panel { position: fixed; right: 12px; bottom: 80px; width: 262px; z-index: 8500; background: rgba(12, 14, 13, 0.96);
  backdrop-filter: blur(20px); border: 1px solid rgba(233, 180, 76, 0.35); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 7px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7); animation: fadein 0.2s ease; }
.pre-btn { font-family: var(--mono); font-size: 11px; color: rgba(238, 243, 236, 0.6); border: 1px solid rgba(238, 243, 236, 0.2);
  border-radius: 4px; padding: 1px 5px; cursor: pointer; }
.pre-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- toast / about ---------- */
#toast { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); z-index: 9500; background: rgba(15, 18, 16, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px; padding: 10px 22px; backdrop-filter: blur(22px) saturate(150%);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; color: var(--ink);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6); animation: fadein 0.2s ease; white-space: nowrap; }
#about-scrim { position: fixed; inset: 0; z-index: 8800; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; }
/* shared yes/no prompt — the OS never uses a native confirm() */
#confirm-scrim { position: fixed; inset: 0; z-index: 9600; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; }
.confirm-card { width: min(360px, 88vw); background: var(--surface-solid); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px; padding: 20px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7); animation: fadein 0.18s ease; }
.confirm-msg { font-family: var(--syne); font-weight: 800; font-size: 15px; color: var(--ink); line-height: 1.4; }
.confirm-detail { font-family: var(--mono); font-size: 11.5px; color: rgba(238, 243, 236, 0.5); line-height: 1.6; margin-top: 9px; }
.confirm-row { display: flex; gap: 8px; margin-top: 16px; }
.confirm-row > div { flex: 1; font-family: var(--mono); font-size: 12px; border-radius: 8px; padding: 8px 0; cursor: pointer; }
.confirm-no { color: rgba(238, 243, 236, 0.6); border: 1px solid rgba(238, 243, 236, 0.22); }
.confirm-yes { background: #e9b44c; color: #070908; border: 1px solid #e9b44c; }
.about-card { width: 340px; background: var(--surface-solid); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px;
  padding: 34px 32px; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7); text-align: center; animation: fadein 0.2s ease; }

/* ---------- creator ---------- */
.cc-drop { border: 1px dashed rgba(238, 243, 236, 0.22); border-radius: 14px; padding: 46px 20px; text-align: center;
  cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.cc-drop:hover { border-color: rgba(92, 217, 163, 0.55); background: rgba(238, 243, 236, 0.03); }
.cc-stage { position: relative; width: 240px; height: 480px; max-width: 100%; margin: 0 auto; overflow: hidden;
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; touch-action: none; cursor: grab; flex: none; }
.cc-frame { position: absolute; left: 40px; top: 80px; width: 160px; height: 320px; border: 1px solid rgba(92, 217, 163, 0.9);
  box-shadow: 0 0 0 9999px rgba(5, 7, 6, 0.6); pointer-events: none; border-radius: 3px; }
.cc-canvas { width: 150px; height: 300px; flex: none; image-rendering: pixelated; border: 1px solid var(--hairline);
  border-radius: 10px; background-color: rgba(0, 0, 0, 0.35);
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.045) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.045) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px; }
input[type="range"] { accent-color: var(--signal); height: 16px; }
input[type="range"].gold { accent-color: var(--citrine); height: 14px; }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .win { border-radius: 12px; }
  .btn-prim, .btn-ghost, .menu-btn, .chip { min-height: 0; }
}
