/* Crawlable content blocks: result landing text, archives, 4D dictionary, footer.
   Uses the theme variables from site.css so dark mode follows automatically. */

.seo-landing[hidden] { display: none !important; }

.seo-landing .seo-content {
    margin-bottom: 18px;
}

.seo-content h2 {
    margin: 22px 0 10px;
    font-size: 1rem;
    line-height: 1.35;
}

.seo-content h3 {
    margin: 16px 0 8px;
    font-size: .92rem;
}

.seo-content h3 small,
.seo-content th small,
.seo-content td small {
    color: var(--text-soft);
    font-weight: 600;
}

.seo-content a {
    color: inherit;
}

.seo-content ul {
    padding-left: 18px;
}

.seo-subtitle {
    margin-top: -4px !important;
    font-weight: 700;
}

.seo-meta {
    font-size: .82rem !important;
}

.seo-cta {
    display: inline-block;
    margin: 8px 0 4px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--text);
    color: var(--surface) !important;
    font-size: .9rem;
    font-weight: 800;
    text-decoration: none;
}

.seo-block {
    margin-top: 14px;
}

.seo-block > summary {
    cursor: pointer;
    list-style: none;
}

.seo-block > summary::-webkit-details-marker { display: none; }

.seo-block > summary h2 {
    display: inline;
}

.seo-block > summary::after {
    content: " ▾";
    color: var(--text-soft);
}

.seo-block:not([open]) > summary::after { content: " ▸"; }

/* Tables */
.seo-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.seo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.seo-table th,
.seo-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.seo-table thead th {
    color: var(--text-soft);
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.seo-table td {
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
}

.seo-table-compact th,
.seo-table-compact td {
    padding: 7px 4px;
    text-align: center;
}

.seo-table-compact th[scope="row"] { text-align: left; }

.seo-prize-table th {
    width: 42%;
    font-size: .84rem;
}

.seo-meaning {
    display: block;
    margin-top: 2px;
    color: var(--text-soft);
    font-size: .78rem;
    letter-spacing: 0;
}

/* Numbers */
.seo-number {
    display: inline-block;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: .06em;
    text-decoration: none;
}

.seo-number-lg {
    font-size: 1.25rem;
}

.seo-number-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin: 0;
    padding: 0 !important;
    list-style: none;
}

.seo-number-grid li {
    padding: 8px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    text-align: center;
}

@media (max-width: 360px) {
    .seo-number-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Chips, grids, lists */
.seo-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.seo-chip-list a,
.seo-chip-list span.active {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.seo-chip-list span.active {
    background: var(--text);
    color: var(--surface);
}

.seo-chip-numbers a {
    font-variant-numeric: tabular-nums;
    letter-spacing: .05em;
}

.seo-range-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.seo-range-grid a {
    padding: 8px 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    font-weight: 800;
    font-size: .86rem;
    text-align: center;
    text-decoration: none;
}

.seo-range-grid small {
    color: var(--text-soft);
    font-weight: 600;
    font-size: .72rem;
}

.seo-topic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.seo-topic-grid a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    text-decoration: none;
}

.seo-topic-grid span,
.seo-topic-grid small {
    color: var(--text-soft);
    font-size: .8rem;
}

.seo-dictionary-list {
    margin: 12px 0 0;
    padding: 0 !important;
    list-style: none;
}

.seo-dictionary-list li {
    display: flex;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.seo-dictionary-list .seo-number {
    flex: 0 0 3.4em;
}

.seo-dictionary-list div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: .84rem;
}

.seo-dictionary-list b {
    color: var(--text-soft);
    font-size: .72rem;
    text-transform: uppercase;
}

.seo-win-list {
    margin: 0;
    padding: 0 !important;
    list-style: none;
}

.seo-win-list li {
    display: grid;
    grid-template-columns: 6.2em 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
    font-size: .84rem;
}

.seo-prize-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
}

.seo-prize-tag.tier-1 { background: #f6e7b0; border-color: #e3c75d; color: #5b4500; }
.seo-prize-tag.tier-2 { background: #e8ecf3; border-color: #c7cfdb; color: #333b48; }
.seo-prize-tag.tier-3 { background: #f2dfd0; border-color: #ddb99a; color: #5a3517; }

.seo-facts {
    margin: 0;
    font-size: .88rem;
    line-height: 1.7;
}

.seo-example {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 14px 0;
    padding: 12px;
    border-left: 3px solid var(--gold);
    border-radius: 8px;
    background: var(--surface-soft);
    font-size: .86rem;
}

.seo-lookup {
    display: flex;
    gap: 8px;
}

.seo-lookup input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 1rem;
    letter-spacing: .1em;
}

.seo-lookup button {
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--text);
    color: var(--surface);
    font-weight: 800;
}

.seo-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Navigation helpers */
.seo-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 10px;
    padding: 0 !important;
    list-style: none;
    color: var(--text-soft);
    font-size: .78rem;
}

.seo-breadcrumbs li + li::before {
    content: "›";
    margin-right: 4px;
}

.seo-breadcrumbs a {
    color: var(--text-soft);
    text-decoration: none;
}

.seo-pager {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 18px 0 6px;
    font-size: .86rem;
    font-weight: 800;
}

.seo-pager a {
    text-decoration: none;
}

.seo-faq details {
    border-bottom: 1px solid var(--line);
}

.seo-faq summary {
    padding: 10px 0;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 700;
}

.seo-faq details p {
    margin-top: 0 !important;
}

.seo-disclaimer {
    margin-top: 18px !important;
    font-size: .76rem !important;
}

/* About pages: statistics list, ranks, games */
.seo-stat-list section {
    padding: 4px 0 10px;
    border-bottom: 1px solid var(--line);
}

.seo-stat-list h3 a {
    text-decoration: none;
}

.seo-stat-list p {
    margin: 4px 0 !important;
}

.seo-rank-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
    padding: 0 !important;
    list-style: none;
}

.seo-rank {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
}

.seo-rank.rank-brown { background: #ecd9c6; color: #6b3f18; }
.seo-rank.rank-silver { background: #e6e9ee; color: #3d4450; }
.seo-rank.rank-gold { background: #f6e7b0; color: #5b4500; }
.seo-rank.rank-platinum { background: #dcecf0; color: #1f4b57; }

.seo-game-list {
    margin-top: 10px;
}

.seo-game {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 16px;
}

.seo-game img {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.seo-game h2 {
    margin: 0 0 4px;
}

.seo-game h2 a {
    text-decoration: none;
}

.seo-game .seo-cta {
    padding: 7px 12px;
    font-size: .84rem;
}

/* Small "about this page" link on app-style screens (Predict, Community) */
.page-about-link {
    display: inline-block;
    margin-top: 6px;
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.page-about-link-center {
    display: block;
    margin: 18px auto 8px;
    font-size: .82rem;
    text-align: center;
    opacity: .75;
}

/* Back to top — sits above the fixed bottom nav, inside the 520px app column */
.back-to-top {
    position: fixed;
    right: max(14px, calc((100vw - 520px) / 2 + 14px));
    bottom: calc(58px + 16px + env(safe-area-inset-bottom));
    z-index: 190; /* under .main-nav (200) and dialogs */
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(214, 178, 92, .55);
    border-radius: 50%;
    background: linear-gradient(135deg, #17110a 0%, #22180c 100%);
    color: #f4d58a;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .2s ease, transform .2s ease;
}

.back-to-top svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.back-to-top:focus-visible {
    outline: 2px solid #f4d58a;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top { transition: none; }
}

/* Footer */
.site-footer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 14px;
    margin: 0 14px;
    padding: 18px 4px calc(96px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    color: var(--text-soft);
    font-size: .8rem;
}

.site-footer h2 {
    margin: 10px 0 6px;
    color: var(--text);
    font-size: .8rem;
}

.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer li {
    padding: 3px 0;
}

.site-footer a {
    color: var(--text-soft);
    text-decoration: none;
}

.site-footer-note {
    grid-column: 1 / -1;
    margin: 14px 0 0;
    font-size: .72rem;
    line-height: 1.5;
}
