:root {
  color-scheme: dark;
  --bg: #16130f;
  --ink: #f6ead4;
  --muted: #c8b59a;
  --dim: #8f8272;
  --panel: #241e18;
  --card: #2e2720;
  --line: #3a3128;
  --gold: #e6c15a;
  --wood: #8a6240;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, #2a221a 0, transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.top {
  padding: 18px 16px 8px;
  max-width: 1480px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0;
  font-size: 26px;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.sub {
  margin: 0;
  max-width: 46rem;
  color: var(--muted);
  font-size: 14px;
}

.banner {
  max-width: 1448px;
  margin: 12px auto 0;
  background: var(--gold);
  color: #24160e;
  border: 2px solid #24160e;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 14px;
}

.banner.bad { background: #e07a6a; }

.layout {
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px 16px 8px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
}

.bezel {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1000px;
  background: #2c2118;
  border: 4px solid var(--wood);
  box-shadow: inset 0 0 0 3px #1a120c, 0 8px 0 #120e0b;
  padding: 10px;
}

.viewport {
  position: relative;
  width: 100%;
  line-height: 0;
  overflow: hidden;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #1b4a34;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.nameplate {
  position: absolute;
  transform: translate(-50%, 0);
  display: flex;
  gap: 4px;
  align-items: center;
  background: #6b3f22;
  color: #f8e7c4;
  border: 2px solid #24160e;
  box-shadow: 2px 2px 0 #24160e;
  padding: 1px 4px 2px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.nameplate .lines { display: flex; flex-direction: column; }
.nameplate .mark { font-weight: 700; min-width: 1em; text-align: center; }
.nameplate.working .mark { color: #b6f5cf; }
.nameplate.idle .mark { color: #ffe08a; }
.nameplate.waiting .mark { color: #d5e6ff; }
.nameplate.done .mark { color: #e4ffb0; }

.bubble {
  position: absolute;
  transform: translate(-50%, -115%);
  width: max-content;
  max-width: 148px;
  background: #fff8e8;
  color: #24160e;
  border: 2px solid #24160e;
  box-shadow: 3px 3px 0 #24160e;
  padding: 4px 6px 5px;
  line-height: 1.25;
  font-size: 12px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.bubble.below { transform: translate(-50%, 6px); }

.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #24160e;
  border-bottom: 0;
}

.bubble.below::after {
  bottom: auto;
  top: -7px;
  border-top: 0;
  border-bottom: 6px solid #24160e;
}

.bubble .who {
  display: block;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bubble .task { margin: 2px 0 0; }
.bubble.working { box-shadow: 3px 3px 0 #1e6b43; }
.bubble.idle { box-shadow: 3px 3px 0 #8a6a20; }
.bubble.waiting { box-shadow: 3px 3px 0 #2a4f8a; }
.bubble.done { box-shadow: 3px 3px 0 #4d7a22; }

.panel {
  width: min(100%, 340px);
  flex: none;
  background: var(--panel);
  border: 2px solid var(--line);
  padding: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.panel-head p {
  margin: 4px 0 8px;
  color: var(--dim);
  font-size: 12px;
}

.card {
  background: var(--card);
  border-left: 4px solid var(--gold);
  padding: 8px 8px 8px 10px;
  margin-top: 8px;
}

.card h3 {
  margin: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag {
  font-size: 10px;
  background: var(--gold);
  color: #24160e;
  padding: 1px 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.task {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.35;
}

.when {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 11px;
}

footer {
  max-width: 1480px;
  margin: 0 auto;
  padding: 8px 16px 22px;
  color: var(--dim);
  font-size: 12px;
}

footer p { margin: 0; }

@media (max-width: 860px) {
  h1 { font-size: 20px; }
  .layout { flex-direction: column; align-items: stretch; }
  .viewport { width: 100%; }
  .panel { width: auto; }
}
