/* =====================================================================
   Shared components for the geography games family
   (Chronophoto, Guess The Country, Draw The Country, Sort The Countries,
   Name The Countries, Click The Countries, Name The Flags).

   This file is IDENTICAL in every site. Edit the master copy in
   Webgames/_shared/shared.css and copy it to each site folder.

   Each site sets its own colours in its styles.css :root, e.g.
     --fam-dark       footer background            (site's dark brand colour)
     --fam-on-dark    footer text
     --fam-surface    modal card background
     --fam-text       modal text
     --fam-title      modal heading (defaults to --fam-text)
     --fam-tile       game tile background
     --fam-tile-hover game tile background on hover
     --fam-icon-bg    app-icon square
     --fam-icon-fg    app-icon glyph
     --fam-backdrop   dimmed page behind a modal
     --fam-accent     header-button border, focus ring, "on" dot of region chips
     --fam-chip-border  border of region chips that are off
   Load this file AFTER the site's styles.css.
   ===================================================================== */

/* ---- Footer ---------------------------------------------------------- */
.site-footer {
    margin-top: auto;
    padding: 22px 16px calc(26px + env(safe-area-inset-bottom));
    background: var(--fam-dark, #000000);
    color: var(--fam-on-dark, #ffffff);
    text-align: center;
    box-sizing: border-box;
    width: 100%;
    position: static;
    border: none;
}

.site-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 32px;
    margin: 0;
    padding: 0;
}

.site-footer .footer-link {
    display: inline-block;
    font-family: var(--fam-font-display, 'Bungee', cursive);
    font-size: clamp(2.1rem, 6vw, 3rem);
    font-weight: normal;
    line-height: 1.15;
    color: var(--fam-on-dark, #ffffff);
    text-decoration: none;
    transition: transform .2s ease;
}

.site-footer .footer-sublinks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 22px;
    margin-top: 10px;
}

.site-footer .footer-sublink {
    display: inline-block;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 1.05rem;
    color: var(--fam-on-dark, #ffffff);
    text-decoration: none;
    transition: transform .2s ease;
}

/* Links on the dark bar grow slightly on hover; no colour change. */
.site-footer .footer-link:hover,
.site-footer .footer-link:focus-visible,
.site-footer .footer-sublink:hover,
.site-footer .footer-sublink:focus-visible {
    transform: scale(1.06);
    color: var(--fam-on-dark, #ffffff);
    opacity: 1;
}

.site-footer .footer-copy {
    margin: 12px 0 0;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 0.85rem;
    color: var(--fam-on-dark, #ffffff);
    opacity: 0.6;
}

/* ---- Daily World box (added to the footer by dailyworld.js) ------------ */
.site-footer .dw-box {
    max-width: 420px;
    margin: 16px auto 0;
    color: var(--fam-on-dark, #ffffff);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
}

.site-footer .dw-box .daily-email { margin-top: 0; }

/* Games without a daily show nothing here until you're signed in. */
.site-footer .dw-box:empty { display: none; }

.site-footer .dw-streak {
    margin: 0;
    font-size: 1.3rem;
}

.site-footer .dw-streak strong {
    font-family: var(--fam-font-display, 'Bungee', cursive);
    font-weight: normal;
}

.site-footer .dw-meta {
    margin: 2px 0 0;
    font-size: 1rem;
    opacity: 0.85;
}

.site-footer .dw-note {
    margin: 2px 0 0;
    font-size: 0.95rem;
    opacity: 0.7;
}

.site-footer .dw-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 16px;
    margin: 10px 0 0;
    font-size: 1rem;
}

/* "See all your stats" is the main thing to do here. */
.site-footer .dw-links .dw-stats {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--fam-on-dark, #ffffff);
    color: var(--fam-dark, #000000);
    text-decoration: none;
    transition: transform .2s ease;
}

.site-footer .dw-signout {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.85;
}

.site-footer .dw-links .dw-stats:hover { transform: scale(1.04); }
.site-footer .dw-signout:hover { opacity: 1; }

.site-footer .dw-signin {
    margin: 6px 0 0;
    font-size: 0.95rem;
    opacity: 0.8;
}

.site-footer .dw-signin a { color: inherit; }

/* ---- Daily email signup (the form in the Daily World box) -------------- */
.site-footer .daily-email {
    max-width: 420px;
    margin: 16px auto 0;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
}

.site-footer .daily-email-label {
    display: block;
    margin-bottom: 6px;
    font-size: 1.05rem;
    color: var(--fam-on-dark, #ffffff);
}

.site-footer .daily-email-row {
    display: flex;
    gap: 8px;
}

.site-footer .daily-email-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--fam-on-dark, #ffffff);
    font: inherit;
    font-size: 1rem;
    box-shadow: none;
}

.site-footer .daily-email-input::placeholder {
    color: var(--fam-on-dark, #ffffff);
    opacity: 0.5;
}

.site-footer .daily-email-input:focus-visible,
.site-footer .daily-email-btn:focus-visible {
    outline: 2px solid var(--fam-accent, #ffffff);
    outline-offset: 2px;
}

.site-footer .daily-email-btn {
    flex: 0 0 auto;
    width: auto;
    height: 40px;
    margin: 0;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    background: var(--fam-on-dark, #ffffff);
    color: var(--fam-dark, #000000);
    font: inherit;
    font-size: 1rem;
    box-shadow: none;
    cursor: pointer;
    transition: transform .2s ease;
}

.site-footer .daily-email-btn:hover {
    transform: scale(1.04);
}

.site-footer .daily-email-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.site-footer .daily-email-msg {
    min-height: 1.2em;
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: var(--fam-on-dark, #ffffff);
    opacity: 0.8;
}

.site-footer .daily-email-hp {
    position: absolute;
    left: -9999px;
}

/* ---- Daily World on the page (dailyworld.js) ---------------------------- */
/* The account button, last in the header, in the site's own header-button style: a
   circle with a person outline, or (signed in) your picture on your colour. */
.dw-account { text-decoration: none; }
.dw-person { flex-shrink: 0; vertical-align: -3px; }

.dw-account.dw-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

/* Your colour (and emoji or flag) from Daily World. */
.dw-account.dw-avatar.dw-filled,
.dw-account.dw-avatar.dw-filled:hover,
.dw-account.dw-avatar.dw-filled:focus-visible {
    overflow: hidden;
    background: var(--dw-av);
    color: var(--dw-av-fg, #ffffff);
}

.dw-account.dw-avatar img {
    /* The whole flag, centred on your colour (flags aren't round, and some aren't rectangles). */
    width: auto;
    height: auto;
    max-width: 66%;
    max-height: 58%;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.dw-account.dw-avatar img.dw-logo,
.dw-menu-pic img.dw-logo {
    /* One of our logos, as a symbol on your colour. */
    width: 60%;
    height: 60%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
}

.dw-avatar-emoji {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    font-size: 1.15rem;
}

/* Chronophoto's navbar links have no border of their own. */
.navbar .dw-account.dw-avatar {
    width: 30px;
    min-width: 30px;
    height: 30px;
    border: 2px solid currentColor;
}

.dw-avatar-dot {
    font-family: var(--fam-font-display, 'Bungee', cursive);
    font-size: 1rem;
    font-weight: normal;
    line-height: 1;
    letter-spacing: 0;
}

/* "What's Daily World": opened by the person outline while signed out. Everything in it
   is centred; the colours are the site's own modal colours. */
.dw-dialog {
    /* Centred even on sites whose reset removes a dialog's own margin: auto. */
    position: fixed;
    inset: 0;
    margin: auto;
    height: fit-content;
    max-height: calc(100vh - 32px);
    overflow: auto;
    box-sizing: border-box;
    width: min(340px, calc(100vw - 32px));
    padding: 30px 26px 16px;
    border: 0;
    border-radius: 20px;
    background: var(--fam-surface, #ffffff);
    color: var(--fam-text, #111111);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    text-align: center;
}

.dw-dialog[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dw-dialog::backdrop { background: rgba(0, 0, 0, 0.5); }

.dw-dialog-logo { display: block; margin: 0 0 10px; border-radius: 12px; }
/* The logo and name link to dailyworld.app: the mark gives a little spin and lift. */
.dw-dialog-brand {
    display: flex; flex-direction: column; align-items: center; width: 100%;
    color: inherit; text-decoration: none; border-radius: 14px; outline-offset: 4px;
}
.dw-dialog-brand .dw-dialog-logo { transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease; }
.dw-dialog-brand:hover .dw-dialog-logo,
.dw-dialog-brand:focus-visible .dw-dialog-logo { transform: translateY(-3px) rotate(-12deg) scale(1.08); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22); }
.dw-dialog-brand h2 { text-decoration: underline transparent; text-decoration-thickness: 2px; text-underline-offset: 4px; transition: text-decoration-color 0.25s ease; }
.dw-dialog-brand:hover h2,
.dw-dialog-brand:focus-visible h2 { text-decoration-color: currentColor; }
@media (prefers-reduced-motion: reduce) {
    .dw-dialog-brand .dw-dialog-logo { transition: none; }
    .dw-dialog-brand:hover .dw-dialog-logo, .dw-dialog-brand:focus-visible .dw-dialog-logo { transform: none; }
}

.dw-dialog h2 {
    width: 100%;
    margin: 0 0 6px;
    padding: 0;
    color: var(--fam-title, var(--fam-text, #111111));
    font-family: var(--fam-font-display, 'Bungee', cursive);
    font-size: 1.45rem;
    font-weight: normal;
    line-height: 1.15;
    text-align: center;
}

.dw-dialog p { margin: 0; line-height: 1.35; text-align: center; }
.dw-dialog .dw-dialog-lede { max-width: 250px; font-size: 1.08rem; }
.dw-dialog .dw-dialog-quiet { margin-top: 6px; font-size: 0.9rem; opacity: 0.65; }

/* The dialog's own colours swapped, so the buttons stand out on light and dark sites. */
.dw-dialog-go,
.dw-dialog-row button {
    background: var(--fam-text, #111111);
    color: var(--fam-surface, #ffffff);
    font-family: inherit;
    cursor: pointer;
    transition: transform .2s ease;
}

.dw-dialog-go {
    box-sizing: border-box;
    width: 100%;
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    text-decoration: none;
}

.dw-dialog-go:hover { transform: scale(1.03); color: var(--fam-surface, #ffffff); }

.dw-dialog-remind { width: 100%; margin: 18px 0 0; }

/* "or just a daily reminder", between two hairlines. */
.dw-dialog .dw-dialog-or {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.dw-dialog-or::before, .dw-dialog-or::after {
    content: '';
    flex: 1;
    border-top: 1px solid currentColor;
    opacity: 0.35;
}

.dw-dialog-row {
    display: flex;
    gap: 6px;
}

.dw-dialog-row input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    border: 1.5px solid rgba(127, 127, 127, 0.45);
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 1rem;
}

.dw-dialog-row input::placeholder { color: inherit; opacity: 0.5; }

.dw-dialog-row button {
    flex-shrink: 0;
    height: 40px;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    font-size: 1rem;
}

.dw-dialog-row button:disabled { opacity: 0.6; cursor: default; }

.dw-dialog .dw-dialog-msg { min-height: 1.2em; margin-top: 6px; font-size: 0.9rem; }

.dw-dialog .dw-dialog-hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

.dw-dialog-later, .dw-dialog-close {
    margin: 0;
    padding: 6px 10px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    opacity: 0.7;
}

.dw-dialog-later { margin-top: 2px; font-size: 0.95rem; }
.dw-dialog-later:hover, .dw-dialog-close:hover { opacity: 1; }

.dw-dialog-close {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.5rem;
    line-height: 1;
}

/* The last line of a game's Stats popup: sign in, or "See all your stats". */
.dw-modal {
    margin: 18px 0 0;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
    opacity: 0.75;
}

.dw-modal a { color: inherit; text-decoration: underline; }
.dw-modal a:hover { opacity: 1; }

/* Notices (dailyworld.js notice()): the streak after a daily and "Copied!" after sharing.
   A dark card in the upper part of the screen, below the header and the mode tabs, so
   it's in view without covering the site's own bar. */
.dw-notices {
    position: fixed;
    left: 50%;
    top: calc(env(safe-area-inset-top) + clamp(96px, 18vh, 170px));
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: calc(100vw - 24px);
    transform: translateX(-50%);
    pointer-events: none;
}

.dw-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
    max-width: 100%;
    padding: 12px 24px 12px 12px;
    border-radius: 20px;
    background: var(--fam-dark, #111111);
    color: var(--fam-on-dark, #ffffff);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    text-align: left;
    pointer-events: auto;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-18px) scale(0.96);
    transition: opacity .3s ease, transform .4s cubic-bezier(.2, .9, .3, 1.25);
}

.dw-notice.dw-notice-in {
    opacity: 1;
    transform: none;
}

.dw-notice-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.9rem;
    line-height: 1;
}

.dw-notice-copied .dw-notice-icon { background: #22c55e; color: #ffffff; }
.dw-notice-streak .dw-notice-icon { background: linear-gradient(160deg, #ffb347, #ff5f2e); }

.dw-notice-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.dw-notice-title {
    font-family: var(--fam-font-display, 'Bungee', cursive);
    font-size: 1.45rem;
    line-height: 1.1;
}

.dw-notice-sub {
    font-size: 1.05rem;
    line-height: 1.2;
    opacity: 0.8;
}

/* The flame gives a little hop as the card arrives. */
.dw-notice-in .dw-notice-flame {
    display: inline-block;
    animation: dw-flame-hop .9s cubic-bezier(.3, 1.6, .5, 1) .15s both;
}

@keyframes dw-flame-hop {
    0% { transform: scale(0.4) rotate(-12deg); }
    60% { transform: scale(1.25) rotate(6deg); }
    100% { transform: scale(1) rotate(0); }
}

@media (max-width: 480px) {
    .dw-notice { gap: 12px; padding: 10px 18px 10px 10px; border-radius: 18px; }
    .dw-notice-icon { width: 46px; height: 46px; font-size: 1.6rem; }
    .dw-notice-title { font-size: 1.25rem; }
    .dw-notice-sub { font-size: 0.98rem; }
}

@media (prefers-reduced-motion: reduce) {
    .dw-notice { transform: none; transition: opacity .3s ease; }
    .dw-notice-in .dw-notice-flame { animation: none; }
}

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

/* ---- Summary tiles at the top of a game's Stats popup -------------------- */
/* Big number, small label under it; the daily streak comes first, with its flame.
   On light and dark popups alike (the tile is a light tint of the popup's own colour). */
.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
    margin: 4px 0 18px;
}

.stat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 12px 8px 10px;
    border-radius: 14px;
    background: rgba(127, 127, 127, 0.12);
    text-align: center;
}

.stat-tile-value {
    font-family: var(--fam-font-display, 'Bungee', cursive);
    font-size: 1.7rem;
    line-height: 1.1;
    white-space: nowrap;
}

.stat-tile-main .stat-tile-value { font-size: 2rem; }
/* Some games style their old stat ids (#dailyStreak...); inside a tile the number follows the tile. */
#statsModal .stat-tile-value [id] { font: inherit; color: inherit; margin: 0; padding: 0; background: none; }
.stat-tile-fire { font-size: 0.75em; margin-right: 2px; vertical-align: 0.06em; }

.stat-tile-label {
    margin-top: 3px;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 0.9rem;
    line-height: 1.2;
    opacity: 0.75;
}

/* "Not played yet" in place of a game's tiles. */
.stat-empty { margin: 6px 0 16px; text-align: center; opacity: 0.75; }

/* Tables that stay tables (one row per map, say), in the same soft look as the tiles. */
#statsModal table.stat-table {
    border-collapse: separate;
    border-spacing: 0 4px;
    margin: 4px 0 12px;
}

#statsModal table.stat-table th {
    padding: 4px 8px;
    border: 0;
    background: none;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 0.85rem;
    font-weight: normal;
    opacity: 0.7;
}

#statsModal table.stat-table td {
    padding: 8px;
    border: 0;
    background: rgba(127, 127, 127, 0.12);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
}

#statsModal table.stat-table td:first-child { border-radius: 10px 0 0 10px; text-align: left; }
#statsModal table.stat-table td:last-child { border-radius: 0 10px 10px 0; }

/* Chronophoto's stats grid, in the same tile style (its markup: <strong>label</strong> <span>number</span>). */
/* Plain class selectors on purpose: Chronophoto hides the other mode's grid with a
   [data-mode-only] rule, which has to win over these. */
.modal .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin: 4px 0 18px;
}

#statsModal .stat-item:not([style*="none"]) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 12px 8px 10px;
    border: 0;
    border-radius: 14px;
    background: rgba(127, 127, 127, 0.12);
    box-shadow: none;
    text-align: center;
}

#statsModal .stat-item > span {
    order: 1;
    font-family: var(--fam-font-display, 'Bungee', cursive);
    font-size: 1.7rem;
    line-height: 1.1;
}

#statsModal .stat-item > strong {
    order: 3;
    margin-top: 3px;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 0.9rem;
    font-weight: normal;
    opacity: 0.75;
}

#statsModal .stat-item > div { order: 2; margin: 0 !important; font-size: 0.8rem !important; opacity: 0.7; }

/* The day a best score was set, small under the score in a game's Stats popup. */
.best-date {
    display: block;
    margin-top: 2px;
    font-size: 0.72em;
    font-weight: normal;
    letter-spacing: 0;
    opacity: 0.7;
}

/* ---- More Games modal ------------------------------------------------- */
/* The page's own script shows/hides it by setting style.display. */
#allGamesModal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    background: var(--fam-backdrop, rgba(0, 0, 0, 0.55));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#allGamesModal .modal-content {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    margin: 0;
    padding: 26px 26px 28px;
    background: var(--fam-surface, #ffffff);
    color: var(--fam-text, #000000);
    border: none;
    border-radius: 16px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    text-align: center;
}

#allGamesModal .modal-header {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 20px;
    padding: 0 40px;
    border: none;
    background: none;
}

#allGamesModal .modal-header h2 {
    margin: 0;
    font-family: var(--fam-font-display, 'Bungee', cursive);
    font-size: 1.9rem;
    font-weight: normal;
    line-height: 1.2;
    color: var(--fam-title, var(--fam-text, #000000));
    text-align: center;
    text-shadow: none;
}

#allGamesModal .modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    left: auto;
    bottom: auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--fam-text, #000000);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: background .2s ease;
}

#allGamesModal .modal-close:hover,
#allGamesModal .modal-close:focus-visible {
    background: var(--fam-close-hover, rgba(0, 0, 0, 0.08));
    color: var(--fam-text, #000000);
    transform: none;
}

#allGamesModal .modal-body {
    margin: 0;
    padding: 0;
    font-size: 1rem;
}

#allGamesModal .games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: none;
    gap: 14px;
    justify-items: stretch;
    margin: 0;
    padding: 0;
}

#allGamesModal .game-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0;
    padding: 20px 10px 16px;
    background: var(--fam-tile, #f3f4f6);
    border: 1px solid var(--fam-tile-border, rgba(0, 0, 0, 0.06));
    border-radius: 12px;
    color: var(--fam-text, #000000);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 1.05rem;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

#allGamesModal .game-item svg {
    --icon-color: var(--fam-icon-fg, #ffffff);
    box-sizing: border-box;
    width: 58px;
    height: 58px;
    margin: 0;
    padding: 13px;
    background: var(--fam-icon-bg, #000000);
    border-radius: 16px;
    fill: var(--fam-icon-fg, #ffffff);
    stroke: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform .2s ease;
}

#allGamesModal .game-item:hover,
#allGamesModal .game-item:focus-visible {
    transform: translateY(-3px);
    background: var(--fam-tile-hover, #ffffff);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    color: var(--fam-text, #000000);
}

#allGamesModal .game-item:hover svg,
#allGamesModal .game-item:focus-visible svg {
    transform: scale(1.06);
    fill: var(--fam-icon-fg, #ffffff);
    stroke: none;
}

/* The title: Daily World's mark, in the same icon colours as the games, and its name,
   linking to dailyworld.app. */
#allGamesModal .dw-modal-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    text-decoration: none;
}

/* Chronophoto sets its body font on every element (*), so the name says to inherit too. */
#allGamesModal .dw-modal-brand span {
    font: inherit;
}

#allGamesModal .dw-modal-brand svg {
    --icon-color: var(--fam-icon-fg, #ffffff);
    flex: none;
    box-sizing: border-box;
    width: 46px;
    height: 46px;
    padding: 7px;
    background: var(--fam-icon-bg, #000000);
    border-radius: 13px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform .2s ease;
}

#allGamesModal .dw-modal-brand:hover svg,
#allGamesModal .dw-modal-brand:focus-visible svg {
    transform: scale(1.06);
}

@media (max-width: 600px) {
    #allGamesModal .modal-content {
        padding: 20px 14px 18px;
    }
    #allGamesModal .modal-header h2 {
        font-size: 1.6rem;
    }
    #allGamesModal .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    #allGamesModal .game-item {
        padding: 16px 8px 14px;
        font-size: 0.95rem;
    }
}

/* ---- Site title heading ----------------------------------------------- */
/* The page's one <h1> wraps the existing title link (or logo) in the header. It adds
   no box and no styling of its own, so the header looks exactly as it did. */
.site-title {
    display: contents;
    font: inherit;
    color: inherit;
    margin: 0;
}

/* ---- FAQ accordion ----------------------------------------------------- */
.about-accordion {
    box-sizing: border-box;
    width: min(760px, calc(100% - 32px));
    max-width: none;
    margin: 16px auto 28px;
    background: var(--fam-faq-bg, var(--fam-surface, #ffffff));
    color: var(--fam-faq-text, var(--fam-text, #000000));
    border: 1px solid var(--fam-tile-border, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    overflow: hidden;
}

.about-accordion .about-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    list-style: none;
    cursor: pointer;
    user-select: none;
    font-family: var(--fam-font-display, 'Bungee', cursive);
    font-size: 1.05rem;
    color: var(--fam-faq-heading, var(--fam-faq-text, var(--fam-text, #000000)));
}

.about-accordion .about-summary::-webkit-details-marker {
    display: none;
}

.about-accordion .about-summary::after {
    content: '+';
    flex-shrink: 0;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 1.5rem;
    line-height: 1;
    transition: transform .25s ease;
}

.about-accordion[open] .about-summary::after {
    transform: rotate(45deg);
}

.about-accordion .about-body {
    padding: 0 18px 18px;
    font-size: 1rem;
    line-height: 1.5;
    overflow: hidden;
    transition: height .3s ease;
}

.about-accordion .about-body h3 {
    margin: 14px 0 4px;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 1.1rem;
    color: var(--fam-faq-heading, var(--fam-faq-text, var(--fam-text, #000000)));
}

.about-accordion .about-body p {
    margin: 0 0 12px;
}

.about-accordion .about-body p:last-child {
    margin-bottom: 0;
}

.about-accordion .about-body strong {
    color: var(--fam-faq-heading, var(--fam-faq-text, var(--fam-text, #000000)));
}

/* ---- Header buttons (Settings, Stats, Continents...) ------------------- */
.header-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    width: auto;
    height: 36px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--fam-accent, rgba(255, 255, 255, 0.5));
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    color: var(--fam-on-dark, #ffffff);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s ease;
}

.header-btn:hover,
.header-btn:focus-visible {
    transform: scale(1.06);
    background: rgba(255, 255, 255, 0.08);
    color: var(--fam-on-dark, #ffffff);
}

.header-btn:focus-visible {
    outline: 2px solid var(--fam-accent, #ffffff);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .header-btn {
        width: 36px;
        padding: 0;
    }
    .header-btn-label {
        display: none;
    }
}

/* Narrow phones: a little less room for the buttons, so the title keeps more of its own. */
@media (max-width: 400px) {
    .header-actions { gap: 6px; }
    .header-btn,
    .dw-account.dw-avatar {
        width: 34px;
        min-width: 34px;
        height: 34px;
    }
}

/* ---- Region chips (World / USA / Canada / Australia / UK) -------------- */
/* The game script toggles "active" (and sometimes "locked") on each chip. */
.region-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 14px auto 2px;
    padding: 0 12px;
}

.region-chips .region-chip {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 7px 14px;
    border: 1.5px solid var(--fam-chip-border, rgba(0, 0, 0, 0.25));
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: none;
    color: var(--fam-dark, #000000);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    line-height: 1.1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

/* A dot that fills in when the set is on, so on/off reads at a glance. */
.region-chips .region-chip::before {
    content: '';
    box-sizing: border-box;
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
}

.region-chips .region-chip:hover {
    transform: scale(1.04);
}

.region-chips .region-chip.active {
    border-color: var(--fam-dark, #000000);
    background: var(--fam-dark, #000000);
    box-shadow: none;
    color: var(--fam-on-dark, #ffffff);
}

.region-chips .region-chip.active::before {
    border-color: var(--fam-accent, #ffffff);
    background: var(--fam-accent, #ffffff);
}

.region-chips .region-chip.locked {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.region-chips .region-chip:focus-visible {
    outline: 2px solid var(--fam-dark, #000000);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .region-chips {
        gap: 5px;
        margin-top: 10px;
    }
    .region-chips .region-chip {
        padding: 6px 11px;
        font-size: 0.98rem;
    }
}

/* Narrow phones: keep all five chips on one row. */
@media (max-width: 420px) {
    .region-chips {
        gap: 4px;
        padding: 0 8px;
    }
    .region-chips .region-chip {
        gap: 5px;
        padding: 6px 8px;
        font-size: 0.92rem;
    }
}

/* Account menu (dailyworld.js toggleMenu): opened by your picture in the header. The same
   white card on every site; the site's own UI font. */
.dw-menu {
    position: fixed;
    z-index: 10000;
    box-sizing: border-box;
    width: min(290px, calc(100vw - 16px));
    padding: 14px;
    border-radius: 16px;
    background: #ffffff;
    color: #101f31;
    box-shadow: 0 0 0 1px rgba(16, 31, 49, 0.08), 0 16px 40px rgba(0, 0, 0, 0.28);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 16px;
    line-height: 1.3;
    text-align: left;
}
.dw-menu-head { display: flex; align-items: center; gap: 12px; }
.dw-menu-pic {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--dw-av, #101f31);
    color: var(--dw-av-fg, #ffffff);
}
.dw-menu-pic img { width: auto; height: auto; max-width: 66%; max-height: 58%; border-radius: 2px; }
.dw-menu-pic .dw-avatar-dot { font-size: 1.15rem; }
/* A player's picture on a game's Party board (DailyWorld.party.avatar). */
.dw-party-pic {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--dw-av, #101f31);
    color: var(--dw-av-fg, #ffffff);
}
.dw-party-pic img { width: auto; height: auto; max-width: 66%; max-height: 58%; border-radius: 2px; }
.dw-party-pic img.dw-logo { width: 60%; height: 60%; max-width: none; max-height: none; border-radius: 0; }
.dw-party-pic .dw-avatar-dot { font-size: 0.85rem; }
.dw-party-pic .dw-avatar-emoji { font-size: 1rem; }
.dw-menu-who { display: flex; flex-direction: column; min-width: 0; }
.dw-menu-who strong { font-size: 17px; font-weight: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-menu-who span { color: #5b6676; font-size: 14px; letter-spacing: 0.04em; }
.dw-menu-streaks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.dw-menu-streaks span {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    border-radius: 12px;
    background: #fff5d1;
    color: #5b6676;
    font-size: 13px;
}
.dw-menu-streaks b { color: #101f31; font-family: var(--fam-font-display, 'Bungee', cursive); font-weight: normal; font-size: 18px; }
.dw-menu-links { display: flex; flex-direction: column; margin-top: 10px; padding-top: 6px; border-top: 1px solid #e2e7ee; }
.dw-menu-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 8px;
    border-radius: 10px;
    color: #101f31;
    text-decoration: none;
}
.dw-menu-links a:hover, .dw-menu-links a:focus-visible { background: #f3f5f9; outline: none; }
/* Friend requests waiting: a gold count (the Daily World sun), like an unread badge (dailyworld.js bubble()). */
.dw-account.dw-has-badge { position: relative; overflow: visible !important; }
.dw-badge, .dw-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f2b400;   /* the Daily World sun */
    color: #101f31;
    font: 600 12px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0;
}
/* On the header picture: just a dot, no number. */
.dw-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 0;
    width: 13px;
    height: 13px;
    padding: 0;
    border: 2px solid #ffffff;
    pointer-events: none;
}
.dw-count { margin-left: auto; }
/* The ring matches the header behind it, like an app icon badge (Chronophoto's navbar is black). */
.navbar .dw-badge { border-color: #000000; }
.dw-menu-tag { padding: 1px 9px; border-radius: 999px; background: #eaeef4; color: #5b6676; font-size: 13px; }
.dw-menu-tag.dw-on { background: #101f31; color: #ffffff; }
.dw-menu-signout {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 9px 8px;
    border: 0;
    border-top: 1px solid #e2e7ee;
    border-radius: 0;
    background: none;
    color: #5b6676;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.dw-menu-signout:hover { color: #101f31; }

/* ── Crowd stats (crowd-tally.js: Click, Name, Flags) ─────── */
.column-item:has(.crowd-pct) { flex-wrap: wrap; }
.column-item .crowd-pct {
    order: 10;
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: 0.78em;
    font-weight: normal;
    opacity: 0.95;
    white-space: nowrap;
    text-align: left;
}
/* The share of players who got it, as a bar (Click, once every country has it: a slightly darker
   part for "with no neighbour on the map yet", its figure on hover). */
.crowd-meter { position: relative; flex: 1 1 auto; max-width: 96px; height: 5px; border-radius: 3px; overflow: hidden; background: rgba(127, 127, 127, 0.28); }
.crowd-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: currentColor; opacity: 0.45; }
.crowd-meter i.is-clean { opacity: 0.2; transition: opacity 0.2s ease; }   /* on top of the bar: only a little darker */
.column-item:hover .crowd-meter i.is-clean { opacity: 0.85; }
.crowd-pct-clean { display: none; }
.column-item:hover .crowd-pct-clean { display: inline; }
.crowd-pct-text { font-variant-numeric: tabular-nums; }

/* game-fx.js: the found counter pops, results cells come in left to right, a flag turns over. */
@media (prefers-reduced-motion: no-preference) {
    .fx-bump { display: inline-block; animation: fx-bump 0.35s ease-out; }
    @keyframes fx-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
    .fx-sweep .column-item { animation: fx-in 0.35s ease-out both; animation-delay: var(--fx-d, 0ms); }
    @keyframes fx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
    .fx-flip { animation: fx-flip 0.5s ease-out; }
    .fx-regrid .flag-item { animation: fx-regrid 0.35s ease-out both; animation-delay: calc(var(--i, 0) * 9ms); }
    @keyframes fx-regrid { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: none; } }
    @keyframes fx-flip { 0% { transform: perspective(400px) rotateY(90deg); } 100% { transform: perspective(400px) rotateY(0); } }
}
.crowd-friends-best { margin: 10px 0 4px; text-align: left; }
.crowd-friends-title { margin: 0 0 6px; font-size: 1rem; }
.crowd-friends-list { list-style: none; margin: 0; padding: 0; }
.crowd-friends-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 2px;
    border-bottom: 1px solid rgba(127, 127, 127, 0.25);
}
.crowd-friends-list li.is-me { font-weight: bold; }
.crowd-friends-list .dw-party-pic { width: 26px; height: 26px; }
.crowd-friends-name { flex: 1; }
.crowd-friends-note { margin: 8px 0; font-size: 0.95rem; opacity: 0.85; }
.crowd-friends-note a { color: inherit; }
.crowd-legend-line {
    margin: 6px 0 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    opacity: 0.8;
    text-align: center;
}

/* ── Party results, friends' scores and the party clock (Draw/Guess The Country) ──
   friends-map.js, party-core.js. Colours come from the site (styles.css :root); the
   defaults are Draw The Country's.
     --pt-card     the results / friends box (not the page's colour)
     --pt-fg, --pt-muted, --pt-line, --pt-soft (your row), --pt-sel (the picked row)
     --pt-strong / --pt-on-strong      Play Again, the total, filled things
     --pt-btn-bg / -fg / -border       Share Results and Friends' Scores (light) …
     --pt-btn-hover-bg / -hover-fg     … go dark on hover; Play Again does the reverse
     --pt-page-btn-*                   Friends' Scores beside Share on a daily (on the page)
     --pt-clock-bg / --pt-clock-fg     the clock and time bar on the map
     --pt-pop-bg / --pt-pop-fg         the hover popup on the map
     --pt-right / --pt-wrong           answers
   Fonts: the site's display font (Bungee) for titles, totals and buttons, and its UI
   font (Jockey One) for everything else. */
.fm-box, .party-results {
    width: 100%;
    max-width: 620px;
    margin: 14px auto 0;
    padding: 18px 18px 16px;
    border-radius: 14px;
    background: var(--pt-card, #f7f7f7);
    color: var(--pt-fg, #111111);
    border: 1px solid var(--pt-line, rgba(0, 0, 0, 0.12));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    text-align: left;
    box-sizing: border-box;
}
.party-results .fm-box { margin: 0; padding: 0; border: none; box-shadow: none; background: none; max-width: none; }
.fm-box[hidden], .party-results[hidden], .party-board[hidden] { display: none; }
.fm-box, .party-results, .fm-box *, .party-results *, .fm-popup .maplibregl-popup-content, .fm-toggle, .demo-tag, .party-toast, .party-clock {
    font-family: var(--font-ui, 'Jockey One', sans-serif);
    letter-spacing: normal;
}
.fm-box h3, .party-results h3, .fm-toggle, .pr-btn, .pr-kicker, .pr-total b, .party-score, .pr-score, .fm-score,
.party-results .party-btn, .pc-time {
    font-family: var(--font-display, 'Bungee', cursive) !important;
    font-weight: normal;
}

/* The end of a party: the total, the rounds, three buttons, then the board. */
.pr-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pr-kicker { font-size: 1.15rem; }
.pr-total { display: flex; align-items: baseline; gap: 6px; padding: 6px 16px; border-radius: 12px; background: var(--pt-strong, #111111); color: var(--pt-on-strong, #ffffff); }
.pr-total b { font-size: 2rem; line-height: 1.1; }
.pr-total small { font-size: 0.95rem; opacity: 0.75; }
.pr-rounds { list-style: none; margin: 14px 0 0; padding: 0; }
.pr-rounds li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--pt-line, rgba(0, 0, 0, 0.1)); }
.pr-rounds li:last-child { border-bottom: none; }
.pr-n { flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--pt-soft, rgba(0, 0, 0, 0.06)); font-size: 0.9rem; }
.pr-place { flex: 1; min-width: 0; font-size: 1.05rem; }
.pr-score { font-size: 1rem; }
.pr-actions { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 10px; margin: 16px 0 4px; }
/* Share Results and Friends' Scores: light, dark on hover. */
.party-results .pr-btn, .party-results .pr-btn.fm-toggle {
    position: relative;
    flex: 1 1 150px;
    max-width: 210px;
    min-height: 52px;
    margin: 0;
    padding: 8px 14px;
    border: 2px solid var(--pt-btn-border, #111111);
    border-radius: 12px;
    background: var(--pt-btn-bg, #ffffff);
    color: var(--pt-btn-fg, #111111);
    font-size: 0.95rem;
    line-height: 1.15;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.party-results .pr-btn:hover:not(.is-empty) {
    background: var(--pt-btn-hover-bg, #111111);
    border-color: var(--pt-btn-hover-bg, #111111);
    color: var(--pt-btn-hover-fg, #ffffff);
    transform: translateY(-2px);
}
/* Play Again, in the middle: the reverse (dark, light on hover), like Chronophoto's. */
.party-results .pr-btn.pr-again {
    flex-grow: 1.25; max-width: 240px; font-size: 1.1rem;
    background: var(--pt-strong, #111111); border-color: var(--pt-strong, #111111); color: var(--pt-on-strong, #ffffff);
}
.party-results .pr-btn.pr-again:hover {
    background: var(--pt-btn-bg, #ffffff); border-color: var(--pt-strong, #111111); color: var(--pt-btn-fg, #111111);
}
.party-results .pr-btn.is-empty { cursor: default; opacity: 0.55; transform: none; }
.pr-btn[hidden] { display: none; }
@media (max-width: 480px) {
    .pr-actions { gap: 8px; }
    .party-results .pr-btn, .party-results .pr-btn.fm-toggle { flex: 1 1 100%; max-width: none; min-height: 48px; }
    .party-results .pr-btn.pr-again { order: -1; max-width: none; }
}

/* Everyone on the code (party-core.js) */
.party-results .party-board { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--pt-line, rgba(0, 0, 0, 0.12)); text-align: left; }
.party-board-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 8px; }
.party-results .party-board-head h3 { margin: 0; font-size: 1.1rem; }
.party-board-sub { color: var(--pt-muted, rgba(0, 0, 0, 0.6)); font-size: 0.95rem; word-break: break-all; }
.party-board-links { margin-left: auto; display: inline-flex; gap: 14px; }
.party-results .party-link, .fm-box .party-link {
    background: none; border: none; padding: 0; margin: 0;
    color: var(--pt-fg, #111111); font-size: 1rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.party-results .party-link:hover { color: var(--pt-link-hover, var(--accent, #ff4a2e)); }
.party-results .party-link:disabled { opacity: 0.5; cursor: wait; }
.party-results .party-note { margin: 8px 0 0; color: var(--pt-muted, rgba(0, 0, 0, 0.6)); }
.party-results .party-btn {
    display: block; margin: 12px auto 0; padding: 10px 20px; border: none; border-radius: 12px;
    background: var(--pt-strong, #111111); color: var(--pt-on-strong, #ffffff); font-size: 1rem; cursor: pointer;
}
.party-results .party-rows { list-style: none; margin: 0; padding: 0; }
.party-results .party-rows li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--pt-line, rgba(0, 0, 0, 0.1)); }
.party-results .party-rows li:last-child { border-bottom: none; }
.party-results .party-rows li.is-me { background: var(--pt-soft, rgba(0, 0, 0, 0.06)); border-radius: 10px; border-bottom-color: transparent; }
.party-results .party-rank { width: 1.6em; text-align: right; color: var(--pt-muted, rgba(0, 0, 0, 0.6)); }
.party-results .party-rows .dw-party-pic { width: 30px; height: 30px; }
.party-results .party-handle { font-size: 0.8em; opacity: 0.65; margin-left: 4px; }
.party-results .party-name { flex: 1; min-width: 0; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-results .party-rel { font-size: 0.9rem; color: var(--pt-muted, rgba(0, 0, 0, 0.6)); }
.party-results .party-score { font-size: 1rem; }
.party-results .party-score small { font-size: 0.75em; opacity: 0.65; }

.party-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10001;
    padding: 10px 18px; border-radius: 999px; background: var(--pt-clock-bg, #111111); color: var(--pt-clock-fg, #ffffff);
    font-size: 1rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); transition: opacity 0.4s ease;
}
.party-toast.is-out { opacity: 0; }

/* The clock on the map, and the time left draining along its top edge (Chronophoto's). */
.party-time-bar {
    position: absolute; top: 0; left: 0; right: 0; height: 8px; z-index: 12;
    background: rgba(128, 128, 128, 0.25); pointer-events: none; overflow: hidden;
}
.party-time-bar[hidden] { display: none; }
.party-time-bar > span {
    display: block; height: 100%; background: var(--pt-clock-bg, #111111);
    transform-origin: left center; transition: transform 0.25s linear, background 0.3s ease;
}
.party-time-bar.pc-low > span { background: #f2a900; }
.party-time-bar.pc-urgent > span { background: #d32f2f; animation: pcBar 1s ease-in-out infinite; }
.party-clock {
    position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 12;
    display: inline-flex; align-items: baseline; gap: 8px;
    padding: 6px 14px; border-radius: 999px;
    background: var(--pt-clock-bg, #111111); color: var(--pt-clock-fg, #ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); white-space: nowrap;
    transition: background 0.3s ease, color 0.3s ease;
    font-size: 1rem;
}
.party-clock[hidden] { display: none; }
.pc-label { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; }
.pc-time { font-size: 1.4rem; line-height: 1; font-variant-numeric: tabular-nums; min-width: 2.4em; text-align: right; }
.party-clock.pc-low { background: #f2a900; color: #101f31; }
.party-clock.pc-urgent { background: #d32f2f; color: #ffffff; animation: pcPulse 1s ease-in-out infinite; }
@keyframes pcPulse { 50% { transform: translateX(-50%) scale(1.08); } }
@keyframes pcBar { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
    .party-clock.pc-urgent, .party-time-bar.pc-urgent > span { animation: none; }
}
@media (max-width: 600px) {
    .party-clock { top: 12px; padding: 4px 11px; gap: 5px; }
    .pc-time { font-size: 1.15rem; }
    .party-time-bar { height: 6px; }
}

/* Friends' Scores beside Share Results on a finished daily: the same size, one line. */
.fm-actions { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 12px; width: 100%; }
.fm-actions > #shareBtn, .fm-actions > #shareResultsBtn, .fm-actions > .fm-toggle {
    flex: 1 1 200px;
    max-width: 280px;
    min-height: 58px;
    margin: 0 !important;
    padding: 10px 16px;
    font-size: 1.25rem;
    line-height: 1.15;
    box-sizing: border-box;
}
.fm-toggle {
    position: relative;
    border: 2px solid var(--pt-page-btn-border, #111111);
    border-radius: var(--radius-btn, 12px);
    background: var(--pt-page-btn-bg, #ffffff);
    color: var(--pt-page-btn-fg, #111111);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.fm-toggle:hover:not(.is-empty) { background: var(--pt-page-btn-border, #111111); color: var(--pt-page-btn-bg, #ffffff); }
/* Greyed by colour, not opacity, so its tip (below) stays solid. */
.fm-toggle.is-empty {
    cursor: default; transform: none;
    color: color-mix(in srgb, var(--pt-page-btn-fg, #111111) 40%, transparent);
    border-color: color-mix(in srgb, var(--pt-page-btn-border, #111111) 35%, transparent);
}
/* The tip opens under the button, solid and on top of what's below, while it shows. */
.fm-toggle.is-empty::after {
    content: attr(data-tip);
    position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%);
    width: max-content; max-width: 240px; padding: 6px 10px; border-radius: 8px;
    background: var(--pt-clock-bg, #111111); color: var(--pt-clock-fg, #ffffff);
    font-family: var(--font-ui, 'Jockey One', sans-serif); font-size: 0.9rem; line-height: 1.3; white-space: normal;
    opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 5;
}
/* Shown on mouse hover, keyboard focus, or for a moment after a tap (friends-map.js tip). */
.fm-toggle.is-empty:focus-visible::after, .fm-toggle.is-empty.tip-show::after { opacity: 1; }
@media (hover: hover) { .fm-toggle.is-empty:hover::after { opacity: 1; } }

/* Friends' Scores on the map (friends-map.js) */
.fm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fm-head h3 { margin: 0; font-size: 1.1rem; }
.fm-close { background: none; border: none; text-decoration: underline; cursor: pointer; color: inherit; padding: 0; font-size: 1rem; }
.fm-sets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.fm-set { border: 1px solid var(--pt-line, rgba(0, 0, 0, 0.2)); background: var(--pt-soft, rgba(0, 0, 0, 0.05)); color: var(--pt-fg, #111111); border-radius: 10px; padding: 5px 12px; font-size: 0.95rem; cursor: pointer; }
.fm-set.active { background: var(--pt-strong, #111111); color: var(--pt-on-strong, #ffffff); border-color: var(--pt-strong, #111111); }
.fm-caption { margin: 10px 0 2px; font-size: 1rem; }
.fm-hint { margin: 2px 0 8px; font-size: 0.9rem; color: var(--pt-muted, rgba(0, 0, 0, 0.6)); }
.fm-scroll { overflow-x: auto; }
.fm-table { width: 100%; border-collapse: collapse; }
.fm-table th, .fm-table td { padding: 7px 6px; border-bottom: 1px solid var(--pt-line, rgba(0, 0, 0, 0.1)); text-align: left; white-space: nowrap; font-size: 1rem; }
.fm-table th { font-size: 0.85rem; color: var(--pt-muted, rgba(0, 0, 0, 0.6)); font-weight: normal; }
.fm-table tbody tr { cursor: pointer; }
.fm-table tbody tr:hover { background: var(--pt-soft, rgba(0, 0, 0, 0.05)); }
.fm-table tbody tr.is-sel { background: var(--pt-sel, rgba(255, 196, 0, 0.25)); }
.fm-player { display: flex; align-items: center; gap: 8px; }
.fm-player .dw-party-pic { width: 26px; height: 26px; }
.fm-swatch { display: inline-block; width: 22px; height: 5px; border-radius: 3px; box-shadow: 0 0 0 1px var(--pt-line, rgba(0, 0, 0, 0.12)); }
.fm-table td.is-right { color: var(--pt-right, #1e8e4e); }
.fm-table td.is-wrong { color: var(--pt-wrong, #c0392b); }
.fm-popup .maplibregl-popup-content { padding: 6px 10px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); background: var(--pt-pop-bg, #ffffff); }
.fm-popup .maplibregl-popup-tip { border-top-color: var(--pt-pop-bg, #ffffff); border-bottom-color: var(--pt-pop-bg, #ffffff); }
.fm-pop { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; color: var(--pt-pop-fg, #111111); }
.fm-pop .dw-party-pic { width: 24px; height: 24px; }

/* The picked player's answers (Guess The Country). */
.fm-detail { margin: 6px 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--pt-soft, rgba(0, 0, 0, 0.05)); }
.fm-detail[hidden] { display: none; }
.fm-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fm-detail-head .dw-party-pic { width: 24px; height: 24px; }
.fm-detail-head b { font-weight: normal; font-size: 1.05rem; }
.fm-detail-round { margin: 10px 0 2px; font-size: 0.95rem; color: var(--pt-muted, rgba(0, 0, 0, 0.6)); }
.fm-answers { list-style: none; margin: 0; padding: 0; }
.fm-answers li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--pt-line, rgba(0, 0, 0, 0.06)); }
.fm-answers li:last-child { border-bottom: none; }
.fm-answers li span { color: var(--pt-muted, rgba(0, 0, 0, 0.6)); }
.fm-answers b { font-weight: normal; text-align: right; }
.fm-answers b.is-right { color: var(--pt-right, #1e8e4e); }
.fm-answers b.is-wrong { color: var(--pt-wrong, #c0392b); }
.fm-real-ans { color: var(--pt-muted, #555555); }

/* ---- Settings inside the controls box (quiz-layout.js; desktop, Click / Name / Flags) ----
   One dark panel: Allow Skips and Stats as two equal tiles, then Regions and continents as
   grids of toggle tiles (off = dark outline, on = tinted with the game's accent). */
body.chips-in-controls .left-panel .controls-container { display: flex; flex-direction: column; }
body.chips-in-controls .controls-container > :nth-last-child(2) { margin-bottom: 16px; }
body.chips-in-controls .controls-settings {
    display: flex; flex-direction: column; gap: 14px;
    margin-top: auto; padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
body.chips-in-controls .settings-group { display: flex; flex-direction: column; gap: 8px; }
body.chips-in-controls .settings-label {
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif);
    font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
}
body.chips-in-controls .controls-settings .region-chips { margin: 0; padding: 0; }
body.chips-in-controls .controls-settings .chip-divider { display: none; }

/* Allow Skips and Stats: the same size, side by side (Stats alone fills the row). */
body.chips-in-controls .controls-settings .settings-options.region-chips {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
body.chips-in-controls .controls-settings .settings-options > :only-child { grid-column: 1 / -1; }
body.chips-in-controls .controls-settings .settings-options .skip-chip,
body.chips-in-controls .controls-settings .settings-options .skip-chip:has(input:checked),
body.chips-in-controls .controls-settings .settings-options .stats-chip {
    box-sizing: border-box; width: 100%; height: 46px; margin: 0;
    justify-content: center; gap: 10px; padding: 0 14px;
    border-radius: 12px; font-size: 1.1rem; box-shadow: none;
}
body.chips-in-controls .controls-settings .settings-options .skip-chip,
body.chips-in-controls .controls-settings .settings-options .skip-chip:has(input:checked) {
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: #eef6f8;
}
body.chips-in-controls .controls-settings .settings-options .skip-chip:hover { background: rgba(255, 255, 255, 0.12); }
/* The switch: a track with its knob drawn in (slides when on). */
body.chips-in-controls .controls-settings .settings-options .skip-chip::before,
body.chips-in-controls .controls-settings .settings-options .skip-chip:has(input:checked)::before {
    width: 40px; height: 22px; border: 0; border-radius: 999px;
    background: radial-gradient(circle, #ffffff 0 7.5px, transparent 8px) no-repeat, rgba(255, 255, 255, 0.25);
    background-size: 22px 22px, auto;
    background-position: 0 50%, 0 0;
    transition: background-position .2s ease, background-color .2s ease;
}
body.chips-in-controls .controls-settings .settings-options .skip-chip:has(input:checked)::before {
    background: radial-gradient(circle, #ffffff 0 7.5px, transparent 8px) no-repeat, var(--fam-accent, #409b92);
    background-size: 22px 22px, auto;
    background-position: 18px 50%, 0 0;
}
body.chips-in-controls .controls-settings .settings-options .skip-chip::after { content: none; }
body.chips-in-controls .controls-settings .settings-options .stats-chip { border-width: 1.5px; }

/* Regions and continents: grids of toggle tiles. */
body.chips-in-controls .controls-settings .settings-regions .region-chips {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
}
body.chips-in-controls .controls-settings .region-chip {
    justify-content: center; padding: 8px 6px; border-radius: 10px; font-size: 1rem;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(238, 246, 248, 0.85);
}
/* Continents: a sub-set of World, so they look lighter (round pills under their own label),
   and with World off they stay in place but greyed out (the game sets [hidden] on the row). */
/* The "Continents · All" row that opens them (folded away at first). */
body.chips-in-controls .controls-settings .continents-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%; margin: 2px 0 0; padding: 7px 10px;
    border: 1px dashed rgba(255, 255, 255, 0.22); border-radius: 10px; background: transparent;
    color: rgba(238, 246, 248, 0.85); cursor: pointer;
    font-family: var(--fam-font-ui, 'Jockey One', sans-serif); font-size: 0.95rem; text-align: left;
    transition: background .2s ease, border-color .2s ease;
}
body.chips-in-controls .controls-settings .continents-toggle:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.35); }
body.chips-in-controls .controls-settings .continents-toggle .continents-sum { margin-left: auto; color: var(--fam-accent, #409b92); }
body.chips-in-controls .controls-settings .continents-toggle::after {
    content: ''; width: 7px; height: 7px; margin: 0 2px 3px 4px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .2s ease;
}
body.chips-in-controls .controls-settings .continents-open .continents-toggle::after { transform: rotate(-135deg); margin-bottom: -3px; }
body.chips-in-controls .controls-settings .continents-toggle:disabled { opacity: 0.4; cursor: default; }
body.chips-in-controls .controls-settings .continents-toggle:disabled .continents-sum { color: inherit; }
/* The fold: closed = no height, open = the chips' height, eased both ways (the box, the map
   beside it and the table or flag grid below follow along). Hidden from tabbing while closed. */
/* Opening: the room opens first (quick), then the chips fade in, so they're never seen
   cut off. Closing: the chips fade out first, then the room closes. */
body.chips-in-controls .controls-settings .continents-fold {
    display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; margin-top: -8px;
    transition: opacity .12s ease, grid-template-rows .22s ease .08s, margin-top .22s ease .08s, visibility 0s linear .3s;
}
body.chips-in-controls .controls-settings .continents-fold > .continent-chips { min-height: 0; overflow: hidden; margin: 0; padding-top: 2px; }
body.chips-in-controls .controls-settings .continents-open .continents-fold {
    grid-template-rows: 1fr; opacity: 1; visibility: visible; margin-top: 0;
    transition: grid-template-rows .2s ease-out, margin-top .2s ease-out, opacity .22s ease .16s, visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
    body.chips-in-controls .controls-settings .continents-fold { transition: none; }
}
body.chips-in-controls .controls-settings .continent-chips .region-chip,
body.chips-in-controls .controls-settings .continent-chips .region-chip.active {
    padding: 5px 4px; font-size: 0.85rem; border-radius: 999px; border-width: 1px;
}
body.chips-in-controls .controls-settings .continent-chips .region-chip.active {
    border-color: color-mix(in srgb, var(--fam-accent, #409b92) 60%, transparent);
    background: color-mix(in srgb, var(--fam-accent, #409b92) 14%, transparent);
}
body.chips-in-controls .controls-settings .continent-chips[hidden] { display: grid !important; opacity: 0.32; pointer-events: none; }
body.chips-in-controls .controls-settings .region-chip:hover { background: rgba(255, 255, 255, 0.1); transform: none; }
body.chips-in-controls .controls-settings .region-chip.active {
    border-color: var(--fam-accent, #409b92);
    background: color-mix(in srgb, var(--fam-accent, #409b92) 28%, transparent);
    color: #ffffff;
}
body.chips-in-controls .controls-settings .region-chip.active::before {
    border-color: var(--fam-accent, #409b92);
    background: var(--fam-accent, #409b92);
}
body.chips-in-controls .controls-settings .region-chip:focus-visible { outline-color: #ffffff; }

/* ---- A livelier timer (game-fx.js liveTimer; Click / Name / Flags) ----
   While it runs: a softly blinking red dot by TIME and an accent edge on its box (both fade in
   and out); each second the digits glow gently and settle, and each new minute they swell a
   little in the accent colour. Every animation starts and ends at rest, so nothing jumps. */
.game-stat { transition: box-shadow .5s ease; }
.game-stat .game-stat-label::before {
    content: ''; display: inline-block; width: 0; height: 7px; margin: 0 0 1px 0; border-radius: 50%;
    background: #ff5a52; vertical-align: middle; opacity: 0;
    transition: width .4s ease, margin .4s ease, opacity .4s ease;
}
.game-stat.is-live { box-shadow: inset 0 0 0 1.5px var(--fam-accent, #409b92); }
.game-stat.is-live .game-stat-label::before { width: 7px; margin-right: 6px; opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
    .game-stat.is-live .game-stat-label::before { animation: fx-live 1.6s ease-in-out infinite; }
    @keyframes fx-live { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
    #timer.fx-tick, #timer.fx-minute { display: inline-block; }
    #timer.fx-tick { animation: fx-tick 0.9s ease-in-out; }
    @keyframes fx-tick { 0%, 100% { text-shadow: 0 0 0 transparent; } 30% { text-shadow: 0 0 10px color-mix(in srgb, var(--fam-accent, #409b92) 70%, transparent); } }
    #timer.fx-minute { animation: fx-minute 1.2s cubic-bezier(.3, .7, .3, 1); }
    @keyframes fx-minute {
        0%, 100% { transform: scale(1); text-shadow: 0 0 0 transparent; }
        35% { transform: scale(1.12); color: var(--fam-accent, #409b92); text-shadow: 0 0 14px color-mix(in srgb, var(--fam-accent, #409b92) 80%, transparent); }
    }
}

/* ---- Things that appear in the controls box (Click / Name / Flags): Give Up / Skip / New Game,
   Share Results, Click's "find this country" prompt and Name The Flags' flag fade and settle in
   whenever the game shows them, instead of popping in. ---- */
@media (prefers-reduced-motion: no-preference) {
    .game-area .controls-container .game-btn,
    .game-area .controls-container .share-result-btn,
    .game-area .controls-container .region-prompt,
    .game-area .controls-container .flag-display .flag-image { animation: fx-appear 0.3s ease-out; }
    @keyframes fx-appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* ---- Map colours (Click / Name / Flags: quiz-layout.js paints the style's water and land from
   each site's --map-water / --map-land in its styles.css) ---- */
/* Every map box shows its map's water colour while the map loads, so nothing flashes a
   different colour first. Each site sets --map-water to the water of the style its map loads
   (or the colour quiz-layout.js paints); a site without it keeps its own background. */
#map { background-color: var(--map-water, transparent); }
