/* Yellowstone Ranger. Big, round, friendly buttons sized for fingers, like Wildfire. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8ec7e8; font-family: -apple-system, "Avenir Next", "Trebuchet MS", "Segoe UI", Roboto, sans-serif; color: #1f2a1f; }
#app { position: fixed; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; }
#view { position: absolute; left: 0; top: 0; touch-action: none; display: block; }
.hidden { display: none !important; }

.btn { border: 0; font: inherit; font-weight: 800; cursor: pointer; color: #1f2a1f; box-shadow: 0 3px 0 rgba(0,0,0,0.22), 0 4px 10px rgba(0,0,0,0.15); outline: none; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.22); }
.btn.round { width: 52px; height: 52px; border-radius: 26px; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.btn.pill { border-radius: 30px; padding: 12px 22px; font-size: 18px; min-height: 52px; }
.btn.big { font-size: 22px; padding: 14px 30px; min-height: 60px; }
.red { background: #ff5a4e; color: #fff; } .green { background: #4cc35a; color: #fff; }
.blue { background: #3d9bff; color: #fff; } .orange { background: #ff9a1f; color: #fff; }
.white { background: #fff; } .yellow { background: #ffd23f; }

#hud { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1; }
#hud > * { pointer-events: auto; }
#topbar { position: absolute; left: 0; right: 0; top: 0; padding: 8px; padding-top: calc(8px + env(safe-area-inset-top)); padding-left: calc(8px + env(safe-area-inset-left)); padding-right: calc(8px + env(safe-area-inset-right));
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.chip { background: rgba(255,255,255,0.92); border-radius: 22px; min-height: 44px; padding: 6px 14px; display: flex; align-items: center; font-weight: 800; font-size: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
#scoreChip { color: #1b7a2b; }
#missionChip { max-width: 46vw; font-size: 14px; line-height: 1.2; }
#btnSpeed { margin-left: auto; font-weight: 900; }

#toast { position: absolute; left: 50%; top: calc(70px + env(safe-area-inset-top)); transform: translateX(-50%); background: rgba(30,30,30,0.85); color: #fff; padding: 10px 18px; border-radius: 18px; font-weight: 700; font-size: 17px; max-width: 90%; text-align: center; pointer-events: none; }
#tip { position: absolute; left: 50%; top: calc(118px + env(safe-area-inset-top)); transform: translateX(-50%); width: 440px; max-width: 94%; background: #fffbe6; border: 4px solid #ffb627; border-radius: 22px; padding: 14px 16px; font-size: 18px; font-weight: 700; line-height: 1.35; box-shadow: 0 8px 24px rgba(0,0,0,0.25); display: flex; flex-direction: column; }
#tip .btn { align-self: flex-end; }

#mini { position: absolute; right: calc(10px + env(safe-area-inset-right)); bottom: calc(118px + env(safe-area-inset-bottom)); width: 170px; height: 110px; background: rgba(20,60,30,0.35); border-radius: 14px; border: 3px solid rgba(255,255,255,0.8); touch-action: none; }

#toolbar { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; overflow: hidden; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.28)); }
.tool { flex: none; width: 84px; height: 88px; border-radius: 20px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 2px; border: 0; font: inherit; font-weight: 800; color: #1f2a1f; box-shadow: 0 3px 0 rgba(0,0,0,0.22); }
.tool .ico { font-size: 26px; line-height: 1; }
.tool .lbl { font-size: 13px; line-height: 1.1; margin-top: 2px; }
.tool.on { background: #ffd23f; box-shadow: 0 0 0 4px #fff, 0 3px 0 rgba(0,0,0,0.22); }

.screen { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: linear-gradient(#bfe8ff, #cfe8a8 55%, #e8d9a0); z-index: 40; }
.tscroll { position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(30px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { width: 72px; height: 72px; border-radius: 16px; }
.logo h1 { margin: 0; font-size: 40px; font-weight: 900; color: #1e5a3a; text-shadow: 0 3px 0 #fff, 0 6px 12px rgba(0,0,0,0.12); line-height: 1.05; }
.tag { margin: 8px 0 4px; font-size: 20px; font-weight: 800; text-align: center; color: #2c4a2c; }
.lead { max-width: 520px; text-align: center; font-weight: 650; font-size: 17px; line-height: 1.4; color: #2c4a2c; }
.how { max-width: 520px; padding-left: 20px; font-size: 16px; font-weight: 650; line-height: 1.45; }
.how li { margin: 8px 0; }
.foot { margin-top: 28px; font-size: 13px; font-weight: 600; color: #4a5a4a; text-align: center; max-width: 520px; line-height: 1.4; }
h2 { font-size: 21px; margin: 20px 0 8px; color: #24412a; }
#btnPlay { margin: 12px 0 8px; }

.modal { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); z-index: 50; }
.card { background: #fff; border-radius: 22px; padding: 18px; width: 400px; max-width: 100%; max-height: 92%; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 8px; }
.card.wide { width: 520px; }
.ctitle { font-size: 26px; font-weight: 900; }
.small { font-size: 14px; font-weight: 650; color: #4a5a4a; line-height: 1.35; }
.ptitle2 { font-size: 18px; font-weight: 900; margin-top: 8px; }
.prow2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.predrow .chip { flex: 1; justify-content: center; }
.facts { margin: 8px 0; padding-left: 18px; font-weight: 650; line-height: 1.4; }
.facts li { margin: 6px 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg.tight button { flex: 1; min-height: 48px; border-radius: 16px; border: 4px solid transparent; background: #eef3ea; font: inherit; font-weight: 800; }
.seg.tight button.on { border-color: #ff9a1f; background: #fff6e6; }
.jlist { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.jitem { text-align: left; border: 0; background: #f3f6f0; border-radius: 14px; padding: 10px 12px; font: inherit; font-weight: 800; }
.jitem .sub { display: block; font-size: 13px; font-weight: 650; color: #4a5a4a; }
.jitem.lock { opacity: 0.55; }

@media (max-width: 700px) {
  .logo h1 { font-size: 28px; }
  .tool { width: 72px; height: 80px; }
  #missionChip { max-width: 42vw; font-size: 13px; }
}
@media (orientation: portrait) and (max-width: 900px) {
  #mini { width: 130px; height: 86px; }
}

#starChip { color: #b07500; }
#btnMute { font-size: 20px; }
.lead.left { text-align: left; max-width: 100%; }

#checklist { position: absolute; left: calc(8px + env(safe-area-inset-left)); top: calc(64px + env(safe-area-inset-top)); width: 270px; max-width: 42vw; background: rgba(255,255,255,0.94); border-radius: 18px; box-shadow: 0 6px 18px rgba(0,0,0,0.22); overflow: hidden; z-index: 4; }
#clToggle { width: 100%; border: 0; background: #1e5a3a; color: #fff; font: inherit; font-weight: 900; font-size: 15px; text-align: left; padding: 10px 12px; cursor: pointer; }
#clList { max-height: 54vh; overflow-y: auto; padding: 4px 6px; }
#checklist.collapsed #clList { display: none; }
.clitem { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 12px; padding: 5px 8px; font: inherit; font-weight: 750; font-size: 12.5px; line-height: 1.2; color: #1f2a1f; cursor: pointer; }
.clitem:hover, .clitem.next { background: #fff4d0; }
.clitem.done { color: #2b6b34; }
.clitem .box { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 2px solid #1e5a3a; display: flex; align-items: center; justify-content: center; font-size: 13px; margin-top: 1px; }
.clitem.done .box { background: #4cc35a; color: #fff; border-color: #2b8a38; }
.clitem .meta { flex: 1; }
.clitem .prog { display: block; font-size: 11px; font-weight: 700; color: #4a5a4a; }

#btnWait { position: absolute; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5; }
#btnShutter { position: absolute; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5; }
#photoFlash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 8; transition: opacity 0.08s; }
#photoFlash.on { opacity: 0.85; }
#reticle { position: absolute; left: 50%; top: 48%; width: 160px; height: 160px; margin: -80px 0 0 -80px; border: 4px solid rgba(255,255,255,0.9); border-radius: 16px; box-shadow: 0 0 0 2px rgba(0,0,0,0.25); pointer-events: none; z-index: 3; }
#reticle:before, #reticle:after { content: ""; position: absolute; background: rgba(255,255,255,0.9); }
#reticle:before { left: 50%; top: 12px; bottom: 12px; width: 2px; margin-left: -1px; }
#reticle:after { top: 50%; left: 12px; right: 12px; height: 2px; margin-top: -1px; }

#challengePop { position: absolute; left: 50%; top: calc(80px + env(safe-area-inset-top)); transform: translateX(-50%); background: #1e5a3a; color: #fff; padding: 12px 20px; border-radius: 20px; font-weight: 800; font-size: 18px; box-shadow: 0 8px 24px rgba(0,0,0,0.28); z-index: 6; pointer-events: none; }
#challengePop.hidden { display: none !important; }

.qtext { font-size: 20px; font-weight: 800; line-height: 1.35; }
.qchoices { display: flex; flex-direction: column; gap: 8px; }
.qchoices button { text-align: left; border: 0; background: #eef3ea; border-radius: 16px; padding: 12px 14px; font: inherit; font-weight: 750; font-size: 16px; min-height: 52px; }
.qchoices button.good { background: #4cc35a; color: #fff; }
.qchoices button.bad { background: #ff5a4e; color: #fff; }

.award { align-items: center; text-align: center; }
.badge { margin: 8px 0 4px; }
.badge-ring { width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ffe27a, #d4a017 55%, #8a5a00); padding: 10px; box-shadow: 0 8px 0 #8a5a00, 0 12px 24px rgba(0,0,0,0.25); }
.badge-inner { width: 100%; height: 100%; border-radius: 50%; background: #1e5a3a; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 4px solid #fff; }
.badge-ico { font-size: 42px; line-height: 1; }
.badge-name { font-weight: 900; font-size: 14px; margin-top: 6px; padding: 0 10px; line-height: 1.2; }
.patch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.patch-card { background: #f3f6f0; border-radius: 16px; padding: 12px; text-align: center; min-height: 160px; }
.patch-card.lock { opacity: 0.7; }
.patch-card .mini-badge { width: 88px; height: 88px; margin: 0 auto 8px; border-radius: 50%; background: #1e5a3a; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; border: 4px solid #d4a017; }
.patch-card.lock .mini-badge { background: #8a948a; border-color: #c5c8c2; filter: grayscale(0.6); }
.patch-card .pname { font-weight: 900; font-size: 15px; }
.patch-card .psub { font-size: 12px; font-weight: 650; color: #4a5a4a; margin-top: 4px; }

#btnContinue { margin-bottom: 8px; }
#btnTitlePatches { margin-bottom: 4px; }

@media (max-width: 700px) {
  #checklist { width: 210px; max-width: 54vw; }
  .clitem { font-size: 12px; padding: 6px 6px; }
  #starChip { display: none; }
}
@media (orientation: portrait) and (max-width: 900px) {
  #checklist { max-height: 36vh; }
  #clList { max-height: 28vh; }
}
