/* Clue Finder
   Road-signage look: asphalt, road-paint yellow, motorway green and signal red,
   set in Overpass (derived from the US highway sign typeface). The option chips
   draw little samples of the actual road markings, bollards and plates. */

:root {
    --asphalt: #24282c;
    --asphalt-2: #353b41;
    --paint: #f2c230;
    --paint-dark: #d9a90f;
    --paper: #edf0eb;
    --surface: #ffffff;
    --ink: #1b1e21;
    --ink-muted: #59626a;
    --rule: #d3d9d1;
    --go: #1d7a4b;
    --go-dark: #16603a;
    --stop: #c2302d;
    --stop-dark: #9f2522;
    --sign-blue: #1d4e89;
    --radius: 10px;
    --radius-sm: 6px;
    --font: 'Overpass', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html {
    scroll-padding-top: 1rem;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

h2 small {
    color: var(--ink-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.35rem;
}

a {
    color: var(--sign-blue);
}

:focus-visible {
    outline: 3px solid var(--paint);
    outline-offset: 2px;
}

/* ---------- Header ---------- */

.site-header {
    background: var(--asphalt);
    position: relative;
}

/* A dashed centre line along the bottom of the header */
.site-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: repeating-linear-gradient(90deg, var(--paint) 0 36px, transparent 36px 60px);
}

.site-header .navbar {
    padding: 0.85rem 0 1.05rem;
}

.site-header .container-xl {
    gap: 0.75rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-decoration: none;
    margin-right: auto;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--go);
    border: 2px solid #fff;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}

.brand-name {
    font-weight: 900;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.site-header .nav-link {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem !important;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
    color: #fff;
    background: var(--asphalt-2);
}

.btn-new {
    background: var(--paint);
    color: var(--ink);
    font-weight: 800;
    font-size: 1.1rem;
    padding: 0.65rem 1.3rem;
    border: 0;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 3px 0 var(--paint-dark);
}

.btn-new:hover,
.btn-new:focus,
.btn-new:active {
    background: #f7cf52;
    color: var(--ink);
}

.btn-new i {
    font-size: 1.35rem;
}

@media (max-width: 575.98px) {
    .btn-new span {
        display: none;
    }

    .btn-new {
        padding: 0.6rem 0.8rem;
    }
}

/* ---------- Layout ---------- */

.site-main {
    flex: 1;
    padding: 2rem 0 3rem;
}

.page-intro {
    margin-bottom: 1.5rem;
    max-width: 62ch;
}

.page-intro h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 900;
    margin-bottom: 0.35rem;
}

.page-intro p {
    color: var(--ink-muted);
    margin: 0;
}

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.5rem;
}

.panel-note {
    color: var(--ink-muted);
    font-size: 0.92rem;
}

.empty-state {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--ink-muted);
}

.code-block {
    background: var(--asphalt);
    color: #fff;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
}

.site-footer {
    color: var(--ink-muted);
    font-size: 0.88rem;
    padding: 1.5rem 0 2rem;
}

.site-footer p {
    margin: 0;
}

/* ---------- Buttons ---------- */

.btn {
    font-family: var(--font);
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.btn-analyse {
    background: var(--paint);
    color: var(--ink);
    border: 0;
    font-size: 1.15rem;
    font-weight: 900;
    padding: 0.7rem 1.8rem;
    box-shadow: 0 3px 0 var(--paint-dark);
}

.btn-analyse:hover,
.btn-analyse:focus,
.btn-analyse:active {
    background: #f7cf52;
    color: var(--ink);
}

.btn-clear {
    background: var(--asphalt-2);
    color: #fff;
    border: 0;
}

.btn-clear:hover,
.btn-clear:focus {
    background: #464d55;
    color: #fff;
}

.btn-quiet {
    background: #dfe4dd;
    color: var(--ink);
    border: 0;
}

.btn-quiet:hover,
.btn-quiet:focus {
    background: #cfd6cc;
    color: var(--ink);
}

.btn-right,
.btn-wrong {
    color: #fff;
    border: 0;
    font-size: 1.15rem;
    font-weight: 900;
    padding: 0.65rem 1.4rem;
    min-width: 8.5rem;
}

.btn-right {
    background: var(--go);
    box-shadow: 0 3px 0 var(--go-dark);
}

.btn-right:hover,
.btn-right:focus,
.btn-right:active {
    background: var(--go-dark);
    color: #fff;
}

.btn-wrong {
    background: var(--stop);
    box-shadow: 0 3px 0 var(--stop-dark);
}

.btn-wrong:hover,
.btn-wrong:focus,
.btn-wrong:active {
    background: var(--stop-dark);
    color: #fff;
}

.btn-next {
    background: var(--asphalt);
    color: #fff;
    border: 0;
    padding: 0.65rem 1.2rem;
}

.btn-next:hover,
.btn-next:focus {
    background: var(--asphalt-2);
    color: #fff;
}

.btn-pick {
    background: #e7ebe4;
    color: var(--ink);
    border: 0;
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
    white-space: nowrap;
}

.btn-pick:hover,
.btn-pick:focus {
    background: var(--go);
    color: #fff;
}

/* ---------- Clue form ---------- */

.clue-panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 0.4rem 1.5rem;
}

.clue-row {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: 0.4rem 1.25rem;
    align-items: start;
    padding: 0.9rem 0;
}

/* Rows are separated by a dashed lane line */
.clue-row + .clue-row {
    background: repeating-linear-gradient(90deg, var(--rule) 0 14px, transparent 14px 24px) top / 100% 2px no-repeat;
}

.clue-label {
    font-weight: 800;
    padding-top: 0.45rem;
}

.clue-label small {
    display: block;
    font-weight: 400;
    color: var(--ink-muted);
    font-size: 0.82rem;
}

.clue-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.35rem 0.8rem;
    background: #f3f5f1;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.chip:hover {
    background: #e6eae3;
}

.btn-check:checked + .chip {
    background: var(--asphalt);
    color: #fff;
    border-color: var(--paint);
}

.btn-check:focus-visible + .chip {
    outline: 3px solid var(--paint);
    outline-offset: 2px;
}

.chip-divider {
    width: 2px;
    height: 1.8rem;
    background: var(--rule);
    margin: 0 0.3rem;
}

.clue-text,
.clue-select {
    max-width: 34rem;
    min-height: 2.5rem;
    border: 2px solid var(--rule);
    font-family: var(--font);
}

.clue-text:focus,
.clue-select:focus {
    border-color: var(--asphalt);
    box-shadow: 0 0 0 3px rgba(242, 194, 48, 0.55);
}

.more-toggle {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 0.6rem;
    width: 100%;
    margin: 1rem 0;
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: 2px dashed #b9c1b6;
    border-radius: var(--radius);
    color: var(--ink);
    font-weight: 800;
    font-size: 1.05rem;
    text-align: left;
}

.more-toggle:hover {
    border-color: var(--asphalt);
}

.more-toggle small {
    color: var(--ink-muted);
    font-weight: 400;
    font-size: 0.88rem;
}

.more-toggle i {
    transition: transform 0.2s ease;
    align-self: center;
}

.more-toggle:not(.collapsed) i {
    transform: rotate(180deg);
}

.action-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin-top: 1.25rem;
    padding: 0.75rem 0;
}

.action-bar-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--asphalt);
    color: #fff;
    border-radius: var(--radius);
    padding: 0.7rem 0.8rem 0.7rem 1.25rem;
    box-shadow: 0 10px 30px rgba(20, 24, 28, 0.25);
}

.clue-count {
    margin-right: auto;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 767.98px) {
    .clue-panel {
        padding: 0.3rem 1rem;
    }

    .clue-row {
        grid-template-columns: 1fr;
    }

    .clue-label {
        padding-top: 0;
    }

    .chip {
        font-size: 0.9rem;
        padding: 0.3rem 0.65rem;
    }

    .action-bar-inner {
        padding-left: 1rem;
    }

    .clue-count {
        font-size: 0.85rem;
    }
}

/* ---------- Swatches: drawn samples on the chips ---------- */

.sw {
    display: inline-block;
    flex-shrink: 0;
    position: relative;
}

.sw-glyph {
    font-size: 1.15rem;
    font-weight: 700;
    min-width: 1.3rem;
    text-align: center;
    line-height: 1;
}

/* Driving side: a stretch of road with a car on the left or right */
.sw-drive {
    width: 26px;
    height: 22px;
    border-radius: 3px;
    background:
        repeating-linear-gradient(180deg, #fff 0 4px, transparent 4px 7px) 50% 0 / 2px 100% no-repeat,
        var(--asphalt-2);
}

.sw-drive::after {
    content: '';
    position: absolute;
    top: 6px;
    width: 7px;
    height: 10px;
    border-radius: 2px;
    background: var(--paint);
}

.sw-drive--l::after {
    left: 3px;
}

.sw-drive--r::after {
    right: 3px;
}

/* Road lines: a short piece of asphalt with the marking painted on */
.sw-edge,
.sw-centre,
.sw-style {
    width: 36px;
    height: 22px;
    border-radius: 3px;
    background-color: var(--asphalt-2);
}

.btn-check:checked + .chip .sw-edge,
.btn-check:checked + .chip .sw-centre,
.btn-check:checked + .chip .sw-style,
.btn-check:checked + .chip .sw-drive {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.sw-edge--none,
.sw-centre--none {
    background-image: linear-gradient(135deg, transparent 47%, rgba(255, 255, 255, 0.35) 47% 53%, transparent 53%);
}

.sw-edge--white {
    background-image: linear-gradient(180deg, transparent 15px, #fff 15px 18px, transparent 18px);
}

.sw-edge--yellow {
    background-image: linear-gradient(180deg, transparent 15px, var(--paint) 15px 18px, transparent 18px);
}

.sw-edge--double-yellow {
    background-image: linear-gradient(180deg, transparent 12px, var(--paint) 12px 14px, transparent 14px 16px, var(--paint) 16px 18px, transparent 18px);
}

.sw-edge--red {
    background-image: linear-gradient(180deg, transparent 15px, #e0443c 15px 18px, transparent 18px);
}

.sw-edge--blue {
    background-image: linear-gradient(180deg, transparent 15px, #3d7fe0 15px 18px, transparent 18px);
}

.sw-centre--white {
    background-image: linear-gradient(180deg, transparent 9px, #fff 9px 12px, transparent 12px);
}

.sw-centre--yellow {
    background-image: linear-gradient(180deg, transparent 9px, var(--paint) 9px 12px, transparent 12px);
}

.sw-centre--double-yellow {
    background-image: linear-gradient(180deg, transparent 7px, var(--paint) 7px 9px, transparent 9px 12px, var(--paint) 12px 14px, transparent 14px);
}

.sw-centre--double-white {
    background-image: linear-gradient(180deg, transparent 7px, #fff 7px 9px, transparent 9px 12px, #fff 12px 14px, transparent 14px);
}

.sw-centre--yellow-white {
    background-image: linear-gradient(180deg, transparent 7px, var(--paint) 7px 9px, transparent 9px 12px, #fff 12px 14px, transparent 14px);
}

.sw-centre--triple {
    background:
        repeating-linear-gradient(90deg, #fff 0 6px, transparent 6px 10px) 0 10px / 100% 2px no-repeat,
        linear-gradient(180deg, transparent 6px, #fff 6px 8px, transparent 8px 14px, #fff 14px 16px, transparent 16px),
        var(--asphalt-2);
}

.sw-style--solid {
    background-image: linear-gradient(180deg, transparent 9px, #fff 9px 12px, transparent 12px);
}

.sw-style--dashed {
    background-image: repeating-linear-gradient(90deg, #fff 0 8px, transparent 8px 13px);
    background-size: 100% 3px;
    background-position: 0 9px;
    background-repeat: no-repeat;
}

/* Bollards */
.sw-bollard {
    width: 13px;
    height: 28px;
    border-radius: 5px 5px 2px 2px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.sw-bollard--black-top {
    background: linear-gradient(180deg, #1c1c1c 0 32%, #fff 32%);
}

.sw-bollard--bw-stripe {
    background: repeating-linear-gradient(-35deg, #fff 0 5px, #1c1c1c 5px 9px);
}

.sw-bollard--white {
    background: linear-gradient(180deg, #fff 18%, #d5312c 18% 34%, #fff 34%);
    background-size: 5px 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #fff;
}

.sw-bollard--red {
    background: linear-gradient(180deg, #d5312c 0 30%, #fff 30% 45%, #d5312c 45% 58%, #fff 58%);
}

.sw-bollard--yellow {
    background: var(--paint);
}

.sw-bollard--green {
    background: linear-gradient(180deg, #1d7a4b 0 36%, #fff 36%);
}

.sw-bollard--blue {
    background: #2b5fb4;
}

.sw-bollard--orange {
    width: 16px;
    border-radius: 2px;
    background:
        radial-gradient(circle, #1c1c1c 2px, transparent 2.5px) 50% 0 / 100% 9px repeat-y,
        #ec7a2b;
}

.sw-bollard--stone {
    width: 16px;
    height: 20px;
    border-radius: 3px 3px 1px 1px;
    background: #b1aca1;
}

/* Reflector colours */
.sw-reflector {
    width: 10px;
    height: 18px;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.sw-reflector--red { background: #d5312c; }
.sw-reflector--white { background: linear-gradient(135deg, #fff, #b9bec2); }
.sw-reflector--orange { background: #ec7a2b; }
.sw-reflector--yellow { background: var(--paint); }
.sw-reflector--blue { background: #2b5fb4; }

/* Telephone poles */
.sw-pole {
    width: 9px;
    height: 28px;
    border-radius: 2px;
}

.sw-pole--wood { background: linear-gradient(90deg, #6e4526, #9a6a42 50%, #6e4526); }
.sw-pole--concrete { background: linear-gradient(90deg, #a9a69d, #d4d1c8 50%, #a9a69d); }
.sw-pole--holes {
    width: 11px;
    background:
        radial-gradient(circle, #54524d 1.6px, transparent 2px) 50% 2px / 100% 6px repeat-y,
        linear-gradient(90deg, #a9a69d, #d4d1c8 50%, #a9a69d);
}
.sw-pole--metal { background: linear-gradient(90deg, #6f7b85, #c3ccd3 50%, #6f7b85); }
.sw-pole--striped {
    background:
        repeating-linear-gradient(-40deg, #1c1c1c 0 3px, var(--paint) 3px 6px) 0 100% / 100% 40% no-repeat,
        linear-gradient(90deg, #a9a69d, #d4d1c8 50%, #a9a69d);
}

/* Car paint */
.sw-paint {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.sw-paint--white { background: #fff; }
.sw-paint--black { background: #16181a; }
.sw-paint--grey { background: linear-gradient(135deg, #e3e6e8, #8e979e); }
.sw-paint--red { background: #c62f2a; }
.sw-paint--blue { background: #2356a8; }
.sw-paint--brown { background: #7a5233; }

/* Licence plates */
.sw-plate {
    width: 32px;
    height: 13px;
    border-radius: 2px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.sw-plate--yellow { background: var(--paint); }
.sw-plate--yellow-rear { background: linear-gradient(90deg, #fff 50%, var(--paint) 50%); }
.sw-plate--black { background: #16181a; }
.sw-plate--red { background: #c62f2a; }
.sw-plate--blue { background: #2356a8; }
.sw-plate--eu { background: linear-gradient(90deg, #1f4fa8 0 6px, #fff 6px); }

/* Warning signs */
.sw-warning {
    width: 22px;
    height: 20px;
}

.sw-warning--triangle,
.sw-warning--triangle-yellow {
    background: #d5312c;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.sw-warning--triangle::after,
.sw-warning--triangle-yellow::after {
    content: '';
    position: absolute;
    inset: 7px 5px 3px;
    background: #fff;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.sw-warning--triangle-yellow::after {
    background: var(--paint);
}

.sw-warning--diamond {
    width: 15px;
    height: 15px;
    margin: 0 3px;
    background: var(--paint);
    border: 2px solid #1c1c1c;
    border-radius: 2px;
    transform: rotate(45deg);
}

/* Chevrons */
.sw-chevron {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    color: #fff;
    font-weight: 900;
    font-size: 13px;
    line-height: 18px;
    text-align: center;
}

.sw-chevron::after {
    content: '\276F\276F';
    letter-spacing: -2px;
}

.sw-chevron--black-white { background: #16181a; color: #fff; }
.sw-chevron--black-yellow { background: #16181a; color: var(--paint); }
.sw-chevron--red-white { background: #d5312c; color: #fff; }
.sw-chevron--blue-white { background: #2356a8; color: #fff; }

/* ---------- Results ---------- */

.clue-summary {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.clue-summary-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-right: auto;
}

.clue-pill {
    background: var(--surface);
    border-radius: 999px;
    padding: 0.25rem 0.8rem;
    font-size: 0.88rem;
    font-weight: 700;
}

.clue-pill span {
    color: var(--ink-muted);
    font-weight: 400;
}

.verdict {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    grid-template-areas:
        'main feedback'
        'hints hints';
    gap: 0;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.verdict-main {
    grid-area: main;
    padding: 1.75rem 1.75rem 1.5rem;
}

.verdict-head {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.verdict-flag {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.verdict-label {
    display: inline-block;
    margin: 0 0 0.25rem;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--ink-muted);
}

.verdict.is-definite .verdict-label {
    background: var(--go);
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
}

.verdict-name {
    font-size: clamp(2.3rem, 6vw, 4.2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 0.95;
    margin: 0;
}

.verdict-meta {
    color: var(--ink-muted);
    margin: 0.4rem 0 0;
    font-size: 0.92rem;
}

.verdict .prob-bar {
    display: block;
    width: 100%;
    height: 10px;
    margin: 1.2rem 0 0.25rem;
}

.verdict-feedback {
    grid-area: feedback;
    background: var(--asphalt);
    color: #fff;
    padding: 1.6rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feedback-title {
    font-weight: 800;
    font-size: 1.2rem;
    margin: 0;
}

.feedback-right .btn-right {
    width: 100%;
}

.feedback-wrong {
    display: flex;
    gap: 0.5rem;
}

.feedback-wrong .form-control {
    min-width: 0;
    flex: 1;
    font-family: var(--font);
    border: 0;
}

.feedback-wrong .form-control:focus {
    box-shadow: 0 0 0 3px rgba(242, 194, 48, 0.7);
}

.verdict-feedback .btn-next {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.35);
    margin-top: auto;
}

.verdict-feedback .btn-next:hover {
    border-color: var(--paint);
    background: transparent;
}

.verdict-status {
    font-weight: 800;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
}

.verdict-status.is-right {
    background: var(--go);
}

.verdict-status.is-wrong {
    background: var(--stop);
}

.verdict-hints {
    grid-area: hints;
    padding: 0 1.75rem 1.75rem;
}

@media (max-width: 991.98px) {
    .verdict {
        grid-template-columns: 1fr;
        grid-template-areas:
            'main'
            'feedback'
            'hints';
    }

    .verdict-hints {
        padding-top: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .verdict-main {
        padding: 1.25rem 1rem;
    }

    .verdict-hints {
        padding: 1.25rem 1rem;
    }

    .verdict-flag {
        width: 54px;
        height: 36px;
    }

    .clue-summary {
        flex-direction: column;
    }
}

.prob-bar {
    display: inline-block;
    height: 8px;
    border-radius: 4px;
    background: #e3e7e1;
    overflow: hidden;
}

.prob-bar span {
    display: block;
    height: 100%;
    background: var(--sign-blue);
    border-radius: 4px;
}

.reasons {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
}

.reason {
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.reason i {
    font-size: 1.1rem;
}

.reason-match i { color: var(--go); }
.reason-miss { color: var(--ink-muted); text-decoration: line-through; }
.reason-miss i { color: var(--stop); }
.reason-evidence i, .reason-text i { color: var(--sign-blue); }
.reason-learned i { color: #8a5a00; }

.reason-none {
    color: var(--ink-muted);
    font-size: 0.92rem;
    margin: 1rem 0 0.75rem;
}

.country-link {
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
}

.hint-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.hint-card {
    background: #f5f7f3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hint-card.is-evidence {
    box-shadow: inset 0 3px 0 var(--go);
}

.hint-image {
    display: block;
    background: #dfe4dd;
    aspect-ratio: 16 / 9;
}

.hint-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hint-body {
    padding: 0.75rem 0.9rem 0.9rem;
}

.hint-body p {
    margin: 0.2rem 0 0;
    font-size: 0.93rem;
}

.hint-type {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--ink-muted);
}

.hint-note {
    color: var(--ink-muted);
    font-size: 0.86rem !important;
    margin-top: 0.45rem !important;
}

.tips {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 6px solid var(--paint);
}

.tips ul {
    margin: 0;
    padding-left: 1.1rem;
}

.tips li {
    margin-bottom: 0.4rem;
}

.tip-pair {
    font-weight: 800;
    margin-right: 0.35rem;
}

.others {
    margin-bottom: 1.5rem;
}

.other-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}

.other + .other {
    border-top: 1px solid var(--rule);
}

.other-row {
    display: grid;
    grid-template-columns: 2rem 32px minmax(0, 1fr) minmax(60px, 180px) 3.2rem auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
}

.other-rank {
    font-weight: 900;
    color: var(--ink-muted);
    text-align: center;
}

.other-name {
    background: none;
    border: 0;
    padding: 0;
    text-align: left;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--ink);
}

.other-name i {
    font-size: 0.9rem;
    color: var(--ink-muted);
    transition: transform 0.2s ease;
}

.other-name:not(.collapsed) i {
    transform: rotate(180deg);
}

.other-row .prob-bar {
    width: 100%;
}

.other-prob {
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.other-detail {
    padding: 0 1rem 1.2rem 3.75rem;
}

.other-detail .reasons {
    margin-top: 0.25rem;
}

.other-detail .hint-list {
    margin-bottom: 0.75rem;
}

@media (max-width: 767.98px) {
    .other-row {
        grid-template-columns: 1.5rem 28px minmax(0, 1fr) 3rem;
    }

    .other-row .prob-bar {
        display: none;
    }

    .other-pick {
        grid-column: 3 / -1;
    }

    .other-detail {
        padding-left: 1rem;
    }
}

.flag {
    width: 28px;
    height: 19px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    vertical-align: -3px;
}

.flag-empty {
    display: inline-block;
    background: #dfe4dd;
}

/* ---------- Stats, history, tables ---------- */

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-weight: 700;
    margin-top: 0.4rem;
}

.stat-note {
    color: var(--ink-muted);
    font-size: 0.88rem;
}

.form-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.form-dot {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: grid;
    place-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
}

.form-dot.is-right { background: var(--go); }
.form-dot.is-wrong { background: var(--stop); }

.form-dot:hover {
    color: #fff;
    transform: translateY(-2px);
}

.table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    overflow-x: auto;
}

.panel .table-wrap {
    border-radius: 0;
}

.data-table {
    margin: 0;
    font-size: 0.93rem;
}

.data-table th {
    font-weight: 800;
    color: var(--ink-muted);
    font-size: 0.85rem;
    border-bottom-width: 2px;
    white-space: nowrap;
}

.data-table td,
.data-table th {
    padding: 0.6rem 0.8rem;
}

.clue-cell {
    color: var(--ink-muted);
    max-width: 28rem;
    font-size: 0.86rem;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    white-space: nowrap;
}

.status-right { background: var(--go); color: #fff; }
.status-wrong { background: var(--stop); color: #fff; }
.status-pending { background: #e3e7e1; color: var(--ink-muted); }

/* ---------- Countries ---------- */

.continent {
    margin-bottom: 2rem;
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.6rem;
}

.country-tile {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 0 0.65rem;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    color: var(--ink);
    text-decoration: none;
}

.country-tile:hover {
    box-shadow: inset 0 -3px 0 var(--paint);
    color: var(--ink);
}

.country-tile .flag {
    grid-row: span 2;
}

.country-tile-name {
    font-weight: 800;
    line-height: 1.2;
}

.country-tile-meta {
    color: var(--ink-muted);
    font-size: 0.82rem;
}

.country-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.country-head h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.02em;
}

.country-head p {
    color: var(--ink-muted);
    margin: 0;
}

.country-head-links {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.profile {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.9rem 1.5rem;
    margin: 0;
}

.profile dt {
    font-size: 0.85rem;
    color: var(--ink-muted);
    font-weight: 700;
}

.profile dd {
    margin: 0;
    font-weight: 600;
}

.hint-section {
    margin-bottom: 2rem;
}

/* ---------- Back to top ---------- */

.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1030;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--go);
    border: 2px solid #fff;
    color: #fff;
    font-size: 26px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(20, 24, 28, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--go-dark);
    color: #fff;
}

/* Keep clear of the sticky Analyse bar */
.has-action-bar .back-to-top {
    bottom: 6.5rem;
}

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