/* Home: masthead, today's game with quick tools beside it, then four shelves. */
@media screen {
.masthead { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding: 26px 0 18px; }
/* The page heading stays as the small label. The line under it is the brand talking. */
.slogan { margin-top: 10px; font-size: clamp(1.75rem, 3.6vw, 2.75rem); font-weight: 500; letter-spacing: -.03em; line-height: 1.08; color: var(--fg-muted); }
.slogan b { font-weight: 800; color: var(--fg); white-space: nowrap; }
/* Its full stop is the lime dot from the logo. */
.slogan b::after { content: ""; display: inline-block; width: .2em; height: .2em; margin-left: .08em; border-radius: 50%; background: var(--c-lime); box-shadow: 0 0 0 .045em var(--c-ink); }
.masthead > p { padding-bottom: .3em; font-size: .9375rem; color: var(--fg-muted); }

/* Lead ─ the daily game is always an ink board with lime art, in both themes. */
.lead { display: grid; grid-template-columns: minmax(0, 1fr) 332px; gap: 20px; align-items: stretch; }
.feature { position: relative; display: grid; grid-template-columns: minmax(280px, 5fr) 6fr; min-width: 0; min-height: 384px; overflow: hidden; border: 1.5px solid var(--edge); border-radius: var(--r-l); background: var(--c-ink); color: var(--c-cream); --lip: #7f9d14; --focus: #c2aeff; }
.feature-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(24px, 3.4vw, 44px); }
.feature .label { color: var(--c-lime); }
.feature .label::before { background: var(--c-lime); box-shadow: none; }
.feature h2 { margin: 16px 0 12px; font-size: clamp(2.5rem, 4.6vw, 3.75rem); font-weight: 900; letter-spacing: -.045em; line-height: .96; }
.feature-pitch { max-width: 22ch; margin: 0 0 26px; font-size: 1.125rem; line-height: 1.4; color: #dad9c6; }
.feature .btn-primary { border-color: var(--c-lime); }
/* The button is the only link; its hit area covers the whole board. */
.feature .btn-primary::after { content: ""; position: absolute; inset: 0; }
.feature-facts { margin: 20px 0 0; font-size: .8125rem; color: #a8aa98; }
.feature-art { position: relative; min-height: 220px; background: var(--c-lime); border-left: 1.5px solid var(--c-ink); }
.feature-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.feature .drop { animation: pin-drop .5s cubic-bezier(.3, 1.4, .5, 1) both; }
.feature .d1 { animation-delay: .25s; }
.feature .d2 { animation-delay: .43s; }
.feature .d3 { animation-delay: .61s; }
.feature:hover .feature-art svg { transform: scale(1.02); }
.feature-art svg { transition: transform .35s ease; }
@keyframes pin-drop { from { transform: translateY(-90px); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }

/* Side ─ three tools for a group, or the visitor's own recent tools. */
.side { display: flex; flex-direction: column; min-width: 0; }
.side .quick, #recentTools { display: flex; flex-direction: column; flex: 1; margin: 0; padding: 0; }
#recentTools { position: relative; flex: none; }
#recentTools + .quick:has(a:not([hidden])) { margin-top: 0; }
.side .label { min-height: 28px; margin: 0; }
#recentTools h2 { font: 700 .6875rem/1.2 var(--font); letter-spacing: .09em; }
#recentTools button { position: absolute; top: -8px; right: -10px; min-height: 40px; font-size: .8125rem; }
.tiles { display: flex; flex-direction: column; flex: 1; }
.tiles a { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 14px; flex: 1; min-height: 84px; padding: 12px 0; border-top: 1px solid var(--rule); color: var(--fg); text-decoration: none; }
.tiles img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border: 1.5px solid var(--edge); border-radius: 6px; transition: transform .14s, box-shadow .14s; }
.tiles b { display: block; font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.tiles small { display: block; margin-top: 2px; font-size: .8125rem; line-height: 1.35; color: var(--fg-muted); }
.tiles a:hover img { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--lift); }
.tiles a:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.home { --lift: var(--c-ink); }
[data-theme=dark] .home { --lift: var(--c-lime); }

/* Browse bar ─ search and categories travel with you down the page. */
.browse { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; margin-top: 44px; padding: 10px 0; border-bottom: 1.5px solid var(--fg); background: var(--page); }
#finder { position: relative; display: flex; align-items: center; flex: 0 1 340px; min-width: 0; }
#finder::before { content: ""; position: absolute; left: 13px; width: 16px; height: 16px; background: var(--fg-muted); pointer-events: none; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='m13 13 5 5'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='m13 13 5 5'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; }
#query { padding-left: 38px; padding-right: 66px; }
#query::-webkit-search-cancel-button { display: none; }
#finder kbd, #clearSearch { position: absolute; right: 4px; }
#finder kbd { right: 12px; padding: 1px 7px; border: 1px solid var(--rule-strong); border-radius: 4px; font: 500 .75rem/1.5 var(--mono); color: var(--fg-muted); pointer-events: none; }
#clearSearch { min-height: 36px; font-size: .8125rem; }
#finder:has(#query:placeholder-shown) #clearSearch, #finder:has(#query:not(:placeholder-shown)) kbd { display: none; }
@media (hover: none), (max-width: 700px) { #finder kbd { display: none; } }
.category-links { display: flex; gap: 2px; margin: 0 -10px 0 auto; }
.category-links a { display: inline-flex; align-items: baseline; gap: 6px; min-height: 44px; padding: 11px 12px 0; border-radius: var(--r); font-weight: 700; font-size: .9375rem; text-decoration: none; }
.category-links a:hover { background: var(--sunken); }
.category-links small { font: 600 .75rem/1 var(--font); color: var(--fg-muted); }
#matchCount { flex-basis: 100%; font-size: .875rem; color: var(--fg-muted); }
#matchCount:empty { display: none; }

/* Shelves ─ one line of heading, then the things themselves. Each shelf has its own grid. */
.shelf { padding: 30px 0 38px; border-bottom: 1px solid var(--rule); scroll-margin-top: 72px; }
.shelf:last-of-type { border-bottom: 0; padding-bottom: 0; }
.shelf-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.shelf-head h2 { font-size: 1.75rem; letter-spacing: -.03em; }
.shelf-head p { font-size: .9375rem; color: var(--fg-muted); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; margin: 0; }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.cards-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { position: relative; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.cards-wide .card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 22px; }
.thumb { position: relative; border: 1.5px solid var(--edge); border-radius: 10px; background: var(--sunken); transition: transform .14s ease, box-shadow .14s ease; }
.thumb img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 8.5px; }
/* Games carry a play badge. Tools do not: you make something with them instead. */
.card.is-game .thumb::before { content: ""; position: absolute; left: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--c-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M12 9.5v11l9-5.5z' fill='%23c6f432'/%3E%3C/svg%3E") center/contain no-repeat; }
/* On hover the picture lifts like a sticker and a pin drops into its corner. */
.thumb::after { content: ""; position: absolute; top: -17px; right: 14px; width: 24px; height: 29px; background: url("assets/pin.svg") center/contain no-repeat; opacity: 0; transform: translateY(-12px) rotate(8deg); transition: opacity .12s, transform .18s cubic-bezier(.3, 1.5, .5, 1); pointer-events: none; }
.card:hover .thumb, .card:focus-within .thumb { transform: translate(-2px, -3px); box-shadow: 4px 5px 0 var(--lift); }
.card:hover .thumb::after, .card:focus-within .thumb::after { opacity: 1; transform: rotate(8deg); }
.card .label { margin-top: 14px; font-size: .6875rem; }
.cards-wide .card .label { margin-top: 0; }
.card h3 { margin: 7px 0 5px; font-size: 1.1875rem; font-weight: 750; letter-spacing: -.015em; line-height: 1.2; }
.cards-wide .card h3 { font-size: 1.375rem; }
.cards-4 .card h3 { font-size: 1.0625rem; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:focus-visible { outline: none; }
.card:has(a:focus-visible) .thumb { outline: 2px solid var(--focus); outline-offset: 3px; }
.card:hover h3 a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.card > p:last-child, .card > div > p:last-child { font-size: .875rem; line-height: 1.45; color: var(--fg-muted); }

@media (max-width: 1020px) {
  .lead { grid-template-columns: 1fr; }
  .side .label { margin-top: 8px; }
  #recentTools button { top: 0; }
  /* Three tiles share one row whether they come from the visitor's history, the defaults, or both. */
  .side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 16px; }
  .side > * { grid-column: 1 / -1; }
  #recentTools:not([hidden]) { grid-column: span 1; }
  #recentTools:not([hidden]) + .quick { grid-column: span 2; }
  #recentTools:has(a:nth-child(2)) { grid-column: span 2; }
  #recentTools:has(a:nth-child(2)) + .quick { grid-column: span 1; }
  #recentTools:has(a:nth-child(3)) { grid-column: 1 / -1; }
  .tiles { flex-direction: row; gap: 16px; }
  .tiles a { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; min-width: 0; padding: 10px 0 0; border-top: 0; }
  .tiles img { align-self: start; }
  .tiles small { display: none; }
  .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .masthead { padding: 18px 0 14px; }
  .masthead > p { display: none; }
  .feature { grid-template-columns: 1fr; min-height: 0; }
  /* A fixed height, not an aspect ratio: a ratio here can size the column from the row and overflow. */
  .feature-art { order: -1; min-width: 0; min-height: 0; height: clamp(140px, 46vw, 300px); border-left: 0; border-bottom: 1.5px solid var(--c-ink); }
  .feature-copy { min-width: 0; }
  .feature-copy { padding: 20px 20px 22px; }
  .feature h2 { margin: 12px 0 8px; font-size: 2.5rem; }
  .feature-pitch { margin-bottom: 18px; font-size: 1rem; max-width: none; }
  .feature .btn-primary { width: 100%; }
  .feature-facts { margin-top: 14px; }
  .side, .tiles { gap: 0 10px; }
  .tiles b { font-size: .875rem; }
  .browse { margin-top: 28px; gap: 4px 12px; padding: 8px 0 4px; }
  #finder { flex: 1 1 100%; }
  .category-links { margin: 0 -8px; width: calc(100% + 16px); justify-content: space-between; }
  .category-links a { padding: 11px 8px 0; }
  .shelf { padding: 22px 0 26px; scroll-margin-top: 112px; }
  .shelf-head { gap: 2px 12px; margin-bottom: 14px; }
  .shelf-head h2 { font-size: 1.5rem; }
  .card.is-game .thumb::before { left: 6px; bottom: 6px; width: 24px; height: 24px; }
  /* Rows scan faster than a grid on a phone: picture left, words right. */
  .cards, .cards-4, .cards-wide { grid-template-columns: 1fr; gap: 18px; }
  .card, .cards-wide .card { display: grid; grid-template-columns: 38% minmax(0, 1fr); align-items: start; column-gap: 14px; }
  .card .thumb { grid-row: 1 / span 3; }
  .cards-wide .card .thumb { grid-row: auto; }
  .card .label { margin-top: 1px; }
  .card h3, .cards-wide .card h3, .cards-4 .card h3 { margin: 5px 0 3px; font-size: 1.0625rem; }
  .card > p:last-child, .card > div > p:last-child { font-size: .8125rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .thumb::after { display: none; }
}
@media (max-width: 360px) {
  .category-links small { display: none; }
}
/* On a short screen, such as a phone held sideways, the bar scrolls away with the page. */
@media (max-height: 520px) {
  .browse { position: static; }
}
}
