/* Pokémon-Gen-4-ish chrome. Placeholder palette for Larry to repaint. */
:root {
  --bg: #0e0e10;
  --panel: #181820;
  --panel-2: #20202a;
  --line: #2b2b38;
  --text: #f3f1ec;
  --muted: #8a8aa0;
  --accent: #6cd4ff;
  --good: #5fdca0;
  --bad: #ff6b6b;
  --bg-msg: #ffd166;
  --bg-tool: #6cd4ff;
  --bg-voice: #a78bfa;
  --bg-bgjob: #5fdca0;
  --bg-err: #ff6b6b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }
.hud {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); margin-bottom: 12px;
}
.title { font-weight: 700; letter-spacing: 0.5px; }
.conn {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line);
}
.conn.on  { color: var(--good); border-color: var(--good); }
.conn.off { color: var(--muted); }
.conn.err { color: var(--bad); border-color: var(--bad); }

.stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px;
}
@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; }
}

canvas {
  display: block;
  background: #2a3a2c;
  border: 1px solid var(--line);
  border-radius: 10px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 100%;
  height: auto;
  max-width: 1024px;
  aspect-ratio: 16 / 10;
}

.log {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: 12px; overflow: hidden;
}
.log h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
#feed {
  list-style: none; margin: 0; padding: 0;
  max-height: 360px; overflow-y: auto; font-size: 12px;
}
#feed li {
  display: flex; gap: 8px; padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}
#feed li:last-child { border-bottom: none; }
#feed .ts { color: var(--muted); width: 56px; flex-shrink: 0; }
#feed .tag {
  padding: 1px 6px; border-radius: 4px; font-weight: 700;
  font-size: 10px; flex-shrink: 0; min-width: 44px; text-align: center;
}
#feed .tag.msg   { background: var(--bg-msg);   color: #000; }
#feed .tag.tool  { background: var(--bg-tool);  color: #000; }
#feed .tag.voice { background: var(--bg-voice); color: #000; }
#feed .tag.bg    { background: var(--bg-bgjob); color: #000; }
#feed .tag.err   { background: var(--bg-err);   color: #000; }
#feed .body { flex: 1; word-break: break-word; }
#feed .who  { color: var(--accent); }
#feed .ms   { color: var(--muted); }

.legend {
  margin-top: 12px; display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12px; color: var(--muted);
}
.dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.dot.d-msg   { background: var(--bg-msg); }
.dot.d-tool  { background: var(--bg-tool); }
.dot.d-voice { background: var(--bg-voice); }
.dot.d-bg    { background: var(--bg-bgjob); }
.dot.d-err   { background: var(--bg-err); }

/* ─── Wallpaper mode (?wallpaper in URL) ──────────────────────────────────
   For Lively Wallpaper / Wallpaper Engine. Strips chrome, scales the canvas
   to fill the screen with crisp pixel upscaling. Activity feed becomes a
   small overlay in the corner — optional reference; can be hidden via the
   .hide-activity class if you prefer pure scene. */
body.wallpaper {
  background: #0a0a0c;
  overflow: hidden;
  margin: 0;
}
body.wallpaper .wrap { max-width: none; padding: 0; height: 100vh; }
body.wallpaper .hud { display: none; }
body.wallpaper .stage {
  display: block;
  height: 100vh;
  width: 100vw;
}
body.wallpaper #world {
  width: 100vw;
  height: 100vh;
  border: none;
  border-radius: 0;
  object-fit: contain;             /* keep aspect ratio, letterbox */
  display: block;
  background: #2a3a2c;
}
body.wallpaper .log {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 280px;
  max-height: 180px;
  border-radius: 8px;
  background: rgba(11, 14, 20, 0.78);
  backdrop-filter: blur(6px);
  font-size: 11px;
  z-index: 10;
}
body.wallpaper .log h3 { display: none; }
body.wallpaper #feed { max-height: 160px; }
body.wallpaper .footer,
body.wallpaper .legend { display: none; }
/* Optional: append #clean to URL to hide activity overlay entirely. */
body.wallpaper.clean .log { display: none; }
