/* BLAKCITY — mobile-first UI over canvas */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #0a0a12; font-family: 'Courier New', monospace; color: #e8e8f0; overscroll-behavior: none; }
html:has(#title.show), body:has(#title.show) { height: auto; min-height: 100%; overflow: auto; overscroll-behavior: auto; }
canvas {
  display: block; image-rendering: pixelated;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
#game {
  position: fixed; inset: 0; touch-action: none; z-index: 10;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
#game.renderer-hidden { display: none; }
#game3d {
  position: fixed; inset: 0; width: 100%; height: var(--app-h, 100vh);
  display: block; touch-action: none; image-rendering: auto;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}

/* ── Title / landing (clean v2 — matches the static city pages, light + Inter) ── */
/* z-index sits below the sheet backdrop so consent/intake sheets open over it.
   All rules are scoped to #title so the dark in-game UI is unaffected. */
#title {
  position: relative; min-height: var(--app-h, 100vh);
  z-index: 42; display: none; overflow: visible;
  background: #ffffff; color: #0c0d12;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#title.show { display: flex; flex-direction: column; }
.title-reel, .title-shade { display: none; }   /* clean white landing — no dark gameplay reel */
.title-shell {
  position: relative; width: min(1180px, 100%);
  margin: 0 auto; padding: clamp(22px, 4vw, 48px) clamp(20px, 5vw, 56px) clamp(28px, 4vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.9fr);
  align-items: center; gap: clamp(28px, 4vw, 60px);
}
.title-copy { display: grid; gap: 14px; align-content: center; }
.title-logo { font-size: clamp(34px, 6vw, 58px); font-weight: 800; letter-spacing: -0.03em; color: #0c0d12; text-shadow: none; }
.title-logo span { color: var(--city-accent, #00a6bd); }
.title-tag { color: #6b7280; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; max-width: 660px; line-height: 1.5; font-weight: 600; }
.viral-strip {
  margin: 2px 0 0; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,232,255,0.08), rgba(200,80,160,0.06));
  border: 1px solid rgba(0,232,255,0.22); max-width: 720px;
}
.viral-strip-stats { font-size: 12px; color: #8090a5; line-height: 1.5; }
.viral-strip-events { font-size: 12px; color: #5f6875; margin-top: 7px; line-height: 1.45; }
.viral-strip-events a { color: #00e8ff; font-weight: 700; text-decoration: none; }
.viral-strip-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.title-copy h1 {
  max-width: 660px; color: #0c0d12; font-size: clamp(38px, 5vw, 62px);
  line-height: 0.98; font-weight: 800; letter-spacing: -0.035em; text-shadow: none;
}
.title-sub { color: #6b7280; font-size: clamp(15px, 1.7vw, 19px); max-width: 600px; line-height: 1.6; }
.title-proof { color: #7c8593; font-size: 12.5px; max-width: 600px; line-height: 1.6; margin: 2px 0 0; }
.title-proof b { color: #cbd3de; font-weight: 700; }
#title.title-branded .title-proof { color: rgba(255,255,255,0.72); }
#title.title-branded .title-proof b { color: #fff; }
.title-actions { display: grid; gap: 9px; align-items: stretch; max-width: 440px; }
.title-actions .btn { min-width: 0; width: 100%; }
.title-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#title .btn { border-radius: 12px; font-weight: 700; padding: 14px 22px; border: 1px solid transparent; box-shadow: none; text-transform: none; letter-spacing: 0; font-family: inherit; }
#title .btn-primary { background: #0c0d12; color: #fff; border-color: #0c0d12; }
#title .btn-primary:hover { background: #23262e; box-shadow: 0 8px 24px rgba(0,0,0,0.16); }
#title .btn-ghost { background: #fff; color: #0c0d12; border-color: #e2e4e8; }
#title .btn-ghost:hover { border-color: #c8ccd2; }
.title-cta-build { font-size: 14px !important; padding: 12px 18px !important; opacity: 1; color: #6b7280 !important; }
.title-note { color: #8a93a0; font-size: 12.5px; max-width: 610px; line-height: 1.6; display: grid; gap: 6px; }
.title-note strong { color: #3a414c; font-weight: 700; }
.title-links { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 13px; margin-top: 4px; }
.title-links a { color: #3a414c; text-decoration: none; font-weight: 600; border-bottom: 1px solid transparent; }
.title-links a:hover, .title-links a:focus-visible { color: #0c0d12; border-color: currentColor; }
.title-media {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
  align-self: center; background: #f5f6f8; border-radius: 28px; padding: clamp(14px, 2vw, 22px);
}
.title-media figure {
  position: relative; height: clamp(132px, 17vw, 190px); border: 1px solid #ececef;
  border-radius: 14px; overflow: hidden; background: #fff; margin: 0;
  box-shadow: 0 12px 30px rgba(12,13,18,0.10);
}
.title-media img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: pixelated; }
.title-media figcaption {
  position: absolute; left: 8px; bottom: 8px; padding: 4px 8px; border-radius: 7px;
  background: rgba(255,255,255,0.92); color: #0c0d12; font-size: 11px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
/* ── Landing feature band (crawlable + visible below the hero) ── */
.title-platforms {
  position: relative; z-index: 1; background: #f7f8fa;
  border-top: 1px solid #ececef; padding: clamp(46px, 7vw, 82px) clamp(18px, 5vw, 64px);
}
.title-platforms > h2 {
  color: #0c0d12; font-size: clamp(30px, 4.5vw, 52px); max-width: 780px; margin: 0 auto 34px;
  text-align: center; line-height: 1.04; font-weight: 800; letter-spacing: -0.03em;
}
.platform-surface-grid {
  max-width: 1120px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px;
}
.platform-surface {
  display: grid; grid-template-rows: 190px 1fr; overflow: hidden;
  background: #fff; color: #0c0d12; text-decoration: none;
  border: 1px solid #dfe4ea; border-radius: 10px;
  transition: transform .16s ease, border-color .2s ease, box-shadow .2s ease;
}
.platform-surface:hover {
  transform: translateY(-3px); border-color: #b9c2cf;
  box-shadow: 0 18px 36px rgba(12,13,18,0.10);
}
.platform-surface-img { position: relative; overflow: hidden; background: #111827; }
.platform-surface-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.platform-surface-body { display: grid; align-content: start; gap: 9px; padding: 22px; }
.platform-surface-body span {
  color: #007d8e; font-size: 11px; letter-spacing: .14em;
  font-weight: 800; text-transform: uppercase;
}
.platform-surface-body h3 { color: #0c0d12; font-size: clamp(20px, 2.4vw, 30px); line-height: 1.12; letter-spacing: -0.02em; }
.platform-surface-body p { color: #5f6875; font-size: 14px; line-height: 1.55; }
.platform-surface-body b { color: #0c0d12; font-size: 13px; margin-top: 3px; }
.title-features {
  position: relative; z-index: 1; background: #fff;
  border-top: 1px solid #ececef; padding: clamp(48px, 7vw, 88px) clamp(18px, 5vw, 64px);
}
.title-features > h2 {
  color: #0c0d12; font-size: clamp(26px, 4vw, 44px); max-width: 760px; margin: 0 auto 40px;
  text-align: center; line-height: 1.08; font-weight: 800; letter-spacing: -0.03em;
}
.segment-kicker {
  max-width: 720px; margin: 0 auto 14px; text-align: center; color: #3a414c;
  font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.problem-grid {
  list-style: none; margin: 0 auto 56px; padding: 0; max-width: 1080px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
}
.problem-grid li {
  display: grid; gap: 8px; align-content: start;
  min-height: 170px; padding: 18px;
  border: 1px solid #dfe4ea; border-radius: 8px; background: #f7f8fa;
}
.problem-grid b { color: #0c0d12; font-size: 16px; line-height: 1.25; }
.problem-grid span { color: #5f6875; font-size: 14px; line-height: 1.55; }
.feature-grid {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1080px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.feature-grid li {
  background: #fff; border: 1px solid #ececef; border-radius: 18px; padding: 24px;
  display: grid; gap: 7px; align-content: start;
}
.feature-grid b { color: #0c0d12; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.feature-grid span { color: #6b7280; font-size: 15px; line-height: 1.6; }
.title-features-cta { text-align: center; color: #6b7280; margin: 36px 0 0; font-size: 15px; }
.title-features-cta a { color: #0c0d12; text-decoration: none; font-weight: 700; border-bottom: 1px solid #0c0d12; }
@media (max-width: 820px) {
  #title { overflow-y: auto; }
  .problem-grid { grid-template-columns: 1fr; margin-bottom: 42px; }
  .problem-grid li { min-height: 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .platform-surface-grid { grid-template-columns: 1fr; }
  .platform-surface { grid-column: auto; grid-template-columns: 1fr; grid-template-rows: 220px auto; min-height: 0; }
  .title-features { padding: 40px 18px 56px; }
  .title-shell { min-height: auto; grid-template-columns: 1fr; align-content: start; padding-bottom: 40px; }
  .title-actions-row { grid-template-columns: 1fr; }
  .title-copy h1 { font-size: clamp(34px, 10vw, 46px); letter-spacing: -0.025em; }
  .title-media { order: -1; }
  .title-media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .title-media figure { height: 120px; }
}
@media (max-width: 430px) {
  .title-media { grid-template-columns: 1fr; }
  .title-media figure { height: 150px; }
}

/* ── Buttons ── */
.btn {
  display: inline-block; border: 0; cursor: pointer; font-family: inherit; font-weight: 700;
  font-size: 15px; padding: 13px 22px; border-radius: 12px; text-decoration: none; text-align: center;
  transition: transform 0.08s, filter 0.15s; user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: linear-gradient(180deg, #00e8ff, #00a8d8); color: #06121a; box-shadow: 0 4px 0 #006888, 0 6px 16px rgba(0,232,255,0.25); }
.btn-ghost { background: #1d1d2c; color: #c8c8d4; border: 1px solid #33334a; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.row-btns { display: flex; gap: 10px; margin-top: 14px; }
.row-btns .btn { flex: 1; }

.radio-now {
  display: grid; gap: 4px; padding: 12px; margin: 10px 0;
  border: 1px solid #2a2a3e; border-radius: 8px; background: #10101a;
}
.radio-now b { color: #00e8ff; }
.radio-now span { color: #9da9b5; font-size: 12px; }
.radio-stations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.media-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.media-upload-grid input { width: 100%; margin-top: 6px; }
.media-list { display: grid; gap: 8px; margin: 8px 0 12px; }
.media-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
  border: 1px solid #2a2a3e; border-radius: 8px; background: #10101a; padding: 9px;
}
.media-row b, .media-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-row span { color: #9da9b5; font-size: 11px; margin-top: 2px; }
.media-actions { display: flex; gap: 6px; }
.station-card {
  border: 1px solid #2a2a3e; border-radius: 8px; background: #10101a; padding: 10px; margin: 8px 0;
}
.media-checks { display: grid; gap: 6px; margin-top: 8px; }
@media (max-width: 520px) {
  .radio-stations, .media-upload-grid { grid-template-columns: 1fr; }
  .media-row { grid-template-columns: 1fr; }
  .media-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

/* ── HUD ── */
#hud { position: fixed; top: 0; left: 0; right: 0; height: var(--app-h, 100vh); pointer-events: none; z-index: 20; display: none; }
#hud.show { display: block; }
.hud-top {
  position: absolute; top: env(safe-area-inset-top, 0); left: 0; right: 0;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px;
}
.hud-pill {
  background: rgba(10,10,20,0.78); border: 1px solid #2a2a3e; border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 5px;
  backdrop-filter: blur(6px); white-space: nowrap;
}
#hud-gems-pill { cursor: pointer; }
#hud-name { color: #00e8ff; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#net-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a6b7a; }
#net-dot.online { background: #3fc380; box-shadow: 0 0 8px #3fc380; }
#multiplayer-dot { width: 8px; height: 8px; border-radius: 50%; background: #d4a03a; }
.multiplayer-pill.live #multiplayer-dot { background: #3fc380; box-shadow: 0 0 8px #3fc380; }
.multiplayer-pill.offline #multiplayer-dot { background: #d4453a; }
#multiplayer-status { color: #c8c8d4; }
.multiplayer-pill { position: relative; cursor: pointer; user-select: none; }
.multiplayer-pill:focus-visible { outline: 2px solid #00e8ff; outline-offset: 2px; }

#spatial-av-launcher {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 42;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 1px solid #2a2a3e;
  background: rgba(16,16,28,0.9);
  color: #e8e8f0;
  font-size: 24px;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}
#spatial-av-launcher:active { transform: translateX(-50%) scale(0.94); }
#spatial-av-launcher.active-voice { border-color: #00e8ff; box-shadow: 0 0 18px rgba(0,232,255,0.38); }
#spatial-av-launcher.active-video { border-color: #ff4f9a; box-shadow: 0 0 18px rgba(255,79,154,0.38); }
/* display:flex above defeats the [hidden] attribute — keep launcher off landing/auth overlays */
#spatial-av-launcher[hidden] { display: none !important; pointer-events: none; }
body:has(#title.show) #spatial-av-launcher { display: none !important; pointer-events: none; }
.spatial-av-live {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(12,12,22,0.55);
}
.spatial-av-live-count { color: #9ad0e8; font: 700 11px/1.4 monospace; }
#spatial-video-cam.muted, #spatial-video-mute.muted { background: #7a3058; }
#spatial-count { padding: 0 7px 0 2px; color: #9ad0e8; font: 700 11px/1 monospace; white-space: nowrap; }
#spatial-video-panel {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  top: calc(env(safe-area-inset-top, 0px) + 58px);
  z-index: 41;
  width: min(220px, 44vw);
  border: 1px solid rgba(255,79,154,0.28);
  border-radius: 12px;
  background: rgba(8, 8, 16, 0.9);
  box-shadow: 0 10px 28px rgba(0,0,0,.38);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.spatial-video-panel-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.spatial-video-panel-toggle {
  flex: 1;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  color: #f2d9e8;
  background: rgba(255,79,154,0.12);
  font: 700 11px/1 'Courier New', monospace;
  cursor: pointer;
  text-align: left;
}
.spatial-video-panel-chevron { color: #ff4f9a; width: 10px; }
.spatial-video-panel-title { flex: 1; }
.spatial-video-panel-count { color: #f0a8cc; font-size: 10px; }
.spatial-video-panel-tools {
  display: flex;
  gap: 4px;
}
.spatial-video-panel-tools button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  color: #f2d9e8;
  background: rgba(255,79,154,0.14);
  font: 700 10px/1 'Courier New', monospace;
  cursor: pointer;
}
.spatial-video-panel-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  max-height: min(42vh, 320px);
  overflow: auto;
}
.spatial-video-panel.collapsed .spatial-video-panel-body { display: none; }
.spatial-video-local-wrap, .spatial-video-peer-wrap {
  position: relative; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.14); background: #05050a;
}
.spatial-video-local, .spatial-video-peer { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #111; }
.spatial-video-label {
  position: absolute; left: 6px; bottom: 5px; padding: 2px 6px; border-radius: 4px;
  background: rgba(0,0,0,0.62); color: #fff; font: 700 10px/1.2 'Courier New', monospace;
}
.spatial-video-panel-body.cam-off .spatial-video-local { opacity: 0.35; filter: grayscale(1); }
.spatial-video-peer-grid { display: grid; gap: 8px; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
/* The Suite Spot — one always-on lounge comms panel (stage + your A/V + chat). */
.suite-lounge {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 66px);
  z-index: 44;
  width: min(340px, calc(100vw - 24px));
  color: #f4ecdd;
  pointer-events: auto;
  border: 1px solid rgba(214, 168, 79, 0.4);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(30, 18, 26, 0.96), rgba(16, 10, 16, 0.96));
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  overflow: hidden;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.sl-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid rgba(214,168,79,0.22); cursor: default; }
.sl-dot { width: 8px; height: 8px; border-radius: 50%; background: #d6a84f; box-shadow: 0 0 8px #d6a84f; flex: 0 0 auto; }
.sl-title { font-family: Georgia, serif; font-size: 14px; letter-spacing: .02em; color: #f0d9a8; }
.sl-count { margin-left: auto; font-size: 11px; color: #b7a998; }
.sl-collapse { background: none; border: 0; color: #cbb98f; font-size: 15px; cursor: pointer; padding: 2px 4px; line-height: 1; }
.suite-lounge.collapsed .sl-body { display: none; }
.suite-lounge.collapsed .sl-head { border-bottom: 0; }
.sl-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; }

.sl-stage {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px;
  min-height: 96px; align-content: start;
  background: radial-gradient(120% 80% at 50% 0%, rgba(214,168,79,0.14), transparent 62%), rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; padding: 8px;
}
.sl-stage-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 88px; text-align: center; color: #b7a998; }
.sl-stage-empty span { font-size: 26px; }
.sl-stage-empty p { font-size: 11px; line-height: 1.5; }
.sl-tile { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #14101a; border: 1px solid rgba(255,255,255,0.08); }
.sl-tile-vid { width: 100%; height: 100%; object-fit: cover; display: block; background: #0c0910; }
.sl-tile.cam-off .sl-tile-vid { visibility: hidden; }
.sl-tile.cam-off::before { content: '🎙️'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; opacity: .5; }
.sl-tile-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; font-size: 10px; color: #f4ecdd; background: linear-gradient(to top, rgba(0,0,0,0.78), transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-tile.speaking { grid-column: 1 / -1; aspect-ratio: 16/10; border-color: #d6a84f; box-shadow: 0 0 0 1px #d6a84f, 0 0 18px rgba(214,168,79,0.4); }
.sl-tile.speaking::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--sl-level, 0%); background: linear-gradient(90deg, #6fe3a0, #d6a84f, #ff6f9c); transition: width 90ms linear; }

.sl-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.sl-btn {
  flex: 1 1 auto; min-height: 34px; min-width: 84px;
  border: 1px solid rgba(214,168,79,0.34); border-radius: 9px; padding: 0 10px;
  background: rgba(214,168,79,0.1); color: #f4e2b8; font: 600 12px/1 inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.sl-btn:hover { background: rgba(214,168,79,0.2); }
.sl-btn.sl-primary { background: #d6a84f; color: #1a1206; border-color: #d6a84f; }
.sl-btn.on { background: rgba(111,227,160,0.16); border-color: rgba(111,227,160,0.5); color: #b8f0cf; }
.sl-btn.off { background: rgba(255,111,156,0.14); border-color: rgba(255,111,156,0.5); color: #ffc0d3; }
.sl-btn.sl-danger { background: rgba(255,111,156,0.16); border-color: rgba(255,111,156,0.5); color: #ffc0d3; }
.sl-btn.sl-quiet { flex: 0 0 auto; min-width: 0; background: none; border-color: rgba(255,255,255,0.14); color: #b7a998; font-size: 11px; }
.sl-btn:focus-visible { outline: 2px solid #f6ce78; outline-offset: 2px; }

.sl-chat { display: flex; flex-direction: column; gap: 6px; }
.sl-chat-log { max-height: 108px; overflow: auto; display: flex; flex-direction: column; gap: 5px; }
.sl-msg { display: flex; gap: 6px; align-items: baseline; font-size: 12px; }
.sl-msg b { color: #f0d9a8; flex: 0 0 auto; }
.sl-msg.me b { color: #8fd0e8; }
.sl-msg span { color: #d8cdbb; overflow-wrap: anywhere; }
.sl-chat-empty { color: #8f8478; font-size: 12px; }
.sl-chat-form { display: flex; gap: 6px; }
.sl-chat-form input { flex: 1; min-width: 0; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.14); background: rgba(0,0,0,0.3); color: #f4ecdd; padding: 0 10px; font: inherit; font-size: 13px; }
.sl-chat-form input:focus-visible { outline: 2px solid #f6ce78; outline-offset: 1px; }
.sl-chat-form button { flex: 0 0 auto; width: 40px; height: 34px; border-radius: 9px; border: 0; background: #d6a84f; color: #1a1206; font-size: 15px; cursor: pointer; }
@media (max-width: 640px) {
  .suite-lounge { left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); width: auto; }
}
.poetry-chat input {
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 7px;
  padding: 0 9px;
  color: #f5edf3;
  background: rgba(0,0,0,0.28);
  font: 700 11px/1 'Courier New', monospace;
}
@media (max-width: 560px) {
  #fishing-ui { bottom: calc(var(--mobile-bottom-band, 148px) + 56px); }
  #spatial-video-panel { width: min(168px, 40vw); top: calc(env(safe-area-inset-top, 0px) + 52px); }
  .poetry-mic-hud { bottom: calc(var(--mobile-bottom-band, 148px) + 48px); }
  .poetry-mic-copy { align-items: flex-start; flex-direction: column; gap: 2px; }
  .poetry-mic-copy span { text-align: left; }
}
#live-roster-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 120;
  width: min(290px, calc(100vw - 24px)); max-height: min(360px, 60vh); overflow: auto;
  padding: 7px; border: 1px solid #34344b; border-radius: 13px;
  background: rgba(12,12,22,.98); box-shadow: 0 14px 38px rgba(0,0,0,.5);
  color: #e8e8f0; font-weight: 500; white-space: normal;
}
.live-roster-head, .live-roster-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.live-roster-head { padding: 6px 7px 9px; border-bottom: 1px solid #29293b; }
.live-roster-head span, .live-roster-here, .live-roster-person small { color: #9292a6; font-size: 11px; }
.live-roster-row { min-height: 42px; padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,.055); }
.live-roster-row:last-child { border-bottom: 0; }
.live-roster-person { min-width: 0; display: flex; align-items: center; gap: 7px; }
.live-roster-person > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-roster-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #3fc380; box-shadow: 0 0 7px rgba(63,195,128,.65); }
.live-roster-row button {
  flex: 0 0 auto; width: 34px; min-height: 30px; padding: 3px;
  border: 1px solid #365247; border-radius: 9px; background: #17251f; color: #dff8e8; cursor: pointer;
}
.live-roster-row button:disabled { opacity: .35; cursor: default; }
.live-roster-row.self { color: #00e8ff; }
.live-roster-empty { padding: 13px 8px; color: #9292a6; font-size: 12px; line-height: 1.4; }
.store-menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 12px 0; }
.store-menu-item {
  display: flex; align-items: center; gap: 9px; min-height: 72px; padding: 8px;
  border: 1px solid #343448; border-radius: 10px; background: #151522; color: #e8e8f0;
  text-align: left; cursor: pointer;
}
.store-menu-item img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #0a0a12; }
.store-menu-item span:not(.store-menu-icon) { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.store-menu-item small { color: #9999aa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-menu-icon { width: 56px; text-align: center; font-size: 30px; }
.product-hero { display: block; width: 100%; max-height: 280px; object-fit: contain; border-radius: 10px; background: #0a0a12; margin: 8px 0; }
.product-audio { width: 100%; margin: 8px 0 12px; }
.owner-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.owner-suite-list { margin: 10px 0 14px; padding-left: 18px; color: #b8b8c8; line-height: 1.5; }
.owner-suite-list li { margin: 6px 0; }
.owner-rank-list { margin: 6px 0 12px; padding-left: 20px; color: #b8b8c8; }
.owner-rank-list li b { float: right; color: #00e8ff; }
.invite-qr-wrap { display: flex; justify-content: center; margin: 12px 0; }
.invite-qr { width: min(280px, 72vw); height: auto; border-radius: 12px; background: #fff; padding: 10px; }
.invite-url { word-break: break-all; font-size: 12px; text-align: center; }
.ph-command-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.ph-crest-chip, .ph-crest-large {
  display: grid; place-items: center; font-weight: 900; font-family: 'Courier New', monospace;
  color: #e8f4ff; background: linear-gradient(180deg, color-mix(in srgb, var(--ph-accent, #00e8ff) 35%, #10101a), #10101a);
  border: 2px solid var(--ph-accent, #00e8ff); clip-path: polygon(50% 0%, 92% 18%, 92% 72%, 50% 100%, 8% 72%, 8% 18%);
}
.ph-crest-chip { width: 52px; height: 58px; font-size: 18px; flex-shrink: 0; }
.ph-crest-large { width: 88px; height: 98px; font-size: 30px; margin: 0 auto 12px; }
.ph-motto { font-style: italic; margin: 0 0 10px; }
.ph-trophy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0 14px; }
.ph-trophy {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  background: #14141f; border: 1px solid #2a2a3e; font-size: 12px;
}
.ph-trophy span { font-size: 20px; }
.ph-trophy b { color: #b8b8c8; font-weight: 600; }
.ph-trophy.earned { border-color: color-mix(in srgb, var(--ph-accent, #00e8ff) 55%, #2a2a3e); background: #121820; }
.ph-trophy.earned b { color: #e8f0ff; }
.ph-trophy.locked { opacity: 0.45; filter: grayscale(0.6); }
.ph-celebrate { text-align: center; }
.penthouse-skyline {
  position: relative; height: 120px; margin: 12px 0 14px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #0a1020 0%, #142238 55%, #1a2840 100%);
  border: 1px solid #2a2a3e;
}
.penthouse-skyline-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--ph-accent, #00e8ff) 45%, transparent) 0%, transparent 68%);
  opacity: 0.75;
}
.penthouse-skyline-city {
  position: absolute; left: 8%; right: 8%; bottom: 18px; height: 52px;
  background:
    linear-gradient(var(--ph-accent, #00e8ff) 0 0) 4% 100% / 8% 62% no-repeat,
    linear-gradient(var(--ph-accent, #00e8ff) 0 0) 16% 100% / 10% 78% no-repeat,
    linear-gradient(var(--ph-accent, #00e8ff) 0 0) 30% 100% / 7% 48% no-repeat,
    linear-gradient(var(--ph-accent, #00e8ff) 0 0) 44% 100% / 12% 88% no-repeat,
    linear-gradient(var(--ph-accent, #00e8ff) 0 0) 60% 100% / 9% 56% no-repeat,
    linear-gradient(var(--ph-accent, #00e8ff) 0 0) 74% 100% / 11% 72% no-repeat,
    linear-gradient(var(--ph-accent, #00e8ff) 0 0) 88% 100% / 8% 44% no-repeat;
  opacity: 0.55;
  filter: blur(0.2px);
}
.owner-ranks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.owner-ranks ol { margin: 4px 0; padding-left: 20px; color: #b8b8c8; }
.owner-ranks li { margin: 4px 0; }
.owner-ranks li b { float: right; color: #00e8ff; }
.owner-product-card { border: 1px solid #343448; border-radius: 10px; padding: 10px; margin: 9px 0; background: #12121d; }
.owner-product-card label { display: grid; gap: 4px; margin-bottom: 7px; color: #aaaabb; font-size: 12px; }
.owner-product-card input, .owner-product-card textarea { width: 100%; }
.hud-right {
  display: none; position: absolute; right: 10px; bottom: calc(82px + env(safe-area-inset-bottom, 0));
  flex-direction: column; gap: 10px; padding: 8px; border: 1px solid #2a2a3e; border-radius: 18px;
  background: rgba(12,12,22,0.72); backdrop-filter: blur(8px);
  max-height: min(68vh, 440px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; touch-action: pan-y; pointer-events: auto;
}
#hud.menu-open .hud-right { display: flex; }
.hud-menu-toggle {
  display: flex; align-items: center; justify-content: center; pointer-events: auto;
  position: absolute; right: 12px; bottom: calc(18px + env(safe-area-inset-bottom, 0));
  width: 54px; height: 54px; border-radius: 16px; border: 1px solid #2a2a3e;
  background: rgba(16,16,28,0.9); color: #e8e8f0; font-size: 25px; font-weight: 900;
  backdrop-filter: blur(6px); cursor: pointer;
}
.hud-btn {
  pointer-events: auto; width: 54px; height: 54px; border-radius: 16px; border: 1px solid #2a2a3e;
  background: rgba(16,16,28,0.85); color: #e8e8f0; font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px);
  transition: transform 0.08s;
}
.hud-btn:active { transform: scale(0.92); }
.hud-btn.active { border-color: #9a50e0; background: rgba(154,80,224,0.28); box-shadow: 0 0 0 1px rgba(154,80,224,0.5) inset; }
.hud-top .hud-pill { pointer-events: auto; }
html[data-input-mode="gamepad"] :focus {
  outline: 3px solid #66f0ff;
  outline-offset: 3px;
}
html[data-input-mode="gamepad"] button:focus,
html[data-input-mode="gamepad"] a:focus,
html[data-input-mode="gamepad"] input:focus,
html[data-input-mode="gamepad"] textarea:focus,
html[data-input-mode="gamepad"] select:focus,
html[data-input-mode="gamepad"] [tabindex]:focus {
  box-shadow: 0 0 0 3px rgba(102,240,255,0.28), 0 0 18px rgba(102,240,255,0.32);
}
html[data-input-mode="gamepad"] #hud.menu-open .hud-right {
  border-color: rgba(102,240,255,0.65);
  box-shadow: 0 0 0 1px rgba(102,240,255,0.18), 0 16px 38px rgba(0,0,0,0.38);
}

#joystick {
  display: none; pointer-events: auto; position: absolute; left: 16px; bottom: calc(22px + env(safe-area-inset-bottom, 0));
  width: 126px; height: 126px; touch-action: none; user-select: none;
}
#joy-base {
  position: absolute; left: 14px; bottom: 0; width: 104px; height: 104px; border-radius: 999px;
  background: rgba(10,10,20,0.45); border: 1px solid rgba(232,232,240,0.24);
  box-shadow: inset 0 0 22px rgba(0,232,255,0.08), 0 8px 28px rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
}
#joy-stick {
  position: absolute; left: 31px; top: 31px; width: 42px; height: 42px; border-radius: 999px;
  background: rgba(50,214,232,0.88); border: 2px solid rgba(255,255,255,0.45);
  box-shadow: 0 0 18px rgba(0,232,255,0.45);
  transform: translate(0, 0);
}
#joy-hide {
  position: absolute; top: 0; right: 0; width: 28px; height: 28px; border-radius: 999px; border: 1px solid #2a2a3e;
  background: rgba(16,16,28,0.86); color: #e8e8f0; font-size: 18px; line-height: 1; z-index: 1;
}
#district-banner {
  position: fixed; top: 18vh; left: 50%; transform: translate(-50%, -8px); z-index: 22;
  font-size: 19px; font-weight: 900; letter-spacing: 0.22em; text-transform: uppercase; color: #e8e8f0;
  text-shadow: 0 0 16px rgba(0,232,255,0.6), 2px 2px 0 #10101a;
  opacity: 0; transition: opacity 0.4s, transform 0.4s; pointer-events: none;
}
#district-banner.show { opacity: 1; transform: translate(-50%, 0); }

#interact-hint {
  position: fixed; top: calc(54px + env(safe-area-inset-top, 0)); bottom: auto; left: 50%;
  transform: translateX(-50%) translateY(-6px);
  max-width: min(480px, 88vw); text-align: center; line-height: 1.35;
  background: rgba(10,10,20,0.9); border: 1px solid #3a3a52; border-radius: 999px;
  padding: 7px 14px; font-size: 12px; font-weight: 600; color: #d8d8e8;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 23;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
#interact-hint.show { opacity: 1; transform: translateX(-50%); }
#interact-hint::before {
  content: '◎'; margin-right: 6px; color: #00e8ff; font-size: 11px;
}

/* ── Speech bubble ── */
#bubble {
  position: fixed; z-index: 24; width: 220px; background: #f4f4f8; color: #16161f;
  border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.45;
  opacity: 0; transform: translateY(6px) scale(0.96); transition: opacity 0.18s, transform 0.18s;
  pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
#bubble.show { opacity: 1; transform: none; }
#bubble::after { content: ''; position: absolute; bottom: -7px; left: 50%; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #f4f4f8; }
.bubble-name { display: block; font-weight: 900; color: #0078a0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; }

/* ── Toasts ── */
#toasts { position: fixed; top: calc(58px + env(safe-area-inset-top, 0)); left: 0; right: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(14,14,26,0.92); border: 1px solid #2e2e44; border-radius: 12px; padding: 10px 16px;
  font-size: 13px; font-weight: 700; max-width: 86vw; display: flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(-10px); transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
}
.toast.show { opacity: 1; transform: none; }
.toast-icon { font-size: 17px; }

/* ── Bottom sheet ── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 54; background: rgba(4,4,10,0);
  transition: background 0.22s;
}
.sheet-backdrop.open { background: rgba(4,4,10,0.45); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: var(--vv-offset, 0px); z-index: 60;
  max-width: 560px; margin: 0 auto;
  background: #14141f; border-radius: 22px 22px 0 0; border-top: 1px solid #2e2e44;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0));
  max-height: min(calc(var(--app-h, 100vh) - 8px), calc(var(--app-h, 100vh) * 0.62));
  transform: translateY(105%); transition: transform 0.24s cubic-bezier(0.3, 1, 0.4, 1), bottom 0.18s ease;
  display: flex; flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
}
.sheet.sheet-tall { max-height: min(calc(var(--app-h, 100vh) - 8px), calc(var(--app-h, 100vh) * 0.88)); }
.sheet.sheet-auth { max-height: min(calc(var(--app-h, 100vh) - 12px), 540px); }
.sheet.sheet-auth .sheet-body { flex: 1; min-height: 0; }
.sheet.sheet-keyboard { max-height: calc(var(--app-h, 100vh) - 4px); }
.sheet.open { transform: none; }
/* higher specificity so the open state wins over the docked side transform below */
.sheet.sheet-side.open { transform: none; }

/* Side/compact decorating panel — non-modal, leaves the room visible & live */
.sheet.sheet-side {
  bottom: 0; left: 0; right: auto; margin: 0;
  max-height: calc(var(--app-h, 100vh) * 0.52); max-width: 100%;
  border-radius: 18px 18px 0 0;
}
.sheet.sheet-side .sheet-body { max-height: calc(var(--app-h, 100vh) * 0.52 - 30px); }
@media (min-width: 700px) {
  .sheet.sheet-side {
    top: 0; bottom: 0; left: auto; right: 0; width: 360px; max-width: 42vw;
    max-height: 100vh; border-radius: 18px 0 0 18px; border-top: 0; border-left: 1px solid #2e2e44;
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0));
    transform: translateX(108%);
    box-shadow: -10px 0 40px rgba(0,0,0,0.55);
  }
  .sheet.sheet-side .sheet-body { max-height: calc(100vh - 64px); }
  .sheet.sheet-side .sheet-grab { display: none; }
}
.sheet-grab { width: 44px; height: 4px; border-radius: 2px; background: #33334a; margin: 4px auto 8px; flex: none; }
.sheet-x { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid #33334a; background: #1d1d2c; color: #c8c8d4; font-size: 17px; font-weight: 700; cursor: pointer; z-index: 2; }
.sheet-x:active { background: #2a2a40; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet h2 { font-size: 19px; margin-bottom: 8px; padding-right: 36px; }
.sheet h3 { font-size: 13px; color: #8d8d99; text-transform: uppercase; letter-spacing: 0.1em; margin: 14px 0 8px; }
.sheet p { font-size: 14px; line-height: 1.55; margin-bottom: 10px; }
.muted { color: #8d8d99; }
.sheet .btn { width: 100%; margin-top: 6px; }
.row-btns .btn { width: auto; }

/* ── Creator ── */
.creator { position: fixed; inset: 0; z-index: 60; background: radial-gradient(ellipse at 50% 20%, #161628 0%, #0a0a12 70%); overflow-y: auto; }
.creator-inner {
  max-width: 420px; margin: 0 auto;
  padding: 26px 20px calc(48px + env(safe-area-inset-bottom, 0) + var(--vv-offset, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.creator-title { font-size: 22px; letter-spacing: 0.14em; color: #00e8ff; text-shadow: 0 0 18px rgba(0,232,255,0.4); }
.creator-lead { font-size: 13px; text-align: center; line-height: 1.5; max-width: 340px; margin: 0; }
.creator .fld { width: 100%; }
#cr-preview { width: 200px; height: 200px; }
.cr-rows { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.cr-row { display: grid; grid-template-columns: 1fr 44px 70px 44px; align-items: center; gap: 6px; background: #15151f; border: 1px solid #26263a; border-radius: 12px; padding: 7px 12px; }
.cr-label { font-size: 13px; color: #c8c8d4; }
.cr-arrow { width: 44px; height: 38px; border-radius: 10px; border: 0; background: #22223a; color: #00e8ff; font-size: 22px; font-weight: 900; cursor: pointer; }
.cr-arrow:active { background: #2e2e52; }
.cr-val { text-align: center; font-size: 12px; color: #e8e8f0; text-transform: capitalize; }
.swatch { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 2px solid #33334a; vertical-align: middle; }
.cr-input {
  width: 100%; background: #10101a; border: 1px solid #2e2e44; border-radius: 12px; color: #e8e8f0;
  font-family: inherit; font-size: 15px; padding: 12px 14px; outline: none; resize: none;
}
.cr-input:focus { border-color: #00a8d8; }
.cr-intent { width: 100%; margin-top: 4px; }
.cr-intent-q { font-size: 13px; color: #9fb2c8; margin-bottom: 7px; text-align: center; }
.cr-intent-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cr-intent-opt { padding: 10px 10px; border: 1px solid #2a3c52; background: #121a2a; color: #cfe0f2; border-radius: 10px; font: inherit; font-size: 13px; cursor: pointer; }
.cr-intent-opt:hover { border-color: #3a5570; }
.cr-intent-opt.selected { border-color: #00e8ff; background: #10303c; color: #d8f7ff; }
.cr-actions { display: flex; gap: 10px; width: 100%; }
.cr-actions .btn { flex: 1; }
.shake { animation: shake 0.35s; border-color: #d4453a !important; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ── Panels content ── */
.npc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.npc-head-text { flex: 1; min-width: 0; }
.npc-head h2 { margin: 0; }
.npc-sub { font-size: 12px; margin: 2px 0 0; }
.npc-tts-toggle {
  flex: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid #2a2a3e;
  background: #141420; font-size: 18px; cursor: pointer; line-height: 1;
}
.npc-tts-toggle:hover { background: #1c1c2c; border-color: #3a3a52; }
.npc-tts-toggle.off { opacity: 0.55; }
.chip { background: #1a1a2a; border-radius: 14px; border: 1px solid #2a2a3e; flex: none; }
.chat-log { background: #0e0e18; border: 1px solid #22223a; border-radius: 14px; padding: 10px; height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.chat-msg { max-width: 84%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.chat-msg.npc { background: #1d2a36; align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.me { background: #00485e; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-row { display: flex; gap: 8px; }
.chat-row .cr-input { flex: 1; }
.chat-row .btn { width: 54px !important; margin: 0; flex: none; }
.npc-games { margin-top: 10px; }
.npc-games .btn { white-space: normal; line-height: 1.25; }
.welcome-cards { display: grid; gap: 8px; margin: 12px 0; }
.welcome-tier {
  display: grid; gap: 6px; margin: 12px 0; padding: 12px;
  background: #10101a; border: 1px solid #2a4056; border-radius: 8px;
  box-shadow: inset 3px 0 0 #00a8d8;
}
.welcome-tier b { color: #e8e8f0; }
.welcome-tier span { color: #b8c2ce; font-size: 13px; line-height: 1.45; }
.welcome-cards div {
  background: #15151f; border: 1px solid #26263a; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; line-height: 1.45;
}
.welcome-cards b { display: block; color: #e8e8f0; margin-bottom: 3px; }
.welcome-cards span { color: #9da9b5; }
.welcome-check { margin-top: 12px; }
.welcome-actions { margin-top: 8px; }
.city-grid { display: grid; gap: 10px; margin-top: 12px; }
.city-card {
  background: #15151f; border: 1px solid #26263a; border-radius: 8px;
  padding: 11px 12px; display: grid; gap: 8px; position: relative;
}
.city-card.active { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.city-card-main { display: flex; align-items: center; gap: 10px; }
.city-card-main b { display: block; color: #e8e8f0; font-size: 14px; }
.city-card-main span:not(.city-dot) { display: block; color: #9da9b5; font-size: 11px; line-height: 1.35; }
.city-dot { width: 13px; height: 13px; border-radius: 50%; flex: none; box-shadow: 0 0 12px currentColor; }
.city-card p { color: #9da9b5; font-size: 12px; line-height: 1.45; margin: 0; }
.city-card .btn { width: auto; margin: 0; justify-self: start; }
.city-pop { font-size: 11px; color: #7ea8ff; }
.atlas-tools { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; margin: 12px 0 10px; }
.atlas-tools .fld { margin: 0; min-width: 0; }
.atlas-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: thin; }
.atlas-tab { flex: none; border: 1px solid #343447; background: #181824; color: #aeb7c3; border-radius: 999px; padding: 7px 11px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.atlas-tab.active { color: #080910; background: #00e8ff; border-color: #00e8ff; }
.atlas-summary { color: #7f8b99; font-size: 11px; min-height: 17px; }
.atlas-fav { position: absolute; top: 9px; right: 9px; border: 0; background: transparent; color: #8d8d99; font-size: 22px; line-height: 1; cursor: pointer; padding: 3px; }
.atlas-fav.active { color: #e8c84d; }
.atlas-chips { display: flex; flex-wrap: wrap; gap: 4px; padding-right: 25px; }
.atlas-chips span { border: 1px solid #383849; background: #181824; color: #9da9b5; border-radius: 999px; padding: 3px 7px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; }
.atlas-empty { border: 1px dashed #39394a; border-radius: 12px; padding: 22px; text-align: center; color: #8d8d99; font-size: 13px; }
@media (max-width: 540px) {
  .atlas-tools { grid-template-columns: 1fr; }
}

/* ── Scheduled events ───────────────────────────────────────────────────── */
.ev-card {
  background: #15151f; border: 1px solid #26263a; border-radius: 10px;
  padding: 11px 12px; margin-bottom: 9px; display: grid; gap: 6px;
}
.ev-card.live { border-color: #3fc380; box-shadow: inset 0 0 0 1px rgba(63,195,128,0.35); }
.ev-head { display: flex; align-items: center; gap: 8px; }
.ev-head b { color: #e8e8f0; font-size: 14px; }
.ev-ico { font-size: 18px; }
.ev-live {
  margin-left: auto; font-size: 10px; font-weight: 800; color: #10101a;
  background: #3fc380; border-radius: 999px; padding: 3px 8px; letter-spacing: .5px;
}
.ev-when { font-size: 11px; }
.ev-desc { color: #c2c2d0; font-size: 12px; line-height: 1.4; margin: 0; }
.ev-card .row-btns { margin-top: 2px; }
.ev-card .btn-sm { width: auto; margin: 0; }
.city-current {
  color: #3fc380; border: 1px solid rgba(63,195,128,0.45); border-radius: 999px;
  padding: 5px 9px; font-size: 11px; font-weight: 800; justify-self: start;
}
.inquiry-list { display: grid; gap: 10px; margin-top: 10px; }
.inquiry-card {
  display: grid; gap: 7px; padding: 12px;
  background: #15151f; border: 1px solid #26263a; border-radius: 8px;
}
.inquiry-card p { margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.inquiry-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inquiry-head b { overflow-wrap: anywhere; }
.pill {
  flex: none; padding: 4px 8px; border-radius: 999px;
  background: #202033; border: 1px solid #34344c; color: #b8c2ce; font-size: 11px;
}
.game-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.game-choices .btn { width: auto; margin: 0; padding-left: 8px; padding-right: 8px; }
.rps-result { min-height: 78px; }
.fishing-panel {
  background: #10151f; border: 1px solid #263448; border-radius: 8px;
  padding: 12px; margin: 10px 0; display: grid; gap: 10px;
}
.fish-stage { font-size: 14px; font-weight: 800; color: #e8e8f0; min-height: 20px; }
.fish-water {
  position: relative; height: 58px; overflow: hidden; border-radius: 8px;
  background: linear-gradient(180deg, #17364a, #0d2233);
  border: 1px solid #244a64;
}
.fish-water::before {
  content: ''; position: absolute; inset: 13px -20px auto; height: 2px;
  background: repeating-linear-gradient(90deg, rgba(154,208,232,0.22) 0 16px, transparent 16px 28px);
}
.fish-bobber {
  position: absolute; left: 50%; top: 25px; width: 16px; height: 16px;
  margin-left: -8px; border-radius: 50%; background: #e8e8f0;
  box-shadow: 0 0 12px rgba(232,232,240,0.35);
}
.fish-bobber.waiting { animation: bobwait 1.1s ease-in-out infinite; }
.fish-bobber.bite { background: #ff5a5a; animation: bobbite 0.22s ease-in-out infinite; box-shadow: 0 0 18px rgba(255,90,90,0.7); }
.fish-meter { height: 10px; background: #1d1d2c; border-radius: 999px; overflow: hidden; border: 1px solid #33334a; }
.fish-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #3fc380, #00e8ff); transition: width 0.08s linear; }
.fish-taps { color: #9da9b5; font-size: 12px; font-weight: 700; }
@keyframes bobwait { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@keyframes bobbite { 0%,100% { transform: translate(-3px, 6px); } 50% { transform: translate(4px, -5px); } }
#fishing-ui {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0));
  z-index: 39; display: flex; justify-content: center; pointer-events: none;
}
.fish-hud-card {
  width: min(560px, 100%); background: rgba(13,15,28,0.92); border: 1px solid #33445f;
  border-radius: 8px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
}
.fish-hud-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fish-hud-top b { display: block; color: #e8e8f0; font-size: 15px; }
.fish-hud-top span { display: block; color: #9da9b5; font-size: 11px; line-height: 1.35; margin-top: 2px; }
.fish-exit {
  pointer-events: auto; width: 38px; height: 38px; border-radius: 8px; border: 1px solid #3b3b55;
  background: #1d1d2c; color: #e8e8f0; font-size: 24px; line-height: 1; cursor: pointer;
}
.fish-hud-water {
  position: relative; height: 48px; margin: 9px 0; overflow: hidden; border-radius: 8px;
  background: linear-gradient(180deg, #17364a, #0d2233); border: 1px solid #244a64;
}
.fish-hud-water::before {
  content: ''; position: absolute; left: -20px; right: -20px; top: 15px; height: 2px;
  background: repeating-linear-gradient(90deg, rgba(154,208,232,0.24) 0 16px, transparent 16px 28px);
}
.fish-hud-bobber {
  position: absolute; left: 50%; top: 20px; width: 15px; height: 15px; margin-left: -7px;
  border-radius: 50%; background: #e8e8f0; box-shadow: 0 0 12px rgba(232,232,240,0.35);
}
.fish-hud-bobber.waiting { animation: bobwait 1.1s ease-in-out infinite; }
.fish-hud-bobber.bite { background: #ff5a5a; animation: bobbite 0.2s ease-in-out infinite; box-shadow: 0 0 18px rgba(255,90,90,0.75); }
.fish-stat { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 8px; margin-top: 7px; font-size: 11px; color: #9da9b5; }
.fish-stat i { display: block; height: 9px; border-radius: 999px; overflow: hidden; background: #1d1d2c; border: 1px solid #33334a; }
.fish-stat b { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #3fc380, #00e8ff); transition: width 0.08s linear; }
.fish-stat.tension b { background: linear-gradient(90deg, #7ee0b0, #e8c84d); }
.fish-stat.tension i.danger b { background: linear-gradient(90deg, #e8c84d, #ff5a5a); }
.fish-hud-meta { min-height: 18px; margin-top: 9px; font-size: 12px; color: #e8e8f0; line-height: 1.35; }
.fish-hud-actions { margin-top: 8px; text-align: right; }
.fish-hud-actions .btn { width: auto; margin: 0; pointer-events: auto; }
.ttt-board {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  margin: 12px auto; max-width: 300px;
}
.ttt-cell {
  aspect-ratio: 1; border: 1px solid #33334a; border-radius: 8px;
  background: #10101a; color: #00e8ff; font-family: inherit; font-size: 32px;
  font-weight: 900; cursor: pointer;
}
.ttt-cell:disabled { cursor: default; color: #e8e8f0; opacity: 0.9; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.badge { font-size: 22px; background: #1a1a2c; border: 1px solid #2e2e44; border-radius: 10px; padding: 6px 9px; }
.badge.locked { opacity: 0.35; filter: grayscale(1); }
.quest { background: #15151f; border: 1px solid #26263a; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.quest.done { border-color: #3fc380; }
.quest.done .quest-text::after { content: ' ✓'; color: #3fc380; }
.quest-text { font-size: 14px; font-weight: 700; }
.quest-bar { height: 6px; background: #22223a; border-radius: 3px; margin: 7px 0 4px; overflow: hidden; }
.quest-fill { height: 100%; background: linear-gradient(90deg, #00a8d8, #00e8ff); border-radius: 3px; transition: width 0.3s; }
.quest-meta { font-size: 11px; color: #8d8d99; }
.streak-line { font-size: 14px; font-weight: 700; background: #15151f; border: 1px solid #26263a; border-radius: 12px; padding: 10px 12px; }
.nb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #15151f; border: 1px solid #26263a; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.gb-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.gb-entry { background: #15151f; border: 1px solid #26263a; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin-bottom: 8px; }
.bb-preview { background: #0c0c16; border: 2px solid; border-radius: 12px; padding: 16px; text-align: center; font-size: 15px; line-height: 1.6; margin-bottom: 10px; }
.fld { display: block; font-size: 12px; color: #8d8d99; margin-bottom: 10px; }
.fld .cr-input { margin-top: 5px; }
.fld-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 10px; }
.fld-check input { width: 18px; height: 18px; accent-color: #00a8d8; }
.auth-foot { text-align: center; margin-top: 12px; font-size: 13px; }
.link-btn {
  background: none; border: 0; padding: 0; color: #00e8ff; font: inherit; font-weight: 800;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:active { opacity: 0.8; }
html.keyboard-open #spatial-av-launcher { opacity: 0; pointer-events: none; }
.swatch-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.swatch-btn { width: 42px; height: 42px; border-radius: 12px; border: 2px solid #33334a; cursor: pointer; }
.swatch-btn.sel { border-color: #00e8ff; box-shadow: 0 0 10px rgba(0,232,255,0.4); }
.tex-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.tex-chip { padding: 9px 16px; border-radius: 12px; border: 2px solid #33334a; background: #1d1d2c; color: #c8c8d4; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.tex-chip.sel { border-color: #00e8ff; color: #fff; box-shadow: 0 0 10px rgba(0,232,255,0.35); }
.tex-chip:active { background: #2a2a40; }
#minimap { width: 100%; height: auto; border-radius: 12px; border: 1px solid #2e2e44; cursor: pointer; touch-action: manipulation; }
.map-hint { font-size: 12px; margin: -4px 0 8px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 10px 0 2px; font-size: 11px; color: #8d8d99; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.map-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.bb-img { max-width: 100%; max-height: 140px; border-radius: 8px; display: block; margin: 0 auto; }
.bb-by { font-size: 11px; color: #6a6a7a; margin-top: 8px; }
.hud-btn.pip { position: relative; }
.hud-btn.pip::after {
  content: ''; position: absolute; top: 7px; right: 7px; width: 11px; height: 11px;
  border-radius: 50%; background: #ff5a5a; border: 2px solid #10101c;
  animation: pippulse 1.6s infinite;
}
@keyframes pippulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.district-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.district-tag { font-size: 11px; padding: 5px 9px; border-radius: 999px; background: #1a1a2c; border: 1px solid #2e2e44; color: #8d8d99; }
.district-tag.seen { color: #3fc380; border-color: #2a5a40; }

.apt-directory { display: grid; gap: 10px; }
.apt-floor-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 10px 0; }
.apt-floor-buttons .btn { margin: 0; width: auto; padding: 9px 4px; }
.apt-floor {
  background: #121820; border: 1px solid #273443; border-radius: 8px; padding: 10px;
}
.apt-floor h3 { margin-top: 0; color: #9ad0e8; }
.apt-slot {
  display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 8px;
  min-height: 38px; border-top: 1px solid #273443; padding: 7px 0; font-size: 12px;
}
.apt-slot:first-of-type { border-top: 0; }
.apt-slot span { color: #8d8d99; overflow-wrap: anywhere; }
.apt-slot .btn { margin: 0; width: auto; }

/* The Blak Repository */
.tbr-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 12px;
}
.tbr-stats span {
  background: #101a17; border: 1px solid #24483d; border-radius: 10px; padding: 9px 8px;
  font-size: 11px; line-height: 1.35; color: #b7d8ca; text-align: center;
}
.tbr-stats b { display: block; color: #7ee0b0; font-size: 18px; line-height: 1.1; }
.tbr-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.tbr-tab {
  border: 1px solid #2e2e44; border-radius: 10px; background: #1a1a2c; color: #c8c8d4;
  font-family: inherit; font-size: 12px; font-weight: 700; padding: 9px 4px; cursor: pointer;
}
.tbr-tab.sel { background: #24483d; color: #7ee0b0; border-color: #3b765f; }
.tbr-search { margin-bottom: 10px; }
.tbr-grid { display: grid; gap: 9px; }
.tbr-card {
  display: block; width: 100%; background: #121820; border: 1px solid #273443; border-radius: 8px;
  padding: 11px; text-align: left; color: #e8e8f0; font-family: inherit;
  overflow-wrap: anywhere;
}
.tbr-card h3 { color: #7ee0b0; letter-spacing: 0; margin: 4px 0 7px; text-transform: none; font-size: 15px; }
.tbr-card p { font-size: 13px; margin-bottom: 8px; }
.tbr-person { cursor: pointer; }
.tbr-person:active { transform: scale(0.99); }
.tbr-kicker { color: #9ad0e8; font-size: 10px; font-weight: 700; text-transform: uppercase; line-height: 1.35; }
.tbr-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.tbr-tags span {
  border: 1px solid #365247; border-radius: 999px; color: #b7d8ca; background: #101a17;
  font-size: 10px; padding: 4px 7px;
  max-width: 100%;
}

@media (min-width: 620px) {
  .tbr-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Home editor ── */
#edit-bar, #city-edit-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
  display: none; flex-direction: column; gap: 8px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, rgba(16,16,28,0) 0%, rgba(12,12,20,0.96) 24%);
  pointer-events: none;
}
#edit-bar.show, #city-edit-bar.show { display: flex; }
.edit-status {
  align-self: center; display: grid; gap: 3px; max-width: min(94%, 650px);
  text-align: center; pointer-events: none; background: rgba(10,10,20,0.9);
  border: 1px solid #00a8d8; border-radius: 12px; padding: 8px 14px;
}
.edit-status b { color: #00e8ff; font-size: 13px; }
.edit-hint {
  font-size: 12px; color: #cfe9ff; line-height: 1.35;
}
.edit-tools { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; pointer-events: auto; }
.edit-tool {
  min-width: 62px; min-height: 54px; border-radius: 14px; border: 1px solid #2e2e44;
  background: rgba(20,20,34,0.95); color: #e8e8f0; font-size: 20px; font-weight: 700;
  cursor: pointer; padding: 5px 11px; display: grid; place-items: center; gap: 1px;
}
.edit-tool small { font: 700 9px/1 'Courier New', monospace; color: #aeb8c4; text-transform: uppercase; }
.edit-tool:active { transform: scale(0.94); }
.edit-tool.done { background: linear-gradient(180deg, #00e8ff, #00a8d8); color: #06121a; border: 0; font-size: 15px; }
@media (max-width: 430px) {
  .edit-tools { gap: 5px; }
  .edit-tool { min-width: 55px; min-height: 50px; padding: 4px 7px; }
  .edit-tool.done { min-width: 74px; }
}

/* ── Furniture picker ── */
.furn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.furn-pick {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #15151f; border: 1px solid #26263a; border-radius: 14px; padding: 14px 6px;
  color: #e8e8f0; font-size: 12px; font-family: inherit; cursor: pointer;
}
.furn-pick:active { background: #1d1d2c; }
.furn-ico { font-size: 26px; }

/* In-app games hub */
.games-hub-section { margin-top: 16px; }
.games-hub-section h3 { margin: 0 0 8px; font-size: 13px; color: #9da9b5; letter-spacing: 0.04em; text-transform: uppercase; }
.games-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.games-hub-card {
  display: grid; gap: 4px; text-align: left; padding: 12px;
  border-radius: 12px; border: 1px solid #2a2a3e; background: #12101a;
  color: #e8e8f0; cursor: pointer; font-family: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--game-accent, #00e8ff) 18%, transparent);
}
.games-hub-card:active { background: #1a1828; }
.games-hub-card.soon { opacity: 0.72; cursor: default; }
.games-hub-icon { font-size: 18px; }
.games-hub-name { font-weight: 700; color: var(--game-accent, #00e8ff); font-size: 13px; }
.games-hub-desc { font-size: 11px; color: #9da9b5; line-height: 1.35; }
.games-hub-badge { font-size: 10px; color: #b86cff; margin-top: 2px; }

/* BlakCade embedded games */
.arcade-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.arcade-choice { min-height: 44px; }
.arcade-overlay {
  position: fixed; top: 0; left: 0; right: 0; height: var(--app-h, 100vh); z-index: 90;
  display: grid; grid-template-rows: auto 1fr;
  background: #05050b; color: #e8e8f0;
}
.arcade-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0)) 14px 10px;
  background: rgba(12,12,22,0.98); border-bottom: 1px solid #2a2a3e;
}
.arcade-topbar b { display: block; color: #00e8ff; letter-spacing: 0; }
.arcade-topbar span { display: block; color: #9da9b5; font-size: 12px; margin-top: 2px; }
.arcade-frame { width: 100%; height: 100%; border: 0; background: #000; }
.arcade-exit { width: auto; margin: 0; white-space: nowrap; }

/* In-world TV — mobile overlay + desktop picture-in-world (video only on screen) */
.tv-overlay {
  position: fixed; inset: 0; z-index: 88; display: none;
  background: #000; pointer-events: none;
}
.tv-overlay.show { display: block; }
.tv-frame-wrap { position: absolute; inset: 0; }
.tv-frame { width: 100%; height: 100%; border: 0; background: #000; }
.tv-overlay-host, .tv-pip-host {
  width: 100%; height: 100%; pointer-events: none;
}
.tv-overlay-host iframe, .tv-pip-host iframe, .tv-pip-frame {
  width: 100%; height: 100%; border: 0; background: #000; pointer-events: none;
}
.tv-pip {
  position: fixed; z-index: 40; display: none;
  border: 2px solid rgba(255,255,255,0.18); border-radius: 4px;
  overflow: hidden; box-shadow: 0 10px 28px rgba(0,0,0,0.55);
  background: #000; pointer-events: none;
}
.tv-pip.show { display: block; }
.tv-pip-screen {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.stage-pip {
  position: fixed; z-index: 5; display: none;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 2px;
  overflow: hidden; pointer-events: none; background: #000;
}
.stage-pip.show { display: block; }
.stage-pip-frame {
  width: 100%; height: 100%; border: 0; background: #000; pointer-events: none;
  position: absolute; inset: 0;
}
.stage-pip-frame iframe { width: 100%; height: 100%; border: 0; background: #000; pointer-events: none; }
.stage-pip-unmute {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-content: center; justify-items: center; gap: 4px;
  border: 0; padding: 8px; cursor: pointer; pointer-events: auto;
  background: linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.55));
  color: #fff; text-align: center;
}
.stage-pip-unmute-icon { font-size: 22px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55)); }
.stage-pip-unmute-text {
  font: 700 11px/1.2 'Courier New', monospace; letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.stage-pip.unmuted .stage-pip-unmute { display: none; }
.stage-pip.has-perf-player .stage-pip-unmute { display: none; }
.stage-pip-live {
  position: absolute; top: 6px; left: 6px; z-index: 3; pointer-events: none;
  background: #e10600; color: #fff; font: 700 10px/1 'Courier New', monospace;
  letter-spacing: 0.08em; padding: 3px 7px; border-radius: 2px;
  box-shadow: 0 0 10px rgba(225, 6, 0, 0.55);
}
.stage-pip-frame video { width: 100%; height: 100%; object-fit: cover; background: #000; pointer-events: none; }

.video-room-overlay {
  position: fixed; inset: 0; z-index: 120; display: none;
  background: rgba(4, 4, 10, 0.88); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 16px;
}
.video-room-overlay.show { display: flex; }
.video-room-shell {
  width: min(960px, 100%); height: min(72vh, 640px); display: flex; flex-direction: column;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; overflow: hidden; background: #0a0a12;
}
.video-room-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.video-room-title { display: block; font-size: 15px; }
.video-room-sub { display: block; font-size: 11px; color: rgba(255,255,255,0.55); }
.video-room-frame { flex: 1; width: 100%; border: 0; background: #000; }
.video-room-actions { display: flex; align-items: center; gap: 8px; }
.vr-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  border: 1px solid #33335a; background: #14141f; color: #d0d6e4;
  font-size: 14px; cursor: pointer; display: grid; place-items: center;
}
.vr-icon:hover { background: #1e1e30; color: #fff; }
/* Popped-out floating window: no backdrop, draggable, resizable, and the city
   behind stays interactive so a call can follow you around. */
.video-room-overlay.windowed {
  position: fixed; inset: auto; display: block; padding: 0;
  background: none; backdrop-filter: none; pointer-events: none;
}
.video-room-overlay.windowed .video-room-shell {
  position: fixed; right: 16px; bottom: 16px;
  width: min(440px, 92vw); height: min(320px, 64vh);
  pointer-events: auto; resize: both; box-shadow: 0 20px 56px rgba(0,0,0,0.6);
}
.video-room-overlay.windowed .video-room-topbar { cursor: move; }
.video-room-shell.dragging { user-select: none; }
.video-room-shell:fullscreen { width: 100vw; height: 100vh; border-radius: 0; }

/* A/V settings + pre-join chooser */
.av-preview {
  width: 100%; aspect-ratio: 16 / 10; max-height: 200px; margin: 0 0 10px;
  background: #06060e; border-radius: 10px; overflow: hidden; border: 1px solid #262642;
}
.av-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.av-meter { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.av-meter-label { font-size: 11px; color: #8a96a8; font-weight: 700; min-width: 24px; }
.av-meter-bar { flex: 1; height: 8px; background: #161628; border-radius: 6px; overflow: hidden; }
.av-meter-bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #50c878, #00e8ff); transition: width 0.08s linear; }
.av-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.av-toggle { background: #14141f; border: 1px solid #33335a; color: #d0d6e4; }
.av-toggle.on { background: rgba(80,200,120,0.16); border-color: #50c878; color: #bdf0cc; }
#spatial-avsettings { padding: 0 10px; min-width: 40px; }

/* Performance city mini-player */
.perf-mini {
  position: fixed;
  left: 12px;
  bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));
  z-index: 39;
  display: none;
  align-items: center;
  gap: 8px;
  max-width: min(280px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  background: rgba(10,10,20,0.88);
  box-shadow: 0 10px 24px rgba(0,0,0,0.42);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}
.perf-mini.show { display: flex; }
.perf-mini.muted { opacity: 0.92; }
.perf-mini-prev,
.perf-mini-next,
.perf-mini-mute {
  width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: #222231; color: #fff; font-size: 16px; cursor: pointer; flex: 0 0 auto;
}
.perf-mini-prev,
.perf-mini-next { display: none; font-size: 14px; }
.perf-mini.radio .perf-mini-prev,
.perf-mini.radio .perf-mini-next { display: inline-flex; align-items: center; justify-content: center; }
.perf-mini-track { display: grid; gap: 4px; min-width: 0; flex: 1; }
.perf-mini-label {
  font: 700 10px/1.2 'Courier New', monospace; color: #c8c8d4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.perf-mini-vol { width: 100%; accent-color: var(--accent, #00e8ff); cursor: pointer; }
.perf-mini-collapse {
  width: 26px; height: 26px; border: 0; border-radius: 9px;
  background: #222231; color: #fff; font-size: 13px; cursor: pointer; flex: 0 0 auto;
}
.perf-mini.collapsed { max-width: none; padding: 6px; gap: 0; }
.perf-mini.collapsed .perf-mini-prev,
.perf-mini.collapsed .perf-mini-next,
.perf-mini.collapsed .perf-mini-mute,
.perf-mini.collapsed .perf-mini-track { display: none; }
.perf-mini.collapsed .perf-mini-collapse { font-size: 15px; }
.perf-onboard {
  display: grid; gap: 10px; margin: 8px 0 14px; padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 14px;
  background: rgba(8,8,16,0.55);
}
.perf-onboard-title { margin: 0; font-size: 15px; color: #e8e8f0; }
.perf-onboard-body { margin: 0; color: #9aa7b4; font-size: 13px; line-height: 1.55; max-width: 620px; }
.perf-onboard-options { display: grid; gap: 8px; }
.perf-onboard-opt {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  padding: 10px 12px; border-radius: 12px; border: 1px solid #2a2a3e; cursor: pointer;
  background: rgba(16,16,28,0.72);
}
.perf-onboard-opt:has(input:checked) { border-color: var(--city-accent, #00e8ff); box-shadow: 0 0 0 1px color-mix(in srgb, var(--city-accent, #00e8ff) 35%, transparent); }
.perf-onboard-opt input { margin-top: 3px; accent-color: var(--city-accent, #00e8ff); }
.perf-onboard-opt span { display: grid; gap: 2px; }
.perf-onboard-opt b { color: #e8e8f0; font-size: 13px; }
.perf-onboard-opt small { color: #8d8d99; font-size: 11px; line-height: 1.4; }

/* BLAK OS music computer */
.sos-backdrop {
  position: fixed; inset: 0; z-index: 57;
  display: grid; place-items: center;
  padding: max(12px, env(safe-area-inset-top, 0)) 12px max(14px, env(safe-area-inset-bottom, 0));
  background: rgba(3, 4, 12, 0.62);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.sos-backdrop.open { opacity: 1; pointer-events: auto; }
.sos-backdrop.minimized { opacity: 0; pointer-events: none; }
.sos-window {
  width: min(920px, 100%);
  height: min(680px, 92vh);
  height: min(680px, 92dvh);
  display: flex; flex-direction: column; overflow: hidden;
  resize: both;
  min-width: 420px;
  min-height: 360px;
  border: 1px solid #31415e;
  border-radius: 16px;
  background: #0a0d14;
  box-shadow: 0 26px 90px rgba(0,0,0,0.68), inset 0 1px 0 rgba(255,255,255,0.05);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.3, 1, 0.4, 1);
}
.sos-backdrop.open .sos-window { transform: none; }
.sos-window.dragging { user-select: none; }
.sos-titlebar,
.sos-taskbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #131827, #0d111d);
  border-color: #232d42;
  flex-shrink: 0;
}
.sos-titlebar { border-bottom: 1px solid #232d42; cursor: move; }
.sos-taskbar { border-top: 1px solid #232d42; }
.sos-logo { font: 800 12px/1 ui-monospace, monospace; letter-spacing: 0.12em; color: #9fd3ff; }
.sos-user { margin-left: auto; min-width: 0; color: #aab6c8; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sos-x {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid #34415a; background: #171d2b; color: #e6edf7;
  cursor: pointer; flex: 0 0 auto;
}
.sos-screen {
  position: relative;
  flex: 1; min-height: 0; overflow: auto;
  padding: 18px;
  background:
    linear-gradient(rgba(112, 196, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 196, 255, 0.035) 1px, transparent 1px),
    radial-gradient(760px 420px at 18% 0%, rgba(76, 126, 255, 0.18), transparent 60%),
    radial-gradient(720px 460px at 88% 12%, rgba(56, 210, 156, 0.12), transparent 66%),
    #080b12;
  background-size: 22px 22px, 22px 22px, auto, auto, auto;
}
.sos-boot { height: 100%; min-height: 300px; display: grid; place-content: center; gap: 10px; text-align: center; }
.sos-boot-logo { font: 900 34px/1 ui-monospace, monospace; color: #eaf4ff; letter-spacing: 0.02em; }
.sos-boot-logo span { color: #74ffbd; }
.sos-boot-line { color: #8da1ba; font-size: 13px; }
.sos-desktop,
.sos-page { display: grid; gap: 12px; }
.sos-desktop.app-open { filter: saturate(0.82) brightness(0.76); pointer-events: none; }
.sos-greet { margin: 0; color: #d9e4f4; font-size: 13px; }
.sos-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.sos-app {
  min-height: 112px; display: grid; place-items: center; gap: 8px;
  border: 1px solid #28364e; border-radius: 8px;
  background: rgba(15, 20, 32, 0.84); color: #eaf1fb;
  font: 700 12px/1.25 system-ui, sans-serif; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.sos-app:hover,
.sos-row:hover { border-color: #6fa8ff; background: rgba(22, 31, 50, 0.92); }
.sos-app span { font-size: 28px; line-height: 1; }
.sos-app-window {
  position: absolute; inset: 18px;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  border: 1px solid #344766; border-radius: 10px;
  background: rgba(8, 11, 18, 0.96);
  box-shadow: 0 18px 60px rgba(0,0,0,0.58), inset 0 1px 0 rgba(255,255,255,0.05);
}
.sos-app-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid #26344c;
  background: linear-gradient(180deg, #172034, #111827);
  flex-shrink: 0;
}
.sos-app-head b { color: #eaf3ff; font-size: 13px; }
.sos-app-close {
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  border: 1px solid #35465f; background: #151d2d; color: #dce8f8;
  font-size: 18px; line-height: 1;
}
.sos-app-body { flex: 1; min-height: 0; overflow: auto; padding: 14px; }
.sos-h { margin: 0; color: #eff5ff; font-size: 17px; line-height: 1.25; }
.sos-h4 { margin: 4px 0 0; color: #a8caff; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.sos-note { color: #8f9db0; font-size: 12px; line-height: 1.45; }
.sos-list { display: grid; gap: 8px; }
.sos-row {
  width: 100%; min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px; align-items: center; text-align: left;
  padding: 10px 12px; border: 1px solid #253149; border-radius: 8px;
  background: rgba(10, 14, 24, 0.86); color: #eaf1fb; cursor: pointer;
}
.sos-row.static { cursor: default; }
.sos-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sos-row-sub { color: #8f9db0; font-size: 11px; line-height: 1.35; grid-column: 1; }
.sos-row-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; grid-row: 1 / span 2; grid-column: 2; }
.sos-pill {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 24px; padding: 3px 8px; border-radius: 999px;
  background: rgba(111,168,255,0.12); color: #a9ccff; border: 1px solid rgba(111,168,255,0.22);
  font-size: 10px; font-weight: 800; white-space: nowrap;
}
.sos-pill.private { background: rgba(255,92,138,0.13); color: #ffb6ca; border-color: rgba(255,92,138,0.28); }
.sos-pill.owner { background: rgba(255,211,95,0.14); color: #ffe29a; border-color: rgba(255,211,95,0.3); }
.sos-pill.venue { background: rgba(111,168,255,0.12); color: #b8d4ff; border-color: rgba(111,168,255,0.28); }
.sos-pill.live { background: rgba(116,255,189,0.1); color: #9dffd0; border-color: rgba(116,255,189,0.25); }
.sos-pill.project { background: rgba(180,140,255,0.12); color: #d4c4ff; border-color: rgba(180,140,255,0.28); }
.sos-daw-chip {
  margin-left: 4px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid #3a5080; background: rgba(111,168,255,0.18); color: #cfe4ff;
  font: 700 11px/1 ui-monospace, monospace; cursor: pointer;
}
.sos-daw-chip:hover { background: rgba(111,168,255,0.28); }
.sos-people { display: flex; flex-wrap: wrap; gap: 6px; }
.sos-tracks { display: grid; gap: 6px; }
.sos-track,
.sos-req {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 9px 10px; border: 1px solid #243047; border-radius: 8px;
  background: rgba(13, 17, 28, 0.72); color: #dce8f8; font-size: 12px;
}
.sos-track span { color: #8d9bb0; font-size: 11px; }
.sos-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sos-actions .danger { color: #ff9aaa; border-color: #553040; }
.sos-cta { justify-self: start; }
.sos-back {
  justify-self: start; border: 0; background: transparent; color: #9fc5ff;
  font: 700 12px system-ui, sans-serif; cursor: pointer; padding: 4px 0;
}
.sos-notes textarea {
  min-height: 360px; resize: vertical;
  padding: 12px; border: 1px solid #2a3852; border-radius: 8px;
  background: rgba(5, 8, 14, 0.82); color: #f0f5ff;
  font: 14px/1.55 ui-monospace, monospace;
}
.sos-taskbar button {
  min-height: 34px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid #28364e; background: #121827; color: #dbe7f7;
  cursor: pointer; font-size: 12px;
}
.sos-taskbar button.active { background: #6fa8ff; border-color: #6fa8ff; color: #07101d; }
.sos-clock { margin-left: auto; color: #8fa2ba; font: 700 12px ui-monospace, monospace; }
.sos-resize { display: none; }

@media (max-width: 640px) {
  .sos-backdrop { padding: 0; place-items: stretch; }
  .sos-window { width: 100%; height: 100%; min-width: 0; min-height: 0; border-radius: 0; border: 0; transform: translateY(100%); resize: none; }
  .sos-titlebar { cursor: default; padding: 8px 10px; }
  .sos-taskbar { padding: 8px 10px; gap: 6px; }
  .sos-taskbar button { padding: 8px 10px; font-size: 12px; }
  .sos-screen { padding: 12px; }
  .sos-app-window { inset: 8px; }
  .sos-app-body { padding: 12px; }
  .sos-apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sos-app { min-height: 92px; }
  .sos-row { grid-template-columns: 1fr; }
  .sos-row-pills { grid-row: auto; grid-column: 1; justify-content: flex-start; }
  .sos-taskbar { overflow-x: auto; }
  .sos-clock { display: none; }
}

/* Collaborative session DAW — floating window */
.daw-float-backdrop {
  position: fixed; inset: 0; z-index: 58;
  display: grid; place-items: center;
  padding: max(10px, env(safe-area-inset-top, 0)) 10px max(12px, env(safe-area-inset-bottom, 0));
  background: rgba(4, 4, 12, 0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.daw-float-backdrop.open { opacity: 1; pointer-events: auto; }
.daw-float-window {
  width: min(1560px, 100%);
  height: 94vh;
  height: 94dvh;
  max-height: 96vh;
  max-height: 96dvh;
  display: flex; flex-direction: column;
  border: 1px solid #343450;
  border-radius: 16px;
  background: #101018;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.3, 1, 0.4, 1);
  overflow: hidden;
}
.daw-float-backdrop.open .daw-float-window { transform: none; }
.daw-float-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #2a2a40;
  background: linear-gradient(180deg, #161622, #11111a);
  flex-shrink: 0;
}
.daw-float-title { min-width: 0; flex: 1; }
.daw-float-head b { display: block; font-size: 15px; color: #f0f4ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daw-float-sub { display: block; font-size: 11px; color: #7a8498; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daw-float-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.daw-float-x {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid #33334a; background: #1a1a28; color: #d0d6e4;
  font-size: 16px; cursor: pointer; flex-shrink: 0;
}
.daw-float-x:active { background: #26263a; }
.daw-float-os {
  height: 40px; padding: 0 12px; border-radius: 10px; margin-right: 8px;
  border: 1px solid #33334a; background: #1a1a28; color: #9fc4ff;
  font: 700 12px/1 ui-monospace, monospace; cursor: pointer; flex-shrink: 0;
}
.daw-float-os:hover { background: #20283e; border-color: #3a4a6a; }
.daw-float-os:active { background: #26263a; }
.daw-float-body {
  overflow: hidden;
  padding: 10px 12px 14px;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}
/* Visible keyboard focus for accessibility across the whole DAW. */
.daw-float-window button:focus-visible,
.daw-float-window input:focus-visible,
.daw-float-window select:focus-visible,
.daw-add-track-panel button:focus-visible,
.daw-add-track-panel input:focus-visible,
.daw-add-track-panel select:focus-visible { outline: 2px solid #6fa8ff; outline-offset: 1px; }
.daw-add-track-backdrop {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0; pointer-events: none;
  transition: opacity 0.16s ease;
}
.daw-add-track-backdrop.open { opacity: 1; pointer-events: auto; }
.daw-add-track-panel {
  width: min(400px, 100%);
  border: 1px solid #3a3a58;
  border-radius: 14px;
  background: #14141f;
  padding: 14px 16px 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  transform: translateY(8px);
  transition: transform 0.16s ease;
}
.daw-add-track-backdrop.open .daw-add-track-panel { transform: none; }
.daw-add-track-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.daw-add-track-head b { font-size: 16px; }
.daw-add-track-actions { display: grid; gap: 8px; margin-top: 12px; }
.daw-add-track-actions .btn { width: 100%; min-height: 44px; }

/* Collaborative session DAW */
.daw-shell {
  --daw-head-w: 108px;
  --daw-lane-h: 64px;
  background: linear-gradient(180deg, #11111c 0%, #090912 100%);
  border: 1px solid #2a2a42;
  border-radius: 14px;
  padding: 12px;
  margin: -4px 0 0;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
/* Pin the controls; only the track list between them scrolls, so the transport
   (top) and record/close (bottom) are never hidden behind tracks. */
.daw-shell > .daw-mode-bar,
.daw-shell > .daw-venue-note,
.daw-shell > .daw-toolbar,
.daw-shell > .daw-upload-bar,
.daw-shell > .daw-hint,
.daw-shell > .daw-record-row,
.daw-shell > .daw-note,
.daw-shell > .daw-footer { flex-shrink: 0; }
.daw-mode-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.daw-venue-note {
  margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; font-size: 11px; line-height: 1.35;
  color: #b8d4ff; background: rgba(111,168,255,0.1); border: 1px solid rgba(111,168,255,0.22);
}
.daw-mode-tabs { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; }
.daw-mode-tabs .btn { min-width: 0; padding: 6px 9px; font-size: 11px; min-height: 34px; }
.daw-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid #2a2a40; border-radius: 10px;
  background: rgba(8,8,14,0.92);
}
.daw-toolbar-compact { padding: 8px 10px; gap: 6px; }
.daw-transport-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%;
}
.daw-undo-group { display: inline-flex; gap: 4px; margin-left: 2px; }
.daw-undo-btn { min-width: 34px; padding: 6px 8px; font-size: 14px; line-height: 1; }
.daw-undo-btn:disabled { opacity: 0.35; }
.daw-tools-toggle { margin-left: auto; min-height: 34px; font-size: 11px; padding: 6px 10px; }
.daw-edit-tools:not(.open) { display: none; }
.daw-edit-tools.open {
  display: flex; flex-wrap: wrap; gap: 6px; width: 100%;
  padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.06);
}
.daw-transport-btns { display: flex; gap: 6px; }
.daw-transport-btns .btn { min-width: 42px; padding: 8px 12px; font-size: 13px; }
.daw-transport-btns .btn-primary { box-shadow: 0 0 0 1px rgba(111,168,255,0.25); }
.daw-edit-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.daw-edit-tools .daw-tool { font-size: 11px; padding: 8px 10px; min-height: 40px; }
.daw-edit-tools .daw-tool:disabled { opacity: 0.35; }
.daw-transport-btns .btn { min-height: 40px; }
.daw-timeblock { margin-left: auto; text-align: right; flex-shrink: 0; }
/* Mobile DAW: the timeline is the star — the toolbar compacts into tight
   rows of small flat buttons instead of a stack of full-width pills. */
@media (max-width: 640px) {
  .daw-float-backdrop { padding: 0; }
  .daw-float-window { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .daw-float-head { padding: 8px 10px; }
  .daw-float-head span { display: none; }
  .daw-float-os { height: 34px; padding: 0 9px; font-size: 11px; margin-right: 6px; }
  .daw-float-x { width: 34px; height: 34px; font-size: 14px; }
  .daw-float-body { padding: 8px 8px 10px; }
  .daw-mode-bar { margin-bottom: 6px; gap: 5px; }
  .daw-presence { max-width: 100%; }
  .daw-chip { max-width: 110px; font-size: 10px; }
  .daw-mode-tabs .btn { padding: 6px 8px; font-size: 10px; min-height: 32px; box-shadow: none; }
  .daw-venue-note { font-size: 10px; padding: 5px 8px; }
  .daw-toolbar { padding: 7px 8px; margin-bottom: 6px; gap: 5px; }
  .daw-toolbar .btn, .daw-transport-btns .btn, .daw-edit-tools .daw-tool {
    min-height: 34px; min-width: 0; padding: 6px 9px; font-size: 11px;
    box-shadow: none; border-radius: 8px; flex: 0 0 auto;
  }
  .daw-transport-btns { gap: 5px; }
  /* Edit tools become one horizontally swipeable strip instead of wrapping
     into three rows of buttons. */
  .daw-edit-tools.open {
    gap: 5px; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px;
  }
  .daw-edit-tools.open::-webkit-scrollbar { display: none; }
  .daw-edit-tools.open .daw-tool, .daw-edit-tools.open .daw-bpm { white-space: nowrap; flex-shrink: 0; }
  .daw-tools-toggle { order: 4; }
  .daw-bpm { font-size: 9px; }
  .daw-bpm input { width: 40px; padding: 3px 4px; font-size: 11px; }
  .daw-status { flex-basis: 100%; order: 9; font-size: 10px; margin: 0; }
  .daw-timeblock { margin-left: auto; }
  .daw-clock { font-size: 13px; }
  .daw-hint { display: none; }
  .daw-workspace-scroll { flex: 1; min-height: 46dvh; }
  .daw-countin { min-width: 30px; height: 30px; font-size: 16px; }
}
.daw-clock { display: block; font: 600 15px/1.1 ui-monospace, monospace; color: #f0f4ff; letter-spacing: 0.04em; }
.daw-duration { display: block; font-size: 10px; color: #6f7a90; margin-top: 2px; }
.daw-status { font-size: 11px; color: #7eb8ff; margin: 0; flex: 1 1 100%; }
.daw-upload-bar {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center;
  padding: 10px 12px; margin-bottom: 10px;
  border: 1px solid #33406a; border-radius: 10px;
  background: rgba(18,22,38,0.95);
}
.daw-upload-bar[hidden] { display: none !important; }
.daw-upload-label { grid-column: 1 / -1; font-size: 12px; color: #b8c8ff; }
.daw-progress-track { height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,0.08); }
.daw-progress-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #4a7dff, #7b5dff);
  transition: width 0.18s ease-out;
}
.daw-progress-pct { font: 600 12px ui-monospace, monospace; color: #9ad0ff; min-width: 36px; text-align: right; }
.daw-workspace-scroll {
  flex: 1 1 auto; min-height: 120px;
  overflow: auto; -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  position: relative;
}
.daw-workspace-scroll.mixer-open .daw-workspace {
  padding-bottom: min(38vh, 200px);
}
.daw-workspace {
  display: grid; grid-template-columns: var(--daw-head-w) minmax(220px, 1fr);
  min-width: min(100%, 520px);
  border: 1px solid #2a2a40; border-radius: 10px; overflow: hidden;
  background: #06060e;
}
.daw-add-track-row {
  width: 100%; margin-top: auto;
  border: 0; border-top: 1px solid #1a1a28;
  background: #0e0e18; color: #8eb8ff;
  font: inherit; font-size: 11px;
  padding: 10px 8px; cursor: pointer;
  min-height: 44px;
}
.daw-add-track-row:active { background: #171728; }
.daw-tracklist {
  border-right: 1px solid #222233;
  background: #0c0c16;
  display: flex; flex-direction: column;
}
.daw-tracklist-corner {
  height: 24px; padding: 0 8px;
  font: 600 9px/24px ui-monospace, monospace; letter-spacing: 0.12em;
  text-transform: uppercase; color: #5a6478;
  border-bottom: 1px solid #222233;
  background: #0a0a14;
}
.daw-track-row {
  min-height: var(--daw-lane-h);
  padding: 6px 6px 6px 4px;
  border-bottom: 1px solid #1a1a28;
  display: grid; grid-template-columns: 18px 1fr; grid-template-rows: auto auto auto;
  gap: 2px 4px; align-content: center;
}
.daw-track-row.muted { opacity: 0.45; }
.daw-track-num {
  grid-row: 1 / span 3; align-self: center;
  font: 600 10px ui-monospace, monospace; color: #4f5a6e; text-align: center;
}
.daw-track-meta { min-width: 0; }
.daw-track-meta b { display: block; color: #e8ecf8; font-size: 10px; line-height: 1.2; }
.daw-track-meta span { display: block; color: #6f7a90; font-size: 9px; line-height: 1.25; word-break: break-word; }
.daw-lane-stripe { display: block; width: 100%; height: 3px; border-radius: 99px; margin-bottom: 3px; border: 0; }
.daw-lane-stripe.beat { background: linear-gradient(90deg, #2f6dff, #6fa8ff); }
.daw-lane-stripe.vocal { background: linear-gradient(90deg, #d94f9a, #ff6fb5); }
.daw-lane-stripe.stem { background: linear-gradient(90deg, #7a58ff, #b08cff); }
.daw-track-btns {
  grid-column: 2; display: flex; flex-wrap: wrap; gap: 3px;
}
.daw-ico {
  border: 1px solid #30304a; border-radius: 5px; background: #141420;
  color: #b8c0d0; font: 600 9px/1 ui-monospace, monospace;
  padding: 3px 5px; cursor: pointer; min-width: 20px;
}
.daw-ico:hover { background: #1e1e30; color: #fff; }
.daw-ico.danger { color: #ff7a8a; border-color: #4a2830; }
.daw-ico.mute.active { background: #4a2830; color: #ff9aa6; border-color: #6a3340; }
.daw-ico.solo.active { background: #4a4220; color: #ffe08a; border-color: #6a5a2a; }
.daw-arrange { min-width: 0; display: flex; flex-direction: column; touch-action: manipulation; }
.daw-ruler {
  position: relative; height: 28px; flex-shrink: 0;
  border-bottom: 1px solid #222233;
  cursor: crosshair; touch-action: manipulation;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(12.5% - 1px), rgba(255,255,255,0.05) calc(12.5% - 1px), rgba(255,255,255,0.05) 12.5%),
    #0a0a14;
}
.daw-ruler-tick {
  position: absolute; top: 0; transform: translateX(-50%);
  font: 10px/24px ui-monospace, monospace; color: #6a7588; white-space: nowrap;
  pointer-events: none;
}
.daw-arrange-body { position: relative; flex: 1; }
.daw-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; left: 0;
  background: #ff4d6d;
  box-shadow: 0 0 10px rgba(255,77,109,0.8);
  z-index: 6; pointer-events: none;
}
.daw-playhead::before {
  content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #ff4d6d;
}
.daw-lane-stack { border-bottom: 1px solid #161622; }
.daw-lane-stack:last-child { border-bottom: 0; }
.daw-take-strip {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 4px 8px 6px  calc(var(--daw-head-w) + 4px);
  background: rgba(8, 8, 14, 0.55);
}
.daw-take-pill {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px;
  border: 1px solid #30304a; background: #141420; color: #9aa4b8;
  font: 700 10px/1 ui-monospace, monospace; cursor: pointer;
}
.daw-take-pill:hover { border-color: #6fa8ff; color: #cfe4ff; }
.daw-take-pill.active {
  background: rgba(111, 168, 255, 0.22); border-color: #6fa8ff; color: #eaf3ff;
  box-shadow: 0 0 0 1px rgba(111, 168, 255, 0.35);
}
.daw-lane-row {
  border-bottom: 1px solid #161622;
  min-height: var(--daw-lane-h);
}
.daw-lane-stack .daw-lane-row { border-bottom: 0; }
.daw-auto-stack {
  display: grid; gap: 2px;
  padding: 2px 0 6px calc(var(--daw-head-w) + 4px);
  background: rgba(6, 6, 12, 0.65);
  border-top: 1px solid rgba(255,255,255,0.04);
}
.daw-auto-row {
  display: grid; grid-template-columns: 28px 1fr; gap: 6px; align-items: stretch;
  min-height: 30px;
}
.daw-auto-label {
  font: 700 9px/30px ui-monospace, monospace; color: #6b7588; text-align: right;
}
.daw-auto-body {
  position: relative; height: 28px; border-radius: 5px;
  border: 1px solid #242436; background: rgba(255,255,255,0.02);
  cursor: crosshair; overflow: hidden;
}
.daw-auto-line {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.daw-auto-point {
  position: absolute; width: 9px; height: 9px; margin: -5px 0 0 -5px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,0.85);
  background: #1a1a28; cursor: grab; padding: 0; z-index: 2;
}
.daw-auto-row.vol .daw-auto-point { border-color: #3ecf8e; box-shadow: 0 0 6px rgba(62,207,142,0.35); }
.daw-auto-row.pan .daw-auto-point { border-color: #6fa8ff; box-shadow: 0 0 6px rgba(111,168,255,0.35); }
.daw-ico.auto.active { color: #3ecf8e; border-color: rgba(62,207,142,0.45); }
.daw-ico.auto.open { background: rgba(62,207,142,0.14); }
.daw-lane-row:last-child { border-bottom: 0; }
.daw-lane-row.muted .daw-clip { opacity: 0.38; filter: grayscale(0.35); }
.daw-lane-body {
  position: relative; height: var(--daw-lane-h); overflow: hidden; cursor: crosshair;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(12.5% - 1px), rgba(255,255,255,0.028) calc(12.5% - 1px), rgba(255,255,255,0.028) 12.5%),
    linear-gradient(180deg, rgba(255,255,255,0.015), transparent 55%);
}
.daw-lane-body:hover { background-color: rgba(111,168,255,0.03); }
.daw-clip {
  position: absolute; top: 7px; bottom: 7px; min-width: 3.5%;
  border-radius: 7px; overflow: hidden; cursor: grab;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
  touch-action: none;
}
.daw-clip:active, .daw-clip.dragging { cursor: grabbing; z-index: 5; }
.daw-clip.selected {
  border-color: #ffd166;
  box-shadow: 0 0 0 1px rgba(255,209,102,0.55), 0 4px 14px rgba(0,0,0,0.45);
}
.daw-clip.beat { background: linear-gradient(180deg, rgba(24,40,72,0.95), rgba(14,24,44,0.95)); border-color: rgba(90,150,255,0.45); }
.daw-clip.vocal { background: linear-gradient(180deg, rgba(52,20,44,0.95), rgba(30,12,28,0.95)); border-color: rgba(255,90,170,0.45); }
.daw-clip.stem { background: linear-gradient(180deg, rgba(36,24,58,0.95), rgba(20,14,36,0.95)); border-color: rgba(170,120,255,0.45); }
.daw-clip-label {
  position: absolute; top: 3px; left: 6px; z-index: 2;
  font: 600 9px/1.2 ui-monospace, monospace; color: rgba(255,255,255,0.88);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8); pointer-events: none;
  max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.daw-clip-handle {
  position: absolute; top: 0; bottom: 0; width: 10px; z-index: 3;
  background: rgba(255,255,255,0.12); opacity: 0; transition: opacity 0.12s;
  touch-action: none;
}
.daw-clip:hover .daw-clip-handle, .daw-clip.selected .daw-clip-handle { opacity: 1; }
.daw-clip-handle.left { left: 0; cursor: ew-resize; border-radius: 7px 0 0 7px; }
.daw-clip-handle.right { right: 0; cursor: ew-resize; border-radius: 0 7px 7px 0; }
.daw-clip.trimming { z-index: 5; box-shadow: 0 0 0 1px rgba(255,255,255,0.5); }
.daw-clip.trimming .daw-clip-handle { opacity: 1; background: rgba(255,255,255,0.32); }
.daw-roster {
  display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: rgba(255,255,255,0.08);
  color: var(--muted, #9aa4b2); cursor: default;
}
.daw-roster.full { background: rgba(255,120,120,0.18); color: #ffb3b3; }
/* Presence chips — who's in the session right now, from any city. */
.daw-top-left { min-width: 0; }
.daw-presence { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; align-items: center; }
.daw-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.07); color: #cfd6e4; border: 1px solid transparent;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.daw-chip .daw-chip-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #3fc380; flex-shrink: 0;
}
.daw-chip.me { background: rgba(111,168,255,0.16); color: #bcd4ff; }
.daw-chip.me .daw-chip-dot { background: #6fa8ff; }
.daw-chip.rec { background: rgba(225,74,66,0.2); color: #ffb3ae; border-color: #e14a42; }
.daw-chip.rec .daw-chip-dot { background: #ff5a5a; animation: dawRecPulse 1.2s ease-in-out infinite; }
.daw-chip.talk { border-color: #3fc380; box-shadow: 0 0 0 1px rgba(63,195,128,0.5); }
.daw-chip.talk .daw-chip-dot { box-shadow: 0 0 6px #3fc380; }
.daw-chip-hint { font-size: 10px; color: #6f7a90; }
.daw-wave { width: 100%; height: 100%; display: block; pointer-events: none; }
.daw-lane-empty {
  display: grid; place-items: center; height: 100%; width: calc(100% - 16px);
  color: #5a6478; font-size: 11px; border: 1px dashed #2a2a40; margin: 8px; border-radius: 8px;
  background: transparent; cursor: pointer; font-family: inherit; transition: border-color 0.12s, color 0.12s;
}
.daw-lane-empty:hover { border-color: #4d9fff; color: #9fc4ff; }
.daw-lane-row.drag-over { outline: 2px solid #4d9fff; outline-offset: -2px; background: rgba(77,159,255,0.08); }
.daw-lane-row.drag-over .daw-lane-empty { border-color: #4d9fff; color: #9fc4ff; }
.daw-mix-row { grid-column: 2; margin: 2px 0 0; display: flex; gap: 6px; min-width: 0; }
.daw-vol, .daw-pan { font-size: 9px; display: flex; align-items: center; gap: 4px; color: #8a96a8; min-width: 0; }
.daw-mix-row .daw-vol { flex: 1.4; }
.daw-mix-row .daw-pan { flex: 1; }
.daw-vol input[type="range"], .daw-pan input[type="range"] { flex: 1; min-width: 0; height: 12px; }
.daw-gain-line {
  position: absolute; left: 0; right: 0; height: 8px; margin-top: -4px; z-index: 4;
  cursor: ns-resize; touch-action: none;
}
.daw-gain-line::before {
  content: ''; position: absolute; left: 0; right: 0; top: 3px; height: 2px;
  background: rgba(255, 214, 88, 0.85); box-shadow: 0 0 4px rgba(0,0,0,0.6);
}
.daw-gain-line::after {
  content: attr(data-gain-label); position: absolute; right: 3px; top: -11px;
  font: 700 8px/1 ui-monospace, monospace; color: #ffd658;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  opacity: 0; transition: opacity 0.12s; pointer-events: none;
}
.daw-clip:hover .daw-gain-line::after, .daw-clip.gain-dragging .daw-gain-line::after { opacity: 1; }
.daw-clip.gain-dragging .daw-gain-line::before { background: #ffd658; height: 2.5px; }
/* Live level meters — horizontal in track heads, vertical in the mixer. */
.daw-meter {
  position: relative; display: block; overflow: hidden;
  background: #0d0d18; border: 1px solid #23233a; border-radius: 3px;
}
.daw-meter i { position: absolute; display: block; }
.daw-meter-h { grid-column: 2; height: 6px; margin-top: 3px; }
.daw-meter-h i {
  left: 0; top: 0; bottom: 0; width: var(--lvl, 0%);
  background: linear-gradient(90deg, #3fc380, #a6d94d 70%, #e8c84d);
  transition: width 0.05s linear;
}
.daw-meter-v { width: 9px; align-self: stretch; }
.daw-meter-v i {
  left: 0; right: 0; bottom: 0; height: var(--lvl, 0%);
  background: linear-gradient(0deg, #3fc380, #a6d94d 70%, #e8c84d);
  transition: height 0.05s linear;
}
.daw-meter i.hot { background: #ff5a5a; }
.daw-ico.arm.active { background: #b3261e; border-color: #e14a42; color: #fff; }

/* Mixer panel — overlays the timeline so the arrange view keeps maximum height. */
.daw-mixer-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 12;
  display: flex; flex-direction: column; gap: 0;
  max-height: min(42%, 220px);
  border: 1px solid #2a2a40; border-radius: 10px 10px 0 0;
  background: rgba(8,8,14,0.97);
  box-shadow: 0 -8px 28px rgba(0,0,0,0.45);
  -webkit-overflow-scrolling: touch;
}
.daw-mixer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-bottom: 1px solid #222233; flex-shrink: 0;
}
.daw-mixer-head b { font-size: 11px; color: #9eb8e8; text-transform: uppercase; letter-spacing: 0.08em; }
.daw-mixer-close {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid #30304a;
  background: #141420; color: #c0c8d8; cursor: pointer; font-size: 16px; line-height: 1;
}
.daw-mixer-strips {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px 10px;
  -webkit-overflow-scrolling: touch;
}
.daw-mixer {
  display: flex; gap: 8px; overflow-x: auto; flex-shrink: 0;
  padding: 10px; margin-top: 8px;
  border: 1px solid #2a2a40; border-radius: 10px;
  background: rgba(8,8,14,0.94);
  -webkit-overflow-scrolling: touch;
}
.daw-strip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 84px; padding: 8px 6px;
  border: 1px solid #232338; border-radius: 8px; background: #10101c;
}
.daw-strip.muted { opacity: 0.55; }
.daw-strip-name {
  max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #dfe6f5; font: 700 10px ui-monospace, monospace; text-transform: uppercase;
}
.daw-strip-mid { display: flex; gap: 6px; height: 110px; align-items: stretch; }
.daw-fader {
  position: relative; width: 26px; border-radius: 6px;
  background: #171725; border: 1px solid #2b2b44;
  cursor: ns-resize; touch-action: none;
}
.daw-fader-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(0deg, rgba(111,168,255,0.5), rgba(111,168,255,0.14));
  border-radius: 0 0 5px 5px; pointer-events: none;
}
.daw-fader-knob {
  position: absolute; left: -3px; right: -3px; height: 10px; margin-bottom: -5px;
  background: #e6ebf5; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,0.6);
  pointer-events: none;
}
.daw-strip-val { color: #8a96a8; font: 700 10px ui-monospace, monospace; }
.daw-strip-pan { width: 68px; height: 12px; }
.daw-strip-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.daw-ico.fx.active { background: #243858; border-color: #4a7dff; color: #b8d4ff; }
.daw-ico.fx.open { box-shadow: 0 0 0 1px rgba(111,168,255,0.45); }
.daw-ico.comp.active { background: #2a3a28; border-color: #5abf7a; color: #b8ffd0; }
.daw-strip.fx-open { min-width: 108px; }
.daw-strip-fx {
  display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  width: 100%; margin-top: 4px; padding-top: 6px; border-top: 1px solid #222233;
}
.daw-strip-fx.open { display: grid; }
.daw-fx-knob {
  display: grid; gap: 2px; font: 700 8px/1 ui-monospace, monospace; color: #7a8498; text-align: center;
}
.daw-fx-knob input[type="range"] { width: 100%; height: 10px; margin: 0; }
.daw-strip-empty { margin: auto 0; color: #4f5a6e; font-size: 10px; text-align: center; }
.daw-strip.empty { justify-content: center; min-height: 160px; }

.daw-rec.active {
  background: #b3261e; border-color: #e14a42; color: #fff;
  animation: dawRecPulse 1.2s ease-in-out infinite;
}
@keyframes dawRecPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 74, 66, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(225, 74, 66, 0); }
}
.daw-hint { margin: 8px 0 0; font-size: 10px; text-align: center; }
.daw-bpm { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #8a96a8; font-weight: 600; }
.daw-bpm input { width: 46px; padding: 4px 5px; font-size: 11px; text-align: center; background: #141420; color: #e6ebf2; border: 1px solid #30304a; border-radius: 5px; }
.daw-countin {
  display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px;
  font: 800 20px/1 ui-monospace, monospace; color: #4d9fff;
  background: rgba(77,159,255,0.12); border: 1px solid rgba(77,159,255,0.4); border-radius: 8px;
}
.daw-countin[hidden] { display: none; }
.daw-record-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 8px; }
.daw-record-row .btn-primary { flex: 1 1 auto; }
.daw-note { margin: 0 0 8px; font-size: 11px; }
.daw-footer { margin-top: 4px; }
.daw-loading { padding: 24px 8px; text-align: center; color: #8a96a8; }

@media (max-width: 640px) {
  .daw-float-backdrop { padding: 0; place-items: stretch; }
  .daw-float-window {
    width: 100%; max-height: none; height: 100%;
    border-radius: 0; border: 0;
    transform: translateY(100%);
  }
  .daw-float-backdrop.open .daw-float-window { transform: none; }
  .daw-float-body { padding: 8px 10px calc(12px + env(safe-area-inset-bottom, 0)); }
  .daw-shell { --daw-head-w: 88px; --daw-lane-h: 56px; padding: 8px; margin: 0; }
  .daw-top { flex-direction: column; align-items: stretch; }
  .daw-mode-tabs { width: 100%; }
  .daw-mode-tabs .btn { flex: 1; min-height: 40px; }
  .daw-toolbar { flex-direction: column; align-items: stretch; }
  .daw-timeblock { margin-left: 0; text-align: left; }
  .daw-edit-tools .btn { flex: 1 1 calc(50% - 4px); }
  .daw-workspace { min-width: 480px; }
  .daw-ico { min-width: 28px; min-height: 28px; padding: 5px 6px; }
  .daw-record-row .btn { min-height: 44px; }
}

@media (min-width: 900px) {
  .daw-shell { --daw-head-w: 120px; --daw-lane-h: 68px; }
  .daw-workspace { min-width: 100%; }
}

/* Live citizen interactions */
.citizen-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; }
.citizen-actions .btn:first-child { grid-column: 1 / -1; }
.emote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.emote-choice {
  display: grid; place-items: center; gap: 5px; min-height: 86px;
  border: 1px solid #303049; border-radius: 14px; background: #15151f;
  color: #e8e8f0; font: inherit; cursor: pointer;
}
.emote-choice span { font-size: 30px; }
.emote-choice:active { transform: scale(.96); background: #202032; }
#voice-call-bar {
  position: fixed; z-index: 105; left: 50%; top: calc(64px + env(safe-area-inset-top, 0));
  transform: translate(-50%, -14px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px);
  padding: 9px 10px 9px 14px; border: 1px solid #3fc380; border-radius: 14px;
  background: rgba(10,18,16,.96); color: #dff8e8; box-shadow: 0 8px 30px rgba(0,0,0,.45);
  transition: opacity .16s, transform .16s;
}
#voice-call-bar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#voice-call-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#voice-call-bar button {
  border: 1px solid #365247; border-radius: 9px; padding: 7px 9px;
  background: #17251f; color: #e8e8f0; font: inherit; white-space: nowrap; cursor: pointer;
}
@media (max-width: 520px) {
  .arcade-choices { grid-template-columns: 1fr; }
  .arcade-topbar { align-items: stretch; flex-direction: column; }
  .arcade-exit { width: 100%; }
}

/* ── Small phones: keep the HUD compact and on one row ── */
@media (max-width: 400px) {
  .hud-top { gap: 6px; padding: 8px 10px; }
  .hud-pill { padding: 5px 9px; font-size: 12px; }
  #hud-name { max-width: 24vw; }
  .hud-right { gap: 8px; }
  .hud-btn { width: 48px; height: 48px; font-size: 21px; }
  .sheet h2 { font-size: 17px; }
  .furn-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px), (pointer: coarse) {
  :root {
    --mobile-corner-inset: calc(14px + env(safe-area-inset-bottom, 0px));
    --mobile-corner-h: 54px;
    --mobile-joystick-h: 126px;
    --mobile-bottom-band: calc(var(--mobile-joystick-h) + var(--mobile-corner-inset) + 6px);
  }
  html:has(#hud.joystick-hidden) {
    --mobile-bottom-band: calc(var(--mobile-corner-h) + var(--mobile-corner-inset) + 10px);
  }

  #joystick { display: block; bottom: var(--mobile-corner-inset); }
  #hud.joystick-hidden #joystick { display: none; }

  .hud-menu-toggle { bottom: var(--mobile-corner-inset); z-index: 2; }

  #hud.menu-open { z-index: 43; }
  .hud-right {
    bottom: calc(var(--mobile-bottom-band) + 12px);
    max-height: min(56vh, calc(var(--app-h, 100vh) - var(--mobile-bottom-band) - env(safe-area-inset-top, 0px) - 72px));
    z-index: 3;
  }

  #spatial-av-launcher { bottom: var(--mobile-corner-inset); }

  .perf-mini { bottom: calc(var(--mobile-bottom-band) + 52px); }

  #interact-hint { top: calc(72px + env(safe-area-inset-top, 0)); max-width: 90vw; font-size: 11px; padding: 6px 12px; }
}

/* ── Guided demo overlay (no dimming — card + highlight ring only) ── */
#guided-demo {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0;
  transition: opacity .18s ease;
}
#guided-demo.show { opacity: 1; }
#guided-demo:not(.show) .guided-demo-card,
#guided-demo:not(.show) .guided-demo-ring {
  pointer-events: none !important;
  visibility: hidden;
}
.guided-demo-ring {
  position: fixed; border: 2px solid #00e8ff; border-radius: 14px;
  box-shadow: 0 0 18px rgba(0,232,255,.45);
  pointer-events: none; transition: left .12s ease, top .12s ease, width .12s ease, height .12s ease;
}
.guided-demo-card {
  position: fixed; width: min(360px, calc(100vw - 24px)); padding: 14px 14px 12px;
  border: 1px solid #34344b; border-radius: 14px; background: rgba(12,12,22,.97);
  box-shadow: 0 16px 40px rgba(0,0,0,.45); color: #e8e8f0; pointer-events: auto;
  max-height: min(42vh, 320px); overflow: auto;
}
.guided-demo-card-center {
  width: min(420px, calc(100vw - 24px));
  left: 50% !important; top: auto !important; right: auto !important;
  transform: translateX(-50%) !important;
}
.guided-demo-progress { color: #7a8a9a; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.guided-demo-title { margin: 0 0 8px; font-size: 17px; color: #00e8ff; }
.guided-demo-body { margin: 0 0 12px; color: #b8b8c8; font-size: 13px; line-height: 1.45; }
.guided-demo-actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; }

/* ── Landscape phones: sheets are short, so allow more height ── */
@media (max-height: 480px) and (orientation: landscape) {
  .sheet { max-height: 88vh; }
  .sheet.sheet-tall { max-height: 92vh; }
}

/* ── Accessibility: honor reduced-motion (stops CSS pulses/slides; game loop unaffected) ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.06s !important;
  }
}

/* ── Build-my-city intake form ── */
select.cr-input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8d8d99 50%), linear-gradient(135deg, #8d8d99 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 12px) 18px; background-size: 6px 6px; background-repeat: no-repeat; }
.intake-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #c8c8d4; background: #15151f; border: 1px solid #26263a; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: #00a8d8; flex: none; }
@media (max-width: 400px) { .intake-checks { grid-template-columns: 1fr; } }

/* ── Style picker ── */
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.style-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; background: #15151f; border: 2px solid #26263a; border-radius: 14px; padding: 12px 8px; color: #e8e8f0; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.style-pick.sel { border-color: #00e8ff; box-shadow: 0 0 12px rgba(0,232,255,0.3); }
.style-pick:active { transform: scale(0.97); }
.style-swatch { width: 100%; height: 46px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); }

/* ── Draft-city preview banner ── */
#preview-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(54px + env(safe-area-inset-top, 0)); z-index: 30;
  display: flex; align-items: center; gap: 10px; max-width: 94vw;
  background: rgba(14,14,26,0.94); border: 1px solid #00a8d8; border-radius: 14px;
  padding: 7px 10px 7px 14px; font-size: 12px; color: #cfe9ff;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5); backdrop-filter: blur(6px);
}
#preview-banner b { color: #00e8ff; }
#preview-banner .pv-actions { display: flex; gap: 6px; flex: none; }
#preview-banner .btn { margin: 0; width: auto; }
@media (max-width: 420px) { #preview-banner { flex-direction: column; align-items: stretch; text-align: center; } }

/* ── Base dashboard (apartment-as-homepage) ─────────────────────────────── */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin: 14px 0 4px; }
.dash-stat {
  background: #15151f; border: 1px solid #26263a; border-radius: 10px;
  padding: 9px 4px; text-align: center; display: grid; gap: 2px;
}
.dash-stat b { color: #e8e8f0; font-size: 15px; }
.dash-stat span { color: #9da9b5; font-size: 10px; line-height: 1.2; }
.dash-feed { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.dash-feed-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  background: #15151f; border: 1px solid #26263a; border-radius: 8px; padding: 8px 10px;
}
.dash-feed-row span { color: #d8d8e4; font-size: 12px; line-height: 1.35; }
.dash-feed-row time { color: #7b8794; font-size: 10px; flex: none; }
@media (max-width: 420px) { .dash-stats { grid-template-columns: repeat(3, 1fr); } }

/* ── Cosmetics boutique (coin sink) ─────────────────────────────────────── */
.cos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.cos-tile {
  background: #15151f; border: 1px solid #26263a; border-radius: 10px;
  padding: 10px 6px; display: grid; gap: 4px; justify-items: center; cursor: pointer;
  color: #d8d8e4; font: inherit; transition: border-color .12s, background .12s;
}
.cos-tile:hover { border-color: #3a3a55; background: #1a1a28; }
.cos-tile.sel { border-color: #3fc380; box-shadow: inset 0 0 0 1px rgba(63,195,128,0.4); }
.cos-prev { font-size: 24px; line-height: 1; min-height: 26px; }
.cos-name { font-size: 11px; color: #cfd6e0; }
.cos-cost { font-size: 11px; color: #e8c84d; font-weight: 700; }
.cos-own { font-size: 10px; color: #7ea8ff; }
.cos-eq { font-size: 10px; color: #3fc380; font-weight: 700; }

/* ── Per-city branded landing skins ───────────────────────────────────────────
   Driven by --city-accent/--city-accent2/--city-sky set in applyCityLandingSkin,
   plus an experience-type skin class so each owned city looks like its own site. */
#title.title-branded .btn.btn-primary {
  background: var(--city-accent, #00e8ff); border-color: var(--city-accent, #00e8ff);
  color: #07070d; text-shadow: none;
}
#title.title-branded .title-logo { text-shadow: none; }
#title.title-branded .title-copy h1 {
  color: #f8fafc;
  text-shadow: 0 2px 18px rgba(0,0,0,0.42);
}
#title.title-branded .title-sub {
  color: rgba(238, 244, 255, 0.88);
  text-shadow: 0 1px 12px rgba(0,0,0,0.34);
}
#title.title-branded .title-tag {
  color: color-mix(in srgb, var(--city-accent2, #dbeafe) 68%, #ffffff);
  text-shadow: 0 1px 10px rgba(0,0,0,0.36);
}
#title.title-branded .title-note {
  color: rgba(226, 232, 240, 0.78);
}
#title.title-branded .title-note strong,
#title.title-branded .title-links a {
  color: rgba(248, 250, 252, 0.86);
}
#title.title-branded .title-links a:hover,
#title.title-branded .title-links a:focus-visible { color: var(--city-accent, #0c0d12); }

/* venue: bold, uppercase (clean light theme — no neon glow) */
#title.title-skin-neon .title-copy h1 { text-transform: uppercase; letter-spacing: -0.02em; }

/* museum / archive: elegant serif, calmer */
#title.title-skin-gallery .title-logo,
#title.title-skin-gallery .title-copy h1 { font-family: Georgia, 'Times New Roman', serif; text-transform: none; letter-spacing: 0; }
#title.title-skin-gallery .title-copy h1 { font-weight: 700; }

/* convention / expo and brand cities: clean modern */
#title.title-skin-expo .title-copy h1,
#title.title-skin-modern .title-copy h1 { text-transform: none; }

/* ── World Atlas (Roblox-style city transit) ──────────────────────────────── */
.wt-cats { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; scrollbar-width: none; }
.wt-cats::-webkit-scrollbar { display: none; }
.wt-chip { flex: none; border: 1px solid #33334a; background: #1a1a28; color: #c2c2d0; border-radius: 999px; padding: 6px 13px; font: 700 12px 'Courier New', monospace; cursor: pointer; }
.wt-chip.on { background: #00e8ff; border-color: #00e8ff; color: #07121a; }
.wt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wt-card { background: #14141f; border: 1px solid #26263a; border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .1s, border-color .12s; text-align: left; }
.wt-card:hover { transform: translateY(-2px); border-color: var(--wt-accent, #00e8ff); }
.wt-card.here { border-color: var(--wt-accent, #00e8ff); box-shadow: inset 0 0 0 1px var(--wt-accent, #00e8ff); }
.wt-thumb { position: relative; aspect-ratio: 16 / 9; background: #0a0a12; }
.wt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wt-cat { position: absolute; top: 7px; left: 7px; background: rgba(8,8,16,0.82); color: #e8e8f0; font: 800 9px 'Courier New', monospace; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; }
.wt-pop { position: absolute; bottom: 7px; left: 7px; background: rgba(8,8,16,0.82); color: #7ee0b0; font: 800 11px 'Courier New', monospace; padding: 3px 7px; border-radius: 999px; }
.wt-badge { position: absolute; bottom: 7px; right: 7px; background: var(--wt-accent, #00e8ff); color: #07121a; font: 800 9px 'Courier New', monospace; padding: 3px 8px; border-radius: 999px; }
.wt-go { position: absolute; bottom: 7px; right: 7px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--wt-accent, #00e8ff); color: #07121a; font-size: 14px; cursor: pointer; display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0,0,0,0.45); }
.wt-go:active { transform: scale(0.92); }
.wt-fav {
  position: absolute; top: 7px; right: 7px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(8,8,16,0.68); color: #ffd24a; font-size: 15px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.wt-fav:hover { background: rgba(8,8,16,0.9); }
.wt-fav.on { background: rgba(255,210,74,0.18); }
.wt-fav:active { transform: scale(0.9); }
.wt-section {
  color: #e8e8f0; font: 800 13px 'Courier New', monospace; letter-spacing: .04em; text-transform: uppercase;
  margin: 16px 2px 9px; opacity: 0.82;
}
.wt-section:first-child { margin-top: 4px; }
.wt-name { color: #e8e8f0; font-weight: 800; font-size: 14px; padding: 9px 11px 0; line-height: 1.2; }
.wt-role { font-size: 11px; padding: 2px 11px 11px; line-height: 1.3; }
/* detail */
.wt-hero { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid #2a2a3e; }
.wt-hero img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.wt-desc { color: #c8c8d4; font-size: 14px; line-height: 1.55; margin: 8px 0; }
.wt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wt-tag { background: #1a1a28; border: 1px solid #2e2e44; color: #9aa7b4; font-size: 11px; padding: 3px 9px; border-radius: 999px; }
@media (max-width: 380px) { .wt-grid { grid-template-columns: 1fr; } }

/* BlakMarket Directory Kiosk — searchable business list */
.mkt-search {
  width: 100%; box-sizing: border-box; margin: 4px 0 10px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid #2a2a40;
  background: #14141f; color: #e6ebf2; font: inherit; font-size: 14px;
}
.mkt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mkt-chip {
  border: 1px solid #2e2e44; background: #171722; color: #b8c0d0;
  font: 600 11px ui-monospace, monospace; padding: 5px 11px; border-radius: 999px; cursor: pointer;
}
.mkt-chip:hover { border-color: #4a4a68; color: #fff; }
.mkt-chip.on { background: #E8A54B; border-color: #E8A54B; color: #1a1206; }
.mkt-list { display: flex; flex-direction: column; gap: 8px; }
.mkt-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; border: 1px solid #23233a; border-radius: 10px; background: rgba(255,255,255,0.03);
}
.mkt-row[hidden] { display: none; }
.mkt-swatch {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
.mkt-info { flex: 1; min-width: 0; }
.mkt-info b { display: block; color: #eef2f8; font-size: 14px; }
.mkt-tag { display: inline-block; color: #E8A54B; font: 700 10px ui-monospace, monospace; text-transform: uppercase; letter-spacing: 0.04em; margin: 1px 0 3px; }
.mkt-info p { margin: 0; color: #97a1b2; font-size: 12px; line-height: 1.4; }
.mkt-act { flex-shrink: 0; align-self: center; }
.mkt-empty { color: #97a1b2; text-align: center; padding: 20px 0; font-size: 13px; }

/* Landing reel video: keep the clean white layout, but let the muted hero reel render. */
.title-reel {
  display: block !important; position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; opacity: 0.16;
  filter: saturate(0.95) contrast(1.05); pointer-events: none; background: #ffffff;
}
.title-shade {
  display: block !important; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.88) 52%, rgba(255,255,255,0.72) 100%);
}
.title-shell, .title-features { position: relative; z-index: 2; }
