/* Crossword, locked play (owner 11-11, D-20261112-08): X3 on phones and tablets (Puzzle | All clues, one thing at a time),
   X2 on computers from 1200 px (grid on the left, the two clue lists on the right, each scrolling by itself).
   The page itself never scrolls (main is fixed to the window); crossword.js sets the square size so it all fits. */
html:has(body.xw-locked), body.xw-locked { overflow: hidden; overscroll-behavior: none; }
html body.xw-locked main:not(#s):not(#s):not(#s):not(#s):not(#s):not(#s) { position: fixed; inset: 0; height: var(--gm-vh, 100dvh); padding-top: var(--gm-top, 64px) !important; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; }
html body.xw-locked.xw-typing main:not(#s):not(#s):not(#s):not(#s):not(#s):not(#s) { padding-top: 0 !important; }
body.xw-locked.xw-typing main > .container, body.xw-locked.xw-typing .xw-sw, body.xw-locked.xw-typing .xw-sample { display: none; }
body.xw-locked main > .container { flex: none; }
body.xw-locked .xw-sample { flex: none; }
body.xw-locked .xw-wrap:not(#s) { flex: 1 1 0; min-height: 0; max-width: none; width: 100%; margin: 0; padding: 0 12px 6px; display: flex; flex-direction: column; box-sizing: border-box; }
body.xw-locked .xw-wrap[hidden] { display: none; }
body.xw-locked .xw-links-low { display: none; }

/* the switch (phones, tablets) */
.xw-sw { display: none; }
body.xw-locked .xw-sw { flex: none; display: flex; width: min(420px, 100%); margin: 4px auto; border: 2px solid var(--vs-deep, #062f37); border-radius: 0; overflow: hidden; box-sizing: border-box; }
body.xw-locked .xw-sw button { flex: 1; min-height: 44px; border: 0; margin: 0; padding: 0; font: 800 calc(18px * var(--fs, 1))/1 var(--vs-font); color: var(--vs-teal, #0a4652); background: #fff; cursor: pointer; }
body.xw-locked .xw-sw button[aria-pressed="true"] { background: var(--vs-teal, #0a4652); color: #fff; }
body.xw-locked .xw-sw button + button { border-left: 2px solid var(--vs-deep, #062f37); }
body.xw-locked .xw-sw button:focus-visible { outline: 3px solid #0b0c0c; outline-offset: -5px; }
body.xw-locked.xw-listmode .xw-sw, body.xw-locked .xw-wrap.xw-listmode .xw-sw { display: none; }

/* the main area: the unit (clue, grid, bar) and the clue lists */
body.xw-locked .xw-main:not(#s) { flex: 1 1 0; min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; overflow: hidden; }
body.xw-locked .xw-unit:not(#s) { flex: 1 1 auto; min-height: 0; max-height: 100%; display: flex; flex-direction: column; position: relative; }
body.xw-locked .xw-top, body.xw-locked .xw-bar { flex: none; }
body.xw-locked .xw-gb { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
body.xw-locked .xw-side:not(#s) { display: none; margin: 0; max-width: none; width: 100%; }
/* messages float over the bottom of the grid, so they never move the grid */
body.xw-locked .xw-unit > .xw-msg:not(:empty), body.xw-locked .xw-unit > .xw-done:not([hidden]) { position: absolute; left: 8px; right: 8px; bottom: calc(var(--xw-barh, 56px) + 8px); margin: 0 !important; z-index: 5; box-sizing: border-box; box-shadow: 0 4px 14px rgba(6, 47, 55, .35); }
body.xw-locked .xw-unit > .xw-msg:not(:empty) { background: #fffdf6; border: 2px solid #0a4652; border-radius: 0; padding: 6px 10px; }
body.xw-locked .xw-unit > .xw-done:not([hidden]) { background: #fffdf6; border: 2px solid #7A4A63; border-radius: 0; padding: 8px 12px; color: var(--vs-ink); }
body.xw-locked .xw-unit > .xw-msg:empty { display: none; }
body.xw-locked .xw-unit > .xw-msg:not(:empty) { pointer-events: none; animation: xw-toast 6s steps(1, end) forwards; }
@keyframes xw-toast { 0% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
/* typing-answers-in-a-list mode: the list fills the unit and scrolls inside */
body.xw-locked .xw-unit > .xw-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; background: #fff; color: var(--vs-ink); }

/* phones and tablets (X3): "All clues" shows the lists instead of the unit */
@media (max-width: 1199.98px) {
  body.xw-locked.xw-view-clues .xw-unit:not(#s) { display: none; }
  body.xw-locked.xw-view-clues .xw-side:not(#s) { display: block; flex: 1 1 0; min-height: 0; overflow-y: auto; background: #fff; border: 2px solid var(--vs-deep, #062f37); border-radius: 0; box-sizing: border-box; max-width: 720px; padding: 0 8px; }
  body.xw-locked .xw-side .xlv-clues, body.xw-locked .xw-side .xlv-clues-panel, body.xw-locked .xw-side .xlv-clues-box:not(.xlv-clues-label) { max-height: none !important; height: auto !important; overflow: visible !important; }
  body.xw-locked .xw-side .xlv-clues-label { position: sticky; top: 0; background: #fff; z-index: 2; }
}
@media (max-width: 719.98px) {
  body.xw-locked .xw-wrap:not(#s) { padding: 0 0 6px; }
  body.xw-locked .xw-unit:not(#s) { width: 100% !important; }
  body.xw-locked.xw-view-clues .xw-side:not(#s) { border-radius: 0; border-left: 0; border-right: 0; }
}

/* computers (X2): the grid on the left, the clue lists on the right (Across and Down side by side, each scrolls) */
@media (min-width: 1200px) {
  body.xw-locked .xw-sw { display: none; }
  body.xw-locked .xw-wrap:not(#s) { padding: 8px 24px 12px; }
  body.xw-locked .xw-main:not(#s) { flex-direction: row; align-items: stretch; justify-content: center; gap: 28px; }
  body.xw-locked .xw-unit:not(#s) { flex: 0 0 auto; align-self: stretch; }
  body.xw-locked .xw-side:not(#s) { display: block; flex: 0 1 640px; min-width: 0; margin: 0; overflow: hidden; }
  body.xw-locked .xw-side .xlv-clues { display: flex !important; gap: 20px; height: 100%; width: 100%; flex-direction: row !important; margin: 0 !important; }
  body.xw-locked .xw-side .xlv-clues-panel { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; height: 100%; margin: 0 !important; overflow: hidden; }
  body.xw-locked .xw-side .xlv-clues-box:not(.xlv-clues-label) { flex: 1 1 0; min-height: 0; height: auto !important; max-height: none !important; overflow-y: auto !important; }
  body.xw-locked .xw-side .xlv-clues-label { flex: none; }
  body.xw-locked .xw-wrap.xw-listmode .xw-side { display: none; }
}

/* the control bar stays on one line, so it never takes more height from the grid: icon buttons are 40 px wide on narrow phones (still 44 tall) */
body.xw-locked .xw-bar:not(#s) { flex-wrap: nowrap; justify-content: space-between; }
@media (max-width: 419.98px) {
  body.xw-locked .xw-ib:not(#s), body.xw-locked .xw-bar .gm-ib:not(#s) { width: 40px; min-width: 40px; }
  body.xw-locked .xw-bar > .xw-zm, body.xw-locked .xw-bar > .xw-icons { gap: 4px; }
  body.xw-locked .xw-b:not(.xw-ib):not(#s) { padding: 4px 8px; }
}
@media (max-width: 339.98px) { body.xw-locked .xw-bar:not(#s) { padding: 6px 4px; gap: 2px; } body.xw-locked .xw-b:not(.xw-ib):not(#s) { padding: 4px 5px; font-size: 15px; } }
