/* GeoRankle map module */
.gr-map,
.live-map {
    position: relative;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(180deg, #bfe3ff 0%, #eaf7ff 100%);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.live-map {
    height: 380px;
    margin: 20px 0 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
}

.gr-map {
    height: 340px;
}

.gr-map-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.gr-map-viewport:active {
    cursor: grabbing;
}

.gr-map-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.gr-map-layer {
    transform-origin: 0 0;
    transition: transform 0.08s ease-out;
}

.gr-country {
    fill: #52616b;
    stroke: #dbeafe;
    stroke-width: 0.42;
    vector-effect: non-scaling-stroke;
    transition: fill 0.25s ease;
}

.gr-country.gr-guessed {
    fill: #ffd400;
}

.gr-country.gr-answer {
    fill: #22c55e;
}

.gr-route-line {
    fill: none;
    stroke: #ef4444;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    opacity: 0.95;
}

.gr-route-dot {
    stroke: white;
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
}

.gr-guess-dot {
    fill: #ffd400;
}

.gr-answer-dot {
    fill: #22c55e;
}

.gr-route-label {
    fill: #111827;
    font-size: 16px;
    font-weight: 900;
    paint-order: stroke;
    stroke: white;
    stroke-width: 4px;
    stroke-linejoin: round;
    pointer-events: none;
}

.gr-map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    gap: 6px;
}

.gr-map-controls button {
    border: none;
    background: white;
    border-radius: 10px;
    padding: 7px 10px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.gr-map-loading,
.gr-map-error {
    padding: 18px;
    font-weight: 900;
}

.gr-map-error {
    color: #991b1b;
}

@media (max-width: 1100px) {
    .live-map {
        height: 300px;
    }

    .gr-map {
        height: 280px;
    }
}

/* Map Engine 2.1 polish */

.gr-country {
    fill: #52616b;
    stroke: rgba(219, 234, 254, 0.95);
    stroke-width: 0.42;
    vector-effect: non-scaling-stroke;
    transition: fill 0.35s ease, stroke 0.35s ease, opacity 0.35s ease;
}

.gr-country.gr-guessed {
    fill: rgba(255, 212, 0, 0.72);
    stroke: #ffd400;
    stroke-width: 1.15;
}

.gr-country.gr-answer {
    fill: rgba(34, 197, 94, 0.9);
    stroke: #16a34a;
    stroke-width: 1.4;
}

.gr-flight-line {
    fill: none;
    stroke: rgba(239, 68, 68, 0.82);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 8 8;
    animation: grRouteDraw 0.8s ease-out both;
}

.gr-final-flight-line {
    stroke: rgba(34, 197, 94, 0.95);
    stroke-width: 4.5;
    stroke-dasharray: none;
}

@keyframes grRouteDraw {
    from {
        stroke-dashoffset: 40;
        opacity: 0;
    }

    to {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

.gr-pin {
    pointer-events: none;
    animation: grPinDrop 0.35s ease-out both;
}

@keyframes grPinDrop {
    from {
        transform: translate(var(--x, 0), var(--y, 0)) scale(0.65);
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.gr-pin-shadow {
    fill: rgba(0, 0, 0, 0.18);
}

.gr-pin-body {
    fill: #ffd400;
    stroke: white;
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 5px 8px rgba(0,0,0,0.28));
}

.gr-answer-pin .gr-pin-body {
    fill: #22c55e;
}

.gr-pin-number,
.gr-pin-check {
    font-size: 13px;
    font-weight: 900;
    fill: #111827;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.gr-pin-check {
    fill: white;
    font-size: 15px;
}

.gr-pin-pulse {
    fill: rgba(34, 197, 94, 0.28);
    animation: grPulse 1.2s ease-out infinite;
}

@keyframes grPulse {
    0% {
        transform: scale(0.7);
        opacity: 0.75;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.gr-map-layer-animated {
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Map Engine 2.2 polish */

.gr-map,
.live-map,
.result-center-map {
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.45), transparent 22%),
        linear-gradient(180deg, #b8e2ff 0%, #e7f7ff 100%) !important;
}

.gr-country {
    fill: #42535d;
    stroke: rgba(240, 249, 255, 0.8);
    stroke-width: 0.42;
    vector-effect: non-scaling-stroke;
    transition: fill 0.35s ease, stroke 0.35s ease, opacity 0.35s ease;
}

.gr-country.gr-guessed {
    fill: rgba(255, 212, 0, 0.55);
    stroke: #ffd400;
    stroke-width: 1.2;
}

.gr-country.gr-answer {
    fill: rgba(34, 197, 94, 0.9);
    stroke: #16a34a;
    stroke-width: 1.6;
}

.gr-flight-shadow {
    fill: none;
    stroke: rgba(15, 23, 42, 0.25);
    stroke-width: 6;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    opacity: 0.55;
}

.gr-flight-line {
    fill: none;
    stroke: rgba(239, 68, 68, 0.72);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 7 7;
    animation: grRouteDraw 0.9s ease-out both;
}

.gr-final-flight-line {
    stroke: url(#routeGradient);
    stroke-width: 4.2;
    stroke-dasharray: none;
}

@keyframes grRouteDraw {
    from {
        stroke-dashoffset: 70;
        opacity: 0;
    }

    to {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

.gr-pin {
    pointer-events: none;
    animation: grPinDrop 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

@keyframes grPinDrop {
    from {
        opacity: 0;
        transform: scale(0.65);
    }

    to {
        opacity: 1;
    }
}

.gr-pin-ground-shadow {
    fill: rgba(0, 0, 0, 0.28);
}

.gr-pin-drop {
    fill: #ffd400;
    stroke: white;
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 8px 9px rgba(0,0,0,0.35));
}

.gr-answer-pin .gr-pin-drop {
    fill: #22c55e;
}

.gr-pin-inner {
    fill: rgba(255, 255, 255, 0.92);
}

.gr-pin-number {
    font-size: 13px;
    font-weight: 900;
    fill: #111827;
    text-anchor: middle;
    dominant-baseline: middle;
}

.gr-pin-check {
    font-size: 15px;
    font-weight: 900;
    fill: #16a34a;
    text-anchor: middle;
    dominant-baseline: middle;
}

.gr-pin-pulse {
    fill: rgba(34, 197, 94, 0.28);
    animation: grPulse 1.25s ease-out infinite;
}

@keyframes grPulse {
    0% {
        transform: scale(0.55);
        opacity: 0.75;
    }

    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

.gr-map-layer-animated {
    transition: transform 0.48s cubic-bezier(0.2, 0.8, 0.2, 1);
}


.gr-pin-drop {
    transform: scale(0.62);
    transform-origin: center;
    transform-box: fill-box;
}

.gr-pin-inner {
    transform: scale(0.75);
    transform-origin: center;
    transform-box: fill-box;
}

.gr-pin-number,
.gr-pin-check {
    font-size: 8px;
}

.gr-pin-pulse {
    transform: scale(0.7);
    transform-origin: center;
    transform-box: fill-box;
}

/* Map Engine 2.3 compact numbered markers - safe version */

.gr-dot-marker {
    pointer-events: none;
}

.gr-dot-shadow {
    fill: rgba(0, 0, 0, 0.28);
}

.gr-dot-body {
    fill: #ffd400;
    stroke: white;
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
}

.gr-answer-marker .gr-dot-body {
    fill: #22c55e;
}

.gr-dot-number,
.gr-dot-check {
    font-size: 11px;
    font-weight: 900;
    fill: #111827;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.gr-dot-check {
    fill: white;
    font-size: 13px;
}

.gr-dot-pulse {
    fill: rgba(34, 197, 94, 0.28);
}

.gr-flight-shadow {
    stroke-width: 4 !important;
    opacity: 0.35 !important;
}

.gr-flight-line {
    stroke-width: 2.2 !important;
    opacity: 0.78 !important;
}

.gr-final-flight-line {
    stroke-width: 3.4 !important;
}

/* Map Engine 2.3 smaller clean markers */

.gr-dot-body {
    r: 6;
    stroke-width: 2;
}

.gr-dot-shadow {
    r: 7;
    cx: 1;
    cy: 2;
    opacity: 0.28;
}

.gr-dot-number {
    font-size: 7px;
    font-weight: 900;
}

.gr-dot-check {
    font-size: 8px;
}

.gr-dot-pulse {
    r: 10;
    opacity: 0.35;
}

.gr-flight-line {
    stroke-width: 1.8 !important;
    opacity: 0.65 !important;
}

.gr-final-flight-line {
    stroke-width: 2.6 !important;
}

/* Map Engine 2.4 smart marker placement */

.gr-marker-leader {
    stroke: rgba(15, 23, 42, 0.45);
    stroke-width: 1;
    stroke-dasharray: 2 2;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.gr-dot-marker {
    filter: drop-shadow(0 3px 5px rgba(0,0,0,0.25));
}

/* ======================================================
   Map Engine 4.0 Step 2
   Cinematic marker + route animation
====================================================== */

.gr-dot-marker {
    transform-origin: center;
    animation: grCinematicMarkerPop 0.42s cubic-bezier(0.18, 1.35, 0.35, 1) both;
}

@keyframes grCinematicMarkerPop {
    0% {
        opacity: 0;
        transform: scale(0.35);
    }

    65% {
        opacity: 1;
        transform: scale(1.18);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}


@keyframes grCinematicRouteDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.gr-flight-shadow {
    opacity: 0;
    animation: grCinematicShadowFade 0.65s ease-out forwards;
}

@keyframes grCinematicShadowFade {
    to {
        opacity: 0.35;
    }
}

.gr-answer-marker .gr-dot-body {
    animation: grAnswerGlow 1.2s ease-out infinite alternate;
}

@keyframes grAnswerGlow {
    from {
        filter: drop-shadow(0 0 3px rgba(34,197,94,0.45));
    }

    to {
        filter: drop-shadow(0 0 10px rgba(34,197,94,0.85));
    }
}

/* Map Engine 4.0 Step 3: route-follow tuning */

.gr-flight-line {
    animation-duration: 0.55s !important;
}

.gr-dot-marker {
    animation-delay: 0.18s;
}

/* Map Engine 4.0: cinematic flight timing */

.gr-flight-line {
    animation-duration: 2.8s !important;
}

.gr-dot-marker {
    animation-delay: 0.9s;
}

/* Map Engine 4.0: stable cinematic route */

.gr-flight-line {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
    animation: none !important;
    opacity: 0.72 !important;
}

.gr-flight-travel-line {
    fill: none;
    stroke: rgba(239, 68, 68, 0.95);
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.gr-flight-travel-dot {
    fill: #ef4444;
    stroke: white;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

/* ======================================================
   GeoRankle Map Engine 5.0
   Natural map visual theme
====================================================== */

/* Kartans ram och hav */
.gr-map,
.live-map,
.result-center-map {
    background:
        radial-gradient(
            circle at 48% 42%,
            rgba(255, 255, 255, 0.16),
            transparent 38%
        ),
        radial-gradient(
            circle at 18% 15%,
            rgba(118, 190, 225, 0.22),
            transparent 32%
        ),
        linear-gradient(
            180deg,
            #75b8d8 0%,
            #8fc9e1 48%,
            #78b8d5 100%
        ) !important;

    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 20px;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.62),
        inset 0 -18px 40px rgba(15, 76, 110, 0.12),
        0 16px 35px rgba(19, 59, 82, 0.18);

    isolation: isolate;
}

/* Svag atmosfär över havet */
.gr-map::before,
.live-map::before,
.result-center-map::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    background:
        linear-gradient(
            115deg,
            rgba(255, 255, 255, 0.12),
            transparent 36%
        ),
        radial-gradient(
            ellipse at center,
            transparent 48%,
            rgba(24, 75, 101, 0.13) 100%
        );
}

/* Kartan ska ligga ovanför havseffekten */
.gr-map-viewport {
    position: relative;
    z-index: 1;
}

/* Naturlig, ljus landfärg */
.gr-country {
    fill: #c8d3ad !important;

    stroke: rgba(77, 100, 91, 0.72) !important;
    stroke-width: 0.48 !important;

    vector-effect: non-scaling-stroke;

    transition:
        fill 0.3s ease,
        stroke 0.3s ease,
        opacity 0.3s ease,
        filter 0.3s ease;
}

/* Diskret interaktion när musen förs över landet */
.gr-country:hover {
    fill: #d3d9b8 !important;
    stroke: rgba(55, 76, 68, 0.92) !important;
}

/* Ett gissat land */
.gr-country.gr-guessed {
    fill: #f1c84b !important;
    stroke: #c59013 !important;
    stroke-width: 1.25 !important;

    filter:
        drop-shadow(0 0 3px rgba(241, 200, 75, 0.7));
}

/* Rätt land */
.gr-country.gr-answer {
    fill: #62b96d !important;
    stroke: #27843b !important;
    stroke-width: 1.55 !important;

    filter:
        drop-shadow(0 0 6px rgba(56, 164, 74, 0.72));
}

/* Renare kartkontroller */
.gr-map-controls {
    top: 14px;
    right: 14px;
    gap: 7px;
}

.gr-map-controls button {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;

    border: 1px solid rgba(31, 58, 69, 0.12);
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.92);
    color: #203943;

    font-family: inherit;
    font-size: 13px;
    font-weight: 800;

    box-shadow:
        0 5px 15px rgba(19, 48, 61, 0.18);

    backdrop-filter: blur(8px);

    transition:
        transform 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.gr-map-controls button:hover {
    background: #ffffff;
    transform: translateY(-1px);

    box-shadow:
        0 7px 18px rgba(19, 48, 61, 0.22);
}

.gr-map-controls button:active {
    transform: translateY(0);
}

/* Ruttens skugga */
.gr-flight-shadow {
    stroke: rgba(26, 48, 58, 0.28) !important;
    stroke-width: 4.6 !important;
    opacity: 0.45 !important;
}

/* Vanlig rutt */
.gr-flight-line {
    stroke: rgba(215, 70, 63, 0.86) !important;
    stroke-width: 2.15 !important;
    opacity: 0.86 !important;
}

/* Animerad färdpunkt */
.gr-flight-travel-line {
    stroke: #dc5149;
    stroke-width: 2.8;
}

.gr-flight-travel-dot {
    fill: #dc5149;
    stroke: rgba(255, 255, 255, 0.96);
    stroke-width: 2.2;
}

/* Gissningsmarkörer */
.gr-dot-body {
    fill: #efc442 !important;
    stroke: #ffffff !important;
    stroke-width: 2.2 !important;
}

.gr-dot-shadow {
    fill: rgba(23, 49, 58, 0.32) !important;
}

/* Svarsmarkören */
.gr-answer-marker .gr-dot-body {
    fill: #4caf5d !important;
    stroke: #ffffff !important;
}

/* Ledarlinje för små länder */
.gr-marker-leader {
    stroke: rgba(31, 56, 65, 0.58);
    stroke-width: 1;
    stroke-dasharray: 2 2;
}

/* Mobil */
@media (max-width: 800px) {
    .gr-map,
    .live-map,
    .result-center-map {
        border-radius: 16px;
    }

    .gr-map-controls {
        top: 10px;
        right: 10px;
    }

    .gr-map-controls button {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
    }
}

/* ======================================================
   GeoRankle Map Engine 5.1
   Step 1: continent depth
====================================================== */

/*
Lägg djupet på länderna, inte på hela SVG-kartan.
Det gör att varje lands kust och gräns blir tydligare.
*/
.gr-country {
    filter:
        drop-shadow(
            -0.7px -0.7px 0
            rgba(255, 255, 235, 0.32)
        )
        drop-shadow(
            0.8px 1.3px 0.8px
            rgba(36, 69, 66, 0.24)
        ) !important;

    transform-box: fill-box;
    transform-origin: center;

    transition:
        fill 0.3s ease,
        stroke 0.3s ease,
        filter 0.3s ease,
        opacity 0.3s ease;
}

/*
En svag gemensam skugga under hela landmassan.
Det gör att kontinenterna känns placerade ovanpå havet.
*/
.gr-map-layer {
    filter:
        drop-shadow(
            0 3px 3px
            rgba(27, 68, 79, 0.18)
        );
}

/*
När spelaren håller musen över ett land lyfts det bara
ytterst lite. Vi undviker att flytta själva landet.
*/
.gr-country:hover {
    filter:
        drop-shadow(
            -0.8px -0.8px 0
            rgba(255, 255, 240, 0.4)
        )
        drop-shadow(
            1px 2px 1.4px
            rgba(31, 63, 59, 0.3)
        ) !important;
}

/*
Gissade länder behöver en tydligare, varmare skugga.
*/
.gr-country.gr-guessed {
    filter:
        drop-shadow(
            0 0 2px
            rgba(255, 224, 105, 0.92)
        )
        drop-shadow(
            1px 2px 1.3px
            rgba(117, 83, 10, 0.34)
        ) !important;
}

/*
Rätt land får ett grönare djup och ett mjukt sken.
*/
.gr-country.gr-answer {
    filter:
        drop-shadow(
            0 0 3px
            rgba(119, 224, 135, 0.95)
        )
        drop-shadow(
            1px 2px 1.5px
            rgba(24, 102, 47, 0.4)
        ) !important;
}

/*
På små skärmar minskar vi filtreringen lite för att
behålla god prestanda.
*/
@media (max-width: 800px) {
    .gr-country {
        filter:
            drop-shadow(
                -0.4px -0.4px 0
                rgba(255, 255, 235, 0.28)
            )
            drop-shadow(
                0.6px 1px 0.6px
                rgba(36, 69, 66, 0.2)
            ) !important;
    }

    .gr-map-layer {
        filter:
            drop-shadow(
                0 2px 2px
                rgba(27, 68, 79, 0.14)
            );
    }
}

/*
Respektera användare som har valt minskade rörelser.
*/
@media (prefers-reduced-motion: reduce) {
    .gr-country {
        transition: none;
    }
}

/* ======================================================
   GeoRankle Map Engine 5.2
   Step 2: ocean depth and atmosphere
====================================================== */

.gr-map,
.live-map,
.result-center-map {
    background:
        /* Mjukt ljus över nordatlanten */
        radial-gradient(
            ellipse at 35% 25%,
            rgba(255, 255, 255, 0.20) 0%,
            rgba(255, 255, 255, 0.08) 24%,
            transparent 48%
        ),

        /* Ljusare område över stilla havet */
        radial-gradient(
            ellipse at 78% 42%,
            rgba(178, 226, 242, 0.18) 0%,
            transparent 42%
        ),

        /* Djupare blått nära nederkanten */
        radial-gradient(
            ellipse at 50% 105%,
            rgba(24, 85, 116, 0.28) 0%,
            transparent 56%
        ),

        /* Mörkare oceanzon till vänster */
        radial-gradient(
            ellipse at 4% 55%,
            rgba(31, 99, 132, 0.22) 0%,
            transparent 46%
        ),

        /* Grundfärg */
        linear-gradient(
            180deg,
            #8ac9e4 0%,
            #78bad8 48%,
            #66a9ca 100%
        ) !important;
}

/*
Överlagring med atmosfär och djup.
Denna ersätter eller kompletterar tidigare ::before-regel.
*/
.gr-map::before,
.live-map::before,
.result-center-map::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    background:
        /* Smalt diagonalt ljusstråk */
        linear-gradient(
            118deg,
            transparent 0%,
            transparent 22%,
            rgba(255, 255, 255, 0.10) 34%,
            rgba(255, 255, 255, 0.03) 46%,
            transparent 58%
        ),

        /* Svagt ljus längs överkanten */
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.16) 0%,
            transparent 24%
        ),

        /* Vinjettering längs kanterna */
        radial-gradient(
            ellipse at center,
            transparent 48%,
            rgba(20, 68, 94, 0.08) 76%,
            rgba(14, 55, 78, 0.18) 100%
        );

    mix-blend-mode: soft-light;
}

/*
Ett extra lager med mycket subtil havstextur.
Pseudo-elementet placeras bakom SVG-kartan.
*/
.gr-map::after,
.live-map::after,
.result-center-map::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    opacity: 0.28;

    background-image:
        radial-gradient(
            circle at 20% 35%,
            rgba(255, 255, 255, 0.12) 0 1px,
            transparent 1.5px
        ),
        radial-gradient(
            circle at 70% 65%,
            rgba(21, 82, 111, 0.10) 0 1px,
            transparent 1.5px
        );

    background-size:
        34px 34px,
        46px 46px;

    background-position:
        0 0,
        12px 18px;

    mask-image:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.42),
            rgba(0, 0, 0, 0.18)
        );
}

/*
Säkerställer att kartan och kontrollerna ligger ovanför
alla havslager.
*/
.gr-map-viewport {
    position: relative;
    z-index: 2;
}

.gr-map-controls {
    z-index: 10;
}

/*
Lite mer glasliknande kartkant.
*/
.gr-map,
.live-map,
.result-center-map {
    border:
        1px solid
        rgba(232, 248, 255, 0.72);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.68),
        inset 0 -24px 48px rgba(18, 72, 100, 0.15),
        0 16px 35px rgba(19, 59, 82, 0.18);
}

/*
Mobil: minska texturen något så havet förblir rent
på små skärmar.
*/
@media (max-width: 800px) {
    .gr-map::after,
    .live-map::after,
    .result-center-map::after {
        opacity: 0.18;

        background-size:
            40px 40px,
            54px 54px;
    }

    .gr-map::before,
    .live-map::before,
    .result-center-map::before {
        mix-blend-mode: normal;
        opacity: 0.72;
    }
}

/* ======================================================
   GeoRankle Map Engine 5.3
   Step 3: Coastline Glow
====================================================== */

/* Basland */
.gr-country {

    stroke: rgba(72, 95, 86, .82) !important;

    stroke-width: .55 !important;

    filter:

        drop-shadow(
            0 0 0.8px
            rgba(235,255,255,.45)
        )

        drop-shadow(
            0 0 2px
            rgba(124,227,235,.22)
        )

        drop-shadow(
            .7px 1.2px 1.4px
            rgba(21,64,71,.22)
        )

        !important;
}

/* Hover */

.gr-country:hover{

    filter:

        drop-shadow(
            0 0 1px
            rgba(255,255,255,.55)
        )

        drop-shadow(
            0 0 4px
            rgba(139,236,255,.34)
        )

        drop-shadow(
            1px 2px 2px
            rgba(16,56,61,.28)
        )

        !important;

}

/* ======================================================
   Soft Coast Atmosphere
====================================================== */

.gr-map::after,
.live-map::after,
.result-center-map::after{

    content:"";

    position:absolute;

    inset:0;

    pointer-events:none;

    z-index:1;

    background:

        radial-gradient(
            ellipse at center,
            rgba(150,238,255,.06),
            transparent 68%
        );

    mix-blend-mode:screen;

    opacity:.65;

}

/* ======================================================
   GeoRankle Map Engine 5.4
   Step 4: simulated land relief
====================================================== */

/*
   Grundrelief:
   - ljust från övre vänster
   - mörkare mot nedre höger
   - svagt kustljus
*/
.gr-country {
    fill: #c8d3ad !important;

    stroke: rgba(67, 91, 80, 0.78) !important;
    stroke-width: 0.52 !important;
    stroke-linejoin: round;

    paint-order: stroke fill;
    shape-rendering: geometricPrecision;

    filter:
        /* Ljus kant från nordväst */
        drop-shadow(
            -0.75px -0.85px 0
            rgba(255, 255, 231, 0.42)
        )

        /* Mycket svag turkos kustreflektion */
        drop-shadow(
            0 0 1.4px
            rgba(142, 228, 233, 0.18)
        )

        /* Första terrängskuggan */
        drop-shadow(
            0.75px 1px 0.45px
            rgba(65, 86, 67, 0.22)
        )

        /* Djupare skugga under landmassan */
        drop-shadow(
            1.5px 2.2px 1.5px
            rgba(24, 62, 66, 0.22)
        )

        brightness(1.015)
        saturate(0.96)

        !important;

    transition:
        fill 0.3s ease,
        stroke 0.3s ease,
        filter 0.3s ease,
        opacity 0.3s ease;
}

/*
   Gemensam, mycket mjuk skugga runt hela världslagret.
   Den binder ihop de separata landpolygonerna visuellt.
*/
.gr-map-layer {
    filter:
        drop-shadow(
            0 3px 4px
            rgba(21, 58, 67, 0.14)
        );
}

/*
   Hover: landet får lite starkare ljus och ser något
   mer upphöjt ut, utan att faktiskt flyttas.
*/
.gr-country:hover {
    fill: #d2dcbc !important;
    stroke: rgba(49, 73, 63, 0.9) !important;

    filter:
        drop-shadow(
            -0.9px -1px 0
            rgba(255, 255, 237, 0.52)
        )
        drop-shadow(
            0 0 2.6px
            rgba(148, 232, 238, 0.28)
        )
        drop-shadow(
            0.9px 1.2px 0.6px
            rgba(61, 82, 64, 0.25)
        )
        drop-shadow(
            1.8px 2.6px 2px
            rgba(21, 54, 59, 0.27)
        )
        brightness(1.035)
        saturate(1.02)

        !important;
}

/*
   Gissade länder behåller reliefen, men får ett
   varmt gult ljus.
*/
.gr-country.gr-guessed {
    fill: #efc84f !important;
    stroke: #b98516 !important;
    stroke-width: 1.2 !important;

    filter:
        drop-shadow(
            -0.7px -0.8px 0
            rgba(255, 247, 186, 0.58)
        )
        drop-shadow(
            0 0 3px
            rgba(255, 218, 82, 0.68)
        )
        drop-shadow(
            1.2px 1.8px 1.2px
            rgba(108, 74, 10, 0.34)
        )

        !important;
}

/*
   Rätt land får samma präglade effekt med grön ton.
*/
.gr-country.gr-answer {
    fill: #59b768 !important;
    stroke: #247e38 !important;
    stroke-width: 1.5 !important;

    filter:
        drop-shadow(
            -0.7px -0.8px 0
            rgba(207, 255, 210, 0.58)
        )
        drop-shadow(
            0 0 4px
            rgba(91, 221, 112, 0.74)
        )
        drop-shadow(
            1.3px 2px 1.4px
            rgba(21, 92, 39, 0.38)
        )

        !important;
}

/*
   När rätt svar visas ska hover inte byta tillbaka
   till den vanliga landfärgen.
*/
.gr-country.gr-answer:hover {
    fill: #63c172 !important;
}

/*
   Samma skydd för ett redan gissat land.
*/
.gr-country.gr-guessed:hover {
    fill: #f3ce57 !important;
}

/*
   På mindre skärmar reducerar vi filtermängden.
   Det ger renare kanter och bättre prestanda.
*/
@media (max-width: 800px) {
    .gr-country {
        filter:
            drop-shadow(
                -0.45px -0.5px 0
                rgba(255, 255, 231, 0.36)
            )
            drop-shadow(
                0 0 1px
                rgba(142, 228, 233, 0.14)
            )
            drop-shadow(
                0.8px 1.2px 0.8px
                rgba(27, 65, 68, 0.2)
            )

            !important;
    }

    .gr-map-layer {
        filter:
            drop-shadow(
                0 2px 2px
                rgba(21, 58, 67, 0.12)
            );
    }
}

/*
   Mindre visuellt arbete för användare som föredrar
   reducerade effekter.
*/
@media (prefers-reduced-motion: reduce) {
    .gr-country {
        transition: none;
    }
}

/* ======================================================
   GeoRankle Map Engine 5.5
   Step 5: Cinematic Flight Route
====================================================== */

.gr-flight-shadow{

    stroke:rgba(20,42,53,.18)!important;

    stroke-width:6!important;

    opacity:.38!important;

    stroke-linecap:round;

}

.gr-flight-line{

    stroke:#d95a46!important;

    stroke-width:2.15!important;

    opacity:.92!important;

    stroke-linecap:round;

    stroke-linejoin:round;

    filter:

        drop-shadow(
            0 0 2px
            rgba(255,255,255,.18)
        )

        drop-shadow(
            0 0 5px
            rgba(217,90,70,.22)
        );

}

.gr-final-flight-line{

    stroke:#43b56e!important;

    stroke-width:3!important;

    filter:

        drop-shadow(
            0 0 6px
            rgba(67,181,110,.35)
        );

}

.gr-flight-travel-dot{

    fill:#ffffff;

    stroke:#d95a46;

    stroke-width:2.5;

    filter:

        drop-shadow(
            0 0 5px
            rgba(255,255,255,.6)
        )

        drop-shadow(
            0 0 8px
            rgba(217,90,70,.35)
        );

}

/* ======================================================
   GeoRankle Map Engine 5.5
   Cinematic route animation support
====================================================== */

/*
Gamla markörer ska vara stabila när kartan renderas om.
Endast den nyaste markören animeras av JavaScript.
*/
.gr-dot-marker {
    animation: none !important;
    animation-delay: 0s !important;
    opacity: 1;
}

/* Den nya destinationen hålls dold under flygresan. */
.gr-dot-marker.gr-marker-pending {
    opacity: 0 !important;
}

/* Markören poppar fram när färdpunkten kommer fram. */
.gr-dot-marker.gr-marker-arriving {
    animation:
        grMarkerArrival
        0.46s
        cubic-bezier(0.18, 1.35, 0.35, 1)
        both !important;

    animation-delay: 0s !important;
}

@keyframes grMarkerArrival {
    0% {
        opacity: 0;
        transform: scale(0.35);
    }

    58% {
        opacity: 1;
        transform: scale(1.22);
    }

    78% {
        transform: scale(0.94);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/*
Den flygande punkten skapas dynamiskt av
map-animation.js.
*/
.gr-flight-travel-dot {
    fill: #ffffff !important;
    stroke-width: 2.4 !important;
    vector-effect: non-scaling-stroke;
    pointer-events: none;

    filter:
        drop-shadow(
            0 0 2px
            rgba(255, 255, 255, 0.95)
        )
        drop-shadow(
            0 0 6px
            rgba(217, 90, 70, 0.58)
        );
}

/*
En mycket diskret puls i hela kartan när rutten
är färdig.
*/
.gr-map-breathe .gr-map-viewport {
    animation:
        grMapBreathe
        0.42s
        cubic-bezier(0.2, 0.8, 0.2, 1)
        both;
}

@keyframes grMapBreathe {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.008);
    }

    100% {
        transform: scale(1);
    }
}

/*
Förhindra att SVG-linjerna fångar mus- eller
touchinteraktion.
*/
.gr-flight-line,
.gr-flight-shadow,
.gr-flight-travel-dot {
    pointer-events: none;
}

/* Reducerade rörelser */
@media (prefers-reduced-motion: reduce) {
    .gr-dot-marker.gr-marker-arriving,
    .gr-map-breathe .gr-map-viewport {
        animation: none !important;
    }

    .gr-dot-marker.gr-marker-pending {
        opacity: 1 !important;
    }
}

/* ======================================================
   GeoRankle Map Engine 5.6
   Premium map markers
====================================================== */

/*
Grundinställning för alla markörer.
*/
.gr-dot-marker {
    pointer-events: none;
    transform-box: fill-box;
    transform-origin: center;
}

/*
Mjuk markörskugga bakom själva kroppen.
*/
.gr-dot-shadow {
    fill: rgba(15, 38, 48, 0.24) !important;
    filter:
        blur(0.65px)
        drop-shadow(
            0 2px 2px
            rgba(12, 35, 43, 0.18)
        );
}

/*
Gissningsmarkörens huvudkropp.
Vi använder orange/guld för att separera den
från den röda flygrutten.
*/
.gr-guess-marker .gr-dot-body {
    fill: #f2b544 !important;
    stroke: rgba(255, 255, 255, 0.98) !important;
    stroke-width: 3.1 !important;
    vector-effect: non-scaling-stroke;

    filter:
        drop-shadow(
            0 1px 1px
            rgba(73, 49, 10, 0.25)
        )
        drop-shadow(
            0 0 4px
            rgba(255, 202, 77, 0.35)
        );
}

/*
Tydligare nummer i mitten.
*/
.gr-dot-number {
    fill: #51370d !important;
    font-family:
        Nunito,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 7px !important;
    font-weight: 900 !important;
    text-anchor: middle;
    dominant-baseline: middle;
    paint-order: stroke fill;

    stroke: rgba(255, 239, 193, 0.65);
    stroke-width: 0.7px;
    vector-effect: non-scaling-stroke;
}

/*
Svarmarkörens gröna kropp.
*/
.gr-answer-marker .gr-dot-body {
    fill: #45b96d !important;
    stroke: rgba(255, 255, 255, 0.98) !important;
    stroke-width: 3.2 !important;
    vector-effect: non-scaling-stroke;

    filter:
        drop-shadow(
            0 1px 1px
            rgba(20, 84, 43, 0.28)
        )
        drop-shadow(
            0 0 6px
            rgba(69, 185, 109, 0.48)
        );
}

/*
Diskret puls bakom rätt svar.
*/
.gr-answer-marker .gr-dot-pulse {
    fill: rgba(69, 185, 109, 0.16) !important;
    stroke: rgba(69, 185, 109, 0.3) !important;
    stroke-width: 1.4 !important;
    vector-effect: non-scaling-stroke;

    transform-box: fill-box;
    transform-origin: center;

    animation:
        grAnswerPulse
        1.7s
        ease-out
        infinite;
}

@keyframes grAnswerPulse {
    0% {
        opacity: 0.72;
        transform: scale(0.58);
    }

    65% {
        opacity: 0.12;
        transform: scale(1.25);
    }

    100% {
        opacity: 0;
        transform: scale(1.38);
    }
}

/*
Vit checkmark med lätt kontrastkant.
*/
.gr-dot-check {
    fill: #ffffff !important;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 7.2px !important;
    font-weight: 900 !important;
    text-anchor: middle;
    dominant-baseline: middle;

    paint-order: stroke fill;
    stroke: rgba(28, 106, 55, 0.65);
    stroke-width: 0.7px;
    vector-effect: non-scaling-stroke;
}

/*
Ledlinjer för små länder får samma premiumkänsla.
*/
.gr-marker-leader {
    stroke: rgba(55, 76, 73, 0.62) !important;
    stroke-width: 1.15 !important;
    stroke-linecap: round;
    stroke-dasharray: 2.5 2.5;
    vector-effect: non-scaling-stroke;
    pointer-events: none;

    filter:
        drop-shadow(
            0 1px 1px
            rgba(255, 255, 255, 0.55)
        );
}

/*
Liten glöd vid ankomst för den senaste markören.
*/
.gr-dot-marker.gr-marker-arriving .gr-dot-body {
    animation:
        grMarkerArrivalGlow
        0.7s
        ease-out
        both;
}

@keyframes grMarkerArrivalGlow {
    0% {
        filter:
            drop-shadow(
                0 0 14px
                rgba(255, 255, 255, 0.95)
            )
            drop-shadow(
                0 0 20px
                rgba(242, 181, 68, 0.72)
            );
    }

    100% {
        filter:
            drop-shadow(
                0 1px 1px
                rgba(73, 49, 10, 0.25)
            )
            drop-shadow(
                0 0 4px
                rgba(255, 202, 77, 0.35)
            );
    }
}

/*
Svarmarkören ska behålla grön ankomstglöd.
*/
.gr-answer-marker.gr-marker-arriving .gr-dot-body {
    animation:
        grAnswerArrivalGlow
        0.75s
        ease-out
        both;
}

@keyframes grAnswerArrivalGlow {
    0% {
        filter:
            drop-shadow(
                0 0 16px
                rgba(255, 255, 255, 0.95)
            )
            drop-shadow(
                0 0 22px
                rgba(69, 185, 109, 0.85)
            );
    }

    100% {
        filter:
            drop-shadow(
                0 1px 1px
                rgba(20, 84, 43, 0.28)
            )
            drop-shadow(
                0 0 6px
                rgba(69, 185, 109, 0.48)
            );
    }
}

/*
På små skärmar gör vi markörerna lite renare
och minskar filtermängden.
*/
@media (max-width: 800px) {
    .gr-guess-marker .gr-dot-body,
    .gr-answer-marker .gr-dot-body {
        stroke-width: 2.6 !important;
    }

    .gr-dot-number,
    .gr-dot-check {
        font-size: 6.6px !important;
    }

    .gr-marker-leader {
        stroke-width: 1 !important;
    }
}

/*
Reducerade rörelser.
*/
@media (prefers-reduced-motion: reduce) {
    .gr-answer-marker .gr-dot-pulse,
    .gr-dot-marker.gr-marker-arriving .gr-dot-body {
        animation: none !important;
    }
}

/* ======================================================
   GeoRankle Map Engine 5.7
   Smart marker placement
====================================================== */

/*
Den exakta landspositionen när markören behöver
flyttas åt sidan.
*/
.gr-marker-anchor {
    fill: rgba(73, 83, 75, 0.9);
    stroke: rgba(255, 255, 255, 0.94);
    stroke-width: 1.35;
    vector-effect: non-scaling-stroke;
    pointer-events: none;

    filter:
        drop-shadow(
            0 1px 2px
            rgba(20, 40, 35, 0.28)
        );
}

.gr-marker-anchor-answer {
    fill: #42b96c;
    stroke: #ffffff;
}

/*
Ledlinjens normala utseende.
*/
.gr-marker-leader {
    fill: none;
    stroke: rgba(56, 73, 67, 0.58) !important;
    stroke-width: 1.05 !important;
    stroke-linecap: round;
    stroke-dasharray: 2.4 2.8;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

/*
Den senaste markörens ledlinje är något tydligare.
*/
.gr-marker-leader-latest {
    stroke: rgba(157, 105, 25, 0.78) !important;
    stroke-width: 1.3 !important;
}

/*
Rätt svar får grön ledlinje.
*/
.gr-marker-leader-answer {
    stroke: rgba(42, 145, 78, 0.82) !important;
}

/*
Gör den senaste markören något tydligare utan att
ändra dess faktiska storlek.
*/
.gr-marker-latest .gr-dot-body {
    stroke-width: 3.35 !important;
}

/*
SVG-texten är nu vertikalt centrerad via CSS.
JavaScript använder därför y="0".
*/
.gr-dot-number,
.gr-dot-check {
    dominant-baseline: central !important;
}

/*
Ledlinjer och ankare tonas fram tillsammans med
den nya renderingen.
*/
.gr-marker-leader,
.gr-marker-anchor {
    animation:
        grMarkerGuideFade
        0.32s
        ease-out
        both;
}

@keyframes grMarkerGuideFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 800px) {
    .gr-marker-anchor {
        r: 2;
        stroke-width: 1.1;
    }

    .gr-marker-leader {
        stroke-width: 0.9 !important;
    }

    .gr-marker-leader-latest,
    .gr-marker-leader-answer {
        stroke-width: 1.1 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gr-marker-leader,
    .gr-marker-anchor {
        animation: none !important;
    }
}

/* ======================================================
   GeoRankle Map Engine 5.8
   Clean route-only presentation
====================================================== */

.gr-dot-marker,
.gr-marker-leader,
.gr-marker-anchor {
    display: none !important;
}

/* ======================================================
   GeoRankle Map Engine 5.9
   Route hierarchy and country focus
====================================================== */

/*
Äldre rutter ligger kvar som en diskret historik.
*/
.gr-flight-line {
    stroke: rgba(203, 91, 66, 0.52) !important;
    stroke-width: 1.65 !important;
    opacity: 0.58 !important;

    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;

    filter:
        drop-shadow(
            0 1px 1px
            rgba(80, 35, 25, 0.16)
        );
}

/*
Skuggorna ska vara mycket subtila så kartan inte
blir rörig när flera rutter finns.
*/
.gr-flight-shadow {
    stroke: rgba(35, 44, 40, 0.2) !important;
    stroke-width: 4.2 !important;
    opacity: 0.24 !important;

    stroke-linecap: round;
    vector-effect: non-scaling-stroke;

    filter: blur(0.45px);
}

/*
Senaste rutten får större kontrast.
*/
.gr-flight-line.gr-route-latest {
    stroke: #d95d46 !important;
    stroke-width: 2.7 !important;
    opacity: 0.96 !important;

    filter:
        drop-shadow(
            0 1px 1px
            rgba(96, 38, 28, 0.28)
        )
        drop-shadow(
            0 0 4px
            rgba(217, 93, 70, 0.28)
        );
}

.gr-flight-shadow.gr-route-latest {
    stroke: rgba(42, 49, 45, 0.34) !important;
    stroke-width: 5.2 !important;
    opacity: 0.32 !important;
}

/*
Slutrutten till rätt land använder grönt.
Denna regel ligger efter latest-regeln och vinner därför.
*/
.gr-final-flight-line,
.gr-final-flight-line.gr-route-latest {
    stroke: #3ea966 !important;
    stroke-width: 3.1 !important;
    opacity: 1 !important;

    filter:
        drop-shadow(
            0 1px 1px
            rgba(22, 86, 45, 0.3)
        )
        drop-shadow(
            0 0 6px
            rgba(62, 169, 102, 0.42)
        );
}

/*
Gissade länder får varm orange färg.
*/
.gr-country.gr-guessed {
    fill: #e8a14c !important;
    stroke: rgba(118, 74, 25, 0.7) !important;
    stroke-width: 0.75 !important;

    filter:
        drop-shadow(
            0 1px 1px
            rgba(98, 59, 20, 0.2)
        );
}

/*
Lite mjukare hover på redan gissade länder.
*/
.gr-country.gr-guessed:hover {
    fill: #efb15f !important;
}

/*
Rätt land får tydlig men naturlig grön färg.
*/
.gr-country.gr-answer {
    fill: #45b96d !important;
    stroke: rgba(25, 105, 54, 0.9) !important;
    stroke-width: 1.15 !important;

    transform-box: fill-box;
    transform-origin: center;

    animation:
        grAnswerCountryArrival
        0.8s
        cubic-bezier(0.2, 0.8, 0.2, 1)
        both;

    filter:
        drop-shadow(
            0 1px 1px
            rgba(18, 83, 42, 0.28)
        )
        drop-shadow(
            0 0 7px
            rgba(69, 185, 109, 0.38)
        );
}

@keyframes grAnswerCountryArrival {
    0% {
        opacity: 0.55;
        filter:
            drop-shadow(
                0 0 18px
                rgba(113, 224, 146, 0.9)
            );
    }

    55% {
        opacity: 1;
        filter:
            drop-shadow(
                0 0 11px
                rgba(69, 185, 109, 0.65)
            );
    }

    100% {
        opacity: 1;
        filter:
            drop-shadow(
                0 1px 1px
                rgba(18, 83, 42, 0.28)
            )
            drop-shadow(
                0 0 7px
                rgba(69, 185, 109, 0.38)
            );
    }
}

/*
När svaret har visats får landet en mycket långsam,
diskret glöd. Ingen skalning används eftersom små
ö-länder annars kan se ut att flytta sig.
*/
.gr-country.gr-answer {
    animation:
        grAnswerCountryArrival
        0.8s
        cubic-bezier(0.2, 0.8, 0.2, 1)
        both,
        grAnswerCountryGlow
        2.8s
        ease-in-out
        0.8s
        infinite
        alternate;
}

@keyframes grAnswerCountryGlow {
    from {
        filter:
            drop-shadow(
                0 1px 1px
                rgba(18, 83, 42, 0.26)
            )
            drop-shadow(
                0 0 4px
                rgba(69, 185, 109, 0.28)
            );
    }

    to {
        filter:
            drop-shadow(
                0 1px 1px
                rgba(18, 83, 42, 0.3)
            )
            drop-shadow(
                0 0 10px
                rgba(69, 185, 109, 0.5)
            );
    }
}

/*
Den flygande punkten följer färgen på aktuell rutt.
*/
.gr-flight-travel-dot {
    fill: #ffffff !important;
    stroke: #d95d46 !important;
    stroke-width: 2.5 !important;

    filter:
        drop-shadow(
            0 0 3px
            rgba(255, 255, 255, 0.95)
        )
        drop-shadow(
            0 0 7px
            rgba(217, 93, 70, 0.55)
        );
}

/*
Mobil: något tunnare linjer.
*/
@media (max-width: 800px) {
    .gr-flight-line {
        stroke-width: 1.35 !important;
    }

    .gr-flight-line.gr-route-latest {
        stroke-width: 2.25 !important;
    }

    .gr-final-flight-line,
    .gr-final-flight-line.gr-route-latest {
        stroke-width: 2.6 !important;
    }

    .gr-flight-shadow {
        stroke-width: 3.5 !important;
    }

    .gr-flight-shadow.gr-route-latest {
        stroke-width: 4.4 !important;
    }
}

/*
Tillgänglighet.
*/
@media (prefers-reduced-motion: reduce) {
    .gr-country.gr-answer {
        animation: none !important;
    }
}

/* ======================================================
   GeoRankle Map Engine 6.0
   Cinematic camera follow
====================================================== */

.gr-map-viewport {
    overflow: hidden;
    touch-action: none;
}

.gr-map-layer {
    transform-origin: 0 0;
    will-change: transform;
}

/*
Vanliga automatiska kameraförflyttningar.
Används inte under själva route-follow-loopen.
*/
.gr-map-layer-animated {
    transition:
        transform
        850ms
        cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
    .gr-map-layer,
    .gr-map-layer-animated {
        transition: none !important;
    }
}

/*
GeoRankle Map Engine 7.0
map-engine.css

Append this complete 7.0 section after earlier historical versions.
*/

:root {
    --gr-map-bg: #08111f;
    --gr-map-bg-soft: #0d1a2d;
    --gr-map-border: rgba(148, 163, 184, 0.22);
    --gr-map-country-fill: #26364d;
    --gr-map-country-stroke: #64748b;
    --gr-map-country-hover: #344963;
    --gr-map-guessed-fill: #f59e0b;
    --gr-map-guessed-stroke: #fcd34d;
    --gr-map-answer-fill: #22c55e;
    --gr-map-answer-stroke: #86efac;
    --gr-map-route: #38bdf8;
    --gr-map-route-final: #4ade80;
    --gr-map-route-shadow: rgba(15, 23, 42, 0.9);
    --gr-map-travel-dot: #f8fafc;
    --gr-map-travel-dot-ring: #38bdf8;
    --gr-map-travel-dot-final-ring: #4ade80;
    --gr-map-control-bg: rgba(15, 23, 42, 0.82);
    --gr-map-control-bg-hover: rgba(30, 41, 59, 0.96);
    --gr-map-control-border: rgba(148, 163, 184, 0.28);
    --gr-map-control-text: #f8fafc;
    --gr-map-focus-ring: rgba(56, 189, 248, 0.5);
    --gr-map-radius: 18px;
    --gr-map-control-radius: 12px;
    --gr-map-shadow:
        0 24px 60px rgba(2, 6, 23, 0.34),
        0 4px 14px rgba(2, 6, 23, 0.2);
    --gr-map-transition-fast: 160ms;
    --gr-map-transition-normal: 280ms;
    --gr-map-transition-slow: 520ms;
    --gr-camera-zoom: 1;
}

/* Root and viewport */
.gr-map,
.gr-map-engine,
[data-georankle-map] {
    position: relative;
    width: 100%;
    min-width: 0;
    isolation: isolate;
}

.gr-map-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1000 / 560;
    overflow: hidden;
    border: 1px solid var(--gr-map-border);
    border-radius: var(--gr-map-radius);
    background:
        radial-gradient(circle at 50% 42%, rgba(56, 189, 248, 0.08), transparent 42%),
        linear-gradient(180deg, var(--gr-map-bg-soft), var(--gr-map-bg));
    box-shadow: var(--gr-map-shadow);
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: contain;
}

.gr-map-viewport.gr-map-dragging {
    cursor: grabbing;
}

.gr-map-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    shape-rendering: geometricPrecision;
    text-rendering: geometricPrecision;
}

.gr-map-layer {
    transform-box: fill-box;
    transform-origin: 0 0;
    will-change: transform;
}

.gr-map-ocean,
.gr-ocean {
    fill: transparent;
    pointer-events: none;
}

.gr-map-grid,
.gr-map-graticule {
    fill: none;
    stroke: rgba(148, 163, 184, 0.09);
    stroke-width: 0.75;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

/* Countries */
.gr-country {
    fill: var(--gr-map-country-fill);
    stroke: var(--gr-map-country-stroke);
    stroke-width: 0.72;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    transition:
        fill var(--gr-map-transition-normal) ease,
        stroke var(--gr-map-transition-normal) ease,
        opacity var(--gr-map-transition-normal) ease,
        filter var(--gr-map-transition-normal) ease;
    pointer-events: visiblePainted;
}

.gr-country:hover {
    fill: var(--gr-map-country-hover);
}

.gr-country[data-guessed="true"],
.gr-country.gr-guessed {
    fill: var(--gr-map-guessed-fill);
    stroke: var(--gr-map-guessed-stroke);
    stroke-width: 1.1;
}

.gr-country[data-answer="true"],
.gr-country.gr-answer {
    fill: var(--gr-map-answer-fill);
    stroke: var(--gr-map-answer-stroke);
    stroke-width: 1.25;
}

.gr-country.gr-country-pending {
    fill: var(--gr-map-country-fill);
    stroke: var(--gr-map-country-stroke);
    opacity: 0.72;
    filter: saturate(0.55) brightness(0.8);
}

.gr-country.gr-country-arriving {
    opacity: 0.94;
    filter:
        saturate(0.8)
        brightness(1.08)
        drop-shadow(0 0 4px rgba(56, 189, 248, 0.35));
}

.gr-country.gr-country-arrived {
    animation: gr-country-arrive 540ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.gr-country.gr-country-landed {
    filter:
        brightness(1.14)
        drop-shadow(0 0 6px rgba(248, 250, 252, 0.44));
}

.gr-map-layer .gr-country {
    stroke-width: calc(0.72 / var(--gr-camera-zoom));
}

.gr-map-layer .gr-country.gr-guessed {
    stroke-width: calc(1.1 / var(--gr-camera-zoom));
}

.gr-map-layer .gr-country.gr-answer {
    stroke-width: calc(1.25 / var(--gr-camera-zoom));
}

/* Routes */
.gr-flight-routes,
.gr-route-layer {
    pointer-events: none;
}

.gr-flight-line,
.gr-flight-shadow {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    vector-effect: non-scaling-stroke;
}

.gr-flight-shadow {
    stroke: var(--gr-map-route-shadow);
    stroke-width: 7;
    opacity: 0.55;
    filter: blur(1.25px);
}

.gr-flight-line {
    stroke: var(--gr-map-route);
    stroke-width: 3.4;
    opacity: 0.96;
    filter:
        drop-shadow(0 0 3px rgba(56, 189, 248, 0.54))
        drop-shadow(0 0 8px rgba(56, 189, 248, 0.22));
}

.gr-flight-line[data-final-route="true"],
.gr-flight-line.gr-route-final {
    stroke: var(--gr-map-route-final);
    stroke-width: 3.8;
    filter:
        drop-shadow(0 0 4px rgba(74, 222, 128, 0.62))
        drop-shadow(0 0 10px rgba(74, 222, 128, 0.28));
}

.gr-flight-line:not(.gr-route-latest) {
    opacity: 0.56;
}

.gr-flight-shadow:not(.gr-route-latest) {
    opacity: 0.28;
}

.gr-flight-line.gr-route-latest {
    opacity: 1;
}

.gr-flight-line.gr-route-drawing,
.gr-flight-shadow.gr-route-drawing {
    will-change: stroke-dashoffset, opacity;
}

.gr-flight-line.gr-route-drawn {
    opacity: 0.9;
}

.gr-flight-shadow.gr-route-drawn {
    opacity: 0.46;
}

/* Travel dot */
.gr-travel-dot {
    fill: var(--gr-map-travel-dot);
    stroke: var(--gr-map-travel-dot-ring);
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
    transform-box: fill-box;
    transform-origin: center;
    filter:
        drop-shadow(0 0 3px rgba(248, 250, 252, 0.84))
        drop-shadow(0 0 8px rgba(56, 189, 248, 0.72));
    animation: gr-travel-dot-breathe 760ms ease-in-out infinite alternate;
    will-change: cx, cy, transform, opacity, filter;
}

.gr-travel-dot.gr-final-travel-dot {
    stroke: var(--gr-map-travel-dot-final-ring);
    filter:
        drop-shadow(0 0 3px rgba(248, 250, 252, 0.9))
        drop-shadow(0 0 10px rgba(74, 222, 128, 0.78));
}

.gr-travel-dot.gr-travel-dot-landed {
    animation: gr-travel-dot-land 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Landing and pulses */
.gr-country.gr-guess-pulse {
    animation: gr-guess-pulse 700ms ease-out both;
}

.gr-country.gr-answer-pulse {
    animation: gr-answer-pulse 980ms ease-out both;
}

.gr-route-animation-active .gr-map-viewport {
    cursor: progress;
}

.gr-route-animation-active .gr-map-controls {
    opacity: 0.8;
}

.gr-route-landed .gr-map-viewport {
    box-shadow:
        var(--gr-map-shadow),
        inset 0 0 28px rgba(56, 189, 248, 0.08);
}

.gr-final-route-complete .gr-map-viewport {
    box-shadow:
        var(--gr-map-shadow),
        inset 0 0 36px rgba(74, 222, 128, 0.12);
}

/* Controls */
.gr-map-controls {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition:
        opacity var(--gr-map-transition-fast) ease,
        transform var(--gr-map-transition-fast) ease;
}

.gr-map-controls button,
.gr-map-control {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--gr-map-control-border);
    border-radius: var(--gr-map-control-radius);
    background: var(--gr-map-control-bg);
    color: var(--gr-map-control-text);
    box-shadow:
        0 8px 20px rgba(2, 6, 23, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition:
        background-color var(--gr-map-transition-fast) ease,
        border-color var(--gr-map-transition-fast) ease,
        transform var(--gr-map-transition-fast) ease,
        box-shadow var(--gr-map-transition-fast) ease,
        opacity var(--gr-map-transition-fast) ease;
}

.gr-map-controls button:hover,
.gr-map-control:hover {
    background: var(--gr-map-control-bg-hover);
    border-color: rgba(148, 163, 184, 0.48);
    transform: translateY(-1px);
}

.gr-map-controls button:active,
.gr-map-control:active {
    transform: translateY(0) scale(0.97);
}

.gr-map-controls button:focus-visible,
.gr-map-control:focus-visible {
    outline: 3px solid var(--gr-map-focus-ring);
    outline-offset: 2px;
}

.gr-map-controls button:disabled,
.gr-map-control:disabled {
    opacity: 0.42;
    cursor: default;
    transform: none;
}

.gr-map-control svg,
.gr-map-controls button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* Loading and errors */
.gr-map-loading,
.gr-map-error,
.gr-map-message {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 24px;
    border-radius: inherit;
    background: rgba(8, 17, 31, 0.8);
    color: #e2e8f0;
    text-align: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.gr-map-loading[hidden],
.gr-map-error[hidden],
.gr-map-message[hidden] {
    display: none;
}

.gr-map-loading::before {
    content: "";
    width: 34px;
    height: 34px;
    border: 3px solid rgba(148, 163, 184, 0.28);
    border-top-color: var(--gr-map-route);
    border-radius: 50%;
    animation: gr-map-spin 720ms linear infinite;
}

.gr-map-error {
    background: rgba(69, 10, 10, 0.84);
    color: #fee2e2;
}

.gr-map-is-loading .gr-map-svg,
.gr-map-loading-active .gr-map-svg {
    opacity: 0.4;
}

.gr-map-is-loading .gr-map-controls,
.gr-map-loading-active .gr-map-controls {
    pointer-events: none;
    opacity: 0.35;
}

/* Accessibility */
.gr-map-viewport:focus-visible {
    outline: 3px solid var(--gr-map-focus-ring);
    outline-offset: 3px;
}

.gr-map-screen-reader-only,
.gr-map-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Keyframes */
@keyframes gr-country-arrive {
    0% {
        opacity: 0.76;
        filter:
            brightness(0.8)
            saturate(0.62)
            drop-shadow(0 0 0 rgba(56, 189, 248, 0));
    }
    54% {
        opacity: 1;
        filter:
            brightness(1.22)
            saturate(1.18)
            drop-shadow(0 0 8px rgba(248, 250, 252, 0.48));
    }
    100% {
        opacity: 1;
        filter: none;
    }
}

@keyframes gr-travel-dot-breathe {
    from {
        transform: scale(0.92);
        opacity: 0.92;
    }
    to {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes gr-travel-dot-land {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    42% {
        transform: scale(1.75);
        opacity: 1;
    }
    100% {
        transform: scale(0.35);
        opacity: 0;
    }
}

@keyframes gr-guess-pulse {
    0% {
        filter:
            brightness(1)
            drop-shadow(0 0 0 rgba(245, 158, 11, 0));
    }
    34% {
        filter:
            brightness(1.28)
            drop-shadow(0 0 10px rgba(245, 158, 11, 0.88));
    }
    100% {
        filter:
            brightness(1)
            drop-shadow(0 0 0 rgba(245, 158, 11, 0));
    }
}

@keyframes gr-answer-pulse {
    0% {
        filter:
            brightness(1)
            drop-shadow(0 0 0 rgba(74, 222, 128, 0));
    }
    28% {
        filter:
            brightness(1.36)
            drop-shadow(0 0 12px rgba(74, 222, 128, 0.96))
            drop-shadow(0 0 24px rgba(74, 222, 128, 0.52));
    }
    62% {
        filter:
            brightness(1.12)
            drop-shadow(0 0 8px rgba(74, 222, 128, 0.52));
    }
    100% {
        filter:
            brightness(1)
            drop-shadow(0 0 0 rgba(74, 222, 128, 0));
    }
}

@keyframes gr-map-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 760px) {
    .gr-map-viewport {
        border-radius: 14px;
    }

    .gr-map-controls {
        top: 10px;
        right: 10px;
        gap: 6px;
    }

    .gr-map-controls button,
    .gr-map-control {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 18px;
    }

    .gr-flight-line {
        stroke-width: 3;
    }

    .gr-flight-line[data-final-route="true"],
    .gr-flight-line.gr-route-final {
        stroke-width: 3.4;
    }

    .gr-flight-shadow {
        stroke-width: 6;
    }
}

@media (max-width: 480px) {
    .gr-map-controls {
        flex-direction: row;
        top: auto;
        right: 10px;
        bottom: 10px;
    }

    .gr-map-controls button,
    .gr-map-control {
        width: 36px;
        height: 36px;
    }
}

/* Light theme */
@media (prefers-color-scheme: light) {
    :root {
        --gr-map-bg: #dbeafe;
        --gr-map-bg-soft: #eff6ff;
        --gr-map-border: rgba(71, 85, 105, 0.24);
        --gr-map-country-fill: #cbd5e1;
        --gr-map-country-stroke: #64748b;
        --gr-map-country-hover: #b6c3d4;
        --gr-map-route-shadow: rgba(15, 23, 42, 0.3);
        --gr-map-control-bg: rgba(255, 255, 255, 0.88);
        --gr-map-control-bg-hover: rgba(248, 250, 252, 0.98);
        --gr-map-control-border: rgba(71, 85, 105, 0.24);
        --gr-map-control-text: #0f172a;
    }

    .gr-map-loading,
    .gr-map-message {
        background: rgba(239, 246, 255, 0.84);
        color: #0f172a;
    }

    .gr-map-error {
        background: rgba(254, 226, 226, 0.9);
        color: #7f1d1d;
    }
}

.gr-theme-dark,
.dark,
[data-theme="dark"] {
    --gr-map-bg: #08111f;
    --gr-map-bg-soft: #0d1a2d;
    --gr-map-country-fill: #26364d;
    --gr-map-country-stroke: #64748b;
    --gr-map-country-hover: #344963;
    --gr-map-control-bg: rgba(15, 23, 42, 0.82);
    --gr-map-control-bg-hover: rgba(30, 41, 59, 0.96);
    --gr-map-control-text: #f8fafc;
}

.gr-theme-light,
.light,
[data-theme="light"] {
    --gr-map-bg: #dbeafe;
    --gr-map-bg-soft: #eff6ff;
    --gr-map-country-fill: #cbd5e1;
    --gr-map-country-stroke: #64748b;
    --gr-map-country-hover: #b6c3d4;
    --gr-map-route-shadow: rgba(15, 23, 42, 0.3);
    --gr-map-control-bg: rgba(255, 255, 255, 0.88);
    --gr-map-control-bg-hover: rgba(248, 250, 252, 0.98);
    --gr-map-control-text: #0f172a;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gr-country,
    .gr-map-controls,
    .gr-map-controls button,
    .gr-map-control {
        transition-duration: 0.01ms !important;
    }

    .gr-country.gr-country-arrived,
    .gr-country.gr-guess-pulse,
    .gr-country.gr-answer-pulse,
    .gr-travel-dot,
    .gr-travel-dot.gr-travel-dot-landed,
    .gr-map-loading::before {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .gr-flight-line,
    .gr-flight-shadow,
    .gr-map-layer {
        transition: none !important;
    }
}

/* Print */
@media print {
    .gr-map-controls,
    .gr-map-loading,
    .gr-map-error,
    .gr-map-message,
    .gr-travel-dot {
        display: none !important;
    }

    .gr-map-viewport {
        border: 1px solid #94a3b8;
        box-shadow: none;
        background: #ffffff;
    }

    .gr-country {
        fill: #d1d5db;
        stroke: #6b7280;
    }

    .gr-country.gr-guessed {
        fill: #f59e0b;
    }

    .gr-country.gr-answer {
        fill: #22c55e;
    }
}

/* =========================================================
   GeoRankle Map Engine 7.1
   Runtime performance mode
   ========================================================= */

/*
map-camera.js adds .gr-camera-moving while the camera is
zooming, panning or settling.

map-animation.js adds .gr-route-animation-active while a
flight is in progress.

During those states, visual effects that require repeated
SVG rasterization are temporarily simplified.
*/

/* ---------------------------------------------------------
   Stable SVG rendering
   --------------------------------------------------------- */

.gr-map-svg {
    /*
    geometricPrecision can be expensive while hundreds of
    paths are transformed every frame. auto is considerably
    cheaper and remains visually clean at normal zoom levels.
    */
    shape-rendering: auto;
    text-rendering: auto;
}

.gr-map-layer {
    /*
    The camera itself writes the SVG transform.

    A CSS transition here would lag behind the JavaScript
    camera and make the map feel elastic or delayed.
    */
    transition: none !important;
}

/* ---------------------------------------------------------
   Camera movement
   --------------------------------------------------------- */

.gr-camera-moving .gr-map-layer,
.gr-route-animation-active .gr-map-layer {
    /*
    Filters on the complete map layer force the browser to
    rasterize the entire transformed world repeatedly.
    */
    filter: none !important;
}

/*
Disable individual country filters while the camera moves.

The fill and stroke colors remain unchanged, so the map still
looks designed, but hundreds of separate shadows no longer
need to be repainted on every frame.
*/

.gr-camera-moving .gr-country,
.gr-route-animation-active .gr-country {
    filter: none !important;

    transition:
        none !important;
}

/*
Hover effects are unnecessary during camera movement and can
trigger additional filter work as countries move underneath
the pointer.
*/

.gr-camera-moving .gr-country:hover,
.gr-route-animation-active .gr-country:hover {
    filter: none !important;

    fill:
        var(--gr-map-country-fill) !important;
}

/*
Preserve guessed and answer colors while movement effects are
disabled.
*/

.gr-camera-moving .gr-country.gr-guessed,
.gr-camera-moving .gr-country[data-guessed="true"],
.gr-route-animation-active .gr-country.gr-guessed,
.gr-route-animation-active .gr-country[data-guessed="true"] {
    fill:
        var(--gr-map-guessed-fill) !important;

    stroke:
        var(--gr-map-guessed-stroke) !important;
}

.gr-camera-moving .gr-country.gr-answer,
.gr-camera-moving .gr-country[data-answer="true"],
.gr-route-animation-active .gr-country.gr-answer,
.gr-route-animation-active .gr-country[data-answer="true"] {
    fill:
        var(--gr-map-answer-fill) !important;

    stroke:
        var(--gr-map-answer-stroke) !important;
}

/* ---------------------------------------------------------
   Routes during movement
   --------------------------------------------------------- */

/*
Blur and glow on moving SVG paths are expensive.

The route retains its normal color and width, but the browser
does not need to redraw blurred offscreen buffers each frame.
*/

.gr-camera-moving .gr-flight-shadow,
.gr-route-animation-active .gr-flight-shadow {
    filter:
        none !important;

    opacity:
        0.32 !important;
}

.gr-camera-moving .gr-flight-line,
.gr-route-animation-active .gr-flight-line {
    filter:
        none !important;
}

/*
Only the active route needs a painting optimization hint.
Do not keep will-change permanently on all historical routes.
*/

.gr-flight-line,
.gr-flight-shadow {
    will-change:
        auto;
}

.gr-flight-line.gr-route-drawing {
    will-change:
        stroke-dashoffset;
}

.gr-flight-shadow.gr-route-drawing {
    will-change:
        stroke-dashoffset,
        opacity;
}

/* ---------------------------------------------------------
   Travel dot
   --------------------------------------------------------- */

/*
The dot already moves every frame. A breathing animation and
animated filter force additional compositing work at the same
time. During flight, use a clean static dot instead.
*/

.gr-route-animation-active .gr-travel-dot {
    animation:
        none !important;

    filter:
        none !important;

    will-change:
        auto !important;
}

/*
A light ring keeps the dot visible without blur.
*/

.gr-route-animation-active .gr-travel-dot {
    fill:
        #ffffff !important;

    stroke:
        var(--gr-map-travel-dot-ring) !important;

    stroke-width:
        3 !important;
}

.gr-route-animation-active
.gr-travel-dot.gr-final-travel-dot {
    stroke:
        var(--gr-map-travel-dot-final-ring) !important;
}

/* ---------------------------------------------------------
   Controls and decorative overlays
   --------------------------------------------------------- */

/*
Backdrop blur is visually useful while the map is stationary,
but can be expensive while content behind it is moving.
*/

.gr-camera-moving .gr-map-controls button,
.gr-camera-moving .gr-map-control,
.gr-route-animation-active .gr-map-controls button,
.gr-route-animation-active .gr-map-control {
    -webkit-backdrop-filter:
        none !important;

    backdrop-filter:
        none !important;
}

/*
Avoid transitions in controls while the main animation is
running.
*/

.gr-camera-moving .gr-map-controls,
.gr-camera-moving .gr-map-controls button,
.gr-camera-moving .gr-map-control,
.gr-route-animation-active .gr-map-controls,
.gr-route-animation-active .gr-map-controls button,
.gr-route-animation-active .gr-map-control {
    transition:
        none !important;
}

/* ---------------------------------------------------------
   Restore visual quality when stationary
   --------------------------------------------------------- */

/*
No explicit restoration rules are required. When the runtime
classes disappear, the normal 7.0 styles automatically apply
again.
*/

/* ---------------------------------------------------------
   Mobile and lower-performance devices
   --------------------------------------------------------- */

@media (max-width: 800px) {
    /*
    Mobile browsers benefit from avoiding SVG filters even
    while the map is stationary.
    */

    .gr-map-layer {
        filter:
            none !important;
    }

    .gr-country {
        filter:
            none !important;

        transition:
            fill 160ms ease,
            stroke 160ms ease,
            opacity 160ms ease;
    }

    .gr-country:hover {
        filter:
            none !important;
    }

    .gr-flight-shadow {
        filter:
            none !important;
    }

    .gr-flight-line {
        filter:
            none !important;
    }

    .gr-travel-dot {
        filter:
            none !important;
    }
}

/* ---------------------------------------------------------
   Reduced motion
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .gr-map-layer,
    .gr-country,
    .gr-flight-line,
    .gr-flight-shadow,
    .gr-travel-dot {
        transition:
            none !important;

        animation:
            none !important;
    }

    .gr-map-layer,
    .gr-country,
    .gr-flight-line,
    .gr-flight-shadow,
    .gr-travel-dot {
        filter:
            none !important;
    }
}

/* =========================================================
   GeoRankle Map Engine 7.1
   Smooth performance-mode transitions
   ========================================================= */

/*
Do not transition SVG filters themselves during movement.
Interpolating complex SVG filters is expensive and may create
more stutter than an immediate switch.

Instead, use lightweight opacity layers to soften the visual
change between detailed and simplified rendering.
*/

/* ---------------------------------------------------------
   Base transition timing
   --------------------------------------------------------- */

.gr-map,
.live-map,
.result-center-map {
    --gr-performance-fade-in: 150ms;
    --gr-performance-fade-out: 260ms;
}

/* ---------------------------------------------------------
   Soft overlay during camera movement
   --------------------------------------------------------- */

/*
A subtle translucent layer hides the exact frame where SVG
filters are disabled. Opacity is inexpensive compared with
animating filters on hundreds of paths.
*/

.gr-map::after,
.live-map::after,
.result-center-map::after {
    transition:
        opacity
        var(--gr-performance-fade-out)
        ease;
}

/*
Keep the overlay subtle. It should not look like the map
becomes foggy or darker.
*/

.gr-camera-moving::after,
.gr-route-animation-active::after {
    opacity:
        0.38 !important;

    transition-duration:
        var(--gr-performance-fade-in);
}

/* ---------------------------------------------------------
   Smooth visual simplification
   --------------------------------------------------------- */

/*
Lower the complete SVG opacity very slightly while entering
performance mode. This disguises the removal of shadows and
glows without making the map visibly fade out.
*/

.gr-map-svg {
    opacity:
        1;

    transition:
        opacity
        var(--gr-performance-fade-out)
        ease;
}

.gr-camera-moving .gr-map-svg,
.gr-route-animation-active .gr-map-svg {
    opacity:
        0.985;

    transition-duration:
        var(--gr-performance-fade-in);
}

/* ---------------------------------------------------------
   Country transition handling
   --------------------------------------------------------- */

/*
Do not use "transition: none" on every country immediately.
Keep only cheap fill, stroke and opacity transitions.

Filter transitions remain disabled because they are costly.
*/

.gr-camera-moving .gr-country,
.gr-route-animation-active .gr-country {
    transition:
        fill 90ms linear,
        stroke 90ms linear,
        opacity 90ms linear !important;
}

/*
When performance mode ends, restore colors gently. Filters
return instantly, but the small opacity transition makes the
change much less noticeable.
*/

.gr-country {
    transition:
        fill 180ms ease,
        stroke 180ms ease,
        opacity 180ms ease !important;
}

/* ---------------------------------------------------------
   Route transition handling
   --------------------------------------------------------- */

.gr-flight-line,
.gr-flight-shadow {
    transition:
        opacity 180ms ease;
}

.gr-camera-moving .gr-flight-line,
.gr-route-animation-active .gr-flight-line,
.gr-camera-moving .gr-flight-shadow,
.gr-route-animation-active .gr-flight-shadow {
    transition-duration:
        90ms;
}

/* ---------------------------------------------------------
   Travel dot
   --------------------------------------------------------- */

.gr-travel-dot {
    transition:
        opacity 140ms ease;
}

.gr-route-animation-active .gr-travel-dot {
    opacity:
        0.98;
}

/* ---------------------------------------------------------
   Controls
   --------------------------------------------------------- */

.gr-map-controls button,
.gr-map-control {
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        opacity 160ms ease,
        transform 160ms ease !important;
}

/* ---------------------------------------------------------
   Avoid expensive visual changes on the first movement frame
   --------------------------------------------------------- */

/*
The first camera frame now keeps a small amount of visual
continuity. The actual heavy filters are still removed, but
the lightweight opacity fades make the transition feel less
abrupt.
*/

.gr-camera-moving .gr-map-viewport,
.gr-route-animation-active .gr-map-viewport {
    transition:
        box-shadow 180ms ease;
}

/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 800px) {
    /*
    Mobile already uses permanently simplified filters, so no
    visual quality switch is required there.
    */

    .gr-map-svg,
    .gr-country,
    .gr-flight-line,
    .gr-flight-shadow,
    .gr-travel-dot {
        transition-duration:
            100ms;
    }
}

/* ---------------------------------------------------------
   Reduced motion
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .gr-map::after,
    .live-map::after,
    .result-center-map::after,
    .gr-map-svg,
    .gr-country,
    .gr-flight-line,
    .gr-flight-shadow,
    .gr-travel-dot,
    .gr-map-controls button,
    .gr-map-control,
    .gr-map-viewport {
        transition:
            none !important;
    }
}

/* =========================================================
   GeoRankle Map Engine 7.4 — Contextual Micro Countries
   ========================================================= */

/*
No neutral atlas dots are rendered. This layer only contains
small countries that have been guessed or revealed.
*/

.gr-micro-country-layer,
.gr-micro-country-symbol,
.gr-micro-country-label {
    pointer-events: none;
}

.gr-micro-country-symbol {
    isolation: isolate;
    transform-origin: 0 0;
}

/* Keep the text label inside the map reset control. */
.gr-map-controls button[data-action="reset"] {
    width: auto;
    min-width: 58px;
    padding: 0 8px;
    align-self: flex-end;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

/* Soft ring behind the newest destination only. */

.gr-micro-country-halo {
    fill: transparent;
    stroke: rgba(252, 211, 77, 0.48);
    stroke-width: 1.05;
    vector-effect: non-scaling-stroke;
    opacity: 0;

    transition:
        stroke 160ms ease,
        opacity 160ms ease;
}

.gr-micro-country-symbol-latest
    .gr-micro-country-halo {
    opacity: 0.72;
}

/* Transparent ring, so nearby countries remain readable. */

.gr-map-layer
    .gr-country.gr-micro-country {
    fill: rgba(245, 158, 11, 0.1);
    stroke: var(--gr-map-guessed-stroke);
    stroke-width: 1.7;
    vector-effect: non-scaling-stroke;
    paint-order: stroke fill;
    pointer-events: none;

    transition:
        fill 160ms ease,
        stroke 160ms ease,
        opacity 160ms ease !important;
}

.gr-map-layer
    .gr-country.gr-micro-country-missing {
    fill: rgba(245, 158, 11, 0.08);
}

.gr-map-layer
    .gr-micro-country-symbol-latest
    .gr-country.gr-micro-country {
    fill: rgba(245, 158, 11, 0.16);
    stroke-width: 2.05;
}

/* Correct answer state. */

.gr-map-layer
    .gr-country.gr-micro-country[data-answer="true"],
.gr-map-layer
    .gr-country.gr-micro-country.gr-answer {
    fill: rgba(34, 197, 94, 0.16);
    stroke: var(--gr-map-answer-stroke);
    stroke-width: 2.1;
}

.gr-micro-country-symbol-answer
    .gr-micro-country-halo {
    stroke: rgba(134, 239, 172, 0.72);
}

/* ---------------------------------------------------------
   Latest-country label
   --------------------------------------------------------- */

.gr-micro-country-label {
    opacity: 1;

    transition:
        opacity 150ms ease;
}

.gr-micro-country-label-line {
    stroke: rgba(252, 211, 77, 0.82);
    stroke-width: 1.15;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.gr-micro-country-label-bg {
    fill: rgba(92, 55, 5, 0.94);
    stroke: rgba(252, 211, 77, 0.82);
    stroke-width: 0.85;
    vector-effect: non-scaling-stroke;
}

.gr-micro-country-label-text {
    fill: #fffdf2;

    font-family:
        "Nunito",
        system-ui,
        sans-serif;

    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: 0.05px;
    dominant-baseline: auto;
}

.gr-micro-country-label-answer
    .gr-micro-country-label-line {
    stroke: rgba(134, 239, 172, 0.9);
}

.gr-micro-country-label-answer
    .gr-micro-country-label-bg {
    fill: rgba(13, 89, 49, 0.96);
    stroke: rgba(134, 239, 172, 0.88);
}

/* Hide the label while the camera is moving. */

.gr-camera-moving
    .gr-micro-country-label,
.gr-camera-preparing
    .gr-micro-country-label,
.gr-route-animation-active
    .gr-micro-country-label {
    opacity: 0;
}

/* Keep movement inexpensive. */

.gr-camera-moving .gr-micro-country,
.gr-route-animation-active .gr-micro-country,
.gr-camera-moving .gr-micro-country-halo,
.gr-route-animation-active .gr-micro-country-halo {
    filter: none !important;
    transition-duration: 90ms !important;
}

@media (max-width: 800px) {
    .gr-micro-country-label-text {
        font-size: 9px;
    }

    .gr-map-layer
        .gr-country.gr-micro-country {
        stroke-width: 1.85;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gr-micro-country,
    .gr-micro-country-halo,
    .gr-micro-country-label {
        transition: none !important;
    }
}
