/* ============================================================================
   CROSS STICKS  (arcade/cross-sticks.htm)
   ============================================================================
   The crossword game's own parts. The frame, the pop-up panel the tiger hosts and
   the buttons under the game come from arcade.css, which every game shares; this
   file loads after it. Everything here is scoped to .xs, the game's own box.

   Inside the frame (arc-screen xs-screen), from the top:
     xs-hud          the black score strip: score, puzzle name and words solved, time
     xs-body         everything under it:
       xs-main         xs-board-box (the puzzle, xs-board, made of xs-cell squares)
                       and xs-cluebar (the clue being worked on, with arrows)
       xs-side         xs-clues (every clue) and xs-keys (letter keys for touch screens)
     xs-fx           confetti, drawn over everything
     arc-overlay     the pop-up panel; xs-list in it is the Set List, xs-stars the stars.
                     Its two halves are xs-panel-lead (the tiger, the logo or a heading,
                     the stars) and xs-panel-rest (the words, the Set List, the buttons).

   The game arranges itself to suit the space it has. cross-sticks.js puts these
   classes on the game's box:
     is-wide / is-stacked   puzzle and clues side by side, or one above the other
     has-keys               the letter keys are showing
     sheet-clues            there is no room for the list of clues, so it is a sheet
                            that slides up when the clue bar is tapped (show-clues)
     is-live                a puzzle is being played
   and these on the pop-up panel's overlay, so that the panel never needs scrolling:
     is-across              its two halves side by side (a phone held sideways)
     is-tight               the tiger steps aside (the rule is in arcade.css)
   ============================================================================ */
.xs {
  --xs-ink: #74290d;        /* the tiger's brown: outlines and shadows */
  --xs-hud: 3.25rem;        /* the height of the score strip */
  --xs-cell: 2rem;          /* the size of one square: cross-sticks.js sets it so the puzzle fits */
  --xs-cols: 9;             /* squares across: set by cross-sticks.js for each puzzle */
  --xs-gap: 0.3rem;         /* the space between letter keys */
}

/* ---------- The frame ---------- */
/* Not a fixed shape like Drum Break's playfield: as wide as the page allows, and as tall
   as fits on the screen with the buttons under it. */
.arc-game.xs .xs-screen {
  display: flex; flex-direction: column;
  width: 100%; max-width: 36rem;
  height: min(46rem, max(27rem, calc(100vh - 7.5rem)));
  height: min(46rem, max(27rem, calc(100dvh - 7.5rem)));   /* dvh: the part of a phone's screen not covered by the browser's bars */
  line-height: 1.3;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.arc-game.xs.is-wide .xs-screen {
  max-width: none;
  height: min(38rem, max(26rem, calc(100vh - 9rem)));
  height: min(38rem, max(26rem, calc(100dvh - 9rem)));
}
.xs button { font-family: Arial, Helvetica, sans-serif; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.xs button:focus-visible { outline: 3px solid #582c7e; outline-offset: 2px; }

/* ---------- The score strip ---------- */
.xs-hud {
  flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr) auto;
  align-items: center; column-gap: 0.6rem;
  height: var(--xs-hud); padding: 0 0.9rem; background: #000;
}
.xs-hud-item { display: flex; flex-direction: column; min-width: 0; }
.xs-hud-mid { align-items: center; }
.xs-hud-end { align-items: flex-end; }
.xs-hud-label {
  max-width: 100%; color: #b399cc; font: bold 0.64rem/1.25 Arial, Helvetica, sans-serif;
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* the numbers are Cooper Black lettering (pictures sized by the font size here); plain bold if that is missing */
.xs-hud-value {
  display: flex; align-items: center; gap: 0.4rem; height: 1.4rem;
  color: #ff9933; font: 900 1.3rem/1 "Arial Black", Arial, Helvetica, sans-serif; white-space: nowrap;
}
.xs-hud-value > span { display: block; line-height: 0; }
.xs-hud-value svg { display: block; height: auto; }
.xs-hud-value .xs-plain { font-size: 1.05rem; line-height: 1; }
.xs-hud-value .xs-hud-roll {
  padding: 0.14rem 0.42rem; border-radius: 999px; background: #fecb32; color: #000;
  font: bold 0.72rem/1.2 Arial, Helvetica, sans-serif; animation: xs-bump 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.xs-hud-roll[hidden] { display: none; }
@keyframes xs-bump { from { transform: scale(0.4); } to { transform: scale(1); } }
/* sound, pause and close: only shown when the game fills a phone's screen (see "Filling the screen") */
.xs-hud-buttons { display: none; align-items: center; gap: 0.35rem; margin-right: -0.35rem; }
.xs-hud-btn {
  display: flex; align-items: center; justify-content: center; width: 2.35rem; height: 2.35rem; padding: 0;
  border: 0; border-radius: 50%; background: #2b2233; color: #fff; cursor: pointer;
}
.xs-hud-btn:active { background: #582c7e; }
.xs .xs-hud-btn:focus-visible { outline-color: #ff9933; }
.xs-hud-btn svg { display: block; width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.xs-hud-btn .xs-icon-fill { fill: currentColor; stroke-width: 1; }
.xs-hud-btn .xs-icon-off, .xs-hud-btn[aria-pressed="false"] .xs-icon-on { display: none; }
.xs-hud-btn[aria-pressed="false"] .xs-icon-off { display: inline; }
.xs-hud-btn[hidden] { display: none; }
.xs .xs-stripe { flex: none; height: 0.5rem; background-size: 28.28px 28.28px; }

/* ---------- Under the strip: the puzzle, the clue bar, the clues, the keys ---------- */
.xs-body { position: relative; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; overflow: clip; }
.xs-main { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.xs-side { flex: none; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.xs-board-box {
  position: relative; flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 0.5rem; overflow: hidden;
}
/* comic-book dots on the paper, fading out down the page (as in Drum Break) */
.xs-board-box::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: min(100%, 22rem); pointer-events: none;
  background-image: radial-gradient(circle, #e9def5 3px, rgba(233, 222, 245, 0) 3.7px), radial-gradient(circle, #e9def5 3px, rgba(233, 222, 245, 0) 3.7px);
  background-size: 20px 30px; background-position: 0 2px, 10px 17px;
  -webkit-mask-image: linear-gradient(#000, rgba(0, 0, 0, 0)); mask-image: linear-gradient(#000, rgba(0, 0, 0, 0));
}

/* The puzzle. A square is xs-cell: its little number (xs-num) and its letter (xs-letter,
   Cooper Black). in-word marks the word being filled in and is-cursor the square that the
   next letter goes in; is-solved is a square of a word got right, is-hinted one the Hint
   button filled in. just-typed, just-solved and is-wrong are passing animations. */
.xs-board {
  position: relative; display: grid; flex: none;
  grid-template-columns: repeat(var(--xs-cols), var(--xs-cell)); grid-auto-rows: var(--xs-cell);
  outline: none;
}
.xs.is-live .xs-board { touch-action: none; }   /* a finger on the puzzle picks squares instead of scrolling the page */
.xs-cell {
  position: relative; margin: calc(var(--xs-cell) * 0.04);
  border: max(1.5px, calc(var(--xs-cell) * 0.065)) solid var(--xs-ink); border-radius: calc(var(--xs-cell) * 0.18);
  background: #fff; box-shadow: 0 calc(var(--xs-cell) * 0.07) 0 rgba(116, 41, 13, 0.3);
  cursor: pointer;
}
.xs-num {
  position: absolute; left: 9%; top: 6%; color: var(--xs-ink);
  font: bold calc(var(--xs-cell) * 0.26)/1 Arial, Helvetica, sans-serif; pointer-events: none;
}
.xs-letter { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; fill: #000; }
span.xs-letter {   /* plain letters, if the lettering file is missing */
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6%; color: #000;
  font: 900 calc(var(--xs-cell) * 0.6)/1 "Arial Black", Arial, Helvetica, sans-serif;
}
.xs-cell.in-word { background: #eee3fa; }
.xs-cell.is-hinted { background: #d3ebff; }
.xs-cell.is-hinted .xs-letter { fill: #0173c2; color: #0173c2; }
.xs-cell.is-solved { background: #fecb32; }
.xs-cell.is-solved .xs-letter { fill: var(--xs-ink); color: var(--xs-ink); }
.xs-cell.is-solved.in-word { background: #ffdf80; }
.xs-cell.is-cursor {
  z-index: 2; background: #ffe9b0; border-color: #582c7e;
  box-shadow: 0 0 0 calc(var(--xs-cell) * 0.075) #582c7e, 0 calc(var(--xs-cell) * 0.12) 0 calc(var(--xs-cell) * 0.075) rgba(88, 44, 126, 0.3);
}
.xs-cell.is-solved.is-cursor { background: #fecb32; }
.xs-cell.is-hinted.is-cursor { background: #d3ebff; }
.xs-cell.is-wrong { z-index: 3; background: #ffd2cc; border-color: #c9302c; animation: xs-shake 0.42s ease; }
.xs-cell.is-wrong .xs-letter { fill: #c9302c; color: #c9302c; }
.xs-cell.just-typed .xs-letter { animation: xs-type 0.17s ease-out; transform-origin: 50% 60%; }
.xs-cell.just-solved { z-index: 3; animation: xs-wave 0.5s cubic-bezier(0.3, 0.6, 0.4, 1) both; animation-delay: calc(var(--xs-i, 0) * 45ms); }
.xs-board.is-dealing .xs-cell { animation: xs-deal 0.34s cubic-bezier(0.3, 1.3, 0.5, 1) both; animation-delay: calc(var(--xs-d, 0) * 1ms); }
@keyframes xs-type { from { transform: scale(0.55); } 60% { transform: scale(1.14); } to { transform: scale(1); } }
@keyframes xs-wave { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-26%) scale(1.12); } 70% { transform: translateY(4%) scale(0.97); } 100% { transform: translateY(0) scale(1); } }
@keyframes xs-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-12%); } 40% { transform: translateX(11%); } 60% { transform: translateX(-8%); } 80% { transform: translateX(6%); } }
@keyframes xs-deal { from { transform: translateY(-45%) scale(0.6); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

/* Comic words that pop up over the puzzle ("TIGHT!", "CLAM!", "ROLL x2") and float away */
.xs-pops { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 4; pointer-events: none; }
.xs-pop {
  position: absolute; left: 0; top: 0; line-height: 0; white-space: nowrap;
  color: #fff; font-family: "Arial Black", Arial, Helvetica, sans-serif; font-weight: 900;
  animation: xs-pop 1.05s ease-out both;
}
.xs-pop svg { display: block; height: auto; overflow: visible; }
.xs-pop .xs-plain { display: block; line-height: 1; font-size: 0.72em; text-shadow: 0 0 3px var(--xs-ink), 0 0 3px var(--xs-ink), 0 2px 0 var(--xs-ink); }
@keyframes xs-pop {
  0% { transform: translate(-50%, -50%) rotate(var(--xs-tilt, 0deg)) scale(0.4); opacity: 0; }
  14% { transform: translate(-50%, -50%) rotate(var(--xs-tilt, 0deg)) scale(1.16); opacity: 1; }
  24% { transform: translate(-50%, -55%) rotate(var(--xs-tilt, 0deg)) scale(1); opacity: 1; }
  72% { opacity: 1; }
  100% { transform: translate(-50%, -140%) rotate(var(--xs-tilt, 0deg)) scale(1); opacity: 0; }
}
/* The caption as a puzzle opens: a small label and the puzzle's name */
.xs-caption {
  position: absolute; left: 50%; top: 50%; z-index: 5; max-width: 94%; padding: 0.5rem 1.3rem 0.75rem;
  background: #fff; border: 4px solid #000; border-radius: 16px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
  text-align: center; pointer-events: none; animation: xs-caption 1.8s ease both;
}
.xs-caption-label { display: block; color: #582c7e; font: bold 0.82rem/1.5 Arial, Helvetica, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.xs-caption-name { display: block; line-height: 0; color: #fe9833; font: 900 clamp(1.5rem, 6vw, 2.2rem)/1 "Arial Black", Arial, Helvetica, sans-serif; }
.xs-caption-name svg { display: block; margin: 0 auto; max-width: 100%; height: auto; overflow: visible; }
.xs-caption-name .xs-plain { display: block; line-height: 1.1; font-size: 0.7em; color: #000; }
@keyframes xs-caption {
  0% { opacity: 0; transform: translate(-50%, -38%) scale(0.9); }
  12%, 82% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1); }
}

/* The clue bar: the clue for the word being filled in, between "previous" and "next" arrows */
.xs-cluebar {
  flex: none; display: flex; align-items: stretch; height: 4rem; margin: 0 0.5rem 0.5rem;
  background: #fff; border: 3px solid #000; border-radius: 14px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.16); overflow: hidden;
}
.xs-nav {
  flex: none; display: flex; align-items: center; justify-content: center; width: 2.75rem; padding: 0;
  border: 0; background: none; color: #582c7e; cursor: pointer;
}
.xs-nav svg { display: block; width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.xs-nav:hover, .xs-clue:hover { background: #f6f0fc; }
.xs-nav:active, .xs-clue:active { background: #e6d9f6; }
.xs .xs-nav:focus-visible, .xs .xs-clue:focus-visible { outline-offset: -3px; border-radius: 10px; }
.xs-clue {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.12rem;
  padding: 0.15rem 0.2rem; border: 0; background: none; color: #000; text-align: center; cursor: pointer;
}
.xs-clue-tag { color: #582c7e; font: bold 0.68rem/1.2 Arial, Helvetica, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; }
.xs-clue-text { font: bold 0.98rem/1.2 Arial, Helvetica, sans-serif; }
.xs-clue.is-long .xs-clue-text { font-size: 0.86rem; }      /* a long clue is set smaller so that it fits (cross-sticks.js decides) */
.xs-clue.is-longer .xs-clue-text { font-size: 0.77rem; line-height: 1.15; }

/* Every clue, in two lists. A row is a button (xs-clue-item): its number, then the clue;
   is-active is the word being filled in, is-solved a word already got right (its answer is added). */
.xs-clues { display: flex; flex-direction: column; min-height: 0; background: #fff; }
.xs-clues-head { display: none; }
.xs-clues-scroll {
  flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0.3rem 0.5rem 0.8rem; touch-action: pan-y;
}
.article .xs-clues-title {
  margin: 0.55rem 0 0.2rem 0.4rem; color: #582c7e; font: bold 0.76rem/1.2 Arial, Helvetica, sans-serif;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.xs .xs-clue-list { list-style: none; margin: 0; padding: 0; }
.xs-clue-item {
  display: flex; align-items: baseline; gap: 0.45rem; width: 100%; padding: 0.3rem 0.4rem;
  border: 0; border-radius: 8px; background: none; color: #000; text-align: left; cursor: pointer;
  font: 0.9rem/1.3 Arial, Helvetica, sans-serif;
}
.xs-clue-item:hover { background: #f6f0fc; }
.xs-clue-item.is-active { background: #ffe9b0; box-shadow: inset 4px 0 0 #582c7e; }
.xs-clue-num { flex: none; min-width: 1.35rem; color: #582c7e; font-weight: bold; text-align: right; }
.xs-clue-words { flex: 1 1 auto; min-width: 0; }
.xs-clue-item.is-solved { color: #857c8e; }
.xs-clue-item.is-solved .xs-clue-num { color: #a79db1; }
.xs-clue-answer { display: block; margin-top: 0.1rem; color: var(--xs-ink); font-size: 0.78rem; font-weight: bold; letter-spacing: 0.07em; }
.xs-clue-answer::before { content: "\2713\00a0"; }

/* Letter keys, for touch screens. Three rows; the last has the Hint and rub-out keys (is-wide).
   is-down is a key under a finger: it swells, like the keys of a phone's own keyboard. */
.xs-keys {
  display: none; flex: none; padding: 0.1rem 0.3rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: #e6dcf3; border-top: 3px solid #000; touch-action: none;
}
.xs.has-keys .xs-keys { display: block; }
.xs-keys-row { display: flex; justify-content: center; gap: var(--xs-gap); max-width: 34rem; margin: 0.3rem auto 0; }
.xs-key {
  position: relative; flex: 0 0 calc((100% - 9 * var(--xs-gap)) / 10); min-width: 0; display: flex; align-items: center; justify-content: center;
  height: 2.85rem; padding: 0; border: 2px solid var(--xs-ink); border-bottom-width: 4px; border-radius: 0.5rem;
  background: #fff; color: #000; cursor: pointer; font: bold 0.74rem/1 Arial, Helvetica, sans-serif; letter-spacing: 0.03em;
  transition: transform 0.05s ease-out;
}
.xs-key .xs-letter { position: static; flex: none; width: min(1.9rem, 100%); height: auto; aspect-ratio: 1; }
.xs-key span.xs-letter { display: block; padding: 0; width: auto; height: auto; font-size: 1.2rem; }
.xs-key.is-wide { flex: 1 1 0; background: #ffa500; color: #000; text-transform: uppercase; }
.xs-key.is-wide svg { display: block; width: 1.6rem; height: 1.6rem; fill: none; stroke: #000; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.xs-key.is-down { z-index: 2; background: #fecb32; transform: translateY(-0.45rem) scale(1.28); box-shadow: 0 0.4rem 0.6rem rgba(0, 0, 0, 0.28); }
.xs-key.is-wide.is-down { transform: translateY(1px) scale(0.97); box-shadow: none; }
.xs-key:disabled { opacity: 0.45; cursor: default; }

/* ---------- How it arranges itself ---------- */
/* Wide (a computer, a tablet on its side): the puzzle on the left, the clues down the right */
.xs.is-wide .xs-body { flex-direction: row; }
.xs.is-wide .xs-main { flex: 1.5 1 0; }
.xs.is-wide .xs-side { flex: 1 1 0; max-width: 23rem; border-left: 4px solid #000; background: #fff; }
.xs.is-wide .xs-clues { flex: 1 1 0; }
/* Wide with letter keys (a tablet or phone on its side): the keys get a wider column, with the
   clue bar above them. On a phone there is no room for the list of clues as well (sheet-clues),
   so the clue bar takes all the space above the keys. */
.xs.is-wide.has-keys .xs-main { flex: 1 1 0; }
.xs.is-wide.has-keys .xs-side { flex: 1.15 1 0; max-width: 28rem; background: var(--arc-paper); }
.xs.is-wide .xs-side .xs-cluebar { margin: 0.5rem; }
.xs.is-wide.has-keys .xs-clues { border-top: 3px solid #000; }
.xs.is-wide.has-keys.sheet-clues .xs-side .xs-cluebar { flex: 1 1 0; height: auto; min-height: 3.4rem; }
/* Stacked without letter keys (a narrow window on a computer): the clues under the puzzle, side by side */
.xs.is-stacked:not(.has-keys) .xs-side { flex: 0 0 30%; border-top: 4px solid #000; }
.xs.is-stacked:not(.has-keys) .xs-clues { flex: 1 1 0; }
.xs.is-stacked:not(.has-keys) .xs-clues-scroll { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 0.6rem; align-content: start; }
/* With letter keys and no room for the list (a phone): the clues are a sheet that slides up over the game */
.xs.sheet-clues .xs-clues { display: none; position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 7; border: 0; }
.xs.sheet-clues.show-clues .xs-clues { display: flex; animation: xs-sheet 0.22s cubic-bezier(0.2, 0.8, 0.3, 1); }
@keyframes xs-sheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
.xs.sheet-clues .xs-clues-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.45rem 0.6rem 0.45rem 0.9rem;
  border-bottom: 3px solid #000; color: #000; font: bold 1rem/1.2 Arial, Helvetica, sans-serif;
}
.xs.sheet-clues .xs-clue-item { padding: 0.5rem 0.4rem; font-size: 0.96rem; }
@media (min-width: 34rem) {
  .xs.sheet-clues .xs-clues-scroll { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 0.8rem; align-content: start; }
}

/* ---------- Confetti and the pop-up panel ---------- */
.xs-fx { position: absolute; left: 0; top: 0; z-index: 9; width: 100%; height: 100%; pointer-events: none; }
.xs .xs-screen .arc-overlay { top: calc(var(--xs-hud) + 0.5rem); z-index: 8; padding: 0.7rem; }   /* the score strip stays in view above the panel */
.xs .arc-panel { overscroll-behavior: contain; }
/* The logo's picture leaves a little room above "Cross" for the tips of the sticks, so the gap
   under it is that much smaller than the shared one (arcade.css) and the panel is no taller. */
.xs .arc-logo { margin-bottom: 0.15rem; }
@media (max-width: 640px) { .xs .arc-logo { margin-bottom: 0.07rem; } }
/* the "solved" panel has the most on it: the tiger and the gaps are a little smaller there */
.xs .arc-overlay[data-screen="done"] .arc-host { margin-bottom: 0.25rem; }
.xs .arc-overlay[data-screen="done"] .arc-tiger { height: 5.2rem; }
.article .xs .arc-overlay[data-screen="done"] .arc-heading { margin: 0.2rem 0 0.35rem; }
.article .xs .arc-overlay[data-screen="done"] .arc-panel-text { margin-bottom: 0.55rem; }
.xs .arc-overlay[data-screen="done"] .arc-stats { margin-bottom: 0.7rem; }
.article .arc-panel .xs-panel-note { color: var(--arc-mute); font-size: 0.82rem; line-height: 1.4; text-align: center; margin: 0.7rem 0 0; }
.article .arc-panel .xs-panel-note:empty { display: none; }
.xs-panel-note strong { color: #000; }
/* The leaderboard's name box, on the solved panel of a Daily Beat (its looks are in arcade.css).
   Nothing in the game's frame can be selected with a finger, but a name has to be typed here. */
.xs .arc-entry { margin-top: 0.1rem; text-align: center; }
.xs .arc-entry input { -webkit-user-select: text; user-select: text; }
/* stars: three big ones when a puzzle is solved, three small ones on each Set List button. is-on is a star earned. */
.article .arc-panel .xs-stars { display: flex; justify-content: center; gap: 0.3rem; margin: 0.1rem 0 0.5rem; line-height: 0; }
.article .arc-panel .xs-stars[hidden] { display: none; }
.xs-star { display: block; width: 2.7rem; height: 2.7rem; overflow: visible; }
.xs-star path { fill: #fff; stroke: #cdc3d8; stroke-width: 1.6; stroke-linejoin: round; }
.xs-star.is-on path { fill: #fecb32; stroke: var(--xs-ink); }
.xs-stars .xs-star.is-on { animation: xs-star 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) both; animation-delay: calc(0.3s + var(--xs-i, 0) * 0.24s); }
@keyframes xs-star { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: scale(1) rotate(0deg); opacity: 1; } }
/* The Set List. The whole panel is one grid there, three squares across: Back in the top
   corner (xs-panel-back) with the heading beside it, then the stars so far, then a button
   for each puzzle (xs-tile: its number, its stars, its name) and Jam Session along the
   bottom (is-wide). is-next is the first puzzle not yet solved. (The panel's two halves and
   the list give up their own boxes, "display: contents", so that everything in them lines
   up on the one grid.) */
.xs .arc-overlay[data-screen="list"] .arc-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; width: min(100%, 25rem); }
.xs .arc-overlay[data-screen="list"] .xs-panel-lead,
.xs .arc-overlay[data-screen="list"] .xs-panel-rest,
.xs .arc-overlay[data-screen="list"] .xs-list { display: contents; }
.xs-list[hidden], .xs-panel-back:empty, .xs .arc-panel-buttons:empty { display: none; }
/* (the heading has the whole top row, so that it sits in the middle of the panel; the space kept
   clear on either side of it is the width of the Back button, which lies over its left end) */
.xs .arc-overlay[data-screen="list"] .xs-panel-back { grid-area: 1 / 1; align-self: center; justify-self: start; z-index: 1; }
.article .xs .arc-overlay[data-screen="list"] .arc-heading { grid-area: 1 / 1 / 2 / -1; align-self: center; margin: 0; padding: 0 5.2rem; }
.article .xs .arc-overlay[data-screen="list"] .arc-panel-text { grid-area: 2 / 1 / 3 / -1; font-size: 0.88rem; line-height: 1.3; margin: 0; }
.xs-tile {
  display: flex; flex-direction: column; gap: 0.2rem; min-height: 3.5rem; padding: 0.3rem 0.4rem 0.35rem;
  border: 2px solid var(--arc-line); border-radius: 10px; background: #fff; color: #000; text-align: left; cursor: pointer;
  font: bold 0.8rem/1.15 Arial, Helvetica, sans-serif;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.xs-tile:hover { background: #f6f0fc; border-color: var(--arc-deep); }
.xs-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 0.3rem; }
.xs-tile-num {
  flex: none; display: flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--arc-deep); color: #fff; font-size: 0.74rem;
}
.xs-tile-stars { display: flex; gap: 1px; }
.xs-tile-stars .xs-star { width: 0.84rem; height: 0.84rem; }
.xs-tile-stars .xs-star path { stroke-width: 2.2; }
.xs-tile.is-done .xs-tile-num { background: var(--arc-orange); color: #000; }
.xs-tile.is-next { background: #fff5dc; border-color: #000; box-shadow: 0 0 0 2px var(--arc-orange); }
.xs-tile.is-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 0.5rem; min-height: 2.4rem; border-style: dashed; }
.xs-tile.is-wide .xs-tile-num { background: var(--arc-blue); color: #000; font-size: 0.95rem; }
.xs-tile-more { color: var(--arc-mute); font-weight: normal; }

/* A wide, short screen (a phone held sideways): the panel's two halves sit side by side, the
   tiger and the title (xs-panel-lead) on the left, the words and buttons (xs-panel-rest) on
   the right. cross-sticks.js marks the overlay "is-across" when the panel is too tall the
   usual way and the screen is wide enough. Its parts are the sizes they are on a phone. */
.xs .arc-overlay.is-across .arc-panel {
  display: flex; gap: 1.1rem; width: min(100%, 40rem);
  padding: 0.6rem 0.9rem 0.7rem; border-width: 3px; border-radius: 15px;
}
/* (auto margins: each half sits in the middle when there is room, and starts at the top when there isn't) */
.xs .arc-overlay.is-across .xs-panel-lead { flex: 0 0 41%; min-width: 12.2rem; margin: auto 0; }   /* (never narrower than the tiger and his speech bubble) */
.xs .arc-overlay.is-across .xs-panel-rest { flex: 1 1 0; min-width: 0; margin: auto 0; }
.xs .arc-overlay.is-across .arc-host { margin-bottom: 0.3rem; }
.xs .arc-overlay.is-across .arc-tiger { height: 4.4rem; }
.xs .arc-overlay.is-across .arc-bubble { font-size: 0.9rem; padding: 0.6em 0.75em; border-width: 2px; }
.xs .arc-overlay.is-across .arc-bubble::after { border-width: 2px; right: -0.55em; }
.xs .arc-overlay.is-across .arc-logo { width: min(90%, 13rem); margin: 0 auto; }
.article .xs .arc-overlay.is-across .arc-heading { font-size: 1.45rem; margin: 0.2rem 0 0; }
.article .xs .arc-overlay.is-across .xs-stars { margin: 0.35rem 0 0; }
.article .xs .arc-overlay.is-across .arc-panel-text { font-size: 0.88rem; margin-bottom: 0.55rem; }
.xs .arc-overlay.is-across .arc-stats { gap: 1.1rem; margin: 0 0 0.6rem; }
.xs .arc-overlay.is-across .arc-stats dd { font-size: 1.25rem; }
.xs .arc-overlay.is-across .arc-btn { padding: 0.55rem 1.1rem; }
.article .xs .arc-overlay.is-across .xs-panel-note { margin-top: 0.5rem; }
/* the leaderboard's name box goes under the stars there, at its phone size and without its hint */
.xs .arc-overlay.is-across .arc-entry { margin: 0.45rem 0 0; padding: 0.45rem 0.6rem 0.55rem; }
.xs .arc-overlay.is-across .arc-entry label { font-size: 0.86rem; margin-bottom: 0.35rem; }
.xs .arc-overlay.is-across .arc-entry input { font-size: 1rem; padding: 0.3rem 0.5rem; }
.xs .arc-overlay.is-across .arc-entry .arc-btn { padding: 0.45rem 0.9rem; }
.xs .arc-overlay.is-across .arc-entry-hint { display: none; }
/* The Set List on such a screen has as many squares across as fit. Along the top: Back on
   the left, the heading with the stars so far under it, and Jam Session on the right. The
   puzzles fill the rows under that. */
.xs .arc-overlay.is-across[data-screen="list"] .arc-panel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(5.3rem, 1fr)); gap: 0.3rem 0.35rem;
  width: min(100%, 46rem); padding: 0.6rem 0.7rem 0.7rem;
}
.xs .arc-overlay.is-across[data-screen="list"] .xs-panel-back { grid-area: 1 / 1 / 3 / 2; }
.article .xs .arc-overlay.is-across[data-screen="list"] .arc-heading { grid-area: 1 / 2 / 2 / -3; align-self: end; font-size: 1.3rem; margin: 0; padding: 0; }
.article .xs .arc-overlay.is-across[data-screen="list"] .arc-panel-text { grid-area: 2 / 2 / 3 / -3; align-self: start; font-size: 0.82rem; margin: -0.15rem 0 0.1rem; }
.xs .arc-overlay.is-across[data-screen="list"] .xs-tile { gap: 0.1rem; min-height: 0; padding: 0.25rem 0.3rem 0.3rem; }
.xs .arc-overlay.is-across[data-screen="list"] .xs-tile.is-wide { grid-area: 1 / -3 / 3 / -1; gap: 0.4rem; align-self: center; min-height: 2.6rem; }

/* ---------- Filling the screen ---------- */
/* Full screen (the button under the game) on a computer or tablet: the frame takes the whole
   screen, with the buttons under it. The three versions are written out separately on purpose:
   a browser that doesn't know one of the ":fullscreen" names would otherwise skip the whole rule. */
.arc-game.xs.is-max .xs-screen { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 76rem; height: auto; }
.arc-game.xs:fullscreen .xs-screen { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 76rem; height: auto; }
.arc-game.xs:-webkit-full-screen .xs-screen { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 76rem; height: auto; }
/* On a phone the game fills the screen by itself while a puzzle is being played, like an app:
   no frame, no buttons underneath (sound, pause and close move into the score strip). */
@media (max-width: 700px), (max-height: 560px) {
  .xs { --xs-hud: 2.9rem; }
  .arc-game.xs.is-max { padding: 0; bottom: auto; height: 100vh; height: 100dvh; }
  .arc-game.xs:fullscreen { padding: 0; }
  .arc-game.xs:-webkit-full-screen { padding: 0; }
  .arc-game.xs.is-max .xs-screen { max-width: none; border: 0; border-radius: 0; box-shadow: none; }
  .arc-game.xs:fullscreen .xs-screen { max-width: none; border: 0; border-radius: 0; box-shadow: none; }
  .arc-game.xs:-webkit-full-screen .xs-screen { max-width: none; border: 0; border-radius: 0; box-shadow: none; }
  .arc-game.xs.is-max .arc-controls { display: none; }
  .arc-game.xs:fullscreen .arc-controls { display: none; }
  .arc-game.xs:-webkit-full-screen .arc-controls { display: none; }
  .arc-game.xs.is-max .xs-hud-buttons { display: flex; }
  .arc-game.xs:fullscreen .xs-hud-buttons { display: flex; }
  .arc-game.xs:-webkit-full-screen .xs-hud-buttons { display: flex; }
  /* the score takes the room it needs (with its "Roll" badge); the puzzle's name gives way */
  .xs-hud { grid-template-columns: auto minmax(0, 1fr) auto auto; padding: 0 0.7rem; column-gap: 0.6rem; }
  .xs-hud-value { font-size: 1.15rem; height: 1.25rem; }
  .xs-hud-value .xs-hud-roll { padding: 0.1rem 0.36rem; font-size: 0.68rem; }
  .xs-board-box { padding: 0.35rem; }
  .xs-cluebar { height: 3.7rem; margin: 0 0.35rem 0.35rem; border-radius: 12px; }
  .xs.is-wide .xs-side .xs-cluebar { margin: 0.35rem; }
  .xs .arc-overlay[data-screen="list"] .arc-panel { padding-left: 0.6rem; padding-right: 0.6rem; }
  .xs-star { width: 2.3rem; height: 2.3rem; }
}
/* short screens (a phone on its side, a small phone): smaller keys and clue bar leave more room for the puzzle */
@media (max-height: 600px) {
  .xs-key { height: 2.5rem; }
  .xs-keys-row { margin-top: 0.25rem; }
  .xs-cluebar { height: 3.4rem; }
  .xs-clue-text { font-size: 0.92rem; }
}
@media (max-width: 360px) {
  .xs { --xs-gap: 0.22rem; }
  .xs-nav { width: 2.4rem; }
}

/* (The leaderboard under the game, its two tabs and its rows are the arcade's own: see arcade.css.) */

@media (prefers-reduced-motion: reduce) {
  .xs-cell.just-typed .xs-letter, .xs-cell.just-solved, .xs-cell.is-wrong, .xs-board.is-dealing .xs-cell,
  .xs-stars .xs-star.is-on, .xs-hud-value .xs-hud-roll { animation: none; }
  .xs-pop { animation-name: xs-pop-calm; }
  .xs-caption { animation-name: xs-caption-calm; }
  .xs.sheet-clues.show-clues .xs-clues { animation: none; }
  .xs-key { transition: none; }
}
@keyframes xs-pop-calm { 0%, 80% { transform: translate(-50%, -50%); opacity: 1; } 100% { transform: translate(-50%, -50%); opacity: 0; } }
@keyframes xs-caption-calm { 0%, 85% { transform: translate(-50%, -50%); opacity: 1; } 100% { transform: translate(-50%, -50%); opacity: 0; } }
