/* Crossword Blitz: Caveman Circus "Paper and sun" look, morning paper edition. */
.qc-wrap { container-type: inline-size; }
.qc-root {
  --qc-ink: #1A1814; --qc-paper: #F7F2E6; --qc-white: #FFFFFF; --qc-red: #D33A2C; --qc-light: #FBE3DE;
  --qc-yellow: #F5E04A; --qc-muted: #5C554B; --qc-soft: #E7DFCC; --qc-keys: #E9DFC8;
  position: relative; max-width: 440px; margin: 0 auto 24px; box-sizing: border-box; overflow: hidden;
  background: var(--qc-paper); color: var(--qc-ink); border: 1px solid var(--qc-ink); box-shadow: 4px 4px 0 var(--qc-ink);
  font-family: Rubik, system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.35; -webkit-tap-highlight-color: transparent;
}
.qc-root *, .qc-root *::before, .qc-root *::after { box-sizing: border-box; }
.qc-root [hidden] { display: none !important; }
.qc-root button, .qc-root input { appearance: none; -webkit-appearance: none; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; font: inherit; color: inherit; text-transform: none; letter-spacing: normal; line-height: 1.2; min-height: 0; width: auto; border-radius: 0; }
.qc-root button { cursor: pointer; }
.qc-root button:focus-visible, .qc-root input:focus-visible { outline: 3px solid var(--qc-red); outline-offset: 2px; }
.qc-root ol, .qc-root ul { list-style: none; margin: 0; padding: 0; }
.qc-root li { margin: 0; }
.qc-root li::before { content: none; }

/* Header strip */
.qc-head { position: relative; display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 0 14px; background: var(--qc-paper); border-bottom: 1px solid var(--qc-ink); overflow: hidden; }
.qc-artwrap { position: absolute; top: 0; right: 0; bottom: 0; display: block; pointer-events: none; }
.qc-art { display: block; height: 100%; width: auto; }
.qc-brand, .qc-head .qc-icon { position: relative; z-index: 1; }
.qc-title { font-weight: 800; font-size: 21px; line-height: 1.05; letter-spacing: .02em; }
.qc-title span { color: var(--qc-red); }
.qc-sub { font-size: 12px; color: var(--qc-muted); }
.qc-root .qc-icon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: var(--qc-white); border: 1px solid var(--qc-ink); font-weight: 800; font-size: 14px; }

/* Body */
.qc-main { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px 0; }
.qc-timer-row { display: flex; align-items: baseline; gap: 8px; }
.qc-clock { font-weight: 900; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.qc-clock::before { content: "\23F1 "; font-size: .8em; }
.qc-clock-lab { font-size: 12px; color: var(--qc-muted); }
.qc-par { margin-left: auto; font-size: 13px; color: var(--qc-muted); }
.qc-par strong { color: var(--qc-ink); }
.qc-bar { height: 8px; margin-top: 6px; border: 1px solid var(--qc-ink); background: var(--qc-white); }
.qc-bar span { display: block; height: 100%; width: 100%; background: var(--qc-red); transition: width .25s linear; }
.qc-low .qc-clock { color: var(--qc-red); animation: qc-tick 1s steps(1) infinite; }
@keyframes qc-tick { 50% { opacity: .45; } }
.qc-is-done .qc-timer { display: none; }

.qc-grid-wrap { position: relative; }
.qc-grid { container-type: inline-size; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; padding: 1px; background: var(--qc-ink); border: 1px solid var(--qc-ink); box-shadow: 3px 3px 0 var(--qc-ink); }
.qc-root .qc-cell { position: relative; aspect-ratio: 1; width: 100%; display: flex; align-items: center; justify-content: center; background: var(--qc-white); font-weight: 800; font-size: 11cqw; line-height: 1; color: var(--qc-ink); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.qc-root .qc-block { background: var(--qc-ink); }
.qc-num { position: absolute; left: 4%; top: 3%; font-size: 3.2cqw; font-weight: 700; color: var(--qc-red); }
.qc-root .qc-cell.qc-word { background: var(--qc-light); }
.qc-root .qc-cell.qc-cur { background: var(--qc-yellow); box-shadow: inset 0 0 0 3px var(--qc-ink); }
.qc-root .qc-cell.qc-miss .qc-letter { color: var(--qc-red); }
.qc-root .qc-cell.qc-miss { background: var(--qc-light); }
.qc-cover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(247, 242, 230, .86); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.qc-cover-box { width: 100%; max-width: 280px; text-align: center; background: var(--qc-white); border: 1px solid var(--qc-ink); box-shadow: 4px 4px 0 var(--qc-ink); padding: 16px; }
.qc-cover-h { font-weight: 900; font-size: 26px; }
.qc-cover-s { font-size: 13px; color: var(--qc-muted); margin: 4px 0 12px; }

.qc-cluebar { display: flex; align-items: stretch; background: var(--qc-white); border-top: 2px solid var(--qc-ink); border-bottom: 2px solid var(--qc-ink); }
.qc-root .qc-cluebar-mid { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 6px; text-align: left; }
.qc-root .qc-cluebar-nav { width: 32px; font-size: 22px; font-weight: 800; color: var(--qc-muted); }
.qc-cluetag { flex: none; font-weight: 900; font-size: 13px; padding: 2px 6px; background: var(--qc-red); color: var(--qc-white); border: 1px solid var(--qc-ink); }
.qc-cluetext { font-size: 15px; font-weight: 600; }
.qc-is-done .qc-cluebar, .qc-is-done .qc-kb, .qc-is-done .qc-hint { display: none; }

.qc-lists, .qc-hint { display: none; }
.qc-list-h { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding-bottom: 6px; border-bottom: 2px solid var(--qc-ink); margin-bottom: 4px; }
.qc-root .qc-list button { display: flex; gap: 8px; width: 100%; padding: 6px 8px; text-align: left; font-size: 14px; }
.qc-list-n { font-weight: 800; color: var(--qc-red); min-width: 14px; }
.qc-list li.qc-on button { background: var(--qc-light); font-weight: 700; }
.qc-list li.qc-done .qc-list-t { color: #A79F8F; text-decoration: line-through; }
.qc-hint { font-size: 12px; color: var(--qc-muted); }
.qc-root:not(.qc-is-started) .qc-list-t { filter: blur(4px); }

/* On-screen keyboard */
.qc-kb { display: flex; flex-direction: column; gap: 6px; margin: 0 -14px; padding: 12px 8px 14px; background: var(--qc-keys); border-top: 1px solid var(--qc-ink); touch-action: manipulation; }
.qc-kb-row { display: flex; gap: 4px; }
.qc-kb-row:nth-child(2) { padding: 0 14px; }
.qc-root .qc-key { flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--qc-white); border: 1px solid var(--qc-ink); box-shadow: 0 2px 0 var(--qc-ink); font-weight: 700; font-size: 16px; }
.qc-root .qc-key:active { transform: translateY(2px); box-shadow: 0 0 0 var(--qc-ink); }
.qc-root .qc-key-del { flex: 1.6; font-size: 18px; }
.qc-root:not(.qc-is-started) .qc-kb { opacity: .5; pointer-events: none; }

/* Buttons */
.qc-root .qc-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; padding: 0 14px; background: var(--qc-yellow); color: var(--qc-ink); border: 1px solid var(--qc-ink); box-shadow: 3px 3px 0 var(--qc-ink); font-weight: 800; font-size: 16px; }
.qc-root .qc-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.qc-root .qc-btn:disabled { opacity: .5; }
.qc-root .qc-btn-ghost { background: var(--qc-white); }
.qc-root .qc-link { align-self: center; padding: 6px; font-size: 13px; color: var(--qc-muted); text-decoration: underline; }

/* Result */
.qc-result { display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; }
.qc-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--qc-red); }
.qc-big { font-weight: 900; font-size: 34px; line-height: 1.05; }
.qc-line { font-size: 14px; color: var(--qc-muted); }
.qc-line strong { color: var(--qc-ink); }
.qc-note { font-size: 13px; color: var(--qc-muted); }
.qc-posted { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--qc-light); border: 1px solid var(--qc-ink); font-size: 13px; font-weight: 700; }
.qc-posted-t { flex: 1; }
.qc-root .qc-change { font-size: 12px; font-weight: 600; text-decoration: underline; }
.qc-name { background: var(--qc-white); border: 1px solid var(--qc-ink); padding: 12px 14px; display: flex; flex-direction: column; }
.qc-name-h { font-weight: 800; font-size: 16px; }
.qc-name-s { font-size: 13px; color: var(--qc-muted); margin: 2px 0 10px; }
.qc-name-row { display: flex; gap: 8px; }
.qc-root .qc-initials { width: 118px; flex: none; height: 48px; border: 2px solid var(--qc-ink); background: var(--qc-paper); text-align: center; font-weight: 900; font-size: 22px; letter-spacing: 6px; text-indent: 6px; text-transform: uppercase; }
.qc-name-row .qc-btn { flex: 1; width: auto; }
.qc-msg { font-size: 13px; font-weight: 700; color: var(--qc-red); margin-top: 6px; }
.qc-msg:empty { display: none; }
.qc-board { border: 1px solid var(--qc-ink); background: var(--qc-white); }
.qc-board-h { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 12px; border-bottom: 1px solid var(--qc-ink); background: #FBF6EA; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.qc-board-h small { font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--qc-muted); }
.qc-board li { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--qc-soft); font-size: 14px; }
.qc-board li:last-child { border-bottom: 0; }
.qc-board li.qc-me { background: var(--qc-light); }
.qc-r { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--qc-ink); background: var(--qc-white); font-weight: 800; font-size: 12px; }
.qc-board li:first-child .qc-r { background: var(--qc-yellow); }
.qc-n { flex: 1; font-weight: 800; letter-spacing: .1em; }
.qc-n em { font-style: normal; font-weight: 700; letter-spacing: 0; font-size: 11px; }
.qc-s { font-weight: 800; font-variant-numeric: tabular-nums; }
.qc-empty { font-size: 14px; color: var(--qc-muted); }
.qc-circus { font-size: 13px; font-weight: 700; }
.qc-circus::before { content: "\25CF  "; color: #E2531B; }
.qc-next { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--qc-muted); }
.qc-next strong { font-size: 18px; color: var(--qc-ink); font-variant-numeric: tabular-nums; }

/* Toast and help */
.qc-toast { position: absolute; left: 50%; top: 70px; transform: translate(-50%, -6px); padding: 7px 14px; background: var(--qc-ink); color: var(--qc-white); font-weight: 800; font-size: 14px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 6; }
.qc-toast.qc-show { opacity: 1; transform: translate(-50%, 0); }
.qc-modal { position: absolute; inset: 0; z-index: 8; display: flex; align-items: flex-start; justify-content: center; padding: 70px 16px 16px; background: rgba(26, 24, 20, .45); }
.qc-dialog { width: 100%; max-width: 380px; padding: 16px 18px; background: var(--qc-paper); border: 1px solid var(--qc-ink); box-shadow: 6px 6px 0 var(--qc-ink); }
.qc-dialog h3 { margin: 0 0 8px; font-size: 19px; font-weight: 800; }
.qc-dialog ul { margin: 0 0 14px; padding-left: 18px; list-style: disc; }
.qc-dialog li { margin: 4px 0; font-size: 14px; }

/* Wide screens: grid on the left, everything else beside it */
@container (min-width: 760px) {
  .qc-root { max-width: 1000px; }
  .qc-head { min-height: 76px; padding: 0 24px; }
  .qc-title { font-size: 27px; }
  .qc-title br { display: none; }
  .qc-title span { margin-left: .25em; }
  .qc-sub { font-size: 13px; }
  .qc-root .qc-icon { width: 36px; height: 36px; }
  .qc-main { display: grid; grid-template-columns: minmax(0, 440px) minmax(300px, 1fr); grid-template-areas: "grid timer" "grid clue" "grid lists" "grid hint" "grid result"; grid-template-rows: auto auto auto auto 1fr; column-gap: 28px; row-gap: 14px; padding: 22px 24px 24px; align-items: start; }
  .qc-grid-wrap { grid-area: grid; }
  .qc-timer { grid-area: timer; }
  .qc-clock { font-size: 30px; }
  .qc-cluebar { grid-area: clue; }
  .qc-cluetext { font-size: 17px; }
  .qc-lists { grid-area: lists; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .qc-hint { grid-area: hint; display: block; }
  .qc-kb { display: none; }
  .qc-result { grid-area: result; grid-row: 1 / span 5; padding-bottom: 0; }
  .qc-is-done .qc-lists { display: none; }
}
@media (prefers-reduced-motion: reduce) { .qc-root *, .qc-toast { animation: none !important; transition: none !important; } }
