/* Weekly Crossword, round 7 (owner 11-10, design C). Loaded after games.css and games-1106.css.
   One teal unit: the clue (with ‹ › and the answer in big squares) on top, the grid, one control bar underneath.
   Colours: dark teal #0a4652, brick #7A4A63, cream and neutrals; gold only for the chosen square and focus. */

/* header: "Weekly" is hidden visually on narrow phones so the title stays on one line; a screen reader still hears it */
:is(.gm-head, .gm-hero) .w-short { display: none; }
@media (max-width: 419.98px) {
  :is(.gm-head, .gm-hero) .xw-wk { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* the site header is fixed; main starts below it whatever its height (it grows with A+) */
body.gm main { padding-top: var(--gm-top, 64px) !important; }

/* SAMPLE notice: local preview only (never on the public site) */
.xw-sample { margin: 0; padding: 6px var(--r4-pad); background: #f0c9c9; color: var(--vs-ink); font: 700 var(--t-sm, 16px)/1.35 var(--vs-font); text-align: center; }
.xw-sample[hidden], .xw-none[hidden] { display: none; }
.xw-none { padding: 18px var(--r4-pad) 28px; font-size: var(--t-body); }
.xw-none h2 { margin: 0 0 6px !important; font-size: var(--t-h3) !important; color: var(--vs-ink) !important; }

/* the typing box: at least 16 px text, or iOS Safari zooms the page in when it gets the focus */
.xw-wrap [id$="-grid-input"] { font-size: max(16px, 1em) !important; }
/* never any custom keyboard; Exolve's own clue strip, buttons, status line and small print are not used */
.xlv-phone-kb { display: none !important; }
.xw-wrap .xlv-curr-clue, .xw-wrap .xlv-controls-etc, .xw-wrap .xlv-clear-area { display: none !important; }
.xw-wrap .xlv-cell-text { font-weight: 700; }

/* ═══ page layout ═══ */
.xw-wrap:not(#s) { padding: 12px var(--vs-gutter, 24px) 24px; max-width: 1240px; margin: 0 auto; box-sizing: border-box; }
.xw-main { display: grid; grid-template-columns: max-content minmax(0, 1fr); grid-template-areas: "unit side" "msg side" "done side"; column-gap: 32px; align-items: start; }
.xw-unit { grid-area: unit; background: #0a4652; border-radius: 0; overflow: hidden; color: #fff; }
.xw-msg { grid-area: msg; } .xw-done { grid-area: done; } .xw-side { grid-area: side; min-width: 0; }
.xw-msg:empty { display: none; }
.xw-wrap .xw-msg:not(:empty) { margin: 8px 0 0; }

/* ═══ top: clue and the answer in big squares ═══ */
.xw-top { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-areas: "prev clue next" "ans ans ans"; align-items: center; gap: 8px 10px; padding: 10px 10px 12px; }
.xw-clue { grid-area: clue; margin: 0; font: 600 calc(20px * var(--fs, 1))/1.3 var(--vs-font); color: #fff; min-height: 2.6em; display: flex; align-items: center; flex-wrap: wrap; column-gap: .35em; }
.xw-clue b { color: var(--gm-gold, #e0b13a); font-weight: 800; white-space: nowrap; }
.xw-clue .xw-len { color: #d9e6e8; font-weight: 500; }
.xw-clue .xw-pick { color: #fff4e2; font-weight: 500; }
.xw-arrow { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 2px solid #fff4e2; border-radius: 0; background: #fff; color: #0a4652; box-shadow: 0 2px 0 #062f37; cursor: pointer; touch-action: manipulation; }
.xw-prev { grid-area: prev; } .xw-next { grid-area: next; }
.xw-arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.xw-arrow:hover { background: #f7f1e6; }
.xw-ans { grid-area: ans; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 52px)); gap: 4px; }
.xw-ans { min-height: 52px; }
.xw-ans span { aspect-ratio: 1; max-height: 52px; display: grid; place-items: center; background: #fff; border-radius: 0; color: #0d2a30; font: 800 28px/1 var(--vs-font); cursor: pointer; }
.xw-ans span.on { background: #ecc55a; }
.xw-ans span.bad { color: #7A4A63; text-decoration: line-through; text-decoration-thickness: 3px; }

/* ═══ the grid: white, flush between the top and the bar (no gap, no inner box) ═══ */
.xw-gb { background: #fff; overflow: hidden; }
body.xw-zoomed .xw-gb { overflow: auto; overscroll-behavior: contain; }
.xw-wrap .xlv-frame { margin: 0 !important; padding: 0 !important; }
.xw-wrap .xlv-grid-and-clues-flex { display: block !important; margin: 0 !important; padding: 0 !important; width: auto !important; }
.xw-wrap .xlv-grid-panel { margin: 0 !important; padding: 4px !important; width: auto !important; max-width: none !important; display: block; box-sizing: border-box; }
.xw-wrap .xlv-grid-parent-centerer { margin: 0 auto !important; width: max-content !important; max-width: none !important; }
body.xw-zoomed .xw-wrap .xlv-grid-parent-centerer { margin: 0 !important; }
.xw-wrap .xlv-grid-parent { margin-left: 0 !important; }
/* Show Errors: a wrong letter is brick with a brick line through its square (never colour alone) */
.xw-wrap .xlv-grid text.xw-bad { fill: #7A4A63 !important; }
.xw-eline { stroke: #7A4A63; stroke-width: 2.5; stroke-linecap: round; }

/* ═══ the bar: every control, joined under the grid ═══ */
.xw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; position: relative; }
.xw-zm, .xw-icons { display: inline-flex; gap: 8px; align-items: center; }
.xw-icons { margin-left: auto; }
.xw-b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 4px 14px; box-sizing: border-box; background: #fff; color: #0a4652; border: 2px solid #fff4e2; border-radius: 0; box-shadow: 0 2px 0 #062f37; font: 700 calc(17px * var(--fs, 1))/1.1 var(--vs-font); white-space: nowrap; cursor: pointer; touch-action: manipulation; }
.xw-b:hover:not(:disabled) { background: #f7f1e6; }
.xw-b:disabled { opacity: .45; cursor: default; }
.xw-ib { width: 44px; padding: 0; }
.xw-b svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.xw-zm .xw-b svg { stroke-width: 3.2; }
/* Show Errors: off = white with an empty ring; on = solid brick with a filled tick, in words for a screen reader (aria-pressed) */
.xw-err .i-on { display: none; }
.xw-err[aria-pressed="true"] { background: #7A4A63; color: #fff; box-shadow: 0 2px 0 #341F2A; }
.xw-err[aria-pressed="true"]:hover { background: #693F55; }
.xw-err[aria-pressed="true"] .i-on { display: block; } .xw-err[aria-pressed="true"] .i-off { display: none; }
.xw-bar .gm-b2:not(#s) { border-color: #fff4e2; box-shadow: 0 2px 0 #062f37; }
.xw-unit :focus-visible, .xw-unit summary:focus-visible { outline: 3px solid var(--gm-gold, #e0b13a) !important; outline-offset: 2px; }
/* the gear's settings panel opens above the bar, inside the page */
.xw-set-pop { position: static; }
.xw-set-pop > .gm-pop-body { bottom: calc(100% + 6px); top: auto !important; right: 6px; color: var(--vs-ink); }
.xw-set { border: 0; padding: 0; margin: 0; }
.xw-set legend { font-weight: 800; padding: 0; margin: 4px 0 6px; }
.xw-set label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--t-body, 18px); cursor: pointer; }
.xw-set input { width: 24px; height: 24px; accent-color: #0a4652; flex: none; }
details[open] > summary.gm-ib:not(#s):not(#s) { background: #f7f1e6; }
/* the compact timer (only when it is on) */
.xw-timer { display: inline-flex; align-items: center; gap: 0 10px; min-height: 44px; color: #fff; }
.xw-timer[hidden], .xw-timer [hidden] { display: none !important; }
.xw-time { display: inline-flex; align-items: center; gap: 6px; font: 800 calc(19px * var(--fs, 1))/1.2 var(--vs-font); color: #fff; font-variant-numeric: tabular-nums; }
.xw-time svg { width: 22px; height: 22px; flex: none; }
.xw-tstate { font: 700 var(--t-sm, 16px)/1.3 var(--vs-font); color: #fff4e2; }
.xw-tstate:empty { display: none; }
.xw-timer.paused .xw-time, .xw-timer.paused .xw-tstate { color: var(--gm-gold, #e0b13a); }
.xw-timer .gm-b2:not(#s) { min-height: 44px; padding: 2px 12px; }

/* ═══ when every square is filled but something is wrong ═══ */
.xw-done { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 8px 0 0; padding: 10px 12px; background: #f7f1e6; border-radius: 0; }
.xw-done[hidden] { display: none; }
.xw-done p { margin: 0; font: 700 var(--t-body, 18px)/1.35 var(--vs-font); color: var(--vs-ink); }
.xw-done .gm-b2:not(#s) { min-height: 44px; background: #7A4A63; color: #fff; border-color: #7A4A63; box-shadow: 0 2px 0 #341F2A; }

/* ═══ clue lists: beside the unit on computers, under it on tablets and phones ═══ */
.xw-side .xlv-clues { margin: 0 !important; width: auto !important; max-width: none !important; }
@media (min-width: 1024px) { .xw-side .xlv-clues { display: grid !important; grid-template-columns: 1fr 1fr; gap: 0 24px; } .xw-side #xmsg { grid-column: 1 / -1; } }
.xw-wrap .xlv-active-clue { box-shadow: inset 4px 0 0 #7A4A63; }

/* ═══ the clue list mode (Settings) ═══ */
.xw-list { background: #fff; color: var(--vs-ink); padding: 10px 12px; }
.xw-listmode .xw-gb, .xw-listmode .xw-ans, .xw-listmode .xw-zm, .xw-listmode .xw-side { display: none !important; }
.xw-tiles span.bad { color: #7A4A63; text-decoration: line-through; }
.xw-li.on { background: #fcf4dc; box-shadow: inset 4px 0 0 #7A4A63; }
.xw-li { scroll-margin-top: 64px; }

/* ═══ focus: a clear ring for keyboard users; nothing after a mouse click or a touch. The typing box never shows a ring;
   the whole grid does, for keyboard users. ═══ */
.xw-wrap [id$="-grid-input"]:focus-visible, .xw-wrap [id$="-grid-input"]:focus { outline: none !important; box-shadow: none !important; }
html[data-input="keyboard"] .xw-wrap .xlv-grid-parent-centerer:has([id$="-grid-input"]:focus) { outline: 3px solid #0b0c0c; outline-offset: 2px; }
html[data-input="pointer"] .xw-wrap :focus-visible { outline: none !important; }

/* ═══ tablets and phones: one column; the clue lists under the unit ═══ */
@media (max-width: 1023.98px) {
  .xw-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "unit" "msg" "done" "side"; }
  .xw-unit { justify-self: center; width: max-content; max-width: 100%; }
  .xw-msg, .xw-done, .xw-side { justify-self: center; width: 100%; max-width: var(--xw-uw, 100%); box-sizing: border-box; }
  .xw-side { margin-top: 14px; }
  .xw-ans { grid-template-columns: repeat(var(--n, 5), minmax(0, 56px)); }
}
/* phones: the unit runs edge to edge straight under the hero (no white gap), ‹ › become elongated half circles on the
   screen's edges so the clue gets the width, and the answer squares are left out (the grid shows the word) */
@media (max-width: 719.98px) {
  .xw-wrap:not(#s) { padding: 0 0 20px; }
  .xw-unit { border-radius: 0; width: auto !important; justify-self: stretch; }
  .xw-top { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 0 8px; padding: 6px 0; min-height: 64px; }
  .xw-arrow { width: 40px; height: 64px; border: 0; background: #fff; box-shadow: none; }
  .xw-prev { border-radius: 0; padding-right: 4px; }
  .xw-next { border-radius: 0; padding-left: 4px; }
  .xw-clue { font-size: calc(18px * var(--fs, 1)); min-height: 2.6em; }
  .xw-ans { display: none !important; }
  .xw-bar { gap: 6px; padding: 8px; }
  .xw-zm, .xw-icons { gap: 6px; }
  .xw-b:not(.xw-ib) { padding: 4px 10px; }
  .xw-side, .xw-wrap .xw-msg:not(:empty), .xw-done, .xw-links-low, .gm-lic { margin-left: 12px; margin-right: 12px; }
  .xw-wrap .xlv-grid-panel { padding: 4px 0 !important; }
}
@media (max-width: 359.98px) { .xw-bar { gap: 4px; padding: 6px; } .xw-zm, .xw-icons { gap: 4px; } .xw-b:not(.xw-ib) { padding: 4px 8px; gap: 6px; } }
.xw-links-low { display: flex; gap: 0 20px; flex-wrap: wrap; margin: 12px 0 0; }

/* while typing on a phone: the site bar slides away and the clue part sticks to the top of the screen */
body.xw-typing header { transform: translateY(-110%); transition: transform .15s ease-out; }
@media (prefers-reduced-motion: reduce) { body.xw-typing header { transition: none; } }
body.xw-typing .xw-top { position: sticky; top: 0; z-index: 30; background: #0a4652; }
body.xw-typing .xw-unit { overflow: visible; }

@media print { .xw-unit .xw-top, .xw-bar, .xw-sample, .xw-done { display: none !important; } }

/* Exolve fixes each clue box at its own pixel width; here they take the column's width instead */
.xw-side .xlv-clues-box, .xw-side .xlv-clues-panel { width: auto !important; max-width: none !important; }
.xw-side .xlv-clues-table { width: 100%; }
/* phones: the unit joins the hero directly (owner: no white gap between the hero and the crossword on mobile) */
@media (max-width: 719.98px) {
  body[data-page="crossword"] main .page-header.gm-hero:not(#s):not(#s):not(#s):not(#s):not(#s):not(#s):not(#s) { margin-bottom: 0 !important; }
  .xw-err svg { display: none !important; }
  .xw-bar, .xw-zm, .xw-icons { gap: 4px; }
  .xw-bar { padding: 8px 6px; }
}

/* Exolve's own stylesheet gives the page a 4 px body margin on small screens; this page uses the site's (none) */
body[data-page="crossword"] { margin: 0 !important; }
/* games.css caps the grid area at 316 px under 340 px wide; here it takes the unit's full width so the grid centres */
.xw-wrap .xw-gb :is(.xlv-grid-and-clues-flex, .xlv-grid-panel) { max-width: none !important; width: auto !important; }

/* hero (owner 11-10: "the hero photo looked great on the pass from before"): the crossword hero is the same size as the Sudoku and
   Solitaire heroes at every width. The puzzle's title and date line stays for screen readers but no longer adds a line to the hero
   (it made the band 30 px taller, so the photo was cropped tighter), and the preview-only SAMPLE notice moved under the hero. */
body[data-page="crossword"] main .page-header.gm-hero.has-photo > .gm-meta:not(#s):not(#s):not(#s):not(#s):not(#s):not(#s):not(#s) {
  display: block; position: absolute !important; width: 1px; height: 1px; margin: 0 !important; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
