/* == fonts: generated by `npm run fonts` (sites/tools/fonts.mjs), do not edit by hand == */
/* Self-hosted from Google Fonts. To change the faces, edit the URL below and
   re-run `npm run fonts`; it reads the URL back from here, and the preload
   list too (PAGE.md, "Preload what paints first").
   source: https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,500;0,700;0,800;1,800;1,900&display=swap
   preload: Montserrat:500,Montserrat:900i
*/
@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/montserrat-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/montserrat-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 900;
  font-display: swap;
  src: url('/assets/fonts/montserrat-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 900;
  font-display: swap;
  src: url('/assets/fonts/montserrat-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/montserrat-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/montserrat-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/montserrat-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/montserrat-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/montserrat-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/montserrat-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* == end fonts == */

/* Color Me Improv — "Cue Cards" direction (ChatGPT, 22 Nov 2026).
   Palette from cszsanjose.com, read off the live page. */
:root {
  --navy: #003458;
  --blue: #0A4E83;
  --red-deep: #98161F;
  --red: #B51F27;
  --grey: #E9E6E8;
  --ink: #000;
  --white: #fff;
  --panel: #EFEDEE;
  --outside: #E9E6E8; /* the window either side of the column: the mockup's pale ground, so the navy header and tabs keep an edge (BUILD.md; desktop review 2) */
  --frame: 1200px;    /* BUILD.md default column; desktop review 1 */
  --line: #8F8A8D;   /* 3:1 against white, a firmer search field: mobile review 6 */

  --slant: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  --radius: 4px;   /* squarer cue cards: desktop review 6 */
  --tab-h: 60px;   /* desktop 11 said 56-60, mobile 12 said 60-64 */
  --gutter: clamp(14px, 4vw, 32px);   /* 14 on a phone, ~32 on a tablet: tablet review 4, 13 */
  --measure: 680px;   /* the phone/tablet column, centred: tablet review 1 */
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  min-height: 100dvh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .dot { fill: currentColor; stroke: none; }

/* One column, phone-width; on desktop it sits centred on navy */
.app {
  max-width: var(--frame);
  margin: 0 auto;
  background: var(--white);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
@media (min-width: 600px) {
  .app { box-shadow: 0 0 0 1px rgb(0 0 0 / .08); }
}

/* ---------- header: navy with the red slash ---------- */
.top {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: var(--white);
  padding: calc(14px + env(safe-area-inset-top)) max(var(--gutter), calc((100% - var(--measure)) / 2)) 18px;   /* logo on the column's edge: tablet review 3, 4 */
  display: flex;
  align-items: center;   /* title and logo share a centre: mobile review 4 */
  gap: 12px;
  min-height: 104px;
}
.top::after {
  content: "";
  position: absolute;
  top: 0; right: -30px; bottom: 0;
  width: 90px;
  background: var(--red);
  transform: skewX(-18deg);
}
.logo {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  color: var(--white);
  text-decoration: none;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  line-height: .9;
  font-size: clamp(14.4px, calc(13px + 0.37vw), 16px);   /* desktop review 4 (+25%), mobile review 3 (-10% on a phone) */
  transform: rotate(-6deg);
  padding-bottom: 6px;
  align-self: center;
}
.logo span:last-child {
  font-size: clamp(18.9px, calc(17px + 0.49vw), 21px);
  border-bottom: 3px solid var(--red);
  padding-bottom: 2px;
}
.top-title {
  position: relative;
  z-index: 1;
  margin: 0;
  flex: 1;
  text-align: center;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(28px, 9vw, 44px);
  line-height: 1;
  letter-spacing: .01em;
  padding-right: 52px;
}

.view { width: 100%; max-width: var(--measure); margin-inline: auto; }
main { flex: 1; padding: clamp(10px, 2vw, 16px) var(--gutter) 18px; }   /* search sits 10 under the masthead: desktop review 5 */
.view { display: flex; flex-direction: column; gap: 8px; }   /* search, deck and button one group: mobile review 5 */

/* ---------- search ---------- */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;   /* mobile review 2 */
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / .06);
}
.search:focus-within { border-color: var(--blue); }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 17px;
  font-weight: 700;
}
.search input::placeholder { font-weight: 500; color: #6b6b6b; }

/* ---------- category bars ---------- */
.cats, .games { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(4px, calc(0.6vw + 2px), 6px); }   /* desktop review 7, tablet review 9 */
.cat {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;   /* desktop review 6 */
  padding: 5px 12px;
  border: 0;
  border-radius: var(--radius);
  color: var(--white);
  text-align: left;
  text-decoration: none;
  background: var(--red-deep);
}
.cats li:nth-child(even) .cat { background: var(--blue); }
.cats li:nth-child(4n+4) .cat { background: var(--navy); }
.cat:active { filter: brightness(1.15); }
.cat > svg { width: 38px; height: 28px; stroke-width: 2.2; }   /* fixed icon column: mobile review 7 */   /* fixed icon box, so every title starts on one line: review 9 */
.cat-text { flex: 1; display: flex; flex-direction: column; line-height: 1.1; }
.cat-name { font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(18px, calc(17px + 0.25vw), 20px); }   /* +1 on a tablet: tablet review 7 */
.cat-sub { font-size: 12px; font-weight: 500; opacity: .82; margin-top: 1px; }   /* quieter by opacity, not size: desktop 8, mobile 8 */
.cat-count { font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; min-width: 44px; }   /* one axis for every count: review 9 */
.cat-count svg { width: 18px; height: 18px; }

/* ---------- a category's games ---------- */
.back {
  align-self: flex-start;
  display: flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 4px 0;
  font-weight: 700; color: var(--blue);
}
.back svg { width: 20px; height: 20px; }
.game {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 0;
  border-left: 6px solid var(--red);
  border-radius: var(--radius);
  background: var(--panel);
  text-align: left;
}
.games li:nth-child(even) .game { border-left-color: var(--blue); }
.game-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.game-name { font-weight: 800; font-size: 17px; }
.game-meta { font-size: 12px; font-weight: 500; color: #555; }
.game svg { width: 18px; height: 18px; color: #777; }
.empty { padding: 14px; background: var(--panel); border-radius: var(--radius); font-weight: 600; }

/* ---------- slanted banner labels ---------- */
.banner {
  margin: 0;
  display: inline-block;
  align-self: flex-start;
  min-width: 70%;
  padding: 6px 30px 6px 12px;
  background: var(--red-deep);
  color: var(--white);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: 19px;
  line-height: 1.15;
  clip-path: var(--slant);
}
.banner.blue { background: var(--blue); }
.banner.navy { background: var(--navy); }

/* ---------- big red button ---------- */
.big-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;   /* icon and label one unit: mobile review 10 */
  width: 100%;
  min-height: 50px;   /* a little taller than a card: desktop 10, mobile 2 */
  padding-inline: 16px;
  margin-top: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--red);
  color: var(--white);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: 18px;   /* mobile review 10 */
  letter-spacing: .01em;
}
.big-btn:active { background: var(--red-deep); }
.big-btn svg { width: 28px; height: 28px; stroke-width: 2.2; }
.big-btn.ghost { background: var(--grey); color: var(--navy); }

/* ---------- rhyme ---------- */
.toggle { display: flex; gap: 6px; }
.toggle button {
  flex: 1;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--grey);
  font-weight: 700;
}
.toggle button[aria-checked="true"] { background: var(--red); color: var(--white); }
.rgroup { display: flex; flex-direction: column; }
.rgroup .banner { min-width: 78%; }
.rwords {
  margin: 0;
  padding: 10px 14px 12px;
  list-style: none;
  background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 4px 16px;
}
.rwords li { font-weight: 800; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.rwords li.phrase { font-weight: 600; font-size: 16px; color: #333; }
.hint { margin: 6px 2px; font-size: 14px; font-weight: 500; color: #555; }
.hint.center { text-align: center; }

/* ---------- random ---------- */
#rand-cards { display: flex; flex-direction: column; gap: 10px; }
.rcard {
  position: relative;
  display: flex; flex-direction: column;
  border: 0; padding: 0; background: none; text-align: left; width: 100%;
}
.rcard .banner { font-size: 16px; padding-top: 4px; padding-bottom: 4px; min-width: 75%; }
.rcard-word {
  display: block;
  padding: 8px 52px 10px 14px;
  background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  font-weight: 800;
  font-size: clamp(30px, 9vw, 40px);
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}
.rcard.small { flex-direction: row; align-items: stretch; }
.rcard.small .banner { min-width: 0; width: 42%; display: flex; align-items: center; }
.rcard.small .rcard-word { flex: 1; font-size: 18px; border-radius: 0 var(--radius) var(--radius) 0; display: flex; align-items: center; justify-content: center; padding: 8px 48px 8px 10px; }
.rcard.rolled .rcard-word { animation: pop .25s ease-out; }
.rcard.locked .rcard-word { box-shadow: inset 0 0 0 2.5px var(--navy); }
.lock {
  position: absolute;
  right: 6px; bottom: 6px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: #888;
}
.rcard.small .lock { bottom: auto; top: 50%; transform: translateY(-50%); }
.rcard.locked .lock { color: var(--white); background: var(--navy); }
.lock svg { width: 20px; height: 20px; }
@keyframes pop { from { transform: scale(.94); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rcard.rolled .rcard-word { animation: none; } }

/* ---------- bottom tabs ---------- */
.tabs {
  position: fixed;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--frame);
  display: flex;
  background: var(--navy);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 5;
}
.tabs a {
  position: relative;
  flex: 1;
  height: var(--tab-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;   /* icon and label one centred unit: tablet review 11 */
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  isolation: isolate;
}
.tabs a[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset: 0 clamp(16px, calc(8vw - 20px), 70px);   /* narrows with the third it marks: desktop 12, tablet 12 */
  background: var(--red);
  transform: skewX(-14deg);
  z-index: -1;
}

/* ---------- game sheet ---------- */
.sheet {
  width: min(560px, 100%);
  max-width: 100%;
  max-height: 85dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 16px 16px 0 0;
  background: var(--white);
}
.sheet::backdrop { background: rgb(0 20 40 / .6); }
.sheet-inner { padding: 22px var(--gutter) calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.sheet-cat { margin: 0; align-self: flex-start; }
.sheet h2 { margin: 0; font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 30px; line-height: 1.05; color: var(--navy); }
#sheet-how { margin: 0; font-size: 17px; line-height: 1.5; font-weight: 500; }
.sheet-facts { margin: 0; display: grid; gap: 6px; }
.sheet-facts div { display: flex; gap: 10px; background: var(--panel); border-radius: var(--radius); padding: 8px 12px; }
.sheet-facts dt { font-weight: 800; text-transform: uppercase; font-size: 13px; color: var(--red-deep); min-width: 70px; padding-top: 2px; }
.sheet-facts dd { margin: 0; font-weight: 600; }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .big-btn { font-size: 18px; }
@media (min-width: 600px) { .sheet { margin: auto; border-radius: 16px; } }

/* ---------- skip link (PAGE.md) ---------- */
.skip-link {
  position: absolute;
  left: 8px; top: -60px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--white);
  color: var(--navy);
  font-weight: 800;
  border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.top :focus-visible, .tabs :focus-visible, .cat:focus-visible, .big-btn:focus-visible { outline-color: var(--white); outline-offset: -5px; }

/* ---------- 404 ---------- */
.lost { display: flex; flex-direction: column; gap: 14px; padding-top: 10px; }
.lost h2 { margin: 0; font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 30px; color: var(--navy); }
.lost p { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.5; }
.lost .big-btn { text-decoration: none; }

/* ---------- desktop: the 1200 frame (desktop review 1 and 3) ----------
   Structure only: the deck goes two across, Random's cards two across, and
   the tab bar follows the content instead of pinning to the window, so a
   short page ends at its last control rather than in an empty white field. */
/* The page colour fills the window up to 1200; the outside colour only
   shows beside the frame. */
@media (min-width: 1200px) { body { background: var(--outside); } }

/* From 600 the tab bar follows the content, so a short page does not end in
   an empty field above a pinned bar (desktop review 3, tablet review 2). */
@media (min-width: 600px) {
  .app { min-height: 0; padding-bottom: 0; }
  .tabs { position: sticky; left: auto; transform: none; bottom: 0; }
}
@media (min-width: 900px) {
  .view { max-width: none; }
  .top { padding-inline: var(--gutter); }
  main { padding-bottom: 24px; }
  .cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #rand-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; }
  #rand-cards .rcard { grid-column: span 2; }        /* the three big words, one row */
  #rand-cards .rcard.small { grid-column: span 3; }  /* location and emotion, the row under */
  .view > .big-btn, .view > .search, .view > .toggle, .view > .hint { max-width: calc(50% - 2px); }
  .view > .big-btn, .view > .search, .view > .toggle { width: 100%; }
}

/* The active wedge meets the screen edge on the outer tabs: mobile review 13 */
.tabs { overflow: hidden; }
.tabs a:first-child[aria-current="page"]::before { left: -30px; }
.tabs a:last-child[aria-current="page"]::before { right: -30px; }

/* Under 360 the compact Random rows stack like the big cards, so a long word
   ("Embarrassed") sets whole instead of breaking mid-word. Structure only. */
@media (max-width: 359px) {
  .rcard.small { flex-direction: column; align-items: stretch; }
  .rcard.small .banner { width: auto; min-width: 75%; align-self: flex-start; }
  .rcard.small .rcard-word { border-radius: 0 var(--radius) var(--radius) var(--radius); }
  .rcard.small .lock { top: auto; bottom: 2px; transform: none; }
}
.rcard-word { overflow-wrap: break-word; }   /* break a word only if it cannot fit whole */
