/* Daily Crossword only: the clue bar (a paper strip), the Across / Down lists laid over Wren's notepad (a pull-up sheet
   on phones), the tool row and the letter keys. Everything else comes from ../shared/game.css. --cw-accent is the
   place's colour (set by cw-hud.js each level). */
:root{--cw-paper:#fbf6e8;--cw-ink:#231d18;--cw-accent:#ffcf5c;--cw-soft:#6f6658}
#screen{touch-action:manipulation;user-select:none;-webkit-user-select:none}
canvas#world{cursor:pointer;border-radius:10px}
canvas#world:focus{outline:none}
.game{gap:8px}
.progress-fill{background:linear-gradient(90deg,#f2cf86,#a9d49a,#9cc0e0,#c7b0e6,#f2b27a);transition:width .25s ease-out}
.progress-label.warn{color:#ffb4a0}

/* the current clue: a strip of paper */
.cw-bar{display:flex;gap:8px;align-items:stretch}
.cw-clue{flex:1;height:50px;overflow:hidden;display:flex;align-items:center;gap:10px;padding:6px 14px;cursor:pointer;
  background:linear-gradient(180deg,#fffaf0,#f3ead6);color:var(--cw-ink);border-radius:12px;
  box-shadow:inset 0 0 0 1px #00000014,0 6px 14px -8px #000;font:600 16px/1.3 "Plus Jakarta Sans",system-ui,sans-serif;
  -webkit-user-select:text;user-select:text}
.cw-clue b{flex:none;font:800 13px/1 "Plus Jakarta Sans",system-ui,sans-serif;letter-spacing:.05em;color:var(--cw-ink);
  background:var(--cw-accent);padding:6px 8px;border-radius:8px}
.cw-clue span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.cw-clue:focus-visible{outline:3px solid var(--cyan);outline-offset:2px}
.cw-step{flex:none;width:44px;font:800 24px/1 "Plus Jakarta Sans",system-ui,sans-serif;color:var(--ink);background:var(--panel);
  border:2px solid var(--line);border-radius:12px;cursor:pointer;touch-action:manipulation}
.cw-step:hover{border-color:var(--cw-accent)}
.cw-step:active{transform:scale(.95)}
.cw-step:focus-visible{outline:3px solid var(--cyan);outline-offset:2px}

/* the clue lists on Wren's notepad (placed by cw-hud.js over the canvas) */
.cw-clues{position:absolute;display:grid;grid-template-columns:1fr 1fr;gap:10px;color:var(--cw-ink);z-index:2}
.cw-clues.stacked{grid-template-columns:1fr;grid-template-rows:1fr 1fr;gap:6px}
.game:has(#start:not([hidden])) .cw-clues,.game:has(#over:not([hidden])) .cw-clues{visibility:hidden}
.cw-col{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#0003 transparent;padding-right:2px}
.cw-col h3{position:sticky;top:0;margin:0;padding:2px 6px 4px;font:800 15px/1.2 "Bricolage Grotesque",system-ui,sans-serif;
  letter-spacing:.02em;color:var(--cw-ink);background:linear-gradient(#fff4d2 75%,#fff4d200);z-index:1}
.cw-col ol{list-style:none;margin:0;padding:0}
.cw-col li{display:flex;gap:8px;padding:4px 6px;border-radius:7px;cursor:pointer;font:500 13px/1.32 "Plus Jakarta Sans",system-ui,sans-serif;
  transition:background-color .18s ease,opacity .18s ease}
.cw-col li b{flex:none;min-width:1.6em;text-align:right;font-weight:800}
.cw-col li:hover{background:#0000000d}
.cw-col li.cross{background:#00000012}
.cw-col li.on{background:var(--cw-accent);box-shadow:0 2px 0 #0000001a}
.cw-col li.done:not(.on){opacity:.42}
.cw-close{display:none}

/* tools */
.cw-tools{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.cw-tools .tool{display:flex;align-items:center;gap:7px;padding:9px 14px;font:700 13px "Plus Jakarta Sans",system-ui,sans-serif;
  border-radius:12px;cursor:pointer;touch-action:manipulation;transition:border-color .15s,background-color .15s,transform .08s}
.cw-tools .tool .ico{font-size:14px;color:var(--cw-accent)}
.cw-tools .tool kbd{font:11px ui-monospace,Menlo,monospace;color:var(--muted);background:#ffffff10;border-radius:5px;padding:1px 5px}
.cw-tools .tool:hover{border-color:var(--cw-accent)}
.cw-tools .tool.on{border-color:var(--cw-accent);background:#ffcf5c22;color:#fff3cf}
#cluesTool{display:none}

/* letter keys: touch screens and narrow windows */
.keys{display:none;gap:6px}
.key-row{display:flex;gap:5px;justify-content:center}
.key{flex:1;max-width:44px;padding:12px 0;font:800 15px "Plus Jakarta Sans",system-ui,sans-serif;color:var(--cw-ink);
  background:linear-gradient(180deg,#fffaf0,#e9dfc8);border:0;border-radius:8px;box-shadow:0 2px 0 #00000055;cursor:pointer;touch-action:manipulation}
.key.wide{max-width:58px;flex:1.4;font-size:17px;background:linear-gradient(180deg,#3a3350,#2a2440);color:var(--ink)}
.key:active{transform:translateY(1px);box-shadow:0 1px 0 #00000055}
.key:focus-visible{outline:3px solid var(--cyan);outline-offset:2px}
@media (pointer:coarse),(max-width:760px){
  .keys{display:grid}
  .cw-tools .tool kbd{display:none}
}
/* upright phones: the clue lists become a sheet over the grid (Clues button), tools in one tight row */
.cw-clues.sheet{display:none;inset:0;padding:14px 12px 10px;background:linear-gradient(180deg,#fff7dc,#f6e8bf);border-radius:14px;
  box-shadow:0 20px 40px -20px #000;grid-template-columns:1fr;grid-template-rows:1fr 1fr}
.cw-clues.sheet.open{display:grid}
.cw-clues.sheet .cw-close{display:block;position:absolute;right:8px;top:6px;z-index:3;width:36px;height:36px;border:0;border-radius:10px;
  background:#00000014;color:var(--cw-ink);font:800 16px "Plus Jakarta Sans",system-ui,sans-serif;cursor:pointer}
.game:has(.cw-clues.sheet) #cluesTool{display:flex}
@media (max-width:760px){
  .game{padding:8px 10px 10px;gap:6px}
  .cw-clue{height:50px;font-size:14px;line-height:1.25;padding:5px 10px}
  .cw-clue b{font-size:11px;padding:5px 6px}
  .cw-step{width:36px}
  .cw-tools{display:grid;grid-template-columns:repeat(5,1fr);gap:5px}
  .cw-tools .tool{flex-direction:column;gap:2px;padding:6px 2px;font-size:10.5px;border-radius:10px}
  .cw-tools .tool .ico{font-size:13px}
  .key{padding:11px 0;font-size:14px}
  .key-row{gap:4px}
  .keys{gap:5px}
}
@media (prefers-reduced-motion:reduce){.cw-col li,.cw-tools .tool,.progress-fill{transition:none}}
.progress-label{text-shadow:0 1px 2px #000,0 0 6px #000c}
/* nothing changes height while you play (a resize would re-fit the grid): the hint line and the clue bar keep their room */
@media (max-width:899px){.hud{grid-template-columns:minmax(0,1fr) auto}
  .hud .tip{grid-column:1/-1;order:3;height:2.7em;display:flex;align-items:center;justify-content:center;overflow:hidden;line-height:1.3}}
@media (min-width:900px) and (max-width:1131px){.hud{min-height:39px}}
