:root {
  --bg: #1a1c2c; --panel: #262b44; --line: #3a4466; --text: #f4f4f4; --dim: #8b9bb4;
  --green: #38b764; --yellow: #ffcd75; --red: #b13e53; --blue: #41a6f6;
  --pix: 'Press Start 2P', monospace; --mono: 'VT323', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 20px; }
h1 { font-family: var(--pix); font-size: 13px; margin: 0; color: var(--yellow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
h2 { font-family: var(--pix); font-size: 10px; margin: 0 0 10px; color: var(--dim); text-transform: uppercase; }
h3 { margin: 0 0 4px; font-family: var(--pix); font-size: 11px; line-height: 1.5; }
a { color: var(--blue); }
small, .dim { color: var(--dim); }
ul { list-style: none; margin: 0; padding: 0; }

header { display: flex; gap: 10px 18px; align-items: center; padding: 10px 16px; border-bottom: 4px solid var(--line); flex-wrap: wrap; }
.clock { font-family: var(--pix); font-size: 11px; color: var(--blue); white-space: nowrap; }
.stats { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-left: auto; }
.stat { display: grid; line-height: 1; }
.stat small { font-size: 15px; }
.stat b { font-weight: normal; font-size: 21px; }
.stat.bad b { color: #ff8fa3; }
.headline { margin: 0; padding: 8px 16px; color: var(--yellow); min-height: 1em; }
.headline:empty { display: none; }

main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; padding: 16px; align-items: start; }
main .wide { grid-column: 1 / -1; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; } }
footer { padding: 0 16px 16px; color: var(--dim); font-size: 16px; }

#stage { position: relative; border: 4px solid var(--line); background: #000; line-height: 0; }
#office { width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; cursor: pointer; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; line-height: 1; }
.label {
  position: absolute; transform: translate(-50%, -100%); text-align: center; pointer-events: auto; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: max-content; max-width: 14%;
}
.label .bubble {
  background: #f4f4f4; color: #1a1c2c; font-size: 14px; padding: 1px 4px; border: 2px solid #1a1c2c;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.label .bubble:empty { display: none; }
.label .name { font-size: 13px; padding: 0 3px; background: rgba(26, 28, 44, .8); color: #fff; white-space: nowrap; }
.label.talk { z-index: 4; max-width: 24%; }
.label.talk .bubble { background: #fff7d6; }
.label.z .name { color: #ff8fa3; }
.label.sel .name { background: var(--blue); color: #000; }
.label.sel, .label:hover { z-index: 5; max-width: 30%; }
@media (max-width: 700px) { .label .name { display: none; } .label.sel .name { display: block; } .label .bubble { font-size: 12px; } }
.paused {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; text-align: center; line-height: 1.2;
  background: rgba(10, 11, 20, .75); padding: 16px;
}
.paused[hidden] { display: none; }
.paused span { font-family: var(--pix); font-size: 12px; color: var(--yellow); }

aside { display: grid; gap: 16px; min-width: 0; }
.panel { background: var(--panel); border: 4px solid var(--line); padding: 12px; min-width: 0; position: relative; }
.x { background: none; border: 0; color: var(--dim); cursor: pointer; font: inherit; position: absolute; top: 6px; right: 8px; }
#detail p { margin: 4px 0; overflow-wrap: anywhere; }
#detail .small { font-size: 17px; color: var(--dim); }
.meter { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; }
.bar { display: block; height: 8px; background: #11131f; border: 2px solid #11131f; }
.bar i { display: block; height: 100%; background: var(--blue); }
.bar.green i { background: var(--green); } .bar.yellow i { background: var(--yellow); } .bar.red i { background: var(--red); }

#projects { display: grid; gap: 10px; }
.proj { display: grid; gap: 4px; }
.proj.closed, .proj.cancelled { opacity: .65; }
.phead { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.phead small { white-space: nowrap; }
.proj details { font-size: 17px; }
.proj summary { cursor: pointer; color: var(--dim); }
.tasks li { padding: 1px 0 1px 8px; border-left: 3px solid var(--yellow); margin: 2px 0; }
.tasks li.revisar { border-color: var(--blue); } .tasks li.testar { border-color: #c77dff; } .tasks li.pronta { border-color: var(--green); color: var(--dim); }

#log { max-height: 280px; overflow: auto; font-size: 17px; color: var(--dim); }
#log li { padding: 2px 0; overflow-wrap: anywhere; }
#log time { color: #5f6c91; margin-right: 6px; }

#roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; }
#roster li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: center; padding: 4px 6px; cursor: pointer; border: 2px solid transparent; line-height: 1.05; }
#roster li:hover { background: #2f3655; }
#roster li.sel { border-color: var(--blue); }
#roster li.off { opacity: .45; }
#roster canvas { width: 24px; height: 36px; image-rendering: pixelated; }
#roster small { font-size: 16px; }
#roster .dim { font-size: 16px; }

/* admin */
.admin { max-width: 960px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
input, select { font: inherit; color: var(--text); background: #11131f; border: 2px solid var(--line); padding: 4px 8px; outline: none; width: 100%; }
input:focus, select:focus { border-color: var(--blue); }
.btn {
  font-family: var(--pix); font-size: 9px; color: var(--text); background: var(--line);
  border: 0; padding: 9px 10px; cursor: pointer; box-shadow: 0 4px 0 #11131f; white-space: nowrap;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #11131f; }
.btn.green { background: var(--green); color: #0b2415; }
.btn.red { background: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.err { color: #ff8fa3; min-height: 1em; margin: 0; }
.ok { color: var(--green); min-height: 1em; margin: 0; }
.login { max-width: 380px; margin: 10vh auto; display: grid; gap: 12px; }
.stories { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.story { border: 3px solid var(--line); padding: 10px; display: grid; gap: 6px; cursor: pointer; background: #1f2338; text-align: left; font: inherit; color: inherit; }
.story.on { border-color: var(--green); }
.story.pick { border-color: var(--blue); }
.story b { font-family: var(--pix); font-size: 10px; line-height: 1.5; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
