/* Written pages and tools (unlimited play, solver, how to play, FAQ, archive, per-day pages),
   and the readable text below the game on the home page. Same Apothecary Night tokens as
   theme.css; nothing here restyles the main game. */
.article { max-width: 780px; width: 100%; margin: 0 auto; padding: 28px 24px 64px; color: var(--text-2); font-size: 17px; line-height: 1.65; }
.article h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.12; color: var(--text); margin: 10px 0 16px; }
.article h2 { font-size: 26px; line-height: 1.2; color: var(--text); margin: 40px 0 12px; }
.article h3 { font-size: 19px; color: var(--text); margin: 0 0 6px; }
.article p { margin: 0 0 14px; }
.article ul, .article ol { margin: 0 0 14px; padding-left: 24px; }
.article li { margin: 7px 0; }
.article b { color: var(--text); }
.article a { color: var(--gold); text-underline-offset: 3px; }
.article a:hover { color: #FFD98A; }
.article .lead { font-size: 19px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.crumbs { font-size: 14px; color: var(--muted); }
.article .crumbs a { color: var(--muted); }

/* The home page's text sits under the game, set off by a rule. */
.about { border-top: 1px solid var(--line); padding-top: 8px; }
.about h2:first-child { margin-top: 28px; }

.faq { display: flex; flex-direction: column; gap: 12px; margin: 0 0 14px; }
.faq-item { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.article .faq-item h2 { font-size: 21px; margin: 0 0 6px; }
.article .faq-item h3 { margin: 0 0 4px; }
.article .faq-item p { margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 18px 0; }
.article a.card-link { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); color: var(--text-2); text-decoration: none; font-size: 15px; line-height: 1.45; }
.article a.card-link:hover { border-color: var(--gold); color: var(--text-2); }
.card-link b { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--text); line-height: 1.2; }

.table-wrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 14px; }
.article table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
.article th, .article td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.article tr:last-child > * { border-bottom: 0; }
.article thead th { background: var(--panel-2); color: var(--text); font-size: 13px; letter-spacing: .04em; }
.article tbody th { color: var(--text); white-space: nowrap; }
.article td { text-transform: none; }

/* A playable board with its count, message and tools (web/player.js) */
.try, .tool { margin: 28px 0 8px; padding: 20px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); color: var(--text); display: flex; flex-direction: column; gap: 14px; }
.article .try h2, .article .try h3 { margin: 0; font-size: 22px; }
.article .try > p, .article .tool p { margin: 0; }
.try > p { font-size: 15px; }
.player { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 620px; margin: 0 auto; }
.pl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 46px; }
.pl-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.article .pl-msg, .article .tool-msg { margin: 0; min-height: 3.1em; text-align: center; font-size: 15px; line-height: 1.5; color: var(--text); }
.article .pl-msg.bad, .article .tool-msg.bad { color: #FFC2CF; }
.pl-tools, .tool-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pl-tools .toggle { margin-left: auto; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.tool-row { justify-content: space-between; }
.tool-row.centre { justify-content: center; }

.tool-bar { display: flex; align-items: flex-end; gap: 12px 14px; flex-wrap: wrap; }
.tool-bar label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.tool select { font: inherit; font-size: 15px; font-weight: 700; padding: 9px 10px; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel-2); color: var(--text); }
.tool-bar label.tool-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; letter-spacing: 0; color: var(--text); }
.tool-check input { width: 18px; height: 18px; accent-color: var(--gold); }
.tool-bar .btn-gold { margin-left: auto; }
.article .tool-step, .article .tool-foot { margin: 0; font-size: 14px; color: var(--text-2); }
.article .tool-step { text-align: center; }
.tool-foot:empty { display: none; }
.article .tool-head { margin: 0; text-align: center; font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.3; color: var(--text); }
.tool .chips .chip { cursor: pointer; }
.btn:disabled { opacity: .45; }

/* Solver: palette and the vials you fill in */
.palette { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.swatch { position: relative; width: 46px; height: 46px; padding: 0; border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel-2); display: grid; place-items: center; }
.swatch.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,193,78,.35); }
.swatch small { position: absolute; right: -5px; top: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--text); color: var(--ink); font: 700 11px/18px var(--body); text-align: center; }
.swatch small:empty { display: none; }
.editor { display: flex; flex-wrap: wrap; gap: 14px 10px; justify-content: center; padding: 16px 10px 12px; border-radius: 18px; background: radial-gradient(120% 90% at 50% 0%, #2A1D45 0%, var(--void) 70%); box-shadow: 0 0 0 1px var(--line); }
.ed-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ed-vial { display: flex; flex-direction: column-reverse; align-items: center; gap: 0; width: 42px; height: calc(var(--cap) * 30px + 12px); padding: 0 0 6px; background: linear-gradient(90deg, rgba(255,255,255,.13), rgba(255,255,255,.02) 38%, rgba(255,255,255,.02) 70%, rgba(255,255,255,.09)); border: 2px solid rgba(246,239,230,.34); border-top: 0; border-radius: 4px 4px 21px 21px; }
.ed-vial:hover { border-color: rgba(246,239,230,.6); }
.ed-vial[aria-disabled="true"] { cursor: default; }
.ed-vial .orb { flex: none; }
.ed-num { font-size: 12px; font-weight: 700; color: var(--muted); }
.ed-pop { width: 42px; min-height: 34px; padding: 0; border-radius: 10px; border: 1.5px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 20px; line-height: 1; font-weight: 700; }
.ed-pop:disabled { opacity: .35; }
/* Vial numbers under the solution board, so "vial 3" in the steps can be found */
.numbered { counter-reset: vial; }
.numbered .vial { counter-increment: vial; }
.numbered .vial::after { content: counter(vial); position: absolute; left: 0; right: 0; top: 100%; font: 700 10px/12px var(--body); color: var(--muted); text-align: center; }
.move-list { font-size: 15px; color: var(--text-2); }
.move-list summary { cursor: pointer; font-weight: 700; color: var(--text); padding: 6px 0; }
.article .move-list ol { margin: 8px 0 0; }
.move-list li.past { opacity: .5; }
.move-list li[aria-current] { color: var(--gold); font-weight: 700; }

/* Archive list and day-to-day links */
.article .days { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.days li { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 15px; }
.article .days a { color: var(--text-2); text-decoration: none; }
.article .days a b { color: var(--gold); }
.days .sub { float: right; font-size: 12px; font-weight: 700; color: #7EE8C1; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.article .pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; }
.pager a:last-child { text-align: right; grid-column: 2; }
.pager small { color: var(--muted); font-size: 13px; font-weight: 500; }

.app-cta { margin-top: 44px; padding: 20px 22px; border-radius: 20px; background: linear-gradient(150deg, #3A2466, var(--panel) 62%); border: 1px solid rgba(179,136,255,.45); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.app-cta div { display: flex; flex-direction: column; gap: 4px; flex: 1 1 260px; font-size: 15px; line-height: 1.5; }
.app-cta b { font-family: var(--display); font-weight: 700; font-size: 20px; }
.article .app-cta a.btn { color: var(--ink); text-decoration: none; }

.site-footer { flex-wrap: wrap; gap: 10px 18px; }
.site-footer a { color: var(--muted); }

@media (max-width: 640px) {
  .article { padding: 20px 16px 48px; font-size: 16px; }
  .article .lead { font-size: 17px; padding: 16px; }
  .article h2 { font-size: 23px; }
  .try, .tool { padding: 14px; margin-left: -4px; margin-right: -4px; }
  .tool-bar .btn-gold { margin-left: 0; width: 100%; }
  .site-footer span { width: 100%; margin-right: 0; }
  /* The header is three rows tall on a phone, so on these pages it scrolls away with the page. */
  .site-header:has(+ .article) { position: static; }
  /* On the home page the header stays put, so the extra links move to the text and footer below. */
  .site-nav .nav-more { display: none; }
  .editor { gap: 12px 6px; padding: 14px 6px 10px; }
}

/* More games: a quiet footer line, and a small row after a solve */
.site-footer .more-games { width: 100%; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.site-footer .more-games a { color: var(--text-2); }
.try-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.try-row a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; text-decoration: none; }
.try-row a:hover { text-decoration: underline; }
.try-row img { border-radius: 7px; }
