/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/367ba69ac0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/bec94a4daf.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/367ba69ac0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/bec94a4daf.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/367ba69ac0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/bec94a4daf.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/367ba69ac0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/bec94a4daf.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/c04dea5e3b.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/68039027a2.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/997f74927d.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/4aa9bb70e8.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/997f74927d.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/4aa9bb70e8.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Layout: a play column (clue bar over a square grid) beside two scrolling clue lists; on touch screens the grid
   takes the width and a dock with the clue bar and a Hungarian keyboard sits at the bottom. */
:root {
  --paper: #FBFBFA;
  --ink: #16181B;
  --muted: #676C74;
  --rule: #DCDDE0;
  --cell: #FFFFFF;
  --block: #16181B;
  --sel: #9FD8C0;
  --word: #E0F1E9;
  --accent: #1B6A50;
  --wrong: #C8371F;
  --pencil: #8A9097;
  --shade: rgba(22, 24, 27, .10);
  --display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gap: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111315; --ink: #E7E8EA; --muted: #9A9FA6; --rule: #2B2E32; --cell: #1C1F22; --block: #08090A;
    --sel: #2D6E57; --word: #1C342B; --accent: #6FCCA7; --wrong: #FF7C68; --pencil: #858B93; --shade: rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111315; --ink: #E7E8EA; --muted: #9A9FA6; --rule: #2B2E32; --cell: #1C1F22; --block: #08090A;
  --sel: #2D6E57; --word: #1C342B; --accent: #6FCCA7; --wrong: #FF7C68; --pencil: #858B93; --shade: rgba(0, 0, 0, .45);
  color-scheme: dark;
}

html, body { background: var(--paper); }
body { color: var(--ink); font: 15px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.app {
  max-width: 1120px; margin: 0 auto;
  padding-block: 14px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Masthead */
.mast { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-bottom: 12px; }
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand h1 { margin: 0; font: 600 30px/1 var(--display); letter-spacing: -.01em; }
.brand span { color: var(--muted); font-size: 13px; }
.brand .logo { font: 600 30px/1 var(--display); letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.datebar { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.datebar .d { min-width: 0; height: 32px; padding: 0 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.datebar .d:hover, .datebar .d[aria-expanded="true"] { background: var(--word); }
.iconbtn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--ink); }
.iconbtn:hover:not(:disabled) { background: var(--word); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.today { font-size: 13px; color: var(--accent); font-weight: 600; padding: 4px 6px; }

/* Toolbar */
.tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-block: 1px solid var(--rule); padding-block: 6px; margin-bottom: 18px; }
.tools .left, .tools .right { display: flex; align-items: center; gap: 2px; }
.timer { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer:hover { background: var(--word); }
.timer[hidden] { display: none; }
.timer .ic-done, .timer.done .ic-pause { display: none; }
.timer.done .ic-done { display: block; color: var(--accent); }
.level { color: var(--muted); font-size: 13px; padding-left: 8px; }
.tool { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 6px; font-size: 14px; }
.tool:hover { background: var(--word); }
.tool[aria-pressed="true"], .tool[aria-expanded="true"] { background: var(--word); color: var(--accent); }
.menu { position: relative; }
.pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; padding: 6px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 10px 30px var(--shade);
  display: grid;
}
.pop button { text-align: left; padding: 8px 10px; border-radius: 5px; font-size: 14px; display: flex; justify-content: space-between; gap: 12px; }
.pop button:hover { background: var(--word); }
.pop hr { border: 0; border-top: 1px solid var(--rule); margin: 6px 4px; }
.pop .on::after { content: "✓"; color: var(--accent); font-weight: 700; }

/* Archive calendar */
.pop.cal { min-width: 0; width: 300px; padding: 12px; gap: 10px; }
.cal-h { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; text-align: center; }
.cal-h b { font: 600 17px/1.2 var(--display); }
.cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-g .wd { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.pop.cal .cal-g button {
  position: relative; display: grid; place-items: center; padding: 0; height: 36px; border-radius: 6px;
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.pop.cal .cal-g button:disabled { color: var(--muted); opacity: .45; cursor: default; }
.pop.cal .cal-g button:disabled:hover { background: none; }
.cal-g button.today { font-weight: 700; box-shadow: inset 0 0 0 1px var(--ink); }
.cal-g button.cur { background: var(--sel); }
.cal-g button.solved::after, .cal-g button.started::after {
  content: ""; position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
}
.cal-g button.solved::after { background: var(--accent); }
.cal-g button.started::after { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-f { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.cal-f b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Board */
.board { position: relative; display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 36px; align-items: stretch; }
.play { min-width: 0; display: grid; gap: 14px; align-content: start; }
.dock { display: grid; gap: 0; }
.cluebar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; background: var(--word); border-radius: 6px; min-height: 64px; }
.cluebar .txt { padding: 8px 4px; cursor: pointer; min-width: 0; }
.cluebar .lab { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.cluebar .clue { font: 400 19px/1.25 var(--display); text-wrap: balance; }
.cluebar .iconbtn { width: 40px; height: 64px; }
.cluebar .iconbtn:hover { background: transparent; color: var(--accent); }

.gridwrap { position: relative; width: min(100%, calc(var(--cols) * 46px)); container-type: inline-size; }
.grid {
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 1px;
  background: var(--block); border: 2px solid var(--block); outline: none;
}
.grid:focus-visible { outline: none; }
.cell {
  position: relative; aspect-ratio: 1; background: var(--cell); display: grid; place-items: center;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  font: 500 calc(100cqw / var(--cols) * .54)/1 var(--ui);
}
.cell.blk { background: var(--block); cursor: default; }
.cell .n { position: absolute; top: 5%; left: 7%; font-size: max(8px, calc(100cqw / var(--cols) * .25)); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.cell .c { padding-top: 14%; }
.cell.word { background: var(--word); }
.cell.sel { background: var(--sel); }
.cell.pen .c { color: var(--pencil); font-weight: 400; }
.cell.ok .c { color: var(--accent); }
.cell.bad::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top right, transparent calc(50% - .75px), var(--wrong) calc(50% - .75px), var(--wrong) calc(50% + .75px), transparent calc(50% + .75px));
}
.cell.rev::before {
  content: ""; position: absolute; top: 0; right: 0; width: 26%; height: 26%; pointer-events: none;
  background: linear-gradient(to bottom left, var(--accent) 50%, transparent 50%);
}
.solved .cell.sel, .solved .cell.word { background: var(--cell); }
/* Solved: one wave across the grid, corner to corner, then still. */
.wave .cell:not(.blk) { animation: wave .55s ease-in-out calc(var(--i) * 22ms) both; }
@keyframes wave { 45% { background: var(--sel); } }

/* Clue lists */
.lists { position: relative; min-width: 0; }
.lists .in { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }
.list { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.list h2 { margin: 0; padding: 0 0 8px; border-bottom: 1px solid var(--rule); font: 600 12px/1.2 var(--ui); letter-spacing: .1em; text-transform: uppercase; }
.list ol { list-style: none; margin: 0; padding: 4px 0 0; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.list li { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); gap: 4px; padding: 6px 8px 6px 6px; border-radius: 5px; cursor: pointer; font: 400 16px/1.3 var(--display); }
.list li b { font: 600 13px/1.6 var(--ui); text-align: right; padding-right: 4px; font-variant-numeric: tabular-nums; }
.list li:hover { background: var(--word); }
.list li.on { background: var(--sel); }
.list li.x { box-shadow: inset 3px 0 0 var(--sel); }
.list li.full { color: var(--muted); }

/* Pause cover */
.cover { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--paper); text-align: center; }
.cover h2 { margin: 0 0 6px; font: 600 26px/1.2 var(--display); }
.cover p { margin: 0 0 18px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 20px; font-weight: 600; background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }

/* Dialogs */
dialog { border: 1px solid var(--rule); border-radius: 12px; padding: 0; background: var(--paper); color: var(--ink); width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px var(--shade); }
dialog::backdrop { background: rgba(10, 12, 14, .35); }
.dlg { padding: 26px 26px 22px; display: grid; gap: 14px; }
.dlg h2 { margin: 0; font: 600 26px/1.15 var(--display); text-wrap: balance; }
.dlg p { margin: 0; }
.dlg ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.dlg .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 0; border-block: 1px solid var(--rule); }
.stats b { display: block; font: 600 28px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 13px; }
.note { color: var(--muted); font-size: 13px; }
kbd { font: 600 12px/1 var(--ui); padding: 2px 5px; border: 1px solid var(--rule); border-radius: 4px; background: var(--cell); }
.set { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.set input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Website only: link to a past day's solution, footer, solution and archive pages */
.sol-link { margin: 28px 0 0; }
a { color: var(--accent); text-underline-offset: 3px; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.page h1 { margin: 0 0 6px; font: 600 30px/1.15 var(--display); text-wrap: balance; }
.page .sub { margin: 0 0 24px; color: var(--muted); }
.sol { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 36px; align-items: start; }
.sol .gridwrap { width: min(100%, calc(var(--cols) * 40px)); }
.sol ol { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 6px; }
.sol li { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); font: 400 16px/1.35 var(--display); }
.sol li b { font: 600 13px/1.6 var(--ui); text-align: right; padding-right: 6px; }
.sol li em { font: 600 13px/1.6 var(--ui); font-style: normal; letter-spacing: .06em; color: var(--accent); }
.arch { display: grid; gap: 28px; }
.arch h2 { margin: 0 0 10px; font: 600 20px/1.2 var(--display); }
.arch ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 28px; }
.arch li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 14px; white-space: nowrap; }
.arch li span { color: var(--muted); }
@media (max-width: 760px) { .sol { grid-template-columns: minmax(0, 1fr); } }

/* Intro and questions under the game */
.about { max-width: 68ch; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--rule); }
.about h2 { margin: 0 0 10px; font: 600 24px/1.2 var(--display); text-wrap: balance; }
.about > p { margin: 0 0 18px; color: var(--ink); }
.faq { display: grid; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--muted); }
.faq details[hidden] { display: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--dock-h, 0px) + env(safe-area-inset-bottom, 0px)); z-index: 50;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 20px; font-size: 14px; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* On-screen keyboard (touch only) */
.kbd { display: none; }

@media (max-width: 959px) {
  .board { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .play { justify-items: center; }
  .play > * { width: 100%; max-width: 600px; }
  .gridwrap { width: min(100%, calc(var(--cols) * 46px)); }
  .lists .in { position: static; }
  .list ol { overflow: visible; }
}
@media (max-width: 640px) {
  .pop.cal { position: fixed; left: 50%; right: auto; top: 64px; transform: translateX(-50%); width: min(300px, calc(100vw - 32px)); }
  .brand h1 { font-size: 26px; }
  .datebar .yr { display: none; }
  .datebar .d { padding: 0 2px; }
  .lists .in { grid-template-columns: minmax(0, 1fr); }
  .tool .lbl { display: none; }
  .tool { padding: 0 8px; }
  .brand span { display: none; }
}

@media (pointer: coarse) {
  .tool .lbl { display: none; }
  .tool { padding: 0 9px; }
  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; gap: 6px;
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    background: var(--paper); border-top: 1px solid var(--rule);
  }
  .play > .dock { width: auto; max-width: none; }
  .cluebar { min-height: 52px; }
  .cluebar .iconbtn { height: 52px; }
  .cluebar .clue { font-size: 17px; }
  .app { padding-bottom: calc(var(--dock-h, 220px) + 24px); }
  .kbd { display: grid; gap: 6px; }
  .kbd .r { display: flex; gap: 4px; justify-content: center; }
  .kbd button {
    flex: 1 1 0; max-width: 44px; height: 44px; border-radius: 5px; background: var(--cell);
    box-shadow: 0 1px 0 var(--rule), inset 0 0 0 1px var(--rule); font: 500 17px/1 var(--ui);
  }
  .kbd button.wide { flex: 1.5 1 0; max-width: 64px; display: grid; place-items: center; }
  .kbd button:active { background: var(--sel); }
  .kbd button[aria-pressed="true"] { background: var(--word); color: var(--accent); }
}

.paused .dock { visibility: hidden; }

@media (prefers-reduced-motion: reduce) { .toast { transition: none; } .wave .cell { animation: none; } }

/* Paper: an empty grid and every clue, nothing else. */
@media print {
  @page { margin: 14mm; }
  :root { --paper: #fff; --ink: #000; --cell: #fff; --block: #000; --rule: #999; --muted: #444; }
  body { background: #fff; }
  .tools, .datebar button:not(.d), .datebar .menu .pop, .dock, .cover, .about, .toast, dialog, .brand span { display: none !important; }
  .datebar .d { display: inline; padding: 0; }
  .app { max-width: none; padding: 0; }
  .mast { padding-bottom: 6mm; }
  .board { display: block; }
  .gridwrap { width: min(100%, calc(var(--cols) * 11mm)); margin-bottom: 8mm; break-inside: avoid; }
  .cell .c { visibility: hidden; }
  .cell.sel, .cell.word { background: #fff; }
  .cell.rev::before, .cell.bad::after { display: none; }
  .lists .in { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; }
  .list ol { overflow: visible; }
  .list li { padding: 1.2mm 0; font-size: 11pt; break-inside: avoid; }
  .list li.on, .list li.x, .list li.full { background: none; box-shadow: none; color: #000; }
}
