:root { --paper: #f4ecd8; --ink: #15120e; --soft: #6d6453; --line: #cdbf9f; --pink: #e8457a; --sel: #ffd84a; --word: #bfe3f2; --theme: #f9c9d9; --bad: #c62828;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; --sans: system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-user-select: none; user-select: none; touch-action: manipulation;
  background-image: radial-gradient(rgba(21,18,14,.045) 1px, transparent 1px); background-size: 5px 5px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.mast { max-width: 1120px; margin: 0 auto; padding: 18px 18px 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; border-bottom: 3px double var(--ink); }
.kicker { margin: 0 0 2px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--pink); }
h1 { margin: 0; font-family: var(--serif); font-size: clamp(21px, 3.4vw, 36px); line-height: 1.05; letter-spacing: -.01em; }
.by { margin: 4px 0 0; font-family: var(--serif); font-style: italic; color: var(--soft); font-size: 14px; }
.tools { display: flex; align-items: center; gap: 10px; flex: none; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; }
.menu { position: relative; }
#menuBtn { border: 2px solid var(--ink); padding: 7px 12px; font-weight: 700; background: var(--paper); box-shadow: 3px 3px 0 var(--ink); }
#menuBtn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.pop { position: absolute; right: 0; top: calc(100% + 8px); background: #fffaf0; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); z-index: 10; min-width: 170px; padding: 4px; }
.pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; font-weight: 600; }
.pop button:hover { background: var(--sel); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 3px 0; }
main { max-width: 1120px; margin: 0 auto; padding: 16px 18px 40px; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 26px; align-items: start; }
.left { position: sticky; top: 10px; }
.board { display: grid; grid-template-columns: repeat(15, 1fr); aspect-ratio: 1; width: 100%; background: var(--ink); border: 3px solid var(--ink); gap: 1px; outline: none; touch-action: manipulation; container-type: inline-size; }
.cell { background: #fffdf6; position: relative; display: grid; place-items: center; font-weight: 700; font-size: 4.1cqw; line-height: 1; padding-top: 14%; text-transform: uppercase; cursor: pointer; overflow: hidden; }
.cell.blk { background: var(--ink); cursor: default; }
.cell i { position: absolute; top: 2%; left: 5%; font-style: normal; font-weight: 500; font-size: 1.75cqw; color: #3a342b; }
.cell.theme { background: var(--theme); }
.cell.word { background: var(--word); }
.cell.sel { background: var(--sel); }
.cell.bad::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 1px), var(--bad) calc(50% - 1px), var(--bad) calc(50% + 1px), transparent calc(50% + 1px)); pointer-events: none; }
.cell.rev { color: #1565c0; }
.cell.pop { animation: pop .18s; }
@keyframes pop { from { transform: scale(1.25); } }
.cluebar { display: flex; align-items: center; gap: 6px; background: var(--word); border: 2px solid var(--ink); margin-top: 10px; min-height: 52px; }
.cluebar p { flex: 1; margin: 0; padding: 6px 2px; font-family: var(--serif); font-size: 16px; line-height: 1.25; }
.cluebar p b { font-family: var(--sans); font-size: 13px; margin-right: 6px; }
.cluebar button { width: 40px; align-self: stretch; font-size: 26px; font-weight: 700; }
.kbd { display: none; margin-top: 8px; }
.kbd div { display: flex; justify-content: center; gap: 4px; margin-bottom: 5px; }
.kbd button { flex: 1; max-width: 42px; height: 46px; background: #fffaf0; border: 1.5px solid var(--ink); border-radius: 5px; font-weight: 700; font-size: 17px; box-shadow: 0 2px 0 var(--ink); }
.kbd button:active { background: var(--sel); transform: translateY(2px); box-shadow: none; }
.kbd button.wide { max-width: 60px; flex: 1.5; font-size: 18px; }
@media (pointer: coarse) { .kbd { display: block; } }
.clues { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.clues h2 { font-family: var(--serif); font-size: 19px; margin: 0 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--ink); position: sticky; top: 0; background: var(--paper); }
.clues ol { list-style: none; margin: 0; padding: 0; }
.clues li { display: flex; gap: 8px; padding: 5px 6px; font-family: var(--serif); font-size: 15.5px; line-height: 1.3; cursor: pointer; border-left: 4px solid transparent; }
.clues li b { font-family: var(--sans); font-size: 13px; min-width: 20px; text-align: right; padding-top: 1px; }
.clues li.on { background: var(--word); border-left-color: var(--ink); }
.clues li.cross { border-left-color: var(--line); }
.clues li.done { color: #9a917f; }
#toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(30px); background: var(--ink); color: var(--paper); padding: 11px 18px; font-weight: 700; opacity: 0; transition: .25s; pointer-events: none; z-index: 30; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%); }
#modal:empty { display: none; }
#modal { position: fixed; inset: 0; background: rgba(21,18,14,.6); display: grid; place-items: center; z-index: 40; padding: 18px; overflow: hidden; }
.sheet { background: #fffaf0; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--pink); padding: 26px 24px; max-width: 420px; text-align: center; animation: land .5s cubic-bezier(.3,1.5,.5,1); }
@keyframes land { from { transform: translateY(-120vh) rotate(-6deg); } }
.sheet .foot { font-size: 84px; line-height: 1; display: block; animation: stomp .6s .45s cubic-bezier(.5,0,.8,.4) backwards; }
@keyframes stomp { from { transform: translateY(-140vh); } }
.sheet h2 { font-family: var(--serif); font-size: 30px; margin: 8px 0 6px; line-height: 1.1; }
.sheet p { font-family: var(--serif); font-size: 17px; margin: 0 0 6px; color: #3a342b; }
.sheet .time { font-family: var(--sans); font-weight: 800; font-size: 34px; margin: 10px 0; color: var(--ink); }
.sheet button { margin-top: 12px; border: 2px solid var(--ink); padding: 10px 20px; font-weight: 700; background: var(--sel); box-shadow: 3px 3px 0 var(--ink); }
@media (min-width: 861px) { .clues > div { max-height: calc(100dvh - 130px); overflow-y: auto; padding-right: 6px; } }
@media (max-width: 860px) {
  main { grid-template-columns: 1fr; padding: 10px 8px 30px; gap: 16px; }
  .left { position: static; max-width: 560px; margin: 0 auto; width: 100%; }
  .mast { padding: 10px 10px 8px; align-items: center; }
  .kicker { font-size: 10px; } .by { display: none; }
  .clues { max-width: 560px; margin: 0 auto; gap: 12px; }
  .clues li { font-size: 14.5px; }
}
