/* Pen the Flock. Uses the site's tokens (public/styles.css, docs/BRAND.md); light only. */
.ptf [hidden] { display: none !important; }
.ptf { margin-top: 12px; }
.ptf h1 { font-size: clamp(2.3rem, 6.5vw, 3.5rem); letter-spacing: -.02em; line-height: 1; margin: 0 0 12px; }
.ptf h2 { margin-top: 36px; }
.ptf h3 { margin: 0 0 6px; font-size: 1.02rem; }
.ptf-btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ptf-quiet { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.ptf-quiet:hover { background: var(--chip); color: var(--ink); border-color: var(--ink); }
.ptf-quiet.on { background: var(--olive); color: var(--on-dark); border-color: var(--olive); }
.ptf .button, .ptf button { min-height: 44px; }
.ptf-big { font-size: 1.05rem; padding: 10px 20px; }
.ptf-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.ptf .table td.num, .ptf .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ptf .table .me td { background: var(--subtotal); }

/* ---------- lobby ---------- */
.ptf-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px; align-items: center; }
.ptf-lede { font-size: 1.12rem; max-width: 52ch; margin: 0 0 16px; }
.ptf-how { margin: 0 0 18px; padding-left: 20px; max-width: 58ch; }
.ptf-how li { margin-bottom: 4px; }
.ptf-demo { margin: 0; }
.ptf-demo canvas { display: block; border-radius: 12px; box-shadow: 0 1px 0 var(--line); }
.ptf-demo figcaption { margin-top: 8px; }
@media (max-width: 860px) { .ptf-hero { grid-template-columns: 1fr; gap: 20px; } }

.ptf-guide { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.ptf-guide li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.ptf-guide canvas { width: 64px; height: 52px; display: block; }
.ptf-guide strong { display: block; }
.ptf-guide p { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
.ptf-guide .from { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.ptf-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.ptf-boards h3 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ptf-you { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.ptf-you div { display: flex; flex-direction: column; }
.ptf-you dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.ptf-you dd { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; color: var(--ink); }

/* ---------- play ---------- */
.ptf-play { max-width: 1000px; margin: 0 auto; }
.ptf-titlebar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ptf-titlebar h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0; }
.ptf-hud { display: grid; grid-template-columns: auto auto auto minmax(140px, 1fr) minmax(120px, .8fr); gap: 8px 18px; align-items: center; background: var(--olive); color: var(--on-dark); border-radius: 14px 14px 0 0; padding: 8px 14px; border-top: 4px solid var(--sand); }
.ptf-hud .lab { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; opacity: .8; font-weight: 600; font-family: var(--font-head); }
.ptf-hud strong { font-family: var(--font-head); font-size: 1.35rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ptf-lives { display: flex; gap: 3px; align-items: center; min-height: 1.5rem; font-weight: 700; }
.ptf-life { font-style: normal; color: var(--sand); font-size: 1.15rem; line-height: 1; }
.ptf-meter, .ptf-wolfclock { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.ptf-meter .lab, .ptf-wolfclock .lab { grid-column: 1 / -1; }
.ptf-track { position: relative; height: 10px; border-radius: 5px; background: rgba(245, 242, 230, .2); overflow: hidden; }
.ptf-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--sage); transition: width .2s; }
.ptf-meter.done .ptf-fill { background: var(--sand); }
.ptf-goal { position: absolute; top: -2px; bottom: -2px; left: 75%; width: 2px; background: var(--on-dark); }
.ptf-wolfclock .ptf-fill { background: var(--sand); transition: none; }
.ptf-wolfclock.here .ptf-fill { background: var(--rust); }
.ptf-wolfclock.here strong { color: var(--sand); }
.ptf-meter strong, .ptf-wolfclock strong { font-size: 1rem; min-width: 3.2em; text-align: right; }
@media (max-width: 640px) {
  .ptf-hud { grid-template-columns: repeat(3, auto); justify-content: space-between; }
  .ptf-meter, .ptf-wolfclock { grid-column: span 3; }
}
.ptf-stage { position: relative; background: var(--meadow, #F3EEDB); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; overflow: hidden; }
.ptf-stage canvas { display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.ptf-stage canvas[data-orient="h"] { cursor: ew-resize; }
.ptf-stage canvas[data-orient="v"] { cursor: ns-resize; }
.ptf-start { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(245, 242, 230, .72); }
.ptf-start .ptf-panel { max-width: 460px; width: 100%; text-align: center; box-shadow: 0 6px 24px rgba(42, 53, 20, .15); }
.ptf-start h2 { margin: 0 0 6px; border: 0; padding: 0; }
.ptf-start p { margin: 0 0 12px; }
.ptf-start .ptf-btnrow { justify-content: center; }
.ptf-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.ptf-controls .grow { flex: 1; }
.ptf-fx { display: flex; gap: 6px; flex-wrap: wrap; }
.ptf-chip { font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--sand); color: var(--on-light-accent); }
.ptf-help { margin-top: 12px; }
.ptf-portrait { display: none; }
@media (max-width: 560px) and (orientation: portrait) { .ptf-portrait { display: block; } }
.ptf-after { margin-top: 14px; }
.ptf-after h2 { margin: 0 0 6px; border: 0; padding: 0; }
.ptf-final { font-size: 1.15rem; margin: 0 0 6px; }
.ptf-final strong { font-family: var(--font-head); font-size: 1.8rem; }

/* ---------- replay ---------- */
.ptf-replaybar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; }
.ptf-replaybar label { flex-direction: row; align-items: center; gap: 6px; }
.ptf-replaybar select { font: inherit; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); min-height: 44px; }
.ptf-progress { width: 100%; height: 8px; margin-top: 10px; accent-color: var(--rust); }
.ptf-levels { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ptf-lvl { min-width: 36px; padding: 4px 8px; min-height: 36px !important; }

/* ---------- badges ---------- */
.ptf-medal { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; }
.ptf-medal-mark { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 1rem; border: 3px solid; letter-spacing: -.02em; }
.cat-milestone .ptf-medal-mark { background: var(--olive); color: var(--on-dark); border-color: var(--sand); }
.cat-skill .ptf-medal-mark { background: var(--rust); color: var(--on-rust); border-color: var(--brick); }
.cat-quirky .ptf-medal-mark { background: var(--sage); color: var(--on-light-accent); border-color: var(--olive); }
.cat-streak .ptf-medal-mark { background: var(--sand); color: var(--on-light-accent); border-color: var(--rust); }
.ptf-medals { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ptf-medals li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.ptf-medals li.locked .ptf-medal-mark { background: var(--surface); color: var(--muted); border-color: var(--line); border-style: dashed; }
.ptf-medals li.mine { border-color: var(--sage); box-shadow: inset 0 0 0 1px var(--sage); }
.ptf-medals p { margin: 2px 0 0; font-size: .9rem; }
.ptf-medals .meta { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.ptf-badges-mini { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.ptf-firsts td:first-child { white-space: nowrap; }
.ptf-crown { color: var(--rust-text); font-weight: 700; }

/* ---------- stats ---------- */
.ptf-heat { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.ptf-heat figure { margin: 0; }
.ptf-heat canvas { display: block; border-radius: 8px; }
.ptf-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-width: 520px; }
.ptf-bars li { display: grid; grid-template-columns: 120px 1fr 48px; gap: 10px; align-items: center; font-size: .92rem; }
.ptf-bars .bar { height: 12px; border-radius: 6px; background: var(--chip); overflow: hidden; }
.ptf-bars .bar span { display: block; height: 100%; background: var(--brick); }
.ptf-bars .n { text-align: right; font-variant-numeric: tabular-nums; }
