/* /css/GroupedXChainLesson.css
// ==========================================================
// Sudoku Paradise — Grouped X-Chain Interactive Lesson
// ----------------------------------------------------------
// Extends the shared lesson language established by
// XYChainLesson.css and adds the grouped candidate board.
// ========================================================== */

.grouped-definition-grid,
.group-state-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

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

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

.grouped-definition-grid article,
.group-state-grid article {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 11px;
  background: #f7fbfb;
}

.grouped-definition-grid h3,
.group-state-grid h3 {
  margin: 0 0 0.45rem;
  color: #174f55;
  font-size: 1.04rem;
}

.grouped-definition-grid p:last-child,
.group-state-grid p:last-child {
  margin-bottom: 0;
}

.single-node-card {
  border-color: rgba(66, 151, 92, 0.55) !important;
  background: #edf8ef !important;
}

.group-node-card {
  border-color: rgba(211, 154, 31, 0.68) !important;
  background: linear-gradient(135deg, #e2f2e3 0 50%, #fff2bd 50%) !important;
}

.victim-node-card {
  border-color: rgba(185, 71, 66, 0.55) !important;
  background: #fdebea !important;
}

.grouped-natural-figure img {
  width: min(100%, 331px);
}

.illustration-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1rem;
  margin-top: 0.9rem;
  color: #405d61;
  font-size: 0.9rem;
  font-weight: 750;
}

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

.legend-swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(35, 59, 62, 0.48);
  border-radius: 3px;
}

.legend-swatch.phase-a,
.key-swatch.gx-phase-a {
  border-color: #42975c;
  background: #abd4ab;
}

.legend-swatch.phase-b,
.key-swatch.gx-phase-b {
  border-color: #3c72a9;
  background: #abc7e9;
}

.legend-swatch.group,
.key-swatch.gx-group {
  border-color: #b7891f;
  background: linear-gradient(135deg, #abd4ab 0 50%, #ead68c 50%);
}

.legend-swatch.victim {
  border-color: #b94742;
  background: #e9abab;
}

.grouped-chain-notation {
  align-items: stretch;
}

.grouped-chain-notation span {
  justify-content: center;
  border: 2px solid transparent;
}

.grouped-chain-notation span small {
  color: #547074;
  font-size: 0.69rem;
  font-weight: 750;
}

.grouped-chain-notation .phase-a-token {
  border-color: #42975c;
  background: #e2f2e3;
}

.grouped-chain-notation .phase-b-token {
  border-color: #3c72a9;
  background: #e5eef9;
}

.grouped-chain-notation .group-token {
  border-color: #b7891f;
  background: linear-gradient(135deg, #e2f2e3 0 50%, #fff2bd 50%);
}

.grouped-chain-notation .weak-symbol {
  color: #707b7d;
}

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

.gx-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid #b5c1c3;
  border-bottom: 1px solid #b5c1c3;
  transition: box-shadow 160ms ease, filter 160ms ease;
}

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

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

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

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

.gx-cell .coordinate {
  position: absolute;
  top: 2px;
  left: 3px;
  color: #405d61;
  font-size: clamp(0.42rem, 1.15vw, 0.61rem);
  font-weight: 800;
}

.gx-cell .candidate-six {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(1.35rem, 4vw, 2.1rem);
  height: clamp(1.35rem, 4vw, 2.1rem);
  border: 2px solid currentColor;
  border-radius: 50%;
  color: #174f55;
  font-size: clamp(0.78rem, 2.5vw, 1.15rem);
  font-weight: 900;
  transition: color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.gx-cell.phase-a {
  background: #dff1e2;
  box-shadow: inset 0 0 0 3px #42975c;
}

.gx-cell.phase-b {
  background: #e3edf8;
  box-shadow: inset 0 0 0 3px #3c72a9;
}

.gx-cell.group-member {
  background: linear-gradient(135deg, #dff1e2 0 50%, #fff0b5 50%);
  box-shadow: inset 0 0 0 3px #b7891f;
}

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

.gx-cell .group-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  padding: 0.05rem 0.2rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.78);
  color: #7a5b11;
  font-size: clamp(0.36rem, 1vw, 0.52rem);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.gx-cell.is-reached {
  filter: saturate(1.2);
}

.gx-cell.is-active {
  box-shadow: inset 0 0 0 4px #0b6870, 0 0 0 3px rgba(11, 104, 112, 0.3);
  z-index: 1;
}

.gx-cell .candidate-six.is-true {
  color: #075f31;
  background: rgba(255, 255, 255, 0.72);
  transform: scale(1.16);
}

.gx-cell .candidate-six.is-false,
.gx-cell .candidate-six.is-eliminated {
  color: #a12824;
  opacity: 0.72;
  text-decoration: line-through 3px;
  transform: scale(0.9);
}

.gx-cell.victim .candidate-six.is-eliminated {
  opacity: 1;
}

.grouped-x-board .empty-cell {
  background: #ffffff;
}

.grouped-x-board .empty-cell:nth-child(even) {
  background: #fcfefe;
}

.group-meaning-card {
  background: linear-gradient(145deg, #fffaf0, #ffffff);
}

.group-state-grid article:first-child {
  border-color: rgba(66, 151, 92, 0.55);
  background: #edf8ef;
}

.group-state-grid article:last-child {
  border-color: rgba(60, 114, 169, 0.5);
  background: #edf3fa;
}

.node-example {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.36rem;
  margin: 0.75rem 0 1rem;
}

.node-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.38rem 0.5rem;
  border: 2px solid #64a2a8;
  border-radius: 8px;
  background: #ffffff;
  color: #174f55;
  font-size: 0.84rem;
  font-weight: 850;
}

.node-chip.grouped {
  border-color: #b7891f;
  background: linear-gradient(135deg, #edf8ef 0 50%, #fff6d5 50%);
}

.node-chip.broken {
  border-color: #b94742;
  background: #fdebea;
}

.node-link {
  min-width: 1.4rem;
  color: #547074;
  font-weight: 950;
  text-align: center;
}

.node-house-note {
  margin: 0 0 0.75rem;
  color: #547074;
  font-size: 0.86rem;
  font-weight: 750;
}

.grouped-spotting-grid article:nth-child(4) {
  border-color: rgba(211, 154, 31, 0.68);
  background: #fffaf0;
}

@media (max-width: 760px) {
  .grouped-definition-grid,
  .group-state-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 430px) {
  .grouped-chain-notation span {
    width: 100%;
  }

  .grouped-chain-notation b {
    width: 100%;
    text-align: center;
  }

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