/* The public "How to Play" site — on the Frenika Devon brand system.
 *
 * The look is brand.css: the SAME stylesheet every Frenika Devon site ships
 * (canonical copy frenikadevon/assets/css/brand.css, copied here by that repo's
 * `php tools/sync-brand.php` — never edit play/brand.css by hand). Warm paper,
 * plum ink, berry buttons, Fraunces / Mulish / Caveat, the rainbow arch in the
 * header and the plum footer. This file only lays out what is particular to
 * these pages, and uses brand tokens (var(--berry), var(--card) …) for every
 * colour so a brand change reaches here through the sync alone.
 *
 * Load order is style.php (the Puzzle Creator's own assets/style.css) → brand.css
 * → this file. The generator's stylesheet draws the puzzle markup inside a saved
 * example, and it shares a few names with brand.css (:root --ink/--muted/--line,
 * body, .topbar, .btn, .panel, .section-head). brand.css loading after it keeps
 * the page chrome on-brand; the "puzzle sheet" block below then hands the sheet
 * back the generator values its puzzles were drawn with. Nothing here restyles
 * `.puzzle` or any other generator class beyond that — the point of snapshotting
 * the preview HTML is that it looks the same here as in the generator.
 *
 * Tuned for a nervous first-timer arriving from a Patreon link on a phone:
 * generous type, one column, and the answer key behind a deliberate tap.
 */

/* ---- undo the generator's page chrome ----
 * style.php sets these for the generator's own admin screen; brand.css
 * overrides most of each, and these are the leftovers it does not mention. */
body.play { background-attachment: scroll; }
.play .topbar { display: block; box-shadow: none; }

/* ---- header ---- */

/* The brand mark goes to the list, so on a phone the text link beside it is
   dropped and the Patreon button keeps the bar to one row. */
@media (max-width: 560px) {
    .play .nav-links.solo a:not(.btn) { display: none; }
}

.play__main {
    max-width: 920px;
    padding-top: clamp(36px, 6vw, 64px);
    padding-bottom: clamp(56px, 8vw, 96px);
}

/* ---- type ---- */

.play__h1 {
    margin: 0 0 14px;
    font-size: clamp(2.3rem, 5vw, 3.6rem);
}
.play__h2 {
    margin: 0 0 14px;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
}
/* The marigold rule under a section heading — the brand's .rule, drawn here so
   the markup does not need an extra element per heading. */
.play__h2::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    margin-top: 12px;
    border-radius: 4px;
    background: var(--marigold);
}
.play__intro {
    margin: 0 0 clamp(30px, 5vw, 44px);
    max-width: 62ch;
    font-size: clamp(1.1rem, 1.6vw, 1.25rem);
    line-height: 1.6;
    color: var(--ink-soft);
}
.play__note {
    margin: 0 0 18px;
    color: var(--ink-soft);
    font-size: 1rem;
}
.play__empty {
    color: var(--muted);
    font-style: italic;
}

.play__back {
    display: inline-block;
    margin-bottom: 14px;
    font-weight: 800;
    font-size: .95rem;
    color: var(--berry);
    text-decoration: none;
}
.play__back:hover { text-decoration: underline; color: var(--berry-dark); }

/* ---- breadcrumb ----
 * Says where the page sits as well as how to leave it. The separators are drawn
 * by CSS so they are never read out as content, and the current page is plain
 * text — a crumb that looks like a link and does nothing is worse than one that
 * plainly is not. */

.crumbs { margin-bottom: 18px; }
.crumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.crumbs__item { display: flex; align-items: center; }
.crumbs__item + .crumbs__item::before {
    content: "/";
    margin: 0 .7em;
    color: var(--line);
    font-weight: 800;
}
.crumbs__link {
    color: var(--berry);
    text-decoration: none;
    padding: 6px 0;   /* a tappable line without a visible box */
}
.crumbs__link:hover { text-decoration: underline; color: var(--berry-dark); }
.crumbs__here { color: var(--muted); }

/* ---- a type section on the list page ---- */

.play__section { margin-bottom: clamp(36px, 5vw, 52px); }
.play__section:last-of-type { margin-bottom: 0; }
/* An eyebrow, not a heading someone is meant to stop and read: a signpost
   between cards, with a hairline running out to the edge. */
.play__section-h {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 18px;
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--berry);
}
.play__section-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* The heading is the way into that type's own page, so it has to look like it
   can be tapped without shouting louder than the cards under it. */
.play__section-link {
    color: inherit;
    text-decoration: none;
    padding: 4px 0;
}
.play__section-link:hover,
.play__section-link:focus-visible { color: var(--berry-dark); text-decoration: underline; }

.play__more { margin: 30px 0 0; }

/* ---- the card grid ----
 * Each card is the brand's .link-card; this only sets the grid and the text. */

.play__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}
.play__card { display: flex; }
.play__card-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-top: 5px solid var(--bar, var(--pink));
}
/* The rainbow, card by card — the same four brights as the logo's arch. */
.play__card:nth-child(4n+2) .play__card-link { --bar: var(--teal); }
.play__card:nth-child(4n+3) .play__card-link { --bar: var(--orange); }
.play__card:nth-child(4n+4) .play__card-link { --bar: var(--yellow); }
.play__card-link { text-align: left; }
.play__card-name { margin: 0 0 6px; font-size: 1.3rem; }
.play__card-blurb { margin: 0; flex: 1; }
/* The brand's arrow link, in words: "How to play →" says what is behind the card. */
.play__card-go {
    margin-top: 16px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--berry);
    transition: transform .15s ease;
}
.play__card-link:hover .play__card-go { transform: translateX(3px); }

/* ---- rules ----
 * A numbered list with the brand's big serif numerals — the look of the .steps
 * component, kept to one column because these are sentences to read in order. */

.play__rules { margin-top: 8px; }
.play__steps {
    list-style: none;
    counter-reset: step;
    margin: 0;
    padding: 0;
    max-width: 66ch;
}
.play__steps li {
    counter-increment: step;
    position: relative;
    padding: 0 0 0 58px;
    margin-bottom: 18px;
    min-height: 40px;
    font-size: 1.05rem;
}
.play__steps li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: -4px;
    font-family: var(--font-display);
    font-variation-settings: 'SOFT' 60;
    font-weight: 650;
    font-size: 1.9rem;
    line-height: 1;
    color: var(--marigold);
}

/* ---- solving tips ----
 * The brand's callout — a card with a berry rule down its left edge — so it
 * reads as help offered beside the rules, not as more rules. */

.play__tips {
    margin-top: clamp(36px, 5vw, 48px);
    padding: clamp(22px, 3vw, 30px);
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 5px solid var(--berry);
    border-radius: var(--r-sm) var(--r-lg) var(--r-lg) var(--r-sm);
    box-shadow: var(--shadow-sm);
}
.play__tips .play__note { margin-bottom: 16px; }

.play__tip-list {
    margin: 0;
    padding: 0;
    max-width: 64ch;
    list-style: none;
}
.play__tip-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    line-height: 1.55;
}
.play__tip-list li:last-child { margin-bottom: 0; }
/* A dot rather than a number: these are suggestions to be picked from, not
   steps. Drawn in CSS so it can never come out as a tofu box. */
.play__tip-list li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: .6em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pink);
}

/* ---- the example puzzle ----
 * A printed sheet on the paper: the card colour, a hairline edge and a soft
 * shadow, with a strip of tape like the brand's polaroids. The horizontal
 * scroll matters — a wide grid on a narrow phone must scroll rather than shrink
 * to unreadable, since the whole page exists to stop people squinting at a
 * puzzle they do not understand yet. */

.play__example { margin-top: clamp(40px, 6vw, 56px); }

.play__paper {
    position: relative;
    /* The generator's own values, inside the sheet only. brand.css redefines
       --ink / --muted / --line for the page; the puzzle was drawn with these,
       and its cell borders need the cooler, darker line to print legibly. */
    --ink: #1f2430;
    --muted: #6b7280;
    --line: #cfd4db;
    --accent: var(--berry);
    --bg: #f4f5f7;
    background: #fff;
    color: var(--ink);
    border: 1px solid #eadfd2;
    border-radius: var(--r-md);
    padding: 26px 22px 8px;
    overflow-x: auto;
    box-shadow: var(--shadow-md);
}
/* brand.css also owns .section-head (a page-section intro block); inside a
   puzzle it is the generator's divider line, so give it the generator's shape. */
.play__paper .section-head {
    max-width: none;
    margin: 26px 0 10px;
    font-family: var(--font-display);
}
.play__paper--answer { margin-top: 14px; }

/* The preview HTML carries its own "Answer Key" heading; on the puzzle half it
   has been split off, and under the reveal it would just repeat the button. */
.play__paper--answer .section-head:first-child { display: none; }

.play__answer { margin-top: 22px; }
/* The reveal is a brand outline button, so it reads as a deliberate choice
   rather than a link. */
.play__answer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 26px;
    border: 2px solid var(--ink);
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
    transition: background .15s ease, color .15s ease;
}
.play__answer-toggle::-webkit-details-marker { display: none; }
.play__answer-toggle:hover { background: var(--ink); color: var(--paper); }
.play__answer[open] .play__answer-toggle::after { content: " (hide)"; font-weight: 600; text-transform: none; letter-spacing: 0; margin-left: .35em; }

/* The label strip (solve time · difficulty · …) comes out of the generator and
   sits on the page rather than on the sheet, so it takes the brand's tags. */
.play .labels { border-bottom-color: var(--line); }
.play .labels .label-badge {
    background: var(--berry-tint);
    border-color: transparent;
    color: var(--berry-dark);
    font-weight: 800;
}

/* ---- "what to expect on Patreon" ----
 * Names a thing on a day. "Lots of puzzles" persuades nobody; "a mystery on
 * Wednesday" is something a visitor can picture. A brand card, quieter than the
 * plum ask below it on purpose — this is the reason, that is the button. */

.expect {
    margin-top: clamp(48px, 7vw, 72px);
    padding: clamp(24px, 3.5vw, 38px);
    background: var(--paper-2);
    border-radius: var(--r-lg);
}
.expect__eyebrow { margin-bottom: 10px; }
.expect__h {
    margin: 0 0 10px;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}
.expect__pitch {
    margin: 0 0 22px;
    max-width: 54ch;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

/* The week. One column on a phone, three across once there is room — three
   side by side is the point: it reads as a rhythm, not a list. */
.expect__week {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 14px;
}
.expect__day {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 5px solid var(--bar, var(--pink));
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}
.expect__day:nth-child(2) { --bar: var(--teal); }
.expect__day:nth-child(3) { --bar: var(--orange); }
.expect__when {
    color: var(--berry);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.expect__what {
    font-family: var(--font-display);
    font-variation-settings: 'SOFT' 60;
    font-weight: 650;
    font-size: 1.25rem;
    line-height: 1.2;
}
.expect__note { color: var(--ink-soft); font-size: .95rem; line-height: 1.5; }

/* The perks that do not belong to a weekday — the brand's .checklist. */
.expect__perks {
    margin-top: 22px;
    display: grid;
    gap: 4px;
}
.expect__perk { margin-bottom: 6px; font-size: 1rem; }

@media (min-width: 700px) {
    .expect__week { grid-template-columns: repeat(3, 1fr); }
    .expect__perks { grid-template-columns: repeat(3, 1fr); gap: 4px 20px; }
}

/* ---- the Patreon ask ----
 * Under the example, where a visitor has just finished one and is as close to
 * playing as they are going to get: the brand's plum band, rounded, with the
 * yellow button. Deliberately louder than the newsletter card below it. */

.patreon {
    margin-top: 24px;
    padding: clamp(30px, 5vw, 48px) clamp(22px, 4vw, 40px);
    text-align: center;
    background: var(--plum);
    color: var(--on-plum);
    border-radius: var(--r-lg);
    position: relative;
    overflow: hidden;
}
/* The rainbow stripe along the top edge, as on the brand footer. */
.patreon::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: var(--rainbow);
}
.patreon__h {
    margin: 0 0 10px;
    color: var(--on-plum);
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}
.patreon__pitch {
    margin: 0 auto 24px;
    max-width: 46ch;
    color: var(--on-plum-soft);
    font-size: 1.08rem;
}

/* ---- newsletter sign-up ----
 * A brand card at the foot of every page. Only rendered when MailerLite is
 * configured here, so these rules never style a dead form. play.js keeps the
 * signup__* class names, so they stay. */

.signup {
    margin: 24px 0 0;
    padding: clamp(24px, 3.5vw, 36px);
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 5px solid var(--teal);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.signup__h {
    margin: 0 0 8px;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
}
.signup__pitch { margin: 0 0 20px; color: var(--ink-soft); max-width: 54ch; }

.signup__form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.signup__field { display: flex; flex-direction: column; gap: 6px; flex: 2 1 220px; }
/* First name is optional, so it yields width to the address before the address
   yields any — on a narrow row the email box is the one that must stay usable. */
.signup__field--name { flex: 1 1 140px; }
.signup__label {
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.signup__btn { flex: 0 0 auto; }

/* The honeypot. Moved out of sight rather than display:none — some bots skip
   anything that is not rendered, and this one is meant to be filled in. */
.signup__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.signup__msg { margin: 14px 0 0; min-height: 1.3em; font-weight: 700; }
.signup__msg--ok { color: var(--teal-deep); }
.signup__msg--err { color: #b42318; }
.signup__msg:empty { margin: 0; min-height: 0; }

.signup__small { margin: 12px 0 0; color: var(--muted); font-size: .88rem; }

@media (max-width: 560px) {
    .play__paper { padding: 18px 14px 4px; }
    .play__steps li { padding-left: 48px; }
    .play__steps li::before { font-size: 1.6rem; }
    .signup__btn, .patreon__btn { width: 100%; }
}
