/* ============================================================================
   flagpole.css  —  🚩 The Flagpole (guess-the-flag quiz) styling (.flg-*)
   A morning flagpole; a flag climbs and locks on a country. Self-contained.
   The RISE is a translateY transition on `.flg-lift`; the WAVE is a smooth CSS
   transform flutter on the inner `.flg-flag` (no displacement filter → no
   pixelation), so both run together cleanly.
   ============================================================================ */
.flg-stage { position: relative; }
.flg-scene { position: relative; height: 340px; overflow: hidden; border-radius: 18px;
    background: linear-gradient(180deg, #8dbde6 0%, #c3ddef 42%, #f6dcac 80%, #faecd2 100%); }
.flg-sun { position: absolute; right: 19%; bottom: 74px; width: 66px; height: 66px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle at 50% 50%, #fff7de, #ffda8b 58%, rgba(255,218,139,0) 72%); box-shadow: 0 0 54px 28px rgba(255,226,164,.55); }
.flg-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; border-radius: 50% 50% 0 0/24px 24px 0 0;
    background: linear-gradient(180deg, #9ed07d, #6aa855); box-shadow: 0 -3px 10px rgba(80,120,50,.2); }
.flg-pole { position: absolute; left: 34%; top: 24px; bottom: 38px; width: 9px; border-radius: 5px; z-index: 2;
    background: linear-gradient(90deg, #9aa4b3, #cfd6e0 45%, #fff 52%, #cfd6e0 60%, #9aa4b3); box-shadow: 0 3px 6px rgba(0,0,0,.22); }
.flg-finial { position: absolute; left: calc(34% - 5px); top: 10px; width: 20px; height: 20px; border-radius: 50%; z-index: 3;
    background: radial-gradient(circle at 38% 34%, #fbe6a8, #e2ac47 60%, #a9781f); box-shadow: 0 2px 5px rgba(0,0,0,.3); }

/* the RISE: a wrapper that climbs the pole */
.flg-lift { position: absolute; left: calc(34% + 5px); top: 28px; width: 122px; height: 82px; z-index: 2;
    transform: translateY(210px); opacity: 0; transition: transform 3.1s cubic-bezier(.16,.62,.24,1), opacity .4s ease; }
.flg-lift.flg-up { transform: translateY(0); opacity: 1; }
/* the WAVE: a smooth cloth flutter on the inner flag (hoist fixed on the left) */
.flg-flag { width: 100%; height: 100%; transform-origin: left center; filter: drop-shadow(2px 5px 5px rgba(0,0,0,.28));
    animation: flgWave 3.2s ease-in-out infinite; }
.flg-flag img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; border: 1px solid rgba(0,0,0,.12); }
@keyframes flgWave {
    0%   { transform: perspective(560px) rotateY(0deg)  skewY(0.6deg); }
    28%  { transform: perspective(560px) rotateY(-12deg) skewY(2deg); }
    52%  { transform: perspective(560px) rotateY(5deg)  skewY(-1.4deg); }
    76%  { transform: perspective(560px) rotateY(-5deg) skewY(1deg); }
    100% { transform: perspective(560px) rotateY(0deg)  skewY(0.6deg); }
}
@media (prefers-reduced-motion: reduce) { .flg-lift { transition: none; } .flg-flag { animation: none; } }
.flg-status { position: absolute; left: 0; right: 0; bottom: 54px; text-align: center; color: #5b5236; font-size: 13px; font-weight: 700; min-height: 16px; text-shadow: 0 1px 0 rgba(255,255,255,.4); }

/* the country card that overlays the scene on reveal (in addition to the bottom bar) */
.flg-card { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%) translateY(12px); width: min(360px, calc(100% - 28px)); z-index: 4;
    display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(20,40,70,.1);
    background: rgba(255,255,255,.97); box-shadow: 0 14px 32px -12px rgba(20,40,70,.55); opacity: 0; transition: opacity .4s ease, transform .4s ease; }
.flg-card.flg-card-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.flg-card-flag { width: 66px; height: 44px; flex: none; object-fit: cover; border-radius: 4px; border: 1px solid rgba(0,0,0,.12); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.flg-card-body { min-width: 0; }
.flg-card-cont { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--flg-accent, #1d4e89); }
.flg-card-name { display: block; font-size: 19px; font-weight: 850; color: #1c2434; line-height: 1.08; }
.flg-card-cap { display: block; font-size: 12.5px; color: #5b6470; margin-top: 1px; }
.flg-card-fact { display: block; font-size: 12px; color: #5b6470; margin-top: 5px; line-height: 1.42; }

/* region chips */
.flg-regions-wrap { text-align: center; }
.flg-regions-lbl { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--theme-muted, #6b7280); margin: 0 0 8px; }
.flg-regions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin: 0 auto 16px; }
.flg-region { cursor: pointer; font-size: 13.5px; font-weight: 650; padding: 7px 14px; border-radius: 11px;
    background: var(--theme-surface, #fff); color: var(--theme-text, #1a1a2e); border: 1.5px solid var(--theme-border, #dfe4ee); transition: transform .12s, border-color .15s, background .15s, box-shadow .15s; }
.flg-region:hover { transform: translateY(-2px); border-color: var(--flg-accent, #1d4e89); }
.flg-region.is-on { background: var(--flg-accent, #1d4e89); border-color: var(--flg-accent, #1d4e89); color: #fff; box-shadow: 0 7px 18px -6px var(--flg-accent, #1d4e89); }

.flg-pickbtn-wrap { text-align: center; }
.flg-pickbtn-main { display: inline-flex; align-items: center; gap: 8px; margin: 16px auto 0; font-size: 15px; font-weight: 800; color: #fff;
    padding: 13px 34px; border-radius: 14px; border: 0; cursor: pointer; letter-spacing: .3px;
    background: linear-gradient(135deg, var(--flg-grad-a, #2a6bb5), var(--flg-grad-b, #123a6b));
    box-shadow: 0 12px 24px -8px var(--flg-accent, #1d4e89), inset 0 1px 0 rgba(255,255,255,.2); transition: transform .12s ease, filter .15s; }
.flg-pickbtn-main:hover { transform: translateY(-2px); filter: brightness(1.05); }
.flg-pickbtn-main:disabled, .flg-pickbtn-main.is-busy { opacity: .6; cursor: default; transform: none; filter: grayscale(.2); }

.flg-effects { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; font-size: 13px; color: var(--theme-text, #1a1a2e); justify-content: center; }
.flg-effects label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.flg-modal-flag { width: 120px; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); box-shadow: 0 3px 8px rgba(0,0,0,.2); }

.page-flg-scope {
    --wsp-result-accent: var(--flg-accent, #1d4e89);
    --wsp-result-grad: linear-gradient(135deg, var(--flg-grad-a, #2a6bb5), var(--flg-grad-b, #123a6b));
    --wsp-result-plate: #fff;
}
/* the flag reads best on a plain white plate */
.page-flg-scope .wsp-result-art { object-fit: cover; padding: 3px; }

/* ── SEO content (.flg-content) — type scale from .content-guide; colour only ── */
.flg-content { color: var(--theme-text, #1a1a2e); background: var(--theme-bg, #fff); padding: 3.25rem 0 3.5rem; margin-top: 1rem; border-top: 1px solid var(--theme-border, #e9ecef); }
.flg-inner { max-width: 860px; margin: 0 auto; padding: 0 1rem; }
.flg-content h2, .flg-content h3 { color: var(--theme-text, #1a1a2e); }
.flg-content p, .flg-content li { color: var(--theme-muted, #5b6470); }
.flg-content strong { color: var(--theme-text, #1a1a2e); }
.flg-content a { color: #1a4d8a; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.flg-kicker-chip { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, #2a6bb5, #123a6b); border-radius: 999px; padding: .3rem .85rem; margin-bottom: .95rem; }
.flg-content .flg-lead { font-size: 1.2rem; line-height: 1.7; color: var(--theme-text, #1a1a2e); margin-bottom: 1.25rem; }
.flg-section { margin-top: 2.9rem; }
.flg-content .table { font-size: 1rem; }
.flg-content .table thead th { text-transform: uppercase; letter-spacing: .05em; font-size: .74rem; font-weight: 800; color: #fff; background: #1a4d8a; padding: .7rem 1rem; }
.flg-content .table tbody td { padding: .6rem 1rem; border-bottom: 1px solid var(--theme-border, #e9ecef); vertical-align: top; }
.flg-content .table tbody td:first-child { font-weight: 700; color: var(--theme-text, #1a1a2e); white-space: nowrap; }
.flg-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.flg-pair-card { background: var(--theme-surface, #f8f9fa); border: 1px solid var(--theme-border, #e9ecef); border-radius: 12px; padding: 1rem 1.1rem; border-top: 3px solid #2a6bb5; }
.flg-pair-card h3 { margin-top: 0 !important; font-size: 1.02rem !important; } .flg-pair-card p:last-child { margin-bottom: 0; font-size: .92rem; }
.flg-faq { margin-top: 1.4rem; }
.flg-faq .accordion-item { background: transparent; border: 0; border-bottom: 1px solid var(--theme-border, #e9ecef); }
.flg-faq .accordion-button { background: transparent; color: var(--theme-text, #1a1a2e); font-weight: 600; padding-left: 0; padding-right: 2.5rem; box-shadow: none; }
.flg-faq .accordion-button:not(.collapsed) { color: #1a4d8a; background: transparent; }
.flg-faq .accordion-button:focus { box-shadow: none; }
.flg-faq .accordion-body { padding-left: 0; color: var(--theme-muted, #5b6470); }
@media (max-width: 767.98px) { .flg-pair { grid-template-columns: 1fr; } }
body[data-theme="high-contrast"] .flg-content p, body[data-theme="high-contrast"] .flg-content li, body[data-theme="high-contrast"] .flg-content .flg-lead { color: rgba(255,255,255,.84); }
body[data-theme="high-contrast"] .flg-content h2, body[data-theme="high-contrast"] .flg-content h3 { color: #fff; }
