/* /css/LockedCandidatesLesson.css
// ==========================================================
// Sudoku Paradise — Locked Candidates 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 {
  color: #0b6870;
  font-weight: 700;
}

.lesson-hero {
  max-width: 900px;
  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;
}

.direction-rule,
.lesson-explanation,
.practice-workbench,
.coexistence-section,
.comparison-section,
.near-miss-section,
.boundary-section,
.lesson-faq,
.lesson-cta {
  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.93);
  box-shadow: 0 8px 22px rgba(20, 55, 60, 0.1);
}

.direction-rule h2,
.lesson-explanation h2,
.practice-workbench h2,
.coexistence-section h2,
.comparison-section h2,
.near-miss-section h2,
.boundary-section h2,
.lesson-faq h2,
.lesson-cta h2 {
  margin: 0 0 0.85rem;
  color: #0b6870;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  line-height: 1.25;
}

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

.direction-card {
  padding: 1.1rem;
  border: 1px solid rgba(11, 104, 112, 0.25);
  border-radius: 12px;
}

.pointing-card {
  background: rgba(224, 246, 243, 0.78);
}

.claiming-card {
  background: rgba(255, 244, 208, 0.72);
}

.direction-label {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #0b6870;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.claiming-card .direction-label {
  background: #a46900;
}

.direction-formula {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.8rem 0 0.55rem;
  color: #174f55;
  font-size: 1.18rem;
}

.direction-formula span {
  color: #d07d00;
  font-size: 1.4rem;
}

.direction-card > p:last-child,
.lesson-explanation p,
.coexistence-copy p,
.coexistence-copy li,
.comparison-section p,
.near-miss-section > p,
.boundary-section p,
.boundary-section li,
.lesson-faq p,
.lesson-cta p {
  line-height: 1.65;
}

.direction-card > p:last-child {
  margin-bottom: 0;
}

.memory-rule {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1.5rem;
  margin: 1rem 0 0;
  padding: 0.75rem;
  border-left: 4px solid #0b6870;
  background: rgba(239, 249, 248, 0.82);
  color: #174f55;
}

.lesson-explanation p {
  margin: 0.55rem 0;
}

.terminology-note {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-left: 4px solid #d39a1f;
  background: rgba(255, 244, 208, 0.72);
  line-height: 1.55;
}

.workbench-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

#nextExerciseButton,
.practice-actions button,
.classification-choices button {
  appearance: none;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

#nextExerciseButton {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(11, 104, 112, 0.38);
  background: #ffffff;
  color: #0b6870;
}

.exercise-title {
  margin: 0.35rem 0;
  color: #174f55;
  font-size: 1.12rem;
}

.exercise-prompt,
.candidate-map-note {
  margin: 0.4rem 0;
  line-height: 1.55;
}

.candidate-map-note {
  color: #547074;
  font-size: 0.88rem;
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(100%, 34rem);
  aspect-ratio: 1;
  margin: 1rem auto;
  border: 3px solid #34494c;
  background: #ffffff;
}

.candidate-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid #aeb9ba;
  border-bottom: 1px solid #aeb9ba;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.97);
}

button.candidate-cell {
  color: #0b6870;
  cursor: pointer;
  font: inherit;
}

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

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

.candidate-cell:nth-child(9n + 3),
.candidate-cell:nth-child(9n + 6) {
  border-right: 2px solid #526467;
}

.candidate-cell:nth-child(n + 19):nth-child(-n + 27),
.candidate-cell:nth-child(n + 46):nth-child(-n + 54) {
  border-bottom: 2px solid #526467;
}

.candidate-digit {
  font-size: clamp(0.9rem, 3.8vw, 1.35rem);
  font-weight: 850;
}

.candidate-cell.is-source {
  background: #ccefea;
  color: #075a62;
  box-shadow: inset 0 0 0 3px #0b6870;
  cursor: default;
  opacity: 1;
}

button.candidate-cell:not(.is-source):hover,
button.candidate-cell:not(.is-source):focus-visible {
  z-index: 2;
  background: #edf9f7;
  outline: 3px solid #0b6870;
  outline-offset: -3px;
}

.candidate-cell.is-selected {
  background: #dff4f1;
  box-shadow: inset 0 0 0 3px #0b6870;
}

.candidate-cell.is-correct {
  background: #d9f2dd;
  color: #1f6d31;
  box-shadow: inset 0 0 0 3px #27813a;
}

.candidate-cell.is-missed {
  background: #fff0bc;
  color: #8b5e00;
  box-shadow: inset 0 0 0 3px #c48a0b;
}

.candidate-cell.is-wrong {
  background: #f8d9d9;
  color: #8f2828;
  box-shadow: inset 0 0 0 3px #a93434;
}

.practice-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  max-width: 34rem;
  margin: 0.75rem auto;
  color: #486467;
  font-size: 0.88rem;
}

.practice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.practice-actions button {
  min-height: 42px;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(11, 104, 112, 0.38);
  background: #ffffff;
  color: #0b6870;
}

.practice-actions .primary-action {
  border-color: #0b6870;
  background: #0b6870;
  color: #ffffff;
}

.practice-actions button:hover,
.practice-actions button:focus-visible,
#nextExerciseButton:hover,
#nextExerciseButton:focus-visible {
  border-color: #084f56;
  outline: 2px solid rgba(11, 104, 112, 0.22);
}

.practice-result {
  max-width: 44rem;
  min-height: 3.2rem;
  margin: 1rem auto 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid #0b6870;
  background: rgba(231, 247, 244, 0.82);
  line-height: 1.55;
}

.practice-result.is-success,
.classification-result.is-success {
  border-color: #27813a;
  background: rgba(224, 246, 227, 0.86);
}

.practice-result.is-error,
.classification-result.is-error {
  border-color: #a93434;
  background: rgba(250, 226, 226, 0.86);
}

.practice-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1rem;
  margin-top: 0.85rem;
  color: #486467;
  font-size: 0.8rem;
}

.practice-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid rgba(20, 55, 60, 0.28);
  border-radius: 3px;
}

.legend-swatch.source {
  background: #ccefea;
}

.legend-swatch.selected {
  background: #dff4f1;
}

.legend-swatch.correct {
  background: #d9f2dd;
}

.legend-swatch.missed {
  background: #fff0bc;
}

.legend-swatch.wrong {
  background: #f8d9d9;
}

.coexistence-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
  align-items: center;
  gap: 1.5rem;
}

.coexistence-copy ol {
  margin: 1rem 0 0;
  padding-left: 1.35rem;
}

.coexistence-copy li + li {
  margin-top: 0.55rem;
}

code {
  padding: 0.08rem 0.25rem;
  border-radius: 4px;
  background: rgba(11, 104, 112, 0.09);
  color: #174f55;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
}

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

.coexistence-figure img {
  display: block;
  width: min(100%, 350px);
  height: auto;
  margin: 0 auto;
  border: 2px solid #526467;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(20, 55, 60, 0.14);
}

.coexistence-figure figcaption {
  margin-top: 0.65rem;
  color: #547074;
  font-size: 0.83rem;
  line-height: 1.45;
}

.comparison-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 10px;
}

.comparison-section table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 0.92rem;
}

.comparison-section th,
.comparison-section td {
  padding: 0.78rem;
  border-right: 1px solid rgba(11, 104, 112, 0.14);
  border-bottom: 1px solid rgba(11, 104, 112, 0.14);
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
}

.comparison-section th:last-child,
.comparison-section td:last-child {
  border-right: 0;
}

.comparison-section tbody tr:last-child th,
.comparison-section tbody tr:last-child td {
  border-bottom: 0;
}

.comparison-section thead th {
  background: #0b6870;
  color: #ffffff;
}

.comparison-section tbody th {
  background: rgba(232, 247, 245, 0.78);
  color: #174f55;
}

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

.classification-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid rgba(11, 104, 112, 0.2);
  border-radius: 10px;
  background: rgba(246, 251, 250, 0.86);
}

.classification-card h3 {
  margin: 0;
  color: #174f55;
  font-size: 1.05rem;
}

.classification-card > p {
  line-height: 1.55;
}

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

.classification-choices button {
  min-height: 39px;
  padding: 0.45rem;
  border: 1px solid rgba(11, 104, 112, 0.32);
  background: #ffffff;
  color: #174f55;
}

.classification-choices button:hover,
.classification-choices button:focus-visible {
  border-color: #0b6870;
  outline: 2px solid rgba(11, 104, 112, 0.2);
}

.classification-choices button.is-correct {
  border-color: #27813a;
  background: #d9f2dd;
  color: #1f6d31;
}

.classification-choices button.is-wrong {
  border-color: #a93434;
  background: #f8d9d9;
  color: #8f2828;
}

.classification-result {
  min-height: 2.4rem;
  margin: 0.7rem 0 0 !important;
  padding: 0.45rem 0.6rem;
  border-left: 3px solid #0b6870;
  background: rgba(231, 247, 244, 0.7);
  font-size: 0.88rem;
}

.classification-explanation {
  margin-bottom: 0 !important;
  color: #486467;
  font-size: 0.88rem;
}

.boundary-section {
  display: flex;
  align-items: flex-start;
  gap: 1.15rem;
  border-color: rgba(211, 154, 31, 0.46);
  background:
    linear-gradient(145deg, rgba(255, 249, 230, 0.96), rgba(255, 255, 255, 0.96));
}

.boundary-badge {
  display: flex;
  flex: 0 0 3.2rem;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: #d39a1f;
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 850;
}

.boundary-section ul {
  padding-left: 1.3rem;
}

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

.lesson-faq details:last-child {
  border-bottom: 1px solid rgba(11, 104, 112, 0.17);
}

.lesson-faq summary {
  color: #174f55;
  cursor: pointer;
  font-weight: 750;
  line-height: 1.45;
}

.lesson-faq details p {
  margin: 0.65rem 0 0.1rem;
}

.lesson-cta {
  text-align: center;
}

.lesson-cta > p {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
}

.cta-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.cta-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.68rem 0.95rem;
  border: 1px solid rgba(11, 104, 112, 0.42);
  border-radius: 9px;
  background: #ffffff;
  color: #0b6870;
  font-weight: 750;
  text-decoration: none;
}

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

.lesson-page-footer {
  padding: 1rem;
  color: #486467;
  font-size: 0.9rem;
  text-align: center;
}

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

@media (max-width: 780px) {
  .lesson-page-header {
    padding-top: 3.6rem;
  }

  .coexistence-section,
  .classification-list {
    grid-template-columns: 1fr;
  }

  .coexistence-figure {
    order: -1;
  }
}

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

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

  .workbench-heading,
  .boundary-section {
    flex-direction: column;
  }

  .practice-actions button {
    flex: 1 1 calc(50% - 0.6rem);
  }
}

@media print {
  .site-menu-button,
  .site-drawer,
  .site-drawer-backdrop,
  .lesson-page-header,
  .lesson-breadcrumbs,
  .practice-workbench,
  .near-miss-section,
  .lesson-cta,
  .lesson-page-footer {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #111111;
  }

  .lesson-page-main {
    width: 100%;
    padding: 0;
  }

  .direction-rule,
  .lesson-explanation,
  .coexistence-section,
  .comparison-section,
  .boundary-section,
  .lesson-faq {
    break-inside: avoid;
    border-color: #8a8a8a;
    box-shadow: none;
  }
}
