@font-face { font-family: "Jersey 10"; src: url('assets/fonts/jersey10-400.woff2') format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url('assets/fonts/pixelify-600.woff2') format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ink: #fff6e3;
  --dim: #c9bda4;
  --panel: rgba(30, 24, 40, .9);
  --edge: #0f0b16;
  --hi: #5b4a6e;
  --gold: #ffd166;
  --green: #7bd88f;
  --rose: #ff8e72;
  --sky: #8ecae6;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2f4a2a; color: var(--ink);
  font-family: "Jersey 10", ui-monospace, "SF Mono", Menlo, monospace; font-size: 18px; -webkit-font-smoothing: none;
  font-variant-ligatures: none; text-rendering: optimizeSpeed;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
canvas#world { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block;
  touch-action: none; cursor: grab; image-rendering: pixelated; image-rendering: crisp-edges; }
canvas#world.dragging { cursor: grabbing; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--gold); }

/* pixel panels: a dark body with a two-step pixel border */
.card { background: var(--panel); border-radius: 2px;
  box-shadow: 0 0 0 2px var(--hi), 0 0 0 4px var(--edge), 0 6px 0 4px rgba(0,0,0,.25); }

#top { position: fixed; left: 0; right: 0; top: 0; padding: calc(10px + var(--safe-t)) 10px 0; display: flex;
  flex-direction: column; gap: 10px; pointer-events: none; z-index: 5; }
#top .card { pointer-events: auto; }
.title { padding: 7px 11px 7px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand { font-family: "Pixelify Sans", "Jersey 10", monospace; font-weight: 600; font-size: 19px; letter-spacing: .5px; color: var(--gold); text-shadow: 0 2px 0 #7a3e1d; }
.brand span { color: var(--ink); text-shadow: 0 2px 0 #3b2d4d; }
.clock { font-size: 21px; display: flex; align-items: baseline; gap: 5px; }
.clock .tz { color: var(--dim); font-size: 17px; }
.sky { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); align-self: center; }
.sky.moon { background: #dfe7ff; box-shadow: inset -3px -1px 0 #9aa6cf, 0 0 6px #b9c6ff; }
.fresh { margin-left: auto; color: var(--dim); font-size: 15px; }
@media (max-width: 899px) {
  .title { flex-wrap: nowrap; justify-content: space-between; }
  .fresh { display: none; }
  .brand { font-size: 17px; white-space: nowrap; }
  .clock { white-space: nowrap; }
}

.score { display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 4px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0 4px; text-align: center; border-left: 2px solid rgba(255,255,255,.08); }
.stat:first-child { border-left: 0; }
.stat b { font-size: 24px; font-weight: 400; color: var(--ink); }
.stat span { font-size: 15px; color: var(--dim); text-transform: uppercase; letter-spacing: .6px; }
#s-earned { color: var(--green); }
#s-spent { color: var(--rose); }
.linky b { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* handoff board */
.board { position: fixed; left: 10px; bottom: calc(92px + var(--safe-b)); z-index: 5; width: min(360px, calc(100vw - 20px)); }
.board-head { display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 10px; font-weight: 400; font-size: 20px; color: var(--gold); }
.board-head .count { color: var(--dim); font-weight: 400; font-size: 17px; }
.board-head .chev { margin-left: auto; color: var(--dim); transition: transform .15s; }
.board.collapsed .chev { transform: rotate(-90deg); }
.board ol { list-style: none; margin: 0; padding: 0 10px 8px; max-height: 32vh; overflow: auto; display: flex; flex-direction: column; gap: 7px; }
.board.collapsed ol { display: none; }
.board.collapsed { width: auto; }
.board li { font-size: 18px; line-height: 1.3; padding: 6px 8px; background: rgba(255,255,255,.05); border-left: 3px solid var(--gold); }
.board li.done { border-left-color: var(--green); opacity: .85; }
.board li .who { display: block; color: var(--dim); font-size: 15px; margin-bottom: 2px; }
.board li .who b { color: var(--ink); font-weight: 400; }
.board li .res { display: block; color: var(--green); margin-top: 3px; }
.board .empty { color: var(--dim); border: 0; background: none; padding: 2px 0; }

/* roster of faces */
.roster { position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 5; display: flex; gap: 4px;
  padding: 7px 8px; overflow-x: auto; scrollbar-width: none; }
.roster::-webkit-scrollbar { display: none; }
.who-btn { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 52px; }
.who-btn .face { width: 38px; height: 38px; image-rendering: pixelated; background: #3d3150; border-radius: 3px;
  box-shadow: 0 0 0 2px var(--edge); }
.who-btn.sel .face { box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--edge); }
.who-btn .nm { font-size: 15px; color: var(--dim); white-space: nowrap; max-width: 54px; overflow: hidden; text-overflow: ellipsis; }
.who-btn .dot { position: absolute; top: -2px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #8a8299; box-shadow: 0 0 0 2px var(--edge); }
.who-btn.working .dot { background: var(--green); box-shadow: 0 0 0 2px var(--edge), 0 0 6px var(--green); }
.who-btn.working .nm { color: var(--ink); }
.who-btn.asleep .dot { background: #6e7fd0; }

.zoom { position: fixed; right: 10px; z-index: 5; bottom: calc(92px + var(--safe-b)); display: flex; flex-direction: column; }
.zoom button { width: 36px; height: 34px; font-size: 31px; line-height: 1; color: var(--ink); }
.zoom button + button { border-top: 2px solid rgba(255,255,255,.1); }

/* agent panel: bottom sheet on phones, side panel on wide screens */
.panel { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; max-height: 58vh; overflow: auto;
  background: #211a2c; padding: 16px 16px calc(18px + var(--safe-b)); box-shadow: 0 -4px 0 var(--hi), 0 -8px 0 var(--edge), 0 -14px 30px rgba(0,0,0,.4);
  animation: sheet .18s ease-out; }
@keyframes sheet { from { transform: translateY(30px); opacity: 0; } }
.panel .close { position: absolute; right: 10px; top: 8px; width: 34px; height: 34px; font-size: 36px; color: var(--dim); }
.p-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; padding-right: 30px; }
.p-face { width: 76px; height: 76px; image-rendering: pixelated; background: #3d3150; box-shadow: 0 0 0 3px var(--edge), 0 0 0 5px var(--hi); flex: 0 0 auto; }
.p-name { font-size: 31px; font-weight: 400; color: var(--gold); }
.p-home { color: var(--dim); font-size: 18px; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 18px; padding: 3px 8px; background: #3a3149; border-radius: 2px; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: #8a8299; }
.pill.working i { background: var(--green); box-shadow: 0 0 6px var(--green); }
.pill.asleep i { background: #6e7fd0; }
.p-sec { margin-top: 14px; }
.p-sec h3 { margin: 0 0 6px; font-size: 17px; text-transform: uppercase; letter-spacing: .8px; color: var(--dim); font-weight: 400; }
.p-next { font-size: 21px; }
.p-next small { display: block; color: var(--dim); font-size: 17px; margin-top: 2px; }
.acts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.acts li { font-size: 19px; line-height: 1.3; padding: 6px 8px; background: rgba(255,255,255,.05); }
.acts li time { display: block; color: var(--dim); font-size: 16px; margin-bottom: 2px; }
.p-row { display: flex; align-items: center; gap: 14px; }
.p-last { color: var(--dim); font-size: 16px; line-height: 1.1; }
.chat { display: inline-block; padding: 9px 14px; background: var(--gold); color: #2b1d0e; font-weight: 400;
  text-decoration: none; box-shadow: 0 0 0 2px var(--edge), 0 3px 0 2px #a8742a; }
.chat:active { transform: translateY(2px); }
.listing { display: flex; justify-content: space-between; gap: 10px; padding: 8px; background: rgba(255,255,255,.05); margin-bottom: 6px; font-size: 20px; text-decoration: none; color: var(--ink); }
.listing b { color: var(--gold); }

.tip { position: fixed; z-index: 6; pointer-events: none; padding: 3px 7px; font-size: 17px; background: var(--panel); box-shadow: 0 0 0 2px var(--edge); }

@media (min-width: 900px) {
  #top { flex-direction: row; justify-content: space-between; align-items: flex-start; padding: 14px 14px 0; }
  .title { flex-direction: column; gap: 2px; padding: 9px 14px 10px; }
  .brand { font-size: 23px; }
  .fresh { margin-left: 0; }
  .score { padding: 9px 6px; min-width: 380px; }
  .stat b { font-size: 29px; }
  .board { left: 14px; bottom: 14px; width: 340px; }
  .roster { left: 50%; right: auto; transform: translateX(-50%); bottom: 14px; max-width: calc(100vw - 730px); min-width: 0; }
  .zoom { right: 14px; bottom: 14px; }
  .panel { left: auto; right: 14px; top: 96px; bottom: 14px; width: 360px; max-height: none; border-radius: 2px;
    box-shadow: 0 0 0 2px var(--hi), 0 0 0 4px var(--edge), 0 10px 30px rgba(0,0,0,.4); animation: side .18s ease-out; }
  @keyframes side { from { transform: translateX(30px); opacity: 0; } }
}
@media (min-width: 900px) and (max-width: 1240px) {
  .roster { left: 370px; right: 70px; transform: none; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
