.decision-replay {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b0e12;
}

.replay-head {
  display: grid;
  grid-template-columns: minmax(220px, .6fr) minmax(520px, 1.4fr);
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

.replay-case {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 76px;
  padding: 0 24px;
  border-right: 1px solid var(--border);
}

.replay-case span,
.replay-state {
  color: var(--blue);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.replay-case strong {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.replay-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.replay-progress li {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 0 18px;
  border-right: 1px solid var(--border);
  color: var(--faint);
  transition: color 180ms ease, background 180ms ease;
}

.replay-progress li:last-child {
  border-right: 0;
}

.replay-progress li::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--blue);
  content: "";
  opacity: 0;
  transform: scaleX(.2);
  transition: opacity 180ms ease, transform 220ms ease;
}

.replay-progress li.is-active {
  color: var(--text);
  background: rgba(91, 132, 255, .055);
}

.replay-progress li.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.replay-progress li.is-complete {
  color: var(--text-soft);
}

.replay-progress li.is-complete b {
  color: var(--green);
}

.replay-progress b {
  color: var(--blue);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.replay-progress span {
  font-size: 13px;
  font-weight: 650;
}

.replay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, .65fr);
  min-height: 610px;
}

.replay-visual {
  min-width: 0;
  border-right: 1px solid var(--border);
  background: #07090c;
}

.replay-screen-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .08em;
}

.replay-screen-bar span:first-child {
  color: var(--text-soft);
}

.replay-viewport {
  position: relative;
  height: 515px;
  overflow: hidden;
  background: #05070a;
}

.replay-stage {
  position: absolute;
  inset: 0;
  transition: opacity 180ms ease;
}

.replay-stage.is-switching {
  opacity: .2;
}

.replay-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.replay-stage::after {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 11, .2);
  content: "";
  pointer-events: none;
  transition: background 220ms ease;
}

.replay-stage.is-revealed::after {
  background: transparent;
}

.replay-focus {
  position: absolute;
  z-index: 2;
  left: var(--focus-left, 70%);
  top: var(--focus-top, 3%);
  width: var(--focus-width, 27%);
  height: var(--focus-height, 34%);
  border: 1px solid rgba(91, 132, 255, .95);
  border-radius: 6px;
  box-shadow:
    0 0 0 999px rgba(4, 7, 11, .68),
    0 0 34px rgba(91, 132, 255, .34),
    inset 0 0 20px rgba(91, 132, 255, .08);
  opacity: 0;
  pointer-events: none;
  transform: scale(.96);
  transition:
    left 300ms ease,
    top 300ms ease,
    width 300ms ease,
    height 300ms ease,
    opacity 200ms ease,
    transform 260ms cubic-bezier(.22, 1, .36, 1);
}

.replay-stage.is-revealed .replay-focus {
  opacity: 1;
  transform: scale(1);
}

.replay-callout {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 18px;
  max-width: min(330px, calc(100% - 36px));
  padding: 9px 12px;
  border: 1px solid rgba(91, 132, 255, .24);
  border-radius: 7px;
  color: var(--text-soft);
  background: rgba(8, 11, 16, .9);
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
  transition: border-color 180ms ease, color 180ms ease;
}

.replay-stage.is-revealed .replay-callout {
  border-color: rgba(91, 132, 255, .55);
  color: #fff;
}

.replay-facts {
  display: flex;
  min-height: 46px;
  border-top: 1px solid var(--border);
}

.replay-facts span {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  color: var(--faint);
  font-size: 11px;
}

.replay-facts span:last-child {
  border-right: 0;
}

.replay-panel {
  display: flex;
  min-width: 0;
  padding: 38px 34px 30px;
  background:
    radial-gradient(circle at 100% 0, rgba(91, 132, 255, .08), transparent 31%),
    var(--surface);
}

.replay-step-content,
.replay-summary {
  display: flex;
  width: 100%;
  flex-direction: column;
}

.replay-step-content[hidden] {
  display: none;
}

.replay-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.replay-status {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.replay-panel h3 {
  margin-top: 24px;
  color: var(--text);
  font-size: clamp(26px, 2.2vw, 34px);
  line-height: 1.24;
  letter-spacing: -.035em;
}

.replay-copy {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.78;
}

.replay-question {
  margin-top: 26px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
}

.replay-choices {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.replay-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-soft);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.replay-choice::after {
  color: var(--faint);
  content: "→";
}

.replay-choice:hover,
.replay-choice:focus-visible {
  border-color: rgba(91, 132, 255, .62);
  color: #fff;
  background: rgba(91, 132, 255, .09);
  outline: none;
  transform: translateX(2px);
}

.replay-choice.is-selected {
  border-color: var(--blue);
  color: #fff;
  background: rgba(91, 132, 255, .14);
}

.replay-choice:disabled {
  cursor: default;
  opacity: .48;
  transform: none;
}

.replay-choice.is-selected:disabled {
  opacity: 1;
}

.replay-skip {
  align-self: flex-start;
  margin-top: 12px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.replay-skip:hover,
.replay-skip:focus-visible {
  color: var(--text);
}

.replay-feedback {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid rgba(91, 132, 255, .26);
  border-radius: 8px;
  background: rgba(91, 132, 255, .055);
  animation: replay-in 260ms ease both;
}

.replay-feedback[hidden] {
  display: none;
}

.replay-feedback div {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-right: 1px solid rgba(91, 132, 255, .18);
}

.replay-feedback div:nth-child(2) {
  border-right: 0;
}

.replay-feedback span {
  color: var(--muted);
  font-size: 10px;
}

.replay-feedback strong {
  color: var(--text);
  font-size: 13px;
}

.replay-feedback p {
  grid-column: 1 / -1;
  padding: 13px 14px;
  border-top: 1px solid rgba(91, 132, 255, .18);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.65;
}

.replay-next {
  align-self: flex-start;
  margin-top: 16px;
}

.replay-next[hidden] {
  display: none;
}

.replay-summary {
  justify-content: center;
  animation: replay-in 320ms ease both;
}

.replay-summary[hidden] {
  display: none;
}

.summary-check {
  display: grid;
  width: 44px;
  height: 44px;
  margin-top: 24px;
  place-items: center;
  border: 1px solid rgba(53, 201, 147, .42);
  border-radius: 50%;
  color: var(--green);
  background: rgba(53, 201, 147, .08);
  font-size: 20px;
}

.replay-summary > p:not(.replay-state) {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.replay-summary dl {
  margin-top: 26px;
  border-top: 1px solid var(--border);
}

.replay-summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.replay-summary dt {
  color: var(--muted);
  font-size: 12px;
}

.replay-summary dd {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}

.replay-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

@keyframes replay-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1040px) {
  .replay-head {
    grid-template-columns: 1fr;
  }

  .replay-case {
    min-height: 64px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .replay-visual {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .replay-panel {
    min-height: 540px;
  }
}

@media (max-width: 720px) {
  .replay-progress li {
    display: flex;
    min-height: 58px;
    justify-content: center;
    padding: 0 6px;
  }

  .replay-progress li span {
    display: none;
  }

  .replay-viewport {
    height: min(64vw, 360px);
  }

  .replay-screen-bar {
    min-height: 44px;
    font-size: 9px;
  }

  .replay-screen-bar span:last-child {
    display: none;
  }

  .replay-facts span {
    font-size: 10px;
  }

  .replay-panel {
    min-height: 0;
    padding: 30px 22px;
  }

  .replay-panel h3 {
    font-size: 27px;
  }

  .replay-feedback {
    grid-template-columns: 1fr;
  }

  .replay-feedback div {
    border-right: 0;
    border-bottom: 1px solid rgba(91, 132, 255, .18);
  }

  .replay-feedback div:nth-child(2) {
    border-bottom: 0;
  }

  .replay-feedback p {
    grid-column: 1;
  }

  .replay-summary-actions {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .replay-stage,
  .replay-focus,
  .replay-choice,
  .replay-progress li,
  .replay-progress li::after {
    transition: none;
  }

  .replay-feedback,
  .replay-summary {
    animation: none;
  }
}
