:root{font-family:system-ui,sans-serif;color:#163c35;background:#edf3ed}*{box-sizing:border-box}body{margin:0}header{background:#174b40;color:white;padding:30px max(5vw,20px)}header a{color:#cde9d5}header span{display:block;font-size:12px;letter-spacing:3px;margin-top:22px}h1{font-size:clamp(32px,5vw,56px);margin:10px 0}main{max-width:1400px;margin:auto;padding:20px}section{background:white;padding:24px;border-radius:16px;margin-bottom:20px;box-shadow:0 3px 15px #163c3509}h2{font-size:22px}label{display:block;margin:12px 0;font-weight:600}input,select{display:block;width:100%;padding:12px;margin-top:6px;border:1px solid #b4c9bf;border-radius:8px;font:inherit}button,a{touch-action:manipulation}button{padding:12px 18px;border:0;border-radius:9px;background:#176a50;color:white;font:inherit;font-weight:600;cursor:pointer;margin:5px 4px 5px 0}button:disabled{opacity:.5;cursor:wait}nav,.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}nav{margin-bottom:20px}nav select{width:auto;max-width:60%}.columns{display:grid;grid-template-columns:1.15fr 1fr;gap:20px}.columns section{min-width:0}#map{height:440px;background:#dce7df;border-radius:10px}.post-marker{background:#fff;border:3px solid #176a50;border-radius:50%;text-align:center;line-height:26px;font-weight:800}.team-marker{background:#ffe19a;padding:4px 8px;white-space:nowrap;border-radius:8px;width:max-content!important;height:auto!important}#status{white-space:pre-wrap;min-height:24px;color:#934625}#preview{max-height:280px;overflow:auto;background:#f4f7f3;padding:15px;margin-top:12px}#choices button{display:block;width:100%;text-align:left;margin:12px 0;padding:18px}#question img,#preview img{max-width:100%}.scroll{overflow:auto}table{border-collapse:collapse;width:100%}td,th{padding:14px;border-bottom:1px solid #dce7df;text-align:center}th:first-child{text-align:left}.qr-card{display:inline-block;width:45%;text-align:center;padding:30px;margin:2%;border:1px solid #bbb;break-inside:avoid}.qr-card img,.qr-card canvas{margin:auto;border:16px solid white}.qr-card p{overflow-wrap:anywhere;font-size:12px}#printArea{display:none}[hidden]{display:none!important}@media(max-width:800px){.columns{grid-template-columns:1fr}#map{height:340px}section{padding:18px}}@media print{body{background:white}header,main>*{display:none!important}main,#printArea{display:block!important}main{padding:0}.qr-card{height:440px}a{color:black}}
.level-picker{border:0;padding:0;margin:16px 0}.level-picker legend{font-weight:650;margin-bottom:8px}.level-picker button{background:#e6eee8;color:#25483c;border:1px solid #cbdccf;font-size:14px;padding:10px}.level-picker button[aria-pressed=true]{background:#176a50;color:white;border-color:#176a50}.selection-actions button{font-size:14px;padding:9px 12px;background:#eaf1eb;color:#174b40}.category-list{max-height:360px;overflow:auto;border:1px solid #d2e1d5;border-radius:10px;padding:10px}.category-list details{margin:4px 0 12px}.category-list summary{font-weight:700;padding:7px;cursor:pointer}.category-option{display:flex;align-items:center;gap:12px;margin:3px 0;padding:10px;border-radius:7px;font-weight:400;cursor:pointer}.category-option:hover{background:#f0f6ef}.category-option input{width:19px;height:19px;flex-shrink:0;margin:0;accent-color:#176a50}.category-option:has(input:checked){background:#e4f3e7}.task-category{color:#587065;font-weight:650;font-size:14px;letter-spacing:.3px}.task-paper{padding:24px 20px;background:#fff;border:1px solid #dce5de;border-radius:14px;box-shadow:0 5px 18px #233c3510;font:20px/1.6 Arial,sans-serif;overflow-x:auto;margin:18px 0 24px;isolation:isolate}.task-paper img,.task-paper svg{max-width:100%!important;height:auto}.task-paper .answer,.task-paper .answers,.task-paper .facit,.task-paper .task-number{display:none!important}.task-paper .fraction{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;text-align:center;margin:0 8px}.task-paper .fraction-line{border-top:2px solid currentColor;min-width:32px}.task-paper table{max-width:100%;width:auto}.task-paper td,.task-paper th{padding:8px}#choices button{display:flex;align-items:center;gap:14px;background:#f4f8f4;color:#183e32;border:2px solid #cbdccf;font-size:19px;line-height:1.35}#choices button:hover:not(:disabled){background:#e6f1e7;border-color:#176a50}.choice-letter{display:grid;place-items:center;width:34px;height:34px;flex-shrink:0;border-radius:50%;background:#dbeadf;font-weight:800;font-size:15px}.choice-text{overflow-wrap:anywhere}#choices button:disabled{opacity:1;cursor:default}#choices button.answer-correct{background:#def3e3;border-color:#268746}#choices button.answer-wrong{background:#fde8e4;border-color:#c5624f}#answer{font-size:21px;font-weight:700}#task{max-width:760px;margin:20px auto}#task h2{font-size:28px}@media(max-width:500px){.task-paper{padding:20px 14px}#choices button{font-size:18px;padding:15px 12px}.level-picker button{font-size:12px;padding:9px}.category-list{max-height:300px}}
@page{size:A4 portrait;margin:10mm}
@media print{
  main{width:190mm;max-width:none;margin:0;padding:0}
  #printArea{width:190mm}
  .qr-sheet{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(4,65mm);gap:5mm;width:190mm;break-after:page;page-break-after:always}
  .qr-sheet:last-child{break-after:auto;page-break-after:auto}
  .qr-card{display:flex;flex-direction:column;align-items:center;justify-content:center;width:auto;height:65mm;min-width:0;margin:0;padding:2mm;border:0.25mm dashed #aaa;break-inside:avoid;page-break-inside:avoid;color:#000}
  .qr-card h2{font:600 9pt/1.2 Arial,sans-serif;margin:0 0 1mm;max-width:100%;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .qr-card h1{font:700 16pt/1.15 Arial,sans-serif;margin:0 0 1mm}
  .qr-card .qr{background:#fff;padding:2mm;line-height:0}
  .qr-card img,.qr-card canvas{width:36mm!important;height:36mm!important;border:0;margin:0;image-rendering:pixelated}
  .qr-card p{font:8pt/1.2 Arial,sans-serif;margin:1mm 0 0}
}
.category-counter{display:flex;align-items:stretch;gap:6px;margin:5px 0}.category-counter button{margin:0;border:1px solid #d1e0d4;background:#f5f8f4;color:#25483c;font-size:15px}.category-counter .category-add{flex:1;text-align:left;font-weight:500}.category-counter .category-reset{min-width:46px;font-weight:800}.category-counter.is-selected button{background:#deefdf;border-color:#6fa381}.category-counter .category-reset:hover{background:#fde8e4}
.post-count{display:flex;align-items:center;flex-wrap:wrap;gap:10px 14px;margin:16px 0;padding:0 0 15px;border-bottom:1px solid #dce7df}.post-count>span{font-weight:650}.post-count strong{font-size:28px;color:#176a50;line-height:1}.post-count small{flex-basis:100%;color:#587065;font-size:13px}.leaflet-container.post-placement,.leaflet-container.post-placement .leaflet-interactive,.leaflet-container.post-placement .leaflet-marker-icon{cursor:var(--post-cursor)!important}.leaflet-container.post-placement .leaflet-control{cursor:auto}
.celebration{position:relative;overflow:hidden;text-align:center;background:linear-gradient(160deg,#fffdf3,#edf7ec);padding:40px 24px}.celebration-kicker{font-size:13px;letter-spacing:3px;color:#54745b;font-weight:800}.celebration h2{font-size:clamp(28px,4vw,48px);margin:12px 0 32px}.podium{display:flex;align-items:flex-end;justify-content:center;gap:12px;max-width:880px;margin:0 auto 24px;position:relative;z-index:1}.podium-place{flex:1;min-width:0;max-width:290px}.podium-names{display:flex;flex-direction:column;gap:6px;font-size:clamp(16px,2.4vw,28px);overflow-wrap:anywhere}.podium-place p{font-size:21px;font-weight:700;margin:10px 0}.podium-step{border-radius:14px 14px 0 0;display:flex;flex-direction:column;align-items:center;justify-content:center;border:1px solid #0001;box-shadow:inset 0 4px 0 #fff7}.podium-step span{font-size:42px}.podium-step b{font-size:56px;color:#392d14}.place-1 .podium-step{height:220px;background:linear-gradient(130deg,#ffe898,#e9b93f)}.place-2 .podium-step{height:160px;background:linear-gradient(130deg,#f0f3f4,#b9c4cb)}.place-3 .podium-step{height:115px;background:linear-gradient(130deg,#f2c8a3,#c48d63)}#confetti{position:absolute;inset:0;pointer-events:none;overflow:hidden}#confetti i{position:absolute;left:var(--left);top:-20px;width:10px;height:17px;background:var(--color);animation:podium-confetti 3.5s var(--delay) ease-in both}@keyframes podium-confetti{0%{transform:translateY(0) rotate(0);opacity:1}100%{transform:translateY(650px) rotate(var(--turn));opacity:0}}.review-nav{display:flex;align-items:center;gap:14px}.review-nav label{min-width:130px}.review-choices{list-style:none;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:12px}.review-choices li{padding:18px;border:1px solid #cfdbd0;border-radius:12px;font-size:20px;overflow-wrap:anywhere}.review-choices li b{margin-right:10px}.review-choices li strong{display:block;font-size:16px;margin-top:10px}.review-choices .review-correct{background:#e0f2df;border:2px solid #408c4d}#review{scroll-margin-top:15px}#review .task-paper{font-size:24px}#reviewTeams td{text-align:left}@media(max-width:600px){.celebration{padding:24px 10px}.podium{gap:6px}.podium-place p{font-size:16px}.podium-step span{font-size:30px}.podium-step b{font-size:40px}.review-choices{grid-template-columns:1fr}.review-nav{flex-wrap:wrap;gap:8px}}@media(prefers-reduced-motion:reduce){#confetti i{animation:none;display:none}}
.task-paper *{box-sizing:border-box;min-width:0}.task-paper .fact-box,.task-paper .given,.task-paper .task-text{max-width:100%}.task-paper .sketch-wrap{margin:16px 0!important}.task-paper .frac{display:inline-flex!important;flex-direction:column!important;align-items:center!important;vertical-align:middle!important}.task-paper .frac .bottom{border-top:1.5px solid currentColor!important}.task-paper .sqrt-over{border-top:1px solid currentColor!important}.task-paper .sqrt{white-space:nowrap}
.task-paper .diagram:has(img){display:table!important;width:fit-content!important;background:transparent!important;border:0!important;margin:14px 0!important}.task-paper .diagram img{display:block}.task-paper .fraction{display:inline-flex!important;flex-direction:column!important;align-items:center!important}.task-paper .fraction .numerator{border-bottom:2px solid currentColor!important}
.task-paper .operator{vertical-align:middle!important}.task-paper .visual svg{display:block;max-height:320px}.task-paper .figure svg,.task-paper .sketch-wrap svg{max-height:260px}
.route-lookup{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.route-lookup label{flex:1;min-width:180px}.route-picker{border:2px solid #bbd9c5}#routeSummary{font-weight:750;color:#176a50}#routeId{text-transform:uppercase;letter-spacing:1px}.scan-post{font-size:22px;width:100%;padding:20px}.scanner-view{position:relative;background:#112b24;border-radius:12px;overflow:hidden;max-width:600px;margin:auto}.scanner-view video{display:block;width:100%;max-height:65vh;object-fit:contain}#scannerPanel{scroll-margin-top:20px}#recoveryHelp{border-left:5px solid #e5b84b}.team-recover{background:transparent;color:#174b40;text-decoration:underline dotted;text-underline-offset:5px;padding:6px;font-size:inherit;text-align:left}.recovery-popover{position:fixed;z-index:2000;top:50%;left:50%;transform:translate(-50%,-50%);width:min(430px,94vw);max-height:92vh;overflow:auto;background:white;border:3px solid #176a50;border-radius:18px;padding:24px;box-shadow:0 0 0 100vmax #102c2455;text-align:center}.recovery-popover>button{float:right}.recovery-popover h2{clear:both;padding-top:12px;overflow-wrap:anywhere}#recoveryQr{display:flex;justify-content:center;padding:20px;background:#fff}#recoveryQr img,#recoveryQr canvas{max-width:100%;height:auto}#recoveryNote{line-height:1.5}@media print{.qr-card .printed-route-id{font-size:10pt;font-weight:800;letter-spacing:.3px}.recovery-popover{display:none!important}}

.post-answered{background:#187344!important;color:#fff!important;border-color:#125c36!important}.post-visited{background:#fff0b5!important;color:#563a00!important;border-color:#9b7100!important}.post-check{position:absolute;right:-7px;top:-9px;background:inherit;border:2px solid currentColor;border-radius:50%;width:20px;height:20px;line-height:16px;font-size:15px;font-weight:900}.post-checklist{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0 22px}.post-chip{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:44px;padding:4px;border:2px solid #187344;border-radius:50%;background:white;color:#174b34;font-weight:700}.post-legend{font-size:.95rem;line-height:1.6}

.post-wrong{background:#b42332!important;color:#fff!important;border-color:#881a26!important}

.student-map{position:relative;isolation:isolate}.run-timer{position:absolute;top:8px;left:50%;transform:translateX(-50%);z-index:500;background:#fff;color:#000;padding:3px 7px;border-radius:3px;font-size:12px;line-height:1.3;font-variant-numeric:tabular-nums;box-shadow:0 1px 4px #0003;pointer-events:none}.timer-warning{color:#c41324;font-weight:700;animation:timer-pulse 1s ease-in-out infinite}.map-banner{position:absolute;top:50%;left:0;right:0;transform:translateY(-50%);z-index:501;padding:18px 8px;background:#fffffff2;color:#174b34;text-align:center;font-size:clamp(20px,5vw,32px);font-weight:800;box-shadow:0 2px 10px #0003;pointer-events:none}@keyframes timer-pulse{50%{opacity:.4}}@media(prefers-reduced-motion:reduce){.timer-warning{animation:none}}

.custom-question{margin:20px 0;padding:16px;border:1px solid #bdcfca;border-radius:12px;min-width:0}.custom-question legend{font-weight:700}.custom-question textarea{display:block;width:100%;box-sizing:border-box;padding:10px;font:inherit;border:1px solid #8ca99e;border-radius:6px;resize:vertical}.custom-answer{margin:12px 0;padding:10px;background:#f4f8f6;border-radius:6px}.custom-answer .correct-choice{display:flex;align-items:center;gap:8px;font-size:14px}.correct-choice input[type=radio]{width:auto;margin:0}
