/* ============================================================
   CITY MAP — immersive neon night-city home screen
   ============================================================ */
.city-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(900px 540px at 50% 38%, oklch(0.28 0.06 285 / 0.55), transparent 70%),
    radial-gradient(700px 500px at 85% 90%, oklch(0.26 0.07 210 / 0.4), transparent 70%),
    linear-gradient(180deg, oklch(0.13 0.03 270), oklch(0.16 0.035 265));
}
/* faint starfield / grid dust */
.city-screen::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(1px 1px at 20% 30%, oklch(0.8 0.05 280 / 0.4) 50%, transparent),
    radial-gradient(1px 1px at 70% 20%, oklch(0.8 0.05 210 / 0.3) 50%, transparent),
    radial-gradient(1px 1px at 40% 70%, oklch(0.8 0.05 290 / 0.25) 50%, transparent),
    radial-gradient(1px 1px at 85% 60%, oklch(0.8 0.05 250 / 0.3) 50%, transparent),
    radial-gradient(1.5px 1.5px at 60% 85%, oklch(0.8 0.05 200 / 0.3) 50%, transparent);
  background-size: 320px 320px;
  opacity: .6;
}

.city-fit { position: absolute; inset: 0; display: grid; place-items: center; }
.city-stage { position: relative; width: 920px; height: 560px; transform-origin: center center; }
.city-stage svg.iso { position: absolute; inset: 0; overflow: visible; }

/* floating building label cards */
.bld-card {
  position: absolute;
  transform: translate(-50%, -100%);
  background: oklch(0.2 0.03 268 / 0.86);
  border: 1px solid var(--edge, var(--hairline));
  border-radius: 13px;
  padding: 9px 12px 10px;
  min-width: 158px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px -14px black, 0 0 0 1px oklch(0 0 0 / 0.3);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s;
  z-index: 5;
}
.bld-card:hover { box-shadow: 0 0 0 1px var(--edge), 0 0 22px -2px var(--edge), 0 16px 36px -14px black; }
.bld-card::after {
  content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  width: 1px; height: 9px; background: var(--edge);
  box-shadow: 0 0 6px var(--edge);
}
.bld-card .bc-top { display: flex; align-items: center; gap: 9px; }
.bld-card .bc-glyph {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--edge); color: oklch(0.16 0.03 268);
  box-shadow: 0 0 14px -2px var(--edge);
}
.bld-card .bc-name { font-size: 13px; font-weight: 700; line-height: 1.1; }
.bld-card .bc-th { font-size: 10px; color: var(--tx-faint); }
.bld-card .bc-desc { font-family: var(--mono); font-size: 9.5px; color: var(--tx-faint); letter-spacing: .02em; margin-top: 7px; }
.bld-card .bc-alert {
  position: absolute; top: -10px; right: -10px;
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px;
  display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: white; box-shadow: 0 0 0 2px oklch(0.16 0.03 268), 0 0 14px -1px currentColor;
}
.bc-alert.danger { background: var(--danger); }
.bc-alert.warn { background: var(--warn); color: oklch(0.22 0.05 78); }
.bc-alert.info { background: var(--info); }
.bld-card .bc-zero {
  position: absolute; top: -8px; right: -8px; width: 18px; height: 18px; border-radius: 99px;
  display: grid; place-items: center; background: var(--panel-2); color: var(--ok);
  box-shadow: 0 0 0 2px oklch(0.16 0.03 268);
}

/* hovered building emphasis (drives svg filter via data attr handled inline) */

/* ---- floating glass panels ---- */
.city-panel {
  position: absolute; z-index: 12;
  background: oklch(0.19 0.03 268 / 0.82);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}
:root[data-theme="light"] .city-panel { background: oklch(0.99 0.004 264 / 0.9); border-color: var(--hairline); }

/* collapsible panel header + body */
.cp-bar {
  display: flex; align-items: center; gap: 9px; padding: 12px 14px; cursor: pointer;
  user-select: none; border-bottom: 1px solid var(--hairline-soft);
}
.cp-bar > svg { color: var(--tx-dim); flex: 0 0 auto; }
.cp-bar h4 { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.cp-bar h4 .th { font-size: 10.5px; color: var(--tx-faint); margin-left: 6px; }
.cp-bar .cp-count {
  margin-left: 4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--warn); color: oklch(0.22 0.05 78);
}
.cp-collapse {
  margin-left: auto; width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--hairline-soft); border-radius: 7px;
  color: var(--tx-faint); cursor: pointer; transition: color .15s, background .15s, transform .2s;
}
.cp-bar:hover .cp-collapse { color: var(--tx); }
.cp-collapse > svg { transition: transform .25s ease; }
.city-panel.is-collapsed .cp-collapse > svg { transform: rotate(-90deg); }
.cp-collapsible { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .26s ease; min-height: 0; }
.cp-collapsible > * { min-height: 0; }
.city-panel.is-collapsed .cp-collapsible { grid-template-rows: 0fr; }
.city-panel.is-collapsed { box-shadow: var(--shadow); }
.city-panel.rt.is-collapsed { max-height: none; }
/* keep the feed area scrollable only when open */
.city-panel.rt .cp-collapsible { overflow: hidden; }
.city-panel.rt .feed { max-height: calc(100vh - 220px); }

/* light-theme fixes for inner dark surfaces */
:root[data-theme="light"] .feed-item:hover { background: oklch(0.94 0.01 264 / 0.8); }
:root[data-theme="light"] .act-cell { background: oklch(0.965 0.008 264 / 0.9); }
:root[data-theme="light"] .city-hint { background: oklch(0.99 0.004 264 / 0.85); border-color: var(--hairline); }
.city-panel.tl { top: 22px; left: 24px; width: 270px; }
.city-panel.rt { top: 22px; right: 24px; width: 312px; max-height: calc(100% - 44px); display: flex; flex-direction: column; }
.city-panel.bl { bottom: 22px; left: 24px; width: 360px; }
.cp-pad { padding: 16px 18px; }
.cp-head { display: flex; align-items: center; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--hairline-soft); }
.cp-head h4 { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; }
.cp-head .th { font-size: 10.5px; }

.status-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ok); font-weight: 600; }
.alert-headline { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 4px; }
.alert-headline .big { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--warn); font-variant-numeric: tabular-nums; }
.alert-headline .lbl { font-size: 12px; color: var(--tx-dim); }
.alert-breakdown { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }

.feed { overflow-y: auto; padding: 6px; }
.feed-item {
  display: flex; gap: 11px; padding: 10px 11px; border-radius: 11px; cursor: pointer; align-items: flex-start;
  transition: background .13s;
}
.feed-item:hover { background: oklch(0.25 0.036 268 / 0.6); }
.feed-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.feed-body { flex: 1; min-width: 0; }
.feed-en { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.feed-th { font-size: 11px; color: var(--tx-faint); line-height: 1.3; margin-top: 1px; }
.feed-time { font-family: var(--mono); font-size: 10px; color: var(--tx-ghost); margin-top: 3px; }

.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hairline-soft); border-radius: 12px; overflow: hidden; }
.act-cell { background: oklch(0.2 0.03 268 / 0.7); padding: 12px 14px; }
.act-cell .av { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.act-cell .al { font-size: 10.5px; color: var(--tx-faint); margin-top: 2px; }
.act-cell .av small { font-size: 12px; color: var(--tx-faint); }

.city-hint {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 12;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--tx-faint);
  background: oklch(0.18 0.03 268 / 0.7); border: 1px solid var(--hairline-soft);
  padding: 7px 14px; border-radius: 99px; backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 8px;
}

@media (max-width: 1180px) {
  .city-panel.bl { width: 300px; }
  .city-panel.rt { width: 270px; }
}

/* ============================================================
   HOME (image) — pixel office building + iso background + pan/zoom
   ============================================================ */
:root {
  --iso-line: oklch(0.7 0.08 250 / 0.16);
  --iso-sky-1: oklch(0.2 0.05 280);
  --iso-sky-2: oklch(0.13 0.03 268);
  --iso-glow: oklch(0.45 0.13 285 / 0.5);
  --iso-glow2: oklch(0.4 0.12 210 / 0.4);
  --iso-star: oklch(0.9 0.04 250 / 0.6);
}
:root[data-theme="light"] {
  --iso-line: oklch(0.45 0.06 250 / 0.14);
  --iso-sky-1: oklch(0.9 0.05 235);
  --iso-sky-2: oklch(0.84 0.06 220);
  --iso-glow: oklch(0.95 0.07 90 / 0.7);
  --iso-glow2: oklch(0.88 0.08 210 / 0.55);
  --iso-star: oklch(1 0.02 250 / 0.7);
}

.img-home {
  position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; display: flex;
}

/* layered isometric backdrop */
.iso-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.iso-sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--iso-sky-1), var(--iso-sky-2));
  transition: background .4s;
}
.iso-parallax { position: absolute; inset: -6%; will-change: transform; }
.city-bg-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  image-rendering: auto; user-select: none; -webkit-user-drag: none;
  opacity: .34; filter: blur(1.5px) saturate(.92);
}
.city-bg-img.light-only { display: none; }
:root[data-theme="light"] .city-bg-img.dark-only { display: none; }
:root[data-theme="light"] .city-bg-img.light-only { display: block; opacity: .42; }
/* fade scrim so the building always reads above the backdrop */
.iso-fade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 38%, var(--iso-sky-2) 86%),
    linear-gradient(180deg, transparent 40%, oklch(0.1 0.03 268 / 0.35));
  transition: background .4s;
}
:root[data-theme="light"] .iso-fade {
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 42%, var(--iso-sky-1) 88%),
    linear-gradient(180deg, transparent 50%, oklch(0.9 0.04 240 / 0.4));
}

/* pan + zoom stage */
.city-stage {
  position: relative; z-index: 1; flex: 1; min-width: 0; min-height: 0; height: 100%; align-self: stretch;
  display: grid; place-items: center;
  overflow: hidden; cursor: grab; touch-action: none; padding: 20px 296px 24px 26px;
}
.city-stage.grabbing, .city-stage:active { cursor: grabbing; }
@media (max-width: 1320px) { .city-stage { padding: 18px 248px 22px 18px; } }
@media (max-width: 980px)  { .city-stage { padding: 14px 14px 16px; } }
.city-stage-inner { will-change: transform; }

.img-scene {
  position: relative;
  height: min(90vh, 1040px);
  aspect-ratio: 1 / 1;
  max-width: 100%;
  filter: drop-shadow(0 30px 60px oklch(0.05 0.02 268 / 0.6));
}
.img-bld { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; user-select: none; -webkit-user-drag: none; }
.img-bld.light-only { display: none; }
:root[data-theme="light"] .img-bld.dark-only { display: none; }
:root[data-theme="light"] .img-bld.light-only { display: block; }

/* opt-in sound control; audio begins only after a click */
.sound-ctrl {
  position: absolute; left: 22px; bottom: 78px; z-index: 14; display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--hairline);
  background: var(--panel); color: var(--tx-dim); box-shadow: var(--shadow); cursor: pointer;
  font: 600 11px/1 var(--sans); backdrop-filter: blur(8px); transition: .18s;
}
.sound-ctrl:hover { color: var(--tx); border-color: var(--cyan); }
.sound-ctrl.is-on { color: var(--ok); border-color: var(--ok); box-shadow: 0 0 18px -7px var(--ok), var(--shadow); }
.sound-icon { font-size: 15px; }

/* hotspot polygons — invisible click/hover targets (no room-wide glow) */
.img-hot { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; }
.hot-poly { fill: transparent; stroke: none; cursor: pointer; }

/* zoom controls */
.zoom-ctrl {
  position: absolute; left: 22px; bottom: 22px; z-index: 14; display: flex; align-items: center; gap: 4px;
  padding: 5px; border-radius: 12px; background: var(--panel); border: 1px solid var(--hairline);
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.zoom-ctrl button {
  width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: none; color: var(--tx-dim); border-radius: 8px; transition: background .14s, color .14s;
}
.zoom-ctrl button:hover { background: var(--panel-3); color: var(--tx); }
.zoom-ctrl .zoom-val { font-family: var(--mono); font-size: 11.5px; color: var(--tx-faint); min-width: 40px; text-align: center; }
.zoom-ctrl .zoom-reset { border-left: 1px solid var(--hairline-soft); border-radius: 0 8px 8px 0; }

/* encouragement mascot (placeholder block, swap PNG later) — bottom right */
.mascot { position: absolute; right: 24px; bottom: 24px; z-index: 14; display: flex; flex-direction: column; align-items: flex-end; gap: 9px; max-width: 240px; }
.mascot-bubble {
  position: relative; background: var(--panel); color: var(--accent-bright); border: 1.5px solid var(--accent);
  border-radius: 12px; padding: 9px 13px; font-size: 12.5px; font-weight: 600; line-height: 1.35;
  box-shadow: 0 10px 26px -12px black, 0 0 18px -6px var(--accent); margin-right: 16px; animation: pepIn .4s ease;
}
.mascot-bubble::after { content: ""; position: absolute; bottom: -10px; right: 20px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 10px solid var(--accent); }
@keyframes pepIn { 0% { opacity: 0; transform: translateY(6px) scale(.96); } 100% { opacity: 1; transform: none; } }
.mascot-close {
  position: absolute; top: -8px; right: -8px; z-index: 2; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; background: var(--panel); border: 1px solid var(--hairline);
  color: var(--tx-faint); box-shadow: 0 2px 8px -2px black; transform: rotate(90deg);
}
.mascot-close:hover { color: var(--tx); }
.mascot-reopen {
  position: absolute; right: 24px; bottom: 24px; z-index: 14; width: 52px; height: 52px; border-radius: 14px; cursor: pointer;
  background: radial-gradient(circle at 50% 36%, oklch(0.8 0.13 60), oklch(0.66 0.16 42) 70%);
  border: 3px solid #14110c; box-shadow: 0 8px 18px -8px black; display: grid; place-items: center;
  animation: mascotIdle 3.6s ease-in-out infinite;
}
.mascot-reopen .mph-face { display: flex; gap: 11px; }
.mascot-reopen .mph-eye { width: 9px; height: 11px; }
.mascot-ph {
  position: relative; width: 88px; height: 88px; border: 3px solid #14110c; border-radius: 16px; cursor: pointer;
  background:
    radial-gradient(circle at 50% 36%, oklch(0.8 0.13 60), oklch(0.66 0.16 42) 70%);
  box-shadow: 0 10px 22px -8px oklch(0 0 0 / 0.6), inset 0 -8px 0 oklch(0 0 0 / 0.18), inset 0 6px 0 oklch(1 0 0 / 0.18);
  display: grid; place-items: center; animation: mascotIdle 3.6s ease-in-out infinite; transition: transform .12s;
}
.mascot-ph:hover { transform: translateY(-3px); }
.mascot-ph.bump { animation: mascotBump .42s ease; }
.mph-face { display: flex; gap: 16px; }
.mph-eye { width: 12px; height: 14px; border-radius: 50%; background: #1c1812; box-shadow: 0 0 0 3px oklch(1 0 0 / 0.85); animation: mphBlink 4s infinite; }
.mph-tag {
  position: absolute; bottom: 5px; right: 6px; font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em;
  color: oklch(0.2 0.04 60); background: oklch(1 0 0 / 0.4); padding: 1px 4px; border-radius: 4px;
}
@keyframes mascotIdle { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-7px) rotate(1.5deg); } }
@keyframes mascotBump { 0% { transform: scale(1); } 40% { transform: scale(1.14) rotate(4deg); } 100% { transform: scale(1); } }
@keyframes mphBlink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@media (max-width: 1100px) { .mascot { max-width: 180px; } .mascot-ph { width: 76px; height: 76px; } }
@media (prefers-reduced-motion: reduce) {
  .mascot-ph, .mph-eye, .iso-glow { animation: none !important; }
}

/* glowing room dot markers */
.room-dot {
  position: absolute; z-index: 6; width: 14px; height: 14px; transform: translate(-50%, -50%);
  border-radius: 50%; cursor: pointer; background: var(--rc);
  border: 2px solid oklch(0.99 0.01 264 / 0.85);
  box-shadow: 0 0 0 2px oklch(0 0 0 / 0.25), 0 0 10px -1px var(--rc);
  transition: transform .18s, box-shadow .18s;
}
.room-dot::before {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1.5px solid var(--rc); opacity: .55; animation: dotping 2.4s ease-out infinite;
}
.room-dot.on { transform: translate(-50%, -50%) scale(1.25); box-shadow: 0 0 0 2px oklch(0 0 0 / 0.25), 0 0 18px 1px var(--rc); }
.room-dot.on::before { animation-duration: 1.2s; opacity: .8; }
:root[data-theme="light"] .room-dot { border-color: oklch(0.28 0.03 268 / 0.7); box-shadow: 0 0 0 2px oklch(1 0 0 / 0.5), 0 0 10px -1px var(--rc); }
@keyframes dotping { 0% { transform: scale(.7); opacity: .7; } 70%,100% { transform: scale(1.5); opacity: 0; } }

/* ambient animation overlays */
.img-ambient { position: absolute; inset: 0; z-index: 4; pointer-events: none; mix-blend-mode: screen; }
.img-ambient .ov { position: absolute; display: block; }
.ov-bars { display: flex; align-items: flex-end; gap: 13%; width: 100%; height: 100%; }
.ov-bars i { flex: 1; min-width: 2px; border-radius: 1px; height: 40%; animation: ovbar 2.5s ease-in-out infinite; }
@keyframes ovbar { 0%,100% { height: 28%; } 50% { height: 96%; } }
.ov-line { width: 100%; height: 100%; overflow: visible; }
.ov-line polyline { stroke-dasharray: 220; stroke-dashoffset: 220; filter: drop-shadow(0 0 4px currentColor); animation: ovdraw 3.4s ease-in-out infinite; }
@keyframes ovdraw { 0% { stroke-dashoffset: 220; } 70%,100% { stroke-dashoffset: 0; } }
.ov-pulse { display: block; border-radius: 50%; border: 2px solid var(--pc); box-shadow: 0 0 12px var(--pc), inset 0 0 8px var(--pc); animation: ovpulse 2.3s ease-in-out infinite; }
@keyframes ovpulse { 0%,100% { opacity: .45; transform: scale(.82); } 50% { opacity: 1; transform: scale(1.06); } }
.ov-hearts { position: absolute; inset: 0; }
.ov-hearts span { position: absolute; bottom: 0; font-size: clamp(10px, 1.3vw, 18px); opacity: 0; animation: ovheart 2.8s ease-in infinite; text-shadow: 0 0 8px currentColor; }
@keyframes ovheart { 0% { transform: translateY(0) scale(.7); opacity: 0; } 20% { opacity: 1; } 80% { opacity: .7; } 100% { transform: translateY(-160%) scale(1); opacity: 0; } }

/* room name tags */
.room-tag {
  position: absolute; transform: translate(-50%, -50%); z-index: 7; cursor: pointer;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 5px 11px; border-radius: 99px;
  background: oklch(0.15 0.02 268 / 0.62); border: 1px solid oklch(0.5 0.04 268 / 0.4);
  color: var(--tx-dim); font-size: 12px; backdrop-filter: blur(5px);
  box-shadow: 0 6px 18px -10px black;
  transition: transform .2s, background .2s, border-color .2s, box-shadow .2s, color .2s;
  animation: tagFloat 4.5s ease-in-out infinite;
}
.room-tag:nth-of-type(2) { animation-delay: -0.8s; }
.room-tag:nth-of-type(3) { animation-delay: -1.6s; }
.room-tag:nth-of-type(4) { animation-delay: -2.4s; }
.room-tag:nth-of-type(5) { animation-delay: -3.2s; }
@keyframes tagFloat { 0%, 100% { margin-top: 0; } 50% { margin-top: -7px; } }
:root[data-theme="light"] .room-tag {
  background: oklch(0.99 0.004 264 / 0.88); border-color: var(--hairline);
  color: var(--tx-dim); box-shadow: 0 8px 20px -12px oklch(0.4 0.05 264 / 0.5);
}
.room-tag .rt-ico { display: grid; place-items: center; color: var(--rc); width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.room-tag .rt-name { font-weight: 600; }
.room-tag .rt-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; color: #fff;
  display: grid; place-items: center; font-family: var(--mono); font-size: 10.5px; font-weight: 700;
}
.rt-badge.danger { background: var(--danger); }
.rt-badge.warn { background: var(--warn); color: oklch(0.22 0.05 78); }
.rt-badge.info { background: var(--info); }
.room-tag .rt-go { display: none; font-family: var(--mono); font-size: 11px; color: var(--rc); padding-left: 3px; }
.room-tag.on {
  background: oklch(0.2 0.03 268 / 0.96); border-color: var(--rc); color: var(--tx);
  box-shadow: 0 0 0 1px var(--rc), 0 0 26px -4px var(--rc), 0 10px 26px -12px black;
  transform: translate(-50%, -50%) scale(1.07); animation-play-state: paused;
}
:root[data-theme="light"] .room-tag.on { background: oklch(1 0 0 / 0.97); color: var(--tx); }
.room-tag.on .rt-ico { opacity: 1; filter: drop-shadow(0 0 6px var(--rc)); }
.room-tag.on .rt-name { text-shadow: 0 0 10px var(--rc); }
.room-tag.on .rt-go { display: inline; }
.room-tag.lobby-tag { cursor: default; color: var(--tx-faint); }
.room-tag.lobby-tag .rt-ico { color: var(--tx-faint); }

/* ---- animated room label chip (collapsed pill → hover detail) ---- */
.room-chip {
  position: absolute; transform: translate(-50%, -50%); z-index: 7; cursor: pointer;
  min-width: 96px; padding: 5px 8px; border-radius: 12px;
  background: oklch(0.16 0.02 268 / 0.5); border: 1px solid oklch(0.6 0.04 268 / 0.34);
  backdrop-filter: blur(9px); box-shadow: 0 8px 20px -12px black;
  animation: tagFloat 4.5s ease-in-out infinite;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
}
.room-chip:nth-of-type(2) { animation-delay: -0.8s; }
.room-chip:nth-of-type(3) { animation-delay: -1.6s; }
.room-chip:nth-of-type(4) { animation-delay: -2.4s; }
.room-chip:nth-of-type(5) { animation-delay: -3.2s; }
.room-chip.on {
  background: oklch(0.2 0.03 268 / 0.9); border-color: var(--rc); z-index: 9;
  box-shadow: 0 0 0 1.5px var(--rc), 0 0 18px -1px var(--rc), 0 0 42px -6px var(--rc), 0 16px 34px -14px black;
  transform: translate(-50%, -50%) scale(1.06); animation-play-state: paused;
}
.room-chip.on .rc-ico { box-shadow: 0 0 16px 0 var(--rc); }
.room-chip.on .rc-val { text-shadow: 0 0 12px var(--rc); }
:root[data-theme="light"] .room-chip { background: oklch(1 0.004 264 / 0.66); border-color: oklch(0.5 0.04 264 / 0.3); box-shadow: 0 8px 18px -12px oklch(0.4 0.05 264 / 0.5); }
:root[data-theme="light"] .room-chip.on { background: oklch(1 0 0 / 0.95); box-shadow: 0 0 0 1.5px var(--rc), 0 0 16px -2px var(--rc), 0 0 36px -8px var(--rc), 0 14px 30px -16px oklch(0.4 0.05 264 / 0.5); }

.rc-row { display: flex; align-items: center; gap: 7px; }
.rc-ico { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 7px; display: grid; place-items: center;
  background: var(--rc); color: oklch(0.15 0.02 268); box-shadow: 0 0 10px -2px var(--rc); transition: box-shadow .2s; }
.rc-viz { width: 36px; height: 16px; display: flex; align-items: center; flex: 0 0 auto; }
.rc-live { font-family: var(--mono); font-size: 7.5px; font-weight: 800; letter-spacing: .05em; color: var(--danger);
  display: inline-flex; align-items: center; gap: 3px; }
.rc-live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 6px var(--danger); animation: ohpulse 1.4s infinite; }
.rc-val { font-family: var(--mono); font-weight: 700; font-size: 12.5px; margin-left: auto; color: var(--tx); letter-spacing: -.01em; transition: text-shadow .2s; }
.rc-badge {
  position: absolute; top: -8px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  display: grid; place-items: center; font-family: var(--mono); font-size: 10px; font-weight: 700; color: #fff;
  box-shadow: 0 0 0 2px var(--panel), 0 2px 8px -2px black;
}
.rc-badge.danger { background: var(--danger); }
.rc-badge.warn { background: var(--warn); color: oklch(0.22 0.05 78); }
.rc-badge.info { background: var(--info); }

.rc-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s ease, margin-top .26s ease, opacity .2s ease; opacity: 0; margin-top: 0; }
.rc-more-in { overflow: hidden; min-height: 0; }
.room-chip.on .rc-more { grid-template-rows: 1fr; opacity: 1; margin-top: 7px; }
.rc-name { font-size: 13px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.rc-sub { font-size: 10px; color: var(--tx-faint); margin-top: 3px; }
.rc-enter { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--rc); }

/* chip viz primitives */
.rc-bars { display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 100%; }
.rc-bars i { flex: 1; min-width: 3px; border-radius: 1.5px; height: 40%; animation: ovbar 2.4s ease-in-out infinite; }
.rc-line { width: 100%; height: 100%; overflow: visible; }
.rc-line polyline { stroke-dasharray: 120; stroke-dashoffset: 120; filter: drop-shadow(0 0 3px currentColor); animation: ovdraw 3s ease-in-out infinite; }
.rc-hearts { display: flex; gap: 6px; align-items: center; }
.rc-hearts i { font-size: 15px; font-style: normal; line-height: 1; animation: swbeat 1.6s ease-in-out infinite; }
.rc-hearts i:nth-child(2) { animation-delay: .45s; }
.rc-pbar { width: 100%; height: 9px; border-radius: 99px; background: oklch(1 0 0 / 0.14); overflow: hidden; }
:root[data-theme="light"] .rc-pbar { background: oklch(0.5 0.03 264 / 0.18); }
.rc-pbar i { display: block; height: 100%; border-radius: 99px; width: 50%; box-shadow: 0 0 8px -1px var(--rc); animation: pbarPulse 2.4s ease-in-out infinite; }
@keyframes pbarPulse { 0%, 100% { width: 32%; } 50% { width: 86%; } }
@media (prefers-reduced-motion: reduce) {
  .rc-bars i, .rc-line polyline, .rc-hearts i, .rc-pbar i { animation: none !important; }
  .rc-line polyline { stroke-dashoffset: 0; }
}

@media (max-width: 980px) {
  .room-tag { font-size: 10.5px; padding: 4px 8px; }
  .room-tag .rt-go { display: none !important; }
}

/* light theme — brighter daytime sky behind the building */
:root[data-theme="light"] .img-home {
  background:
    radial-gradient(1100px 680px at 50% 30%, oklch(0.93 0.05 250 / 0.9), transparent 72%),
    radial-gradient(760px 520px at 84% 88%, oklch(0.9 0.06 200 / 0.7), transparent 72%),
    linear-gradient(180deg, oklch(0.9 0.04 240), oklch(0.85 0.05 235));
}
:root[data-theme="light"] .img-home::before { opacity: .3; }
:root[data-theme="light"] .img-scene { filter: drop-shadow(0 26px 50px oklch(0.5 0.05 250 / 0.4)); }
:root[data-theme="light"] .img-ambient { mix-blend-mode: normal; }

@media (prefers-reduced-motion: reduce) {
  .ov-bars i, .ov-line polyline, .ov-pulse, .ov-hearts span { animation: none !important; }
  .ov-line polyline { stroke-dashoffset: 0; }
}

/* ============================================================
   HOME — office building cutaway (rooms)  [legacy room-cutaway v2]
   ============================================================ */
.home-screen {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background:
    radial-gradient(900px 540px at 50% 36%, oklch(0.28 0.06 285 / 0.5), transparent 70%),
    radial-gradient(700px 480px at 85% 92%, oklch(0.26 0.07 210 / 0.36), transparent 70%),
    linear-gradient(180deg, oklch(0.13 0.03 270), oklch(0.16 0.035 265));
}
.home-screen::before {
  content: ""; position: absolute; inset: 0; opacity: .6;
  background-image:
    radial-gradient(1px 1px at 20% 30%, oklch(0.85 0.05 280 / 0.45) 50%, transparent),
    radial-gradient(1px 1px at 70% 20%, oklch(0.85 0.05 210 / 0.32) 50%, transparent),
    radial-gradient(1px 1px at 42% 72%, oklch(0.85 0.05 290 / 0.26) 50%, transparent),
    radial-gradient(1.5px 1.5px at 86% 62%, oklch(0.85 0.05 200 / 0.3) 50%, transparent);
  background-size: 300px 300px;
}

.cutaway-fit { position: absolute; inset: 0; display: grid; place-items: center; padding: 70px 348px 60px; }
.cutaway { width: 100%; max-width: 860px; }
.cutaway-base {
  height: 16px; margin: -4px 6% 0; border-radius: 0 0 40% 40%;
  background: radial-gradient(60% 100% at 50% 0, oklch(0 0 0 / .55), transparent 75%);
}
.building {
  display: grid; gap: 7px;
  grid-template-columns: 1fr 0.84fr 1fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas: "facebook stock finance" "tiktok lobby hr";
  height: min(58vh, 528px); min-height: 410px; padding: 11px;
  background: linear-gradient(180deg, #3b2c20, #281e15);
  border: 4px solid #14110c; border-radius: 7px;
  box-shadow: var(--shadow-lg), inset 0 0 0 2px #4a3624, inset 0 0 60px -10px #000;
}

.room {
  position: relative; overflow: hidden; cursor: pointer;
  border: 3px solid #14110c; border-radius: 4px; background: #14131f;
  transition: box-shadow .16s, transform .16s;
}
.room-floor {
  position: absolute; inset: 0;
  background-color: color-mix(in oklab, var(--rc) 15%, #131220);
  background-image:
    linear-gradient(45deg, oklch(1 0 0 / .035) 25%, transparent 25%, transparent 75%, oklch(1 0 0 / .035) 75%),
    linear-gradient(45deg, oklch(1 0 0 / .035) 25%, transparent 25%, transparent 75%, oklch(1 0 0 / .035) 75%);
  background-size: 26px 26px; background-position: 0 0, 13px 13px;
}
.room-wall {
  position: absolute; top: 0; left: 0; right: 0; height: 32%;
  background: linear-gradient(180deg, color-mix(in oklab, var(--rc) 30%, #0e0d18), color-mix(in oklab, var(--rc) 12%, #0e0d18));
  border-bottom: 2px solid #14110c;
  box-shadow: inset 0 0 26px -6px var(--rc);
}
.room.hot { box-shadow: inset 0 0 0 2px var(--rc), 0 0 24px -2px var(--rc); transform: translateY(-2px); z-index: 8; }

.room-plate {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 7px; padding: 4px 9px; white-space: nowrap;
  background: oklch(0.16 0.02 268 / 0.9); border: 2px solid #14110c; border-radius: 6px;
  box-shadow: 0 0 14px -4px var(--rc);
}
.room-name { font-size: 12px; color: var(--rc); text-shadow: 0 0 8px var(--rc); }
.room-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px; color: #fff;
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.room-badge.danger { background: var(--danger); }
.room-badge.warn { background: var(--warn); color: oklch(0.22 0.05 78); }
.room-badge.info { background: var(--info); }
.room-badge.ok { background: var(--ok); color: oklch(0.2 0.04 152); }
.room-enter {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); z-index: 6;
  opacity: 0; pointer-events: none; transition: opacity .15s;
  font-family: var(--pixel); font-size: 11px; color: #0b0c16; background: var(--rc);
  border: 2px solid #14110c; border-radius: 5px; padding: 4px 11px; box-shadow: 0 2px 0 rgba(0,0,0,.3);
}
.room.hot .room-enter { opacity: 1; }

/* sprites */
.rs { position: absolute; image-rendering: pixelated; pointer-events: none; }
.work-cat { background-repeat: no-repeat; background-size: 800% 500%; animation: catType 1.4s steps(1) infinite alternate; }
@keyframes catType {
  0% { background-position: 0% 0%; } 14% { background-position: -100% 0%; }
  28% { background-position: -200% 0%; } 42% { background-position: -300% 0%; }
  56% { background-position: -400% 0%; } 70% { background-position: -500% 0%; }
  85% { background-position: -600% 0%; } 100% { background-position: -700% 0%; }
}
.coffee { background-repeat: no-repeat; background-size: 1200% 800%; animation: coffee 1.6s steps(12) infinite; }
@keyframes coffee { from { background-position: 0 0; } to { background-position: -1200% 0; } }
.server { background-repeat: no-repeat; background-size: 4000% 100%; animation: serveranim 4s steps(40) infinite; }
@keyframes serveranim { from { background-position: 0 0; } to { background-position: -4000% 0; } }

.crate { position: absolute; background: linear-gradient(180deg, #a9742f, #7c4f1d); border: 2px solid #4f3210; box-shadow: inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.22); }
.crate::before { content: ""; position: absolute; inset: 18% 10%; border: 1.5px solid rgba(0,0,0,.22); }

.room-screen { position: absolute; z-index: 4; border: 2px solid #0c0e18; background: #0b1020; box-shadow: 0 0 12px -2px var(--rc); overflow: hidden; }
.room-bars { position: absolute; inset: 5px; display: flex; align-items: flex-end; gap: 3px; }
.room-bars i { flex: 1; background: var(--rc); box-shadow: 0 0 5px var(--rc); animation: barGrow 2.6s ease-in-out infinite; }
@keyframes barGrow { 0%,100% { height: 28%; } 50% { height: 92%; } }
.live-chat { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 6px; color: #fff; font-family: var(--pixel); font-size: 9px; }
.live-chat > div:nth-child(1) { color: var(--tiktok-pink); }
.live-chat > div:nth-child(2) { color: var(--cyan); }
.live-chat > div:nth-child(3) { color: var(--warn); }

.room-neon {
  position: absolute; z-index: 4; font-family: var(--pixel); font-weight: bold; padding: 2px 8px; border-radius: 4px;
  text-shadow: 0 0 8px currentColor, 0 0 16px currentColor;
  box-shadow: 0 0 12px -2px currentColor, inset 0 0 8px -2px currentColor; animation: flick 3.5s infinite;
}
@keyframes flick { 0%,17%,21%,54%,58%,100% { opacity: 1; } 19%,56% { opacity: .42; } }
.fb-thumb { position: absolute; z-index: 4; width: 32px; height: 32px; border-radius: 8px; background: var(--fb); color: #fff; display: grid; place-items: center; font-family: var(--pixel); font-size: 19px; box-shadow: 0 0 14px -2px var(--fb); }
.ring-light { position: absolute; z-index: 4; width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--tiktok-pink); box-shadow: 0 0 18px var(--tiktok-pink), inset 0 0 12px var(--tiktok-pink); animation: pulsedot 2.4s infinite; }
@keyframes pulsedot { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.room-bubble {
  position: absolute; z-index: 7; max-width: 118px;
  background: #f6f1e0; color: #2a2618; border: 2px solid #1c1812; border-radius: 4px;
  padding: 4px 7px; font-size: 10.5px; line-height: 1.3; box-shadow: 2px 2px 0 rgba(0,0,0,.35);
  animation: bob 3.4s ease-in-out infinite;
}
.room-bubble::after { content: ""; position: absolute; bottom: -9px; left: 14px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid #1c1812; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.room-fx { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.room-fx .mote { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 5px var(--rc); opacity: 0; animation: motrise linear infinite; }
@keyframes motrise { 0% { transform: translateY(0); opacity: 0; } 16% { opacity: .8; } 84% { opacity: .55; } 100% { transform: translateY(-120px); opacity: 0; } }

/* lobby */
.room.lobby { cursor: default; background: #1b1712; }
.lobby-floor {
  background-color: #241d15;
  background-image:
    linear-gradient(45deg, oklch(1 0 0 / .04) 25%, transparent 25%, transparent 75%, oklch(1 0 0 / .04) 75%),
    linear-gradient(45deg, oklch(1 0 0 / .04) 25%, transparent 25%, transparent 75%, oklch(1 0 0 / .04) 75%);
  background-size: 24px 24px; background-position: 0 0, 12px 12px;
}
.lobby-banner {
  position: absolute; top: 9%; left: 50%; transform: translateX(-50%); z-index: 5; text-align: center;
  font-family: var(--pixel); font-size: 11px; line-height: 1.55; letter-spacing: 1px; color: #e0b86a;
  background: #2a2018; border: 3px solid #14110c; padding: 7px 11px; box-shadow: inset 0 0 0 2px #4a3624;
}
.welcome-mat {
  position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%); z-index: 4;
  font-family: var(--pixel); font-size: 11px; color: #3a2a18; letter-spacing: 2px;
  background: linear-gradient(180deg, #caa15e, #a87f44); border: 3px solid #5a3f22; padding: 5px 16px;
  box-shadow: 0 3px 0 rgba(0,0,0,.3);
}

@media (max-width: 1240px) {
  .cutaway-fit { padding: 64px 20px 56px; }
  .city-panel.tl, .city-panel.rt { opacity: .96; }
}
@media (max-width: 980px) {
  .city-panel.tl, .city-panel.rt { display: none; }
  .cutaway-fit { padding: 16px; }
  .building { height: auto; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 200px);
    grid-template-areas: "facebook stock" "finance tiktok" "lobby hr"; }
}
