/* TallyPal — "game night, broadcast live".
   One family (Archivo) used at two widths: expanded black for broadcast headlines, normal for
   reading. Scores use the system rounded face so they match the app. Colors are the app's own:
   tally red and blue from the icon, leader gold from the crown, and the night-blue of a living
   room with the TV on. */

:root {
    --night: #12142A;
    --night-2: #1C1F3A;
    --night-text: #EEF0FA;
    --night-soft: #A7ACCB;
    --paper: #F4F5F8;
    --card: #FFFFFF;
    --ink: #0F1117;
    --ink-soft: #565C6E;
    --rule: #DCDFE7;
    --red: #FF4F57;
    --blue: #3D87FF;
    --gold: #FFC931;
    --link: #1F64D6;
    --wide: 'Archivo', system-ui, sans-serif;
    --body: 'Archivo', system-ui, -apple-system, sans-serif;
    --score: ui-rounded, 'SF Pro Rounded', 'Archivo', system-ui, sans-serif;
    --page: 78rem;
    --measure: 36rem;
}
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0E1018;
        --card: #191C27;
        --ink: #F1F2F6;
        --ink-soft: #A2A7B7;
        --rule: #2A2E3B;
        --link: #8AB6FF;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 1.0625rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); color: var(--ink); padding: .5rem 1rem; z-index: 20; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2.5rem, var(--page)); margin-inline: auto; }
.wrap.narrow { --page: 50rem; }
.measure { max-width: 50rem; }

/* Type */
h1, h2 { text-wrap: balance; }
h1, h2, h3 { margin: 0; font-family: var(--wide); }
h1, h2 {
    font-weight: 850;
    font-stretch: 125%;
    letter-spacing: -0.035em;
    line-height: .98;
}
h1 { font-size: clamp(2.5rem, 6.4vw, 5.5rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.75rem); }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }
.lede { font-size: clamp(1.125rem, 1.5vw, 1.3125rem); color: var(--ink-soft); max-width: var(--measure); line-height: 1.5; }
.muted { color: var(--ink-soft); }

/* App Store badge */
.badge { display: inline-block; line-height: 0; border-radius: 9px; flex: none; }
.badge img { height: 54px; width: auto; }
.badge .on-dark { display: none; }
.on-night .badge .on-light { display: none; }
.on-night .badge .on-dark { display: block; }
@media (prefers-color-scheme: dark) {
    .badge .on-light { display: none; }
    .badge .on-dark { display: block; }
}

/* Header */
.site-header { padding-block: 1.25rem; position: relative; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .625rem; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; font-stretch: 112%; }
.brand img { width: 38px; height: 38px; border-radius: 9px; }
.site-nav { display: flex; align-items: center; gap: 1.75rem; font-weight: 500; font-size: 1rem; }
.site-nav a { text-decoration: none; color: var(--ink-soft); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav .badge img { height: 40px; }
.on-night .brand, .on-night .site-nav a:hover { color: var(--night-text); }
.on-night .site-nav a { color: var(--night-soft); }
@media (max-width: 760px) { .site-nav .nav-link { display: none; } }

/* Shared pieces */
.section { padding-block: clamp(4rem, 9vw, 8rem); }
.section.tight { padding-top: 0; }
.section-head { display: grid; gap: 1.25rem; max-width: 52rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.page-head { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem); display: grid; gap: 1.25rem; justify-items: start; }
.page-head h1 { font-size: clamp(2.5rem, 6vw, 4.75rem); }
figure { margin: 0; }
.device { filter: drop-shadow(0 30px 40px rgba(10, 12, 30, .22)); }
.device-note { margin-top: .75rem; font-size: .875rem; color: var(--ink-soft); }

/* "LIVE" pill: marks things that happen in real time, as on the TV app. */
.live {
    display: inline-flex; align-items: center; gap: .45em;
    padding: .3em .75em; border-radius: 999px;
    background: rgba(255, 79, 87, .14); color: var(--red);
    font-weight: 800; font-size: .8125rem; letter-spacing: .02em;
}
.live::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: currentColor; }

.button {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .8rem 1.35rem; border-radius: 999px; border: 0; cursor: pointer;
    background: var(--ink); color: var(--paper);
    font-weight: 700; text-decoration: none;
}
.button:hover { opacity: .88; }
.button.light { background: var(--night-text); color: var(--night); }

.split { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split.flip { grid-template-columns: 1.3fr 1fr; }
.split.flip .split-copy { order: 2; }
.split-copy { display: grid; gap: 1.25rem; justify-items: start; }
.split-copy p { color: var(--ink-soft); max-width: var(--measure); }
@media (max-width: 900px) {
    .split, .split.flip { grid-template-columns: 1fr; }
    .split.flip .split-copy { order: 0; }
}

.scorepad { list-style: none; padding: 0; margin: 0; border-top: 3px solid var(--ink); }
.scorepad li { display: grid; grid-template-columns: minmax(10rem, 17rem) 1fr; gap: .375rem 2rem; padding-block: 1.125rem; border-bottom: 1px solid var(--rule); }
.scorepad h3 { font-size: 1.0625rem; }
.scorepad p { color: var(--ink-soft); max-width: 40rem; }
@media (max-width: 640px) { .scorepad li { grid-template-columns: 1fr; } }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 1.5rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 3rem 1fr; gap: .25rem 1rem; }
.steps li::before {
    content: counter(step); grid-row: span 2;
    width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center;
    font-family: var(--score); font-weight: 800; font-size: 1.375rem;
    background: var(--ink); color: var(--paper);
}
.steps h3 { font-size: 1.125rem; align-self: center; }
.steps p { color: var(--ink-soft); grid-column: 2; }
.night .steps li::before { background: var(--night-text); color: var(--night); }
.night .steps p { color: var(--night-soft); }

.faq { border-top: 3px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.125rem; font-weight: 700; font-size: 1.0625rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--score); font-size: 1.5rem; font-weight: 500; color: var(--ink-soft); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding-bottom: 1.25rem; color: var(--ink-soft); max-width: 44rem; display: grid; gap: .75rem; }
.faq .answer ul, .faq .answer ol { margin: 0; padding-left: 1.25rem; }
.faq-group + .faq-group { margin-top: 3.5rem; }
.faq-group > h2 { font-size: clamp(1.625rem, 3vw, 2.125rem); margin-bottom: 1rem; }

.prose { max-width: 44rem; display: grid; gap: 1rem; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); margin-top: 1.75rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { margin: 0; padding-left: 1.25rem; display: grid; gap: .5rem; }
.prose strong { color: var(--ink); font-weight: 650; }

/* Night: the living room with the TV on */
.night {
    background:
        radial-gradient(60% 50% at 50% 0%, rgba(61, 135, 255, .22), transparent 70%),
        radial-gradient(40% 40% at 85% 90%, rgba(255, 79, 87, .14), transparent 70%),
        var(--night);
    color: var(--night-text);
}
.night .lede, .night p { color: var(--night-soft); }
.night a { color: #fff; }

/* Game cards: each game is a playing card, and its corner index is how it's won. */
.card-row { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(9.5rem, 15vw, 12rem); gap: 1.25rem; overflow-x: auto; padding: 1rem 1.25rem 2rem; margin: 0 -1.25rem; scroll-snap-type: x mandatory; scroll-padding-inline: 1.25rem; scrollbar-width: thin; list-style: none; }
.card-row > li { scroll-snap-align: start; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 2rem 1.25rem; list-style: none; padding: 0; margin: 0; }
.game-card {
    position: relative; aspect-ratio: 5 / 7;
    background: var(--card); color: var(--tint);
    border-radius: 14px;
    box-shadow: 0 1px 0 rgba(15, 17, 23, .06), 0 12px 26px -14px rgba(15, 17, 23, .4), inset 0 0 0 1px rgba(15, 17, 23, .07);
    display: grid; place-items: center;
    container-type: inline-size;
}
.game-card .index { position: absolute; display: grid; justify-items: center; line-height: 1; font-family: var(--score); font-weight: 800; }
.game-card .index b { font-size: 15cqw; letter-spacing: -0.02em; }
.game-card .index small { font-size: 6.5cqw; font-weight: 700; margin-top: .3em; opacity: .85; }
.game-card .index.tl { top: 7cqw; left: 7cqw; }
.game-card .index.br { bottom: 7cqw; right: 7cqw; transform: rotate(180deg); }
.game-card .pip { width: 44cqw; height: 44cqw; display: grid; place-items: center; }
.game-card .pip .mask-icon { width: 100%; height: 100%; }
.game-card .pip .letter { font-family: var(--wide); font-stretch: 125%; font-weight: 900; font-size: 40cqw; line-height: 1; }
.game-card-name { margin-top: .75rem; font-weight: 700; font-size: .9375rem; line-height: 1.25; }
.game-card-rule { font-size: .8125rem; color: var(--ink-soft); }
.mask-icon { display: block; -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; background: currentColor; }
.t-card { --tint: #E5333B; }
.t-board { --tint: #2F72E6; }
.t-outdoor { --tint: #1E9152; }
.t-bar { --tint: #DD7A00; }
.t-sports { --tint: #0C8E9A; }
.t-family { --tint: #8A4FD3; }
@media (prefers-color-scheme: dark) {
    .t-card { --tint: #FF6B71; } .t-board { --tint: #6EA2FF; } .t-outdoor { --tint: #45C27C; }
    .t-bar { --tint: #FFA23A; } .t-sports { --tint: #36C4D0; } .t-family { --tint: #B488F0; }
}

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.5rem; }
.filters button { border: 1px solid var(--rule); background: var(--card); padding: .5rem 1rem; border-radius: 999px; font-weight: 600; font-size: .9375rem; cursor: pointer; color: var(--ink-soft); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.5rem; list-style: none; padding: 0; margin: 0; }
.assets li { display: grid; gap: .75rem; align-content: start; }
.assets .thumb { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 1.25rem; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; min-height: 0; }
.assets .thumb img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }

.closing { padding-block: clamp(4.5rem, 9vw, 8rem); text-align: center; }
.closing .wrap { display: grid; gap: 1.5rem; justify-items: center; }
.closing img.icon { width: 104px; height: 104px; border-radius: 24px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }

.site-footer { padding-block: 2.5rem 3rem; font-size: .9375rem; color: var(--ink-soft); border-top: 1px solid var(--rule); }
.site-footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 3rem; }
.site-footer nav { display: grid; grid-template-columns: repeat(3, auto); gap: .5rem 2rem; align-content: start; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.legal { font-size: .8125rem; margin-top: .5rem; max-width: 40rem; }
@media (max-width: 720px) {
    .site-footer .wrap { grid-template-columns: 1fr; }
    .site-footer nav { grid-template-columns: repeat(2, auto); justify-content: start; }
}

/* Header laid over the night hero on the home page */
.site-header.overlay { position: absolute; top: 0; left: 0; right: 0; }
.site-header.overlay + main .hero { padding-top: 5.5rem; }
[hidden] { display: none !important; }
.game-card .pip .suit { font-size: 44cqw; line-height: 1; font-family: system-ui, sans-serif; }
