/*
 * doxapolls.com — the public website, in the app's visual language.
 *
 * Tokens are frontend/src/constants/theme.js (lightTheme / darkTheme); each
 * component block names the React Native component it mirrors, so a change in
 * the app has an obvious counterpart here. The app lets people pick a theme;
 * the website follows the system setting.
 */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/public/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
        U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+221E, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/public/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F,
        U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/public/fonts/ibm-plex-mono-medium.woff2') format('woff2');
}

/* ---- tokens ------------------------------------------------------------ */

:root {
    color-scheme: light dark;

    --background: #F5EFE5;
    --surface: #F9E4C8;
    --surface-elevated: #FFFFFF;
    --card: #FFFFFF;
    --card-background: #FFFFFF;
    --text: #000000;
    --text-secondary: #5A5A5A;
    --text-tertiary: #8A8A8A;
    --text-inverse: #FEFBF7;
    --primary: #232932;
    --border: #E8D4B0;
    --border-light: #F2E8D8;
    --error: #DC3545;
    --shadow: rgba(35, 41, 50, 0.15);
    /* theme.primary + '12' / '20' / '30' (hex alpha) */
    --primary-07: #23293212;
    --primary-12: #23293220;
    --primary-19: #23293230;

    /* the globe (website only): countries as white shapes on a beige ocean,
       borders as thin ocean-coloured gaps, countries with polls in tan */
    --globe-ocean: #E8D4B0;
    --globe-land: #FFFFFF;
    --globe-border: #E8D4B0;
    --globe-grid: #FFFFFF73;
    --globe-has: #D4A574;
    --globe-active: #232932;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #1A1D23;
        --surface: #232932;
        --surface-elevated: #2D3340;
        --card: #282E38;
        --card-background: rgba(35, 41, 50, 0.8);
        --text: #F9E4C8;
        --text-secondary: #C4B5A0;
        --text-tertiary: #8A8A8A;
        --text-inverse: #232932;
        --primary: #F9E4C8;
        --border: #3A4050;
        --border-light: #2D3340;
        --error: #FF5555;
        --shadow: rgba(0, 0, 0, 0.3);
        --primary-07: #F9E4C812;
        --primary-12: #F9E4C820;
        --primary-19: #F9E4C830;
        --globe-ocean: #232932;
        --globe-land: #3A4050;
        --globe-border: #232932;
        --globe-grid: #3A405080;
        --globe-has: #B8956A;
        --globe-active: #F9E4C8;
    }
}

/* ---- base -------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.4;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.mono { font-family: var(--font-mono); font-weight: 500; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Ionicons, from the page's inline sprite */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; display: inline-block; vertical-align: middle; }

.page {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px 40px;
}
.page.wide { max-width: 1200px; }

/* ---- header (HomeScreen header) ---------------------------------------- */

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 10px;
}
/* The wordmark PNG is used as a mask so it takes the theme's primary color,
   the way the app sets tintColor on it. */
.logo {
    display: block;
    width: 107px;
    height: 32px;
    background: var(--primary);
    -webkit-mask: url('/public/images/logo_name_500.png') left center / contain no-repeat;
    mask: url('/public/images/logo_name_500.png') left center / contain no-repeat;
}
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    color: var(--text);
}
.icon-button:hover { background: var(--primary-07); }
.get-app {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: var(--text-inverse);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
}
.get-app .i { font-size: 16px; }
.get-app:hover { opacity: 0.9; }

/* Dropdown menus (the header's "Get the app"), in the look of the app's
   FlockMenuButton menu. <details> does the opening; js/menus.js closes it on
   an outside click or Escape. */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    padding: 4px 0;
    border-radius: 16px;
    background: var(--surface-elevated);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
    transform-origin: top right;
    animation: menu-in 0.18s cubic-bezier(0.33, 1, 0.68, 1);
}
.dropdown-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.dropdown-row + .dropdown-row { box-shadow: inset 0 0.5px 0 var(--border); }
.dropdown-row:hover { background: var(--primary-07); }
.dropdown-icon { font-size: 22px; }
.dropdown-text { display: flex; flex-direction: column; }
.dropdown-title { font-size: 15px; font-weight: 600; }
.dropdown-sub { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
@keyframes menu-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }

/* ---- intro (website only) ---------------------------------------------- */

.intro { padding: 18px 0 16px; }
.intro h1 {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.intro p { font-size: 15px; color: var(--text-secondary); max-width: 440px; }

/* ---- SegmentedControl ---------------------------------------------------- */

.seg {
    display: flex;
    background: var(--surface);
    border-radius: 999px;
    padding: 3px;
}
.seg-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.seg-item .i { font-size: 15px; margin-top: -1px; }
.seg-item.active {
    background: var(--surface-elevated);
    color: var(--text);
    font-weight: 700;
    box-shadow: 0 1px 3px var(--shadow);
}
.seg-item:not(.active):hover { color: var(--text); }
.seg.full .seg-item { flex: 1; }

/* 'prominent' — the app's For You | Explore switch; on the web it is the
   Country | Continent | World switch, and its compact form the Live | Ended
   and sort rows under it */
.seg.prominent { border: 1px solid var(--border); padding: 4px; }
.seg.prominent .seg-item { padding: 9px 16px; font-size: 15px; letter-spacing: 0.2px; }
.seg.prominent .seg-item .i { font-size: 17px; }
.seg.prominent .seg-item.active {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 3px 6px var(--primary-19);
}
.seg.prominent.compact { padding: 3px; }
.seg.prominent.compact .seg-item { padding: 5px 12px; font-size: 13px; }
.seg.prominent.compact .seg-item .i { font-size: 14px; }

/* ---- the feed's controls (website only; the app keeps these in a menu) ---------- */

.where {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin: 12px 0 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.where .i { font-size: 13px; margin-top: 1px; }
.where a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Country | Continent | World — the app's prominent SegmentedControl */
/* Segments size to their names, so "United States | North America | World"
   fits a phone without cutting the long ones. */
.seg.full.scope-switch .seg-item { min-width: 0; flex: 1 1 auto; }
.scope-switch .seg-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-flag {
    flex-shrink: 0;
    width: 21px;
    height: 14px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.seg-continent { flex-shrink: 0; width: 20px; height: 18px; }
.continent {
    display: block;
    background: currentColor;
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}
.continent.africa { -webkit-mask-image: url('/public/images/continents/africa.svg'); mask-image: url('/public/images/continents/africa.svg'); }
.continent.asia { -webkit-mask-image: url('/public/images/continents/asia.svg'); mask-image: url('/public/images/continents/asia.svg'); }
.continent.europe { -webkit-mask-image: url('/public/images/continents/europe.svg'); mask-image: url('/public/images/continents/europe.svg'); }
.continent.north-america { -webkit-mask-image: url('/public/images/continents/north-america.svg'); mask-image: url('/public/images/continents/north-america.svg'); }
.continent.south-america { -webkit-mask-image: url('/public/images/continents/south-america.svg'); mask-image: url('/public/images/continents/south-america.svg'); }
.continent.oceania { -webkit-mask-image: url('/public/images/continents/oceania.svg'); mask-image: url('/public/images/continents/oceania.svg'); }

.feed-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

/* ---- PollRender ------------------------------------------------------------ */

.poll-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
}
a.poll-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.poll-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px var(--shadow); }

.poll-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.poll-meta .i { font-size: 12px; margin-right: 2px; }
.poll-meta .dot { white-space: pre; }

.poll-question {
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}
h1.poll-question { font-size: 20px; line-height: 26px; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--border-light);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}
.status .i { font-size: 14px; color: var(--primary); }
.status.final { background: var(--primary-07); border-color: var(--primary-19); color: var(--primary); }
.status .final-meta { font-weight: 600; color: var(--text-secondary); }
.tag {
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--primary-12);
    border: 1px solid var(--primary);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.options { display: flex; flex-direction: column; gap: 8px; }
.option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
}
.option-fill { position: absolute; inset: 0 auto 0 0; background: var(--border); }
.option > :not(.option-fill) { position: relative; }
.option-text { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.option-pct { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.option-pct .sign { font-family: var(--font); font-weight: 700; }
.options.closed .option { border-color: transparent; }
.option.winner .option-fill { background: var(--primary-19); }
.option.winner .option-text { font-weight: 700; }
.option .trophy { font-size: 14px; color: var(--primary); }

.poll-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.poll-stats { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.poll-stats strong { font-family: var(--font-mono); font-weight: 500; color: var(--text); }
.poll-stats .sep { color: var(--border); font-weight: 300; }
.poll-stats .comments { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); }
.poll-stats .comments .i { font-size: 14px; }
.open-hint { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

/* ---- PollDetailsScreen ------------------------------------------------------ */

.detail-header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px 0 16px;
    min-height: 56px;
}
.detail-header .icon-button { position: relative; z-index: 1; margin-left: -8px; }
.detail-location {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 56px 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    pointer-events: none;
}
.detail-location .i { font-size: 14px; }
.info-box {
    background: var(--surface);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.info-box.row { display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ---- PollStatistics ------------------------------------------------------------ */

.stats {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 8px;
}
.stats-divider { height: 1px; background: var(--border); margin: 14px 0; }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: flex-start; }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; margin: 5px 8px 0 0; flex-shrink: 0; }
.legend-name { flex: 1; font-size: 14px; font-weight: 700; line-height: 20px; margin-right: 8px; overflow-wrap: anywhere; }
.legend-pct { font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--text-secondary); }
.legend-pct .sign, .seg-label .sign { font-family: var(--font); }
.stats-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.stat-rows { display: flex; flex-direction: column; gap: 6px; }
.stat-row { display: flex; align-items: center; }
.stat-label { width: 64px; margin-right: 10px; text-align: right; font-size: 13px; flex-shrink: 0; }
.stat-bar {
    flex: 1;
    display: flex;
    height: 18px;
    margin: 2px 0;
    border-radius: 9px;
    overflow: hidden;
    background: var(--border-light);
}
.stat-seg { display: grid; place-items: center; height: 100%; overflow: hidden; }
.seg-label { font-family: var(--font-mono); font-size: 10px; color: #FFFFFF; }
.stat-count { width: 32px; margin-left: 10px; text-align: right; font-family: var(--font-mono); font-size: 14px; flex-shrink: 0; }
.stat-row.is-empty .stat-label, .stat-row.is-empty .stat-count { color: var(--text-tertiary); }
.stat-row.is-empty .stat-bar { background: none; border: 1px dashed var(--border-light); }

/* ---- Comments (the section's frame; the comments themselves are app-only) ---- */

.comments-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}
.comments-title { font-size: 18px; font-weight: 600; color: var(--primary); }
.comments-app-only { text-align: center; padding: 24px 12px 12px; }
.comments-icon { font-size: 48px; color: var(--text-secondary); }
.comments-text { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-top: 12px; }
.comments-sub { font-size: 14px; color: var(--text-tertiary); margin: 4px auto 0; max-width: 360px; }

/* ---- call to action (website only) -------------------------------------------- */

.cta {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px 20px;
    margin: 16px 0 8px;
    text-align: center;
}
.cta-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.cta-text { font-size: 14px; color: var(--text-secondary); margin: 0 auto 16px; max-width: 400px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 14px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.button:hover { opacity: 0.9; }
.cta .store-badges { margin-top: 16px; }

/* ---- "Open in Doxa", per device (website only; js/open-app.js sets data-platform) ---- */

.handoff { margin-top: 4px; }
.handoff-ios, .handoff-android { display: none; }
.handoff[data-platform="ios"] .handoff-ios,
.handoff[data-platform="android"] .handoff-android { display: block; }
.handoff[data-platform="ios"] .handoff-desktop,
.handoff[data-platform="android"] .handoff-desktop { display: none; }
.handoff .button .i { font-size: 18px; }
.handoff-secondary {
    display: block;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.handoff-secondary:hover { color: var(--text); }
.handoff-note { margin: 10px auto 0; font-size: 13px; color: var(--text-secondary); max-width: 320px; }
/* The QR code stays black on white in both themes: not every scanner reads an inverted one. */
.handoff-qr {
    display: inline-block;
    padding: 12px;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 2px 8px var(--shadow);
}
.handoff-qr .qr { display: block; width: 148px; height: 148px; }
.handoff .store-badges { margin-top: 14px; }

/* ---- SearchScreen / SearchBar ------------------------------------------------------ */

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-background);
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 6px 6px 6px 12px;
    margin-bottom: 12px;
}
.search-form:focus-within { border-color: var(--primary); }
.search-form > .i { font-size: 20px; color: var(--text-secondary); }
.search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    outline: none;
    font-size: 15px;
    padding: 6px 0;
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-input::-webkit-search-cancel-button { filter: grayscale(1); }
.search-submit { padding: 8px 14px; border-radius: 10px; font-size: 14px; }
.search-modes { margin-bottom: 16px; }
.results-header { font-size: 16px; font-weight: 600; padding-bottom: 16px; }

/* ---- empty states --------------------------------------------------------------- */

.empty { text-align: center; padding: 48px 20px 16px; }
.empty-icon { font-size: 80px; color: var(--text-tertiary); }
.empty-title { font-size: 24px; font-weight: 700; margin: 16px 0 8px; }
.empty-sub { font-size: 16px; color: var(--text-secondary); max-width: 420px; margin: 0 auto; }
.empty-sub strong { color: var(--text); }
.empty .button { margin-top: 24px; }
.feed-empty { font-size: 18px; color: var(--text-secondary); text-align: center; margin: 40px 0; }
.tips {
    margin: 32px auto 0;
    background: var(--card-background);
    border-radius: 16px;
    padding: 20px;
    text-align: left;
    max-width: 440px;
}
.tips-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.tip { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.tip:last-child { margin-bottom: 0; }
.tip .i { font-size: 16px; color: var(--primary); }
.invite-code-label { margin-top: 22px; font-size: 13px; color: var(--text-secondary); }
.invite-code {
    display: inline-block;
    margin-top: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 22px;
    letter-spacing: 2px;
}

/* ---- home page: the map beside the feed (website only) ---------------------------- */

.explore { display: grid; gap: 8px 40px; }
.explore-map { min-width: 0; }
.explore-feed { min-width: 0; transition: opacity 0.15s ease; }
.explore-feed.loading { opacity: 0.5; pointer-events: none; }
.explore-feed h1:focus { outline: none; }

@media (min-width: 960px) {
    .explore { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); align-items: start; }
    /* The map stays put while the feed scrolls. */
    .explore-map {
        position: sticky;
        top: 16px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        padding-top: 18px;
        scrollbar-width: thin;
    }
}
@media (max-width: 959px) {
    .page.wide { max-width: 600px; }
    .explore-map { padding-top: 8px; }
}

.globe {
    position: relative;
    width: 100%;
    max-width: min(560px, calc(100vh - 240px));
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 28px;
    overflow: hidden;
}
@media (max-width: 959px) {
    .globe { max-width: 320px; }
}
.globe-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.globe-canvas.pickable { cursor: pointer; }
.globe-canvas.dragging { cursor: grabbing; }
.globe-canvas:focus-visible { outline-offset: -2px; border-radius: 28px; }
@media (max-width: 959px) {
    /* A vertical swipe over the globe scrolls the page on a phone; a
       sideways one turns the globe. */
    .globe-canvas { touch-action: pan-y; }
}
.globe-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 40px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}
.globe.ready .globe-fallback { display: none; }
.globe:not(.ready) .globe-zoom { display: none; }
.globe-tip {
    position: absolute;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--surface-elevated);
    box-shadow: 0 4px 12px var(--shadow);
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 14px));
}
.globe-tip[hidden] { display: none; } /* display:flex above would otherwise win over [hidden] */
.globe-tip strong { font-weight: 700; }
.globe-tip span { font-size: 11px; font-weight: 500; color: var(--text-secondary); }
.globe-zoom { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.globe-zoom button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--surface-elevated);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}
.globe-zoom button:hover { background: var(--card); }
.globe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 18px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--globe-has); }


/* ---- footer ---------------------------------------------------------------------- */

.footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.store-badge { display: block; transition: transform 0.15s ease, opacity 0.15s ease; }
.store-badge:hover { transform: translateY(-1px); opacity: 0.85; }
.store-badge img { display: block; height: 44px; width: auto; }
.store-badge.play img { height: 64px; margin: -10px 0; }
.fine-print { font-size: 12px; color: var(--text-tertiary); }
.fine-print a { text-decoration: underline; text-underline-offset: 2px; }
.fine-print a:hover { color: var(--text-secondary); }

@media (max-width: 420px) {
    .page { padding: 0 16px 32px; }
    .intro h1 { font-size: 26px; }
    .scope-switch.seg.prominent .seg-item { padding: 9px 6px; gap: 5px; font-size: 13.5px; letter-spacing: 0; }
}

/* The narrowest phones: the header's app button keeps only its icon, and the
   scope switch drops the icons of the segments that aren't selected. */
@media (max-width: 360px) {
    .scope-switch .seg-item:not(.active) .seg-flag,
    .scope-switch .seg-item:not(.active) .seg-continent,
    .scope-switch .seg-item:not(.active) .i { display: none; }
    .scope-switch.seg.prominent .seg-item { padding: 8px 5px; font-size: 12px; }
    .get-app { padding: 8px 10px; }
    .get-app span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
