@font-face {
  font-family: 'Gasoek One';
  src: url('/assets/gasoek-one-latin.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root { --paper: #FDEBD2; --shadow: #495E5D; }
* { box-sizing: border-box; }
html { scroll-padding-top: 20px; }
body { margin: 0; background: var(--paper); color: #252d28; font: 15px/1.6 Arial, Helvetica, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border-radius: 0; }
a, button, input, select { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #b64870; outline-offset: 4px; }
button:disabled { cursor: wait; opacity: .65; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; letter-spacing: -.7px; }
::selection { background: #eed457; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1100px; margin-inline: auto; padding-inline: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip-link { position: fixed; top: -100px; left: 15px; padding: 12px; z-index: 100; background: white; }
.skip-link:focus { top: 10px; }

/* Start with the phone layout: logo, controls, cards. */
.site-header { display: flex; justify-content: center; padding-block: 22px 18px; }
.brand { display: block; }
.logo-layers { position: relative; display: block; width: 190px; height: 87px; }
.logo-layers img { position: absolute; object-fit: fill; }
.logo-shadow { left: 10.41%; top: 14.58%; width: 80.65%; height: 75.31%; }
.logo-fill, .logo-outline { left: 9.1%; top: 11.69%; width: 80.65%; height: 75.3%; }
.logo-script { left: 6.65%; top: 14.37%; width: 78.04%; height: 55.92%; }

/* A brief, flat tile curtain. Only the catalogue's first visit opts in. */
.intro { display: none; position: fixed; inset: 0; z-index: 90; overflow: hidden; pointer-events: none; background: var(--paper); }
.intro-pending .intro { display: block; }
.intro-grid { position: absolute; left: 50%; top: 50%; display: grid; transform: translate(-50%, -50%); }
.intro-tile { display: grid; place-items: center; border: .75px solid #010101; }
.intro-tile img { width: 58%; height: 58%; object-fit: contain; }
.intro-logo { position: absolute; inset: 0; display: grid; place-items: center; }
.intro-logo .logo-layers { width: min(81vw, 470px); height: auto; aspect-ratio: 324.45 / 147.61; }
.intro:not(.intro-ready) .intro-grid, .intro:not(.intro-ready) .intro-logo { visibility: hidden; }
.intro-ready { animation: intro-lifetime 2200ms linear both; }
.intro-ready .intro-grid { animation: intro-appear 180ms ease-out both; }
.intro-ready .intro-tile { animation: intro-scatter 740ms cubic-bezier(.55, 0, .8, .4) var(--delay) both; }
.intro-ready .intro-logo .logo-layers { animation: intro-logo-exit 1450ms both; }
@keyframes intro-appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes intro-lifetime {
  0%, 38% { background: var(--paper); }
  39%, 100% { background: transparent; }
}
@keyframes intro-logo-exit {
  0% { opacity: 0; transform: translateY(-12px); animation-timing-function: ease-out; }
  18%, 45% { opacity: 1; transform: translateY(0); animation-timing-function: cubic-bezier(.5, 0, .8, .5); }
  61% { opacity: 1; transform: translateY(24px); animation-timing-function: cubic-bezier(.55, 0, .8, .5); }
  100% { opacity: 1; transform: translateY(calc(-50vh - 300px)); }
}
@keyframes intro-scatter {
  0% { transform: translate(0, 0) rotate(0); }
  18% { transform: translate(var(--nudge-x), var(--nudge-y)) rotate(0); }
  100% { transform: translate(var(--exit-x), var(--exit-y)) rotate(var(--turn)); }
}
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-bottom: 18px; }
.category-filter { flex-basis: 100%; display: flex; gap: 20px; margin: 0; padding: 0; border: 0; }
.category-filter label { position: relative; cursor: pointer; }
.category-filter input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.category-filter span { display: flex; align-items: center; min-height: 44px; padding: 5px 2px; border-bottom: 2px solid transparent; font-size: 14px; color: #495E5D; }
.category-filter input:checked + span { border-bottom-color: #495E5D; color: #252d28; font-weight: bold; }
.category-filter input:focus-visible + span { outline: 3px solid #b64870; outline-offset: 4px; }
.icon { display: inline-block; width: 18px; height: 18px; flex-shrink: 0; }
.search { flex-basis: 100%; min-width: 0; height: 48px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #495e5d66; }
.search input { width: 100%; min-width: 0; height: 100%; padding: 10px 12px 10px 0; border: 0; background: none; font-size: 16px; }
.search input::placeholder { color: #495E5D; opacity: 1; }
.search:focus-within { border-bottom-color: #495E5D; }
.select-wrap { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.select-wrap select { width: 148px; min-height: 44px; padding: 0 25px 0 0; border: 0; border-radius: 0; background: transparent; appearance: none; -webkit-appearance: none; font-size: 14px; }
.select-wrap > .icon:last-child { position: absolute; right: 0; pointer-events: none; width: 15px; height: 15px; }
.player-filter { gap: 9px; }
.player-filter select { width: 50px; }
.game-grid { display: grid; gap: 20px; }
.game-card { display: flex; flex-direction: column; min-width: 0; border: 1.5px solid; box-shadow: 4px 4px 0 var(--shadow); background: var(--paper); transition: transform .15s, box-shadow .15s; }
.pink { --card-color: #e8b9d1; }
.blue { --card-color: #d3e3f2; }
.yellow { --card-color: #f4dd67; }
.green { --card-color: #d4e1b9; }
.lilac { --card-color: #cbc1dc; }
.orange { --card-color: #ef9978; }
.card-art { height: 104px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1.5px solid; background: var(--card-color); }
.letter-art { position: relative; display: flex; align-items: center; justify-content: center; }
.letter-art > span { display: flex; align-items: center; justify-content: center; width: 43px; height: 57px; margin-left: -2px; border: 1.5px solid #252d28; box-shadow: 3px 3px 0 var(--shadow); background: var(--paper); color: #e2afd0; font: 400 35px/1 'Gasoek One', sans-serif; -webkit-text-stroke: .7px #252d28; paint-order: stroke fill; text-shadow: 2px 2px 0 var(--shadow); transform: rotate(calc((var(--n) - 1) * 9deg)); }
.art-0 > span { width: 49px; height: 66px; font-size: 43px; }
.art-0 > span:first-child { background: #f6dc57; transform: rotate(-12deg); }
.art-0 > span:last-child { background: #d8e5f0; color: #f46a43; transform: rotate(11deg); margin-top: 5px; }
.art-1 > span:nth-child(2) { background: #e8b9d1; color: #f9db35; }
.art-1 > span:nth-child(3) { color: #dae6f5; }
.art-1 > span:last-child { background: #d2dfb5; color: #bdb2d1; }
.art-2 { gap: 23px; }
.art-2 > span { background: #d3e3f2; }
.art-2 > span:last-child { background: #edb9d1; color: #f9db35; }
.art-3 > span { color: #f46a43; transform: rotate(-8deg); margin-top: calc(var(--n) * 3px); }
.art-4 > span { width: 49px; height: 64px; font-size: 43px; background: #f8e277; }
.art-4 > span:last-child { background: #ecc2d5; color: #dae6f5; transform: rotate(8deg); }
.art-5 > span { background: #d5e5f0; width: 49px; height: 64px; font-size: 43px; }
.art-5 > span:last-child { background: #f7df68; color: #f46a43; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 16px 16px 0; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-title h2 { font-size: 25px; }
.card-body > p { font-size: 14px; line-height: 1.5; margin-top: 8px; }
.card-meta { display: flex; gap: 18px; margin-block: 13px; }
.card-meta > span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.card-meta .icon { width: 16px; height: 16px; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; padding-block: 10px; border-top: 1px solid #d8d6cb; font-size: 12px; }
.card-bottom > span { display: flex; align-items: center; gap: 7px; }
.view-rules { font-weight: 600; }
.difficulty-dots { display: inline-flex; align-items: center; gap: 3px; }
.difficulty-dots i { display: inline-block; width: 6px; height: 6px; border: 1px solid #4c6354; border-radius: 50%; }
.difficulty-dots i.filled { background: #4c6354; }
.empty-state { padding: 40px 20px; text-align: center; }
.empty-state h2 { font-size: 26px; margin-bottom: 20px; }
.thank-you { text-align: center; padding: 48px 0 0; }
.thank-you h2 { font-size: 28px; margin-bottom: 7px; }
.thank-you p { font-size: 14px; }
.thank-you-art { width: min(390px, calc(100% + 40px)); aspect-ratio: 390 / 233; overflow: hidden; margin-top: 16px; position: relative; left: 50%; transform: translateX(-50%); }
.thank-you-scene { position: relative; width: 100%; aspect-ratio: 390 / 308.576; }
.thank-you-photo-frame { position: absolute; inset: 0 19.151%; display: grid; place-items: center; }
.thank-you-photo { position: relative; width: 87.276%; height: 93.008%; border: 1.5px solid #252d28; box-shadow: 4px 4px 0 var(--shadow); background: var(--paper); transform: rotate(-6.39deg); }
.thank-you-photo-crop { position: absolute; inset: 0; overflow: hidden; }
.thank-you-photo-crop img { position: absolute; width: 116.81%; height: 128.9%; left: -16.81%; top: -23.72%; }
.thank-you-kiss { position: absolute; width: 11.43%; height: 8.014%; }
.kiss-one { left: 77.56%; top: 63.76%; transform: rotate(6.39deg); }
.kiss-two { left: 92.05%; top: 65.15%; transform: rotate(-2.89deg); }
.thank-you-signature { position: absolute; left: 17.69%; top: 36.99%; width: 64.93%; height: 26.75%; }

/* Rules and local downloads. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 14px; border: 1.5px solid; background: var(--paper); box-shadow: 3px 3px 0 var(--shadow); font-size: 14px; font-weight: bold; text-align: center; }
.button.primary { background: #efd971; }
.rules-main { padding-bottom: 40px; }
.back-link { display: inline-block; min-height: 44px; padding-block: 9px; margin-bottom: 12px; font-size: 14px; }
.rules-layout { display: flex; flex-direction: column; gap: 20px; }
.rules-sheet { width: 100%; border: 1.5px solid; box-shadow: 4px 4px 0 var(--shadow); background: var(--paper); }
.rules-heading { padding: 23px 20px; border-bottom: 1.5px solid; background: #fff; }
.rules-sheet > .card-art { height: 130px; }
.sample-label { font-size: 12px; margin-bottom: 8px; }
.rules-heading h1 { font-size: 39px; letter-spacing: -1.5px; margin-bottom: 15px; }
.rules-heading > p:not(.sample-label) { font-size: 14px; line-height: 1.7; }
.rules-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 20px; font-size: 12px; }
.rules-meta .difficulty-dots { margin-right: 4px; }
.rules-content { padding: 25px 20px; }
.rule-section { margin-bottom: 27px; }
.rule-section h2 { display: flex; align-items: center; gap: 10px; font-size: 23px; margin-bottom: 12px; }
.rule-number { display: inline-block; flex-shrink: 0; min-width: 25px; font: 400 27px/1 'Gasoek One', sans-serif; letter-spacing: 0; color: #e2afd0; -webkit-text-stroke: .7px #252d28; paint-order: stroke fill; text-shadow: 1.5px 1.5px 0 var(--shadow); }
.rule-section:nth-child(6n+2) .rule-number { color: #f37148; }
.rule-section:nth-child(6n+3) .rule-number { color: #c4e0a8; }
.rule-section:nth-child(6n+4) .rule-number { color: #c1b0d6; }
.rule-section:nth-child(6n+5) .rule-number { color: #f9db35; }
.rule-section:nth-child(6n+6) .rule-number { color: #dae6f5; }
.rule-section p, .rule-section li { font-size: 15px; line-height: 1.75; }
.rule-section ol { padding-left: 22px; margin: 0; }
.rule-section li { padding-left: 6px; margin-bottom: 12px; }
.rule-section li::marker { font-weight: bold; }
.rules-colophon { padding-top: 15px; border-top: 1px solid #d0d2c5; color: #5a6259; font-size: 11px; overflow-wrap: anywhere; }
.save-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; order: -1; }
#export-status { grid-column: 1 / -1; font-size: 12px; }
#export-status:empty { display: none; }
dialog { width: min(600px, calc(100% - 28px)); max-height: 90dvh; padding: 20px; border: 2px solid; box-shadow: 5px 5px 0 var(--shadow); background: var(--paper); color: #252d28; }
dialog::backdrop { background: #252d28a8; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dialog-top h2 { font-size: 28px; }
.close-dialog { flex-shrink: 0; width: 44px; height: 44px; border: 1.5px solid; background: none; font-size: 25px; line-height: 1; }
.dialog-top + p { margin-top: 14px; font-size: 14px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 18px; }
#rules-image { width: 100%; height: auto; border: 1px solid; }
.save-hint { font-size: 12px; margin-top: 10px; }
.not-found { text-align: center; padding-block: 50px; }
.not-found h1 { font-size: 40px; margin-bottom: 25px; }

@media (min-width: 600px) {
  .wrap { padding-inline: 28px; }
  .site-header { padding-block: 28px 24px; }
  .logo-layers { width: 220px; height: 101px; }
  .filters { gap: 12px 26px; margin-bottom: 26px; }
  .search { flex: 1; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .card-art { height: 125px; }
  .card-body { padding: 18px 18px 0; }
  .rules-heading, .rules-content { padding: 28px; }
  .rules-heading h1 { font-size: 48px; }
}
@media (min-width: 960px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rules-layout { display: grid; grid-template-columns: minmax(0, 1fr) 215px; gap: 28px; align-items: start; }
  .save-panel { position: sticky; top: 24px; display: flex; flex-direction: column; order: initial; }
}
@media (hover: hover) {
  .game-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
  .button:hover { background: #f3e9d2; }
  .button.primary:hover { background: #e8ce58; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .intro { display: none !important; }
}
@media print {
  @page { size: A4; margin: 15mm; }
  body { background: white; color: black; font-size: 10pt; }
  .intro, .site-header, .back-link, .save-panel, dialog, .skip-link { display: none !important; }
  .wrap, .rules-main { padding: 0; margin: 0; max-width: none; }
  .rules-layout { display: block; }
  .rules-sheet { border: 0; box-shadow: none; background: white; }
  .rules-sheet > .card-art { display: none; }
  .rules-heading { padding: 0 0 15px; background: none !important; border-bottom: 2px solid black; break-inside: avoid; }
  .rules-heading h1 { font-size: 32pt; margin: 8px 0 10px; }
  .rules-heading > p:not(.sample-label) { font-size: 10pt; }
  .sample-label { font-size: 8pt; }
  .rules-meta { margin-top: 12px; font-size: 8pt; }
  .rules-content { padding: 18px 0 0; }
  .rule-section { margin-bottom: 17px; break-inside: avoid; }
  .rule-section h2 { font-size: 16pt; margin-bottom: 8px; break-after: avoid; }
  .rule-number { color: black !important; -webkit-text-stroke: 0; text-shadow: none; font-size: 17pt; }
  .rule-section p, .rule-section li { font-size: 10pt; line-height: 1.55; }
  .rule-section li { margin-bottom: 6px; }
  .rules-colophon { font-size: 8pt; break-inside: avoid; }
}
