/* TeamDoku: warm, calm, large targets, light and dark. The board itself stays on paper in
   both themes so the eight player colors keep the contrast the palette was chosen for. */

/* Type: Fredoka, round and playful, for headings, the wordmark and the big numbers; Nunito,
   round and easy to read, for everything else and the digits on the board. Both are served
   from this site (no third party requests), Latin only, OFL (licenses in fonts/). */
@font-face { font-family: "Nunito"; src: url("/fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
/* stand ins sized to the real fonts' widths and heights, so text barely moves when they land */
@font-face { font-family: "Nunito Fallback"; src: local("Arial"), local("ArialMT"); font-weight: 100 549; size-adjust: 101.5%; ascent-override: 99.6%; descent-override: 34.8%; line-gap-override: 0%; }
@font-face { font-family: "Nunito Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 550 1000; size-adjust: 98.5%; ascent-override: 102.6%; descent-override: 35.8%; line-gap-override: 0%; }
@font-face { font-family: "Fredoka Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 100 1000; size-adjust: 94%; ascent-override: 103.6%; descent-override: 25.1%; line-gap-override: 0%; }

:root {
  --bg: #faf6ee; --surface: #fffdf8; --surface-2: #f3ecdd; --ink: #1f1b16; --muted: #5b5348; --line: #d8ccb8;
  --accent: #2b2620; --accent-ink: #fffdf8; --focus: #1b5fd1; --danger: #a8251b; --ok: #1f6b45;
  --paper: #fffdf8; --paper-ink: #1f1b16; --paper-line: #8c7f6b; --paper-thin: #d9cfbf;
  --peer: #f4ecda; --same: #ffe3a1; --sel: #ffd479;
  --radius: 14px; --gutter: 16px;
  /* the eight player colors (palette.js) for color on the page itself; dark mode lifts them */
  --p0: #0B5CAD; --p1: #C24F00; --p2: #00805C; --p3: #7A3FA0; --p4: #8F7000; --p5: #B03A78; --p6: #2D7F9F; --p7: #C0152F;
  --glow: 34%; --lift: 0 1px 0 rgba(60, 40, 10, .06), 0 22px 44px -26px rgba(60, 40, 10, .38);
  /* the raised edge under keys and buttons, the board's shadow, a switch that is off */
  --key-edge: #e0d3bd; --board-shadow: 0 2px 0 rgba(31, 27, 22, .08), 0 30px 56px -32px rgba(40, 26, 6, .55); --switch-off: #8c7f6b;
  --font: "Nunito", "Nunito Fallback", ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Fredoka", "Fredoka Fallback", var(--font);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191611; --surface: #25211b; --surface-2: #302b23; --ink: #f4eee3; --muted: #bdb3a2; --line: #463f33;
    --accent: #f4eee3; --accent-ink: #1b1813; --focus: #7db0ff; --danger: #ff9d92; --ok: #78d4a3;
    --p0: #7fb2ff; --p1: #ff9f5a; --p2: #4fd3a5; --p3: #c79bf2; --p4: #e8c547; --p5: #f58cc2; --p6: #62c4e8; --p7: #ff7a8a;
    --glow: 34%; --lift: 0 1px 0 rgba(0, 0, 0, .3), 0 24px 48px -24px rgba(0, 0, 0, .7);
    --key-edge: #0d0b08; --board-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 60px -28px rgba(0, 0, 0, .9); --switch-off: #80766a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.18; margin: 0 0 .5em; letter-spacing: 0; }
h1 { font-size: clamp(30px, 6vw, 46px); }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 24px; text-decoration: none; letter-spacing: -.005em; }
.brand svg { width: 34px; height: 34px; overflow: visible; flex: none; }
.brand .mark-box { fill: var(--surface); }
.brand .mark-lines path { stroke: var(--line); stroke-width: 2.4; stroke-linecap: round; }
.brand .mark-edge { fill: none; stroke: var(--ink); stroke-width: 6; }
.brand .mark text { font: 600 23px var(--display); text-anchor: middle; dominant-baseline: central; }
.brand-name { display: grid; line-height: 1.05; }
.brand-name small { font: 700 12.5px/1.2 var(--font); color: var(--muted); letter-spacing: .01em; margin-top: 2px; }
@media (max-width: 899px) { .brand-name small { display: none; } }

/* the header: the eight colors along the very top, then a bar of frosted paper that stays in
   reach as the page scrolls (on screens tall enough to spare it). Each tab sits on a small
   tile in a player color; the page you are on is a raised key with its tile filled in, and
   your own name sits at the end on your blue tile. */
.site-header { position: relative; z-index: 30; width: 100%; padding-top: 4px; background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; }
.site-header::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--p0) 0 12.5%, var(--p1) 0 25%, var(--p2) 0 37.5%, var(--p3) 0 50%, var(--p4) 0 62.5%, var(--p5) 0 75%, var(--p6) 0 87.5%, var(--p7) 0); }
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 12px 28px -22px rgba(40, 26, 6, .55); }
@media (min-height: 640px) {
  :root { --header-h: 78px; }
  html { scroll-padding-top: calc(var(--header-h) + 8px); }
  .site-header { position: sticky; top: 0; }
}
.site-header .site-bar { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto; padding: 12px var(--gutter); }
.site-header .brand { flex: none; min-height: 44px; border-radius: 12px; }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px 6px 7px; border-radius: 14px; border: 1px solid transparent; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 16px; line-height: 1.2; white-space: nowrap; }
.tab:hover { background: var(--surface-2); }
.tab-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent); }
.tab-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab-ico svg .thin { stroke-width: 1.3; }
.tab-ico svg .solid { fill: currentColor; stroke: none; }
.tab .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
.tab .me-long { display: inline-block; max-width: 11em; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.tab .me-short { display: none; }
/* the page you are on: a raised key, its tile filled in its color */
.tab[aria-current="page"] { background: var(--surface); border-color: var(--line); box-shadow: 0 3px 0 var(--key-edge), 0 10px 20px -16px rgba(40, 26, 6, .5); }
.tab[aria-current="page"] .tab-ico { background: var(--cf); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.tab[aria-current="page"] .avatar { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2), 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 18px; height: 4px; margin-left: -9px; border-radius: 2px; background: var(--c); }
@media (max-width: 640px) {
  /* a phone: the tabs stand up, the tile over a short label, like an app's tab bar */
  .site-header .site-bar { gap: 8px; padding: 8px var(--gutter) 8px; }
  .site-header nav { gap: 2px; margin-right: -4px; }
  .tab { flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; min-width: 54px; padding: 5px 3px 4px; font-size: 12px; border-radius: 12px; }
  .tab-ico, .tab .avatar { width: 30px; height: 30px; border-radius: 9px; }
  .tab .avatar { font-size: 12.5px; }
  .tab-ico svg { width: 18px; height: 18px; }
  .tab .me-long { display: none; }
  .tab .me-short { display: inline; }
  .tab[aria-current="page"]::after { display: none; }
  .site-header .brand { font-size: 20px; gap: 7px; }
  .site-header .brand svg { width: 30px; height: 30px; }
  :root { --header-h: 80px; }
}
@media (prefers-reduced-motion: no-preference) {
  .site-header { transition: box-shadow .25s, border-color .25s; }
  .tab { transition: background-color .15s, transform .12s; }
  .tab:active { transform: translateY(2px); }
  .tab-ico, .tab .avatar { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
  .tab:hover .tab-ico, .tab:hover .avatar, .tab:focus-visible .tab-ico, .tab:focus-visible .avatar { transform: translateY(-2px) rotate(-7deg); }
  /* the tab of the page you are on settles in like a key that lights up */
  .tab[aria-current="page"] .tab-ico, .tab[aria-current="page"] .avatar { animation: pop .45s .1s cubic-bezier(.3, 1.6, .5, 1) both; }
  .tab[aria-current="page"]::after { animation: arrive .4s .3s ease-out both; }
  /* the mark's nine digits hop corner to corner when you point at it */
  .brand svg text { transform-box: fill-box; transform-origin: center; }
  .brand:hover svg text, .brand:focus-visible svg text { animation: logo-hop .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--k) * 55ms); }
}
@keyframes logo-hop { 45% { transform: translateY(-14%) scale(1.14); } }
@media (max-width: 389px) { .site-header .brand { font-size: 18px; gap: 6px; } }
@media (max-width: 374px) {
  /* the narrowest phones keep the mark and let the tabs have the room */
  .site-header .brand .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-header .brand { min-width: 44px; justify-content: center; }
  .site-header .brand svg { width: 34px; height: 34px; }
}
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 8px var(--gutter) 48px; overflow-x: clip; }

.btn { font: inherit; font-weight: 800; min-height: 52px; padding: 0 22px; border-radius: 14px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--accent-ink); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; }
input[type="text"], input[type="search"], input[type="email"], textarea, select { font: inherit; min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; }
textarea { min-height: 120px; }
.code-input { text-transform: uppercase; letter-spacing: .25em; font-weight: 800; text-align: center; max-width: 11em; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin: 0 0 16px; }
.notice.error { border-color: var(--danger); color: var(--danger); }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 700; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -1px; background: var(--pc, #888); flex: none; }

/* segmented tier picker */
.tiers { display: flex; gap: 6px; flex-wrap: wrap; }
.tiers button { font: inherit; font-weight: 800; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 9px; }
.tiers button:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
/* difficulty as one to four filled squares, in the text color */
.lv { display: inline-grid; grid-template-columns: repeat(2, 6px); gap: 2px; flex: none; }
.lv i { width: 6px; height: 6px; border-radius: 2px; background: currentColor; opacity: .22; }
.lv i.on { opacity: 1; }
.tiers button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.stack > * + * { margin-top: 18px; }

/* checkboxes that switch a setting on or off */
.toggle { display: flex; gap: 12px; align-items: center; min-height: 48px; cursor: pointer; }
.toggle input[type="checkbox"], .notes-view input[type="checkbox"] { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: var(--switch-off); cursor: pointer; }
.toggle input[type="checkbox"]::after, .notes-view input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.toggle input[type="checkbox"]:checked, .notes-view input[type="checkbox"]:checked { background: var(--ok); }
.toggle input[type="checkbox"]:checked::after, .notes-view input[type="checkbox"]:checked::after { transform: translateX(18px); }
.toggle input[type="checkbox"]:disabled, .notes-view input[type="checkbox"]:disabled { opacity: .45; cursor: default; }
.toggle-text { display: grid; gap: 2px; }
.toggle-title { font-weight: 800; color: var(--ink); }
.toggle-note { font-size: 15px; color: var(--muted); }

kbd { font: inherit; font-size: .88em; font-weight: 700; padding: 0 7px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 2px 0 var(--key-edge); color: var(--ink); white-space: nowrap; }

/* home: the hero */
.hero { display: grid; gap: 28px; grid-template-areas: "intro" "art" "panel"; padding-top: 12px; }
.hero-intro { grid-area: intro; }
.hero-panel { grid-area: panel; display: grid; gap: 16px; align-content: start; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(400px, 490px); grid-template-rows: auto 1fr; grid-template-areas: "intro art" "panel art"; column-gap: 64px; row-gap: 28px; padding-top: 36px; }
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 15px; font-weight: 700; }
.eyebrow .tiles, .kicker .tiles { display: grid; grid-template-columns: repeat(4, 7px); gap: 2px; }
.eyebrow .tiles i, .kicker .tiles i { width: 7px; height: 7px; border-radius: 2px; }
.hero h1 { font-size: clamp(42px, 6.8vw, 70px); line-height: 1.02; letter-spacing: -.012em; font-weight: 600; margin-bottom: 20px; }
.together { white-space: nowrap; }
.tiles i:nth-child(1), .together span:nth-child(1) { --i: 0; --c: var(--p0); }
.tiles i:nth-child(2), .together span:nth-child(2) { --i: 1; --c: var(--p1); }
.tiles i:nth-child(3), .together span:nth-child(3) { --i: 2; --c: var(--p2); }
.tiles i:nth-child(4), .together span:nth-child(4) { --i: 3; --c: var(--p3); }
.tiles i:nth-child(5), .together span:nth-child(5) { --i: 4; --c: var(--p4); }
.tiles i:nth-child(6), .together span:nth-child(6) { --i: 5; --c: var(--p5); }
.tiles i:nth-child(7), .together span:nth-child(7) { --i: 6; --c: var(--p6); }
.tiles i:nth-child(8), .together span:nth-child(8) { --i: 7; --c: var(--p7); }
.together span { display: inline-block; color: var(--c); }
.tiles i { background: var(--c); }
.hero p.lead { font-size: 21px; color: var(--muted); max-width: 30em; margin: 0; }

.play-panel { position: relative; overflow: hidden; padding: 26px 22px 22px; box-shadow: var(--lift); }
.play-panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--p0) 0 12.5%, var(--p1) 0 25%, var(--p2) 0 37.5%, var(--p3) 0 50%, var(--p4) 0 62.5%, var(--p5) 0 75%, var(--p6) 0 87.5%, var(--p7) 0); }
.play-panel h2, .hero-panel h2 { font-size: 22px; }
.join-part { margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--line); }
.btn.go svg { width: 20px; height: 20px; margin-right: -4px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn.go { padding: 0 26px; }

/* the picture: a board on paper, digits in four players' colors, live pointers */
.hero-art { grid-area: art; position: relative; width: 100%; max-width: 490px; margin: 0 auto; padding: 14px 18px 0; }
.art-glow { position: absolute; inset: -8% 0 -2%; pointer-events: none;
  background:
    radial-gradient(30% 30% at 31% 31%, color-mix(in srgb, var(--p0) var(--glow), transparent), transparent),
    radial-gradient(28% 28% at 71% 29%, color-mix(in srgb, var(--p5) var(--glow), transparent), transparent),
    radial-gradient(30% 30% at 69% 69%, color-mix(in srgb, var(--p2) var(--glow), transparent), transparent),
    radial-gradient(28% 28% at 30% 70%, color-mix(in srgb, var(--p4) var(--glow), transparent), transparent); }
.art-board { position: relative; container-type: inline-size; transform: rotate(-2deg); }
.art-grid { display: grid; grid-template: repeat(9, 1fr) / repeat(9, 1fr); aspect-ratio: 1; background: var(--paper); border: 3px solid var(--paper-ink); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 0 rgba(31, 27, 22, .1), 0 34px 60px -30px rgba(40, 26, 6, .55); }
.art-grid i { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; font-style: normal; font-weight: 800; font-size: calc(100cqw / 9 * .56); line-height: 1; color: #2c2822; border-right: 1px solid var(--paper-thin); border-bottom: 1px solid var(--paper-thin); }
.art-grid i:nth-child(9n) { border-right: 0; }
.art-grid i:nth-child(n+73) { border-bottom: 0; }
.art-grid i.bl { border-left: 2px solid var(--paper-ink); }
.art-grid i.bt { border-top: 2px solid var(--paper-ink); }
.art-grid i.p > b { position: relative; color: var(--c); font-weight: 700; }
/* the squares people are working: rounded tiles ringed in their color, as on the real board */
.art-grid i.ring, .art-grid i.sel { background: color-mix(in srgb, var(--r) 9%, var(--paper)); }
.art-grid i.ring::before, .art-grid i.sel::before { content: ""; position: absolute; inset: 7%; border-radius: 26%; background: color-mix(in srgb, var(--r) 14%, var(--paper)); box-shadow: inset 0 0 0 2.5px var(--r); }
.art-grid i.sel::before { inset: 5%; background: var(--sel); box-shadow: inset 0 0 0 2.5px var(--r), 0 6px 10px -5px rgba(40, 26, 6, .45); }
.art-notes { position: absolute; inset: 2px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center; }
.art-notes b { font-size: calc(100cqw / 9 * .25); font-weight: 800; }
.art-tag { position: absolute; z-index: 2; display: flex; align-items: flex-start; pointer-events: none; }
.art-tag svg { width: clamp(14px, 3.8cqw, 17px); height: auto; aspect-ratio: 16 / 20; flex: none; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .3)); }
.art-tag svg path { fill: var(--c); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }
.art-tag span { margin: clamp(11px, 3.3cqw, 15px) 0 0 -3px; padding: 3px 11px 4px; border-radius: 999px; background: var(--c); color: #fff; font-size: clamp(12px, 3.1cqw, 14px); font-weight: 800; line-height: 1.2; white-space: nowrap; box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .5); }
.art-tag.flip { flex-direction: row-reverse; translate: -100% 0; }
.art-tag.flip svg { transform: scaleX(-1); }
.art-tag.flip span { margin: clamp(11px, 3.3cqw, 15px) -3px 0 0; }
.art-players { position: relative; width: fit-content; max-width: 100%; margin: 22px auto 0; padding: 8px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--lift); font-size: 15px; }
.art-players p { display: none; }
.art-players ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; }
.art-players li { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.art-players li span { font-weight: 700; }
.art-players li b { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.art-players .dot { width: 12px; height: 12px; }
@media (min-width: 900px) {
  .hero-art { align-self: center; padding: 8px 8px 92px 30px; }
  .art-glow { inset: -8% -6% -2%; }
  .art-players { position: absolute; left: 0; bottom: 0; margin: 0; padding: 12px 18px 10px; min-width: 156px; rotate: 1.5deg; }
  .art-players p { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .art-players ul { display: grid; gap: 0; }
  .art-players li { min-height: 28px; }
  .art-players li span { flex: 1; }
}

/* home: try a board, set out like a practice table. A band of dotted paper with a soft glow
   in the player colors; three steps to play, each with a small picture; the board on a little
   stack of sheets with its own progress bar in your color; today's puzzle as a page off a desk
   calendar. */
.try { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-areas: "intro" "board" "daily"; gap: 30px; margin: 80px calc(-1 * var(--gutter)) 0; padding: 36px var(--gutter) 32px; background: var(--surface-2); }
.try::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 30% at 80% 34%, color-mix(in srgb, var(--p0) 19%, transparent), transparent),
    radial-gradient(36% 26% at 8% 96%, color-mix(in srgb, var(--p5) 14%, transparent), transparent),
    radial-gradient(34% 26% at 100% 100%, color-mix(in srgb, var(--p2) 16%, transparent), transparent),
    radial-gradient(color-mix(in srgb, var(--ink) 12%, transparent) 1px, transparent 1.6px) 0 0 / 20px 20px; }
.try-intro { grid-area: intro; }
.try-board { grid-area: board; min-width: 0; }
#try-h { font-size: clamp(32px, 4.4vw, 44px); line-height: 1.06; letter-spacing: -.01em; margin-bottom: 12px; text-wrap: balance; }
.try-intro > .muted { max-width: 28em; margin: 0; }
.try .kicker { margin-bottom: 16px; }
.try-steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; max-width: 32em; }
.try-steps li { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 16px; padding: 12px 16px 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 0 rgba(60, 40, 10, .05), 0 12px 22px -18px rgba(60, 40, 10, .45); font-size: 16px; line-height: 1.45; color: var(--muted); }
.try-steps b { display: block; margin-bottom: 1px; font-family: var(--display); font-size: 19px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.try-pic { width: 56px; height: 56px; rotate: -4deg; }
.try-steps li:nth-child(2) .try-pic { rotate: 3deg; }
.try-pic svg { display: block; width: 100%; height: 100%; overflow: visible; font-family: inherit; filter: drop-shadow(0 6px 7px rgba(40, 26, 6, .16)); }
/* the practice board's head, like the play page's: its difficulty and a bar in your color */
.try-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; max-width: 580px; margin: 0 auto 22px; }
.try-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; margin: 0; font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.2; }
.try-title .pill { font-family: var(--font); background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.try .progress { background: var(--surface); }
.try-head .progress:empty { display: flex; }
/* two loose sheets under the board, as if torn off the same pad */
.try-board .board-root { position: relative; }
.try-board .board-root::before, .try-board .board-root::after { content: ""; position: absolute; inset: 0 0 auto; aspect-ratio: 1; z-index: -1; border-radius: 14px; background: var(--paper); border: 3px solid var(--paper-ink); box-shadow: var(--board-shadow); }
.try-board .board-root::before { rotate: -4deg; translate: -4px 6px; }
.try-board .board-root::after { rotate: 2.5deg; translate: 6px 2px; background: color-mix(in srgb, var(--paper) 94%, var(--paper-line)); }
.demo-note { color: var(--muted); font-size: 15px; margin: 10px 0 0; text-align: center; text-wrap: balance; }
.demo-note::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 4px; background: var(--p0); vertical-align: -1px; }
/* today's puzzle: a page off a desk calendar, which stays paper in dark mode */
.daily { grid-area: daily; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "cal title" "cal text" "go go"; gap: 4px 20px; align-self: start; padding: 22px 22px 22px 20px; box-shadow: var(--lift); }
.card.daily { margin: 0; }
.daily-main { display: contents; }
.daily h2 { grid-area: title; align-self: end; margin: 0; font-size: 22px; }
.daily .muted { grid-area: text; align-self: start; margin: 0; font-size: 16px; line-height: 1.45; }
.daily .btn { grid-area: go; justify-self: start; margin-top: 16px; }
.cal { grid-area: cal; width: 72px; margin: 2px 0 0 2px; text-align: center; background: var(--paper); color: var(--paper-ink); border: 2px solid var(--paper-ink); border-radius: 14px; overflow: hidden; rotate: -5deg; box-shadow: 0 2px 0 rgba(31, 27, 22, .12), 0 12px 18px -10px rgba(40, 26, 6, .5); }
.cal span { display: block; padding: 4px 0 3px; background: #C0152F; color: #fff; font-size: 13px; font-weight: 900; line-height: 1.25; letter-spacing: .1em; text-transform: uppercase; }
.cal b { display: block; padding-top: 3px; font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1.05; }
.cal small { display: block; padding-bottom: 6px; font-size: 12px; font-weight: 800; line-height: 1.3; letter-spacing: .06em; text-transform: uppercase; color: #5b5348; }
@media (max-width: 480px) { .daily .btn { justify-self: stretch; } }
@media (min-width: 640px) and (max-width: 899px) {
  /* a tablet: the three steps stand side by side, each picture over its words */
  .try-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
  .try-steps li { grid-template-columns: minmax(0, 1fr); align-items: start; align-content: start; gap: 12px; padding: 16px 16px 18px; }
  .daily { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "cal title go" "cal text go"; }
  .daily .btn { align-self: center; margin: 0 0 0 8px; }
}
@media (max-width: 359px) { .try-title .pill { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
@media (min-width: 700px) { .try { margin-inline: 0; padding: 40px; border-radius: 28px; } }
@media (min-width: 900px) {
  .try { grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); grid-template-rows: auto 1fr; grid-template-areas: "intro board" "daily board"; gap: 30px 56px; align-items: start; padding: 48px; }
  .try-intro { padding-top: 4px; }
}

/* home: a centered head for each band below the hero */
.sec-head { max-width: 40em; margin: 0 auto 36px; text-align: center; }
.sec-head h2 { font-size: clamp(32px, 4.8vw, 48px); line-height: 1.06; letter-spacing: -.01em; font-weight: 600; margin: 0 0 12px; text-wrap: balance; }
.sec-head .lead { margin: 0; color: var(--muted); font-size: 19px; }

/* home: how it works, four steps each with a picture on a tint of its own color */
.how { margin-top: 88px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
.how-step { --c: #0B5CAD; --t: var(--p0); display: flex; flex-direction: column; padding: 8px 8px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--lift); }
.how-step:nth-child(2) { --c: #C24F00; --t: var(--p1); }
.how-step:nth-child(3) { --c: #00805C; --t: var(--p2); }
.how-step:nth-child(4) { --c: #B03A78; --t: var(--p5); }
.step-art { aspect-ratio: 8 / 5; padding: 8px 10px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(color-mix(in srgb, var(--t) 30%, transparent) 1.1px, transparent 1.7px) 0 0 / 14px 14px, color-mix(in srgb, var(--t) 12%, var(--surface)); }
.step-art svg, .perk-art svg { display: block; width: 100%; height: 100%; overflow: visible; font-family: inherit; filter: drop-shadow(0 10px 12px rgba(40, 26, 6, .16)); }
/* the step's number, a tile in its color that sits on the picture's lower edge (white on every
   palette color is at least 4.5:1) */
.step-n { position: relative; display: grid; place-items: center; width: 48px; height: 48px; margin: -26px 0 0 14px; border-radius: 15px; border: 4px solid var(--surface); background: var(--c); color: #fff; font-family: var(--display); font-size: 22px; font-weight: 600; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.how-step h3 { margin: 12px 14px 6px; font-size: 22px; }
.how-step p { margin: 0 14px; color: var(--muted); font-size: 16px; line-height: 1.5; }
@media (max-width: 639px) { .step-art { aspect-ratio: 16 / 9; } }

/* home: the little things, each with a square of paper that shows it */
.perks { margin-top: 88px; }
.perk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 30px 36px; }
@media (min-width: 640px) { .perk-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .perk-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 44px; } }
.perk { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: start; align-content: start; gap: 4px 18px; }
.perk-art { grid-row: span 2; width: 72px; height: 72px; rotate: -4deg; }
.perk:nth-child(even) .perk-art { rotate: 3deg; }
.perk-art svg { filter: drop-shadow(0 8px 9px rgba(40, 26, 6, .16)); }
.perk h3 { margin: 2px 0 0; font-size: 20px; line-height: 1.25; }
.perk p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
/* the closing call: back up to the Start card */
.cta { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 56px; text-align: center; }
.cta p { margin: 0; font-size: 16px; }
#start-h { scroll-margin-top: 24px; }

@media (prefers-reduced-motion: no-preference) {
  .toggle input[type="checkbox"]::after, .notes-view input[type="checkbox"]::after { transition: transform .18s cubic-bezier(.3, 1.4, .5, 1); }
  .together span { animation: hop .6s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(200ms + var(--i) * 70ms); }
  .art-board { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .art-grid i.p > b { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(500ms + var(--k) * 55ms); }
  .art-tag { animation: arrive .5s ease-out both, bob 4.5s ease-in-out infinite alternate; animation-delay: calc(2s + var(--t) * 250ms), calc(2.6s + var(--t) * 700ms); }
  .art-players { animation: arrive .5s 2.4s ease-out both; }
  .btn.go svg { transition: transform .2s; }
  .btn.go:hover svg { transform: translateX(3px); }
  /* How it works plays once as it scrolls into view (home-art.js adds .seen) */
  .how.seen .how-step { animation: lift-in .6s cubic-bezier(.2, .7, .2, 1) both; }
  .how.seen .how-step:nth-child(2) { animation-delay: .12s; }
  .how.seen .how-step:nth-child(3) { animation-delay: .24s; }
  .how.seen .how-step:nth-child(4) { animation-delay: .36s; }
  .how.seen .chip.on rect:first-child { animation: press .5s .9s ease-out both; transform-box: fill-box; transform-origin: center; }
  .how.seen .ctile, .how.seen .face { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(700ms + var(--k) * 90ms); transform-box: fill-box; transform-origin: center; }
  .how.seen .face { animation-delay: calc(1400ms + var(--k) * 150ms); }
  .how.seen .dig { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(900ms + var(--k) * 140ms); transform-box: fill-box; transform-origin: center; }
  .how.seen .burst { animation: arrive .4s 1.6s ease-out both; }
  .how.seen .mt { animation: tile .4s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(1000ms + var(--k) * 45ms); transform-box: fill-box; transform-origin: center; }
  .how.seen .check, .how.seen .ribbon { animation: pop .5s 1.9s cubic-bezier(.3, 1.6, .5, 1) both; transform-box: fill-box; transform-origin: center; }
  .step-art .ptr { animation: bob 4.5s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -2.2s); }
  .step-art .spark, .perk-art .spark { animation: twinkle 2.8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
  .step-art .spark:nth-of-type(2n) { animation-delay: -1.2s; }
  .perks.seen .perk { animation: lift-in .55s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--n, 0) * 80ms); }
  .perk:nth-child(2) { --n: 1; } .perk:nth-child(3) { --n: 2; } .perk:nth-child(4) { --n: 3; } .perk:nth-child(5) { --n: 4; } .perk:nth-child(6) { --n: 5; }
  .perk-art { transition: rotate .3s cubic-bezier(.3, 1.6, .5, 1); }
  .perk:hover .perk-art { rotate: 0deg; }
  /* the practice band: the steps rise in, their pictures play, the sheets fan out */
  .try.seen .try-steps li { animation: lift-in .55s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--n, 0) * 110ms); }
  .try-steps li:nth-child(2) { --n: 1; } .try-steps li:nth-child(3) { --n: 2; }
  .try.seen .try-pic .pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(550ms + var(--k) * 80ms); transform-box: fill-box; transform-origin: center; }
  .try.seen .try-pic .key-face { animation: press .5s 800ms ease-out both; transform-box: fill-box; transform-origin: center; }
  .try-pic { transition: rotate .3s cubic-bezier(.3, 1.6, .5, 1); }
  .try-steps li:hover .try-pic { rotate: 0deg; }
  .try.seen .board-root::before { animation: fan .8s .25s cubic-bezier(.3, 1.4, .5, 1) both; }
  .try.seen .board-root::after { animation: fan .8s .4s cubic-bezier(.3, 1.4, .5, 1) both; }
  .cal { transition: rotate .3s cubic-bezier(.3, 1.6, .5, 1); }
  .daily:hover .cal { rotate: 0deg; }
}
@keyframes fan { from { rotate: 0deg; translate: 0 0; } }
@keyframes press { 40% { transform: scale(.9); } }
@keyframes lift-in { from { opacity: 0; transform: translateY(26px); } }
@keyframes hop { from { opacity: 0; transform: translateY(.35em) scale(.6); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) rotate(-4deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.3); } }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
@keyframes bob { to { transform: translateY(-5px); } }

/* lists */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; min-height: 64px; }
a.item:hover { background: var(--surface-2); }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-family: var(--display); font-weight: 600; }
.item .sub { color: var(--muted); font-size: 15px; }
/* the inbox on My puzzles: a dot in the accent while unread, plain text once read */
.item.inbox-item { min-height: 56px; padding: 12px 16px; }
.item.inbox-item .title { display: block; font-family: var(--font); font-weight: 600; line-height: 1.35; }
.item.inbox-item.unread .title { font-weight: 800; }
.inbox-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); }
.item.inbox-item.unread .inbox-dot { border-color: var(--p0); background: var(--p0); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bar { display: block; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--ok); }

/* a rounded square in the player's color with their initials, like a tile on the board */
.avatar { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--pc); color: #fff; font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: .03em; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.you { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; }
/* a line icon on a soft tile of one color */
.ic { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--c); }
.ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* inner pages: a head with a kicker, a big title, a lead and a picture in the player colors */
.page-head { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 40px; margin: 8px 0 32px; padding: 34px 40px; border-radius: 28px; background: var(--surface-2); }
.page-head::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(34% 80% at 86% 20%, color-mix(in srgb, var(--p0) 20%, transparent), transparent),
    radial-gradient(30% 70% at 70% 105%, color-mix(in srgb, var(--p5) 17%, transparent), transparent),
    radial-gradient(26% 70% at 102% 92%, color-mix(in srgb, var(--p2) 18%, transparent), transparent); }
.page-head h1 { font-size: clamp(40px, 6.2vw, 62px); line-height: 1.02; letter-spacing: -.012em; font-weight: 600; margin: 0 0 12px; }
.page-head .lead { margin: 0; color: var(--muted); font-size: 19px; max-width: 32em; }
.kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 5px 14px 5px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 800; }
.head-art { width: 250px; }
.head-art svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 14px 16px rgba(40, 26, 6, .2)); }
.head-art .paper { fill: var(--paper); stroke: var(--paper-ink); stroke-width: 3; }
.head-art .slot { fill: none; stroke: var(--paper-thin); stroke-width: 2; stroke-dasharray: 4 3.5; }
.head-art .base { fill: var(--line); }
@media (max-width: 640px) {
  .page-head { display: block; padding: 22px 20px 24px; border-radius: 22px; margin-bottom: 24px; }
  .page-head .kicker { margin-bottom: 24px; }
  .page-head h1 { font-size: clamp(34px, 10vw, 40px); }
  .page-head .lead { font-size: 17px; }
  .head-art { position: absolute; top: 12px; right: 10px; width: 96px; z-index: -1; }
  .head-art svg { filter: drop-shadow(0 6px 8px rgba(40, 26, 6, .18)); }
}

/* the account head: your name on a corner of a board */
.me-art { --s: 52px; position: relative; width: auto; padding: 4px 92px 30px 6px; }
.me-board { width: fit-content; display: grid; grid-template-columns: repeat(3, var(--s)); grid-auto-rows: var(--s); background: var(--paper); border: 3px solid var(--paper-ink); border-radius: 16px; overflow: hidden; transform: rotate(-4deg); box-shadow: var(--board-shadow); }
.me-board i { display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: calc(var(--s) * .52); line-height: 1; color: #2c2822; border-right: 1px solid var(--paper-thin); border-bottom: 1px solid var(--paper-thin); }
.me-board i:nth-child(3n) { border-right: 0; }
.me-board i:nth-child(n+7) { border-bottom: 0; }
.me-board i.p { color: var(--c); }
.me-board .me-cell { background: var(--sel); box-shadow: inset 0 0 0 3px #0B5CAD; }
.me-tag { position: absolute; left: calc(var(--s) * 2 - 4px); top: calc(var(--s) * 2 - 6px); display: flex; align-items: flex-start; }
.me-tag svg { width: 17px; height: 21px; flex: none; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .3)); }
.me-tag svg path { fill: #0B5CAD; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }
.me-tag span { margin: 15px 0 0 -3px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; padding: 3px 11px 4px; border-radius: 999px; background: #0B5CAD; color: #fff; font-size: 14px; font-weight: 800; line-height: 1.2; white-space: nowrap; box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .5); }
@media (max-width: 640px) {
  .me-art { --s: 28px; position: absolute; width: auto; padding: 0; top: 18px; right: 18px; }
  .me-board { border-width: 2px; border-radius: 10px; }
  .me-board .me-cell { box-shadow: inset 0 0 0 2px #0B5CAD; }
  .me-tag { display: none; }
}
@media (max-width: 400px) {
  .page-head .kicker { gap: 8px; padding: 4px 11px 4px 7px; font-size: 13px; }
  .head-art { width: 76px; top: 14px; right: 8px; }
  .me-art { --s: 23px; width: auto; top: 16px; right: 14px; }
}

/* My puzzles */
/* Same Place, the home (GAME_SPEC.md section 8): the people first, one place at a time */
.place-home { display: grid; gap: 22px; margin: 8px 0 40px; }
.place-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.place-pick .kicker { margin: 0; justify-self: start; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; padding: 5px 14px; }
.all-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 800; color: var(--ink); text-decoration: none; }
.all-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.all-link:hover { text-decoration: underline; }
.place-chips { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.place-chip { font: inherit; font-weight: 800; font-size: 15px; line-height: 1.25; display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 64px; padding: 10px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-align: center; }
.place-chip:hover { background: var(--surface-2); }
.place-chip[aria-pressed="true"] { border: 2px solid var(--ink); background: var(--surface-2); padding: 9px 7px; }
.place-chip:focus-visible, .place-go:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip-dots { display: flex; gap: 3px; }
.chip-dots i, .place-people i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--pc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.place-head h1 { font-size: clamp(32px, 6vw, 48px); margin: 0 0 6px; }
.place-head .lead { margin: 0; color: var(--muted); font-size: 19px; font-weight: 700; }
.place-head .lead.changed { color: var(--ink); }
.place-since { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.place-welcome { margin: 0 0 4px; font-weight: 800; color: var(--muted); }
.place-card { display: grid; grid-template-columns: minmax(120px, 210px) minmax(0, 1fr); grid-template-areas: "pic info" "act act"; gap: 18px 22px; padding: 20px; box-shadow: var(--lift); }
.card.place-card { margin: 0; }
.place-mosaic { grid-area: pic; }
.pic { display: block; aspect-ratio: 1; padding: 5px; background: var(--paper); border: 2px solid var(--paper-ink); border-radius: 12px; }
.pic svg { display: block; width: 100%; height: 100%; }
.place-info { grid-area: info; display: grid; align-content: start; gap: 8px; min-width: 0; }
.place-state { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.place-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-weight: 700; }
.place-people li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.place-people i { width: 14px; height: 14px; flex: none; }
.place-count { margin: 0; font-size: 15px; }
.place-actions { grid-area: act; display: grid; gap: 6px; }
.place-actions .btn { width: 100%; font-size: 19px; min-height: 58px; }
.place-last { justify-self: center; min-height: 44px; display: inline-flex; align-items: center; font-weight: 800; color: var(--ink); }
.made-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.made-head h2 { font-size: 22px; margin: 0; }
.link-btn { font: inherit; font-weight: 800; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.made-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 150px)); gap: 16px; }
.made-grid.story { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.made-tile { display: grid; gap: 6px; text-decoration: none; color: var(--ink); }
.made-tile:hover .pic { box-shadow: var(--lift); }
.made-date { font-size: 14px; font-weight: 800; }
.made-who { font-size: 13px; }
.all-h { font-size: 26px; margin: 0 0 18px; }
@media (min-width: 900px) {
  .place-home { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: "pick pick" "head card" "made card"; align-items: start; gap: 22px 40px; }
  .place-pick { grid-area: pick; } .place-head { grid-area: head; } .place-card { grid-area: card; } .place-made { grid-area: made; }
  .place-chips { grid-template-columns: repeat(3, minmax(0, 220px)); }
}
@media (max-width: 520px) {
  .place-card { grid-template-columns: minmax(0, 132px) minmax(0, 1fr); padding: 16px; gap: 16px; }
  .place-chip { font-size: 14px; }
}
.lobby { display: grid; gap: 28px; }
@media (min-width: 900px) { .lobby { grid-template-columns: 340px minmax(0, 1fr); gap: 40px; align-items: start; } .new-card { position: sticky; top: calc(var(--header-h, 0px) + 16px); } }
.new-card h2 { font-size: 22px; }
.new-card > .muted { font-size: 16px; margin-bottom: 16px; }
.lobby-lists { display: grid; gap: 30px; }
/* the daily calendar: a month of day tiles, Sunday first. Solved days are filled in green with
   a tick, a board in progress is ringed, a day not played yet is a plain tile to tap, and
   days still to come or with no puzzle are faint and do nothing. Today has a bold edge. */
.cal-card { padding: 20px 18px 16px; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.cal-head h2 { margin: 0; font-size: 22px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav b { min-width: 8.5em; text-align: center; font-family: var(--display); font-weight: 600; font-size: 18px; }
.cal-step { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.cal-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cal-step:disabled { opacity: .35; cursor: default; }
.cal-summary { margin: 8px 0 12px; font-size: 16px; }
.cal-week, .cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 430px; }
.cal-week span { text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.cal-days { margin-top: 6px; }
.cal-day { position: relative; aspect-ratio: 1; min-height: 40px; display: grid; place-items: center; padding: 0; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font: 700 17px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer; }
.cal-day.blank { border: 0; background: none; }
.cal-day svg { position: absolute; right: 4px; bottom: 4px; width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cal-day.st-solved { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.cal-day.st-open { background: var(--surface); border: 3px solid var(--p0); }
.cal-day.st-finished { background: var(--surface); color: var(--muted); }
.cal-day.st-future, .cal-day.st-missing { background: none; color: var(--muted); opacity: .55; cursor: default; }
.cal-day.st-missing { border-style: dashed; }
.cal-day.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
@media (hover: hover) { .cal-day.st-none:hover, .cal-day.st-open:hover { background: var(--surface); transform: translateY(-1px); } }
.cal-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.cal-key span { display: inline-flex; align-items: center; gap: 6px; }
.cal-key i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line); background: var(--surface-2); }
.cal-key i.k-solved { background: var(--ok); border-color: var(--ok); }
.cal-key i.k-open { background: var(--surface); border: 2.5px solid var(--p0); }
/* Learn strategies (lobby.js): fifteen tiles on a scrap of paper, one per strategy, filled in its
   difficulty's color once mastered; then the way to the next lesson */
.learn-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; padding: 18px 20px; }
.card.learn-card { margin: 0; }
.learn-card-tiles { display: grid; grid-template-columns: repeat(7, 11px); gap: 4px; padding: 9px; border-radius: 13px; background: var(--paper); border: 2.5px solid var(--paper-ink); rotate: -5deg; box-shadow: 0 2px 0 rgba(31, 27, 22, .1), 0 10px 16px -10px rgba(40, 26, 6, .5); }
.learn-card-tiles i { width: 11px; height: 11px; border-radius: 3px; background: #ece4d4; }
.learn-card-tiles i.on { background: var(--tc); }
.learn-card h2 { margin: 0 0 2px; font-size: 22px; }
.learn-card h2 a { text-decoration: none; }
.learn-card h2 a:hover { text-decoration: underline; }
.learn-card-main p { margin: 0; font-size: 16px; line-height: 1.45; }
@media (max-width: 560px) { .learn-card { grid-template-columns: auto minmax(0, 1fr); } .learn-card .btn { grid-column: 1 / -1; } }
.daily .daily-past { grid-column: 1 / -1; margin-top: 12px; font-size: 15px; font-weight: 700; color: var(--muted); }
.list-h { display: flex; align-items: center; gap: 10px; font-size: 24px; margin-bottom: 12px; }
.list-h .count { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* a puzzle: progress ring (or a check when done), the title and its difficulty, who is on it */
.item.game { position: relative; gap: 16px; padding: 14px 14px 14px 14px; }
.item.game:hover { border-color: color-mix(in srgb, var(--ink) 28%, var(--line)); box-shadow: var(--lift); }
.badge { flex: none; position: relative; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; }
.badge.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.badge.ring circle { fill: none; stroke-width: 5; }
.badge.ring .track { stroke: var(--surface-2); }
.badge.ring .fill { stroke: var(--ok); stroke-linecap: round; }
.badge.ring b { font-family: var(--display); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.badge.solved { background: var(--ok); color: var(--surface); }
.badge.filled { background: var(--surface-2); color: var(--muted); }
.badge:is(.solved, .filled) svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
/* a board kept on this device shows its picture: the board in miniature on a tilted sheet of
   paper (paper in dark mode too, like the board), with a check once it is solved */
.badge.thumb { width: 64px; height: 64px; padding: 2px; border-radius: 13px; background: var(--paper); border: 2.5px solid var(--paper-ink); rotate: -3deg; box-shadow: 0 2px 0 rgba(31, 27, 22, .1), 0 9px 14px -9px rgba(40, 26, 6, .55); }
.item.game:nth-child(even) .badge.thumb { rotate: 2deg; }
.badge.thumb > svg { display: block; width: 100%; height: 100%; }
.thumb-mark { position: absolute; top: -10px; right: -10px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #1f6b45; border: 2.5px solid var(--surface); }
.thumb-mark.filled { background: #6f6556; }
.thumb-mark svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.game-main { flex: 1; min-width: 0; display: grid; justify-items: start; gap: 2px; }
.game-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.game-title .lv { color: var(--muted); }
.game-link { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; }
.game-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.game-link:focus-visible { outline: none; }
.game-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.game .sub { font-size: 15px; line-height: 1.4; }
.faces { display: inline-flex; margin-top: 6px; padding-left: 2px; }
.faces .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; box-shadow: 0 0 0 2px var(--surface), inset 0 -2px 0 rgba(0, 0, 0, .2); }
.faces .avatar + .avatar { margin-left: -5px; }
.avatar.more { background: var(--surface-2); color: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.archive { position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.archive:hover { background: var(--surface-2); }
.archive[disabled] { opacity: .5; cursor: default; }
.archive svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.go-arrow { flex: none; width: 20px; height: 20px; margin-left: -4px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 560px) {
  .item.game { gap: 12px; padding: 12px; }
  .badge { width: 50px; height: 50px; border-radius: 14px; }
  .badge.thumb { width: 56px; height: 56px; border-radius: 12px; border-width: 2px; }
  .badge.ring b { font-size: 13px; }
  .archive { padding: 0; }
  .archive span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .go-arrow { display: none; }
}
.hero-panel .item.game { padding: 12px; }

/* nothing here yet: a small paper board and a friendly line */
.empty { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: 16px; line-height: 1.45; }
.empty svg { flex: none; width: 64px; height: 64px; transform: rotate(-5deg); filter: drop-shadow(0 6px 8px rgba(40, 26, 6, .16)); }
.empty .paper { fill: var(--paper); stroke: var(--paper-ink); stroke-width: 3; }
.empty .slot { fill: none; stroke: var(--paper-thin); stroke-width: 1.5; stroke-dasharray: 3 3; }
.empty b { display: block; color: var(--ink); font-family: var(--display); font-size: 19px; font-weight: 600; }

/* Leaderboard */
#lb-controls { display: grid; gap: 10px; }
.tiers.periods button { min-height: 44px; padding: 0 14px; font-size: 16px; }
.lb-card { margin-top: 16px; }
.lb-off { padding: 28px 26px 26px; }
.lb-off h2 { font-size: clamp(25px, 4vw, 32px); }
.lb-off > .muted { max-width: 44em; }
.metric-cards { list-style: none; padding: 0; margin: 22px 0 24px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.metric-cards li { display: grid; align-content: start; gap: 4px; padding: 16px 16px 18px; border-radius: 16px; background: var(--surface-2); }
.metric-cards .ic { background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.metric-cards b { margin-top: 10px; font-family: var(--display); font-size: 19px; font-weight: 600; line-height: 1.3; }
.metric-cards li > span:last-child { font-size: 15px; line-height: 1.45; color: var(--muted); }
@media (max-width: 560px) {
  .lb-off { padding: 22px 18px 20px; }
  .metric-cards { gap: 10px; }
  .metric-cards li { grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 2px; padding: 14px; }
  .metric-cards .ic { grid-row: span 2; }
  .metric-cards b { margin-top: 0; font-size: 17px; }
}
/* Your progress: six tiles, each a number on a colored icon tile, then solves by difficulty */
.progress-card { margin-bottom: 22px; }
.progress-card .card-head { margin-bottom: 12px; }
.progress-card .card-head h2 { margin: 0; }
.progress-card .caption { font-size: 14px; font-weight: 700; color: var(--muted); }
.stat-tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-tiles li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; align-content: start; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.stat-tiles .v { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-tiles .l { grid-column: 1 / -1; margin-top: 10px; font-weight: 800; font-size: 15.5px; line-height: 1.25; }
.stat-tiles .n { grid-column: 1 / -1; margin-top: 3px; font-size: 14.5px; line-height: 1.4; color: var(--muted); }
.tier-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.tier-stat { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); }
.tier-stat .tl { font-weight: 800; font-size: 15px; }
.tier-stat b { font-family: var(--display); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; }
.tier-stat .bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.tier-stat .bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); min-width: 0; }
.rank-h { margin: 6px 0 12px; }
/* badges: a tile in its level's metal (bronze to diamond) with the metric's icon, five pips
   for the five levels, and how far it is to the next. Not yet earned: an empty dashed tile. */
:root { --bronze: #a0602a; --silver: #6f7a84; --gold: #a57a0c; --platinum: #2b7f8f; --diamond: #5458cf; }
.badges-h { font: 800 15px/1.3 var(--font); letter-spacing: .02em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.badge-news { margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 16%, var(--surface)); font-weight: 800; }
.badges { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.badge-card { position: relative; display: grid; justify-items: center; text-align: center; gap: 4px; padding: 16px 10px 14px; border-radius: 16px; background: var(--surface-2); }
.badge-card .medal { --m: var(--line); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--m); color: #fff; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22), 0 6px 14px -8px rgba(40, 26, 6, .6); margin-bottom: 6px; }
.badge-card .medal svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge-card.lv0 .medal { background: transparent; color: var(--muted); border: 2px dashed var(--line); box-shadow: none; }
.badge-card.lv1 .medal { --m: var(--bronze); } .badge-card.lv2 .medal { --m: var(--silver); } .badge-card.lv3 .medal { --m: var(--gold); }
.badge-card.lv4 .medal { --m: var(--platinum); } .badge-card.lv5 .medal { --m: var(--diamond); }
.badge-card .bt { font-weight: 800; font-size: 15.5px; line-height: 1.25; }
.badge-card .bl { font-family: var(--display); font-weight: 600; font-size: 18px; }
.badge-card.lv0 .bl { color: var(--muted); font-family: var(--font); font-weight: 700; font-size: 15px; }
.badge-card .new-pill { font-family: var(--font); font-size: 12px; vertical-align: 2px; background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: var(--ink); border-color: var(--gold); }
.badge-card .pips { display: flex; gap: 4px; margin: 2px 0; }
.badge-card .pips i { width: 9px; height: 9px; border-radius: 3px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.badge-card .pips i.on { background: var(--ink); box-shadow: none; }
.badge-card .bn { font-size: 14px; line-height: 1.35; color: var(--muted); }
.badge-card .spark { position: absolute; left: 50%; top: 44px; width: 9px; height: 9px; border-radius: 3px; pointer-events: none; }
@media (max-width: 760px) { .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tier-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .stat-tiles li { padding: 12px; column-gap: 10px; } .stat-tiles .v { font-size: 26px; } }
.rank { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; background: var(--surface-2); font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.rank.top { background: var(--accent); color: var(--accent-ink); }
.lb-name { display: inline-flex; align-items: center; gap: 10px; }
.lb-name .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; background: var(--surface-2); color: var(--ink); box-shadow: none; }
tr.me .rank, tr.me .lb-name .avatar { background: var(--surface); }
tr.me .rank.top { background: var(--accent); }

/* Account */
.account-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 820px) { .account-grid { grid-template-columns: 1fr 1fr; } }
.account-grid > .card { margin: 0; padding: 22px; }
.card-title { display: flex; align-items: center; gap: 12px; font-size: 22px; }
.me-preview { display: flex; align-items: center; gap: 12px; min-height: 60px; margin: 0 0 18px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.me-name { min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger) 4%, var(--surface)); }
/* sign-in: the whole width on a wide screen, words on the left and the form on the right */
.signin-card { grid-column: 1 / -1; }
.signin-body { display: grid; gap: 4px 32px; margin-top: 12px; }
.signin-body > .muted { margin: 0 0 12px; max-width: 34em; }
.signin-body .row .btn { flex: 1 1 auto; }
.signin-body .code-input { max-width: none; font-size: 22px; letter-spacing: .35em; }
.signed-as { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; min-width: 0; }
.signed-as > span:last-child { display: grid; min-width: 0; }
.signed-as b { overflow-wrap: anywhere; font-size: 18px; }
.signed-as small { color: var(--muted); font-size: 15px; }
.signed-as .tick { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); }
.signed-as .tick svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 820px) {
  .signin-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .signin-body .row .btn { flex: 0 1 auto; }
}
/* Sign in with Google, to Google's branding guidelines: the standard G from Google's kit (on
   its own theme's fill), Google Sans Medium, and the light or dark theme's colours. The font
   is fetched only when the button shows. */
@font-face { font-family: "Google Sans"; src: url("/fonts/google-sans-medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
:root { --gsi-fill: #ffffff; --gsi-edge: #747775; --gsi-ink: #1f1f1f; --gsi-mark: url("/google-g-light.png"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --gsi-fill: #131314; --gsi-edge: #8e918f; --gsi-ink: #e3e3e3; --gsi-mark: url("/google-g-dark.png"); }
}
.signin-ways { display: grid; gap: 14px; }
.gsi-button { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--gsi-edge); border-radius: 14px; background: var(--gsi-fill); color: var(--gsi-ink); font: 500 17px/20px "Google Sans", var(--font); letter-spacing: .1px; cursor: pointer; }
/* hover and press: a layer of the text colour over the whole button, mark included */
.gsi-button::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--gsi-ink); opacity: 0; pointer-events: none; }
.gsi-button:hover::after { opacity: .08; }
.gsi-button:active::after { opacity: .12; }
.gsi-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gsi-button:disabled { opacity: .6; cursor: default; }
.gsi-button:disabled::after { opacity: 0; }
.gsi-mark { flex: none; width: 20px; height: 20px; background: var(--gsi-mark) center / 20px 20px no-repeat; }
.signin-or { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); font-size: 15px; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* pages people arrive at from a link (a join code, a group invite, a missing page): one band
   with a big picture beside the words and the next step */
.land { position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; gap: 20px; margin: 8px 0 0; padding: 26px 20px 32px; border-radius: 28px; background: var(--surface-2); text-align: center; }
.land::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 46% at 22% 26%, color-mix(in srgb, var(--p0) 18%, transparent), transparent),
    radial-gradient(38% 44% at 32% 96%, color-mix(in srgb, var(--p5) 15%, transparent), transparent),
    radial-gradient(34% 50% at 98% 10%, color-mix(in srgb, var(--p2) 16%, transparent), transparent),
    radial-gradient(30% 40% at 92% 100%, color-mix(in srgb, var(--p4) 14%, transparent), transparent); }
.land-art { width: min(100%, 360px); }
.land-art.compact { width: min(100%, 300px); }
.land-art svg { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; filter: drop-shadow(0 14px 16px rgba(40, 26, 6, .2)); }
.land-art .paper { fill: var(--paper); stroke: var(--paper-ink); stroke-width: 3; }
.land-art .slot { fill: none; stroke: var(--paper-thin); stroke-width: 2; stroke-dasharray: 4 3.5; }
.land-art .cslot { fill: #f6f0e4; stroke: #c3b59d; stroke-width: 2; stroke-dasharray: 5 4; }
.land-text { min-width: 0; max-width: 34em; }
.land h1 { font-size: clamp(32px, 7.4vw, 54px); line-height: 1.04; letter-spacing: -.012em; margin: 0 0 12px; text-wrap: balance; }
.land .lead { margin: 0; color: var(--muted); font-size: 18px; text-wrap: pretty; }
.land-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 0; }
.code-row { justify-content: center; margin-top: 22px; flex-wrap: nowrap; }
.code-row .code-input { flex: 0 1 11em; min-width: 0; font-size: 20px; background: var(--surface); }
.code-row .btn { flex: none; }
@media (min-width: 820px) {
  .land { grid-template-columns: minmax(0, 410px) minmax(0, 1fr); justify-items: start; align-items: center; gap: 52px; min-height: 380px; padding: 48px 56px 48px 40px; text-align: left; }
  .land-art { width: 100%; }
  .land-art.compact { width: min(100%, 340px); justify-self: center; }
  .land-actions, .code-row { justify-content: flex-start; }
}
/* the join page: what TeamDoku is, for someone who has only seen a code */
.land-facts { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 760px) { .land-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.land-facts li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: 14px; row-gap: 2px; padding: 16px 18px 16px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.land-facts .ic { grid-row: span 2; }
.land-facts b { font-family: var(--display); font-size: 18px; font-weight: 600; line-height: 1.3; }
.land-facts li > span:last-child { color: var(--muted); font-size: 15px; line-height: 1.45; }

/* Privacy: the promises in short, then each part on its own card */
.promises { list-style: none; margin: -8px 0 24px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.promises li { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 9px 14px 9px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-family: var(--display); font-size: 18px; font-weight: 600; line-height: 1.25; }
.policy { display: grid; gap: 16px; }
@media (min-width: 820px) { .policy { grid-template-columns: 1fr 1fr; } }
.policy .card { margin: 0; padding: 22px 24px; }
.policy .card-title { margin-bottom: 14px; }
.policy p { font-size: 17px; line-height: 1.6; }
.policy p:last-child { margin-bottom: 0; }
.policy ul.plain { margin: 0 0 12px; padding-left: 1.2em; font-size: 17px; line-height: 1.6; }

/* a puzzle group */
.group-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 820px) { .group-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.group-grid .card { margin: 0; padding: 22px; }
.group-grid .play-panel { padding-top: 26px; }
.group-side { display: grid; gap: 16px; }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.members li { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 54px; padding: 7px 12px 7px 7px; border-radius: 14px; background: var(--surface-2); }
.members .name { min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  .land-art .tk { animation: lift-in .7s cubic-bezier(.2, .7, .2, 1) both; }
  .land-art .tk-board { animation: deal .6s .2s cubic-bezier(.2, .8, .3, 1.1) both; transform-box: fill-box; transform-origin: center; }
  .land-art:not(.redraw) .ctile { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(450ms + var(--k) * 80ms); transform-box: fill-box; transform-origin: center; }
  .land-art.redraw .tk, .land-art.redraw .tk-board, .land-art.redraw .ptr, .land-art.redraw .spark { animation: none; }
  .land-art.redraw .ctile.typed { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1) both; transform-box: fill-box; transform-origin: center; }
  /* while joining, the code's tiles take turns hopping, like a row of pieces waiting */
  .land[data-state="joining"] .land-art:not(.redraw) .ctile { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both, code-wave 1.5s ease-in-out infinite; animation-delay: calc(450ms + var(--k) * 80ms), calc(1.3s + var(--k) * 110ms); }
  .land-art .ptr { animation: arrive .5s 1.1s ease-out both, bob 4.5s 1.6s ease-in-out infinite alternate; }
  .land-art .nf { animation: deal .6s cubic-bezier(.2, .8, .3, 1.1) both; animation-delay: calc(80ms + var(--k) * 140ms); transform-box: fill-box; transform-origin: center; }
  .land-art .gp, .head-art .gp { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(450ms + var(--k) * 120ms); transform-box: fill-box; transform-origin: center; }
  .head-art .lock { animation: lift-in .7s cubic-bezier(.2, .7, .2, 1) both; }
  .head-art .lk { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(400ms + var(--k) * 60ms); transform-box: fill-box; transform-origin: center; }
  .members li { animation: arrive .4s ease-out both; }
}
@keyframes code-wave { 0%, 55%, 100% { transform: none; } 25% { transform: translateY(-8px); } }

/* the footer: the eight colors along the top, what TeamDoku is, where to go */
.site-footer { position: relative; margin-top: 24px; padding: 40px var(--gutter) 28px; background: var(--surface-2); color: var(--muted); font-size: 15px; }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--p0) 0 12.5%, var(--p1) 0 25%, var(--p2) 0 37.5%, var(--p3) 0 50%, var(--p4) 0 62.5%, var(--p5) 0 75%, var(--p6) 0 87.5%, var(--p7) 0); }
.foot { max-width: calc(1100px - 2 * var(--gutter)); margin: 0 auto; display: grid; gap: 22px; }
@media (min-width: 760px) { .foot { grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: start; } }
.foot .brand { width: fit-content; min-height: 44px; border-radius: 10px; color: var(--ink); font-size: 20px; }
.foot .brand svg { width: 28px; height: 28px; }
.foot-brand p { margin: 10px 0 16px; max-width: 30em; font-size: 16px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 700; }
.facts li::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 2px; margin: 0 -10px; }
.site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 10px; color: var(--ink); font-weight: 700; text-decoration: none; }
.site-footer nav a:hover { background: var(--surface); }
.site-footer nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.foot-small { max-width: calc(1100px - 2 * var(--gutter)); margin: 24px auto 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .item.game, .archive, .tiers button { transition: border-color .15s, box-shadow .2s, background-color .15s, transform .2s; }
  .item.game:hover { transform: translateY(-2px); }
  .item.game:hover .go-arrow { transform: translateX(3px); }
  .go-arrow { transition: transform .2s; }
  .head-art .mb, .land-art .mb { animation: deal .6s cubic-bezier(.2, .8, .3, 1.1) both; animation-delay: calc(80ms + var(--k) * 140ms); transform-box: fill-box; transform-origin: center; }
  .head-art .stack-tile { animation: stack .45s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(120ms + var(--k) * 45ms); transform-box: fill-box; transform-origin: 50% 100%; }
  .head-art .spark, .land-art .spark { animation: twinkle 2.8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
  .head-art .spark:nth-of-type(2n), .land-art .spark:nth-of-type(2n) { animation-delay: -1.2s; }
  .me-board { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .me-tag { animation: arrive .5s .6s ease-out both, bob 4.5s 1.2s ease-in-out infinite alternate; }
  .badge.ring .fill { animation: ring .8s .1s ease-out both; }
  .badge.thumb { transition: rotate .3s cubic-bezier(.3, 1.6, .5, 1); animation: deal .55s cubic-bezier(.2, .8, .3, 1.1) both; }
  .item.game:hover .badge.thumb, .item.game:focus-within .badge.thumb { rotate: 0deg; }
  .item.game:nth-child(2) .badge.thumb { animation-delay: 70ms; }
  .item.game:nth-child(3) .badge.thumb { animation-delay: 140ms; }
}
@keyframes deal { from { opacity: 0; transform: translateY(24px) rotate(-8deg) scale(.9); } }
@keyframes stack { from { opacity: 0; transform: translateY(-30px) scale(.8); } }
@keyframes twinkle { from { transform: scale(.65); opacity: .7; } }
@keyframes ring { from { stroke-dasharray: 0 100; } }

table.board-table { width: 100%; border-collapse: collapse; }
table.board-table th, table.board-table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); }
table.board-table td.num, table.board-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { font-weight: 800; background: var(--surface-2); }

dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); padding: 22px; max-width: min(480px, calc(100vw - 32px)); width: 100%; font: inherit; }
dialog::backdrop { background: rgba(20, 16, 10, .55); }
dialog h2 { font-size: 24px; }
dialog .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 18px; }
.codebox { font-family: var(--display); font-size: 42px; font-weight: 600; letter-spacing: .16em; text-align: center; padding: 10px 0; }
.linkbox { word-break: break-all; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 16px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 50; max-width: calc(100vw - 32px); }

[hidden] { display: none !important; }

/* the header is full on a phone: What's new stays in the footer and the note under the headline there */
@media (max-width: 600px) { .site-header .tab[href="/#whats-new"] { display: none; } }
