:root {
  --bg: #070912;
  --panel: #10142a;
  --panel-2: #161b36;
  --ink: #e8e6da;
  --ink-dim: #9a97ad;
  --gold: #e9c767;
  --gold-hi: #f4dc8e;
  --gold-deep: #b98a2e;
  --gold-soft: rgba(233, 199, 103, 0.16);
  --line: #262c52;
  --violet: #7f7fd5;
  --lamp: 1; /* 0..1 lamp-glow intensity, set from JS by time of day */
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 700px at 70% -10%, #181d42 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- Top bar / controls (carried from v1) ---------- */
.topbar {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 26, 0.72);
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { font-size: 30px; color: var(--gold); text-shadow: 0 0 18px rgba(233,199,103,.65); line-height: 1; }
.brand h1 { margin: 0; font-size: 24px; letter-spacing: .4px; }
.brand-sub { margin: 2px 0 0; color: var(--ink-dim); font-size: 13px; }
.clockbox { text-align: center; margin-left: auto; }
.clock { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); line-height: 1; }
.clock-state { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--ink-dim); margin-top: 4px; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn {
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 14px; font-size: 14px; cursor: pointer;
}
.btn:hover { border-color: var(--gold-deep); }
.btn.primary { background: linear-gradient(180deg, #f2d47e, var(--gold)); color: #241a04; font-weight: 700; border-color: var(--gold-deep); }
.speed-wrap { font-size: 13px; color: var(--ink-dim); display: flex; align-items: center; gap: 6px; }
.speed-wrap select { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 13px; }

.layout { display: flex; gap: 22px; padding: 22px 28px 8px; align-items: stretch; }
.room-wrap { flex: 1 1 auto; min-width: 0; }
.room-hint { color: var(--ink-dim); font-size: 13px; margin: 10px 2px 0; }

/* ---------- The floor plan ---------- */
.plan {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 520px;
  background: #05060f;
  border: 3px solid #3a3355;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 0 0 6px rgba(0,0,0,.45), inset 0 0 90px rgba(0,0,0,.5);
}
.floor { position: absolute; }
.fl-study      { left: 0;    top: 0;    width: 36.5%; height: 42.5%; background: linear-gradient(155deg, #2b2140 0%, #211a33 60%, #1c162c 100%); }
.fl-hall       { left: 36.5%; top: 0;   width: 31%;   height: 40.5%; background: linear-gradient(180deg, #241d3a, #1e1830); }
.fl-observatory{ left: 67.5%; top: 0;   width: 32.5%; height: 40.5%; background: linear-gradient(200deg, #1a2145 0%, #141a38 70%); }
.fl-landing    { left: 0;    top: 42.5%; width: 36.5%; height: 3.5%; background: #1c162c; }
.fl-kitchen    { left: 0;    top: 46%;  width: 36.5%; height: 54%;  background: linear-gradient(160deg, #262038 0%, #1d1830 65%); }
.fl-server     { left: 0;    top: 46%;  width: 16.5%; height: 22.5%; background: linear-gradient(180deg, #101223, #0b0d1a); }
.fl-lounge     { left: 36.5%; top: 40.5%; width: 63.5%; height: 59.5%; background: linear-gradient(150deg, #282040 0%, #201a34 55%, #1b152c 100%); }
.fl-entry      { left: 36.5%; top: 76%; width: 30%;   height: 24%;  background: linear-gradient(180deg, #231b36, #1d1730); }
/* floor texture: faint plank seams */
.floor::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(233,199,103,.035) 1px, transparent 1px);
  background-size: 100% 26px;
}
.fl-server::after { background-image: linear-gradient(rgba(233,199,103,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(233,199,103,.05) 1px, transparent 1px); background-size: 22px 22px; }

.rug { position: absolute; border-radius: 50%; border: 2px solid rgba(233,199,103,.30); pointer-events: none; }
.rug-study  { left: 8%;  top: 22%; width: 22%; height: 17%; background: radial-gradient(closest-side, rgba(127,127,213,.20), rgba(185,138,46,.10) 70%, transparent); }
.rug-hall   { left: 43%; top: 24%; width: 18%; height: 14%; background: radial-gradient(closest-side, rgba(185,138,46,.16), transparent); }
.rug-lounge { left: 58%; top: 62%; width: 30%; height: 26%; background: radial-gradient(closest-side, rgba(127,127,213,.16), rgba(185,138,46,.08) 72%, transparent); }
.rug-obs    { left: 74%; top: 24%; width: 19%; height: 13%; background: radial-gradient(closest-side, rgba(233,199,103,.12), transparent); border-color: rgba(233,199,103,.22); }

.room-label {
  position: absolute; z-index: 3;
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(232,230,218,.34); pointer-events: none;
}
.rl-study  { left: 3%;  top: 39%; }
.rl-hall   { left: 48.5%; top: 4.5%; }
.rl-obs    { left: 70%; top: 36.5%; }
.rl-lounge { left: 88%; top: 93%; }
.rl-kitchen{ left: 24%; top: 47.5%; }
.rl-server { left: 2%;  top: 47.2%; font-size: 8.5px; letter-spacing: 1.6px; }
.rl-entry  { left: 62.5%; top: 77.5%; }

/* Walls: drawn slabs with a lit top edge + drop shadow for height */
.walls { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.wall { position: absolute; background: linear-gradient(180deg, #4a3f6b, #2e2749); }
.wall.wh { box-shadow: inset 0 2px 0 rgba(244,220,142,.45), 0 4px 5px rgba(0,0,0,.45); border-radius: 1px; }
.wall.wv { background: linear-gradient(90deg, #4a3f6b, #2e2749); box-shadow: inset 2px 0 0 rgba(244,220,142,.35), 4px 0 5px rgba(0,0,0,.4); border-radius: 1px; }

/* Lamps */
.lamp { position: absolute; z-index: 8; }
.lamp-glow {
  position: absolute; left: 50%; top: 50%; width: 90px; height: 90px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(244,220,142,.5), rgba(233,199,103,.14) 55%, transparent 72%);
  opacity: var(--lamp); pointer-events: none;
}
.lamp-shade {
  width: 0; height: 0; margin: 0 auto; position: relative; z-index: 1;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-bottom: 10px solid var(--gold-deep);
  filter: drop-shadow(0 0 4px rgba(233,199,103,.6));
}
.lamp-pole { width: 2px; height: 26px; background: #57482a; margin: 0 auto; }
.desk-lamp { right: -6px; top: -12px; }
.desk-lamp .lamp-glow { width: 64px; height: 64px; }
.candelabra { position: absolute; left: 64.6%; top: 43.5%; width: 2.6%; z-index: 8; }
.candelabra img { width: 100%; image-rendering: pixelated; display: block; position: relative; z-index: 1; }
.candelabra .lamp-glow { width: 54px; height: 54px; }

/* ---------- Study furniture ---------- */
.bookshelf {
  position: absolute; left: 2%; top: 2%; width: 29%; height: 8.5%; z-index: 5;
  background: linear-gradient(180deg, #3a2c1c, #2a2013);
  border: 1px solid #57401f; border-bottom: 4px solid #57401f; border-radius: 3px;
  box-shadow: 0 5px 8px rgba(0,0,0,.5);
  padding: 3px 5px 0;
}
.books { display: flex; gap: 2px; height: 78%; align-items: flex-end; }
.books span { flex: 1; height: var(--h); border-radius: 1px 1px 0 0; background: #4a3a6b; }
.books span:nth-child(3n) { background: #6b4a2f; }
.books span:nth-child(4n) { background: #54477e; }
.books span:nth-child(5n) { background: #7a5a34; }
.books span:nth-child(7n) { background: #3d3163; }
.bookshelf-base { height: 12%; background: #57401f; margin: 1px -5px 0; }
.desk {
  position: absolute; left: 16%; top: 14%; width: 17%; height: 11%; z-index: 7;
}
.desk-surface {
  position: absolute; inset: auto 0 0 0; height: 58%;
  background: linear-gradient(180deg, #4a3823, #3a2c1a);
  border: 1px solid #6b4e26; border-radius: 4px;
  box-shadow: 0 7px 10px rgba(0,0,0,.55);
}
.monitor {
  position: absolute; left: 16%; top: 0; width: 44%; height: 62%; z-index: 1;
  background: #0a0e26; border: 2px solid #57482a; border-radius: 3px;
  box-shadow: 0 3px 6px rgba(0,0,0,.5);
}
.monitor-screen { position: absolute; inset: 2px; overflow: hidden; background: linear-gradient(180deg, #1b2350, #10173a); }
.monitor-screen i { display: block; height: 2px; margin: 3px 3px 0; background: rgba(233,199,103,.5); border-radius: 1px; }
.monitor-screen i:nth-child(2) { width: 70%; } .monitor-screen i:nth-child(3) { width: 85%; } .monitor-screen i:nth-child(4) { width: 55%; }
.plan[data-scene="desk"] .monitor-screen { animation: screenflicker 1.6s steps(2) infinite; }
@keyframes screenflicker { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.mic { position: absolute; left: 72%; top: 16%; width: 3px; height: 46%; background: #57482a; z-index: 1; }
.mic-head {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 9px; height: 13px; border-radius: 5px; background: var(--gold-deep);
  box-shadow: 0 0 7px rgba(233,199,103,.55);
}
.plan[data-scene="desk"] .mic-head { animation: micpulse 1.1s ease-in-out infinite alternate; }
@keyframes micpulse { from { box-shadow: 0 0 4px rgba(233,199,103,.4); } to { box-shadow: 0 0 11px rgba(233,199,103,.9); } }
.reading-chair { position: absolute; left: 6.5%; top: 25%; width: 9%; height: 13%; z-index: 7; }
.chair-back {
  position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 50% 0%, #54477e 0%, #3d3163 70%);
  border: 2px solid #6a5a9e; border-radius: 46% 46% 12px 12px;
  box-shadow: 0 6px 9px rgba(0,0,0,.55);
}
.open-book { position: absolute; left: 50%; top: 46%; width: 62%; height: 34%; transform: translateX(-50%); display: flex; z-index: 1; }
.open-book .page { flex: 1; background: #efe6c8; border: 1px solid #b8a888; }
.page-l { border-radius: 3px 1px 1px 3px; transform-origin: right center; }
.page-r { border-radius: 1px 3px 3px 1px; }
.plan[data-scene="library"] .page-r { animation: pageturn 2.6s ease-in-out infinite; }
@keyframes pageturn { 0%, 55%, 100% { transform: rotateY(0deg); } 75% { transform: rotateY(-38deg); } }

/* ---------- Observatory ---------- */
.big-window {
  position: absolute; left: 71%; top: 1.5%; width: 25%; height: 15%; z-index: 5;
  border: 3px solid #57482a; border-radius: 4px; overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,.5), inset 0 0 0 1px rgba(244,220,142,.35);
}
.sky { position: absolute; inset: 0; background: linear-gradient(180deg, #05081f, #10163c); transition: background 1.2s; }
.sky-stars { position: absolute; inset: 0; transition: opacity 1.2s; }
.sky-stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; }
.orb { position: absolute; width: 13%; aspect-ratio: 1; border-radius: 50%; background: #e9c767; box-shadow: 0 0 12px rgba(233,199,103,.85); }
.orb.moon { background: #e8e2cc; box-shadow: 0 0 9px rgba(232,226,204,.7); }
.sky-hill { position: absolute; left: 0; right: 0; bottom: 0; height: 26%; background: linear-gradient(180deg, #141a38, #0a0e26); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.window-frame { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 49.2%, rgba(87,72,42,.9) 49.2%, rgba(87,72,42,.9) 50.8%, transparent 50.8%); }
.telescope { position: absolute; left: 79.5%; top: 18.5%; width: 9%; height: 9%; z-index: 7; }
.scope-tube {
  position: absolute; left: 30%; top: 6%; width: 62%; height: 24%;
  background: linear-gradient(180deg, #8a6d2f, #57482a);
  border-radius: 4px; transform: rotate(-24deg); transform-origin: left center;
  box-shadow: 0 3px 5px rgba(0,0,0,.5);
}
.scope-legs {
  position: absolute; left: 38%; top: 42%; width: 26%; height: 52%;
  background: linear-gradient(90deg, transparent 42%, #57482a 42%, #57482a 58%, transparent 58%);
}
.scope-eye {
  position: absolute; left: 22%; top: 20%; width: 14%; aspect-ratio: 1; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 6px rgba(233,199,103,.7);
}
.plan[data-scene="window"] .scope-eye { animation: micpulse 1.4s ease-in-out infinite alternate; }
.star-chart {
  position: absolute; left: 95.2%; top: 19%; width: 3.6%; aspect-ratio: .78; z-index: 5;
  background: #efe6c8; border: 1px solid #b8a888; border-radius: 1px;
  box-shadow: 0 3px 5px rgba(0,0,0,.45);
  background-image: radial-gradient(circle at 30% 35%, #57482a 1.2px, transparent 1.6px), radial-gradient(circle at 68% 58%, #57482a 1px, transparent 1.4px), radial-gradient(circle at 45% 78%, #57482a 1px, transparent 1.4px);
}

/* ---------- Lounge ---------- */
.dash-screen {
  position: absolute; left: 69%; top: 41.5%; width: 26%; height: 15.5%; z-index: 7;
  background: linear-gradient(180deg, #0b1030, #080c24);
  border: 2px solid var(--gold-deep); border-radius: 6px;
  box-shadow: 0 6px 14px rgba(0,0,0,.6), 0 0 22px rgba(233,199,103,.14);
  overflow: hidden; padding: 6px 10px;
}
.dash-slide { position: absolute; inset: 6px 10px 14px; opacity: 0; transition: opacity .6s; display: flex; flex-direction: column; justify-content: center; }
.dash-slide.active { opacity: 1; }
.dash-big { font-size: clamp(18px, 2.6vw, 34px); font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1; }
.dash-mid { font-size: clamp(12px, 1.4vw, 18px); font-weight: 600; color: var(--ink); line-height: 1.25; }
.dash-sub { font-size: clamp(9px, .95vw, 12px); color: var(--ink-dim); margin-top: 3px; }
.dash-dots { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.dash-dots i { width: 5px; height: 5px; border-radius: 50%; background: #3c4276; }
.dash-dots i.on { background: var(--gold); }
.couch-sprite {
  position: absolute; left: 68%; top: 60%; width: 17%; z-index: 6;
  image-rendering: pixelated;
  filter: drop-shadow(0 7px 7px rgba(0,0,0,.55)) saturate(1.05);
}
.coffee-table {
  position: absolute; left: 71.5%; top: 79%; width: 10%; height: 5.5%; z-index: 6;
  background: linear-gradient(180deg, #4a3823, #3a2c1a);
  border: 1px solid #6b4e26; border-radius: 4px;
  box-shadow: 0 5px 8px rgba(0,0,0,.5);
}
.plant { position: absolute; left: 89.5%; top: 82%; width: 6%; height: 10%; z-index: 7; }
.plant-pot {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 44%; height: 34%;
  background: linear-gradient(180deg, #8a5a34, #6b4226);
  border-radius: 2px 2px 6px 6px; box-shadow: 0 4px 6px rgba(0,0,0,.5);
}
.plant-leaves { position: absolute; inset: 0 0 26% 0; }
.plant-leaves i {
  position: absolute; bottom: 0; left: 50%; width: 34%; height: 78%;
  background: linear-gradient(180deg, #6a5a9e, #43356f);
  border-radius: 100% 4px 100% 4px; transform-origin: bottom center;
}
.plant-leaves i:nth-child(1) { transform: translateX(-50%) rotate(-38deg); }
.plant-leaves i:nth-child(2) { transform: translateX(-50%) rotate(-16deg); height: 92%; }
.plant-leaves i:nth-child(3) { transform: translateX(-50%) rotate(4deg); height: 100%; }
.plant-leaves i:nth-child(4) { transform: translateX(-50%) rotate(24deg); height: 88%; }
.plant-leaves i:nth-child(5) { transform: translateX(-50%) rotate(44deg); height: 70%; }

/* ---------- Kitchen ---------- */
.fridge {
  position: absolute; left: 28.5%; top: 47.5%; width: 7%; height: 13%; z-index: 7;
  background: linear-gradient(160deg, #3d4470, #2a3054);
  border: 1px solid #565e8f; border-radius: 4px;
  box-shadow: 0 6px 9px rgba(0,0,0,.55);
}
.fridge-door-line { position: absolute; left: 0; right: 0; top: 34%; height: 1px; background: #565e8f; }
.sticky-note {
  position: absolute; left: 12%; top: 8%; width: 62%; padding: 2px 1px;
  background: #f2df8e; color: #4a3c10;
  font-size: clamp(5px, .58vw, 8px); font-weight: 700; line-height: 1.25; text-align: center;
  transform: rotate(-5deg); box-shadow: 0 2px 3px rgba(0,0,0,.35); border-radius: 1px;
}
.counter-south {
  position: absolute; left: 17%; top: 92.5%; width: 19.5%; height: 6.5%; z-index: 5;
  background: linear-gradient(180deg, #4a4266, #373154);
  border-top: 2px solid #6a5f92; box-shadow: 0 -3px 7px rgba(0,0,0,.35);
}
.stove {
  position: absolute; left: 2.5%; top: 71%; width: 10%; height: 15%; z-index: 7;
  background: linear-gradient(180deg, #23263f, #171a2e);
  border: 1px solid #454a75; border-radius: 5px;
  box-shadow: 0 6px 9px rgba(0,0,0,.55);
}
.burner { position: absolute; width: 30%; aspect-ratio: 1; border-radius: 50%; border: 2px solid #454a75; background: #101223; }
.burner.b1 { left: 10%; top: 8%; } .burner.b2 { right: 10%; bottom: 8%; }
.plan[data-scene="kitchen"] .burner.b1 { border-color: var(--gold-deep); box-shadow: 0 0 8px rgba(233,199,103,.35); }
.pot {
  position: absolute; right: 8%; top: 6%; width: 42%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #565e8f, #2a3054 75%);
  border: 2px solid #6a72a8;
}
.spoon {
  position: absolute; left: 46%; top: -16%; width: 9%; height: 62%;
  background: #b8a888; border-radius: 3px; transform-origin: bottom center;
}
.plan[data-scene="kitchen"] .spoon { animation: stir 1.5s ease-in-out infinite; }
@keyframes stir { 0%,100% { transform: rotate(-16deg); } 50% { transform: rotate(16deg); } }
.steam { position: absolute; bottom: 78%; width: 16%; aspect-ratio: 1; border-radius: 50%; background: rgba(232,230,218,.5); opacity: 0; filter: blur(1px); }
.steam.s-a { left: 22%; } .steam.s-b { left: 46%; } .steam.s-c { left: 68%; }
.plan[data-scene="kitchen"] .steam { animation: steamrise 2.2s ease-out infinite; }
.plan[data-scene="kitchen"] .steam.s-b { animation-delay: .7s; }
.plan[data-scene="kitchen"] .steam.s-c { animation-delay: 1.4s; }
@keyframes steamrise { 0% { opacity: 0; transform: translateY(0) scale(.6); } 30% { opacity: .75; } 100% { opacity: 0; transform: translateY(-190%) scale(1.5); } }
.k-table {
  position: absolute; left: 19.5%; top: 84%; width: 10%; height: 7.5%; z-index: 6;
  background: linear-gradient(180deg, #4a3823, #3a2c1a);
  border: 1px solid #6b4e26; border-radius: 4px;
  box-shadow: 0 5px 8px rgba(0,0,0,.5);
}
.k-chair { position: absolute; width: 26%; height: 30%; background: #54477e; border: 1px solid #6a5a9e; border-radius: 3px; }
.k-chair.ch-1 { left: -14%; top: 34%; } .k-chair.ch-2 { right: -14%; top: 34%; }

/* ---------- Server closet ---------- */
.rack {
  position: absolute; top: 48.5%; width: 5.6%; height: 17.5%; z-index: 7;
  background: linear-gradient(180deg, #171a2e, #101223);
  border: 1px solid #454a75; border-radius: 3px;
  box-shadow: 0 5px 8px rgba(0,0,0,.6);
  padding: 4px 3px; display: flex; flex-direction: column; gap: 3px;
}
.rack-a { left: 2.2%; } .rack-b { left: 8.8%; }
.rack i { flex: 1; border-radius: 2px; background: #1d2138; position: relative; }
.rack i::after {
  content: ""; position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 5px var(--gold);
  animation: rackblink 2.4s steps(1) infinite; animation-delay: var(--d, 0s);
}
.rack i::before {
  content: ""; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 40%; height: 2px; background: #454a75; border-radius: 1px;
}
@keyframes rackblink { 0%, 72% { opacity: 1; } 78%, 88% { opacity: .15; } 94%, 100% { opacity: 1; } }

/* ---------- Entry ---------- */
.hammock { position: absolute; left: 39%; top: 79.5%; width: 13%; height: 12%; z-index: 6; }
.hammock-cloth {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #54477e, #3d3163);
  border: 2px solid #6a5a9e;
  border-radius: 8px 50% 8px 50% / 8px 38% 8px 38%;
  transform: rotate(9deg);
  box-shadow: 0 6px 9px rgba(0,0,0,.5);
}
.front-door {
  position: absolute; left: 54.5%; bottom: 0; width: 8%; height: 13%; z-index: 7;
  background: linear-gradient(180deg, #3a2c1a, #2a2013);
  border: 2px solid #6b4e26; border-bottom: none; border-radius: 5px 5px 0 0;
  box-shadow: 0 -3px 8px rgba(0,0,0,.5);
}
.door-knob { position: absolute; right: 10%; top: 48%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: var(--gold); box-shadow: 0 0 5px rgba(233,199,103,.6); }
.plan[data-scene="door"] .front-door { box-shadow: 0 -3px 8px rgba(0,0,0,.5), 0 0 18px rgba(233,199,103,.4); border-color: var(--gold); }
.door-mat {
  position: absolute; left: 53.5%; top: 84.5%; width: 10%; height: 4.5%; z-index: 5;
  background: rgba(185,138,46,.22); border: 1px solid rgba(233,199,103,.4); border-radius: 3px;
  color: rgba(233,199,103,.65); font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.coat-hooks { position: absolute; left: 38.5%; top: 92%; width: 9%; height: 2.4%; z-index: 6; background: #3a2c1a; border-radius: 2px; display: flex; justify-content: space-around; }
.coat-hooks i { width: 12%; height: 160%; background: var(--gold-deep); border-radius: 0 0 4px 4px; }

/* ---------- Station markers ---------- */
.st-marker { position: absolute; z-index: 4; transform: translate(-50%, -50%); pointer-events: none; }
.st-marker::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px;
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 1px solid rgba(233,199,103,.0);
  transition: border-color .4s, box-shadow .4s, background .4s;
}
.st-marker span {
  position: relative; font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase;
  color: rgba(232,230,218,.38); white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.st-marker.active::before {
  border-color: rgba(233,199,103,.85);
  background: radial-gradient(closest-side, rgba(233,199,103,.22), transparent);
  box-shadow: 0 0 18px rgba(233,199,103,.45);
}
.st-marker.active span { color: var(--gold-hi); }

/* ---------- Motes ---------- */
.motes { position: absolute; inset: 0; z-index: 9; pointer-events: none; overflow: hidden; }
.mote {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(244,220,142,.55); box-shadow: 0 0 5px rgba(233,199,103,.5);
  animation: motedrift linear infinite;
}
@keyframes motedrift {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: .8; }
  55% { transform: translate(26px, -34px); opacity: .5; }
  88% { opacity: .7; }
  100% { transform: translate(-12px, -64px); opacity: 0; }
}

/* ---------- Bella the cat ---------- */
.cat {
  position: absolute; width: 5.2%; z-index: 30;
  transform: translate(-50%, -78%);
  pointer-events: none;
}
.cat svg { width: 100%; display: block; filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); }
.cat.walking svg { animation: catbob .34s ease-in-out infinite alternate; }
@keyframes catbob { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }
.cat .cat-tail { transform-origin: 12px 26px; }
.cat.walking .cat-tail { animation: tailwag .5s ease-in-out infinite alternate; }
/* Bella's legs: far pair steps opposite the near pair while she walks;
   napping tucks them away so the loaf pose still reads. */
.cat.walking .leg-near { animation: legstep .34s ease-in-out infinite alternate; }
.cat.walking .leg-far { animation: legstep .34s ease-in-out infinite alternate-reverse; }
@keyframes legstep { from { transform: translateX(-.7px); } to { transform: translateX(.7px); } }
.cat.napping .cat-legs { opacity: 0; }
@keyframes tailwag { from { transform: rotate(-7deg); } to { transform: rotate(9deg); } }
.cat.napping svg { transform: scaleY(.72) translateY(20%); }
.cat-shadow { width: 62%; height: 6px; margin: 1px auto 0; border-radius: 50%; background: rgba(0,0,0,.45); }
.cat-zs { position: absolute; right: -6%; top: -34%; opacity: 0; }
.cat.napping .cat-zs { opacity: 1; }
.cat-zs span { position: absolute; color: var(--gold-hi); font-weight: 700; text-shadow: 0 0 6px rgba(233,199,103,.6); animation: zfloat 2.4s ease-out infinite; }
.cat-zs span:nth-child(1) { font-size: 11px; left: 0; }
.cat-zs span:nth-child(2) { font-size: 15px; left: 10px; animation-delay: 1.2s; }
@keyframes zfloat { 0% { transform: translateY(4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-13px); opacity: 0; } }

/* ---------- The character (sprite) ---------- */
.character {
  position: absolute; width: 7.4%; z-index: 50;
  transform: translate(-50%, -94%);
  pointer-events: none;
}
.character.pose-sleeping { width: 11.5%; }
.character .sprite {
  width: 100%; display: block; position: relative; z-index: 1;
  filter: drop-shadow(0 0 9px rgba(233,199,103,.45));
}
.character.idle-bob .sprite { animation: idlebob 2.6s ease-in-out infinite; }
@keyframes idlebob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.2%); } }
.character.stretching .sprite { animation: stretch 1.1s ease-in-out infinite; }
@keyframes stretch { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.07) translateY(-2%); } }
.character .shadow {
  width: 58%; height: 8px; margin: -4% auto 0;
  border-radius: 50%; background: rgba(0,0,0,.55);
}
.bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  width: max-content; max-width: 230px; z-index: 2;
  background: #f7efd2; color: #26200c;
  font-size: 12.5px; font-weight: 600; line-height: 1.35;
  padding: 7px 10px; border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.45);
  text-align: center;
}
.bubble::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #f7efd2;
}
.bubble.bub-left { left: -12%; transform: none; }
.bubble.bub-left::after { left: 26%; }
.bubble.bub-right { left: auto; right: -12%; transform: none; }
.bubble.bub-right::after { left: 74%; }

/* Time-of-day wash over the rooms (the figure is luminous — he sits above it) */
.lighting {
  position: absolute; inset: 0; z-index: 40; pointer-events: none;
  background: rgba(6, 10, 38, 0.36);
  transition: background 1.2s;
}

/* ---------- Log panel (carried from v1) ---------- */
.log-panel {
  flex: 0 0 330px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 18px 14px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 170px);
}
.log-panel h2 { margin: 0; font-size: 18px; }
.log-sub { color: var(--ink-dim); font-size: 12.5px; margin: 4px 0 12px; }
.log { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; }
.log li {
  display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px;
  cursor: pointer; border: 1px solid transparent; align-items: baseline;
}
.log li:hover { background: var(--panel-2); }
.log li .lt { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; flex: 0 0 42px; }
.log li .lx { font-size: 13.5px; line-height: 1.35; }
.log li .lst { display: block; color: var(--ink-dim); font-size: 11px; margin-top: 1px; }
.log li.done { opacity: .55; }
.log li.done .lx::before { content: "✓ "; color: var(--gold); }
.log li.current { background: var(--gold-soft); border-color: var(--gold-deep); opacity: 1; }
.now-card { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.now-label { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--ink-dim); }
.now-text { font-size: 15px; font-weight: 600; margin-top: 4px; line-height: 1.4; }

.foot { padding: 10px 28px 22px; color: var(--ink-dim); font-size: 12.5px; }
.foot code { color: var(--gold); }

@media (max-width: 980px) {
  .layout { flex-direction: column; }
  .log-panel { flex: none; max-height: none; }
  .clockbox { margin-left: 0; }
  .plan { min-height: 380px; }
}
