/* ==========================================================================
   Past-answer archives (hub pages + per-date pages)
   A ledger look: yesterday's answer on a ticket stub (perforated edge,
   answer hidden until tapped), then the last week, a "has it been an
   answer?" lookup, the full month-by-month record and the numbers.
   Each game sets --ga-accent / --ga-soft on <main>.
   ========================================================================== */

.ga-page { --ga-accent: #4f5bd5; --ga-soft: #eef0ff; --ga-ink: #1f2430; --ga-muted: #6b7280; --ga-line: #e7e9f0; }
.ga-page .page-header { text-align: center; margin-bottom: 14px; }
.ga-page .page-header h1 { font-size: clamp(1.5rem, 4.4vw, 2.1rem); line-height: 1.2; margin-bottom: 6px; color: var(--ga-ink); }
.ga-page .page-meta { color: var(--ga-muted); font-size: .9rem; }
.ga-page .page-meta a { color: var(--ga-accent); }

/* ---- Top: ticket + last week side by side on desktop ---- */
.ga-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; margin-bottom: 16px; align-items: start; }
@media (max-width: 760px) { .ga-top { grid-template-columns: 1fr; } }

.ga-ticket {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 18px 18px 16px;
    border: 1px solid var(--ga-line);
    box-shadow: 0 10px 26px -18px rgba(20, 24, 40, .45);
    overflow: hidden;
}
.ga-ticket::before {           /* accent stub with perforation */
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
    background: var(--ga-accent);
}
.ga-ticket::after {
    content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 8px;
    background: radial-gradient(circle at 0 6px, #fafbfc 3px, transparent 3.5px) 0 0 / 8px 12px repeat-y;
}
.ga-ticket-inner { padding-left: 14px; }
.ga-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ga-accent); }
.ga-ticket h2 { font-size: 1.15rem; color: var(--ga-ink); margin: 4px 0 2px; }
.ga-ticket .ga-sub { color: var(--ga-muted); font-size: .88rem; margin-bottom: 12px; }

.ga-reveal > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    min-height: 54px; padding: 10px 14px;
    border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--ga-accent) 55%, #fff);
    background: var(--ga-soft);
}
.ga-reveal > summary::-webkit-details-marker { display: none; }
.ga-blurred { font: 800 1.4rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .12em; color: transparent; text-shadow: 0 0 12px rgba(30, 30, 60, .55); user-select: none; }
.ga-reveal-cta { font-size: .84rem; font-weight: 700; color: var(--ga-accent); white-space: nowrap; }
.ga-reveal[open] > summary { display: none; }
.ga-answer { padding: 6px 2px 2px; animation: ga-in .3s ease both; }
.ga-answer-word { font: 800 clamp(1.6rem, 6vw, 2.1rem)/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .1em; color: var(--ga-ink); word-break: break-word; }
.ga-answer-word.is-sentence { font-size: 1.25rem; letter-spacing: 0; line-height: 1.35; }
.ga-answer p { color: #4a5160; font-size: .92rem; margin-top: 8px; line-height: 1.55; }
.ga-ticket-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: .88rem; }
.ga-ticket-links a { color: var(--ga-accent); font-weight: 600; text-decoration: none; }
.ga-ticket-links a:hover { text-decoration: underline; }
@keyframes ga-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- Cards & tables ---- */
.ga-card { background: #fff; border-radius: 16px; border: 1px solid var(--ga-line); padding: 16px 18px; margin-bottom: 16px; }
.ga-card > h2 { font-size: 1.15rem; color: var(--ga-ink); margin-bottom: 10px; }
.ga-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ga-table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #8a8fa0; padding: 6px 8px; border-bottom: 2px solid var(--ga-line); }
.ga-table td { padding: 8px; border-bottom: 1px solid #f1f2f6; vertical-align: top; }
.ga-table tr:last-child td { border-bottom: 0; }
.ga-table td.ga-date { white-space: nowrap; color: #4a5160; }
.ga-table td.ga-date a { color: var(--ga-accent); font-weight: 600; text-decoration: none; }
.ga-table td.ga-num { color: #8a8fa0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ga-table td.ga-ans { font-weight: 700; letter-spacing: .04em; color: var(--ga-ink); }
.ga-table td.ga-extra { color: var(--ga-muted); font-size: .86rem; }
.ga-table tr.ga-hit td { background: #fff7d6; }
.ga-more { display: inline-block; margin-top: 10px; font-size: .88rem; font-weight: 600; color: var(--ga-accent); text-decoration: none; }

/* ---- Lookup ---- */
.ga-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ga-search input {
    flex: 1 1 220px; min-height: 46px; padding: 10px 14px;
    border: 1.5px solid #d6d9e4; border-radius: 12px; font-size: 1rem;
}
.ga-search input:focus { outline: 3px solid color-mix(in srgb, var(--ga-accent) 30%, #fff); border-color: var(--ga-accent); }
.ga-search-result { margin-top: 10px; font-size: .95rem; color: #3f4553; min-height: 1.4em; }
.ga-search-result b { color: var(--ga-ink); }
.ga-months-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ga-months-nav a { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--ga-soft); color: var(--ga-accent); text-decoration: none; font-weight: 600; }

/* ---- Month accordions ---- */
.ga-month { border-top: 1px solid var(--ga-line); }
.ga-month:first-of-type { border-top: 0; }
.ga-month > summary {
    list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px;
    padding: 12px 2px; font-weight: 700; color: var(--ga-ink); min-height: 44px;
}
.ga-month > summary::-webkit-details-marker { display: none; }
.ga-month > summary::before { content: "▸"; color: var(--ga-accent); transition: transform .2s; }
.ga-month[open] > summary::before { transform: rotate(90deg); }
.ga-month > summary span { font-weight: 500; font-size: .85rem; color: #8a8fa0; }
.ga-month .ga-table { margin-bottom: 8px; }

/* ---- Numbers ---- */
.ga-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ga-tile { background: #f8f9fc; border: 1px solid var(--ga-line); border-radius: 12px; padding: 12px 14px; }
.ga-tile b { display: block; font-size: 1.35rem; color: var(--ga-ink); line-height: 1.2; }
.ga-tile span { font-size: .8rem; color: var(--ga-muted); }
.ga-bars { display: grid; gap: 7px; margin: 6px 0 12px; }
.ga-bar { display: grid; grid-template-columns: 120px 1fr 44px; gap: 10px; align-items: center; font-size: .86rem; color: #4a5160; }
.ga-bar-track { height: 12px; background: #f0f1f6; border-radius: 999px; overflow: hidden; }
.ga-bar-fill { height: 100%; background: var(--ga-accent); border-radius: 999px; }
.ga-bar b { text-align: right; font-variant-numeric: tabular-nums; color: var(--ga-ink); }
.ga-note { font-size: .84rem; color: #8a8fa0; }

/* ---- SEO body (reuses .answer-card from daily-answers.css) ---- */
.ga-page .answer-card h2 { font-size: 1.3rem; color: #2d3748; margin-bottom: 10px; }
.ga-page .answer-card h3 { font-size: 1.05rem; color: #2d3748; margin: 14px 0 6px; }
.ga-page .answer-card p { color: #4a5160; margin-bottom: 10px; line-height: 1.7; }
.ga-page .answer-card ul, .ga-page .answer-card ol { margin: 0 0 10px 20px; color: #4a5160; line-height: 1.7; }
.ga-page .answer-card li { margin-bottom: 4px; }
.ga-page section.answer-card > details { border-bottom: 1px solid #eef0f4; padding: 10px 0; }
.ga-page section.answer-card > details > summary { cursor: pointer; font-weight: 600; color: #2d3748; min-height: 32px; }
.ga-page section.answer-card > details > p { margin: 8px 0 0; }
.ga-snippet { background: var(--ga-soft); border-left: 4px solid var(--ga-accent); padding: 12px 14px; border-radius: 0 10px 10px 0; }
.ga-figure { margin: 12px 0 4px; }
.ga-figure img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--ga-line); }
.ga-figure figcaption { font-size: .84rem; color: #8a8fa0; margin-top: 6px; text-align: center; }
.ga-links { display: flex; flex-wrap: wrap; gap: 10px; }
.ga-links a { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--ga-soft); color: var(--ga-accent); text-decoration: none; font-weight: 600; font-size: .9rem; }

/* ---- Per-date pages ---- */
.ga-date-nav { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0 16px; font-size: .92rem; }
.ga-date-nav a { color: var(--ga-accent); font-weight: 600; text-decoration: none; }
.ga-levels { display: grid; gap: 14px; }
.ga-level h3 { font-size: 1rem; color: var(--ga-ink); margin-bottom: 4px; }
.ga-level .ga-sub { color: var(--ga-muted); font-size: .85rem; margin-bottom: 10px; }
.ga-puzzle-text { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.05rem; line-height: 1.6; color: #2f3340; background: #fbfaf6; border: 1px solid #eee8d9; border-radius: 12px; padding: 12px 14px; }

@media (max-width: 520px) {
    .ga-card { padding: 14px; }
    .ga-table td, .ga-table th { padding: 7px 5px; }
    .ga-table .ga-hide-sm { display: none; }
    .ga-bar { grid-template-columns: 92px 1fr 38px; }
}
@media (prefers-reduced-motion: reduce) { .ga-answer { animation: none; } }

/* Pips boards inside archive pages scale to their column (container query),
   with horizontal scroll as the fallback for older browsers. */
.ga-page .ga-level { container-type: inline-size; overflow-x: auto; }
.ga-page .ga-level .pips-board {
    --pips-cell: min(48px, calc((100cqw - (var(--pips-cols) - 1) * 6px) / var(--pips-cols)));
}
.ga-levels-3 { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
.ga-levels-3 .ga-level-hard { grid-column: 1 / -1; }
@media (max-width: 600px) { .ga-levels-3 { grid-template-columns: 1fr; } }
