@font-face {
  font-family: Inter;
  src: url("../assets/fonts/Inter-Variable.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  color-scheme: light;
  --white: #fff;
  --paper: #f5f5f2;
  --gray-1: #cccccc;
  --gray-2: #999999;
  --gray-3: #666666;
  --gray-4: #333333;
  --black: #000;
  --red: #f93c31;
  --blue: #1e93ff;
  --light-blue: #88d8f1;
  --yellow: #ffdc00;
  --green: #4fcc30;
  --purple: #a356d6;
  --pink: #ff7bcc;
  --orange: #ff851b;
  --sans: Inter, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--paper);
  color: var(--black);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}

button,
select,
input {
  font: inherit;
}

button,
select {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.8;
}

.replay-app {
  display: grid;
  height: 100dvh;
  grid-template-rows: 58px minmax(0, 1fr) 104px;
  background-color: var(--white);
  background-image:
    linear-gradient(var(--gray-1) 1px, transparent 1px),
    linear-gradient(90deg, var(--gray-1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.embedded-replay .back-link {
  display: none;
}

.embedded-replay .app-header {
  grid-template-columns: minmax(160px, 1fr) auto;
}

.embedded-replay .run-identity {
  text-align: left;
}

.embedded-replay .run-identity h1 {
  justify-content: flex-start;
}

.app-header {
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  border-bottom: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
}

.back-link {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 7px;
  color: inherit;
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  text-transform: uppercase;
}

.back-link:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.run-identity {
  min-width: 0;
  text-align: center;
}

.run-kicker,
.eyebrow {
  display: block;
  color: var(--gray-3);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.25;
  text-transform: uppercase;
}

.run-kicker {
  color: var(--gray-1);
}

.run-identity h1 {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1;
  text-transform: uppercase;
}

.run-identity h1 small {
  color: var(--gray-1);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
}

.run-facts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.run-facts strong {
  padding: 5px 8px;
  border: 1px solid var(--green);
  background: var(--green);
  color: var(--black);
  font-weight: 500;
}

.trace-mode-toggle {
  position: relative;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--yellow);
  border-radius: 0;
  background: var(--yellow);
  color: var(--black);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.trace-mode-toggle:hover {
  border-color: var(--white);
  background: var(--white);
}

.trace-mode-toggle[aria-pressed="true"] {
  border-color: var(--white);
  background: var(--white);
  color: var(--black);
}

.trace-mode-toggle::after {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid var(--black);
  background: var(--white);
  box-shadow: 3px 3px 0 var(--black);
  color: var(--black);
  content: attr(data-hint);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-transform: none;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.trace-mode-toggle:hover::after,
.trace-mode-toggle:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .trace-mode-toggle::after {
    display: none;
  }
}

.replay-main {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(520px, 0.96fr) minmax(420px, 1.04fr);
  gap: 1px;
  overflow: hidden;
  border-bottom: 1px solid var(--black);
  background: var(--black);
}

.world-pane,
.activity-pane {
  min-width: 0;
  min-height: 0;
  background: var(--white);
}

.world-pane {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 34px auto;
  overflow: hidden;
}

.activity-pane {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr);
  overflow: hidden;
}

.replay-app:not(.has-agent-trace) .replay-main {
  grid-template-columns: 1fr;
}

.replay-app:not(.has-agent-trace) .activity-pane,
.replay-app:not(.has-agent-trace) .world-heading,
.replay-app:not(.has-agent-trace) .visual-status,
.replay-app:not(.has-agent-trace) .timeline-events,
.replay-app:not(.has-agent-trace) .attention-timeline {
  display: none;
}

.replay-app:not(.has-agent-trace) .world-pane {
  grid-template-rows: minmax(0, 1fr) auto;
}

.replay-app:not(.has-agent-trace) .input-panel {
  border-top: 1px solid var(--black);
}

.pane-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--black);
  background: var(--white);
}

.pane-heading h2 {
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.visual-format {
  padding: 3px 6px;
  border: 1px solid var(--gray-1);
  background: var(--paper);
  color: var(--gray-3);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.quiet-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
}

.quiet-button {
  gap: 7px;
  min-height: 30px;
  padding: 4px 9px;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.quiet-button:hover,
.icon-button:hover {
  background: var(--yellow);
}

.visual-stage {
  position: relative;
  display: grid;
  min-height: 0;
  container-type: size;
  place-items: center;
  overflow: hidden;
  padding: 12px;
  background: var(--gray-4);
}

.visual-source {
  position: relative;
  width: min(100%, 640px);
  width: min(100%, 100cqh, 640px);
  max-width: 640px;
  aspect-ratio: 1;
  background: var(--black);
  box-shadow: 0 0 0 1px var(--black);
}

.visual-source::after {
  content: "";
  position: absolute;
  z-index: 20;
  inset: 0;
  background: var(--black);
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease 220ms;
}

.visual-stage.story-ended .visual-source::after {
  opacity: 1;
}

.story-ending {
  position: absolute;
  z-index: 21;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  color: var(--white);
  text-align: center;
}

.story-ending[hidden] {
  display: none;
}

.story-ending a {
  color: var(--yellow);
  font-size: 17px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.story-ending span {
  color: var(--gray-1);
  font-size: 13px;
}

.visual-source > img {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  object-fit: contain;
}

.visual-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--gray-4);
  color: var(--white);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.click-pulse {
  position: absolute;
  z-index: 5;
  width: 32px;
  height: 38px;
  pointer-events: none;
}

.click-pulse::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 32px;
  background: url("./assets/pixel-pointer.svg?v=2") 0 0 / 24px 32px no-repeat;
  content: "";
  image-rendering: pixelated;
  transform: translate(2px, 2px);
}

.click-pulse::after {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 4px;
  height: 4px;
  background: var(--yellow);
  box-shadow:
    -8px 0 0 var(--yellow),
    8px 0 0 var(--yellow),
    0 -8px 0 var(--yellow),
    -6px -6px 0 var(--yellow),
    6px -6px 0 var(--yellow);
  content: "";
  opacity: 0;
}

.click-pulse.is-pressing::before {
  animation: pixel-pointer-press var(--click-animation-duration, 360ms) steps(3, end) both;
}

.click-pulse.is-pressing::after {
  animation: pixel-click-spark var(--click-animation-duration, 360ms) steps(3, end) both;
}

@keyframes pixel-pointer-press {
  0%, 20% { transform: translate(9px, 9px); }
  45%, 72% { transform: translate(1px, 1px); }
  100% { transform: translate(3px, 3px); }
}

@keyframes pixel-click-spark {
  0%, 38% { opacity: 0; }
  45%, 72% { opacity: 1; }
  100% { opacity: 0; }
}

.region-focus {
  position: absolute;
  z-index: 4;
  border: 0;
  background: rgb(30 147 255 / 10%);
  box-shadow:
    inset 0 0 0 3px var(--blue),
    0 0 0 1px var(--black);
  pointer-events: none;
}

.region-focus::before {
  position: absolute;
  top: 3px;
  left: 3px;
  padding: 3px 5px;
  background: var(--blue);
  color: var(--white);
  content: "Selected region";
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.region-focus.is-full-frame::before {
  display: none;
}

.region-focus.is-sampled {
  background-color: rgb(255 220 0 / 7%);
  background-image:
    linear-gradient(to right, rgb(255 220 0 / 68%) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 220 0 / 68%) 1px, transparent 1px);
  background-size:
    calc(100% / var(--sample-columns)) 100%,
    100% calc(100% / var(--sample-rows));
  box-shadow:
    inset 0 0 0 3px var(--yellow),
    0 0 0 1px var(--black);
}

.region-focus.is-sampled::before {
  background: var(--yellow);
  color: var(--black);
  content: "Pixel samples";
}

.attention-route {
  position: absolute;
  z-index: 8;
  top: 20px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0;
  max-width: calc(100% - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--blue);
  background: var(--white);
  box-shadow: 3px 3px 0 var(--black);
  color: var(--black);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
}

.attention-route span,
.attention-route strong {
  overflow: hidden;
  padding: 7px 9px;
  text-overflow: ellipsis;
}

.attention-route span {
  color: var(--gray-3);
  font-weight: 400;
}

.attention-route strong {
  background: var(--blue);
  color: var(--white);
  font-weight: 500;
}

.attention-route svg {
  width: 28px;
  height: 12px;
  margin: 0 7px;
  color: var(--blue);
}

.visual-stage[data-focus-kind="pixels"] .attention-route {
  border-color: var(--yellow);
}

.visual-stage[data-focus-kind="pixels"] .attention-route strong {
  background: var(--yellow);
  color: var(--black);
}

.visual-stage[data-focus-kind="pixels"] .attention-route svg {
  color: var(--yellow);
}

.attention-result {
  position: absolute;
  z-index: 7;
  right: var(--attention-inset, 20px);
  bottom: var(--attention-inset, 20px);
  width: min(42%, var(--attention-width, 250px));
  padding: var(--attention-padding, 6px);
  border: 2px solid var(--blue);
  background: var(--white);
  box-shadow: var(--attention-shadow, 5px) var(--attention-shadow, 5px) 0 var(--black);
}

.visual-stage[data-focus-kind="pixels"] .attention-result {
  border-color: var(--yellow);
}

.attention-result-label {
  display: block;
  overflow: hidden;
  padding: 1px 2px 5px;
  font-family: var(--mono);
  font-size: 8px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.attention-crop {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: var(--attention-max-height, 240px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--black);
  background: var(--black);
}

.attention-crop img {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  image-rendering: pixelated;
}

.attention-result canvas {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 240px;
  margin: 0 auto;
  border: 1px solid var(--black);
  background: var(--paper);
  image-rendering: pixelated;
  object-fit: contain;
}

.visual-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 102px 30px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border-top: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.visual-status:has([data-frame-count]:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) 102px 30px minmax(0, 180px);
}

.visual-status [data-frame-status],
.visual-status [data-frame-count] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-status [data-frame-count] {
  text-align: left;
}

.visual-boundary-toggle {
  display: inline-grid;
  width: 102px;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border: 1px solid var(--black);
}

.visual-boundary-toggle button {
  min-width: 0;
  height: 22px;
  padding: 0 7px;
  border: 0;
  border-radius: 0;
  background: var(--white);
  color: var(--gray-3);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.visual-boundary-toggle button + button {
  border-left: 1px solid var(--black);
}

.visual-boundary-toggle button:hover,
.visual-boundary-toggle button:focus-visible {
  background: var(--yellow);
  color: var(--black);
  outline: 0;
}

.visual-boundary-toggle button.active {
  background: var(--black);
  color: var(--white);
}

.visual-status .icon-button {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
}

.visual-status .icon-button:hover {
  background: var(--yellow);
}

.visual-status .icon-button svg {
  width: 15px;
  height: 15px;
}

.input-panel {
  display: grid;
  min-height: 84px;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 8px 12px;
  background: var(--white);
}

.input-panel h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-actions-shell {
  min-width: 0;
}

.game-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.direction-pad {
  display: grid;
  width: 76px;
  height: 52px;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
}

.direction-pad button,
.input-key {
  border: 1px solid var(--gray-2);
  border-radius: 0;
  background: var(--paper);
  color: var(--gray-3);
}

.direction-pad button {
  display: grid;
  min-width: 0;
  padding: 0;
  place-items: center;
}

.direction-pad svg {
  width: 13px;
  height: 13px;
}

.input-key {
  display: grid;
  min-width: 52px;
  height: 52px;
  place-items: center;
  padding: 4px 8px;
}

.input-key small {
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1;
  text-transform: uppercase;
}

.interact-key {
  min-width: 76px;
}

.spacebar-icon {
  display: grid;
  width: 44px;
  height: 20px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.spacebar-icon i {
  width: 24px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  border-left: 1px solid currentColor;
}

.spacebar-icon.compact {
  width: 24px;
  height: 14px;
  border-color: currentColor;
}

.spacebar-icon.compact i {
  width: 13px;
  height: 5px;
}

[data-action-key].is-available {
  border-color: var(--black);
  background: var(--white);
  color: var(--black);
}

[data-action-key].is-active {
  border-color: var(--black);
  background: var(--yellow);
  color: var(--black);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 25%);
  transform: translateY(1px);
}

.action-tooltip {
  position: fixed;
  z-index: 100;
  max-width: calc(100vw - 16px);
  padding: 6px 8px;
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
}

.activity-heading {
  border-left: 0;
}

.activity-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 850;
  text-transform: uppercase;
}

.notes-button {
  border-width: 2px;
  background: var(--purple);
  color: var(--white);
  font-weight: 700;
}

.notes-button:hover {
  background: var(--yellow);
  color: var(--black);
}

.activity-feed {
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: var(--paper);
  scrollbar-color: var(--gray-2) transparent;
}

.activity-card {
  position: relative;
  margin: 0 0 10px;
  padding: 11px 12px 12px 15px;
  border: 1px solid var(--black);
  border-left-width: 5px;
  background: var(--white);
}

.activity-card:last-child {
  margin-bottom: 0;
}

.activity-card.message { border-left-color: var(--black); }
.activity-card.inspect { border-left-color: var(--blue); }
.activity-card.pixels { border-left-color: var(--yellow); }
.activity-card.memory { border-left-color: var(--purple); }
.activity-card.tool { border-left-color: var(--gray-2); }
.activity-card.commit { border-left-color: var(--green); }

.activity-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.activity-card header strong {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-card header strong code {
  display: inline-block;
  margin-left: 4px;
  font-family: var(--mono);
  font-size: 1em;
  font-variant-ligatures: none;
  font-weight: 600;
  text-transform: none;
}

.activity-card header span {
  color: var(--gray-3);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.activity-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.52;
}

.agent-question {
  padding: 10px 12px 11px;
  background: #eef8ff;
}

.activity-card.pixels .agent-question {
  background: #fff9cc;
}

.agent-question p span {
  display: block;
  width: max-content;
  margin: 0 0 4px -5px;
  padding: 2px 5px;
  background: var(--blue);
  color: var(--white);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
  vertical-align: 1px;
}

.agent-question p {
  padding-left: 5px;
}

.activity-card.pixels .agent-question p span {
  background: var(--yellow);
  color: var(--black);
}

.view-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.view-list-heading strong {
  color: var(--gray-3);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  text-transform: uppercase;
}

.activity-card code {
  padding: 1px 3px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.86em;
}

.activity-card details {
  margin-top: 8px;
}

.activity-card summary {
  width: max-content;
  cursor: pointer;
  color: var(--gray-3);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.activity-card pre {
  max-height: 240px;
  margin: 8px 0 0;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--gray-1);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.view-list {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.view-button {
  position: relative;
  display: grid;
  min-height: 44px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 1px solid var(--gray-1);
  border-radius: 0;
  background: var(--white);
  text-align: left;
}

.view-button:hover,
.view-button.active {
  z-index: 2;
  border-color: var(--black);
  background: #eef8ff;
}

.activity-card.pixels .view-button:hover,
.activity-card.pixels .view-button.active {
  background: #fff9cc;
}

.view-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  background: var(--black);
  color: var(--white);
  font-family: var(--mono);
  font-size: 9px;
}

.view-copy {
  min-width: 0;
}

.view-copy strong,
.view-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-copy strong {
  font-size: 11px;
}

.view-copy small,
.view-region {
  color: var(--gray-3);
  font-family: var(--mono);
  font-size: 8px;
}

.view-region {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 8px;
  max-width: calc(100% - 58px);
  padding: 5px 7px;
  border: 1px solid var(--black);
  background: var(--white);
  box-shadow: 3px 3px 0 var(--black);
  opacity: 0;
  pointer-events: none;
  text-align: right;
  transform: translate(4px, -50%);
  transition: opacity 90ms linear, transform 90ms linear, visibility 90ms linear;
  visibility: hidden;
}

.view-button:hover .view-region,
.view-button:focus-visible .view-region,
.view-button.active .view-region {
  opacity: 1;
  transform: translate(0, -50%);
  visibility: visible;
}

.activity-card.pixels .view-region {
  background: #fff9cc;
}

.view-region strong,
.view-region small {
  display: block;
  white-space: nowrap;
}

.view-region strong {
  color: var(--black);
  font-weight: 500;
}

.view-region small {
  color: var(--gray-3);
}

.commit-action {
  display: flex;
  align-items: center;
  gap: 10px;
}

.commit-action-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--black);
  background: var(--green);
  font-family: var(--mono);
  font-size: 10px;
}

.commit-action strong,
.commit-action small {
  display: block;
}

.commit-action strong {
  font-size: 12px;
}

.commit-action small {
  color: var(--gray-3);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.activity-trace-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 2px solid var(--gray-2);
  color: var(--gray-3);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.45;
}

.empty-state {
  margin: 24px 0;
  color: var(--gray-3);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

.transport {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-rows: 40px 64px;
  background: var(--white);
}

.level-track {
  display: flex;
  min-width: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--black);
}

.level-jump {
  position: relative;
  display: flex;
  min-width: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 7px;
  border: 0;
  border-right: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.level-jump span {
  color: var(--gray-3);
}

.level-jump:hover,
.level-jump.active {
  background: var(--yellow);
}

.transport-row {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) 88px 34px 64px;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
}

.transport-buttons {
  display: flex;
  gap: 5px;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
}

.icon-button.primary {
  background: var(--black);
  color: var(--white);
}

.icon-button.primary:hover {
  background: var(--yellow);
  color: var(--black);
}

.click-animation-toggle[aria-pressed="true"] {
  background: var(--yellow);
}

.timeline {
  position: relative;
  height: 34px;
}

.timeline input {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 34px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.timeline input::-webkit-slider-runnable-track {
  height: 3px;
  border: 1px solid var(--black);
  background: var(--white);
}

.timeline input::-webkit-slider-thumb {
  width: 12px;
  height: 18px;
  margin-top: -8px;
  appearance: none;
  border: 1px solid var(--black);
  border-radius: 0;
  background: var(--red);
}

.timeline input::-moz-range-track {
  height: 3px;
  border: 1px solid var(--black);
  background: var(--white);
}

.timeline input::-moz-range-thumb {
  width: 12px;
  height: 18px;
  border: 1px solid var(--black);
  border-radius: 0;
  background: var(--red);
}

.timeline-events {
  position: absolute;
  z-index: 2;
  inset: 2px 6px auto;
  height: 8px;
  pointer-events: none;
}

.timeline-event {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: 3px;
  height: 7px;
  overflow: hidden;
  transform: translateX(-50%);
}

.timeline-event-segment {
  width: 100%;
  min-height: 1px;
  flex: 1 1 0;
  background: var(--blue);
}

.timeline-event-segment.pixels { background: var(--yellow); }
.timeline-event-segment.memory { background: var(--purple); }

.attention-timeline {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 32px;
  overflow: visible;
  pointer-events: none;
}

.attention-timeline path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
}

.attention-timeline circle {
  stroke: var(--black);
  stroke-width: 1;
}

.attention-timeline [data-attention-current] {
  fill: var(--red);
}

.attention-timeline [data-attention-source] {
  fill: var(--blue);
}

.attention-timeline[data-focus-kind="pixels"] path {
  stroke: var(--yellow);
}

.attention-timeline[data-focus-kind="pixels"] [data-attention-source] {
  fill: var(--yellow);
}

.action-position {
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.speed-button {
  height: 32px;
  min-width: 54px;
  padding: 0 10px;
  border: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
}

.speed-button:hover,
.speed-button:focus-visible {
  background: var(--yellow);
}

.notes-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
  box-shadow: 8px 8px 0 var(--black);
}

.notes-dialog::backdrop {
  background: rgb(0 0 0 / 55%);
}

.notes-shell {
  display: grid;
  max-height: calc(100dvh - 42px);
  grid-template-rows: auto auto minmax(0, 1fr);
}

.notes-shell > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px;
  border-bottom: 1px solid var(--black);
}

.notes-shell h2 {
  margin: 2px 0 0;
  font-size: 16px;
}

.notes-tabs {
  display: flex;
  border-bottom: 1px solid var(--black);
}

.notes-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
  font-family: var(--mono);
  font-size: 11px;
  font-variant-ligatures: none;
  font-weight: 600;
}

.notes-tabs button.active {
  background: var(--purple);
  color: var(--white);
}

.notes-shell pre {
  min-height: 240px;
  margin: 0;
  overflow: auto;
  padding: 18px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .replay-app {
    min-height: 100dvh;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .replay-app:not(.has-agent-trace) {
    grid-template-rows: max-content minmax(444px, 1fr) auto;
  }

  .app-header {
    min-height: 58px;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    row-gap: 8px;
  }

  .run-identity {
    text-align: left;
  }

  .run-identity h1 {
    justify-content: flex-start;
  }

  .run-facts {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-bottom: 4px;
  }

  .replay-main {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .world-pane,
  .activity-pane {
    overflow: visible;
  }

  .world-pane {
    grid-template-rows: 52px auto 34px auto;
  }

  .visual-stage {
    min-height: 360px;
  }

  .visual-source {
    width: min(100%, 560px);
  }

  .activity-pane {
    grid-template-rows: 52px auto;
  }

  .activity-feed {
    max-height: 620px;
  }

  .transport {
    position: sticky;
    bottom: 0;
  }
}

@media (max-width: 620px) {
  .app-header {
    padding: 9px 12px;
  }

  .run-identity h1 small,
  .run-facts span:first-child {
    display: none;
  }

  .world-pane {
    grid-template-rows: 52px auto 34px auto;
  }

  .visual-stage {
    min-height: 318px;
    padding: 8px;
  }

  .visual-status {
    grid-template-columns: minmax(0, 1fr) 82px 24px;
    gap: 5px;
    padding: 0 8px;
  }

  .visual-status:has([data-frame-count]:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) 82px 24px minmax(0, 92px);
  }

  .visual-boundary-toggle {
    width: 82px;
  }

  .visual-boundary-toggle button {
    padding: 0 5px;
  }

  .attention-result {
    width: min(44%, var(--attention-width, 250px));
  }

  .input-panel {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .replay-app:not(.has-agent-trace) .input-panel {
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 7px;
  }

  .input-panel header {
    text-align: center;
  }

  .game-controls {
    justify-content: center;
    gap: 5px;
  }

  .direction-pad {
    width: 70px;
    height: 48px;
  }

  .input-key {
    min-width: 43px;
    height: 48px;
    padding: 3px 5px;
  }

  .interact-key {
    min-width: 58px;
  }

  .reset-key {
    display: none;
  }

  .transport {
    grid-template-rows: 34px 58px;
  }

  .level-jump {
    min-width: 32px;
    padding: 0 4px;
  }

  .level-jump span {
    display: none;
  }

  .transport-row {
    grid-template-columns: auto minmax(60px, 1fr) 30px 44px;
    gap: 6px;
    padding: 0 8px;
  }

  .action-position {
    display: none;
  }

  .speed-button {
    min-width: 44px;
    padding: 0 4px;
  }

  .transport-buttons .icon-button {
    width: 30px;
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.replay-app.has-story {
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-rows: 58px 48px minmax(0, 1fr) 104px;
}

.replay-app.has-story.has-single-story-chapter {
  grid-template-rows: minmax(0, 1fr);
}

.replay-app.has-story.has-single-story-chapter > .app-header,
.replay-app.has-story.has-single-story-chapter > .story-chapters,
.replay-app.has-story.has-single-story-chapter > .transport {
  display: none;
}

.replay-app.has-story.has-single-story-chapter > .replay-main,
.replay-app.has-story.has-single-story-chapter > .story-coach {
  grid-row: 1;
}

.replay-app.has-story.has-single-story-chapter .story-coach [data-story-previous] {
  display: none;
}

.replay-app.has-story.has-single-story-chapter .story-coach > footer {
  grid-template-columns: 1fr 1.15fr;
}

.replay-app.has-story.has-single-story-chapter .story-coach > footer.without-replay {
  grid-template-columns: 1fr;
}

.replay-app.has-story > .app-header,
.replay-app.has-story > .story-chapters,
.replay-app.has-story > .transport {
  grid-column: 1 / -1;
}

.replay-app.has-story > .app-header {
  grid-row: 1;
}

.replay-app.has-story > .story-chapters {
  grid-row: 2;
}

.replay-app.has-story > .replay-main {
  grid-column: 1;
  grid-row: 3;
  grid-template-columns: minmax(430px, .96fr) minmax(340px, 1.04fr);
}

.replay-app.has-story > .transport {
  grid-row: 4;
}

.guided-replay .run-facts [data-run-score],
.guided-replay .run-facts [data-run-actions] {
  display: none;
}

.guided-replay [data-story-locked] {
  cursor: default !important;
  pointer-events: none !important;
}

.guided-replay [data-story-locked-area] {
  opacity: .4;
  pointer-events: none;
  transition: opacity 180ms ease;
  user-select: none;
}

.story-chapters {
  position: relative;
  z-index: 22;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  border-bottom: 1px solid var(--black);
  background: var(--black);
  gap: 1px;
}

.story-chapters button {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: var(--white);
  color: var(--gray-3);
  text-align: left;
}

.story-chapters button:hover,
.story-chapters button.active {
  background: var(--yellow);
  color: var(--black);
}

.story-chapters button span {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 9px;
}

.story-chapters button strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-overlay {
  position: fixed;
  z-index: 40;
  inset: 0;
  pointer-events: none;
}

.story-veil,
.story-focus-ring {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.story-focus-ring {
  transition: inset 160ms ease, left 160ms ease, top 160ms ease,
    width 160ms ease, height 160ms ease, opacity 240ms ease;
}

.story-overlay.is-emphasizing .story-veil,
.story-overlay.is-emphasizing .story-focus-ring {
  opacity: 1;
}

.story-veil {
  z-index: 40;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 240ms ease;
}

.story-veil-field {
  fill: rgb(0 0 0 / 48%);
}

.story-focus-ring {
  z-index: 41;
  border: 3px solid var(--yellow);
  box-shadow: 0 0 0 1px var(--black), 0 0 0 6px rgb(255 220 0 / 22%);
}

.story-pointer {
  position: fixed;
  z-index: 43;
  width: 22px;
  height: 22px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.story-pointer[hidden] {
  display: none;
}

.story-pointer i {
  position: absolute;
  inset: 0;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 0 rgb(255 220 0 / 55%);
  animation: story-pointer-pulse 1.15s ease-out infinite;
}

.story-pointer strong {
  position: absolute;
  top: 17px;
  left: 17px;
  padding: 3px 5px;
  border: 1px solid var(--yellow);
  background: var(--black);
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.story-hotspot {
  cursor: pointer;
}

.story-scroll-cue {
  position: fixed;
  z-index: 43;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--black);
  background: var(--yellow);
  pointer-events: none;
  transform: translate(-50%, -100%);
}

.story-scroll-cue i {
  width: 10px;
  height: 10px;
  border-right: 3px solid var(--black);
  border-bottom: 3px solid var(--black);
  animation: story-scroll-cue-bounce 900ms ease-in-out infinite;
}

@keyframes story-scroll-cue-bounce {
  0%, 100% { transform: translateY(-3px) rotate(45deg); }
  50% { transform: translateY(3px) rotate(45deg); }
}

@keyframes story-pointer-pulse {
  0% { box-shadow: 0 0 0 0 rgb(255 220 0 / 55%); transform: scale(.82); }
  65% { box-shadow: 0 0 0 12px rgb(255 220 0 / 0%); transform: scale(1); }
  100% { box-shadow: 0 0 0 12px rgb(255 220 0 / 0%); transform: scale(.82); }
}

.story-coach {
  position: relative;
  z-index: 22;
  display: grid;
  min-width: 0;
  grid-column: 2;
  grid-row: 3;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-self: center;
  width: calc(100% - 36px);
  height: 210px;
  max-height: calc(100% - 36px);
  margin: 18px;
  overflow: hidden;
  border: 2px solid var(--black);
  background: var(--white);
  box-shadow: 7px 7px 0 var(--black);
  color: var(--black);
  pointer-events: auto;
}

.story-coach.is-changing {
  animation: story-coach-change 220ms ease-out;
}

.story-coach.is-emphasizing {
  box-shadow: 7px 7px 0 var(--black);
}

@keyframes story-coach-change {
  from { opacity: .35; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.story-coach > header {
  display: flex;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.story-coach > header span {
  color: var(--yellow);
}

.story-coach-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  overflow: auto;
  background: var(--white);
  text-align: center;
  transition: background-color 180ms ease-out;
}

.story-coach:not(.has-body) .story-coach-copy {
  display: grid;
  align-content: center;
}

.story-coach:not(.has-body) h3 {
  padding-bottom: 20px;
}

.story-coach.is-emphasizing .story-coach-copy {
  background: var(--yellow);
}

.story-coach h3 {
  width: 100%;
  margin: 0 auto;
  padding: 20px 8px 10px;
  font-size: 18px;
  line-height: 1.25;
}

.story-space {
  display: inline-grid;
  width: 2.5em;
  height: 1.05em;
  margin: 0 .12em;
  background: var(--white);
  box-shadow: 0 2px 0 currentColor;
  color: var(--black);
  vertical-align: -.08em;
}

.story-space i {
  width: 1.35em;
  height: .42em;
}

.story-coach > p {
  display: none;
}

.story-coach-copy > p {
  width: min(100%, 34ch);
  margin: 0 auto;
  padding: 0 20px 20px;
  color: var(--gray-4);
  font-size: 15px;
  line-height: 1.55;
}

.story-coach.is-emphasizing .story-coach-copy > p {
  color: var(--black);
}

.story-coach > footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  border-top: 1px solid var(--black);
}

.story-coach > footer.without-replay {
  grid-template-columns: 1fr 1.15fr;
}

.story-coach > footer button {
  min-height: 42px;
  padding: 0 9px;
  border: 0;
  border-right: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.story-coach > footer button:last-child {
  border-right: 0;
  background: var(--black);
  color: var(--white);
}

.story-coach > footer button:hover:not(:disabled) {
  background: var(--yellow);
  color: var(--black);
}

.story-coach > footer button:disabled {
  color: var(--gray-2);
  cursor: default;
}

.story-region {
  position: absolute;
  z-index: 8;
  border: 3px solid var(--blue);
  background: rgb(30 147 255 / 10%);
  box-shadow: 0 0 0 1px var(--black);
  pointer-events: none;
  opacity: 0;
  animation: story-region-introduce 2.6s ease-out var(--story-region-delay) both;
}

@keyframes story-region-introduce {
  0% { opacity: 0; box-shadow: 0 0 0 1px var(--black), 0 0 0 0 rgb(30 147 255 / 35%); }
  12%, 70% { opacity: 1; }
  38% { box-shadow: 0 0 0 1px var(--black), 0 0 0 7px rgb(30 147 255 / 16%); }
  100% { opacity: 0; box-shadow: 0 0 0 1px var(--black), 0 0 0 0 rgb(30 147 255 / 0%); }
}

.story-unlock {
  position: fixed;
  z-index: 46;
  top: 116px;
  left: 50%;
  display: grid;
  width: min(440px, calc(100vw - 28px));
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 2px solid var(--yellow);
  background: var(--black);
  box-shadow: 8px 8px 0 rgb(255 220 0 / 78%);
  color: var(--white);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -14px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.story-unlock.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.story-unlock-visual {
  position: relative;
  width: 92px;
  max-height: 92px;
  overflow: hidden;
  border: 1px solid var(--yellow);
  background: var(--gray-4);
}

.story-unlock-visual img {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  image-rendering: pixelated;
}

.story-unlock span,
.story-unlock strong,
.story-unlock p {
  display: block;
}

.story-unlock span {
  margin: 2px 0 5px;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.story-unlock strong {
  font-size: 14px;
  line-height: 1.25;
}

.story-unlock p {
  margin: 5px 0 0;
  color: var(--gray-1);
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 1280px) {
  .replay-app.has-story {
    grid-template-columns: 1fr;
    grid-template-rows: 58px 48px auto minmax(0, 1fr) 104px;
  }

  .replay-app.has-story.has-single-story-chapter {
    grid-template-rows: 116px minmax(0, 1fr);
  }

  .replay-app.has-story.has-single-story-chapter > .story-coach {
    grid-row: 1;
  }

  .replay-app.has-story.has-single-story-chapter > .replay-main {
    grid-row: 2;
  }

  .replay-app.has-story > .app-header,
  .replay-app.has-story > .story-chapters,
  .replay-app.has-story > .story-coach,
  .replay-app.has-story > .replay-main,
  .replay-app.has-story > .transport {
    grid-column: 1;
  }

  .replay-app.has-story > .story-coach {
    grid-row: 3;
  }

  .replay-app.has-story > .replay-main {
    grid-row: 4;
  }

  .replay-app.has-story > .transport {
    grid-row: 5;
  }

  .story-coach {
    width: calc(100% - 20px);
    height: 96px;
    max-height: 96px;
    margin: 10px;
    grid-template-columns: 150px minmax(0, 1fr) 220px;
    grid-template-rows: auto;
    border-left: 0;
  }

  .story-coach > header {
    flex-direction: column;
    border-right: 1px solid var(--black);
    border-bottom: 0;
  }

  .story-coach-copy {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
    overflow: auto;
  }

  .story-coach h3 {
    padding: 12px 16px;
    font-size: 17px;
    line-height: 1.25;
  }

  .story-coach-copy > p {
    padding: 0 16px 12px;
    font-size: 15px;
  }

  .story-coach > footer {
    border-top: 0;
    border-left: 1px solid var(--black);
  }

  .story-coach > footer button {
    min-height: 72px;
  }
}

@media (max-width: 980px) {
  .replay-app.has-story {
    min-height: 100dvh;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto 48px auto auto auto;
  }

  .replay-app.has-story.has-single-story-chapter {
    grid-template-rows: auto auto;
  }

  .story-coach {
    height: auto;
    max-height: none;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .story-coach-copy {
    grid-template-columns: 1fr;
  }

  .story-coach h3 {
    padding: 10px 12px 3px;
    font-size: 17px;
  }

  .story-coach-copy > p {
    padding: 0 12px 10px;
    font-size: 15px;
  }

  .story-coach > footer {
    grid-column: 1 / -1;
    border-top: 1px solid var(--black);
    border-left: 0;
  }

  .story-coach > footer button {
    min-height: 34px;
  }
}

@media (max-width: 620px) {
  .story-chapters button {
    justify-content: center;
    padding: 0 5px;
  }

  .story-chapters button strong {
    display: none;
  }

  .story-coach h3 {
    font-size: 17px;
  }

  .story-unlock {
    top: 108px;
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .story-unlock-visual {
    width: 66px;
    max-height: 66px;
  }
}
