:root {
  --v3-solar: #ffc857;
  --v3-satellite: #6ee8ef;
  --v3-rfi: #ff9a7c;
  --v3-ink: #07142f;
}

.child-scene.data-scene {
  grid-template-rows: auto minmax(0, 1fr);
}

.child-scene.data-scene[data-scenario="rfi_scan"]:has(.rfi-clue-deck) {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.child-brand-copy strong b {
  margin-left: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(110, 232, 239, 0.46);
  border-radius: 999px;
  color: var(--signal-soft);
  background: rgba(41, 216, 242, 0.1);
  font-size: 11px;
  letter-spacing: 0.12em;
  vertical-align: 3px;
}

.team-route {
  position: relative;
  isolation: isolate;
}

.team-route-line {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  z-index: -1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(169, 183, 212, 0.14);
  transform: translateY(-50%);
}

.team-route-line i {
  display: block;
  width: var(--route-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--safe),
    var(--signal-soft),
    var(--sun)
  );
  box-shadow: 0 0 14px rgba(110, 232, 239, 0.45);
  transition: width 480ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.team-route .chapter-node {
  min-height: 46px;
  padding: 5px 8px;
  border-radius: 14px;
  background: rgba(3, 11, 28, 0.8);
}

.team-route .chapter-node.current {
  color: #0b1430;
  background: var(--sun);
  box-shadow: 0 10px 26px rgba(255, 200, 87, 0.22);
}

.team-route .chapter-node.current::before {
  background: #0b1430;
  box-shadow: 0 0 0 6px rgba(11, 20, 48, 0.1);
}

.team-route .chapter-node img {
  position: absolute;
  left: 50%;
  top: -28px;
  width: 42px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgba(0, 0, 0, 0.42));
  transform: translateX(-50%);
  animation: v3-route-hop 600ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.role-constellation.picture-role-grid {
  align-content: center;
}

.role-claim {
  position: relative;
  width: 100%;
  color: var(--white);
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.role-claim:hover,
.role-claim:focus-visible {
  border-color: rgba(110, 232, 239, 0.62);
  transform: translateY(-3px);
}

.role-claim:disabled {
  cursor: default;
  transform: none;
}

.role-claim.claimed {
  border-color: rgba(255, 200, 87, 0.78);
  background:
    radial-gradient(
      circle at 14% 20%,
      rgba(255, 200, 87, 0.2),
      transparent 34%
    ),
    rgba(16, 37, 74, 0.92);
  box-shadow:
    0 0 0 4px rgba(255, 200, 87, 0.1),
    0 20px 36px rgba(0, 0, 0, 0.24);
}

.role-claim-state {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 5px 9px;
  border: 1px solid rgba(110, 232, 239, 0.28);
  border-radius: 999px;
  color: var(--signal-soft);
  background: rgba(3, 11, 28, 0.68);
  font-size: 11px;
  font-weight: 850;
}

.role-claim.claimed .role-claim-state {
  border-color: rgba(255, 200, 87, 0.48);
  color: #0b1430;
  background: var(--sun);
}

.role-reset {
  grid-column: 1 / -1;
  min-height: 44px;
  border: 1px solid rgba(169, 183, 212, 0.28);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(3, 11, 28, 0.48);
  font-weight: 800;
}

.prediction-picture-panel .prediction-capsule {
  grid-column: 1 / -1;
}

.prediction-capsule {
  width: 100%;
  min-height: 92px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 14px;
  border: 1px dashed rgba(169, 183, 212, 0.4);
  border-radius: 24px;
  color: var(--muted);
  background: rgba(3, 11, 28, 0.48);
}

.prediction-capsule.sealed {
  border-style: solid;
  border-color: rgba(255, 200, 87, 0.62);
  color: var(--white);
  background: rgba(255, 200, 87, 0.09);
  box-shadow: inset 0 0 28px rgba(255, 200, 87, 0.05);
}

.prediction-capsule > img,
.prediction-capsule .picture-choice-art {
  width: 70px;
  height: 64px;
  object-fit: contain;
}

.prediction-capsule span small,
.prediction-capsule span strong {
  display: block;
}

.prediction-capsule span small {
  color: inherit;
  font-size: 12px;
  font-weight: 750;
}

.prediction-capsule span strong {
  margin-top: 3px;
  color: var(--white);
  font-size: 22px;
}

.prediction-capsule > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--sun);
  font-style: normal;
  font-weight: 950;
}

.data-header > div:last-child {
  display: grid;
  justify-items: end;
  gap: 9px;
}

.visual-mode-toggle {
  padding: 4px;
  display: flex;
  gap: 4px;
  border: 1px solid rgba(169, 183, 212, 0.22);
  border-radius: 16px;
  background: rgba(3, 11, 28, 0.58);
}

.visual-mode-toggle button {
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}

.visual-mode-toggle button.active {
  color: #07142f;
  background: var(--signal-soft);
  box-shadow: 0 8px 18px rgba(41, 216, 242, 0.18);
}

.evidence-capture-toast {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  width: min(620px, 72%);
  min-height: 88px;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 200, 87, 0.66);
  border-radius: 24px;
  color: #0b1430;
  background: #fff5d7;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42), 0 0 36px rgba(255, 200, 87, 0.2);
  transform: translateX(-50%);
  animation: v3-evidence-toast 2.2s ease both;
}

.evidence-capture-toast img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.evidence-capture-toast small,
.evidence-capture-toast strong {
  display: block;
}

.evidence-capture-toast small {
  color: #76601c;
  font-size: 12px;
  font-weight: 850;
}

.evidence-capture-toast strong {
  margin-top: 3px;
  font-size: clamp(18px, 1.4vw, 25px);
}

.evidence-reasoning-trail {
  grid-column: 1 / -1;
  width: 100%;
  padding: 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  border: 1px solid rgba(110, 232, 239, 0.26);
  border-radius: 22px;
  background: rgba(3, 11, 28, 0.5);
}

.evidence-reasoning-trail span {
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.evidence-reasoning-trail small,
.evidence-reasoning-trail strong {
  display: block;
}

.evidence-reasoning-trail small {
  color: var(--muted);
  font-size: 11px;
}

.evidence-reasoning-trail strong {
  margin-top: 3px;
  color: var(--white);
  font-size: 14px;
  line-height: 1.35;
}

.evidence-reasoning-trail > i {
  align-self: center;
  color: var(--sun);
  font-style: normal;
  font-size: 22px;
}

.mission-complete-constellation {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.mission-complete-constellation span {
  min-width: 0;
  padding: 10px 6px;
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 200, 87, 0.3);
  border-radius: 15px;
  color: var(--sun);
  background: rgba(255, 200, 87, 0.075);
  animation: v3-complete-star 520ms var(--star-delay, 0ms) ease both;
}

.mission-complete-constellation span i {
  font-style: normal;
  font-size: 24px;
  filter: drop-shadow(0 0 10px rgba(255, 200, 87, 0.52));
}

.mission-complete-constellation span strong {
  color: var(--white);
  font-size: 12px;
  white-space: nowrap;
}

.mission-complete-constellation > small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.v3-result-workspace {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.v3-result-tabs {
  justify-self: end;
  padding: 4px;
  display: flex;
  gap: 4px;
  border: 1px solid rgba(169, 183, 212, 0.24);
  border-radius: 16px;
  background: rgba(3, 11, 28, 0.72);
}

.v3-result-tabs button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.v3-result-tabs button.active {
  color: var(--v3-ink);
  background: var(--sun);
}

.v3-result-workspace > .result-card,
.result-replay-panel {
  min-height: 0;
  height: 100%;
}

.result-replay-panel {
  padding: clamp(14px, 1.3vw, 22px);
  overflow: hidden;
  border: 1px solid rgba(110, 232, 239, 0.28);
  border-radius: 30px;
  background: rgba(3, 11, 28, 0.9);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.result-replay-panel .v3gv-replay-header h2 {
  font-size: clamp(24px, 1.8vw, 34px);
}

.result-replay-panel .v3gv-replay-header > strong {
  min-height: 42px;
}

.result-replay-panel .v3gv-replay-controls button {
  min-width: 138px;
  min-height: 48px;
}

.result-replay-panel .v3gv-replay-timeline {
  min-height: 54px;
}

@keyframes v3-route-hop {
  from {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes v3-evidence-toast {
  0% {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.96);
  }
  12%, 82% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.99);
  }
}

@keyframes v3-complete-star {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1250px), (max-height: 760px) {
  .team-route .chapter-node {
    min-height: 38px;
    padding: 3px 6px;
  }

  .team-route .chapter-node img {
    top: -21px;
    width: 32px;
    height: 29px;
  }

  .role-claim-state {
    top: 7px;
    right: 7px;
  }

  .role-reset {
    min-height: 34px;
  }

  .prediction-capsule {
    min-height: 68px;
    grid-template-columns: 54px minmax(0, 1fr) 36px;
  }

  .prediction-capsule > img,
  .prediction-capsule .picture-choice-art {
    width: 52px;
    height: 48px;
  }

  .visual-mode-toggle button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 11px;
  }

  .evidence-capture-toast {
    min-height: 68px;
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .evidence-capture-toast img {
    width: 50px;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-route .chapter-node img,
  .evidence-capture-toast,
  .mission-complete-constellation span {
    animation: none;
  }
}
