/* Kids Menu. REFERENCE: a diner kids' menu on a checkered tablecloth.
   COMMITMENT: a faint red-and-white diner tablecloth; the menu sits on it as real paper.
   Everything on the paper is pure black on white (Jeff's B&W laser prints grey as fuzzy
   dots), so the screen shows exactly what prints. One radius for UI (12px); the menu
   cards use the rounded diner look. Fredoka for the menu, Archivo for the controls,
   Comic Sans for the famous game (Comic Neue where a device has none). */
:root {
    --ink: #000;
    --paper: #fff;
    /* Red-and-white diner check, kept faint so the menu stays the thing you look at
       (Jeff, 2026-11-11: "more white and red checker and less distracting"). */
    --cloth: rgba(206, 43, 43, 0.075);
    --cloth-bg: #fffdfb;
    --r: 12px;
    --ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --menu: "Fredoka", "Archivo", Arial, sans-serif;
    --comic: "Comic Sans MS", "Comic Neue", "Chalkboard SE", cursive;
}
@media (prefers-color-scheme: dark) {
    :root { --cloth: rgba(206, 43, 43, 0.14); --cloth-bg: #161212; }
    .top { color: #fff; }
    .top .logo { background: #fff; }
    .home-link { color: #fff; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; color: var(--ink); font: 400 16px/1.4 var(--ui);
    background-color: var(--cloth-bg);
    background-image: linear-gradient(90deg, var(--cloth) 50%, transparent 50%), linear-gradient(var(--cloth) 50%, transparent 50%);
    background-size: 64px 64px;
}
h1, h2, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #000; outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; border: 2px solid #000; padding: 8px 12px; z-index: 5; }
.skip:focus { left: 16px; }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1280px; margin: 0 auto; padding: 16px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.logo { background: #fff; border-radius: var(--r); padding: 5px; border: 2px solid #000; }
.logo img { height: 64px; width: auto; }
.brand-name { display: block; font: 700 40px/1 var(--menu); letter-spacing: 0.01em; text-transform: uppercase; }
.brand-line { display: block; font-size: 15px; margin-top: 4px; }
.home-link { font-weight: 800; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
.top .brand-name, .top .brand-line { background: var(--cloth-bg); padding: 0 4px; }
@media (max-width: 560px) { .logo img { height: 48px; } .brand-name { font-size: 30px; } }

/* The table: order pad + the menu */
.table { display: grid; gap: 24px; max-width: 1280px; margin: 0 auto; padding: 0 16px 48px; align-items: start; }
@media (min-width: 1180px) { .table { grid-template-columns: 300px 1fr; } .pad { position: sticky; top: 16px; } }

/* Order pad */
.pad { background: #fff; border: 2px solid #000; border-radius: var(--r); padding: 16px; display: grid; gap: 16px; }
.pad-title { font: 700 22px/1 var(--menu); text-transform: uppercase; letter-spacing: 0.04em; padding-bottom: 12px; border-bottom: 3px dotted #000; }
.field { display: grid; gap: 8px; }
.lbl { font: 800 13px/1 var(--ui); text-transform: uppercase; letter-spacing: 0.1em; }
.daynav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.day { text-align: center; }
.day b { display: block; font: 700 20px/1.1 var(--menu); }
.day small { display: block; font-size: 13px; margin-top: 2px; }
.arrow { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid #000; border-radius: var(--r); background: #fff; cursor: pointer; transition: background-color 150ms ease-out, color 150ms ease-out; }
.arrow:hover:not(:disabled) { background: #000; color: #fff; }
.arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.linkish { justify-self: center; background: none; border: 0; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; padding: 0 8px; }
.segs { display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid #000; border-radius: var(--r); overflow: hidden; }
.seg { min-height: 44px; border: 0; background: #fff; font: 700 16px/1 var(--menu); cursor: pointer; transition: background-color 150ms ease-out, color 150ms ease-out; }
.seg + .seg { border-left: 2px solid #000; }
.seg:hover { text-decoration: underline; text-underline-offset: 3px; }
.seg[aria-pressed="true"] { background: #000; color: #fff; }
.sets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.set { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 8px; border: 2px solid #000; border-radius: var(--r); background: #fff; cursor: pointer; text-align: left; transition: transform 150ms ease-out; }
.set:hover { transform: translateY(-1px); }
.set[aria-pressed="true"] { outline: 3px solid #000; outline-offset: 2px; }
.set[aria-pressed="true"] .set-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.set-art { display: flex; flex: none; }
.set-art img { width: 30px; height: 30px; }
.lt { width: 26px; height: 26px; margin: 2px; border-radius: 50%; border: 2px solid #000; display: grid; place-items: center; font: 800 14px/1 var(--ui); background: #fff; }
.lt.dk { background: #000; color: #fff; }
.set-name { font: 600 15px/1.15 var(--menu); }
.set-name small { display: block; font: 400 12px/1.2 var(--ui); }
.row-field { grid-template-columns: 1fr auto; align-items: center; }
.switch { width: 58px; height: 34px; border-radius: 999px; border: 2px solid #000; background: #fff; position: relative; cursor: pointer; }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #000; transition: transform 150ms ease-out; }
.switch[aria-checked="true"] { background: #000; }
.switch[aria-checked="true"] span { background: #fff; transform: translateX(24px); }
.btn { min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 2px solid #000; border-radius: var(--r); background: #000; color: #fff; font: 800 15px/1 var(--ui); text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; transition: background-color 150ms ease-out, color 150ms ease-out; }
.btn:hover:not(:disabled) { background: #fff; color: #000; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn.big { min-height: 56px; font-size: 17px; width: 100%; }
.note { font-size: 13px; line-height: 1.35; }
.classset { border-top: 3px dotted #000; padding-top: 14px; }
.classrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.classrow input { width: 72px; min-height: 44px; border: 2px solid #000; border-radius: var(--r); padding: 0 10px; font: 700 18px/1 var(--ui); background: #fff; color: #000; }
.classrow input:hover { border-width: 3px; padding: 0 9px; }
.classrow .btn { flex: 1 1 100%; }

/* The menu: two sheets of paper on the cloth */
.menu { display: grid; gap: 28px; justify-items: center; min-width: 0; }
.sheet { display: grid; gap: 28px; width: 100%; justify-items: center; }
.page { position: relative; width: 100%; max-width: 8.5in; background: #fff; padding: 0.35in 0.4in; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.18); font: 400 15px/1.35 var(--menu); }
.page::before { position: absolute; top: -22px; left: 0; font: 800 12px/1 var(--ui); text-transform: uppercase; letter-spacing: 0.12em; background: #000; color: #fff; padding: 5px 8px; border-radius: 6px 6px 0 0; }
.front::before { content: "Front"; }
.back::before { content: "Back"; }
@media (max-width: 640px) { .page { padding: 14px; } }
.loading { background: #fff; border: 2px solid #000; border-radius: var(--r); padding: 32px; text-align: center; font: 600 20px/1.3 var(--menu); width: 100%; max-width: 8.5in; display: grid; gap: 16px; justify-items: center; }
.err { font-style: italic; }

/* Inside the menu */
.head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border: 3px solid #000; border-radius: 18px; padding: 8px 16px; }
.head img { height: 64px; width: auto; }
.head h1 { font: 700 30px/1 var(--menu); text-transform: uppercase; letter-spacing: 0.01em; }
.head .tag { font-size: 14px; margin-top: 4px; }
.sheet-no { display: inline-block; margin-left: 6px; border: 2px solid #000; border-radius: 999px; padding: 0 8px; font-weight: 600; }
.name { font-weight: 600; white-space: nowrap; }
.name span { display: inline-block; width: 150px; border-bottom: 2px solid #000; margin-left: 6px; }
@media (max-width: 640px) { .head { grid-template-columns: auto 1fr; } .name { grid-column: 1 / -1; } .head h1 { font-size: 22px; } .head img { height: 48px; } }
.minihead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: 14px; border-bottom: 3px solid #000; padding-bottom: 6px; }
.course { margin-top: 12px; border: 2px dashed #000; border-radius: 18px; padding: 10px 14px 12px; break-inside: avoid; min-width: 0; }
.course h2 { display: flex; align-items: baseline; gap: 8px; font: 700 17px/1.2 var(--menu); margin-bottom: 8px; }
.course h2 .what { text-transform: uppercase; letter-spacing: 0.03em; }
.course h2 .lead { flex: 1; border-bottom: 3px dotted #000; transform: translateY(-4px); min-width: 12px; }
.course h2 .price { font-weight: 600; font-size: 14px; white-space: nowrap; }
.row { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .row { grid-template-columns: 1fr 1fr; } }
.turn { text-align: right; font-weight: 600; margin-top: 10px; font-size: 14px; }

.board { display: block; width: 100%; height: auto; }
.board .co { font: 600 11px var(--menu); fill: #000; }
.board .pl { font: 700 25px var(--ui); }
.m1 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; }
@media (min-width: 700px) { .m1 { grid-template-columns: repeat(4, 1fr); } }
.pz figcaption { font-size: 13.5px; margin-top: 4px; }
.pz .line { display: block; border-bottom: 1.5px solid #000; height: 20px; }
.course > .pz .board { max-width: 300px; }

.who { font: 400 15px/1.3 var(--comic); margin-bottom: 6px; }
.game { display: grid; gap: 8px; }
.moves { font: 400 16px/1.5 var(--comic); }
.mv { white-space: nowrap; }
.game .pz .board { max-width: 200px; }
.game .pz figcaption { font: 400 13.5px/1.35 var(--comic); }

.ws { display: grid; gap: 8px; justify-items: start; }
.grid { border-collapse: collapse; border: 2px solid #000; }
.grid td { width: 24px; height: 24px; text-align: center; font: 700 15px/1 var(--menu); padding: 0; }
.grid.n11 td { width: 22px; height: 22px; font-size: 14px; }
.find { font-weight: 600; font-size: 14px; display: grid; grid-template-columns: repeat(3, auto); gap: 0 14px; width: 100%; }
.find li { white-space: nowrap; }
.find li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.box { width: 13px; height: 13px; border: 2px solid #000; border-radius: 3px; flex: none; }
.hint { font-size: 12.5px; margin-top: 6px; }

.colorme { display: grid; justify-items: center; gap: 6px; }
.colorme img { width: 100%; max-width: 250px; height: auto; }
.namebox { width: 100%; font-weight: 600; }
.namebox .line { display: block; border-bottom: 1.5px solid #000; height: 22px; }
.fact { display: flex; flex-direction: column; }
.fact-text { font: 600 20px/1.35 var(--menu); padding: 6px 0; flex: 1; }
.sign { font-size: 12px; border-top: 2px solid #000; padding-top: 6px; }

/* Answers: upside down at the foot of the back, like a kids' menu */
.key { margin-top: 12px; display: flex; justify-content: center; }
.key > div { transform: rotate(180deg); border-top: 2px solid #000; padding-top: 6px; font-size: 13px; text-align: center; transition: transform 200ms ease-out; }
.key ol { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; }
body.show-answers .key > div { transform: none; outline: 3px solid #000; outline-offset: 6px; border-radius: 4px; font-size: 15px; }
body.show-answers .grid td.hit { background: #000; color: #fff; }

.set-print { display: none; }

/* Number tabs and the key's title bar: the PandaChess Panda-look worksheet's marks */
.tab { display: inline-block; min-width: 20px; padding: 1px 5px; background: #000; color: #fff; font: 700 13px/1.2 var(--ui); text-align: center; border-radius: 3px; margin-right: 3px; }
.keybar { display: inline-block; background: #000; color: #fff; font: 800 12px/1 var(--ui); text-transform: uppercase; letter-spacing: 0.1em; padding: 4px 8px; margin-bottom: 4px; }
.head { border-bottom-width: 5px; }

/* Settings: section names */
.settings { border-top: 3px dotted #000; padding-top: 12px; }
.settings summary { font: 800 13px/1.3 var(--ui); text-transform: uppercase; letter-spacing: 0.1em; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.settings summary:hover { text-decoration: underline; text-underline-offset: 3px; }
#pad-labels { display: grid; gap: 10px; margin-top: 8px; }
.lab { display: grid; gap: 4px; }
.lab label { font: 700 13px/1.2 var(--ui); }
.lab input { min-height: 40px; border: 2px solid #000; border-radius: 8px; padding: 0 10px; font: 500 15px/1 var(--menu); background: #fff; color: #000; width: 100%; }
.lab input.small { min-height: 34px; font: 400 13px/1 var(--ui); }
.lab input:hover { border-width: 3px; padding: 0 9px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Printing: only the paper. Each page is one letter page. */
@page { size: letter; margin: 0.3in; }
@media print {
    body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .top, .pad, .skip { display: none !important; }
    .table { display: block; padding: 0; max-width: none; }
    .menu, .sheet { display: block; }
    body.printing-set .table { display: none; }
    body.printing-set .set-print { display: block; }
    .page { box-shadow: none; padding: 0; max-width: none; break-after: page; }
    .page::before { display: none; }
    .sheet:last-child .page.back { break-after: auto; }
    body.show-answers .key > div { transform: rotate(180deg); outline: 0; font-size: 13px; }
    body.show-answers .grid td.hit { background: none; color: #000; }
    .row { grid-template-columns: 1fr 1fr; }
    .m1 { grid-template-columns: repeat(4, 1fr); }
}
