:root {
    --ink: #173f35;
    --ink-soft: #5d716a;
    --paper: #f7f6f1;
    --card: #fffefa;
    --line: #d9ded8;
    --green: #197b62;
    --green-light: #dff0e9;
    --orange: #f0a33a;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    background: radial-gradient(circle at 7% 4%, rgba(25, 123, 98, .08), transparent 24rem), var(--paper);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1:focus {
    outline: none;
}

button,
a {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
canvas:focus-visible {
    outline: 3px solid rgba(240, 163, 58, .65);
    outline-offset: 3px;
}

.game-shell {
    width: min(1480px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 34px;
    display: flex;
    flex-direction: column;
}

.location-shell {
    width: min(1180px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 34px;
    display: flex;
    flex-direction: column;
}

.location-picker {
    flex: 1;
    padding: 70px 0 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.location-picker h1 {
    max-width: 760px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(48px, 7vw, 82px);
    font-weight: 500;
    letter-spacing: -.055em;
    line-height: .95;
}

.location-intro {
    max-width: 520px;
    margin: 24px 0 42px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.7;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.location-card {
    min-height: 210px;
    padding: 23px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 17px;
    box-shadow: 0 12px 34px rgba(23, 63, 53, .06);
    text-align: left;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.location-card:hover {
    z-index: 1;
    border-color: var(--green);
    box-shadow: 0 18px 45px rgba(23, 63, 53, .12);
    transform: translateY(-4px);
}

.location-index {
    color: var(--green);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.location-name {
    max-width: 90%;
    margin-top: auto;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(25px, 3vw, 37px);
    letter-spacing: -.04em;
    line-height: 1;
}

.location-country {
    margin-top: 8px;
    color: var(--ink-soft);
    font-size: 12px;
}

.location-arrow {
    width: 34px;
    height: 34px;
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: grid;
    place-items: center;
    color: white;
    background: var(--ink);
    border-radius: 50%;
    font-size: 18px;
}

.game-header {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 760;
    letter-spacing: -.02em;
    text-decoration: none;
}

.brand-button {
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.brand-button small {
    margin-left: 3px;
    color: var(--ink-soft);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.brand-mark {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    color: white;
    background: var(--ink);
    border-radius: 11px 11px 11px 3px;
    font-size: 23px;
    line-height: 1;
    transform: rotate(-2deg);
}

.score-pill {
    min-width: 126px;
    padding: 10px 15px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: 0 5px 18px rgba(23, 63, 53, .05);
}

.score-pill span,
.eyebrow {
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.score-pill strong {
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.game-grid {
    flex: 1;
    min-height: 0;
    padding: 28px 0;
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 26px;
}

.quiz-panel {
    padding: 31px;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 16px 45px rgba(23, 63, 53, .07);
}

.eyebrow {
    margin: 0 0 12px;
    font-weight: 750;
    letter-spacing: .13em;
}

.round-progress {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.round-progress span {
    height: 4px;
    border-radius: 99px;
}

.round-progress .complete {
    background: var(--green);
}

.round-progress .current {
    background: var(--orange);
}

.round-progress .upcoming {
    background: #e1e5df;
}

.setup-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setup-progress span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
}

.setup-progress i {
    width: 34px;
    height: 2px;
    background: #dfe4de;
}

.setup-progress .current {
    color: white;
    background: var(--orange);
}

.setup-progress .complete {
    color: white;
    background: var(--green);
}

.setup-progress .upcoming {
    color: var(--ink-soft);
    background: #e8ebe6;
}

.question-block,
.result-block {
    margin: auto 0;
    padding: 40px 0;
}

.target-icon,
.result-icon {
    width: 49px;
    height: 49px;
    margin-bottom: 25px;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--green-light);
    border-radius: 50%;
    font-size: 29px;
    font-weight: 700;
}

.setup-number {
    font-size: 18px;
}

.question-block > p:first-of-type,
.result-kicker {
    margin: 0 0 8px;
    color: var(--green);
    font-size: 13px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.question-block h1 {
    max-width: 290px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(32px, 3.4vw, 49px);
    font-weight: 500;
    letter-spacing: -.045em;
    line-height: .98;
}

.instruction {
    max-width: 280px;
    margin: 24px 0 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.65;
}

.tip {
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-soft);
    background: #f2f4ef;
    border-radius: 12px;
}

.tip > span {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--green);
    background: white;
    border-radius: 8px;
}

.tip p {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
}

.tip strong {
    display: block;
    color: var(--ink);
}

.result-icon {
    color: white;
    background: var(--green);
}

.result-block h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 39px;
    font-weight: 500;
    letter-spacing: -.04em;
}

.result-block > p:last-of-type {
    margin: 6px 0 25px;
    color: var(--ink-soft);
    font-size: 14px;
}

.points-earned {
    padding: 14px 0;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.points-earned strong {
    color: var(--green);
    font-size: 17px;
}

.primary-button {
    width: 100%;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    background: var(--ink);
    border: 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 150ms ease, background 150ms ease;
}

.primary-button:hover {
    background: var(--green);
    transform: translateY(-1px);
}

.primary-button span {
    font-size: 20px;
}

.secondary-button {
    width: 100%;
    margin-top: 10px;
    padding: 11px 15px;
    color: var(--ink-soft);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.secondary-button:hover {
    color: var(--green);
    border-color: var(--green);
}

.area-warning {
    margin: 0 0 12px;
    color: #a45036;
    font-size: 12px;
    line-height: 1.5;
}

.finish-card {
    padding: 18px;
    background: var(--green-light);
    border-radius: 14px;
}

.finish-card p {
    margin: 0 0 3px;
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.finish-card strong {
    display: block;
    margin-bottom: 15px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
}

.map-panel {
    min-height: 540px;
    position: relative;
    overflow: hidden;
    background: #f2f0e8;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 16px 45px rgba(23, 63, 53, .08);
}

.street-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
    touch-action: none;
}

.street-map.is-panning {
    cursor: grabbing;
}

.hit-map {
    display: none;
}

.map-controls {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    display: grid;
    overflow: hidden;
    background: rgba(255, 254, 250, .92);
    border: 1px solid rgba(190, 194, 186, .8);
    border-radius: 9px;
    box-shadow: 0 5px 16px rgba(23, 63, 53, .12);
    backdrop-filter: blur(8px);
}

.map-controls button {
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.map-controls button:last-child {
    border-bottom: 0;
    font-size: 16px;
}

.map-controls button:hover {
    color: white;
    background: var(--green);
}

.map-caption,
.map-legend {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

.map-caption {
    right: 15px;
    bottom: 14px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #62655f;
    background: rgba(255, 254, 250, .88);
    border: 1px solid rgba(190, 194, 186, .7);
    border-radius: 8px;
    font-size: 10px;
}

.map-scale,
.map-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-scale i {
    width: 28px;
    height: 5px;
    display: inline-block;
    border: solid #5f625d;
    border-width: 0 1px 1px;
}

.map-legend {
    left: 15px;
    bottom: 14px;
    padding: 10px 12px;
    display: flex;
    gap: 14px;
    color: #565d58;
    background: rgba(255, 254, 250, .9);
    border: 1px solid rgba(190, 194, 186, .7);
    border-radius: 8px;
    font-size: 10px;
}

.map-legend i {
    width: 17px;
    height: 4px;
    display: inline-block;
    border-radius: 99px;
}

.legend-target {
    background: var(--green);
}

.legend-guess {
    background: var(--orange);
}

.legend-centre {
    background: var(--orange);
}

.legend-radius {
    background: rgba(25, 123, 98, .25);
    border: 1px dashed var(--green);
}

.map-shake {
    animation: map-shake 220ms ease;
}

.game-footer {
    min-height: 53px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #85918c;
    border-top: 1px solid var(--line);
    font-size: 10px;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.game-footer a {
    color: inherit;
    text-decoration: none;
}

.game-footer a:hover {
    color: var(--green);
}

.map-data-loading {
    display: grid;
    place-items: center;
}

.map-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--ink-soft);
    font-size: 13px;
}

.map-loader .brand-mark {
    animation: loader-pulse 1.2s ease-in-out infinite alternate;
}

.map-loader p {
    margin: 0;
}

#blazor-error-ui {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    display: none;
    padding: 14px 18px;
    color: white;
    background: #9f2d2d;
    border-radius: 10px;
}

#blazor-error-ui a,
#blazor-error-ui .dismiss {
    margin-left: 12px;
    color: white;
    cursor: pointer;
}

.loading-progress {
    width: 70px;
    height: 70px;
    margin: 35vh auto 15px;
    display: block;
}

.loading-progress circle {
    fill: none;
    stroke: #d9ded8;
    stroke-width: .6rem;
}

.loading-progress circle:last-child {
    stroke: var(--green);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%;
}

.loading-progress-text {
    color: var(--ink-soft);
    font-size: 12px;
    text-align: center;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading map");
}

@keyframes map-shake {
    0%,
    100% {
        transform: translateX(0);
    }

    35% {
        transform: translateX(-4px);
    }

    70% {
        transform: translateX(4px);
    }
}

@keyframes loader-pulse {
    from {
        transform: translateY(0) rotate(-2deg);
    }

    to {
        transform: translateY(-6px) rotate(2deg);
    }
}

@media (max-width: 900px) {
    .game-shell {
        padding: 0 18px;
    }

    .location-shell {
        padding: 0 18px;
    }

    .location-grid {
        grid-template-columns: 1fr;
    }

    .location-card {
        min-height: 150px;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .quiz-panel {
        min-height: 350px;
    }

    .map-panel {
        min-height: 560px;
    }
}

@media (max-width: 560px) {
    .game-shell {
        padding: 0 12px;
    }

    .location-shell {
        padding: 0 12px;
    }

    .location-picker {
        padding: 45px 0;
    }

    .location-picker h1 {
        font-size: 45px;
    }

    .game-header {
        min-height: 70px;
    }

    .brand {
        font-size: 14px;
    }

    .brand-mark {
        width: 31px;
        height: 31px;
    }

    .score-pill {
        min-width: 75px;
        padding: 8px 10px;
    }

    .score-pill span {
        display: none;
    }

    .game-grid {
        padding: 16px 0;
        gap: 16px;
    }

    .quiz-panel {
        min-height: 330px;
        padding: 23px;
    }

    .map-panel {
        min-height: 520px;
    }

    .map-caption {
        display: none;
    }

    .game-footer span:last-child {
        display: none;
    }
}
