:root {
  color-scheme: dark;
  --desktop: #061224;
  --desktop-dot: #0b2241;
  --window: #b9bcc2;
  --window-light: #f5f6f8;
  --window-mid: #858990;
  --window-dark: #252830;
  --navy: #071d5c;
  --ink: #07101c;
  --terminal: #07111d;
  --terminal-2: #0d1a2a;
  --terminal-line: #29415c;
  --green: #7dff73;
  --amber: #ffc548;
  --red: #ff4f58;
  --cyan: #59d7ff;
  --white: #f8fbff;
  --muted: #9cb0c8;
  --shadow: rgba(0, 0, 0, .65);
  font-family: "Trebuchet MS", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--desktop);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--desktop);
  background-image:
    linear-gradient(rgba(7, 24, 49, .88), rgba(2, 8, 18, .94)),
    radial-gradient(circle at 1px 1px, var(--desktop-dot) 1px, transparent 1px);
  background-size: auto, 12px 12px;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.desktop {
  min-height: 100vh;
  padding: clamp(10px, 2vw, 26px);
  display: grid;
  place-items: center;
}

.game-window {
  width: min(1480px, 100%);
  min-height: min(920px, calc(100vh - 30px));
  overflow: hidden;
  background: var(--window);
  border: 3px solid;
  border-color: var(--window-light) var(--window-dark) var(--window-dark) var(--window-light);
  box-shadow: 14px 18px 0 rgba(0, 0, 0, .42), 0 28px 70px var(--shadow);
}

.title-bar {
  min-height: 38px;
  padding: 5px 6px 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--navy);
}

.title-bar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #061224;
  background: var(--amber);
  border: 2px solid;
  border-color: #fff #694d00 #694d00 #fff;
  font-size: .9rem;
}

.window-controls {
  display: flex;
  gap: 4px;
}

.window-controls span {
  width: 28px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #111;
  background: var(--window);
  border: 2px solid;
  border-color: #fff #36383d #36383d #fff;
  line-height: 1;
}

.menu-bar {
  min-height: 39px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 2px solid var(--window-dark);
}

.menu-bar button,
.help-dialog button {
  min-height: 29px;
  padding: 4px 12px;
  color: #111;
  background: var(--window);
  border: 2px solid;
  border-color: #fff #32343a #32343a #fff;
  cursor: pointer;
}

.menu-bar button:active,
.help-dialog button:active {
  border-color: #32343a #fff #fff #32343a;
}

.build-label {
  margin-left: auto;
  padding-right: 6px;
  color: #34373d;
  font-family: "Courier New", monospace;
  font-size: .76rem;
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

.start-screen {
  min-height: 800px;
  display: grid;
  grid-template-columns: minmax(320px, .88fr) minmax(440px, 1.12fr);
  background: #08111f;
}

.start-art {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #101c35;
  border-right: 4px solid #02050a;
}

.start-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49%, rgba(98, 145, 255, .08) 50%, transparent 51%),
    linear-gradient(0deg, #050a14 0 5%, transparent 5% 100%);
  background-size: 18px 100%, 100% 100%;
  pointer-events: none;
}

.start-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  image-rendering: pixelated;
  filter: saturate(1.08) contrast(1.04);
}

.start-art__scanlines {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, .38) 4px
  );
}

.start-art__badge {
  position: absolute;
  z-index: 3;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 10px 14px;
  color: var(--amber);
  background: rgba(4, 9, 19, .9);
  border: 2px solid var(--amber);
  font-family: "Courier New", monospace;
  font-weight: 700;
  text-align: center;
  letter-spacing: .08em;
}

.start-copy {
  padding: clamp(28px, 5vw, 76px);
  color: var(--white);
  align-self: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font: 700 .78rem/1.4 "Courier New", monospace;
  letter-spacing: .16em;
}

.start-copy h1 {
  margin: 0;
  color: #fff;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(4rem, 8vw, 7.8rem);
  line-height: .78;
  letter-spacing: .015em;
  text-shadow: 5px 5px 0 #000b23, 8px 8px 0 #2851a9;
}

.start-copy h1 span {
  color: var(--amber);
  font-size: .58em;
  letter-spacing: .12em;
}

.start-lead {
  max-width: 680px;
  margin: 28px 0 22px;
  color: #d6e3f7;
  font-size: 1.05rem;
  line-height: 1.55;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mode-grid--single {
  grid-template-columns: 1fr;
}

.mode-card {
  min-height: 142px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: #07101c;
  text-align: left;
  cursor: pointer;
  border: 4px solid;
  border-color: #fff #1d2737 #1d2737 #fff;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .5);
}

.mode-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .5);
}

.mode-card:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .5);
  border-color: #1d2737 #fff #fff #1d2737;
}

.mode-card--easy {
  background: #78e389;
}

.mode-card--hard {
  background: #ff6e67;
}

.mode-card--weekend {
  min-height: 122px;
  color: #07101c;
  background: linear-gradient(135deg, #ffc548 0 72%, #ff9152 72% 100%);
}

.mode-card__top {
  font: 900 1.25rem "Courier New", monospace;
}

.mode-card strong {
  font-size: .94rem;
}

.mode-card small {
  color: #17202d;
  font-size: .84rem;
  line-height: 1.4;
}

.start-notes {
  margin-top: 18px;
  padding: 12px 14px;
  color: #c7d5e9;
  background: #0c1b30;
  border: 1px solid #365276;
  font: .82rem/1.45 "Courier New", monospace;
}

.start-notes p {
  margin: 4px 0;
}

.records {
  margin-top: 18px;
}

.section-title,
.panel-title {
  padding: 7px 9px;
  color: #fff;
  background: var(--navy);
  font: 700 .78rem "Courier New", monospace;
  letter-spacing: .07em;
}

.records-list {
  min-height: 46px;
  padding: 8px 10px;
  color: #9fb3cc;
  background: #050b14;
  border: 2px solid;
  border-color: #020307 #324357 #324357 #020307;
  font: .8rem/1.55 "Courier New", monospace;
}

.record-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
}

.record-row strong {
  color: var(--amber);
}

.game-screen {
  padding: 10px;
}

.game-progress {
  padding: 7px 9px 9px;
  color: #111;
  background: #d3d4d7;
  border: 2px solid;
  border-color: #fff #383a3f #383a3f #fff;
}

.game-progress__labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font: 700 .76rem "Courier New", monospace;
}

.game-progress__track {
  height: 15px;
  padding: 2px;
  background: #16181d;
  border: 2px solid;
  border-color: #45484f #fff #fff #45484f;
}

.game-progress__track span {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(90deg, #2b62c5 0 13px, #173e8c 13px 15px);
  transition: width .35s steps(8, end);
}

.game-grid {
  margin-top: 9px;
  display: grid;
  grid-template-columns: minmax(235px, .72fr) minmax(460px, 1.7fr) minmax(250px, .8fr);
  gap: 9px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  padding: 5px;
  background: #c4c6ca;
  border: 2px solid;
  border-color: #fff #3a3c41 #3a3c41 #fff;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 1;
  margin: 5px 0 7px;
  overflow: hidden;
  background: #10172a;
  border: 3px solid;
  border-color: #34363b #fff #fff #34363b;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, #000 4px);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
  transition: opacity .15s linear;
}

.portrait-state {
  position: absolute;
  z-index: 2;
  left: 7px;
  right: 7px;
  bottom: 7px;
  padding: 5px 7px;
  color: var(--amber);
  background: rgba(0, 0, 0, .82);
  border: 1px solid var(--amber);
  font: 700 .73rem "Courier New", monospace;
  text-align: center;
}

.difficulty-chip {
  margin-bottom: 8px;
  padding: 5px 7px;
  color: #fff;
  background: #30343b;
  border: 2px solid;
  border-color: #202126 #fff #fff #202126;
  font: 700 .72rem "Courier New", monospace;
  text-align: center;
}

.stats {
  display: grid;
  gap: 8px;
}

.stat__label {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
  color: #111;
  font: 700 .73rem "Courier New", monospace;
}

.meter {
  height: 15px;
  padding: 2px;
  background: #1b1d20;
  border: 2px solid;
  border-color: #3a3c41 #fff #fff #3a3c41;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(90deg, #248c42 0 10px, #155e2b 10px 12px);
  transition: width .25s steps(7, end);
}

.stat--promile .meter span {
  background: repeating-linear-gradient(90deg, #d59b1f 0 10px, #8b5d09 10px 12px);
}

.stat--danger .meter span {
  background: repeating-linear-gradient(90deg, #d9424d 0 10px, #871a2b 10px 12px);
}

.cash-box {
  min-height: 52px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #0c3418;
  background: #8fea9c;
  border: 3px solid;
  border-color: #d8ffdd #286b34 #286b34 #d8ffdd;
  font-family: "Courier New", monospace;
  font-weight: 700;
}

.cash-box strong {
  font-size: 1.25rem;
}

.cash-box--alcohol {
  min-height: 52px;
  color: #fff4cf;
  background: #674113;
  border-color: #dcb975 #2d1903 #2d1903 #dcb975;
}

.cash-box--alcohol strong {
  font-size: 1rem;
  text-align: right;
}

.event-column {
  min-width: 0;
}

.event-card {
  min-height: 674px;
  padding: clamp(18px, 3vw, 32px);
  color: var(--white);
  background-color: var(--terminal);
  background-image: radial-gradient(circle at 1px 1px, rgba(92, 151, 215, .13) 1px, transparent 1px);
  background-size: 10px 10px;
  border: 4px solid;
  border-color: #252a31 #f5f5f5 #f5f5f5 #252a31;
  box-shadow: inset 0 0 0 2px #000;
}

.event-meta {
  padding-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--terminal-line);
  color: var(--cyan);
  font: 700 .78rem/1.3 "Courier New", monospace;
  letter-spacing: .06em;
}

.event-meta div {
  display: flex;
  gap: 9px;
}

.event-meta strong {
  color: var(--white);
}

#event-location {
  color: var(--amber);
  text-align: right;
}

.event-badge {
  width: fit-content;
  margin: 19px 0 9px;
  padding: 5px 8px;
  color: #061224;
  background: var(--cyan);
  font: 900 .72rem "Courier New", monospace;
  letter-spacing: .07em;
}

.event-card h2 {
  margin: 0 0 16px;
  color: #fff;
  font: 900 clamp(1.7rem, 3vw, 2.65rem)/1.05 "Arial Black", Impact, sans-serif;
  letter-spacing: -.02em;
}

.event-story {
  min-height: 142px;
  color: #d5e0ee;
  font: 1.03rem/1.62 "Courier New", monospace;
}

.event-story p {
  margin: 0 0 13px;
}

.event-story strong {
  color: var(--amber);
}

.event-story .dialogue {
  padding-left: 12px;
  color: #fff;
  border-left: 3px solid var(--cyan);
}

.organism-note {
  margin-top: 14px !important;
  padding: 8px 10px;
  color: #ffdda0;
  background: #2b1d08;
  border: 1px solid #8d651c;
  font-size: .83rem;
  line-height: 1.45;
}

.effect-box {
  margin: 14px 0;
  padding: 10px 12px;
  color: #d9e6f6;
  background: #101f31;
  border: 1px dashed #4e6d90;
  font: 700 .78rem/1.45 "Courier New", monospace;
}

.effect-box .positive {
  color: var(--green);
}

.effect-box .negative {
  color: #ff8389;
}

.effect-box .warning {
  color: var(--amber);
}

.resolution-response {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  font-size: .9rem;
}

.continue-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #a9bed6;
  font-size: .7rem;
  letter-spacing: .04em;
}

.continue-button {
  min-height: 38px;
  padding: 8px 14px;
  color: #07101e;
  background: var(--cyan);
  border: 2px solid;
  border-color: #dff8ff #1b617e #1b617e #dff8ff;
  box-shadow: 2px 2px 0 #02060d;
  cursor: pointer;
  font: 900 .76rem "Courier New", monospace;
  letter-spacing: .06em;
}

.continue-button:hover,
.continue-button:focus-visible {
  color: #fff;
  background: #176d98;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.effect-box .world-roll {
  color: #ffe48b;
  background: #362c0d;
}

.event-card.is-resolving .choice-button {
  opacity: .54;
  cursor: default;
}

.event-card.is-resolving .choice-button.is-selected {
  color: #fff;
  background: #173d91;
  opacity: 1;
}

.choice-button:disabled {
  pointer-events: none;
}

.choices {
  margin-top: 19px;
  display: grid;
  gap: 10px;
}

.choice-button {
  min-height: 55px;
  padding: 10px 13px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  color: #111;
  background: #c7c9cd;
  border: 3px solid;
  border-color: #fff #303238 #303238 #fff;
  box-shadow: 3px 3px 0 #000;
  text-align: left;
  cursor: pointer;
}

.choice-button:hover {
  color: #fff;
  background: #173d91;
}

.choice-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #000;
  border-color: #303238 #fff #fff #303238;
}

.choice-key {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #111827;
  border: 1px solid #fff;
  font: 900 .9rem "Courier New", monospace;
}

.choice-label {
  font-weight: 700;
  line-height: 1.35;
}

.keyboard-hint {
  padding: 5px 8px 0;
  color: #35383d;
  font: 700 .7rem "Courier New", monospace;
  text-align: center;
}

.intel-panel {
  display: flex;
  flex-direction: column;
}

.intel-section {
  margin-top: 6px;
  padding: 8px;
  background: #d5d6d8;
  border: 2px solid;
  border-color: #56585e #fff #fff #56585e;
}

.intel-section h3 {
  margin: 0 0 7px;
  color: #202329;
  font: 900 .72rem "Courier New", monospace;
  letter-spacing: .05em;
}

.intel-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.intel-heading span {
  font: 700 .7rem "Courier New", monospace;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  padding: 4px 6px;
  color: #fff;
  background: #283a55;
  border: 1px solid #0b1422;
  font: 700 .69rem "Courier New", monospace;
}

.chip--new {
  color: #061224;
  background: var(--amber);
}

.director-readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed #6e7279;
  color: #343941;
  font: 700 .61rem/1.25 "Courier New", monospace;
}

.director-readout strong {
  color: #071d5c;
  text-align: right;
}

.npc-world-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.npc-world-status:empty {
  display: none;
}

.npc-state {
  padding: 3px 5px;
  color: #fff;
  background: #5b2b63;
  border: 1px solid #25102a;
  font: 700 .58rem "Courier New", monospace;
}

.npc-state--returned {
  color: #062814;
  background: #78d69c;
  border-color: #1d6340;
}

.tempo-label {
  color: #071d5c;
  font: 900 .7rem "Courier New", monospace;
}

.tempo-track {
  height: 12px;
  padding: 2px;
  background: #1b1d20;
  border: 2px solid;
  border-color: #3a3c41 #fff #fff #3a3c41;
}

.tempo-track span {
  display: block;
  width: 40%;
  height: 100%;
  background: repeating-linear-gradient(90deg, #e48c25 0 10px, #9b4d11 10px 12px);
  transition: width .25s steps(5, end);
}

.intel-note {
  margin: 6px 0 0;
  color: #41454c;
  font: .65rem/1.35 "Courier New", monospace;
}

.status-list {
  gap: 4px;
}

.chip--status {
  color: #261500;
  background: #f3b344;
  border-color: #704500;
  font-size: .61rem;
}

.obligation-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.obligation-list li {
  padding: 5px 6px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  color: #202329;
  background: #c2c4c8;
  border-left: 4px solid #3164a7;
  font: .64rem/1.35 "Courier New", monospace;
}

.obligation-list li strong {
  color: #071d5c;
}

.obligation-list li.problem-row {
  background: #ffe2a1;
  border-left-color: #c56d00;
}

.obligation-list li.problem-row strong {
  color: #713b00;
}

.obligation-list li.is-late {
  background: #efb3b6;
  border-left-color: #9e1824;
}

.obligation-list li.is-late strong {
  color: #8c101a;
}

.obligation-list li.is-empty {
  display: block;
  color: #555960;
  border-left-color: #777a80;
}

.quest-text {
  margin: 0;
  color: #25282e;
  font: .78rem/1.4 "Courier New", monospace;
}

.inventory-list {
  display: grid;
  gap: 5px;
}

.inventory-item {
  width: 100%;
  min-height: 33px;
  padding: 5px 7px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #111;
  background: #bfc1c5;
  border: 2px solid;
  border-color: #fff #3c3e44 #3c3e44 #fff;
  font: 700 .7rem "Courier New", monospace;
  text-align: left;
}

button.inventory-item {
  cursor: pointer;
}

button.inventory-item:hover:not(:disabled) {
  color: #fff;
  background: #173d91;
}

.inventory-item:disabled {
  color: #575a61;
  cursor: default;
}

.inventory-action {
  color: #274a24;
  font-size: .63rem;
}

.discovery-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.discovery-grid div {
  padding: 6px 3px;
  text-align: center;
  background: #b9bbc0;
  border: 1px solid #777a80;
}

.discovery-grid dt {
  color: #3d4046;
  font: .57rem "Courier New", monospace;
}

.discovery-grid dd {
  margin: 3px 0 0;
  color: #071d5c;
  font: 900 1rem "Courier New", monospace;
}

.log-section {
  flex: 1;
}

.game-log {
  max-height: 170px;
  margin: 0;
  padding-left: 20px;
  overflow: auto;
  color: #30333a;
  font: .68rem/1.4 "Courier New", monospace;
}

.game-log li {
  margin-bottom: 5px;
}

.status-bar {
  min-height: 34px;
  margin-top: 8px;
  padding: 5px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
  color: #25272c;
  font: 700 .72rem "Courier New", monospace;
}

.status-bar span {
  padding: 4px 7px;
  border: 2px solid;
  border-color: #63666c #fff #fff #63666c;
}

#run-score {
  min-width: 140px;
  text-align: right;
}

.ending-card {
  text-align: center;
}

.ending-card .event-story {
  min-height: auto;
}

.ending-score {
  margin: 18px 0;
  color: var(--amber);
  font: 900 clamp(2.5rem, 7vw, 5rem) Impact, "Arial Black", sans-serif;
  letter-spacing: .04em;
  text-shadow: 4px 4px 0 #000;
}

.ending-rank {
  margin: 0 0 16px;
  color: var(--cyan);
  font: 900 1.25rem "Courier New", monospace;
}

.cash-score-line {
  margin: 0 auto 14px;
  padding: 8px 10px;
  color: #dff8cc;
  background: #112610;
  border: 1px solid #4e8647;
  font: 700 .78rem/1.4 "Courier New", monospace;
}

.cash-score-line strong {
  color: var(--green);
}

.callback-note {
  padding: 8px 10px;
  color: #bcecff;
  background: #102943;
  border-left: 4px solid var(--cyan);
  font-size: .85rem;
}

.effect-box .status-change {
  color: var(--amber);
}

.effect-box .obligation-change {
  color: #b6e6ff;
}

.effect-box .callback-change {
  color: #d4b8ff;
}

.summary-grid {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.decision-summary {
  margin: 16px 0;
  padding: 10px 12px;
  color: #dce9f8;
  background: #0b1929;
  border: 1px solid #365a7c;
  text-align: left;
  font: .78rem/1.45 "Courier New", monospace;
}

.decision-summary p {
  margin: 4px 0;
}

.decision-summary strong {
  color: var(--amber);
}

.run-timeline {
  max-height: 290px;
  margin: 10px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  text-align: left;
  border-top: 1px solid #35506e;
}

.run-timeline li {
  padding: 8px 2px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  border-bottom: 1px solid #223a52;
  color: #cbd9e9;
  font: .72rem/1.4 "Courier New", monospace;
}

.run-timeline time {
  color: var(--cyan);
  font-weight: 700;
}

.run-timeline strong {
  color: #fff;
}

.summary-grid div {
  padding: 9px;
  background: #101f31;
  border: 1px solid #35506e;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font: .65rem "Courier New", monospace;
}

.summary-grid strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font: 900 1rem "Courier New", monospace;
}

.help-dialog {
  width: min(680px, calc(100vw - 26px));
  padding: 0;
  color: #111;
  background: var(--window);
  border: 3px solid;
  border-color: #fff #282a2f #282a2f #fff;
  box-shadow: 12px 14px 0 rgba(0, 0, 0, .45);
}

.help-dialog::backdrop {
  background: rgba(0, 5, 16, .74);
}

.dialog-title {
  min-height: 36px;
  padding: 4px 5px 4px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: var(--navy);
  font-family: "Courier New", monospace;
}

.dialog-title button {
  width: 28px;
  min-height: 25px;
  padding: 0;
  font-size: 1.1rem;
}

.dialog-content {
  padding: 20px;
  line-height: 1.55;
}

.dialog-content h2 {
  margin-top: 0;
}

.dialog-content li {
  margin-bottom: 8px;
}

.fine-print {
  padding: 9px;
  background: #d4d5d8;
  border: 1px solid #74767b;
  font-size: .82rem;
}

@media (max-width: 1120px) {
  .game-grid {
    grid-template-columns: 220px minmax(420px, 1fr);
  }

  .intel-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .intel-panel > .panel-title {
    grid-column: 1 / -1;
  }

  .intel-section {
    margin-top: 0;
  }

  .log-section {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .desktop {
    padding: 0;
    place-items: start center;
  }

  .game-window {
    min-height: 100vh;
    border-width: 0;
    box-shadow: none;
  }

  .start-screen {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .start-art {
    min-height: 390px;
    max-height: 55vh;
    border-right: 0;
    border-bottom: 4px solid #02050a;
  }

  .start-copy {
    padding: 28px 20px 38px;
  }

  .start-copy h1 {
    font-size: clamp(3.4rem, 18vw, 6rem);
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .portrait-panel {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 7px 10px;
  }

  .portrait-panel > .panel-title {
    grid-column: 1 / -1;
  }

  .portrait-frame {
    grid-row: span 2;
  }

  .difficulty-chip {
    margin: 0;
    align-self: end;
  }

  .stats {
    align-self: start;
  }

  .event-card {
    min-height: auto;
  }

  .intel-panel {
    grid-column: auto;
    grid-template-columns: 1fr 1fr;
  }

  .log-section {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .title-bar {
    font-size: .76rem;
  }

  .window-controls {
    display: none;
  }

  .menu-bar {
    flex-wrap: wrap;
  }

  .menu-bar button {
    flex: 1;
    padding-inline: 6px;
    font-size: .78rem;
  }

  .build-label {
    width: 100%;
    padding: 3px 4px;
    text-align: right;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .game-progress__labels span {
    display: none;
  }

  .game-progress__labels {
    justify-content: center;
  }

  .portrait-panel {
    grid-template-columns: 124px 1fr;
  }

  .event-card {
    padding: 16px 13px;
  }

  .event-meta {
    font-size: .69rem;
  }

  .event-card h2 {
    font-size: 1.7rem;
  }

  .event-story {
    font-size: .93rem;
  }

  .choice-button {
    grid-template-columns: 30px 1fr;
    padding: 8px;
  }

  .intel-panel {
    grid-template-columns: 1fr;
  }

  .log-section {
    grid-column: auto;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
/* v0.6 encounter state inside the existing shareware window. */
.how-to-play { margin: 1rem 0; padding: .85rem 1rem; border: 2px solid #344c70; background: #0c1728; color: #d5dfef; font-size: 1rem; line-height: 1.6; }
.how-to-play summary { cursor: pointer; color: #bde7ff; font-weight: 700; }
.how-to-play p { margin: .8rem 0; }
.police-encounter { position: relative; isolation: isolate; margin: 1rem 0 1.25rem; border: 2px solid #527aad; overflow: hidden; background: #07101e; animation: police-enter .5s ease-out; }
.police-scene { display: block; width: 100%; height: auto; max-height: 250px; object-fit: cover; object-position: center; image-rendering: pixelated; filter: brightness(.66); }
.police-officers { display: flex; gap: .7rem; justify-content: center; margin: -4.5rem .75rem .75rem; position: relative; }
.police-officers figure { margin: 0; width: min(31%, 135px); border: 2px solid #84a8d6; background: #091728; }
.police-officers img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; image-rendering: pixelated; }
.police-officers figcaption { padding: .3rem; font-size: 1rem; text-align: center; color: #e0efff; font-weight: 700; }
.police-mode .event-card { border-color: #6085b5; position: relative; }
.police-mode .portrait-panel, .police-mode .intel-panel { filter: brightness(.72); }
.police-mode .event-card::after { content: ""; pointer-events: none; position: absolute; inset: 0; border: 6px solid transparent; z-index: 2; animation: police-lights 4s ease-in-out infinite; }
@keyframes police-lights { 0%, 100% { border-color: rgba(45,132,255,.22); box-shadow: inset 10px 0 42px rgba(45,132,255,.07); } 50% { border-color: rgba(227,74,80,.22); box-shadow: inset -10px 0 42px rgba(227,74,80,.07); } }
@keyframes police-enter { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .police-encounter, .police-mode .event-card::after { animation: none; } }
@media (max-width: 520px) { .police-scene { max-height: 180px; } .police-officers { margin-top: -3rem; } }
