/* watch.css — the Watch page (watch.html, js/watch.js): streams, the island
   map with its agents, the picked agent's panel and the thinking feed. */
.watch {
  --k-protagonist: #ffb02e;
  --k-teammate: var(--g-live);
  --k-villager: #5fb4ff;
  --k-community: #3fd6c0;
  --k-buddy: #c28bff;
  --k-solo: var(--store-muted);
  --k-other: var(--store-dim);
}
.watch .page-head .kicker { margin-bottom: 6px; }
.watch [data-kind] { --k: var(--k-other); }
.watch [data-kind="protagonist"] { --k: var(--k-protagonist); }
.watch [data-kind="teammate"] { --k: var(--k-teammate); }
/* a village crew wears its own blue, the same on every read (js/watch.js crewHue) */
.watch [data-kind="villager"] { --k: hsl(var(--crew-h, 210) 85% 64%); }
.watch [data-kind="community"] { --k: var(--k-community); }
.watch [data-kind="buddy"] { --k: var(--k-buddy); }
.watch [data-kind="solo"] { --k: var(--k-solo); }

/* ── streams ─────────────────────────────────────────────────────────────── */
.w-streams { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.w-streams:empty { display: none; }
.w-stream-go {
  display: grid; gap: 6px; height: 100%; padding: 14px;
  background: var(--store-panel); border: 1px solid var(--store-line); border-radius: var(--r);
  color: var(--store-ink); text-decoration: none; box-shadow: var(--bevel);
}
.w-stream-go:hover, .w-stream-go:focus-visible { border-color: var(--g-live); text-decoration: none; }
.w-stream-top { grid-column: 1 / -1; }
.w-stream-top .w-stream-go { padding: 18px; background: linear-gradient(135deg, var(--g-deep), var(--store-panel) 60%); }
.w-stream-top .w-stream-who { font-size: 1.35rem; }
.w-stream-top-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 600 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--store-muted); }
.w-stream-live { padding: 3px 6px; background: var(--breach-red); color: #fff; border-radius: var(--r-sm); }
.w-stream-n { margin-left: auto; }
.w-stream-who { font-family: var(--sg); font-size: 1.05rem; overflow-wrap: anywhere; }
.w-stream-title { color: var(--store-muted); font-size: .86rem; overflow-wrap: anywhere; }
.w-stream-game { color: var(--g-live); font-size: .8rem; }
.w-empty { margin-top: 12px; }

/* ── the island ──────────────────────────────────────────────────────────── */
.w-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
@media (min-width: 861px) {
  .w-stage { grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); align-items: start; }
}
.w-map {
  position: relative; aspect-ratio: 1 / 1; width: 100%; overflow: hidden;
  background: #0d2a33; border: 1px solid var(--store-line); border-radius: var(--r);
}
.w-map-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.w-nomap .w-map-img { display: none; }
.w-nomap {
  background-color: #0d2a33;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 10% 10%;
}
.w-dots, .w-crews { position: absolute; inset: 0; }
.w-crews { pointer-events: none; }
.w-dark .w-dots { opacity: .45; }
.w-map-say {
  position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 8px 10px;
  background: rgba(10, 12, 10, .86); border: 1px solid var(--store-line-2); border-radius: var(--r-sm);
  color: var(--store-ink); font-size: .84rem;
}
.w-map-say:empty { display: none; }

.w-dot {
  position: absolute; width: 24px; height: 24px; padding: 0; transform: translate(-50%, -50%);
  background: var(--store-panel); border: 2px solid var(--k); border-radius: 50%;
  color: var(--store-ink); cursor: pointer; z-index: 1;
  transition: left 9.5s linear, top 9.5s linear, opacity .3s;
}
.w-dot.w-new { transition: none; }
.w-dot[data-kind="protagonist"] {
  width: 34px; height: 34px; z-index: 3;
  box-shadow: 0 0 0 3px rgba(255, 176, 46, .35), 0 0 18px rgba(255, 176, 46, .8);
}
@media (prefers-reduced-motion: no-preference) {
  .w-dot[data-kind="protagonist"] { animation: w-glow 2.4s ease-in-out infinite; }
}
@keyframes w-glow {
  50% { box-shadow: 0 0 0 6px rgba(255, 176, 46, .18), 0 0 26px rgba(255, 176, 46, .95); }
}
.w-dot:hover, .w-dot:focus-visible, .w-dot.w-picked { z-index: 4; outline: 2px solid #fff; outline-offset: 2px; }
.w-dot.w-down { opacity: .45; filter: grayscale(1); }
.w-dot .w-dot-face { width: 100%; height: 100%; border: 0; font-size: .5rem; }
.w-dot[data-kind="protagonist"] .w-dot-face { font-size: .66rem; }
.w-dot-name {
  position: absolute; left: 50%; top: 100%; margin-top: 4px; transform: translateX(-50%);
  padding: 2px 5px; background: rgba(10, 12, 10, .85); border-radius: var(--r-sm);
  font: 600 .68rem/1.2 var(--mono); color: var(--store-ink); white-space: nowrap; pointer-events: none;
  display: none;
}
.w-dot[data-kind="protagonist"] .w-dot-name { display: block; color: var(--k-protagonist); }
.w-dot:hover .w-dot-name, .w-dot:focus-visible .w-dot-name, .w-dot.w-picked .w-dot-name { display: block; }
.w-crew {
  position: absolute; transform: translate(-50%, -260%); white-space: nowrap;
  font: 700 .64rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: hsl(var(--crew-h, 210) 85% 74%); text-shadow: 0 1px 3px #000, 0 0 6px #000;
}

/* a face: the picture, else the initials, ringed in the kind's colour */
.w-face {
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; overflow: hidden;
  border-radius: 50%; border: 2px solid var(--k, var(--store-line-2)); background: var(--store-pit);
  font: 700 .62rem/1 var(--mono); color: var(--store-ink);
}
.w-face img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* the picked agent */
.w-panel {
  padding: 16px; background: var(--store-panel); border: 1px solid var(--store-line);
  border-radius: var(--r); box-shadow: var(--bevel); min-width: 0; scroll-margin-top: 16px;
}
.w-panel-none { color: var(--store-muted); font-size: .9rem; }
.w-agent-head { display: flex; align-items: center; gap: 12px; }
.w-agent-head .w-face { width: 48px; height: 48px; font-size: .9rem; }
.w-agent-head h3 { font: 700 1.2rem/1.15 var(--sg); color: var(--store-ink); overflow-wrap: anywhere; }
.w-agent-kind { color: var(--store-muted); font-size: .8rem; margin-top: 2px; }
.w-facts { display: grid; gap: 3px; margin-top: 14px; }
.w-facts dt { margin-top: 9px; font: 600 .66rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--store-dim); }
.w-facts dd { color: var(--store-ink); font-size: .88rem; overflow-wrap: anywhere; }
.w-facts .w-thought {
  padding: 8px 10px; border-left: 3px solid var(--k-protagonist); background: var(--store-pit);
  font-size: .95rem; line-height: 1.45;
}
.w-orders, .w-said { list-style: none; display: grid; gap: 4px; }
.w-orders li::before { content: "▸ "; color: var(--store-dim); }
.w-said-to { font: 600 .66rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--store-dim); }
#w-agent-spectate { margin-top: 14px; }

.w-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: .78rem; color: var(--store-muted); }
.w-legend li::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px;
  border-radius: 50%; border: 2px solid var(--k); vertical-align: -1px;
}

.w-roster { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 14px; }
.w-who, .w-think {
  display: flex; gap: 10px; align-items: center; width: 100%; min-height: 44px; padding: 7px 10px;
  background: var(--store-panel); border: 1px solid var(--store-line); border-left: 3px solid var(--k);
  border-radius: var(--r-sm); color: var(--store-ink); font: inherit; text-align: left; cursor: pointer;
}
.w-who:hover, .w-think:hover, .w-who:focus-visible, .w-think:focus-visible { border-color: var(--g-live); border-left-color: var(--k); }
.w-who[aria-pressed="true"] { background: var(--store-panel-2); border-color: var(--store-line-2); border-left-color: var(--k); }
.w-who-text { display: grid; min-width: 0; }
.w-who-text b { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-who-sub { color: var(--store-dim); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── thinking ────────────────────────────────────────────────────────────── */
.w-feed { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.w-think { display: grid; gap: 4px; align-items: start; }
.w-think-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: .8rem; }
.w-think-head b { color: var(--k); }
.w-think-text { font-size: .93rem; line-height: 1.45; overflow-wrap: anywhere; }
.w-feed-none { color: var(--store-muted); font-size: .88rem; }
.w-more { margin-top: 30px; }

/* every agent, and who drives it: the floor table and two count tables,
   drawn by js/agent-floor.js (its `con-` classes, in the store's colours) */
.w-floor, .w-count { width: 100%; border-collapse: collapse; font-size: .88rem; }
.w-floor th { text-align: left; font-weight: 600; color: var(--store-muted); font-size: .76rem;
  padding: 6px 8px; border-bottom: 1px solid var(--store-line-2); white-space: nowrap; }
.w-floor td, .w-count td { padding: 7px 8px; border-bottom: 1px solid var(--store-line); vertical-align: middle; }
.w-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 24px; margin-top: 14px; }
.w-counts h3 { font-size: .9rem; margin: 6px 0; }
.w-drivers .con-n { text-align: right; font-family: var(--mono); white-space: nowrap; }
.w-drivers .scroll-x { position: relative; }
.w-drivers .con-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.w-drivers .con-dim, .w-drivers .mono-note { color: var(--store-dim); }
.w-drivers .con-agent { white-space: nowrap; }
.w-drivers .con-face { display: inline-block; width: 28px; height: 28px; border-radius: 3px; vertical-align: middle;
  background: var(--store-pit); object-fit: cover; }
.w-drivers .con-face-none { border: 1px dashed var(--store-line-2); }
.w-drivers .con-who { display: inline-flex; flex-direction: column; vertical-align: middle; margin-left: 8px; line-height: 1.25; }
.w-drivers .con-who a { color: var(--store-ink); font-weight: 600; }
.w-drivers .con-kind, .w-drivers .con-model, .w-drivers .con-ago { font-size: .72rem; color: var(--store-dim); }
.w-drivers .con-model { display: block; }
.w-drivers .con-why { color: var(--store-muted); }
.w-drivers .con-watch { white-space: nowrap; }

/* on a phone the floor's five columns wrapped "doing now" one word a line and
   pushed the watch link 64px off screen. Each row becomes a card instead, the
   shape agent-console.css gives the same rows (.con-floor): who, the score and
   the watch link on top, then what drives it, then what it is doing. */
@media (max-width: 640px) {
  .w-drivers .scroll-x { overflow: visible; }
  .w-floor thead { display: none; }
  .w-floor tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "agent score go" "by by by" "now now now";
    gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--store-line); }
  .w-floor td { border: 0; padding: 0; }
  .w-floor td[colspan] { grid-column: 1 / -1; }
  .w-floor .con-agent { grid-area: agent; white-space: normal; min-width: 0; }
  .w-floor .con-score { grid-area: score; align-self: center; }
  .w-floor .con-go { grid-area: go; align-self: center; }
  .w-floor .con-go a { display: inline-flex; align-items: center; min-height: 44px; }
  .w-floor .con-by { grid-area: by; padding-left: 36px; font-size: .82rem; }
  .w-floor .con-by .con-model { display: inline; margin-left: 6px; }
  .w-floor .con-now { grid-area: now; padding-left: 36px; font-size: .85rem; }
  .w-floor .con-who a { display: inline-flex; align-items: center; min-height: 44px; }
  /* a body that reports nothing takes no line at all */
  .w-floor td.con-blank { display: none; }
}
