/* Night Raid. One dark look on purpose: it's a night raid. */
:root {
  --night: #0e1210;
  --panel: #151a17;
  --line: #2b352e;
  --ink: #e1e4d6;
  --muted: #8f998c;
  --tommy: #8fc76f;
  --amber: #e9b13c;
  --red: #e15c44;
  --noise: #84c0e2;
  --f-type: "Special Elite", "Courier New", monospace;
  --f-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--night); color: var(--ink); }
body { font-family: var(--f-body); font-size: 14px; line-height: 1.4; }
[hidden] { display: none !important; }
kbd { font-family: var(--f-head); border: 1px solid var(--muted); border-radius: 3px; padding: 0 4px; font-size: .8rem; color: var(--ink); }

/* the left column and the board (v20): the board gets the whole rest of the screen */
.app { height: 100%; display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 10px; padding: 8px 10px; }
.side { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.side header { display: grid; gap: 6px; }
.side h1 { font-size: 1.6rem; }
.side .op { margin-top: 2px; font-size: .82rem; }
.side .card { padding: 8px 10px; gap: 6px; align-content: start; }
.side .ladder div { padding: 3px 2px; font-size: .72rem; }
.side .job { font-size: .82rem; }
.side .squad { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.side .man { grid-template-columns: 26px 1fr; border-color: var(--line); padding: 5px 6px; align-items: start; }
.side .man .tags { justify-content: start; max-width: none; margin-top: 3px; }
.side .who b { font-size: .95rem; }
.side .who span { display: block; }
.side .log { font-size: .8rem; gap: 2px; }
.side .end { display: grid; place-content: center; gap: 2px; font-size: 1.1rem; padding: 6px; }
.side .end span { font-size: .75rem; letter-spacing: .04em; font-weight: 600; opacity: .8; }
.side .end kbd { justify-self: center; margin-top: 4px; }
header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; }
h1 { font-family: var(--f-type); font-weight: 400; font-size: 1.9rem; letter-spacing: .04em; margin: 0; line-height: 1; }
.op { font-family: var(--f-type); color: var(--muted); margin-top: 4px; }
.bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { font-family: var(--f-head); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.pill.now { background: var(--tommy); border-color: var(--tommy); color: var(--night); }
.pill.guards { background: #59606a; border-color: #59606a; color: var(--ink); }
.pill.warnp { border-color: var(--amber); color: var(--amber); }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 12px; min-height: 0; }
.stage { position: relative; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #0b100d; min-height: 0; }
.stage canvas { position: absolute; inset: 0; }
.stage canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
.fail { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 20px; text-align: center; }

.banner { position: absolute; left: 50%; top: 18px; transform: translate(-50%, -10px); opacity: 0; pointer-events: none;
  font-family: var(--f-type); font-size: 1.7rem; letter-spacing: .06em; padding: 8px 20px; border-radius: 4px;
  background: rgba(14,18,16,.85); border: 1px solid var(--tommy); color: var(--tommy); transition: opacity .25s, transform .25s; white-space: nowrap; }
.banner.show { opacity: 1; transform: translate(-50%, 0); }
.banner.bad { border-color: var(--red); color: var(--red); font-size: 2.6rem; }

.panel { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; display: grid; gap: 8px; }
.card h2 { font-family: var(--f-head); text-transform: uppercase; letter-spacing: .1em; font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0; }

.ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ladder div { font-family: var(--f-head); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; text-align: center; padding: 5px 2px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); }
.ladder .s { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.ladder .a, .ladder .x { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.ladder div.on { background: var(--tommy); color: var(--night); border-color: var(--tommy); }
.ladder .s.on { background: var(--amber); border-color: var(--amber); }
.ladder .a.on, .ladder .x.on { background: var(--red); border-color: var(--red); }

.job { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.job li { display: grid; grid-template-columns: 18px 1fr; color: var(--ink); }
.job li span { color: var(--muted); }
.job li.done { color: var(--tommy); }
.job li.done span { color: var(--tommy); }

.squad { display: grid; gap: 4px; }
.man { all: unset; cursor: pointer; display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 4px; border: 1px solid transparent; }
.man:hover { background: #1b221d; }
.man:focus-visible { outline: 2px solid var(--noise); }
.man.sel { border-color: var(--tommy); background: #1b241d; }
.man.gone { opacity: .45; cursor: default; }
.tok { width: 26px; height: 26px; border-radius: 50%; background: var(--tommy); color: var(--night); display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; }
.man.gone .tok { background: var(--muted); }
.who { min-width: 0; }
.who b { font-family: var(--f-head); font-weight: 600; font-size: 1rem; display: block; line-height: 1.1; }
.who span { font-size: .76rem; color: var(--muted); }
.tags { display: flex; gap: 3px; flex-wrap: wrap; justify-content: end; max-width: 110px; }
.tags i { font-style: normal; font-family: var(--f-head); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: 1px 5px; border-radius: 3px; border: 1px solid var(--tommy); color: var(--tommy); }
.tags i.used { border-color: var(--line); color: var(--muted); text-decoration: line-through; }
.tags i.out { border-color: var(--noise); color: var(--noise); }
.tags i.dead { border-color: var(--red); color: var(--red); }
.tags i.watch { border-color: var(--amber); color: var(--amber); }

.btns { display: grid; gap: 5px; }
.btns.three { grid-template-columns: repeat(3, 1fr); }
.btn { all: unset; cursor: pointer; text-align: center; border: 1px solid var(--line); border-radius: 3px; padding: 6px 4px; display: grid; gap: 1px; background: #1a201c; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:focus-visible { outline: 2px solid var(--noise); outline-offset: 1px; }
.btn b { font-family: var(--f-head); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: .92rem; }
.btn span { font-size: .72rem; color: var(--muted); }
.btn.on { border-color: var(--tommy); background: #20301f; }
.btn.on b { color: var(--tommy); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.small { padding: 6px 10px; display: inline-flex; gap: 6px; align-items: center; }

.targets { display: grid; gap: 4px; }
.targets:empty { display: none; }
.target { all: unset; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid var(--red); border-radius: 3px; background: #241615; }
.target b { font-family: var(--f-head); font-weight: 600; }
.target span { color: var(--muted); font-size: .8rem; }
.target.cancel { border-color: var(--line); background: transparent; }
.target:focus-visible { outline: 2px solid var(--noise); }

.readout { font-size: .86rem; padding: 7px 9px; border-radius: 3px; background: #111612; border-left: 3px solid var(--noise); min-height: 2.8em; }
.readout.warn { border-left-color: var(--amber); }
.readout.bad { border-left-color: var(--red); }
.readout .bad { color: var(--red); }
.readout .warn { color: var(--amber); }
.readout .good { color: var(--tommy); }

.end { all: unset; cursor: pointer; text-align: center; padding: 10px; border-radius: 4px; background: var(--tommy); color: var(--night); font-family: var(--f-head); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 1rem; }
.end kbd { border-color: var(--night); color: var(--night); }
.end:hover { filter: brightness(1.08); }
.end:disabled { opacity: .45; cursor: default; }
.end:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .84rem; }
.log li { color: var(--muted); }
.log li.good { color: var(--tommy); }
.log li.warn { color: var(--amber); }
.log li.bad { color: var(--red); }
.log li.round { color: var(--ink); font-family: var(--f-head); text-transform: uppercase; letter-spacing: .08em; }

#ver { position: fixed; right: 10px; top: 4px; font-family: var(--f-head); color: var(--muted); font-size: .8rem; }

.overlay { position: fixed; inset: 0; background: rgba(6,9,7,.78); display: flex; padding: 16px; z-index: 10; overflow-y: auto; }
.sheet { margin: auto; max-width: 860px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 22px 26px; display: grid; gap: 12px; }
.sheet.small { max-width: 460px; text-align: center; }
.sheet h1 { font-size: 2.4rem; }
.sheet h1.win { color: var(--tommy); }
.sheet h1.lose { color: var(--red); }
.brief { font-family: var(--f-type); font-size: 1.02rem; line-height: 1.55; margin: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.keys { color: var(--muted); margin: 0; }
.go { all: unset; cursor: pointer; justify-self: center; padding: 11px 34px; border-radius: 4px; background: var(--tommy); color: var(--night); font-family: var(--f-head); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 1.1rem; }
.go:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.stats { display: grid; gap: 4px; }
.stats div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; }
.stats span { color: var(--muted); }

/* ---- the tip at the foot of the board ---- */
.tip { position: absolute; left: 10px; bottom: 10px; max-width: min(720px, calc(100% - 20px)); z-index: 4; pointer-events: none;
  font-size: .88rem; padding: 7px 10px; border-radius: 4px; background: rgba(14,18,16,.88); border-left: 3px solid var(--noise); }
.tip.warn { border-left-color: var(--amber); }
.tip.bad { border-left-color: var(--red); }
.tip .bad { color: var(--red); }
.tip .warn { color: var(--amber); }
.tip .good { color: var(--tommy); }
.tip .pace-sneak { color: #e6d15a; }
.tip .pace-run { color: #ec8a3a; }

/* ---- the menu for a man: in the left column, with a thin pointer across to him ---- */
.pointer { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 5; pointer-events: none; overflow: visible; }
.pointer path { fill: var(--tommy); fill-opacity: .9; stroke: var(--night); stroke-width: 1; stroke-opacity: .6; stroke-linejoin: round; }
.pointer path.aim { fill: var(--red); }

/* ---- the info card (v21): a picture of the man or guard pointed at, and all about him ---- */
.info { position: absolute; right: 10px; top: 10px; z-index: 5; width: 290px; pointer-events: none;
  display: grid; grid-template-columns: 86px 1fr; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 6px;
  background: rgba(21,26,23,.95); border: 1px solid var(--line); border-left: 4px solid #3f8fe8; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.info.de { border-left-color: #e0442e; }
.info img { width: 86px; height: 108px; object-fit: cover; border-radius: 4px; background: radial-gradient(circle at 50% 35%, #2c3a30, #121813); }
.info .itext { display: grid; gap: 3px; align-content: start; font-size: .8rem; }
.info .iname { font-family: var(--f-head); font-weight: 700; font-size: 1.1rem; line-height: 1.1; }
.info .irole { color: var(--muted); }
.info .irow b { font-family: var(--f-head); font-weight: 600; letter-spacing: .02em; }
.info .istate { font-family: var(--f-head); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.info .istate.calm { color: var(--tommy); }
.info .istate.suspicious { color: var(--amber); }
.info .istate.alerted, .info .istate.hunting, .info .istate.dead { color: var(--red); }

/* ---- picking a target: a bubble beside each one, with the odds, pointing at him ---- */
.bubbles { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.bubble { all: unset; position: absolute; pointer-events: auto; cursor: pointer; box-sizing: border-box; width: 190px;
  display: flex; flex-direction: column; gap: 1px; padding: 5px 8px; border-radius: 6px;
  background: rgba(36,22,21,.96); border: 1px solid var(--red); box-shadow: 0 4px 16px rgba(0,0,0,.55); }
.bubble b { font-family: var(--f-head); font-weight: 600; font-size: .95rem; letter-spacing: .02em; }
.bubble span { color: var(--ink); opacity: .8; font-size: .74rem; line-height: 1.3; }
.bubble:hover { background: #3a1f1b; }
.bubble:focus-visible { outline: 2px solid var(--noise); }
.menu { position: relative; z-index: 6; background: var(--panel); border: 1px solid var(--tommy); border-radius: 6px;
  padding: 6px; display: flex; flex-direction: column; gap: 4px; flex: none; }
.menu .mhead { display: flex; justify-content: space-between; gap: 10px; padding: 2px 4px 4px; border-bottom: 1px dotted var(--line); }
.menu .mhead b { font-family: var(--f-head); font-weight: 700; font-size: 1.05rem; }
.menu .mhead span { color: var(--muted); font-size: .8rem; align-self: center; }
.menu .mnote { font-size: .78rem; color: var(--muted); padding: 0 4px; }
.menu .mrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.menu button { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 8px; border-radius: 4px; border: 1px solid var(--line); background: #1a201c; }
.menu button:hover:not(:disabled) { border-color: var(--muted); }
.menu button:focus-visible { outline: 2px solid var(--noise); }
.menu button b { font-family: var(--f-head); font-weight: 600; font-size: .95rem; letter-spacing: .02em; }
.menu button span { color: var(--muted); font-size: .74rem; }
.menu button.pace { flex-direction: column; align-items: center; gap: 0; padding: 5px 2px; }
.menu button.pace b { text-transform: uppercase; font-size: .85rem; }
.menu button.pace.on { border-color: var(--tommy); background: #20301f; }
.menu button.pace.on b { color: var(--tommy); }
.menu button:disabled { opacity: .4; cursor: default; }
.menu button.target { border-color: var(--red); background: #241615; }

@media (max-width: 980px) {
  .app { height: auto; grid-template-columns: minmax(0, 1fr); }
  .side { overflow: visible; order: 2; }
  .stage { order: 1; }
  .main { grid-template-columns: minmax(0, 1fr); }
  .stage { height: 62vh; }
  .panel { overflow: visible; }
  .cols { grid-template-columns: 1fr; }
}
