:root {
  --path-panel: #ffffff;
  --path-soft: #f2f5f2;
  --path-accent: #0b6e4f;
  --path-accent-soft: #e3f2ec;
}

body {
  background: #f7f8f5;
}

.path-site-header {
  align-items: flex-start;
}

.path-header-copy {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
}

.path-site-header .header-actions a {
  width: auto;
  min-width: 120px;
  height: 40px;
  padding: 0 14px;
}

.path-site-header .secondary-action,
.game-actions .secondary-action,
.game-actions .primary-action {
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.path-site-header .secondary-action,
.game-actions .secondary-action {
  background: #ffffff;
  color: var(--ink);
}

.game-actions button {
  min-height: 40px;
  padding: 0 14px;
}

.path-game-shell {
  width: min(100% - 32px, 1380px);
  margin: 28px auto 64px;
}

.game-mode {
  display: none;
}

.game-mode.active {
  display: block;
}

.mini-game-mode-selector {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.mini-game-mode {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}

.mini-game-mode.active,
.mini-game-mode:hover,
.mini-game-mode:focus-visible {
  border-color: var(--path-accent);
  background: var(--path-accent-soft);
  color: var(--path-accent);
}

.path-intro,
.puzzle-panel {
  border: 1px solid var(--line);
  background: var(--path-panel);
  box-shadow: 0 12px 28px rgb(24 35 29 / 6%);
}

.complete-team-panel {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--path-panel);
  box-shadow: 0 12px 28px rgb(24 35 29 / 6%);
}

.complete-team-copy {
  max-width: 660px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.complete-team-metrics {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 130px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.complete-team-metrics strong {
  color: var(--path-accent);
  font-size: 28px;
  line-height: 1;
}

.complete-team-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.complete-team-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.complete-team-slot {
  display: grid;
  align-content: center;
  min-height: 106px;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.complete-team-slot.filled {
  border-color: var(--path-accent);
  background: var(--path-accent-soft);
}

.complete-team-slot.seed-hero {
  background: #eef1f5;
  border-color: #99a5b4;
}

.complete-team-slot.empty {
  place-items: center;
  min-height: 106px;
  border-style: dashed;
  color: #8a918e;
  font-size: 12px;
  font-weight: 800;
}

.slot-remove {
  width: fit-content;
  padding: 3px 6px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.slot-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.complete-team-search-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.complete-team-search {
  width: min(100%, 360px);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.complete-team-search:focus-visible {
  outline: 3px solid rgb(11 110 79 / 28%);
  outline-offset: 2px;
  border-color: var(--path-accent);
}

.complete-team-candidates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  max-height: 420px;
  margin-top: 10px;
  overflow: auto;
}

.complete-team-candidate {
  display: grid;
  gap: 3px;
  min-height: 74px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.complete-team-candidate:hover,
.complete-team-candidate:focus-visible,
.complete-team-candidate.hint-candidate {
  border-color: var(--path-accent);
  background: var(--path-accent-soft);
}

.complete-team-candidate:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.candidate-role,
.complete-team-candidate > span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.complete-team-candidate > span:last-child {
  color: var(--path-accent);
}

.guess-hero-panel {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--path-panel);
  box-shadow: 0 12px 28px rgb(24 35 29 / 6%);
}

.guess-hero-copy {
  max-width: 660px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.guess-hero-metrics {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 145px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.guess-hero-metrics > strong {
  color: var(--path-accent);
  font-size: 28px;
  line-height: 1;
}

.guess-hero-round-controls {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--path-soft);
}

.guess-round-button {
  min-height: 26px;
  padding: 3px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
}

.guess-round-button.active,
.guess-round-button:hover,
.guess-round-button:focus-visible {
  background: #ffffff;
  color: var(--path-accent);
}

.guess-hero-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.guess-clue-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 18px;
  border: 1px solid var(--path-accent);
  background: var(--path-accent-soft);
}

.guess-clue-label {
  color: var(--path-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.guess-clue-card strong {
  font-size: 18px;
  line-height: 1.35;
}

.guess-picker-section,
.guess-feedback-section {
  margin-top: 26px;
}

.guess-hero-search {
  width: min(100%, 380px);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.guess-hero-search:focus-visible {
  outline: 3px solid rgb(11 110 79 / 28%);
  outline-offset: 2px;
  border-color: var(--path-accent);
}

.guess-hero-candidates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.guess-hero-candidate {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  text-align: left;
}

.guess-hero-candidate:hover,
.guess-hero-candidate:focus-visible {
  border-color: var(--path-accent);
  background: var(--path-accent-soft);
}

.guess-hero-candidate:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.guess-feedback-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.guess-feedback-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 12px;
}

.feedback-match,
.feedback-different {
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 850;
}

.feedback-match {
  background: var(--path-accent-soft);
  color: var(--path-accent);
}

.feedback-different {
  background: #f3eeee;
  color: #8b3c36;
}

.path-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.path-intro h2,
.puzzle-panel h2,
.puzzle-panel h3 {
  margin: 0;
}

.path-intro p:last-child {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--muted);
}

.how-to-play-list {
  display: grid;
  max-width: 760px;
  gap: 6px;
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.how-to-play-list strong {
  color: var(--path-accent);
}

.how-to-play-note {
  font-size: 13px;
}

.direction-note {
  display: grid;
  flex: 0 0 190px;
  gap: 6px;
  padding: 14px;
  border-left: 3px solid var(--path-accent);
  background: var(--path-accent-soft);
  color: var(--muted);
  font-size: 13px;
}

.direction-note-mark {
  color: var(--ink);
  font-weight: 900;
}

.puzzle-panel {
  margin-top: 16px;
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.compact-heading {
  margin-bottom: 12px;
}

.move-count {
  color: var(--path-accent);
  font-size: 14px;
  font-weight: 900;
}

.score-summary {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.optimal-toggle {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--path-accent);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
}

.optimal-toggle:hover,
.optimal-toggle:focus-visible {
  border-color: var(--path-accent);
  background: var(--path-accent-soft);
}

.optimal-panel {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.duel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin-top: 24px;
}

.duel-card {
  min-height: 130px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--path-soft);
}

.target-card {
  border-color: var(--path-accent);
  background: var(--path-accent-soft);
}

.hero-card-content {
  display: grid;
  align-content: center;
  min-height: 92px;
  gap: 8px;
}

.hero-card-label,
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-card-content strong {
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.05;
}

.role-chip {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-arrow {
  color: var(--path-accent);
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
}

.game-status {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--line);
  background: var(--path-soft);
  color: var(--muted);
  font-size: 14px;
}

.game-status.success {
  border-color: var(--path-accent);
  background: var(--path-accent-soft);
  color: var(--ink);
}

.game-status.warning {
  border-color: #ad7a15;
  background: #fff7df;
  color: #664a0d;
}

.game-status.error {
  border-color: #b44a43;
  background: #fff0ee;
  color: #762d29;
}

.path-section {
  margin-top: 28px;
}

.path-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 42px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.path-item {
  position: relative;
  width: 148px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-weight: 850;
}

.path-item.is-target {
  border-color: var(--path-accent);
  background: var(--path-accent-soft);
}

.path-arrow {
  position: absolute;
  top: 50%;
  right: -34px;
  color: var(--path-accent);
  font-size: 22px;
  font-weight: 900;
  transform: translateY(-50%);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.choice-card {
  display: grid;
  gap: 7px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.link-effect {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.link-effect strong {
  color: var(--path-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
}

.full-link-effect {
  position: relative;
  width: 100%;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  cursor: help;
}

.full-link-effect > span:not(.effect-popover) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.full-link-effect:focus-visible {
  outline: 2px solid var(--path-accent);
  outline-offset: 3px;
}

.effect-popover {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: calc(100% + 8px);
  display: none;
  width: min(360px, 70vw);
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--path-accent);
  background: #ffffff;
  box-shadow: 0 10px 24px rgb(24 35 29 / 14%);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.effect-detail:hover .effect-popover,
.effect-detail:focus .effect-popover,
.effect-detail:focus-within .effect-popover {
  display: block;
}

.choice-card:hover,
.choice-card:focus-visible {
  border-color: var(--path-accent);
  background: var(--path-accent-soft);
  transform: translateY(-1px);
}

.choice-card:focus-visible,
.game-actions button:focus-visible,
.header-actions a:focus-visible,
.optimal-toggle:focus-visible,
.mini-game-mode:focus-visible,
.slot-remove:focus-visible,
.complete-team-candidate:focus-visible {
  outline: 3px solid rgb(11 110 79 / 28%);
  outline-offset: 2px;
}

.completion-panel {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--path-accent);
  background: var(--path-accent-soft);
}

.completion-panel p {
  margin: 8px 0;
  color: var(--muted);
}

.completion-rating {
  color: var(--path-accent);
}

.complete-effects-heading {
  display: block;
  margin-top: 16px;
  color: var(--ink);
  font-size: 13px;
}

.complete-effects-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.complete-effect-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgb(11 110 79 / 20%);
  background: rgb(255 255 255 / 70%);
  font-size: 12px;
  line-height: 1.35;
}

.complete-effect-item strong {
  color: var(--path-accent);
  font-size: 11px;
}

.complete-effect-item span {
  color: var(--muted);
}

.game-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 28px;
}

.game-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

@media (max-width: 700px) {
  .path-game-shell {
    width: min(100% - 20px, 1380px);
    margin-top: 16px;
  }

  .path-intro,
  .puzzle-panel,
  .complete-team-panel,
  .guess-hero-panel {
    padding: 16px;
  }

  .mini-game-mode-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mini-game-mode {
    padding: 0 8px;
  }

  .path-intro {
    display: block;
  }

  .score-summary {
    justify-items: start;
  }

  .direction-note {
    margin-top: 18px;
  }

  .complete-team-metrics {
    justify-items: start;
    margin-top: 18px;
    text-align: left;
  }

  .guess-hero-metrics {
    justify-items: start;
    margin-top: 18px;
    text-align: left;
  }

  .guess-hero-progress-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .complete-team-progress-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .complete-team-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .complete-team-candidates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .complete-effects-list {
    grid-template-columns: 1fr;
  }

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

  .guess-hero-search {
    width: 100%;
  }

  .complete-team-search-label {
    display: none;
  }

  .complete-team-search {
    width: 100%;
  }

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

  .route-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .path-list {
    display: grid;
    gap: 12px;
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .path-item {
    width: auto;
    min-width: 0;
  }

  .path-arrow {
    top: auto;
    right: auto;
    bottom: -23px;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
  }

  .effect-popover {
    position: static;
    width: auto;
    margin-top: 8px;
    box-shadow: none;
  }

  .effect-detail:focus .effect-popover,
  .effect-detail:focus-within .effect-popover {
    display: block;
  }

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

  .game-actions .primary-action {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .game-actions .secondary-action {
    grid-row: 2;
  }
}
