/*
 * The website in the game's own look (DESIGN.md): a coach's things, in a real place. Sits on kit.css (the game's panel
 * kit, copied by tools/site_kit.mjs). Every page is somewhere: one of the game's painted rooms behind it, dimmed so the
 * panels lead. Panels are made things: a chalkboard for a play, taped paper for a list or a form, a scoreboard for a
 * number, one wooden sign for where you are. Gold is the one thing to do next, and a scoreboard's numbers. Nothing else.
 * Cool blacks, chalk white, the field's green: no brown pages (Robert, 2026-10-19), and never purple.
 */
@font-face { font-family: 'Twemoji Country Flags'; unicode-range: U+1F1E6-1F1FF; font-display: swap; src: url('fonts/TwemojiCountryFlags.woff2') format('woff2'); }

body.fw {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  color: var(--fhk-chalk); background: var(--fhk-black);
  font: 400 1rem/1.5 var(--fhk-body);
  -webkit-text-size-adjust: 100%;
}
body.fw::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, oklch(0.13 0.016 250 / 0.78), oklch(0.10 0.016 250 / 0.93) 70%),
    var(--room-wide, none) center / cover no-repeat, var(--fhk-black);
}
@media (orientation: portrait) { body.fw::before { background-image: linear-gradient(180deg, oklch(0.13 0.016 250 / 0.8), oklch(0.10 0.016 250 / 0.94) 60%), var(--room-tall, var(--room-wide, none)); } }
.fw *, .fw *::before, .fw *::after { box-sizing: border-box; }
.fw a { color: inherit; }
.fw :focus-visible { outline: 3px solid var(--fhk-gold); outline-offset: 2px; }
.fw .flag { font-family: 'Twemoji Country Flags', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; font-style: normal; }

/* ---- the web's chalkboards have a steel frame (tools/steel_chalkboard.py): wood is for the one sign */
.fw .fhk-chalk { border-image-source: url('panels/chalkboard-steel.webp'); background-color: #1c2922; }

/* ---- the top: the one wooden sign (where you are), and the way to everything we have built */
.fw-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; max-width: 80rem; margin: 0 auto; padding: 0.9rem clamp(1rem, 4vw, 2.5rem) 0.4rem; }
.fw-sign { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.fw-sign img { width: 3rem; height: 3rem; flex: none; }
.fw-sign .fhk-plank { transform: rotate(-0.8deg); }
.fw-sign .fhk-title { font-size: clamp(1.05rem, 2.4vw, 1.4rem); white-space: nowrap; }
.fw-nav { display: flex; flex-wrap: wrap; gap: 0.15rem 0.2rem; margin-left: auto; align-items: center; }
.fw-nav a { text-decoration: none; font-weight: 700; font-size: 0.9375rem; color: var(--fhk-chalk-dim); padding: 0.55rem 0.6rem 0.4rem; border-bottom: 3px solid transparent; transition: color 0.2s, border-color 0.2s; }
.fw-nav a:hover { color: var(--fhk-chalk); border-bottom-color: oklch(0.95 0.015 85 / 0.35); }
.fw-nav a[aria-current='page'] { color: var(--fhk-chalk); border-bottom-color: var(--fhk-chalk); }
.fw-who { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; font-size: 0.875rem; color: var(--fhk-chalk-dim); width: 100%; margin-top: -0.6rem; }
.fw-who:empty { display: none; }
@media (max-width: 760px) {
  /* Every link in sight on a phone: two short rows, nothing hidden off the edge. */
  .fw-nav { margin-left: 0; width: 100%; gap: 0 0.1rem; }
  .fw-nav a { white-space: nowrap; font-size: 0.875rem; padding: 0.5rem 0.45rem 0.35rem; }
  .fw-who { margin-top: 0; }
}

/* ---- the page */
.fw-main { max-width: 80rem; margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2.5rem) 7rem; }
.fw-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin: 0.8rem 0 1.4rem; }
.fw-h1 { font-size: clamp(2rem, 5.4vw, 3.6rem); margin: 0.2rem 0 0.5rem; }
.fw-kick { font-size: 0.875rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fhk-chalk-dim); margin: 0; }
.fw-lede { font-size: 1.125rem; max-width: 46rem; color: oklch(0.88 0.015 85); margin: 0; }
.fw-h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); margin: 2.4rem 0 0.9rem; }
.fw-note { color: var(--fhk-chalk-dim); font-size: 0.9375rem; }
.fw-empty { color: var(--fhk-chalk-dim); padding: 1.5rem 0; font-size: 1.05rem; }
.fw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 1.2rem; }
.fw-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.fw-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 520px) { .fw-two { grid-template-columns: 1fr; } }
.fhk-btn.small { font-size: 0.875rem; padding: 0.6em 1.2em 0.55em; }
.fhk-btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
a.fhk-btn { text-decoration: none; }
.fw-link { background: none; border: 0; padding: 0.4rem 0.2rem; color: var(--fhk-chalk-dim); font: 600 0.875rem var(--fhk-body); text-decoration: underline; cursor: pointer; min-height: 2.5rem; }
.fw-link:hover { color: var(--fhk-chalk); }
.fhk-paper .fw-link { color: var(--fhk-ink-dim); }
.fhk-paper .fw-link:hover { color: var(--fhk-ink); }

/* ---- picking: chalk underline for what is chosen, never a gold fill */
.fw-pick { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.fw-pick button, .fw-pick a { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--fhk-chalk-dim); font: 700 0.9375rem var(--fhk-body); padding: 0.55rem 0.7rem 0.4rem; cursor: pointer; text-decoration: none; min-height: 2.75rem; transition: color 0.2s, border-color 0.2s; }
.fw-pick button:hover, .fw-pick a:hover { color: var(--fhk-chalk); }
.fw-pick [aria-pressed='true'], .fw-pick [aria-current='true'] { color: var(--fhk-chalk); border-bottom-color: var(--fhk-chalk); }
.fw-pick small { display: block; font-size: 0.75rem; font-weight: 600; opacity: 0.8; }
.fhk-paper .fw-pick button { color: var(--fhk-ink-dim); }
.fhk-paper .fw-pick [aria-pressed='true'] { color: var(--fhk-ink); border-bottom-color: var(--fhk-marker); }
.fw select.fw-select { min-height: 2.75rem; padding: 0.4rem 2rem 0.4rem 0.75rem; border-radius: 0.625rem; border: 1px solid oklch(0.36 0.022 250); background: oklch(0.2 0.016 250); color: var(--fhk-chalk); font: 600 0.9375rem var(--fhk-body); }

/* ---- a play on a chalkboard */
.fw-play { display: grid; gap: 0.55rem; align-content: start; transition: transform 0.2s; }
.fw-play:hover { transform: rotate(-0.4deg) translateY(-2px); }
.fw-play .fw-diagram { display: block; cursor: pointer; }
.fw-play .fw-diagram > svg, .fw-board > svg { display: block; width: 100%; height: auto; }
.fw-play h3 { margin: 0.1rem 0 0; }
.fw-play .fhk-tape { justify-self: start; font-size: 1.05rem; }
.fw-meta { font-size: 0.875rem; color: var(--fhk-chalk-dim); margin: 0; }
.fw-used { font-family: var(--fhk-handwriting); font-size: 0.9375rem; color: var(--fhk-chalk); margin: 0; }
.fw-board { max-width: 62rem; }

/* ---- every kid's job, on taped paper, with the crew's tip */
.fw-jobs { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.fw-job { display: grid; grid-template-columns: 3.4rem 1fr; gap: 0.2rem 0.9rem; padding: 0.75rem 0; border-bottom: 1px solid oklch(0.24 0.016 250 / 0.16); }
.fw-job:last-child { border-bottom: 0; }
.fw-job > .fw-facewrap, .fw-job > .fw-face { grid-row: span 2; }
.fw-facewrap { position: relative; display: inline-block; width: 3.4rem; height: 3.4rem; flex: none; }
.fw-facewrap img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: oklch(0.86 0.03 88); display: block; }
.fw-faceflag { position: absolute; right: -0.25rem; bottom: -0.15rem; font-size: 1.15rem; line-height: 1; filter: drop-shadow(0 1px 0 oklch(0.2 0.01 250 / 0.5)); }
/* a play's drawing on a phone fits the screen: plays/page.js frames it on the kids (no sideways scroll), and a tap on
   a kid shows the job in words (Robert, 2026-10-19: no scroll bars) */
.fw-job b { font-size: 1.05rem; }
.fw-job p { margin: 0; }
.fw-job .fw-tip { font-family: var(--fhk-handwriting); color: var(--fhk-marker); font-size: 0.9375rem; }
.fw-line[data-level] { display: none; }
html[data-level='rookie'] .fw-line[data-level='rookie'], html[data-level='starter'] .fw-line[data-level='starter'], html[data-level='captain'] .fw-line[data-level='captain'] { display: block; }

/* ---- dialogs are taped paper */
.fw-dialog { border: 0; padding: 0; background: none; width: min(36rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 2rem); overflow: visible; color: var(--fhk-ink); }
.fw-dialog::backdrop { background: oklch(0.08 0.012 250 / 0.78); }
.fw-dialog > .fhk-paper { max-height: calc(100dvh - 2rem); overflow: auto; }
.fw-form { display: grid; gap: 0.85rem; }
.fw-form h2 { font-size: 1.5rem; margin: 0; }
.fw-form p { margin: 0; }
.fw-form label { display: grid; gap: 0.25rem; font-weight: 700; font-size: 0.9375rem; }
.fw-form label small { font-weight: 500; color: var(--fhk-ink-dim); }
.fhk-paper input:not([type='checkbox']):not([type='file']), .fhk-paper select, .fhk-paper textarea {
  width: 100%; min-height: 2.75rem; font: 600 1rem var(--fhk-body); color: var(--fhk-ink);
  background: oklch(1 0 0 / 0.55); border: 0; border-bottom: 2px solid var(--fhk-ink-dim); border-radius: 0.4rem 0.4rem 0 0; padding: 0.45rem 0.55rem;
}
.fhk-paper input:focus, .fhk-paper select:focus, .fhk-paper textarea:focus { outline: none; border-bottom-color: var(--fhk-ink); background: oklch(1 0 0 / 0.8); }
.fw-check { display: flex !important; grid-template-columns: none; gap: 0.6rem; align-items: flex-start; font-weight: 600 !important; }
.fw-check input { width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; accent-color: var(--fhk-ink); }
.fw-error { color: var(--fhk-marker); font-weight: 700; }
.fw-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-end; margin-top: 0.3rem; }
.fhk-paper .fhk-btn.quiet { color: var(--fhk-ink); background: oklch(0.86 0.025 88); box-shadow: inset 0 -0.22em 0 oklch(0.74 0.03 85); }
.fhk-paper .fhk-btn.quiet:hover { background: oklch(0.9 0.025 88); }
.fw-choice { display: grid; gap: 0.6rem; }
.fw-choice button { text-align: left; display: grid; gap: 0.15rem; padding: 0.85rem 1rem; border-radius: 0.625rem; border: 2px solid oklch(0.24 0.016 250 / 0.25); background: oklch(1 0 0 / 0.45); color: var(--fhk-ink); font: 500 0.9375rem var(--fhk-body); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.fw-choice button:hover, .fw-choice button:focus-visible { border-color: var(--fhk-ink); background: oklch(1 0 0 / 0.75); }
.fw-choice b { font-size: 1.05rem; }

/* ---- a word that comes and goes: a strip of tape at the bottom */
.fw-toast { position: fixed; left: 50%; bottom: 5.5rem; z-index: 50; transform: translateX(-50%) rotate(-1deg); font-size: 1.05rem; padding: 0.5em 1.2em; box-shadow: 0 0.3rem 0 oklch(0.08 0.01 250 / 0.6); }
.fw-toast button { margin-left: 0.8rem; font: 800 0.875rem var(--fhk-body); text-transform: uppercase; letter-spacing: 0.08em; background: none; border: 0; color: var(--fhk-marker); cursor: pointer; text-decoration: underline; }

/* ---- the bar on the bottom edge that holds a page's buttons (DESIGN.md: "Layout") */
.fw-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; align-items: center; padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom)); background: oklch(0.1 0.014 250 / 0.95); border-top: 1px solid oklch(0.3 0.02 250); }

/* ---- the scoreboard's numbers */
.fw-score { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.6rem; text-align: center; }
.fw-score .fhk-bulbs { font-size: clamp(2rem, 6vw, 3rem); display: block; }
.fw-score small { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fhk-chalk-dim); margin-top: 0.3rem; }

/* ---- drawn icons (FHF.icon): lines, never a device's emoji */
.fw .fw-icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; display: inline-block; }

/* ---- the foot */
.fw-foot { max-width: 80rem; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 8rem; color: var(--fhk-chalk-dim); font-size: 0.875rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.fw-foot a { color: var(--fhk-chalk-dim); }
@media print { body.fw::before, .fw-top, .fw-bar, .fw-foot { display: none !important; } }
