/* Wintergewitter — December on the Kalmyk steppe: a white-out, read in ink. */
:root {
  --snow: #eef0f1;
  --snow-deep: #dde2e4;
  --shade: #c4ccd0;
  --ink: #16191c;
  --ink-soft: #5b666d;
  --rule: #aab4b9;
  --de: #414d3d;
  --de-pale: #e6e9e2;
  --su: #7d2f24;
  --su-pale: #f2e3df;
  --signal: #c8641e;
  --earth: #a08a6a;
  --paper: #f7f7f4;
  --panel: #23282b;
  --panel-2: #2d3336;
  --panel-ink: #e7eaeb;
  --display: "Haettenschweiler", "Arial Narrow", "Franklin Gothic Condensed", Impact, sans-serif;
  --body: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --data: "Consolas", "DejaVu Sans Mono", "Menlo", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--panel);
  color: var(--panel-ink);
  font-family: var(--body);
  font-size: 15px;
  overflow: hidden;
}
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ---------------------------------------------------------------- shell */
#app { display: flex; height: 100%; width: 100%; }
#board { position: relative; flex: 1 1 auto; min-width: 0; background: var(--snow-deep); }
#map { display: block; width: 100%; height: 100%; touch-action: none; }

#side {
  flex: 0 0 340px; display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid #000; min-height: 0;
}

/* --------------------------------------------------------------- typography */
.stencil {
  font-family: var(--display); text-transform: uppercase;
  letter-spacing: .16em; font-weight: 400;
}
h1.stencil { font-size: 44px; letter-spacing: .2em; margin: 0; line-height: 1; }
.eyebrow {
  font-family: var(--data); font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-soft);
}
#side .eyebrow { color: #8e9aa0; }

/* ------------------------------------------------------------------ panel */
.pane { border-bottom: 1px solid #0c0f10; padding: 10px 12px; }
.pane.grow { flex: 1 1 auto; overflow-y: auto; min-height: 60px; }
.pane h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: .16em; font-size: 15px; margin: 0 0 6px; font-weight: 400; color: #cfd6d9; }

.clock { display: flex; align-items: baseline; gap: 10px; }
.clock .turn { font-family: var(--display); font-size: 30px; letter-spacing: .06em; line-height: 1; }
.clock .of { font-family: var(--data); font-size: 11px; color: #8e9aa0; }
.init { margin-left: auto; font-family: var(--data); font-size: 11px; padding: 2px 7px; border: 1px solid #4a5457; }
.init.de { color: #c3d0bd; border-color: #55634f; }
.init.su { color: #e8b9b0; border-color: #7d2f24; }

/* formations */
.form {
  display: block; width: 100%; text-align: left; background: var(--panel-2);
  border: 1px solid #3a4245; border-left: 3px solid var(--de);
  color: var(--panel-ink); padding: 6px 8px; margin-bottom: 5px;
}
.form.su { border-left-color: var(--su); }
.form[disabled] { opacity: .38; cursor: default; }
.form.active { background: #3c4549; border-color: var(--signal); }
.form .nm { font-family: var(--display); letter-spacing: .1em; text-transform: uppercase; font-size: 14px; }
.form .st { font-family: var(--data); font-size: 10px; color: #93a0a6; display: flex; gap: 8px; margin-top: 2px; }
#objs .st { display: flex; justify-content: space-between; gap: 8px; }
.bar { height: 3px; background: #4b5457; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--de); }
.form.su .bar i { background: #a2483a; }

/* orders */
#orders { display: flex; flex-wrap: wrap; gap: 5px; }
.btn {
  background: #333c40; color: var(--panel-ink); border: 1px solid #4c565a;
  padding: 5px 9px; font-family: var(--data); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
}
.btn:hover:not([disabled]) { background: #414c50; }
.btn[disabled] { opacity: .35; cursor: default; }
.btn.go { background: var(--signal); border-color: #e2762a; color: #16110c; font-weight: bold; }
.btn.wide { width: 100%; text-align: center; }

/* the fire slip: a printed form, laid on the console */
#slip {
  background: var(--paper); color: var(--ink); font-family: var(--data);
  font-size: 11px; padding: 8px 9px; line-height: 1.45;
  box-shadow: 0 2px 0 rgba(0,0,0,.5); border-top: 3px double var(--ink);
}
#slip .hd { font-family: var(--display); letter-spacing: .14em; font-size: 14px; text-transform: uppercase; }
#slip .row { display: flex; justify-content: space-between; }
#slip .row b { font-weight: normal; color: #4a545a; }
#slip .dice { display: flex; gap: 3px; margin: 4px 0; flex-wrap: wrap; }
#slip .d {
  width: 17px; height: 17px; line-height: 16px; text-align: center;
  border: 1px solid var(--ink); font-size: 10px;
}
#slip .d.hit { background: var(--ink); color: var(--paper); }
#slip .verdict {
  margin-top: 5px; font-family: var(--display); letter-spacing: .12em;
  text-transform: uppercase; font-size: 15px; border: 2px solid var(--su);
  color: var(--su); display: inline-block; padding: 1px 6px; transform: rotate(-1.5deg);
}
#slip .verdict.nil { border-color: #8b959a; color: #667075; }

/* signals traffic */
#log { font-family: var(--data); font-size: 10.5px; line-height: 1.5; }
#log div { margin-bottom: 3px; color: #a9b5ba; }
#log .tm { color: var(--signal); }
#log .fr { color: #dfe6e8; }

/* --------------------------------------------- the advance ribbon (signature) */
#ribbon { position: absolute; right: 0; top: 0; bottom: 0; width: 92px; pointer-events: none; }
#ribbon canvas { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------------ sheets */
.veil {
  position: absolute; inset: 0; background: rgba(12,15,16,.86);
  display: flex; align-items: center; justify-content: center; z-index: 40; padding: 20px;
}
.veil[hidden] { display: none !important; }
.sheet {
  background: var(--paper); color: var(--ink); max-width: 760px; width: 100%;
  max-height: 92%; overflow-y: auto; padding: 26px 30px 24px;
  border-top: 10px solid var(--ink); box-shadow: 0 18px 60px rgba(0,0,0,.6);
}
.sheet h1 { color: var(--ink); }
.sheet h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; font-weight: 400; font-size: 17px; margin: 18px 0 6px; }
.sheet p { line-height: 1.6; margin: 8px 0; }
.sheet .lede { font-size: 17px; }
.sheet .rule { height: 1px; background: var(--rule); margin: 14px 0; }
.sheet .choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sheet .btn { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sheet .btn.go { background: var(--signal); border-color: var(--signal); color: #17110b; }
.sheet .btn.ghost { background: transparent; color: var(--ink); }
.oob { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-family: var(--data); font-size: 11.5px; }
.oob ul { margin: 3px 0 0; padding-left: 14px; }
.oob li { margin: 1px 0; }
.oob h3 { font-family: var(--display); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; margin: 8px 0 2px; font-weight: 400; }
table.tab { width: 100%; border-collapse: collapse; font-family: var(--data); font-size: 11.5px; }
table.tab th, table.tab td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--rule); }
table.tab th { font-weight: normal; color: var(--ink-soft); text-transform: uppercase; font-size: 10px; letter-spacing: .12em; }
.km { font-family: var(--display); font-size: 30px; letter-spacing: .04em; }

/* opening screen */
#title { text-align: center; }
#title .sub { font-family: var(--data); letter-spacing: .3em; text-transform: uppercase; font-size: 11px; color: var(--ink-soft); margin-top: 8px; }
#title .quote { font-style: italic; margin: 18px auto; max-width: 46ch; }

/* the unit card, raised off the map on a hover */
#tip {
  position: absolute; z-index: 20; pointer-events: none; width: 268px;
  background: var(--paper); color: var(--ink); font-family: var(--data); font-size: 11px;
  line-height: 1.45; padding: 8px 10px 9px; border-top: 3px solid var(--ink);
  box-shadow: 0 6px 22px rgba(0,0,0,.45);
}
#tip[hidden] { display: none !important; }
#tip.su { border-top-color: var(--su); }
#tip.de { border-top-color: var(--de); }
#tip .desig { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: 15px; line-height: 1.1; }
#tip .kit { font-size: 12px; margin-top: 1px; }
#tip .who { color: var(--ink-soft); margin-bottom: 5px; }
#tip .grid { display: grid; grid-template-columns: auto auto; gap: 0 10px; border-top: 1px solid var(--rule); padding-top: 4px; }
#tip .grid span:nth-child(odd) { color: var(--ink-soft); }
#tip .grid span:nth-child(even) { text-align: right; }
#tip .state { margin-top: 5px; border-top: 1px solid var(--rule); padding-top: 4px; }
#tip .state i { font-style: normal; display: inline-block; border: 1px solid var(--signal); color: #8a4412; padding: 0 4px; margin: 2px 3px 0 0; font-size: 10px; }
#tip .shot { margin-top: 6px; background: var(--ink); color: var(--paper); padding: 5px 7px; }
#tip .shot b { font-weight: normal; color: #9fb0b7; }
#tip .shot .line { display: flex; justify-content: space-between; }

/* zoom cluster */
#zoom { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.zb {
  width: 30px; height: 30px; background: rgba(24,29,31,.86); color: #dfe6e8;
  border: 1px solid #4c565a; font-family: var(--data); font-size: 15px; line-height: 1;
  padding: 0; display: flex; align-items: center; justify-content: center;
}
.zb:hover { background: rgba(45,53,57,.95); }
#map { cursor: grab; }

/* map hint strip */
#hint {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(18,22,24,.9);
  color: #dfe6e8; font-family: var(--data); font-size: 11px; padding: 6px 10px;
  letter-spacing: .06em; display: flex; gap: 14px; align-items: center;
}
#hint .k { color: var(--signal); }
#hint .sp { margin-left: auto; }

@media (max-width: 900px) {
  #app { flex-direction: column; }
  #side { flex: 0 0 47%; border-left: none; border-top: 1px solid #000; }
  #ribbon { width: 60px; }
  h1.stencil { font-size: 30px; }
  .oob { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
