/* Cryptograms — level picker, quote board, frequency panel, stats and on-screen keys */

/* The app's How to Play popup sits outside the page, so it gets the colours too. */
.cryptograms-page,
.pv-native-how-modal__body {
  --cg-cell-w: clamp(1.4rem, 3.6vw, 1.85rem);
  --cg-border: var(--border);
  --cg-surface: var(--surface-strong);
  --cg-cell-bg: var(--bg-elevated);
  --cg-given: #0f766e;
  --cg-given-bg: #ccfbf1;
  --cg-conflict: #b45309;
  --cg-conflict-bg: #fef3c7;
  --cg-wrong: #dc2626;
  --cg-wrong-bg: #fee2e2;
  --cg-match-bg: color-mix(in srgb, var(--accent-soft) 70%, var(--cg-cell-bg));
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0 0;
}

[data-theme="dark"] .cryptograms-page,
[data-theme="dark"] .pv-native-how-modal__body {
  --cg-given: #5eead4;
  --cg-given-bg: rgba(45, 212, 191, 0.16);
  --cg-conflict: #fbbf24;
  --cg-conflict-bg: rgba(251, 191, 36, 0.16);
  --cg-wrong: #f87171;
  --cg-wrong-bg: rgba(248, 113, 113, 0.16);
}

.cryptograms-shell {
  width: min(900px, 100%);
  margin-inline: auto;
}

/* ---- header ---- */

.cryptograms-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 0.42rem clamp(0.35rem, 2vw, 0.85rem);
  border-bottom: 1px solid var(--cg-border);
}

.cryptograms-header__row {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.cryptograms-header__title {
  margin: 0;
  font-size: clamp(1.15rem, 3.2vw, 1.5rem);
  line-height: 1.2;
}

.cryptograms-header__controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* Pill timer matching the other games (Word Search, Fill-Ins); its colours come
   from the shared "option/stat cards" rule in main.css. */
.cryptograms-header__timer {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.35rem;
  padding: 0 0.95rem;
  border: 1px solid var(--cg-border);
  border-radius: 999px;
}

.cryptograms-header__timer-icon {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.85;
}

.cryptograms-header__timer-digits {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--text);
}

/* Plain status line like Word Search's toolbar status and Color Rush's status:
   centred, muted, semi-bold. */
.cryptograms-header__status {
  flex: 1 1 100%;
  min-height: 1.35em;
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

/* ---- difficulty picker: a badge next to the title, see level-menu.css ---- */

/* ---- board ---- */

.cryptograms-body {
  padding: 0.75rem clamp(0.35rem, 2vw, 0.85rem) 1rem;
}

.cg-quote-wrap {
  position: relative;
}

.cg-quote {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 0.95rem;
  padding: 1rem 0.6rem;
  border: 1px solid var(--cg-border);
  border-radius: var(--radius-md);
  background: var(--cg-surface);
  box-shadow: var(--shadow-sm);
}

.cg-word {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.12rem;
  white-space: nowrap;
}

.cg-cell {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  width: var(--cg-cell-w);
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Letter boxes are Wordscapes-style tiles (wordscapes.css .ws-cell--tile /
   .ws-cell--filled): rounded, soft purple gradient, thin border, small shadow;
   a filled tile gets the stronger gradient and a purple border. The given /
   amber / red / selected states keep their own colours on top of the tile. */
.cg-cell__guess {
  --cg-tile-shadow: 0 2px 6px rgba(91, 33, 182, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: calc(var(--cg-cell-w) * 1.2);
  border: 1px solid rgba(91, 33, 182, 0.22);
  border-radius: clamp(5px, 1.6vw, 8px);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(237, 228, 255, 0.65) 48%,
    rgba(199, 210, 254, 0.45) 100%
  );
  box-shadow: var(--cg-tile-shadow);
  color: var(--text);
  font-size: calc(var(--cg-cell-w) * 0.72);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

[data-theme="dark"] .cg-cell__guess {
  --cg-tile-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(196, 181, 253, 0.28);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(139, 92, 246, 0.22) 55%,
    rgba(99, 102, 241, 0.18) 100%
  );
}

/* Code letters use the panel-heading look ("Letter frequencies", Fill-Ins'
   "Words to fill"): muted, bold, letter-spaced, so they stay quieter than the
   guesses in the tiles. The left padding balances the trailing letter-spacing
   so a single letter stays centred under its tile. */
.cg-cell__code {
  padding-left: 0.07em;
  font-size: calc(var(--cg-cell-w) * 0.5);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.07em;
  font-variant-numeric: tabular-nums;
}

.cg-cell.is-filled .cg-cell__guess {
  --cg-tile-shadow: 0 3px 10px rgba(91, 33, 182, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: linear-gradient(145deg, #ffffff 0%, #ede9fe 45%, #ddd6fe 100%);
}

[data-theme="dark"] .cg-cell.is-filled .cg-cell__guess {
  --cg-tile-shadow: 0 3px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, #3b2f55 0%, #4c3d6e 50%, #5b4a82 100%);
}

/* Other boxes with the selected code letter. */
.cg-cell.is-match .cg-cell__guess {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--cg-match-bg);
}

.cg-cell.is-locked {
  cursor: default;
}

/* State tiles: flat tint and matching border, same shape and shadow. */
.cg-cell.is-locked .cg-cell__guess {
  border-color: var(--cg-given);
  background: var(--cg-given-bg);
  color: var(--cg-given);
}

.cg-cell.is-conflict .cg-cell__guess {
  border-color: var(--cg-conflict);
  background: var(--cg-conflict-bg);
  color: var(--cg-conflict);
}

.cg-cell.is-wrong .cg-cell__guess {
  border-color: var(--cg-wrong);
  background: var(--cg-wrong-bg);
  color: var(--cg-wrong);
}

/* Boxes in a word sit only ~2px apart, so anything drawn outside a box is
   painted over by its right-hand neighbour. The selection ring is therefore an
   inset shadow that stays inside the box, and the active/focused box is lifted
   above its neighbours so the focus outline below is never clipped either. */
.cg-cell.is-active,
.cg-cell:focus-visible {
  z-index: 1;
}

.cg-cell.is-active .cg-cell__guess {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent), var(--cg-tile-shadow);
}

.cg-cell.is-active .cg-cell__code,
.cg-cell.is-match .cg-cell__code {
  color: var(--accent-strong);
  font-weight: 800;
}

.cg-cell:focus-visible {
  outline: none;
}

.cg-cell:focus-visible .cg-cell__guess {
  outline: 2px solid var(--accent-strong);
  outline-offset: 1px;
}

/* Punctuation uses the tile letters' text (size, weight, colour) and a box the
   tile's height with the same vertical centring, so commas and full stops sit
   on the same baseline as the guessed letters. */
.cg-punct {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-width: 0.35rem;
  height: calc(var(--cg-cell-w) * 1.2);
  font-size: calc(var(--cg-cell-w) * 0.72);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

/* Invisible text field that receives typing. It must stay focusable (not
   display:none) so tapping a box can open the device keyboard; 16px text stops
   iOS from zooming the page when it takes focus. */
.cg-type-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  color: transparent;
  background: transparent;
  caret-color: transparent;
  pointer-events: none;
}

/* Colour, size and line height come from the shared "How to Play" text rule
   in main.css, like the how-to line below; kept centred under the board. */
.cg-source {
  margin: 0.6rem 0 0;
  text-align: center;
}

.cg-source__name {
  font-weight: 700;
}

/* ---- toolbar ---- */

.cg-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
}

.cg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--cg-border);
  border-radius: 999px;
  background: var(--cg-surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* 16px, same as Queens' and Zip's buttons */
  font-weight: 700;
  cursor: pointer;
}

.cg-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.cg-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cg-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Hide/Show toggle beside the panel heading. Colours, border, shape and hover
   come from the shared game-button rules in main.css; 16px text like the other
   buttons, with slightly tighter padding so it sits beside the heading. */
.cg-link-btn {
  min-height: 1.9rem;
  padding: 0.15rem 0.7rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.cg-link-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---- how to play ---- */

/* Colour, size and line height come from the shared "How to Play" rule in
   main.css (Queens, Zip, Color Rush); left-aligned like those games. */
.cg-how {
  margin: 0.7rem 0 0;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

/* Legend tags share the non-interactive "option/stat card" look from main.css
   (transparent, soft shadow), like the letter tracker. Each tag keeps its own
   colour on the border and text, matching the amber/red frequency chips. */
.cg-legend {
  display: inline-block;
  padding: 0 0.45rem;
  border: 1px solid var(--cg-border);
  border-radius: 12px;
  font-weight: 800;
  line-height: 1.45;
}

:is(.cryptograms-page, .pv-native-how-modal__body) .cg-how .cg-legend--given {
  border-color: var(--cg-given);
  color: var(--cg-given);
}

:is(.cryptograms-page, .pv-native-how-modal__body) .cg-how .cg-legend--conflict {
  border-color: var(--cg-conflict);
  color: var(--cg-conflict);
}

:is(.cryptograms-page, .pv-native-how-modal__body) .cg-how .cg-legend--wrong {
  border-color: var(--cg-wrong);
  color: var(--cg-wrong);
}

/* ---- frequency panel + letter strip ---- */

.cg-freq {
  margin: 0.95rem 0 0;
}

.cg-freq__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
}

/* Same panel heading as Fill-Ins' "Words to fill" and Word Search's "Words to
   find": small muted capitals that scale down on narrow screens. */
.cg-freq__title,
.cg-remaining-wrap__title {
  margin: 0;
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.cg-remaining-wrap__title {
  margin-bottom: 0.4rem;
}

.cg-freq__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.85rem, 1fr));
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cg-freq__list[hidden] {
  display: none;
}

/* Chips use the shared game-button style from main.css (shape, border, shadow,
   hover). That style forces the text colour with an inherited
   -webkit-text-fill-color, so the letters inside reset it to keep the
   given / amber / red colour coding below. */
.cg-freq__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  width: 100%;
  padding: 0.25rem 0.15rem 0.3rem;
  font: inherit;
  cursor: pointer;
}

.cg-freq__item span {
  -webkit-text-fill-color: currentColor;
}

.cg-freq__top {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
}

/* Code letters look the same as the codes under the board tiles: muted, bold,
   letter-spaced; the selected chip's code turns bold purple like the board's. */
.cg-freq__code {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.cg-freq__item.is-active .cg-freq__code {
  color: var(--accent-strong);
  font-weight: 800;
}

/* Same muted, bold, letter-spaced look as the code letter beside it, kept
   smaller so the count stays secondary. */
.cg-freq__count {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  font-variant-numeric: tabular-nums;
}

/* A guessed letter looks the same here as in its board tile: dark, extra-bold.
   Given / amber / red / "?" colours below match the tiles too. */
.cg-freq__guess {
  min-width: 1.3rem;
  border-top: 1px solid var(--cg-border);
  padding-top: 0.08rem;
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  color: var(--text);
}

.cg-freq__item.is-empty .cg-freq__guess {
  color: var(--text-muted);
  opacity: 0.55;
}

.cg-freq__item.is-given .cg-freq__guess {
  color: var(--cg-given);
}

.cg-freq__item.is-conflict .cg-freq__guess {
  color: var(--cg-conflict);
}

.cg-freq__item.is-wrong .cg-freq__guess {
  color: var(--cg-wrong);
}

/* State borders: scoped to the page so they outrank the shared border colour. */
.cryptograms-page .cg-freq__item.is-conflict {
  border-color: var(--cg-conflict);
}

.cryptograms-page .cg-freq__item.is-wrong {
  border-color: var(--cg-wrong);
}

/* Selected letter: same held-hover look as the selected level button. */
.cryptograms-page .cg-freq__item.is-active {
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent) inset,
    0 6px 14px rgba(58, 30, 118, 0.14);
}

.cg-freq__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.cg-remaining-wrap {
  margin: 0.85rem 0 0;
}

.cg-remaining {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Not clickable, so these use the shared non-interactive "option/stat card"
   colours from main.css (like the timer) rather than the button rules, with
   the frequency chips' shape so the two panels match. */
.cg-remaining__letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  min-height: 1.85rem;
  padding: 0.18rem 0.3rem;
  border: 1px solid var(--cg-border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.cg-remaining__letter.is-used {
  opacity: 0.38;
  text-decoration: line-through;
}

/* ---- win panel ---- */

.cryptograms-win-panel {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  /* Anchor to the top of the quote so a tall card grows downward over the
     toolbar instead of upward over the level picker. */
  align-items: flex-start;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  /* Transparent overlay so the card can be taller than the quote box without a
     half-covering backdrop; the card itself takes the pointer events. */
  background: transparent;
  pointer-events: none;
}

.cryptograms-win-panel[hidden] {
  display: none;
}

.cryptograms-win-panel__modal {
  width: min(440px, 100%);
  padding: 1.15rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
  /* Panel text, as on every other game's win panel (main.css
     .word-search-win-panel__modal): 16px, semi-bold, same colour and line
     height. Everything inside inherits it. */
  color: #22133f;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  pointer-events: auto;
  animation: cg-win-pop 0.45s ease-out;
}

[data-theme="dark"] .cryptograms-win-panel__modal {
  color: #f2f5ff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

@keyframes cg-win-pop {
  0% { opacity: 0; transform: scale(0.94); }
  100% { opacity: 1; transform: scale(1); }
}

/* Same outlined card as the stats tiles (shared "option/stat card" look in main.css). */
.cryptograms-win-panel__quote-wrap {
  margin: 0.55rem 0 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--cg-border);
  border-radius: 12px;
  text-align: left;
}

/* All win panel text (title, quote, author, details) inherits the panel's
   text, the same pattern every other game's win panel uses (Word Search,
   Fill-Ins, Queens, Color Rush, Arrow Escape, Tangram, Wordscapes). The emoji
   sets the title apart, as in the other games, and the quote's card sets it
   apart from the details. */
.cryptograms-win-panel__title,
.cryptograms-win-panel__quote,
.cryptograms-win-panel__author,
.cryptograms-win-panel__detail {
  margin: 0;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.cryptograms-win-panel__detail + .cryptograms-win-panel__detail {
  margin-top: 0.25rem;
}

/* Attribution sits right-aligned under the quote, in the same text style. */
.cryptograms-win-panel__author {
  margin-top: 0.35rem;
  text-align: right;
}


/* Colours, border, shape and hover come from the shared game-button rules in
   main.css (same as the other games' celebration buttons). */
.cryptograms-win-panel__btn {
  margin: 0.6rem 0 0;
  padding: 0.55rem 1.25rem;
  font: inherit;
  font-size: 1rem; /* 16px, same as the other Cryptograms buttons */
  font-weight: 700;
  cursor: pointer;
}

.cryptograms-win-panel__btn:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* ---- stats dialog ---- */

.cg-stats {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1rem 1.1rem 0.9rem;
  border: 1px solid var(--cg-border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.cg-stats::backdrop {
  background: rgba(18, 12, 26, 0.45);
}

.cg-stats__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.75rem;
}

/* Same dialog title as Wordscapes' "Choose a level" modal. */
.cg-stats__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

/* Colours, border, shape and hover come from the shared game-button rules in main.css. */
.cg-stats__close {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  font-size: 1rem; /* 16px, same as the other buttons */
  line-height: 1;
  cursor: pointer;
}

.cg-stats__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cg-stats__summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin: 0 0 0.8rem;
}

/* Display-only tiles: shared "option/stat card" look from main.css
   (transparent, purple-tinted border, soft shadow), like the timer. */
.cg-stats__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem 0.4rem;
  border: 1px solid var(--cg-border);
  border-radius: 12px;
}

.cg-stats__value {
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
}

.cg-stats__label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

/* The table sits in the same outlined card as the tiles above it (shared
   "option/stat card" look from main.css). */
.cg-stats__table-wrap {
  overflow-x: auto;
  border: 1px solid var(--cg-border);
  border-radius: 12px;
}

/* Values use the stat-chip text from the other games (Queens' chips, Zip's
   timer): bold, fixed-width numbers. */
.cg-stats__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cg-stats__table th,
.cg-stats__table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--cg-border);
  text-align: center;
  white-space: nowrap;
}

/* The card's border closes the table, so the last row needs no rule. */
.cg-stats__table tbody tr:last-child th,
.cg-stats__table tbody tr:last-child td {
  border-bottom: none;
}

/* Column headings use the panel-heading look ("Letter frequencies", Fill-Ins'
   "Words to fill"): small muted capitals, letter-spaced. */
.cg-stats__table thead th {
  color: var(--text-muted);
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  /* Two-word headings ("Best time", "Best streak") wrap so the table fits. */
  white-space: normal;
  line-height: 1.25;
}

.cg-stats__table tbody th {
  text-align: left;
  font-weight: 700;
}

/* Current level: same light purple fill as the selected level button. */
.cg-stats__table tr.is-current {
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
}

.cg-stats__table tr.is-current th {
  color: var(--accent-strong);
  font-weight: 800;
}

/* Same helper-tip text as Fill-Ins' note under its word list. */
.cg-stats__note {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  font-size: clamp(0.72rem, 2.2vw, 0.84rem);
  line-height: 1.45;
  text-align: center;
}

/* ---- compact screens ---- */

@media (max-width: 480px) {
  .cryptograms-page {
    --cg-cell-w: clamp(1.2rem, 6.4vw, 1.55rem);
  }

  .cg-quote {
    gap: 0.6rem 0.6rem;
    padding: 0.75rem 0.3rem;
  }

  .cg-word {
    gap: 0.08rem;
  }

  /* Fit all seven columns on a phone instead of scrolling sideways. */
  .cg-stats {
    padding-inline: 0.75rem;
  }

  .cg-stats__table {
    font-size: 0.76rem;
  }

  .cg-stats__table th,
  .cg-stats__table td {
    padding: 0.42rem 0.2rem;
  }

  /* Smaller and tighter on phones so all seven columns fit without scrolling
     (single words like "PLAYED" cannot wrap). */
  .cg-stats__table thead th {
    font-size: 0.6rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
  }
}
