/* Family Game Pack. Fonts: SIL OFL 1.1, served from this site (licence texts in fonts/). */
@font-face { font-family: fgp-body; src: url(fonts/AtkinsonHyperlegible-Regular.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: fgp-body-bold; src: url(fonts/AtkinsonHyperlegible-Bold.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: fgp-head; src: url(fonts/Fredoka-SemiBold.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: fgp-script; src: url(fonts/BerkshireSwash-Regular.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: fgp-fb; src: url(fonts/Andika-Regular.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: fgp-fb-bold; src: url(fonts/Andika-Bold.ttf) format("truetype"); font-display: swap; }

:root { --green: #1F5C46; --cran: #B3263E; --gold: #C99A2E; --ink: #222; --grey: #5f5f5f; --tint: #EEF4F0; --cream: #FBF7EE; --line: #d9d2c3; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.5 fgp-body, system-ui, sans-serif; color: var(--ink); background: var(--cream); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }
a { color: var(--green); }
h1, h2, h3, .brand, .lbl { font-family: fgp-head, system-ui, sans-serif; font-weight: 600; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; min-height: 56px; }
.brand { font-size: 20px; color: var(--green); display: flex; align-items: center; gap: 10px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--cran); margin-right: 9px; }

.intro { padding: 26px 0 6px; max-width: 720px; }
h1 { font-size: 34px; line-height: 1.1; color: var(--green); margin: 0 0 10px; }
.lead { font-size: 19px; margin: 0 0 12px; }
.etsy-note { font-family: fgp-body-bold, fgp-body, sans-serif; color: var(--cran); margin: 0; }
.bad-msg { background: #fff3f3; border: 1px solid #e7b9b9; border-radius: 10px; padding: 12px 14px; margin: 12px 0 0; }

/* Locked / unlocked. early.js sets html.unl while a link is checked; app.js adds .on once it matches. */
.unl-only { display: none; }
html.on .unl-only { display: block; }
html.unl .locked-only, html.on .locked-only { display: none; }
html.unl:not(.on) .preview { visibility: hidden; }

.banner { background: var(--green); color: #fff; border-radius: 14px; padding: 16px 18px; margin: 14px 0 16px; max-width: 720px; }
.banner h2 { margin: 0 0 4px; font-size: 24px; }
.banner p { margin: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; max-width: 720px; }
.lbl { display: block; font-size: 18px; color: var(--green); margin: 14px 0 2px; padding: 0; }
.card > .lbl:first-child { margin-top: 0; }
.hint { margin: 0 0 8px; font-size: 15px; color: var(--grey); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input[type=text], input[type=number] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #b8b0a0; border-radius: 10px; background: #fff; color: var(--ink); min-height: 46px; }
input:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
input.short { max-width: 140px; }
.nrow { display: flex; gap: 8px; margin-bottom: 8px; }
.nrow input { flex: 1; min-width: 0; }
.rm { flex: none; width: 46px; min-height: 46px; border: 1px solid #b8b0a0; background: #fff; border-radius: 10px; font-size: 22px; color: var(--grey); cursor: pointer; }
.rm:disabled { opacity: .35; cursor: default; }
.radio { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 17px; cursor: pointer; }
.radio input { width: 20px; height: 20px; accent-color: var(--green); }
.btn { font: 600 17px fgp-head, system-ui, sans-serif; background: var(--cran); color: #fff; border: 2px solid var(--cran); border-radius: 26px; padding: 11px 20px; min-height: 48px; cursor: pointer; }
.btn-2 { background: #fff; color: var(--cran); }
.btn.btn-sm { font-size: 15px; min-height: 44px; padding: 8px 16px; }
.btn:disabled { opacity: .45; cursor: default; }
.dl { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.errs ul { margin: 14px 0 0; padding: 10px 14px 10px 30px; background: #fff3f3; border: 1px solid #e7b9b9; border-radius: 10px; font-size: 15px; }
.msg { min-height: 1.5em; margin: 10px 0 0; font-size: 15px; }
.small { font-size: 15px; color: var(--grey); margin: 8px 0 0; }
.linkish { font: inherit; background: none; border: 0; padding: 10px 0; color: var(--green); text-decoration: underline; cursor: pointer; }

.preview { padding: 22px 0 30px; }
.preview h2 { font-size: 22px; color: var(--green); margin: 0 0 12px; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pg { margin: 0; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 20px -10px rgba(0,0,0,.3); }
.pg svg { display: block; width: 100%; height: auto; }
.pg text { font-kerning: none; font-variant-ligatures: none; text-rendering: geometricPrecision; }
.pv-empty { background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 22px; color: var(--grey); margin: 0; }

.foot { border-top: 1px solid var(--line); background: #fff; padding: 16px 0 22px; font-size: 14px; color: var(--grey); }
.foot p { margin: 4px 0; }

.doc { max-width: 760px; padding: 24px 18px 40px; }
.doc h1 { font-size: 30px; }
.doc h2 { font-size: 20px; color: var(--green); margin: 22px 0 6px; }
.doc .muted { color: var(--grey); }

.swipe { display: none; font-size: 14px; color: var(--grey); margin: -6px 0 10px; }

/* Wide screens, unlocked: the form on the left, the preview on the right. */
@media (min-width: 1100px) {
  html.on main.wrap { display: grid; grid-template-columns: 520px 1fr; column-gap: 32px; align-items: start; }
  html.on .intro { grid-column: 1 / -1; }
  html.on .preview { padding-top: 14px; }
  html.on .pages { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
/* Phones: the pages are a strip you swipe through. */
@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 28px; }
  .lead { font-size: 17px; }
  .card { padding: 14px; }
  .dl .btn { width: 100%; }
  .pages { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding: 4px 2px 14px; }
  .pg { flex: 0 0 86%; scroll-snap-align: start; }
  .swipe { display: block; }
}
