/* ============================================================
   Climatle — game-vibe pass.

   Outfit font, vibrant sky → sunset gradient background, bold
   coral primary + ocean blue accent, big rounded everything,
   playful animations. Less editorial, more "tap to play".
============================================================ */

:root {
    --cl-bg-top:    #eef5ff;
    --cl-bg-bot:    #fff3e6;
    --cl-card:      #ffffff;
    --cl-card-soft: #f7faff;

    --cl-ink:       #131628;
    --cl-ink-2:     #353a5a;
    --cl-mute:      #7a8195;
    --cl-line:      rgba(19, 22, 40, 0.08);
    --cl-line-2:    rgba(19, 22, 40, 0.04);
    --cl-line-3:    rgba(19, 22, 40, 0.16);

    /* Vibrant — primary coral (warm) + accent blue (cool) */
    --cl-primary:    #ff6b4a;
    --cl-primary-2:  #ff8c69;
    --cl-primary-3:  #ffe4dc;
    --cl-accent:     #1a6bff;
    --cl-accent-2:   #4a8eff;
    --cl-accent-3:   #dce8ff;
    --cl-success:    #22c55e;
    --cl-success-2:  #4ade80;
    --cl-success-3:  #d6f5e0;

    --cl-warm:       #ffb347;
    --cl-cold:       #5fb4e3;
    --cl-mild:       #87cc8a;

    --cl-globe-ocean:  #dceeff;
    --cl-globe-land:   #c9b791;
    --cl-globe-stroke: #1a1d2e;

    --cl-font-display: 'Outfit', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --cl-font-ui:      'Outfit', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --cl-font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

    --cl-radius-sm: 10px;
    --cl-radius:    16px;
    --cl-radius-lg: 22px;
    --cl-radius-xl: 28px;

    --cl-shadow-xs:  0 1px 2px rgba(19, 22, 40, 0.04);
    --cl-shadow-sm:  0 2px 6px rgba(19, 22, 40, 0.06), 0 1px 2px rgba(19, 22, 40, 0.04);
    --cl-shadow-md:  0 6px 18px rgba(19, 22, 40, 0.08), 0 2px 4px rgba(19, 22, 40, 0.04);
    --cl-shadow-lg:  0 20px 48px rgba(19, 22, 40, 0.12), 0 6px 14px rgba(19, 22, 40, 0.06);
    --cl-shadow-pop: 0 8px 0 rgba(19, 22, 40, 0.08);
    --cl-glow-coral: 0 0 32px rgba(255, 107, 74, 0.22);
    --cl-glow-blue:  0 0 32px rgba(26, 107, 255, 0.22);

    --cl-ease:      cubic-bezier(0.2, 0.8, 0.2, 1);
    --cl-ease-out:  cubic-bezier(0.4, 0, 0.2, 1);
    --cl-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Page ───────────────────────────────────────────────────── */
.climatle-page {
    background:
        radial-gradient(ellipse 60% 40% at 90% 0%, rgba(255, 107, 74, 0.10), transparent 65%),
        radial-gradient(ellipse 60% 40% at 10% 100%, rgba(26, 107, 255, 0.08), transparent 65%),
        linear-gradient(180deg, var(--cl-bg-top) 0%, var(--cl-bg-bot) 100%);
    background-attachment: fixed;
    color: var(--cl-ink);
    font-family: var(--cl-font-ui);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    line-height: 1.5;
}

.climatle-page .navbar,
.climatle-page .breadcrumbs,
.climatle-page .left-rail,
.climatle-page .right-rail,
.climatle-page .ad-section,
.climatle-page .subscribe-popup { display: none !important; }
.climatle-page header.site-header { background: transparent; box-shadow: none; border-bottom: 1px solid var(--cl-line); }

/* ── Layout ─────────────────────────────────────────────────── */
.climatle {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 100px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ── Hero (compact horizontal bar) ─────────────────────────── */
.climatle__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 0 10px;
    flex-wrap: wrap;
}

.climatle__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.climatle__logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cl-primary), var(--cl-warm));
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 74, 0.28);
    flex-shrink: 0;
    transition: transform .5s var(--cl-spring);
}
.climatle__logo-mark:hover { transform: rotate(360deg); }
.climatle__logo-mark svg { display: block; }

.climatle__title {
    font-family: var(--cl-font-display);
    font-weight: 800;
    font-size: clamp(24px, 4vw, 30px);
    letter-spacing: -0.025em;
    line-height: 1;
    color: var(--cl-ink);
    margin: 0;
    background: linear-gradient(135deg, var(--cl-primary) 0%, var(--cl-warm) 60%, var(--cl-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.climatle__tagline {
    font-family: var(--cl-font-ui);
    font-weight: 500;
    font-size: 13px;
    color: var(--cl-mute);
    padding-left: 12px;
    margin-left: 4px;
    border-left: 1px solid var(--cl-line-3);
    line-height: 1.2;
}

.climatle__puzzle-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--cl-card);
    border: 1.5px solid var(--cl-line);
    border-radius: 999px;
    box-shadow: var(--cl-shadow-xs);
    flex-shrink: 0;
}
.climatle__puzzle {
    font-family: var(--cl-font-ui);
    font-weight: 800;
    font-size: 13px;
    color: var(--cl-primary);
    letter-spacing: 0.02em;
}
.climatle__pill-dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--cl-line-3);
    flex-shrink: 0;
}
.climatle__date {
    font-family: var(--cl-font-ui);
    font-weight: 500;
    font-size: 12px;
    color: var(--cl-mute);
}

/* ── How to play ──────────────────────────────────────────── */
.climatle__how {
    text-align: center;
    color: var(--cl-ink-2);
    font-family: var(--cl-font-ui);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.55;
    margin: 0 auto;
    max-width: 620px;
    padding: 16px 20px;
    background: var(--cl-card);
    border: 1.5px solid var(--cl-line);
    border-radius: var(--cl-radius);
    box-shadow: var(--cl-shadow-sm);
}
.climatle__how em {
    color: var(--cl-primary);
    font-style: normal;
    font-weight: 700;
}

/* ── Input row (hero — large, highlighted) ────────────────── */
.climatle__input-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    /* Match the explanatory text box above */
    max-width: 620px;
    margin: 0 auto;
    width: 100%;
}
.climatle__autocomplete { position: relative; width: 100%; }
/* Same on the toast mount so the toast lines up under the input */
.climatle__toast-mount {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.climatle__input-icon {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cl-primary);
    z-index: 1;
    pointer-events: none;
    transition: color .18s ease, transform .25s var(--cl-spring);
}
.climatle__autocomplete:focus-within .climatle__input-icon {
    transform: translateY(-50%) scale(1.12);
}

#climatle-input {
    width: 100%;
    height: 80px;
    padding: 0 28px 0 64px;
    border: 2.5px solid var(--cl-primary);
    border-radius: var(--cl-radius-lg);
    background: var(--cl-card);
    color: var(--cl-ink);
    font-family: var(--cl-font-ui);
    font-weight: 600;
    font-size: 20px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
    box-shadow:
        0 0 0 4px var(--cl-primary-3),
        0 14px 36px rgba(255, 107, 74, 0.22),
        0 3px 8px rgba(19, 22, 40, 0.08);
    animation: cl-input-pulse 2.6s ease-in-out infinite;
}
#climatle-input::placeholder { color: var(--cl-mute); font-weight: 500; }
#climatle-input:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 5px var(--cl-primary-3),
        0 18px 40px rgba(255, 107, 74, 0.28),
        0 4px 10px rgba(19, 22, 40, 0.10);
}
#climatle-input:focus,
.climatle--finished #climatle-input {
    animation: none;
}
#climatle-input:focus {
    border-color: var(--cl-primary);
    box-shadow:
        0 0 0 6px var(--cl-primary-3),
        0 18px 44px rgba(255, 107, 74, 0.32),
        0 4px 10px rgba(19, 22, 40, 0.10);
}

@keyframes cl-input-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 4px var(--cl-primary-3),
            0 14px 36px rgba(255, 107, 74, 0.22),
            0 3px 8px rgba(19, 22, 40, 0.08);
    }
    50% {
        box-shadow:
            0 0 0 7px var(--cl-primary-3),
            0 18px 48px rgba(255, 107, 74, 0.30),
            0 3px 8px rgba(19, 22, 40, 0.08);
    }
}

.climatle__suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: var(--cl-card);
    border: 1.5px solid var(--cl-line);
    border-radius: var(--cl-radius);
    box-shadow: var(--cl-shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}
.climatle__suggestions.is-open { display: block; }

.climatle__suggestion {
    padding: 12px 14px;
    border-radius: var(--cl-radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    color: var(--cl-ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: background 0.12s ease, transform 0.12s ease;
}
.climatle__suggestion:hover,
.climatle__suggestion.is-active {
    background: var(--cl-primary-3);
    transform: translateX(2px);
}
.climatle__suggestion-country {
    color: var(--cl-mute);
    font-size: 12px;
    font-weight: 500;
}

/* Section header above a country's top-5 cities. Non-interactive. */
.climatle__suggestion-group {
    padding: 10px 14px 4px;
    list-style: none;
    cursor: default;
    border-top: 1px solid var(--cl-line-2);
    margin-top: 4px;
}
.climatle__suggestion-group:first-child {
    border-top: 0;
    margin-top: 0;
}
.climatle__suggestion-group-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cl-accent);
}

/* ── Progress dots ────────────────────────────────────────── */
.climatle__progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.climatle__dots {
    display: flex;
    gap: 8px;
}
.climatle__dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--cl-card);
    border: 1.5px solid var(--cl-line-3);
    transition: transform .4s var(--cl-spring), background-color .3s ease, border-color .3s ease;
}
.climatle__dot.is-filled {
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(19, 22, 40, 0.12);
}
.climatle__dot.is-cold    { background: var(--cl-cold); }
.climatle__dot.is-cool    { background: #87b8e0; }
.climatle__dot.is-warm    { background: var(--cl-warm); }
.climatle__dot.is-hot     { background: var(--cl-primary); }
.climatle__dot.is-correct {
    background: var(--cl-success);
    border-color: transparent;
    transform: scale(1.3);
    box-shadow:
        0 0 0 4px var(--cl-success-3),
        0 4px 10px rgba(34, 197, 94, 0.4);
    animation: cl-dot-pop .5s var(--cl-spring) both;
}
@keyframes cl-dot-pop {
    0%   { transform: scale(0.6); }
    60%  { transform: scale(1.5); }
    100% { transform: scale(1.3); }
}

.climatle__dots-label {
    font-family: var(--cl-font-ui);
    font-weight: 600;
    font-size: 13px;
    color: var(--cl-mute);
}

/* ── Toast mount (below input) ────────────────────────────── */
.climatle__toast-mount {
    position: relative;
    display: block;
    width: 100%;
    height: 0;
    z-index: 30;
}
.climatle__guess-toast {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    background:
        linear-gradient(135deg, var(--cl-primary-3) 0%, var(--cl-card) 55%, var(--cl-card) 100%);
    border: 1.5px solid color-mix(in srgb, var(--cl-primary) 18%, transparent);
    border-radius: var(--cl-radius-lg);
    padding: 18px 20px 18px 18px;
    box-shadow:
        0 14px 40px rgba(255, 107, 74, 0.18),
        0 4px 10px rgba(19, 22, 40, 0.06);
    animation: cl-toast-in 0.5s var(--cl-spring) both;
    display: flex;
    align-items: center;
    gap: 16px;
}
.climatle__toast-wx {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    padding: 8px;
    background: var(--cl-card);
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(19, 22, 40, 0.10);
}
.climatle__toast-body { flex: 1; min-width: 0; }
.climatle__guess-toast.is-out {
    animation: cl-toast-fly 0.85s cubic-bezier(0.55, 0.05, 0.4, 0.5) forwards;
    pointer-events: none;
}
@keyframes cl-toast-in {
    0%   { opacity: 0; transform: translateY(-16px) scale(0.95); }
    100% { opacity: 1; transform: none; }
}
@keyframes cl-toast-fly {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    50%  { opacity: 0.95; transform: translateY(calc(var(--cl-fly-y, 200px) * 0.5)) scale(0.92); }
    85%  { opacity: 0.35; transform: translateY(calc(var(--cl-fly-y, 200px) * 0.93)) scale(0.8); }
    100% { opacity: 0;    transform: translateY(var(--cl-fly-y, 200px)) scale(0.75); }
}
.climatle__toast-message {
    margin: 0;
    font-family: var(--cl-font-ui);
    font-weight: 500;
    font-size: 17px;
    line-height: 1.45;
    color: var(--cl-ink);
}
.climatle__toast-message strong {
    font-weight: 700;
    color: var(--cl-primary);
}
.climatle__toast-meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--cl-font-mono);
    font-size: 11.5px;
    color: var(--cl-mute);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.climatle__toast-sep { color: var(--cl-line-3); }

/* ── Board (responsive) ───────────────────────────────────── */
.climatle__board {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
@media (min-width: 900px) {
    .climatle { max-width: 1040px; }

    .climatle__board {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 0;
        transition: gap 0.6s var(--cl-ease);
    }

    /* No guesses yet → globe is 640px wide, centered via justify-content on
       the parent (avoids margin:auto which can't be interpolated). On first
       guess, .has-guesses flips and the 3:2 grow ratio takes over. */
    .climatle__stage {
        flex: 0 1 640px;
        min-width: 0;
        align-self: flex-start;
        margin: 0;
        position: sticky;
        top: 0;
        transition: flex 0.6s var(--cl-ease);
    }
    .climatle__guesses {
        flex: 0 1 0;
        min-width: 0;
        align-self: flex-start;
        margin: 0;
        opacity: 0;
        overflow: hidden;
        transition: flex 0.6s var(--cl-ease), opacity 0.4s ease;
    }

    .climatle__board.has-guesses               { gap: 28px; }
    .climatle__board.has-guesses .climatle__stage  { flex: 3 1 0; }
    .climatle__board.has-guesses .climatle__guesses {
        flex: 2 1 0;
        opacity: 1;
        transition: flex 0.6s var(--cl-ease), opacity 0.4s 0.25s ease;
    }

    .climatle__top,
    .climatle__how,
    .climatle__input-row,
    .climatle__toast-mount,
    .climatle__progress,
    .climatle__reveal,
    .climatle__seo {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ── Globe stage ───────────────────────────────────────────── */
.climatle__stage {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--cl-radius-xl);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 30%, #ffffff 0%, #e3edf7 100%);
    box-shadow:
        inset 0 0 0 1.5px var(--cl-line),
        var(--cl-shadow-md);
    cursor: grab;
}
.climatle__stage:active { cursor: grabbing; }

.climatle__stage canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 1;
}

.climatle__stage-glow {
    position: absolute;
    inset: -10%;
    pointer-events: none;
    background: radial-gradient(circle at 50% 45%,
        rgba(255, 179, 71, 0.12) 0%,
        transparent 50%);
    z-index: 2;
    animation: cl-glow 7s ease-in-out infinite;
}
@keyframes cl-glow {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

.climatle__hint {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    font-family: var(--cl-font-ui);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--cl-ink-2);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 9px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--cl-line);
    pointer-events: none;
    z-index: 3;
    box-shadow: var(--cl-shadow-sm);
}

/* ── Guesses ──────────────────────────────────────────────── */
.climatle__guesses {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.climatle__guess {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px 16px;
    background: var(--cl-card);
    border: 1.5px solid var(--cl-line);
    border-radius: var(--cl-radius);
    box-shadow: var(--cl-shadow-sm);
    animation: cl-guess-in 0.45s var(--cl-spring) both;
    transition: transform .18s var(--cl-ease-out), box-shadow .2s ease;
}

.climatle__guess-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.climatle__guess-wx {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(19, 22, 40, 0.10));
}
.climatle__guess-wx--empty {
    width: 32px; height: 32px;
    background: var(--cl-card-2);
    border-radius: 50%;
}

.climatle__guess-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--cl-font-mono);
    font-size: 13px;
    color: var(--cl-ink-2);
    font-weight: 600;
}
.climatle__guess-sep { color: var(--cl-mute-2); }
.climatle__guess-dist { color: var(--cl-ink); }
.climatle__guess-match { color: var(--cl-mute); }

.climatle__guess-msg {
    font-size: 14px;
    line-height: 1.5;
    color: var(--cl-ink-2);
}
.climatle__guess-msg strong { color: var(--cl-success); font-weight: 700; }
.climatle__guess-msg em { color: var(--cl-mute); font-style: italic; }

.climatle__guess-mod {
    font-weight: 700;
    white-space: nowrap;
}
.climatle__guess-mod--warmer { color: var(--cl-primary); }
.climatle__guess-mod--colder { color: var(--cl-accent); }
.climatle__guess-mod--wetter { color: var(--cl-accent); }
.climatle__guess-mod--drier  { color: #a07534; }
.climatle__guess:hover {
    transform: translateY(-2px);
    box-shadow: var(--cl-shadow-md);
}
@keyframes cl-guess-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
.climatle__guess.is-correct {
    border-color: var(--cl-success);
    background: linear-gradient(135deg, var(--cl-success-3) 0%, var(--cl-card) 100%);
    box-shadow:
        0 0 0 3px var(--cl-success-3),
        var(--cl-shadow-md);
}

.climatle__guess-name {
    font-family: var(--cl-font-ui);
    font-weight: 700;
    font-size: 16px;
    color: var(--cl-ink);
    letter-spacing: -0.015em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.climatle__guess-name .climatle__suggestion-country {
    font-family: var(--cl-font-ui);
    font-weight: 500;
    color: var(--cl-mute);
    font-size: 11px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.climatle__guess-dist {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--cl-font-mono);
    font-size: 13px;
    color: var(--cl-ink);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.climatle__guess-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cl-primary), var(--cl-warm));
    color: white;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--cl-font-ui);
    box-shadow: 0 3px 8px rgba(255, 107, 74, 0.30);
}
.climatle__guess.is-correct .climatle__guess-arrow {
    background: linear-gradient(135deg, var(--cl-success), var(--cl-success-2));
    box-shadow: 0 3px 8px rgba(34, 197, 94, 0.32);
}

.climatle__guess-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--cl-line-2);
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}
.climatle__guess-bar::after {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: var(--cl-match, 0%);
    min-width: 8px;
    background: linear-gradient(90deg, var(--cl-primary), var(--cl-warm));
    border-radius: 999px;
    transition: width 0.7s var(--cl-spring);
    box-shadow: 0 0 12px rgba(255, 107, 74, 0.32);
}
.climatle__guess.is-correct .climatle__guess-bar::after {
    background: linear-gradient(90deg, var(--cl-success), var(--cl-success-2));
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.32);
}

/* ── Result modal ─────────────────────────────────────────── */
.climatle__modal-backdrop[hidden] { display: none; }
.climatle__modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(19, 22, 40, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    animation: cl-backdrop-in 0.3s ease both;
}
@keyframes cl-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.climatle__reveal[hidden] { display: none; }
.climatle__reveal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 210;
    width: calc(100% - 32px);
    max-width: 480px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 44px 26px 28px;
    border: 2px solid var(--cl-line);
    border-radius: var(--cl-radius-xl);
    text-align: center;
    background: var(--cl-card);
    box-shadow: var(--cl-shadow-lg);
    overflow-x: hidden;
    animation: cl-reveal-in 0.45s var(--cl-spring) both;
}

.climatle__modal-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: -28px -10px 0 -10px;   /* pull tight against the modal padding */
    min-height: 36px;
}
.climatle__modal-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--cl-mute);
    border-radius: 999px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    margin: 0;
    transition: opacity .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.climatle__modal-close:hover {
    opacity: 1;
    background: rgba(19, 22, 40, 0.08);
    color: var(--cl-ink);
    transform: rotate(90deg);
}
.climatle__modal-close:active { transform: rotate(90deg) scale(0.92); }
.climatle__modal-close svg { display: block; }

body.climatle--modal-open { overflow: hidden; }

/* ── Countdown to next puzzle ──────────────────────────────── */
.climatle__result-msg {
    font-family: var(--cl-font-display);
    font-weight: 800;
    font-size: clamp(28px, 6vw, 36px);
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin: 12px 0 4px;
}
.climatle--won  .climatle__result-msg { color: var(--cl-success); }
.climatle--lost .climatle__result-msg { color: var(--cl-primary); }

.climatle__result-sub {
    font-family: var(--cl-font-ui);
    font-weight: 500;
    font-size: 14px;
    color: var(--cl-mute);
    margin: 0 0 18px;
}

.climatle__countdown {
    margin-top: 22px;
    padding: 18px 18px 16px;
    background: linear-gradient(135deg, var(--cl-primary-3) 0%, var(--cl-card) 100%);
    border: 1.5px solid color-mix(in srgb, var(--cl-primary) 14%, transparent);
    border-radius: var(--cl-radius);
    text-align: center;
}
.climatle--won .climatle__countdown {
    background: linear-gradient(135deg, var(--cl-success-3) 0%, var(--cl-card) 100%);
    border-color: color-mix(in srgb, var(--cl-success) 18%, transparent);
}
.climatle__countdown-label {
    font-family: var(--cl-font-ui);
    font-size: 13px;
    font-weight: 700;
    color: var(--cl-ink);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.climatle__countdown-emoji {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    animation: cl-hourglass 3s ease-in-out infinite;
    transform-origin: center;
}
@keyframes cl-hourglass {
    0%, 60%, 100% { transform: rotate(0); }
    70%           { transform: rotate(180deg); }
}
.climatle__countdown-time {
    font-family: var(--cl-font-mono);
    font-weight: 700;
    font-size: 36px;
    color: var(--cl-primary);
    letter-spacing: 0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.climatle--won .climatle__countdown-time { color: var(--cl-success); }
.climatle__countdown-foot {
    font-family: var(--cl-font-ui);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--cl-mute);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ── Re-open modal button ──────────────────────────────────── */
.climatle__show-summary {
    margin: 18px auto 0;
    display: block;
    appearance: none;
    height: 48px;
    padding: 0 24px;
    border: 1.5px solid var(--cl-primary);
    border-radius: var(--cl-radius);
    background: transparent;
    color: var(--cl-primary);
    font-family: var(--cl-font-ui);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease;
}
.climatle__show-summary:hover {
    background: var(--cl-primary-3);
    transform: translateY(-1px);
}
.climatle__show-summary:active { transform: translateY(0); }
.climatle__show-summary[hidden] { display: none; }
.climatle__reveal::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at top, var(--cl-primary-3), transparent 65%),
        radial-gradient(ellipse at bottom right, var(--cl-accent-3), transparent 50%);
    pointer-events: none;
}
.climatle__reveal > * { position: relative; z-index: 1; }
@keyframes cl-reveal-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.climatle__reveal-wx {
    width: 88px;
    height: 88px;
    display: block;
    margin: 0 auto 12px;
    filter: drop-shadow(0 8px 18px rgba(19, 22, 40, 0.18));
    animation: cl-reveal-wx-in 0.6s 0.15s var(--cl-spring) both;
}
@keyframes cl-reveal-wx-in {
    from { opacity: 0; transform: scale(0.5) rotate(-12deg); }
    to   { opacity: 1; transform: scale(1)   rotate(0); }
}

.climatle__stamp {
    display: inline-block;
    padding: 8px 18px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--cl-primary), var(--cl-warm));
    color: white;
    font-family: var(--cl-font-ui);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    transform: rotate(-3deg);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(255, 107, 74, 0.4);
    animation: cl-stamp-in .55s 0.25s var(--cl-spring) both;
}
@keyframes cl-stamp-in {
    from { opacity: 0; transform: rotate(8deg) scale(1.6); }
    to   { opacity: 1; transform: rotate(-3deg) scale(1); }
}

.climatle__answer-name {
    font-family: var(--cl-font-display);
    font-weight: 800;
    font-size: clamp(48px, 10vw, 72px);
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 8px 0 8px;
    color: var(--cl-ink);
    background: linear-gradient(135deg, var(--cl-ink) 0%, var(--cl-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: cl-answer-in 0.6s 0.2s var(--cl-spring) both;
}
@keyframes cl-answer-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

.climatle__answer-country {
    font-family: var(--cl-font-ui);
    font-weight: 600;
    font-size: 14px;
    color: var(--cl-mute);
    margin-bottom: 28px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.climatle__flag {
    width: 28px;
    height: 20px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px var(--cl-line), 0 2px 6px rgba(0,0,0,.1);
    object-fit: cover;
}
.climatle__flag[src=""], .climatle__flag:not([src]) { display: none; }

.climatle__share {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: auto;
    padding: 6px 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cl-primary);
    font-family: var(--cl-font-ui);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.005em;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(255, 107, 74, 0.30);
    text-decoration-thickness: 1.5px;
    cursor: pointer;
    box-shadow: none;
    transition: color .15s ease, text-decoration-color .15s ease;
}
.climatle__share svg {
    display: block;
    flex-shrink: 0;
    transition: transform .25s var(--cl-spring);
}
.climatle__share:hover {
    color: color-mix(in srgb, var(--cl-primary) 80%, var(--cl-ink) 20%);
    text-decoration-color: var(--cl-primary);
}
.climatle__share:hover svg { transform: translateY(-2px); }
.climatle__share:focus-visible {
    outline: 2px solid var(--cl-primary);
    outline-offset: 2px;
}
.climatle__share.is-copied {
    color: var(--cl-success);
    text-decoration-color: var(--cl-success);
}
.climatle__share-status {
    margin-top: 14px;
    min-height: 16px;
    font-family: var(--cl-font-ui);
    font-size: 12px;
    color: var(--cl-mute);
    font-weight: 600;
}

.climatle--finished .climatle__input-row { opacity: 0.4; pointer-events: none; }
.climatle--finished .climatle__hint { display: none; }

.climatle--theme-tropical { --cl-primary: #ff7a3d; --cl-primary-2: #ff9966; }
.climatle--theme-arid     { --cl-primary: #d99343; --cl-primary-2: #ebac60; }
.climatle--theme-temperate{ /* default */ }
.climatle--theme-cool     { --cl-primary: #4a8bd6; --cl-primary-2: #6ba4e2; }
.climatle--theme-polar    { --cl-primary: #6b94c0; --cl-primary-2: #8aaccf;
                            --cl-globe-ocean: #d4e3f0; }

/* ── SEO content (kept polished but playful) ──────────────── */
.climatle__seo {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--cl-line);
    color: var(--cl-ink-2);
    font-size: 16px;
    line-height: 1.7;
    counter-reset: cl-seo;
}
.climatle__seo p { margin: 0 0 16px; }
.climatle__seo strong { color: var(--cl-ink); font-weight: 700; }
.climatle__seo a { color: var(--cl-primary); text-decoration: underline; text-underline-offset: 3px; }

.climatle__seo-h {
    counter-increment: cl-seo;
    font-family: var(--cl-font-display);
    font-weight: 800;
    font-size: clamp(26px, 4vw, 32px);
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--cl-ink);
    margin: 48px 0 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}
.climatle__seo-h:first-of-type { margin-top: 8px; }
.climatle__seo-h::before {
    content: counter(cl-seo, decimal-leading-zero);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-family: var(--cl-font-ui);
    font-size: 13px;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, var(--cl-primary), var(--cl-warm));
    border-radius: 999px;
    letter-spacing: 0;
    box-shadow: 0 4px 12px rgba(255, 107, 74, 0.32);
}

.climatle__seo > p:first-of-type {
    font-size: 18px;
    line-height: 1.6;
    color: var(--cl-ink);
}
.climatle__seo > p:first-of-type::first-letter {
    font-family: var(--cl-font-display);
    font-weight: 800;
    font-size: 64px;
    line-height: 0.86;
    color: var(--cl-primary);
    float: left;
    padding: 6px 12px 0 0;
    letter-spacing: -0.05em;
}

.climatle__seo ol.climatle__list {
    counter-reset: cl-step;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 24px;
}

/* Promotional / OG artwork shown after “How to play” */
.climatle__og-figure {
    margin: 0 0 32px;
    padding: 0;
    border-radius: var(--cl-radius-lg);
    overflow: hidden;
    box-shadow: var(--cl-shadow-md);
    border: 1.5px solid var(--cl-line);
    background: var(--cl-card);
    max-width: 920px;
}
.climatle__og-img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}
.climatle__seo ol.climatle__list > li {
    counter-increment: cl-step;
    position: relative;
    padding: 18px 20px 18px 64px;
    background: var(--cl-card);
    border: 1.5px solid var(--cl-line);
    border-radius: var(--cl-radius);
    box-shadow: var(--cl-shadow-sm);
    transition: transform .18s var(--cl-spring), box-shadow .2s ease, border-color .2s ease;
}
.climatle__seo ol.climatle__list > li:hover {
    transform: translateY(-2px);
    box-shadow: var(--cl-shadow-md);
    border-color: var(--cl-primary);
}
.climatle__seo ol.climatle__list > li::before {
    content: counter(cl-step);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--cl-font-ui);
    font-size: 16px;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, var(--cl-primary), var(--cl-warm));
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(255, 107, 74, 0.28);
}
.climatle__seo ol.climatle__list > li ul {
    list-style: disc;
    padding-left: 22px;
    margin: 10px 0 0;
    color: var(--cl-ink-2);
}
.climatle__seo ol.climatle__list > li ul li {
    margin-bottom: 4px;
    background: none;
    border: 0;
    padding: 0;
    box-shadow: none;
}

.climatle__seo ul.climatle__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0;
    list-style: none;
    margin: 0 0 24px;
}
.climatle__seo ul.climatle__list > li {
    margin: 0;
    padding: 18px 18px 18px 18px;
    background: var(--cl-card);
    border: 1.5px solid var(--cl-line);
    border-radius: var(--cl-radius);
    box-shadow: var(--cl-shadow-sm);
    color: var(--cl-ink-2);
    font-size: 14.5px;
    line-height: 1.55;
    transition: transform .18s var(--cl-spring), box-shadow .2s ease;
    position: relative;
    padding-top: 42px;
}
.climatle__seo ul.climatle__list > li:hover {
    transform: translateY(-3px);
    box-shadow: var(--cl-shadow-md);
}
.climatle__seo ul.climatle__list > li::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--cl-primary);
    box-shadow: 0 0 0 5px var(--cl-primary-3);
}
.climatle__seo ul.climatle__list > li strong { display: block; margin-bottom: 4px; color: var(--cl-ink); }

.climatle__faq {
    margin: 0 0 12px;
    padding: 22px 24px;
    background: var(--cl-card);
    border: 1.5px solid var(--cl-line);
    border-radius: var(--cl-radius-lg);
    box-shadow: var(--cl-shadow-sm);
    transition: transform .18s var(--cl-spring), box-shadow .2s ease, border-color .2s ease;
}
.climatle__faq:hover {
    transform: translateY(-2px);
    box-shadow: var(--cl-shadow-md);
    border-color: var(--cl-primary);
}
.climatle__faq h3 {
    font-family: var(--cl-font-display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--cl-ink);
    margin: 0 0 10px;
    padding-left: 32px;
    position: relative;
}
.climatle__faq h3::before {
    content: "Q";
    position: absolute;
    left: 0;
    top: 2px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--cl-font-ui);
    font-size: 12px;
    font-weight: 800;
    color: white;
    background: var(--cl-primary);
    border-radius: 999px;
}
.climatle__faq p {
    margin: 0;
    color: var(--cl-ink-2);
    font-size: 15.5px;
    line-height: 1.65;
    padding-left: 32px;
}

.climatle__data-note {
    margin-top: 36px;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--cl-primary-3) 0%, var(--cl-accent-3) 100%);
    border: 1.5px solid color-mix(in srgb, var(--cl-primary) 20%, var(--cl-line));
    color: var(--cl-ink);
    font-family: var(--cl-font-ui);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.55;
    border-radius: var(--cl-radius);
    box-shadow: var(--cl-shadow-sm);
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .climatle { padding: 20px 14px 60px; gap: 14px; }
    .climatle__top { padding: 2px 0 6px; gap: 10px; }
    .climatle__brand { gap: 8px; }
    .climatle__logo-mark { width: 32px; height: 32px; }
    .climatle__title { font-size: 22px; }
    .climatle__tagline { display: none; }
    .climatle__puzzle-pill { padding: 5px 12px; }
    .climatle__how { font-size: 14.5px; padding: 14px 18px; }
    .climatle__reveal { padding: 36px 20px 24px; }
    .climatle__answer-name { font-size: clamp(40px, 11vw, 56px); }
    #climatle-input { height: 64px; font-size: 18px; padding: 0 18px 0 52px; }
    .climatle__input-icon { left: 20px; }
    .climatle__seo-h { font-size: 23px; }
    .climatle__faq h3 { font-size: 17px; }
    .climatle__seo ul.climatle__list { grid-template-columns: 1fr; }
}

.climatle__confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
