/* Roomful Words' pages (/words/ on the hub) (tools/build_words.py): the home page, the set pages, the worksheets page and its
   printouts. Loaded after site.css and gamenight.css. The game's own pieces (boxes, keyboard, the daily puzzle, the TV
   and phone screens) are in words-game.css. */

.rw-page ul:not([class]), .rw-page ol.steps { padding-left: 1.3em; }
.rw-page ul:not([class]) li { margin: 6px 0; }
.rw-hero h1 { max-width: 16em; }
.rw-daily-box { margin: 26px 0 8px; padding: 16px 20px 18px; border: 2px solid rgba(255, 246, 229, 0.16); border-radius: 20px; background: var(--night); max-width: 40em; }
.rw-daily-box h2 { margin-top: 0; }
.rw-daily-box p { color: var(--paper-dim); }

/* ---------- Word lists on the set pages ---------- */
.rw-words { list-style: none; padding: 0; margin: 10px 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.rw-words li {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline;
  background: var(--night); border: 2px solid rgba(255, 246, 229, 0.12); border-radius: 12px; padding: 10px 12px;
}
.rw-words .emoji { grid-row: span 3; font-size: 1.5rem; line-height: 1; align-self: start; }
.rw-words strong { font-size: 1.15rem; letter-spacing: 0.02em; }
.rw-words .clue { grid-column: 2; color: var(--paper-dim); font-size: 0.95rem; }
.rw-words .fact { grid-column: 2; color: var(--muted); font-size: 0.85rem; margin-top: 3px; }
.rw-words li:not(:has(.emoji)) { grid-template-columns: 1fr; }
.rw-words li:not(:has(.emoji)) .clue, .rw-words li:not(:has(.emoji)) .fact { grid-column: 1; }
.rw-sheet-form { max-width: 34em; }

/* ---------- Worksheets: the on-screen preview ---------- */
.wsheet, .wkeys, .wlist {
  background: #fff; color: #111; border-radius: 12px; padding: 14px 16px; max-width: 680px; width: 100%; box-sizing: border-box;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
.wsheet header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wsheet-title { font-weight: 900; font-size: 1.05rem; letter-spacing: 0.03em; }
.wsheet-set { font-weight: 650; font-size: 0.9rem; color: #333; }
.wsheet-name { margin: 8px 0 2px; font-size: 0.95rem; }
.wsheet-help { margin: 0 0 6px; font-size: 0.85rem; color: #444; }
.wsheet-words { margin: 0; padding-left: 1.6em; display: grid; gap: 7px; }
.wsheet-words li { display: grid; gap: 4px; break-inside: avoid; }
.wsheet-clue { font-size: 0.92rem; line-height: 1.25; }
.wsheet-clue .e { margin-right: 6px; }
.wsheet-boxes { display: flex; flex-wrap: wrap; gap: 4px; }
.wsheet-boxes span {
  display: inline-grid; place-items: center; width: 1.7em; height: 1.9em; border: 1.5px solid #111; border-radius: 3px;
  font-weight: 800; font-size: 0.95rem;
}
.wsheet-boxes span.shown { background: #eee; }
.wsheet footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 0.72rem; color: #444; }
.wsheet-no { font-weight: 750; color: #111; letter-spacing: 0.04em; }
.wkeys h2, .wlist h2 { color: #111; font-size: 1.35rem; margin: 0 0 8px; }
.wkeys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; }
.wkey h3 { color: #111; font-size: 0.9rem; margin: 0 0 3px; }
.wkey ol { margin: 0; padding-left: 1.5em; font-size: 0.85rem; }
.wlist ol { margin: 0; padding-left: 1.6em; columns: 3; column-gap: 18px; font-size: 0.95rem; }
.wlist ol.many { columns: 4; }
.wlist li { break-inside: avoid; padding: 2px 0; }
.wlist-foot { margin: 10px 0 0; font-size: 0.72rem; color: #444; }
@media (max-width: 560px) {
  .wlist ol, .wlist ol.many { columns: 2; }
  .wsheet-boxes span { width: 1.5em; height: 1.7em; }
}

/* ---------- Printing: two worksheets to a US Letter page, then the answer keys; or the word list ---------- */
@media print {
  .rw-print .print-sheet { display: block; }
  body[data-print="list"] #sheets, body[data-print="list"] #keys, body:not([data-print="list"]) #list { display: none !important; }
  .wsheet {
    width: 7.7in; height: 4.85in; max-width: none; margin: 0 auto 0.3in; padding: 0.1in 0.15in; border-radius: 0; border: 1px dashed #999;
    display: flex; flex-direction: column; break-inside: avoid; page-break-inside: avoid; font-size: 10pt; overflow: hidden;
  }
  .wsheet:nth-child(2n) { margin-bottom: 0; break-after: page; page-break-after: always; }
  .wsheet:last-child { break-after: page; page-break-after: always; }
  .wsheet-title { font-size: 12pt; }
  .wsheet-words { flex: 1; gap: 0.03in; grid-template-columns: 1fr 1fr; column-gap: 0.3in; padding-left: 0.28in; }
  .wsheet-clue { font-size: 9pt; }
  .wsheet-boxes span { width: 0.24in; height: 0.27in; font-size: 10pt; border-radius: 2px; }
  .wsheet footer { margin-top: auto; font-size: 7pt; }
  .wkeys, .wlist { width: 7.7in; max-width: none; padding: 0; border-radius: 0; }
  .wkeys-grid { grid-template-columns: repeat(5, 1fr); gap: 0.12in 0.18in; }
  .wkey { break-inside: avoid; }
  .wkey ol { font-size: 9pt; }
  .wlist h2 { font-size: 18pt; }
  .wlist ol { font-size: 12pt; columns: 3; }
  .wlist ol.many { columns: 4; font-size: 11pt; }
}
