/* Reading surface: shared game CSS owns the header, palette and type scale. */
.rules-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.rules-page .skip-link {
  position: absolute;
  top: -100px;
  left: 14px;
  padding: 12px;
  background: #faf8f2;
  z-index: 1;
}
.rules-page .skip-link:focus {
  top: 12px;
}
.guide-main {
  flex: 1;
  font-size: var(--clue-size);
  line-height: 1.4;
}
.guide-main svg,
.guide-footer svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.back-link:hover,
.guide-footer a:hover {
  text-decoration: underline;
}
.mobile-back-link {
  display: none;
}
@media (max-width: 650px) {
  .rules-page .rules-header .game-toolbar {
    justify-content: space-between;
  }
  .mobile-back-link {
    display: inline-flex;
    margin-top: 0;
    white-space: nowrap;
    font-size: 12px;
  }
  .guide-main > .back-link {
    display: none;
  }
}
.introduction {
  margin: 12px 0 24px;
}
.introduction h1 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  text-wrap: balance;
}
.introduction p {
  margin: 0;
  max-width: 70ch;
}
.example-board {
  margin: 0;
  background: #fcfbf7;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.example-board figcaption {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.example-rows {
  list-style: none;
  padding: 0;
  margin: 0;
}
.example-rows li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 94px;
  padding: 12px 56px 12px 16px;
}
.example-rows li + li {
  border-top: 1px solid var(--line);
}
.row-number {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #eeece4;
  font-size: 27px;
  font-weight: 700;
}
.example-rows p {
  margin: 0 0 0 18px;
  font-size: var(--clue-size);
  line-height: 1.4;
}
.example-word {
  display: flex;
  gap: 7px;
}
.example-word > span,
.sample {
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-weight: 700;
}
.example-word > span {
  width: 70px;
  height: 68px;
  font-size: var(--tile-size);
}
.example-word > .changed,
.sample.changed {
  background: var(--changed-green);
}
.sample.revealed {
  background: #e6b84b;
  color: #263224;
}
.color-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  margin: 20px 0 28px;
  padding: 0;
  font-size: 15px;
}
.color-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sample {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  font-size: 20px;
}
.quick-rules,
.more-rules {
  width: 100%;
  max-width: 70ch;
  margin-inline: auto;
}
.quick-rule {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.quick-rule h2,
.more-rules h2 {
  font-size: 20px;
  margin: 0 0 6px;
  line-height: 1.3;
}
.quick-rule p {
  margin: 0;
}
.rule-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e9eee6;
  display: grid;
  place-items: center;
}
.rule-icon svg {
  width: 24px;
  height: 24px;
}
.play-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 780px;
  min-height: 54px;
  padding: 13px 16px;
  margin: 24px auto;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}
.play-link:hover {
  background: #194a35;
}
.guide-footer {
  width: calc(100% - 48px);
  max-width: 1118px;
  margin: auto auto 0;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  color: var(--muted);
}
.guide-footer a {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.guide-footer svg {
  width: 13px;
  height: 13px;
}
.more-rules {
  margin-top: 32px;
  margin-bottom: 24px;
}
.more-rules details {
  border-bottom: 1px solid var(--line);
}
.more-rules details:first-child {
  border-top: 1px solid var(--line);
}
.more-rules summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
}
.more-rules summary::-webkit-details-marker {
  display: none;
}
.more-rules summary:hover {
  color: var(--green);
}
.more-rules summary:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
.more-rules details[open] > summary svg {
  transform: rotate(180deg);
}
.more-rules h2 {
  margin: 0;
  text-wrap: balance;
}
.more-rules p {
  margin: 8px 0;
  line-height: 1.6;
}
.more-rules details > p:last-child {
  margin-bottom: 20px;
}
@media (min-width: 651px) and (max-width: 1100px) {
  .example-rows li {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 16px;
    padding-right: 44px;
  }
  .row-number {
    width: 38px;
    height: 38px;
    font-size: 21px;
  }
  .example-rows p {
    margin-left: 0;
  }
  .example-word {
    gap: 6px;
  }
  .example-word > span {
    width: 46px;
    height: 48px;
  }
}
@media (max-width: 650px) {
  .back-link {
    font-size: 12px;
    margin-top: 4px;
  }
  .introduction {
    margin: 8px 0 18px;
  }
  .introduction h1 {
    font-size: 22px;
  }
  .example-board figcaption {
    padding: 10px;
    font-size: 11px;
  }
  .example-rows li {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 6px 10px;
    padding: 9px 10px;
    min-height: 78px;
  }
  .row-number {
    width: 30px;
    height: 30px;
    font-size: 17px;
    grid-row: span 2;
  }
  .example-rows p {
    margin-left: 0;
  }
  .example-word {
    grid-column: 2;
    gap: 5px;
  }
  .example-word > span {
    width: 36px;
    height: 35px;
    border-radius: 5px;
  }
  .color-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0 24px;
    font-size: 11px;
  }
  .color-legend li {
    gap: 6px;
    line-height: 1.3;
  }
  .sample {
    width: 27px;
    height: 29px;
    font-size: 17px;
    border-radius: 5px;
  }
  .quick-rule {
    gap: 12px;
  }
  .quick-rule h2,
  .more-rules h2 {
    font-size: 16px;
  }
  .quick-rule br {
    display: none;
  }
  .play-link {
    min-height: 44px;
    font-size: 12px;
    padding: 9px 7px;
  }
  .guide-footer {
    width: calc(100% - 28px);
  }
}
@media (max-width: 650px) and (max-height: 740px) {
  .example-rows li {
    min-height: 64px;
    padding-block: 4px;
  }
  .example-word > span {
    height: 30px;
  }
}
