/* /css/WWingLesson.css
// ==========================================================
// Sudoku Paradise — W-Wing Interactive Lesson
// ========================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: #243b3e;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.lesson-page-header {
  display: flex;
  justify-content: center;
  padding: 1.1rem 5rem 0.4rem;
}

.lesson-brand {
  color: #0b6870;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.lesson-page-main {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.7rem 0 2.5rem;
}

.lesson-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-width: 920px;
  margin: 0 auto 1rem;
  color: #547074;
  font-size: 0.84rem;
}

.lesson-breadcrumbs a,
.lesson-page-footer a {
  color: #0b6870;
  font-weight: 700;
}

.lesson-hero {
  max-width: 920px;
  margin: 0 auto 1.4rem;
  text-align: center;
}

.lesson-eyebrow,
.section-kicker {
  margin: 0 0 0.4rem;
  color: #0b6870;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.lesson-hero h1 {
  margin: 0;
  color: #174f55;
  font-size: clamp(2rem, 6vw, 3.35rem);
  line-height: 1.08;
}

.lesson-lead {
  max-width: 820px;
  margin: 1rem auto 0;
  font-size: clamp(1.03rem, 2.4vw, 1.18rem);
  line-height: 1.68;
}

.lesson-card {
  max-width: 920px;
  margin: 1.3rem auto;
  padding: clamp(1.15rem, 4vw, 1.8rem);
  border: 1px solid rgba(11, 104, 112, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(20, 55, 60, 0.1);
}

.lesson-card h2 {
  margin: 0 0 0.85rem;
  color: #0b6870;
  font-size: clamp(1.35rem, 3.5vw, 1.8rem);
  line-height: 1.25;
}

.lesson-card p,
.lesson-card li {
  line-height: 1.65;
}

.name-card,
.proof-workbench,
.lesson-cta {
  background: linear-gradient(145deg, #eef9f8, #ffffff);
}

.memory-rule,
.family-caution,
.shared-candidate-note,
.internal-link-note {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid #d39a1f;
  background: rgba(255, 246, 216, 0.8);
  color: #174f55;
}

.family-separation,
.term-comparison,
.wing-family-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.family-separation,
.term-comparison {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wing-family-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.family-separation article,
.term-comparison article,
.wing-family-grid article {
  padding: 1rem;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 11px;
  background: #f7fbfb;
}

.family-separation h3,
.term-comparison h3,
.wing-family-grid h3 {
  margin: 0 0 0.45rem;
  color: #174f55;
}

.family-separation p,
.term-comparison p,
.wing-family-grid p {
  margin-bottom: 0;
}

.featured-term {
  border-color: rgba(211, 154, 31, 0.65) !important;
  background: #fffaf0 !important;
}

.difference-grid,
.proof-road-grid,
.spotting-grid,
.case-anatomy {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

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

.proof-road-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.difference-grid article,
.proof-road-grid article,
.spotting-grid article,
.case-anatomy article {
  padding: 1rem;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 11px;
  background: #f7fbfb;
}

.difference-grid h3,
.proof-road-grid h3,
.spotting-grid h3,
.case-anatomy h3 {
  margin: 0 0 0.45rem;
  color: #174f55;
}

.difference-grid p,
.proof-road-grid p,
.spotting-grid p,
.case-anatomy p {
  margin-bottom: 0;
}

.w-difference {
  border-color: rgba(211, 154, 31, 0.65) !important;
  background: #fffaf0 !important;
}

.trivalue-demonstration {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 150px;
  aspect-ratio: 1;
  margin: 1.25rem auto 0.75rem;
  border: 3px solid #4b5e61;
  background: #fff3bd;
}

.trivalue-demonstration .candidate-token {
  align-self: center;
}

.term-abbreviation {
  margin: 0 0 0.25rem;
  color: #0b6870;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.bvc-demonstration {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 116px;
  aspect-ratio: 1;
  margin: 1.25rem auto 0.75rem;
  border: 3px solid #4b5e61;
  background: #fff9dc;
}

.candidate-token {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #075f68;
  font-size: 1.35rem;
  font-weight: 900;
}

.role-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.role-cards article {
  padding: 1rem;
  border: 2px solid transparent;
  border-radius: 11px;
  text-align: center;
}

.role-cards h3 {
  margin: 0.2rem 0 0.65rem;
}

.role-name {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pivot-role {
  border-color: #d39a1f !important;
  background: #fff6d8;
}

.pincer-a-role {
  border-color: #2588a3 !important;
  background: #e2f4f8;
}

.pincer-b-role {
  border-color: #42975c !important;
  background: #e4f5e8;
}

.role-pair {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

.role-pair span,
.pair-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
}

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

.wing-a-role {
  border-color: #2588a3 !important;
  background: #e2f4f8;
}

.wing-b-role {
  border-color: #42975c !important;
  background: #e4f5e8;
}

.connector-role {
  border-color: #d39a1f !important;
  background: #fff6d8;
}

.victim-role {
  border-color: #b94742 !important;
  background: #fdebea;
}

.strong-link-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 1.1rem 0;
  padding: 1rem;
  border-radius: 10px;
  background: #eef5f5;
}

.strong-link-display .endpoint {
  padding: 0.55rem 0.75rem;
  border: 2px solid #d39a1f;
  border-radius: 8px;
  background: #fffaf0;
  color: #174f55;
  font-weight: 850;
}

.strong-link-display .link-mark {
  color: #1976a3;
  font-size: 1.2rem;
  font-weight: 950;
}

.alternating-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 10px;
  background: #ffffff;
}

.chain-node {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: #eef5f5;
  color: #174f55;
  font-weight: 850;
}

.chain-link {
  min-width: 2.2rem;
  color: #547074;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.chain-link.strong {
  color: #1976a3;
}

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

.w-case-figure img {
  width: min(100%, 620px);
}

.case-anatomy .wing-a-item {
  border-left: 4px solid #2588a3;
}

.case-anatomy .wing-b-item {
  border-left: 4px solid #42975c;
}

.case-anatomy .connector-item {
  border-left: 4px solid #d39a1f;
}

.case-anatomy .victim-item {
  border-left: 4px solid #b94742;
}

code {
  color: #075f68;
  font-weight: 800;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(280px, 480px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  margin-top: 1.1rem;
}

.w-wing-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid #43585b;
  background: #ffffff;
}

.w-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-right: 1px solid #b5c1c3;
  border-bottom: 1px solid #b5c1c3;
  font-size: clamp(0.66rem, 2vw, 0.95rem);
}

.w-cell:nth-child(9n + 3),
.w-cell:nth-child(9n + 6) {
  border-right: 3px solid #43585b;
}

.w-cell:nth-child(n + 19):nth-child(-n + 27),
.w-cell:nth-child(n + 46):nth-child(-n + 54) {
  border-bottom: 3px solid #43585b;
}

.w-cell:nth-child(9n) {
  border-right: 0;
}

.w-cell:nth-child(n + 73) {
  border-bottom: 0;
}

.w-cell .coordinate {
  position: absolute;
  top: 2px;
  left: 3px;
  color: #5c7377;
  font-size: clamp(0.42rem, 1.2vw, 0.62rem);
  font-weight: 750;
}

.w-cell .cell-candidates {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.55rem 0.1rem 0.1rem;
}

.w-cell .digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15em;
  color: #1a6269;
  font-weight: 900;
  transition: transform 160ms ease, color 160ms ease, opacity 160ms ease;
}

.w-cell.connector-a,
.w-cell.connector-b {
  background: #fff3bd;
  box-shadow: inset 0 0 0 3px #d39a1f;
}

.w-cell.wing-a {
  background: #d9f0f6;
  box-shadow: inset 0 0 0 3px #2588a3;
}

.w-cell.wing-b {
  background: #ddf2e2;
  box-shadow: inset 0 0 0 3px #42975c;
}

.w-cell.victim {
  background: #f9dedd;
  box-shadow: inset 0 0 0 3px #b94742;
}

.w-cell .digit.is-chosen,
.w-cell .digit.is-forced {
  color: #8b5200;
  font-size: 1.22em;
  transform: scale(1.18);
}

.w-cell .digit.is-eliminated {
  color: #a12824;
  opacity: 0.72;
  text-decoration: line-through 3px;
  transform: scale(0.9);
}

.board-key p {
  margin: 0 0 0.75rem;
}

.key-swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.4rem;
  border: 2px solid;
  vertical-align: -0.12rem;
}

.key-swatch.connector {
  border-color: #d39a1f;
  background: #fff3bd;
}

.key-swatch.wing-a {
  border-color: #2588a3;
  background: #d9f0f6;
}

.key-swatch.wing-b {
  border-color: #42975c;
  background: #ddf2e2;
}

.key-swatch.victim {
  border-color: #b94742;
  background: #f9dedd;
}

.board-observation {
  padding: 0.8rem;
  border-radius: 9px;
  background: #eef5f5;
}

.case-study {
  background: linear-gradient(145deg, #f8fcfb, #ffffff);
}

.case-figure-single {
  margin: 1.2rem 0 0;
  text-align: center;
}

.case-figure-single img {
  display: block;
  width: min(100%, 480px);
  height: auto;
  margin: 0 auto;
  border: 3px solid #566164;
  background: #ffffff;
  image-rendering: auto;
}

.case-figure-single figcaption {
  max-width: 720px;
  margin: 0.7rem auto 0;
  color: #547074;
  font-size: 0.94rem;
  line-height: 1.55;
}

.three-road-summary {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid #b94742;
  background: #fdebea;
  color: #762824;
  font-weight: 750;
}

.proof-road-grid article.is-active {
  border-color: #23864c;
  background: #dff4e5;
  box-shadow: 0 0 0 2px rgba(35, 134, 76, 0.14);
}

.proof-road-grid .road-status {
  color: #547074;
  font-size: 0.86rem;
  font-weight: 800;
}

.proof-road-grid article.is-complete .road-status {
  color: #185f38;
}

.geometry-emphasis {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(185, 71, 66, 0.32);
  border-radius: 9px;
  background: #fff4f3;
  color: #762824;
  font-weight: 750;
}

.comparison-note {
  margin-top: 0.8rem;
  color: #547074;
  font-size: 0.92rem;
}

.case-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.15rem;
}

.case-comparison figure {
  margin: 0;
  text-align: center;
}

.case-comparison img {
  display: block;
  width: min(100%, 330px);
  height: auto;
  margin: 0 auto;
  border: 3px solid #566164;
  background: #ffffff;
}

.case-comparison figcaption {
  max-width: 360px;
  margin: 0.6rem auto 0;
  color: #547074;
  font-size: 0.9rem;
  line-height: 1.5;
}

.case-filter {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 11px;
  background: #f7fbfb;
}

.case-filter h3,
.case-proof h3 {
  margin-top: 0;
  color: #174f55;
}

.case-filter ol {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.case-proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.case-proof article {
  padding: 1rem;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 11px;
  background: #ffffff;
}

.case-proof p {
  margin-bottom: 0;
}

.case-conclusion {
  padding: 0.85rem 1rem;
  border-left: 4px solid #b94742;
  background: #fdebea;
  color: #762824;
  font-weight: 750;
}

.proof-buttons,
.victim-choices,
.structure-actions,
.cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.proof-buttons button,
.victim-choices button,
.structure-actions button,
.cta-links a {
  padding: 0.68rem 0.9rem;
  border: 1px solid #0b6870;
  border-radius: 7px;
  background: #ffffff;
  color: #075f68;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.proof-buttons button:hover,
.proof-buttons button:focus-visible,
.victim-choices button:hover,
.victim-choices button:focus-visible,
.structure-actions button:hover,
.structure-actions button:focus-visible,
.cta-links a:hover,
.cta-links a:focus-visible {
  background: #e7f5f4;
}

.proof-buttons button.is-tested,
.victim-choices button.is-correct,
.structure-actions button.is-correct {
  border-color: #23864c;
  background: #dff4e5;
  color: #185f38;
}

.victim-choices button.is-wrong,
.structure-actions button.is-wrong {
  border-color: #b94742;
  background: #fbe0df;
  color: #932e29;
}

.proof-result {
  min-height: 5.4rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 9px;
  background: #eef5f5;
  line-height: 1.6;
}

.proof-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.proof-progress span {
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  background: #e8eeee;
  color: #547074;
  font-size: 0.86rem;
  font-weight: 750;
}

.proof-progress span.is-complete {
  background: #dff4e5;
  color: #185f38;
}

.proof-conclusion {
  padding: 0.85rem 1rem;
  border-left: 4px solid #b94742;
  background: #fdebea;
  color: #762824;
}

.victim-feedback {
  min-height: 3.2rem;
  margin-bottom: 0;
  padding: 0.8rem 0;
  font-weight: 750;
}

.victim-feedback.success,
.structure-feedback.success {
  color: #185f38;
}

.victim-feedback.error,
.structure-feedback.error {
  color: #932e29;
}

.structure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.structure-card {
  padding: 1rem;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 11px;
  background: #f7fbfb;
}

.structure-card h3 {
  margin: 0 0 0.7rem;
  color: #174f55;
}

.pair-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.pair-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.35rem 0.48rem;
  border-radius: 8px;
  background: #ffffff;
  color: #174f55;
  font-weight: 800;
}

.pair-chip.pivot-pair {
  border: 2px solid #d39a1f;
}

.pair-chip.pincer-pair {
  border: 2px solid #64a2a8;
}

.structure-feedback {
  min-height: 3.2rem;
  margin: 0.7rem 0 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.structure-score {
  margin-bottom: 0;
  color: #0b6870;
  font-weight: 850;
  text-align: right;
}

.formal-pattern {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.1rem 0;
  padding: 1rem;
  border-radius: 10px;
  background: #eef5f5;
}

.formal-pattern span:nth-child(odd) {
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(11, 104, 112, 0.35);
  border-radius: 8px;
  background: #ffffff;
}

.formal-result {
  color: #174f55;
  font-size: 1.08rem;
  font-weight: 850;
  text-align: center;
}

.notation-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 0.7rem;
  border: 1px solid #bfd0d2;
  text-align: left;
}

thead th {
  background: #e8f3f3;
  color: #174f55;
}

.near-misses ul {
  padding-left: 1.25rem;
}

.lesson-faq details {
  border-top: 1px solid rgba(11, 104, 112, 0.2);
  padding: 0.85rem 0;
}

.lesson-faq summary {
  color: #174f55;
  font-weight: 800;
  cursor: pointer;
}

.lesson-faq details p {
  margin-bottom: 0;
}

.cta-links .primary {
  background: #0b6870;
  color: #ffffff;
}

.lesson-page-footer {
  padding: 1rem;
  color: #547074;
  text-align: center;
}

@media (max-width: 760px) {
  .family-separation,
  .term-comparison,
  .role-cards,
  .w-role-grid,
  .board-layout,
  .case-comparison,
  .case-proof,
  .structure-grid,
  .wing-family-grid,
  .difference-grid,
  .proof-road-grid,
  .two-road,
  .spotting-grid,
  .case-anatomy {
    grid-template-columns: 1fr;
  }

  .w-wing-board {
    width: min(100%, 480px);
    margin: 0 auto;
  }

  .lesson-page-header {
    padding-left: 6rem;
  }
}

@media (max-width: 430px) {
  .lesson-page-main {
    width: min(100% - 1rem, 1040px);
  }

  .lesson-card {
    padding: 1rem;
  }

  .proof-buttons button,
  .victim-choices button,
  .structure-actions button,
  .cta-links a {
    width: 100%;
    text-align: center;
  }

  .w-cell .coordinate {
    display: none;
  }
}
