/* Create By Asking: the word scramble maker and cryptogram maker. Loaded after style.css, tools.css and
   family.css (for the form rows, textarea and print sheet basics); reuses the dark .tool-shell look. */

.pz { grid-template-columns: minmax(0, 1fr) 290px; align-items: start; gap: 22px 28px; scroll-margin-top: 84px; }
.pz > * { min-width: 0; }
.pz-board { display: grid; gap: 14px; align-content: start; background: rgba(255, 255, 255, 0.03); border-radius: 14px; padding: 16px 14px; }
.pz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pz-head h3 { font-size: var(--step-2); }
.pz-head span { font: 600 0.8rem/1 var(--mono); color: #FFC93C; }
.pz-msg { min-height: 1.3em; text-align: center; color: #FFE08F; font-size: var(--step--1); margin: 0; }
.pz-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pz-side { display: grid; gap: 14px; align-content: start; }
.pz-side .btn { justify-content: center; }
.pz-side .f-row > span { flex-basis: 100%; margin-bottom: 2px; }
.pz-side small { color: #A597CC; font-size: 0.75rem; line-height: 1.4; }
.pz > .tool-note { grid-column: 1 / -1; margin: 0; }

/* word scramble */
.sc-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sc-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.sc-num { font: 700 0.9rem/30px var(--mono); color: #A597CC; text-align: right; }
.sc-body { display: grid; gap: 8px; }
.sc-tiles { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-tile { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: #FFC93C; color: #1C0F3F; font: 700 1.05rem/1 var(--mono); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.sc-gap { width: 12px; }
.sc-clue { margin: 0; color: #CBBFE8; font-size: var(--step--1); font-style: italic; }
.sc-line { display: flex; gap: 8px; }
.tool-shell .sc-line input { flex: 1 1 0; width: 100%; min-width: 0; font: 700 1.05rem/1.2 var(--mono); letter-spacing: 0.08em; border: 2px solid rgba(255, 255, 255, 0.12); }
.sc-row.done { background: rgba(91, 212, 143, 0.12); }
.sc-row.done .sc-tile { background: #5BD48F; }
.tool-shell .sc-row.done input { border-color: #5BD48F; color: #5BD48F; opacity: 1; }
.tool-shell .sc-row.wrong input { border-color: #FF7A62; }
.tool-shell .sc-row.ans input { color: #FF9ED2; opacity: 1; }
.sc-line .btn:disabled { opacity: 0.35; cursor: default; }

/* cryptogram */
.cg-board { display: flex; flex-wrap: wrap; gap: 16px 18px; justify-content: center; padding: 6px 0; }
.cg-word { display: inline-flex; gap: 3px; align-items: flex-start; }
.cg-cell { display: grid; gap: 3px; justify-items: center; cursor: text; }
.tool-shell .cg-cell input { width: clamp(24px, 6.4vw, 34px); height: clamp(30px, 7.6vw, 40px); padding: 0; text-align: center; border-radius: 6px; border: 0; border-bottom: 3px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.06); font: 700 clamp(1rem, 3.6vw, 1.3rem)/1 var(--mono); color: #fff; text-transform: uppercase; caret-color: #FFC93C; }
.tool-shell .cg-cell input:focus { border-color: #FFC93C; background: rgba(255, 201, 60, 0.18); }
.cg-code { font: 600 clamp(0.72rem, 2.6vw, 0.9rem)/1 var(--mono); color: #A597CC; }
.cg-punct { font: 700 clamp(1rem, 3.6vw, 1.3rem)/1 var(--mono); color: #CBBFE8; align-self: flex-start; padding-top: 0.45em; min-width: 0.4em; text-align: center; }
.cg-cell.same input { background: rgba(255, 255, 255, 0.14); }
.cg-cell.same .cg-code { color: #FFC93C; }
.tool-shell .cg-cell.given input { color: #6FA8FF; }
.tool-shell .cg-cell.clash input { color: #FFB04D; }
.tool-shell .cg-cell.wrong input { border-color: #FF7A62; color: #FF7A62; }
.tool-shell .cg-cell.done input { border-color: #5BD48F; color: #5BD48F; }
.cg-reveal { margin: 0; text-align: center; font: 600 var(--step-0)/1.3 var(--body); color: #5BD48F; }
.cg-legend { margin: 0; text-align: center; font-size: 0.75rem; color: #A597CC; }
.cg-legend b { font-weight: 600; }
.cg-legend .g { color: #6FA8FF; } .cg-legend .c { color: #FFB04D; }

@media (max-width: 860px) { .pz { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .cg-board { gap: 12px 12px; } .cg-word { gap: 2px; } .sc-tile { width: 26px; height: 26px; font-size: 0.95rem; } }

/* printing */
@media print {
  .f-sclist { list-style: decimal; text-align: left; max-width: 170mm; margin: 0 auto; padding-left: 10mm; font: 600 13pt/1.4 "Figtree", Arial, sans-serif; }
  .f-sclist li { margin: 0 0 6mm; break-inside: avoid; }
  .f-sclist .j { font: 700 16pt/1.2 "JetBrains Mono", "Courier New", monospace; letter-spacing: 0.05em; margin-right: 6mm; }
  .f-sclist .c { font-style: italic; font-weight: 400; color: #333; }
  .f-sclist .a { display: block; margin-top: 3mm; min-height: 7mm; border-bottom: 0.4mm solid #444; max-width: 90mm; font: 700 14pt/1.4 "JetBrains Mono", "Courier New", monospace; }
  .f-cgboard { display: flex; flex-wrap: wrap; gap: 6mm 7mm; justify-content: center; margin: 0 auto 10mm; max-width: 180mm; }
  .f-cgboard .w { display: inline-flex; gap: 1mm; break-inside: avoid; }
  .f-cgboard .l { display: grid; gap: 1mm; justify-items: center; }
  .f-cgboard .l b { width: 8mm; height: 9mm; border-bottom: 0.4mm solid #000; font: 700 14pt/9mm "JetBrains Mono", "Courier New", monospace; text-align: center; }
  .f-cgboard .l i { font: 600 9pt/1 "JetBrains Mono", "Courier New", monospace; font-style: normal; color: #444; }
  .f-cgboard .p { font: 700 14pt/9mm "JetBrains Mono", "Courier New", monospace; }
  .f-cgkey { border-collapse: collapse; margin: 0 auto; }
  .f-cgkey td { border: 0.3mm solid #888; width: 7mm; height: 8mm; text-align: center; font: 600 10pt/1 "JetBrains Mono", "Courier New", monospace; }
  .f-cgkey tr:first-child td { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
