/* Guides: the article list and the small board diagrams inside articles.
   Everything else comes from /assets/base.css (.doc). */

.doc--article { max-width: 760px; }
.doc--article p, .doc--article li { font-size: 16px; line-height: 1.65; }
.doc--article h2 { font-size: 20px; margin-top: 34px; }
.doc--article h3 { font-size: 16px; }

.article-meta {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 22px;
}

.lede {
  font-size: 18px !important;
  line-height: 1.6;
  color: var(--text);
}

/* ------------------------------ guide list ----------------------------- */

.guide-list {
  list-style: none;
  padding: 0 !important;
  margin: 20px 0 0;
  display: grid;
  gap: 14px;
}

.guide-list li { margin: 0; }

.guide-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}

.guide-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.guide-card__game { font-size: 13px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.guide-card__title { display: block; font-size: 18px; font-weight: 700; margin: 4px 0 6px; }
.guide-card__text { display: block; color: var(--text-dim); font-size: 15px; line-height: 1.5; }

/* -------------------------------- figures ------------------------------ */

.figure {
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
}

.figure figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

.board {
  display: grid;
  gap: 2px;
  width: max-content;
  margin: 0 auto;
}

.board span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  border-radius: 4px;
}

/* Minesweeper */
.board--mines span { background: var(--peer); color: var(--text); }
.board--mines .c { background: var(--border-strong); }
.board--mines .s { background: var(--border-strong); box-shadow: inset 0 0 0 3px var(--ok); }
.board--mines .m { background: var(--border-strong); box-shadow: inset 0 0 0 3px var(--error); }
.board--mines .q { color: var(--text-dim); font-weight: 400; }
.board--mines .n1 { color: #3757e8; }
.board--mines .n2 { color: #17a673; }
.board--mines .n3 { color: #e0435b; }

/* Sudoku: thick lines between the 3x3 boxes */
.board--sudoku { gap: 0; border: 2px solid var(--text); border-radius: 4px; }
.board--sudoku span {
  width: 32px;
  height: 32px;
  border-radius: 0;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--given);
}
.board--sudoku span.br { border-right: 2px solid var(--text); }
.board--sudoku span.bb { border-bottom: 2px solid var(--text); }
.board--sudoku span.er { border-right: 0; }
.board--sudoku span.eb { border-bottom: 0; }
.board--sudoku .x { background: var(--same); color: var(--entry); }
.board--sudoku .t { background: var(--accent); color: var(--accent-text); }
.board--sudoku .o { background: var(--error-soft); color: var(--error); }
.board--sudoku .h { background: var(--highlight); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
}
.legend i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  vertical-align: -2px;
  margin-right: 6px;
}

/* --------------------------------- tables ------------------------------ */

.table-wrap { overflow-x: auto; margin: 18px 0; }
.data {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
.data th, .data td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}
.data th:first-child, .data td:first-child { text-align: left; }
.data th { color: var(--text-dim); font-weight: 600; }

/* The game an article is about, right under the lede: its picture and a way in. */
.play-card {
  margin: 4px 0 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.play-card img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.play-card__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
}
.doc--article .play-card__text { color: var(--text-dim); font-size: 14px; line-height: 1.4; }
.play-card__text strong { color: var(--text); }

/* A bar inside a table cell; the width is set inline. */
.bar {
  display: inline-block;
  max-width: 120px;
  min-width: 4px;
  height: 10px;
  border-radius: 5px;
  background: var(--accent);
  vertical-align: middle;
}
.data td:has(.bar) { width: 130px; }

.figure svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }

.related {
  margin-top: 34px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.related p { margin: 0 0 6px; }
.related p:last-child { margin: 0; }

@media (max-width: 480px) {
  .board span { width: 28px; height: 28px; font-size: 14px; }
  .board--sudoku span { width: 30px; height: 30px; }
}
