/* Județele României — map quiz (js/judete.js). Tokens on :root, redefined under body.dark-theme. */
:root {
    --ju-accent: #1d4ed8;
    --ju-accent-2: #2563eb;
    --ju-on-accent: #ffffff;
    --ju-accent-soft: #e5edff;
    --ju-page-bg: #f2f5fb;
    --ju-card-bg: #ffffff;
    --ju-card-border: #d9e1ee;
    --ju-muted: #5b6577;
    --ju-shadow: 0 10px 30px rgba(20, 40, 90, .10);
    --ju-sea: #dbe8f6;
    --ju-sea-2: #c9dbef;
    --ju-land: #f6f1e4;
    --ju-land-hover: #ece3cb;
    --ju-border: #8f9db3;
    --ju-outline: #3d4b63;
    --ju-out: #e2e6ec;
    --ju-ok: #2fb463;
    --ju-late: #f2a33a;
    --ju-bad: #e5484d;
    --ju-target: #f59e0b;
    --ju-target-stroke: #7c2d12;
    --ju-sel: #2563eb;
    --ju-label: #1f2937;
    --ju-label-halo: rgba(255, 255, 255, .85);
    --ju-good: #15803d;
    --ju-badtxt: #c81e1e;
    --ju-warn: #b45309;
    --ju-gold: #f59e0b;
    --ju-overlay: rgba(10, 20, 40, .5);
    --ju-r0: #fde2b8; --ju-r1: #cfe8c9; --ju-r2: #f9cfd6; --ju-r3: #cfe0f7;
    --ju-r4: #e6d6f5; --ju-r5: #fbe9a8; --ju-r6: #c9ece8; --ju-r7: #f3d3b8;
}

body.dark-theme {
    --ju-accent: #7aa2ff;
    --ju-accent-2: #93b4ff;
    --ju-on-accent: #0b1430;
    --ju-accent-soft: #17233f;
    --ju-page-bg: #0d1220;
    --ju-card-bg: #161d2e;
    --ju-card-border: #2a3550;
    --ju-muted: #a2adc4;
    --ju-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --ju-sea: #0c1426;
    --ju-sea-2: #0f1b33;
    --ju-land: #2b3550;
    --ju-land-hover: #36436a;
    --ju-border: #5d6c8c;
    --ju-outline: #b8c4dc;
    --ju-out: #1b2234;
    --ju-ok: #22a35a;
    --ju-late: #d88a26;
    --ju-bad: #d2393e;
    --ju-target: #f5b13d;
    --ju-target-stroke: #fff4d6;
    --ju-sel: #7aa2ff;
    --ju-label: #f3f5fa;
    --ju-label-halo: rgba(8, 12, 24, .82);
    --ju-good: #4ade80;
    --ju-badtxt: #f87171;
    --ju-warn: #fbbf24;
    --ju-overlay: rgba(0, 0, 0, .6);
    --ju-r0: #5c4a2a; --ju-r1: #33503a; --ju-r2: #5a3843; --ju-r3: #31455f;
    --ju-r4: #483b5e; --ju-r5: #575030; --ju-r6: #2c5250; --ju-r7: #5a4334;
}

/* clip, not hidden: the site-wide `body { overflow-x: hidden }` would kill position: sticky. */
.ju-body, body.ju-body#page-top {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--ju-page-bg);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: clip;
}
.ju-main { padding-top: 92px; padding-bottom: 40px; }
.ju-game .container, .ju-hero .container { max-width: 1200px; }

/* ---- hero ---- */
.ju-hero { text-align: center; padding: 4px 0 10px; }
.ju-hero h1 { font-weight: 800; font-size: clamp(1.55rem, 5vw, 2.2rem); margin-bottom: 4px; }
.ju-hero-icon { color: var(--ju-accent); }
.ju-lead { margin: 0 auto; max-width: 600px; color: var(--ju-muted); font-size: .98rem; line-height: 1.45; }

/* ---- layout: map left, panel right; on a phone the panel's blocks go around the map ---- */
.ju-app { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.ju-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ju-mapcol { min-width: 0; }
.ju-card { padding: 14px; border-radius: 18px; background: var(--ju-card-bg); border: 1px solid var(--ju-card-border); box-shadow: var(--ju-shadow); }
.ju-card[hidden], .ju-tools[hidden], .ju-list[hidden], .ju-row[hidden], .ju-weak[hidden] { display: none; }

/* ---- the map ---- */
.ju-stage { position: relative; width: 100%; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: radial-gradient(ellipse at 40% 35%, var(--ju-sea) 0%, var(--ju-sea-2) 100%); box-shadow: inset 0 0 0 1px var(--ju-card-border), var(--ju-shadow); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.ju-stage:focus { outline: none; }
.ju-stage:focus-visible { box-shadow: 0 0 0 3px var(--ju-gold), var(--ju-shadow); }
.ju-mapbox { position: relative; width: 100%; aspect-ratio: var(--ju-ratio, 2986 / 2115); }
.ju-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.ju-stage.is-zoomed .ju-map { cursor: grab; }
.ju-stage.is-panning .ju-map { cursor: grabbing; }
.ju-county { fill: var(--ju-land); stroke: var(--ju-border); stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-linejoin: round; fill-rule: evenodd; transition: fill .25s, opacity .25s; }
.ju-outline { fill: none; stroke: var(--ju-outline); stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; pointer-events: none; }
.ju-app:not([data-view="quiz"]) .ju-county.rg-0 { fill: var(--ju-r0); }
.ju-app:not([data-view="quiz"]) .ju-county.rg-1 { fill: var(--ju-r1); }
.ju-app:not([data-view="quiz"]) .ju-county.rg-2 { fill: var(--ju-r2); }
.ju-app:not([data-view="quiz"]) .ju-county.rg-3 { fill: var(--ju-r3); }
.ju-app:not([data-view="quiz"]) .ju-county.rg-4 { fill: var(--ju-r4); }
.ju-app:not([data-view="quiz"]) .ju-county.rg-5 { fill: var(--ju-r5); }
.ju-app:not([data-view="quiz"]) .ju-county.rg-6 { fill: var(--ju-r6); }
.ju-app:not([data-view="quiz"]) .ju-county.rg-7 { fill: var(--ju-r7); }
.ju-app[data-view="setup"] .ju-county { opacity: .9; }
.ju-county.is-hover { fill: var(--ju-land-hover); }
.ju-app:not([data-view="quiz"]) .ju-county.is-hover { filter: brightness(.94); }
body.dark-theme .ju-app:not([data-view="quiz"]) .ju-county.is-hover { filter: brightness(1.22); }
.ju-county.is-out { fill: var(--ju-out); stroke-opacity: .5; cursor: default; }
.ju-county.is-ok { fill: var(--ju-ok); }
.ju-county.is-late { fill: var(--ju-late); }
.ju-county.is-bad { fill: var(--ju-bad); }
.ju-county.is-target { fill: var(--ju-target); stroke: var(--ju-target-stroke); stroke-width: 2.5px; animation: ju-glow 1.4s ease-in-out infinite; }
@keyframes ju-glow { 50% { fill-opacity: .72; } }
.ju-county.is-sel { stroke: var(--ju-sel); stroke-width: 3px; filter: saturate(1.5) brightness(.95); }
body.dark-theme .ju-county.is-sel { filter: saturate(1.3) brightness(1.35); }
.ju-county.is-seen { stroke-dasharray: none; }
.ju-county.is-flash-bad { fill: var(--ju-bad); animation: ju-flash .55s ease-out; }
.ju-county.is-flash-ok { animation: ju-pop .5s ease-out; }
.ju-county.is-reveal { stroke: var(--ju-target-stroke); stroke-width: 3px; animation: ju-blink .5s ease-in-out 3; }
@keyframes ju-flash { 0% { fill-opacity: 1; } 50% { fill-opacity: .45; } 100% { fill-opacity: 1; } }
@keyframes ju-pop { 0% { fill-opacity: .4; } 100% { fill-opacity: 1; } }
@keyframes ju-blink { 50% { fill-opacity: .35; } }
.ju-county.is-cursor { stroke: var(--ju-gold); stroke-width: 4px; }
.ju-ping { fill: none; stroke: var(--ju-target-stroke); stroke-width: 3px; vector-effect: non-scaling-stroke; pointer-events: none; animation: ju-ping 1.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ju-ping { 0% { opacity: 1; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.4); } }
.ju-labels { pointer-events: none; font-weight: 800; fill: var(--ju-label); stroke: var(--ju-label-halo); paint-order: stroke; stroke-linejoin: round; text-anchor: middle; dominant-baseline: central; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.ju-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 12px; text-align: center; color: var(--ju-muted); font-weight: 700; }
.ju-loading[hidden] { display: none; }
/* the bar under the map: legend left, zoom right (never on top of a county) */
.ju-mapbar { display: flex; align-items: center; gap: 8px; padding: 0 8px 8px; min-height: 52px; }
.ju-legend { flex: 1; min-width: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .8rem; font-weight: 700; color: var(--ju-muted); line-height: 1.2; }
.ju-sw { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ju-sw::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--c); border: 1px solid rgba(0, 0, 0, .15); }
.ju-zoom { flex: none; display: flex; gap: 6px; }
.ju-zbtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--ju-card-border); background: var(--ju-card-bg); color: inherit; display: grid; place-items: center; font-size: 1rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); cursor: pointer; touch-action: manipulation; }
.ju-zbtn:hover { border-color: var(--ju-accent); }
.ju-tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; padding: 6px 10px; border-radius: 10px; background: var(--ju-card-bg); border: 1px solid var(--ju-card-border); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); font-size: .88rem; line-height: 1.25; white-space: nowrap; }
.ju-tip[hidden] { display: none; }
.ju-tip b { display: block; }
.ju-tip span { color: var(--ju-muted); font-size: .8rem; }
.ju-pause { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; text-align: center; background: var(--ju-card-bg); }
.ju-pause[hidden] { display: none; }
.ju-pause-title { margin: 0; font-weight: 900; font-size: 1.5rem; }
.ju-pause-sub { margin: 0 0 6px; color: var(--ju-muted); }

.ju-status { margin: 8px 2px 0; min-height: 2.8em; font-weight: 700; text-align: center; color: var(--ju-muted); line-height: 1.4; font-size: .95rem; }
.ju-status.is-good { color: var(--ju-good); }
.ju-status.is-bad { color: var(--ju-badtxt); }
.ju-status.is-warn { color: var(--ju-warn); }

/* ---- list mode ---- */
.ju-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 6px; }
.ju-li { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--ju-card-border); background: var(--ju-card-bg); color: inherit; text-align: left; font-weight: 700; font-size: .9rem; cursor: pointer; }
.ju-li[hidden] { display: none; }
.ju-li-code { flex: none; min-width: 30px; padding: 2px 4px; border-radius: 6px; background: var(--ju-accent-soft); color: var(--ju-accent); font-size: .78rem; text-align: center; }
.ju-li.is-ok { border-color: var(--ju-ok); background: color-mix(in srgb, var(--ju-ok) 18%, var(--ju-card-bg)); }
.ju-li.is-late { border-color: var(--ju-late); }
.ju-li.is-bad { border-color: var(--ju-bad); background: color-mix(in srgb, var(--ju-bad) 15%, var(--ju-card-bg)); }
.ju-li.is-sel { border-color: var(--ju-sel); box-shadow: 0 0 0 2px var(--ju-sel); }

/* ---- setup ---- */
.ju-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ju-mode { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--ju-card-border); background: var(--ju-page-bg); color: inherit; text-align: left; cursor: pointer; touch-action: manipulation; transition: background .15s, border-color .15s; }
.ju-mode:last-child { grid-column: 1 / -1; }
.ju-mode-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ju-accent-soft); color: var(--ju-accent); font-size: 1rem; }
.ju-mode-t { display: flex; flex-direction: column; font-weight: 800; font-size: .95rem; line-height: 1.15; min-width: 0; }
.ju-mode-t small { font-weight: 600; font-size: .76rem; color: var(--ju-muted); margin-top: 2px; }
.ju-mode[aria-checked="true"] { border-color: var(--ju-accent); background: var(--ju-accent); color: var(--ju-on-accent); }
.ju-mode[aria-checked="true"] small { color: inherit; opacity: .85; }
.ju-mode[aria-checked="true"] .ju-mode-icon { background: rgba(255, 255, 255, .2); color: inherit; }
.ju-row { margin-top: 12px; }
.ju-field { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; width: 100%; }
.ju-select { flex: 1; min-width: 0; min-height: 46px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--ju-card-border); background: var(--ju-page-bg); color: inherit; font-weight: 700; font-size: 1rem; }
.ju-select:focus { outline: none; border-color: var(--ju-accent); }
.ju-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--ju-page-bg); border: 1px solid var(--ju-card-border); }
.ju-seg button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: inherit; font-weight: 800; font-size: .92rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.ju-seg button[aria-checked="true"] { background: var(--ju-accent); color: var(--ju-on-accent); }
.ju-switch { display: inline-flex; align-items: center; gap: 10px; margin: 0; min-height: 40px; font-weight: 700; cursor: pointer; user-select: none; }
.ju-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ju-switch-ui { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--ju-card-border); transition: background .2s; flex: none; }
.ju-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.ju-switch input:checked + .ju-switch-ui { background: var(--ju-accent); }
.ju-switch input:checked + .ju-switch-ui::after { transform: translateX(18px); }
.ju-switch input:focus-visible + .ju-switch-ui { outline: 3px solid var(--ju-gold); outline-offset: 2px; }
.ju-start-row { display: grid; gap: 8px; margin-top: 14px; }
.ju-recsum { margin: 10px 0 0; text-align: center; color: var(--ju-muted); font-size: .88rem; }
.ju-recsum b { color: var(--text-color); }
.ju-weak { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--ju-page-bg); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ju-weak p { margin: 0; flex: 1 1 180px; font-size: .88rem; color: var(--ju-muted); line-height: 1.35; }
.ju-weak p i { color: var(--ju-badtxt); }
.ju-weak span { color: var(--text-color); font-weight: 700; }

/* ---- buttons ---- */
.ju-btn { min-height: 48px; padding: 8px 16px; border-radius: 14px; border: 1px solid var(--ju-card-border); background: var(--ju-card-bg); color: inherit; font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; touch-action: manipulation; transition: background .15s, border-color .15s, transform .1s; }
.ju-btn:hover { border-color: var(--ju-accent); }
.ju-btn:active { transform: scale(.98); }
.ju-btn[hidden] { display: none; }
.ju-btn-primary { background: var(--ju-accent); border-color: var(--ju-accent); color: var(--ju-on-accent); }
.ju-btn-primary:hover { background: var(--ju-accent-2); border-color: var(--ju-accent-2); }
.ju-btn-big { min-height: 54px; font-size: 1.1rem; }
.ju-btn-small { min-height: 40px; padding: 6px 12px; font-size: .88rem; }
.ju-round { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 1px solid var(--ju-card-border); display: grid; place-items: center; background: var(--ju-card-bg); color: inherit; font-size: 16px; cursor: pointer; touch-action: manipulation; }
.ju-round[hidden], .ju-round span[hidden] { display: none; }
.ju-round[aria-pressed="true"]#ju-listbtn { background: var(--ju-accent); border-color: var(--ju-accent); color: var(--ju-on-accent); }
.ju-link { border: 0; background: none; padding: 6px 4px; color: var(--ju-muted); font-size: .88rem; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 36px; }
.ju-link[hidden] { display: none; }
.ju-btn:focus-visible, .ju-round:focus-visible, .ju-mode:focus-visible, .ju-seg button:focus-visible, .ju-zbtn:focus-visible, .ju-li:focus-visible, .ju-opt:focus-visible, .ju-link:focus-visible, .ju-vec:focus-visible { outline: 3px solid var(--ju-gold); outline-offset: 2px; }

/* ---- question bar ---- */
.ju-qbar { padding: 12px 14px; }
.ju-prompt { margin: 0; font-size: 1.22rem; font-weight: 700; line-height: 1.3; min-height: 1.3em; }
.ju-prompt b { color: var(--ju-accent); font-weight: 900; }
.ju-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.ju-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px; border-radius: 999px; background: var(--ju-page-bg); border: 1px solid var(--ju-card-border); font-size: .86rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ju-pill.is-bad { color: var(--ju-badtxt); }
.ju-pill i { color: var(--ju-accent); }
.ju-meta .ju-link { margin-left: auto; }
.ju-recline { margin: 6px 0 0; font-size: .82rem; color: var(--ju-muted); }
.ju-recline:empty { display: none; }
.ju-recline b { color: var(--text-color); }

/* ---- answers ---- */
.ju-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ju-opt { position: relative; min-height: 56px; padding: 8px 10px 8px 34px; border-radius: 14px; border: 2px solid var(--ju-card-border); background: var(--ju-page-bg); color: inherit; font-weight: 800; font-size: 1rem; line-height: 1.2; cursor: pointer; touch-action: manipulation; text-align: left; transition: border-color .15s, background .15s; }
.ju-opt kbd { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); padding: 1px 6px; border-radius: 6px; background: var(--ju-card-border); color: var(--ju-muted); font-size: .72rem; font-family: inherit; box-shadow: none; }
.ju-opt:hover:not(:disabled) { border-color: var(--ju-accent); }
.ju-opt:disabled { cursor: default; }
.ju-opt.is-right { border-color: var(--ju-ok); background: color-mix(in srgb, var(--ju-ok) 22%, var(--ju-card-bg)); }
.ju-opt.is-wrong { border-color: var(--ju-bad); background: color-mix(in srgb, var(--ju-bad) 18%, var(--ju-card-bg)); }
.ju-opt:disabled:not(.is-right):not(.is-wrong) { opacity: .55; }
.ju-type { display: flex; gap: 8px; }
.ju-type[hidden], .ju-opts[hidden] { display: none; }
.ju-type-in { flex: 1; min-width: 0; min-height: 52px; padding: 8px 12px; border-radius: 14px; border: 2px solid var(--ju-card-border); background: var(--ju-page-bg); color: inherit; font-weight: 800; font-size: 1.1rem; }
.ju-type-in.is-code { text-transform: uppercase; letter-spacing: .1em; }
.ju-type-in:focus { outline: none; border-color: var(--ju-accent); }

/* ---- learning card ---- */
.ju-info-empty { margin: 0; color: var(--ju-muted); line-height: 1.45; }
.ju-info-empty i { color: var(--ju-accent); margin-right: 4px; }
.ju-info-head { display: flex; align-items: center; gap: 12px; }
.ju-info-name { margin: 0; font-weight: 900; font-size: 1.4rem; line-height: 1.15; }
.ju-plate { flex: none; display: inline-flex; align-items: stretch; height: 34px; border-radius: 6px; border: 2px solid #1f2937; background: #fff; color: #111827; font-weight: 900; font-size: 1.1rem; letter-spacing: .06em; overflow: hidden; padding-right: 8px; align-items: center; gap: 7px; }
.ju-plate-eu { align-self: stretch; display: grid; place-items: center; padding: 0 4px; background: #1e40af; color: #fde047; font-size: .6rem; letter-spacing: 0; }
.ju-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.ju-facts div { padding: 8px 10px; border-radius: 12px; background: var(--ju-page-bg); min-width: 0; }
.ju-facts dt { font-size: .74rem; font-weight: 700; color: var(--ju-muted); text-transform: uppercase; letter-spacing: .03em; }
.ju-facts dd { margin: 2px 0 0; font-weight: 800; font-size: 1rem; line-height: 1.25; }
.ju-vec-title { margin: 12px 0 6px; font-weight: 700; font-size: .9rem; color: var(--ju-muted); }
.ju-vecs { display: flex; flex-wrap: wrap; gap: 6px; }
.ju-vec { min-height: 38px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--ju-card-border); background: var(--ju-page-bg); color: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; }
.ju-vec:hover { border-color: var(--ju-accent); }
.ju-seen { margin: 10px 0 0; font-size: .82rem; color: var(--ju-muted); }

/* ---- tools ---- */
.ju-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.ju-menu { margin-left: auto; }
.ju-tools.is-setup { justify-content: flex-end; }

/* ---- help ---- */
.ju-help { max-width: 820px; margin: 18px auto 0; padding: 12px 16px; border-radius: 14px; background: var(--ju-card-bg); border: 1px solid var(--ju-card-border); }
.ju-help summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.ju-help ul { margin: 10px 0 0; padding-left: 20px; color: var(--ju-muted); line-height: 1.55; }
.ju-help li { margin-bottom: 4px; }
.ju-help strong { color: var(--text-color); }
.ju-credit { margin: 10px 0 0; font-size: .8rem; color: var(--ju-muted); line-height: 1.5; }
.ju-credit a, .ju-powered a { color: var(--ju-accent); }
.ju-powered { text-align: center; color: var(--ju-muted); font-size: .85rem; margin: 24px 0 0; }

/* ---- end of round ---- */
.ju-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--ju-overlay); overflow-y: auto; animation: ju-fade .2s ease-out; }
.ju-overlay[hidden] { display: none; }
@keyframes ju-fade { from { opacity: 0; } }
.ju-dialog { width: 100%; max-width: 420px; margin: auto; display: flex; flex-direction: column; gap: 8px; padding: 20px 16px 16px; border-radius: 22px; background: var(--ju-card-bg); border: 1px solid var(--ju-card-border); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); color: var(--text-color); text-align: center; animation: ju-rise .25s ease-out; }
@keyframes ju-rise { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.ju-dialog h2 { margin: 0; font-weight: 800; font-size: 1.45rem; }
.ju-dialog-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 24px; color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.ju-dialog-icon.is-perfect { background: linear-gradient(135deg, #f59e0b, #c2410c); }
.ju-dialog-sub { margin: 0; color: var(--ju-muted); line-height: 1.5; }
.ju-dialog-sub b { color: var(--text-color); }
.ju-newrec { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: linear-gradient(135deg, rgba(245, 158, 11, .25), rgba(194, 65, 12, .18)); color: var(--text-color); font-weight: 800; }
.ju-newrec i { color: var(--ju-gold); }
.ju-mist-wrap { text-align: left; }
.ju-mist-wrap[hidden] { display: none; }
.ju-mist-title { margin: 4px 0 4px; font-weight: 800; font-size: .9rem; }
.ju-mistakes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 34vh; overflow-y: auto; }
.ju-mistakes li { padding: 7px 10px; border-radius: 10px; background: var(--ju-page-bg); border-left: 4px solid var(--ju-bad); font-size: .92rem; line-height: 1.3; }
.ju-mistakes small { color: var(--ju-muted); font-size: .84rem; }
.ju-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.ju-dialog-actions .ju-btn-primary { grid-column: 1 / -1; order: -1; min-height: 52px; }
.ju-dialog-actions #ju-over-review:not([hidden]) { grid-column: 1 / -1; order: -1; }

/* ---- phone: the panel's blocks go around the map ---- */
@media (max-width: 899px) {
    .ju-main { padding-top: 84px; }
    .ju-hero { padding-bottom: 6px; }
    .ju-lead { font-size: .9rem; }
    .ju-app { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
    .ju-side { display: contents; }
    .ju-setup { order: 1; }
    .ju-qbar { order: 1; }
    .ju-mapcol { order: 2; }
    .ju-answers { order: 3; }
    .ju-learn { order: 3; }
    .ju-tools, .ju-tools.is-setup { order: 4; justify-content: center; }
    /* the map runs edge to edge on a phone: every pixel helps the small counties */
    .ju-stage { width: calc(100% + 24px); margin: 0 -12px; border-radius: 0; box-shadow: inset 0 1px 0 var(--ju-card-border), inset 0 -1px 0 var(--ju-card-border); }
    .ju-app[data-view="setup"] .ju-mapcol { order: 0; }
    .ju-status { min-height: 2.6em; font-size: .9rem; margin-top: 6px; }
    .ju-app[data-view="setup"] .ju-status, .ju-app[data-view="learn"] .ju-status { display: none; }
    .ju-qbar { padding: 10px 12px; }
    /* the list scrolls inside itself, so the county card below stays close */
    .ju-list { max-height: 46vh; overflow-y: auto; padding: 2px; overscroll-behavior: contain; }
    .ju-prompt { font-size: 1.12rem; }
    .ju-card { padding: 12px; }
}
@media (max-width: 420px) {
    .ju-mode { min-height: 54px; padding: 7px 8px; gap: 8px; }
    .ju-mode-icon { width: 30px; height: 30px; font-size: .9rem; }
    .ju-mode-t { font-size: .88rem; }
    .ju-mode-t small { font-size: .7rem; }
    .ju-opt { font-size: .95rem; min-height: 54px; }
    .ju-facts dd { font-size: .95rem; }
    .ju-zbtn { width: 42px; height: 42px; }
    .ju-mapbar { padding: 0 10px 6px; }
    .ju-legend { font-size: .76rem; gap: 3px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .ju-county, .ju-dialog, .ju-overlay, .ju-ping { animation: none !important; transition: none !important; }
}
