/* The graph visualizes the original OpenEnv episode log. */
.arena-workbench {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.arena-workbench .arena-terminals {
  margin: 0;
}
.arena-stage {
  --arena-accent: #8aabff;
  background: #101621;
  color: #edf1fa;
  border: 1px solid #263040;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 32px #1724380a;
}
.arena-stage[data-active-agent="attacker"] {
  --arena-accent: #f08094;
}
.arena-stage[data-active-agent="worker"] {
  --arena-accent: #82a8ff;
}
.arena-stage[data-active-agent="oversight"] {
  --arena-accent: #e4c66e;
}
.arena-stage-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px 0;
}
.arena-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #9eacc5;
  font:
    9px "Geist Mono",
    monospace;
  letter-spacing: 0.12em;
}
.arena-stage-heading h2 {
  margin-top: 7px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.4px;
  color: #edf1fa;
}
.arena-stage-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #abb8ce;
  font-size: 10px;
  white-space: nowrap;
  padding: 7px 10px;
  background: #1e2735;
  border: 1px solid #2d3a4e;
  border-radius: 20px;
}
.arena-stage-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8ec8b0;
}
.arena-stage button:focus-visible,
.arena-stage a:focus-visible,
.arena-stage input:focus-visible,
.arena-stage select:focus-visible,
#arena-graph-host:focus-visible {
  outline: 2px solid #c4d4ff;
  outline-offset: 4px;
}
.arena-graph-shell {
  position: relative;
  margin-top: 12px;
  background: radial-gradient(ellipse at 48% 47%, #1c315428, transparent 67%);
}
.arena-graph-viewport {
  position: relative;
  height: 480px;
  isolation: isolate;
}
#arena-graph-host {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline-offset: -3px;
}
#arena-graph-host canvas {
  display: block;
}
.arena-graph-loading,
.arena-graph-error,
.arena-graph-fallback {
  position: absolute;
  inset: 90px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #a9bad7;
  font-size: 12px;
  line-height: 1.6;
}
.arena-graph-fallback {
  flex-direction: column;
  gap: 9px;
  inset: 80px 24px 105px;
}
.arena-graph-fallback strong {
  color: #e6efff;
  font-size: 16px;
  font-weight: 500;
}
.arena-graph-fallback p {
  max-width: 410px;
  margin: 0;
}
.arena-stage .graph-hover-label {
  max-width: 260px;
  padding: 9px 11px;
  border: 1px solid #465b7b;
  border-radius: 6px;
  background: #142036f5;
  color: #c8d7ee;
  font:
    12px/1.5 Geist,
    sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  box-shadow: 0 8px 24px #0005;
}
.arena-stage .graph-hover-label strong {
  color: #f0f4ff;
  font-weight: 500;
}
.arena-graph-toolbar {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 26px;
  right: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.arena-graph-readout {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8e9fb9;
  font:
    9px "Geist Mono",
    monospace;
  flex-wrap: wrap;
}
.arena-graph-readout b {
  color: #c2d2ed;
  font-weight: 500;
}
.arena-graph-dimensional {
  border: 1px solid #435d88;
  border-radius: 4px;
  color: #9dbbfa;
  padding: 4px 5px;
  letter-spacing: 0.06em;
  background: #182a45a6;
}
.arena-graph-seed {
  color: #7287a7;
}
.arena-graph-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.arena-graph-controls .arena-graph-control {
  height: 29px;
  padding: 0 9px;
  font-size: 10px;
  background: #182334d9;
  backdrop-filter: blur(8px);
  border-color: #34445e;
}
.arena-graph-controls .arena-graph-control[aria-pressed="true"] {
  background: #203969;
  border-color: #6e96eb;
  color: #c4d6ff;
}
.arena-graph-overlay-footer {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 14px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.arena-graph-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 16px;
  color: #a5b4cc;
  font-size: 9px;
  pointer-events: none;
  text-shadow: 0 1px 5px #101621;
}
.arena-graph-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.arena-graph-key {
  --key-color: #b6a3e3;
  display: block;
  width: 5px;
  height: 5px;
  background: var(--key-color);
  border-radius: 50%;
  box-shadow: 0 0 7px color-mix(in srgb, var(--key-color) 35%, transparent);
}
.arena-graph-key.attacker {
  --key-color: #ff7894;
}
.arena-graph-key.worker {
  --key-color: #789bff;
}
.arena-graph-key.oversight {
  --key-color: #e4c66e;
}
.arena-graph-key.rejected {
  --key-color: #ff7894;
}
.arena-graph-key.flagged {
  --key-color: #e4c66e;
}
.arena-graph-key.request {
  --key-color: #b6a3e3;
}
.arena-graph-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 15px;
  font-size: 9px;
  color: #7e91ae;
  pointer-events: none;
  text-shadow: 0 1px 5px #101621;
}
.arena-graph-hints span + span::before {
  content: "·";
  padding-right: 15px;
  color: #5d708e;
}
.arena-graph-inspector {
  position: absolute;
  z-index: 5;
  top: 54px;
  right: 20px;
  width: min(280px, calc(100% - 40px));
  max-height: 356px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #496080;
  border-radius: 9px;
  padding: 15px;
  background: #162235f2;
  backdrop-filter: blur(16px);
  box-shadow:
    0 12px 34px #03071266,
    inset 0 1px 0 #90b7f012;
  color: #bacbe3;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
#arena-graph-inspector[hidden] {
  display: none;
}
.arena-graph-inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.arena-graph-inspector-kicker {
  display: block;
  font:
    8px "Geist Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8facda;
  margin-bottom: 5px;
}
.arena-graph-inspector h3,
.arena-graph-inspector-title {
  margin: 0;
  color: #eef3ff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.arena-graph-inspector-close {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #43526b;
  border-radius: 4px;
  background: #23334a;
  color: #b8cce9;
  cursor: pointer;
}
.arena-graph-inspector-close:hover {
  border-color: #89aee7;
  color: white;
}
.arena-graph-inspector-body,
.arena-graph-inspector p {
  margin-top: 9px;
}
.arena-graph-inspector-description {
  color: #acbdd7;
}
.arena-graph-inspector-meta,
.arena-graph-inspector dl {
  display: grid;
  grid-template-columns: minmax(65px, auto) minmax(0, 1fr);
  gap: 6px 12px;
  border-top: 1px solid #31415b;
  padding-top: 11px;
  margin-top: 12px;
  font-size: 10px;
}
.arena-graph-inspector-meta > div {
  display: contents;
}
.arena-graph-inspector .arena-control {
  padding-inline: 10px;
  margin-top: 10px;
}
.arena-graph-inspector dt {
  color: #839bbd;
}
.arena-graph-inspector dd {
  margin: 0;
  color: #d1def0;
  text-align: right;
}
.arena-graph-inspector-reward {
  color: var(--arena-accent);
  font:
    16px "Geist Mono",
    monospace;
}
.arena-graph-inspector pre {
  margin-top: 11px;
  padding: 10px;
  white-space: pre-wrap;
  background: #0c1522;
  color: #c3d1e8;
  border: 1px solid #2b3c56;
  border-radius: 5px;
  font:
    11px/1.6 "Geist Mono",
    monospace;
}
.arena-graph-inspector code {
  font-family: "Geist Mono", monospace;
}
.arena-commentary {
  padding: 15px 26px;
  min-height: 76px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-block: 1px solid #2c3545;
  background: #182130;
}
.arena-commentary-glyph {
  display: flex;
  color: var(--arena-accent);
}
.arena-commentary > div {
  min-width: 0;
  flex: 1;
}
.arena-commentary strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #e1e8f4;
}
.arena-commentary p {
  margin-top: 5px;
  font-size: 10px;
  color: #a2b0c5;
  line-height: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.arena-turn-order {
  display: flex;
  gap: 7px;
  align-items: center;
  font:
    8px "Geist Mono",
    monospace;
  color: #8da0bc;
  white-space: nowrap;
}
.arena-event-reward {
  color: var(--arena-accent);
  font-size: 18px;
  text-align: right;
}
.arena-event-reward small {
  display: block;
  color: #9caac0;
  font:
    9px Geist,
    sans-serif;
  margin-top: 4px;
}
.arena-transport {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 16px 26px 12px;
}
.arena-playback-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
}
.arena-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  font:
    11px Geist,
    sans-serif;
  color: #bbc8de;
  background: #1b2534;
  border: 1px solid #354259;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.arena-control:hover:not(:disabled) {
  color: white;
  border-color: #7b9ad1;
}
.arena-control:disabled {
  opacity: 0.3;
  cursor: default;
}
.arena-play {
  min-width: 107px;
  padding-inline: 11px;
  background: #3159f5;
  border-color: #3159f5;
  color: white;
}
.arena-play:hover:not(:disabled) {
  background: #456afa;
}
.arena-icon-button {
  width: 32px;
}
.arena-scrubber {
  flex: 1;
  display: flex;
  min-width: 60px;
}
.arena-scrubber input {
  width: 100%;
  min-width: 0;
  height: 4px;
  padding: 0;
  margin: 0;
  border: 0;
  appearance: none;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    #7399ff var(--replay-progress),
    #354157 var(--replay-progress)
  );
  cursor: pointer;
}
.arena-scrubber input::-webkit-slider-thumb {
  appearance: none;
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background: #b8caff;
  box-shadow: 0 0 0 3px #385dac44;
}
.arena-scrubber input::-moz-range-thumb {
  height: 10px;
  width: 10px;
  border: 0;
  border-radius: 50%;
  background: #b8caff;
}
.arena-scrubber input:disabled {
  cursor: default;
  opacity: 0.4;
}
.arena-clock {
  color: #a8b6cc;
  font-size: 9px;
  white-space: nowrap;
}
.arena-speed select {
  color: #b4c2d9;
  font:
    11px "Geist Mono",
    monospace;
  background: #1b2534;
  border: 1px solid #354259;
  border-radius: 4px;
  height: 28px;
  padding: 0 4px;
  cursor: pointer;
}
.arena-stage-footnote {
  padding: 0 26px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #8e9eb7;
  font-size: 9px;
}

@media (max-width: 1100px) {
  .arena-stage-heading,
  .arena-commentary,
  .arena-transport {
    padding-left: 20px;
    padding-right: 20px;
  }
  .arena-graph-toolbar {
    left: 20px;
    right: 20px;
  }
  .arena-graph-overlay-footer {
    left: 20px;
    right: 20px;
  }
  .arena-graph-seed {
    display: none;
  }
  .arena-turn-order {
    display: none;
  }
  .arena-transport {
    gap: 12px;
  }
}
@media (max-width: 700px) {
  .arena-stage-heading {
    align-items: flex-start;
    padding: 18px 16px 0;
    gap: 10px;
  }
  .arena-stage-heading h2 {
    font-size: 17px;
    max-width: 215px;
    line-height: 1.3;
  }
  .arena-stage-status {
    font-size: 8px;
    padding: 5px 7px;
    gap: 5px;
  }
  .arena-eyebrow {
    font-size: 8px;
  }
  .arena-graph-shell {
    margin-top: 10px;
  }
  .arena-graph-viewport {
    height: 390px;
  }
  .arena-graph-toolbar {
    left: 15px;
    right: 15px;
    top: 8px;
    gap: 9px;
  }
  .arena-graph-readout {
    gap: 7px;
    font-size: 8px;
  }
  .arena-graph-controls {
    gap: 5px;
  }
  .arena-graph-controls .arena-graph-control {
    height: 28px;
    padding-inline: 7px;
    font-size: 9px;
    gap: 4px;
  }
  .arena-graph-overlay-footer {
    left: 15px;
    right: 15px;
    gap: 9px;
  }
  .arena-graph-legend {
    font-size: 8px;
    gap: 8px 12px;
  }
  .arena-graph-hints {
    font-size: 8px;
    gap: 4px 8px;
  }
  .arena-graph-hints span + span::before {
    padding-right: 8px;
  }
  .arena-graph-inspector {
    position: relative;
    top: auto;
    right: auto;
    margin: 0 15px 15px;
    width: auto;
    max-height: 280px;
    padding: 13px;
    box-shadow: none;
  }
  .arena-commentary {
    padding: 12px 15px;
    min-height: 86px;
    gap: 9px;
  }
  .arena-commentary strong {
    font-size: 10px;
    line-height: 15px;
  }
  .arena-commentary p {
    font-size: 9px;
    line-height: 14px;
  }
  .arena-event-reward {
    font-size: 16px;
  }
  .arena-event-reward small {
    font-size: 8px;
  }
  .arena-transport {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 15px;
  }
  .arena-playback-buttons {
    flex: 1;
  }
  .arena-scrubber {
    order: 4;
    flex: 1 0 100%;
    padding-block: 8px;
  }
  .arena-clock {
    font-size: 8px;
  }
  .arena-speed select {
    font-size: 10px;
  }
  .arena-stage-footnote {
    padding: 0 15px 13px;
    font-size: 8px;
    line-height: 13px;
    flex-wrap: wrap;
    gap: 1px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .arena-stage *,
  .arena-stage *::before,
  .arena-stage *::after {
    scroll-behavior: auto;
    transition-duration: 0s;
    animation-duration: 0s;
  }
}

@media (min-width: 1000px) {
  .page:has(> .arena-workbench) {
    gap: 16px;
    padding-top: 20px;
  }
  .page:has(> .arena-workbench) > .config {
    padding-block: 9px;
    min-height: 60px;
  }
  .arena-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 36%);
    gap: 16px;
    height: var(--arena-workbench-height, calc(100dvh - 260px));
    min-height: 440px;
  }
  .arena-workbench .arena-stage {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    min-height: 0;
  }
  .arena-workbench .arena-stage-heading {
    flex: 0 0 auto;
    padding: 15px 18px 0;
    gap: 10px;
  }
  .arena-workbench .arena-stage-heading h2 {
    font-size: 16px;
    margin-top: 5px;
  }
  .arena-workbench .arena-stage-status {
    font-size: 8px;
    padding: 5px 7px;
  }
  .arena-workbench .arena-graph-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    min-width: 0;
    margin-top: 10px;
  }
  .arena-workbench .arena-graph-viewport {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    height: auto;
  }
  .arena-workbench .arena-graph-toolbar,
  .arena-workbench .arena-graph-overlay-footer {
    left: 18px;
    right: 18px;
  }
  .arena-workbench .arena-graph-seed {
    display: none;
  }
  .arena-workbench .arena-graph-inspector {
    max-height: calc(100% - 68px);
  }
  .arena-workbench .arena-commentary {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 10px 18px;
  }
  .arena-workbench .arena-transport {
    flex: 0 0 auto;
    gap: 10px;
    padding: 12px 18px 10px;
  }
  .arena-workbench .arena-stage-footnote {
    flex: 0 0 auto;
    padding: 0 18px 11px;
    font-size: 8px;
  }
  .arena-workbench .arena-stage-footnote > span:last-child {
    display: none;
  }
}
