/* Geyser Quest. Storybook field-guide look, touch first. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #efe6cf; color: #2b2418; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#app { position: fixed; inset: 0; overflow: hidden; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }
canvas.fill { display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; touch-action: manipulation; }
button:disabled { opacity: 0.6; cursor: default; }
.ico { flex: none; vertical-align: middle; }
h1, h2, h3 { margin: 0.2em 0 0.4em; }
.small, small { font-size: 0.86em; color: #6a5d48; }

/* top bar */
.topbar { flex: none; display: flex; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 10px 6px; background: #1f5f8f; color: #fff; position: sticky; top: 0; z-index: 5; }
.topbar .title { flex: 1; font-weight: 800; font-size: 1.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { background: rgba(255,255,255,0.18); border-radius: 999px; padding: 6px 12px; font-weight: 700; white-space: nowrap; }
.round { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #1f5f8f; font-size: 1.4em; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 rgba(0,0,0,0.2); }
.topbar .round { background: rgba(255,255,255,0.95); }

/* buttons */
.big { display: block; width: 100%; min-height: 52px; margin: 8px 0; padding: 12px 16px; border-radius: 14px; font-size: 1.08em; font-weight: 800; background: #fff; color: #1f5f8f; box-shadow: 0 3px 0 rgba(0,0,0,0.18); }
.big.go { background: #2e9d4a; color: #fff; }
.big.danger { background: #c0392b; color: #fff; }
.big.call { background: #e8752a; color: #fff; font-size: 1.3em; letter-spacing: 1px; }
.big.dim { opacity: 0.6; }
.big:active, .tile:active, .choice:active, .basinbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.18); }
.small { min-height: 36px; }
button.small { background: #fff; border-radius: 10px; padding: 6px 12px; font-weight: 700; color: #1f5f8f; margin-top: 6px; box-shadow: 0 2px 0 rgba(0,0,0,0.15); }
.row { display: flex; gap: 10px; padding: 0 12px; }
.row > .big { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 10px 16px; font-weight: 700; box-shadow: 0 2px 0 rgba(0,0,0,0.15); min-height: 46px; }

/* hub */
.hub { padding: calc(12px + env(safe-area-inset-top)) 14px 24px; max-width: 980px; margin: 0 auto; width: 100%; }
.hubhead h1 { font-size: 2.1em; color: #1f5f8f; margin: 0; letter-spacing: -0.5px; }
.hubhead .sub { color: #8a6a3a; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; font-size: 0.8em; }
.rankcard { background: #fff; border-radius: 16px; padding: 12px 14px; margin: 12px 0 8px; box-shadow: 0 2px 0 rgba(0,0,0,0.1); }
.rk { display: flex; gap: 12px; align-items: center; }
.rkname { font-weight: 900; font-size: 1.25em; color: #1f5f8f; }
.rkpts { font-size: 0.9em; color: #6a5d48; }
.bar { height: 12px; border-radius: 6px; background: #e3dccb; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #2f8fd8, #2e9d4a); border-radius: 6px; }
.goal { display: block; width: 100%; text-align: left; background: #fff4d6; border: 2px dashed #e0a64a; border-radius: 14px; padding: 12px 14px; font-weight: 700; margin: 6px 0 12px; min-height: 48px; }
.goal .lbl { display: inline-block; background: #e0a64a; color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 0.8em; margin-right: 4px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(5, 1fr); } }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: #fff; border-radius: 16px; padding: 12px; min-height: 128px; box-shadow: 0 3px 0 rgba(0,0,0,0.12); }
.tile b { font-size: 1.0em; line-height: 1.15; color: #1f3f5f; }
.tile small { font-size: 0.78em; line-height: 1.25; }
.tile .num { position: absolute; top: 8px; right: 10px; font-weight: 900; color: #cfc5ae; }
.tile.locked { background: #e9e4d8; padding-right: 34px; }
.tile.locked .ico { opacity: 0.45; }
.lockbadge { position: absolute; bottom: 8px; right: 8px; }
.hubrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; justify-content: center; }

/* overlays */
#layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.overlay { position: absolute; inset: 0; background: rgba(20,30,40,0.55); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity 0.18s; pointer-events: auto; }
.overlay.in { opacity: 1; }
.overlay .panel { background: #fffaf0; border-radius: 20px; padding: 18px; width: 100%; max-width: 520px; max-height: 92%; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.overlay h2 { color: #1f5f8f; }
.stars { font-size: 2.4em; text-align: center; letter-spacing: 6px; }
.star { color: #d9d2c0; } .star.on { color: #f0a500; text-shadow: 0 2px 0 #b07800; }
.bigpts { text-align: center; font-size: 2em; font-weight: 900; color: #2e9d4a; }
.bigpts small { display: block; font-size: 0.4em; color: #6a5d48; }
.lines { padding-left: 18px; margin: 8px 0; } .lines li { margin: 4px 0; }
.lines li.ok { color: #1a7a3a; } .lines li.no { color: #b03020; }
.rankline { font-weight: 800; margin-top: 8px; } .rankline span { font-weight: 600; color: #6a5d48; font-size: 0.9em; }
.rankup .panel { text-align: center; } .rankname { font-size: 1.8em; font-weight: 900; color: #e8752a; margin: 8px 0; }
.burst { height: 60px; background: radial-gradient(circle, #ffd54a 0%, rgba(255,213,74,0) 70%); }
.alert .panel { border: 4px solid #e8752a; }
.alertbar { background: #e8752a; color: #fff; font-weight: 900; letter-spacing: 1px; border-radius: 10px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; animation: blink 0.8s infinite alternate; }
@keyframes blink { from { filter: brightness(1); } to { filter: brightness(1.25); } }

/* toasts */
#toasts { position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 30; pointer-events: none; }
.toast { background: rgba(30,40,50,0.92); color: #fff; padding: 10px 16px; border-radius: 12px; max-width: 92%; font-weight: 600; transition: opacity 0.4s, transform 0.4s; }
.toast.out { opacity: 0; transform: translateY(10px); }
.toast.card { background: #1f5f8f; } .toast.tpatch, .toast.tbadge { background: #8a5a00; } .toast.info { background: #5a3a1a; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot.r0, .r0 .dot { background: #7a8a6a; } .dot.r1 { background: #2e86de; } .dot.r2 { background: #9b59b6; } .dot.r3 { background: #f0a500; }
.rar { font-size: 0.78em; font-weight: 800; padding: 1px 6px; border-radius: 6px; color: #fff; }
.rar.r0 { background: #7a8a6a; } .rar.r1 { background: #2e86de; } .rar.r2 { background: #9b59b6; } .rar.r3 { background: #f0a500; }
.tag { font-size: 0.78em; background: #e6f2ff; color: #1f5f8f; border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.tag.gold { background: #ffe9a8; color: #7a5200; }

/* shared mode layout */
.scenebox { position: relative; flex: none; min-height: 240px; height: 42vh; max-height: 520px; background: #cfe6f6; overflow: hidden; }
.scenebox.lab { height: 36vh; min-height: 200px; }
.scenebox.color { height: 46vh; }
.scenebox.dashbox { height: 46vh; min-height: 220px; flex: none; border-radius: 14px; overflow: hidden; margin-bottom: 8px; }
.scenebox.dashbox.small { height: 30vh; min-height: 160px; }
.scenebox.finalebox { height: 50vh; flex: none; border-radius: 14px; overflow: hidden; }
.scenebox canvas, .mapbox canvas, .parkmap canvas { position: absolute; inset: 0; }
.clockchip { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.92); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-variant-numeric: tabular-nums; z-index: 2; }
.qcard, .logpanel, .colorpanel, .dials, .goalbar, .cluecard, .signs, .sbctl, .tools { padding: 10px 14px; }
.qcard, .logpanel, .colorpanel, .dials { flex: none; max-width: 760px; width: 100%; margin: 0 auto; }
.q-n { font-weight: 800; color: #8a6a3a; font-size: 0.9em; }
.q-text { font-size: 1.12em; font-weight: 700; margin: 6px 0 10px; line-height: 1.35; }
.choices { display: grid; gap: 8px; }
.choices.small { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choice { background: #fff; border-radius: 12px; padding: 14px; font-weight: 700; text-align: left; min-height: 52px; box-shadow: 0 2px 0 rgba(0,0,0,0.15); border: 2px solid transparent; }
.choice.sel { border-color: #2f8fd8; background: #e6f2ff; }
.choice.right { background: #d8f3dc; border-color: #2e9d4a; } .choice.wrong { background: #fbe0dc; border-color: #c0392b; }
.why { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; line-height: 1.35; }
.why.ok { background: #e3f6e6; } .why.no { background: #fdeee9; }
.window input[type=range] { width: 100%; height: 44px; }
.win-lab { font-size: 1.05em; }
.goalbar { background: #fff4d6; border-bottom: 2px solid #ecd9a8; line-height: 1.35; }
.hintline { padding: 6px 14px; color: #5a4d38; line-height: 1.35; }
.hintline.top { padding-top: 10px; }

/* explorer */
.mapbox { position: relative; flex: 1 1 auto; min-height: 300px; background: #dccfb0; touch-action: none; overflow: hidden; }
.zoomctl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.cluecard { flex: none; background: #fffaf0; border-top: 3px solid #e0a64a; min-height: 120px; }
.cl-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; color: #8a6a3a; font-size: 0.9em; flex-wrap: wrap; }
.cl-text { font-size: 1.08em; font-weight: 600; margin: 6px 0; line-height: 1.35; }
.cl-found b { color: #1f5f8f; font-size: 1.15em; }
.parkwrap { flex: 1; display: flex; flex-direction: column; }
.parkmap { position: relative; height: 38vh; min-height: 220px; flex: none; overflow: hidden; }
.basinlist, .pickwrap { padding: 10px 14px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); max-width: 980px; width: 100%; margin: 0 auto; }
.pickwrap > p, .pickwrap > .q-n, .pickwrap > ul { grid-column: 1 / -1; }
.basinbtn { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: #fff; border-radius: 14px; padding: 12px 14px; min-height: 60px; box-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.basinbtn b { color: #1f3f5f; font-size: 1.05em; }
.basinbtn.locked { background: #e9e4d8; color: #8a8270; }
.loglist { padding-left: 18px; margin: 0; }

/* logbook */
.logpanel .row { padding: 0; }
.logform .fl { font-weight: 800; margin: 10px 0 4px; }
.logform .big.go { opacity: 0.55; } .logform .big.go.ready { opacity: 1; }

/* lab */
.dials { display: grid; gap: 8px; }
.dial .dl { font-weight: 800; font-size: 0.85em; color: #8a6a3a; margin-bottom: 3px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.segb, .togb { background: #fff; border-radius: 10px; padding: 10px 12px; font-weight: 700; min-height: 44px; box-shadow: 0 2px 0 rgba(0,0,0,0.12); border: 2px solid transparent; }
.segb.on, .togb.on { background: #1f5f8f; color: #fff; }
.segb.lockd { opacity: 0.55; }
.togs { display: flex; flex-wrap: wrap; gap: 6px; }
.labres { padding: 12px; border-radius: 12px; line-height: 1.35; } .labres.ok { background: #e3f6e6; } .labres.no { background: #fdeee9; }

/* color lab */
.palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin: 6px 0; }
.swatch { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 0.9em; min-height: 46px; border: 3px solid transparent; text-align: left; }
.swatch i { width: 24px; height: 24px; border-radius: 50%; flex: none; border: 2px solid rgba(0,0,0,0.15); }
.swatch.on { border-color: #1f5f8f; }

/* shake */
.shakegrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px 12px; }
@media (min-width: 700px) { .shakegrid { grid-template-columns: repeat(3, 1fr); } }
.stile { background: #fff; border-radius: 12px; padding: 6px; border: 3px solid transparent; display: flex; flex-direction: column; }
.stile canvas { width: 100%; height: 110px; border-radius: 8px; display: block; }
.stile .sn { font-weight: 700; font-size: 0.88em; padding-top: 4px; }
.stile.sel { border-color: #e8752a; background: #fff1e6; }
.stile.changed { border-color: #2e9d4a; } .stile.same.sel { border-color: #c0392b; }
.shaking { animation: shake 0.12s infinite; }
@keyframes shake { 0% { transform: translate(0, 0); } 25% { transform: translate(-4px, 2px); } 50% { transform: translate(3px, -3px); } 75% { transform: translate(-2px, -2px); } }
.signs { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; }
.chip.warn { background: #ffe0b0; color: #7a3a00; }

/* trivia */
.screen.night, .night { background: #1c2340; color: #eef; }
.night .q-n { color: #c9b98a; } .night .choice { background: #2c3560; color: #fff; }
.night .choice.right { background: #1f6a3a; } .night .choice.wrong { background: #7a2a2a; }
.night .why.ok { background: #1f4a32; } .night .why.no { background: #4a2626; }
.listenbtn { background: #ffd54a; color: #3a2a00; }

/* build and sandbox */
.sbctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fsel { font: inherit; font-weight: 700; padding: 10px; border-radius: 10px; min-height: 46px; max-width: 100%; border: 2px solid #c8bca0; background: #fff; }
.sbgo { width: auto; margin: 0; padding: 10px 22px; }
.sbinfo { width: 100%; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; }
.scenebox.build { height: 46vh; }

/* cards */
.binderhead { padding: 10px 14px 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; flex: none; }
.tab { background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; white-space: nowrap; min-height: 42px; }
.tab.on { background: #1f5f8f; color: #fff; } .tab.on small { color: #cfe; }
.rarf { padding: 0 12px 6px; }
.binder { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 8px 12px 20px; }
.minicard { background: #fff; border-radius: 12px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 3px solid #e3dccb; min-height: 140px; }
.minicard canvas { width: 56px; height: 56px; }
.minicard .mn { font-weight: 700; font-size: 0.8em; line-height: 1.15; text-align: center; }
.minicard .mr { font-size: 0.7em; font-weight: 800; }
.minicard.r1 { border-color: #9cc3ee; } .minicard.r2 { border-color: #c9a3dc; } .minicard.r3 { border-color: #f0c860; }
.minicard.locked { background: #eee9dd; }
.minicard.shiny { background: linear-gradient(135deg, #fff, #fff3c4, #fff); box-shadow: 0 0 0 2px #f0a500; }
.mr.r0 { color: #6a7a5a; } .mr.r1 { color: #2e86de; } .mr.r2 { color: #8e44ad; } .mr.r3 { color: #c98a00; }

/* card viewer */
.cardview .panel { text-align: center; }
.rcard { position: relative; width: 100%; max-width: 340px; margin: 0 auto; aspect-ratio: 5 / 7; perspective: 1000px; cursor: pointer; }
.rcard .face { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform 0.5s; background: #fff; border: 6px solid #7a8a6a; overflow: hidden; display: flex; flex-direction: column; }
.rcard.r1 .face { border-color: #2e86de; } .rcard.r2 .face { border-color: #9b59b6; } .rcard.r3 .face { border-color: #f0a500; }
.rcard.shiny .front { box-shadow: inset 0 0 30px rgba(255,213,74,0.8); }
.rcard .back { transform: rotateY(180deg); padding: 12px; text-align: left; overflow-y: auto; font-size: 0.9em; }
.rcard.flipped .front { transform: rotateY(180deg); } .rcard.flipped .back { transform: rotateY(360deg); }
.rcard canvas { width: 100%; height: auto; display: block; }
.cname { font-weight: 900; font-size: 1.3em; color: #1f3f5f; padding: 8px 10px 0; }
.cmeta { color: #6a5d48; font-size: 0.85em; padding: 2px 10px; }
.crar { margin: auto 10px 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; font-size: 0.85em; }
.crar.r0 { color: #6a7a5a; } .crar.r1 { color: #2e86de; } .crar.r2 { color: #8e44ad; } .crar.r3 { color: #c98a00; }
.back dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0; } .back dt { font-weight: 800; color: #8a6a3a; } .back dd { margin: 0; }
.back .fact { line-height: 1.35; } .back .tip { background: #fff4d6; padding: 6px 8px; border-radius: 8px; } .back .src { font-size: 0.78em; color: #8a7d68; }

/* progress */
.progress { padding: 10px 14px 30px; max-width: 860px; margin: 0 auto; width: 100%; }
.ladder { display: grid; gap: 6px; }
.rung { background: #fff; border-radius: 12px; padding: 8px 12px; display: grid; grid-template-columns: 64px 1fr; gap: 0 8px; opacity: 0.7; }
.rung small { grid-column: 2; } .rung .rp { grid-row: span 2; font-weight: 800; color: #8a6a3a; align-self: center; }
.rung.done { opacity: 1; background: #e3f6e6; } .rung.cur { opacity: 1; background: #fff4d6; border: 2px solid #e0a64a; }
.bbars { display: grid; gap: 6px; }
.bb { display: grid; grid-template-columns: 1fr 1.2fr 50px; gap: 8px; align-items: center; font-weight: 700; font-size: 0.9em; }
.bb .bar { margin: 0; } .bb.locked { opacity: 0.5; } .bb em { font-style: normal; text-align: right; }
.leggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.leggrid.small { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.legbtn { background: #fff; border-radius: 12px; padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 48px; border: 2px solid #eee2c0; }
.legbtn.got { border-color: #f0a500; background: #fff8e0; }
.patches { display: flex; flex-wrap: wrap; gap: 6px; }
.patch { background: #2c5f3c; color: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 0.85em; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.badge { background: #eee9dd; border-radius: 12px; padding: 8px 10px; display: grid; grid-template-columns: 26px 1fr; gap: 0 8px; opacity: 0.7; }
.badge small { grid-column: 2; } .badge .ico { grid-row: span 2; } .badge.got { background: #fff8e0; opacity: 1; }
.story p, .sources p { line-height: 1.45; }

/* landscape phones: keep scenes from eating the whole screen */
@media (max-height: 500px) { .scenebox { height: 52vh; min-height: 160px; } .tile { min-height: 96px; } }

/* ===================== Theme v2: national-park field guide ===================== */
:root {
  --ink: #2a2216; --ink2: #5c4e38; --paper: #efe6cf; --paper2: #f7f1e1; --card: #fffbf2;
  --forest: #2e4a34; --forest2: #3f6447; --bark: #5e4a30; --ochre: #c98a2a; --gold: #e8a400;
  --sky: #2b78b8; --go: #3b8a3c; --go2: #2d6e2e; --call: #e0702a; --danger: #b8392a;
  --display: "Rockwell", "Roboto Slab", "Museo Slab", "Georgia", ui-serif, serif;
  --ui: -apple-system, BlinkMacSystemFont, "Avenir Next", "Segoe UI", system-ui, Roboto, sans-serif;
  --shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 2px 0 rgba(94,74,48,0.16), 0 6px 16px -6px rgba(60,40,10,0.28);
}
html, body { font-family: var(--ui); color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.55), rgba(255,255,255,0) 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.35 0 0 0 0 0.2 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.screen { animation: scrIn 0.28s ease-out; }
@keyframes scrIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h1, h2, h3, .rkname, .rankname, .cname, .topbar .title, .tile b, .basinbtn b { font-family: var(--display); letter-spacing: 0.1px; }

/* top bar: forest green with an ochre rule, like a park sign */
.topbar { background: linear-gradient(180deg, #3d5e44 0%, #2b4631 100%); color: #fbf3de; border-bottom: 3px solid var(--ochre); box-shadow: 0 3px 10px rgba(30,40,20,0.25); }
.topbar .title { font-weight: 700; font-size: 1.15em; text-shadow: 0 1px 0 rgba(0,0,0,0.35); }
.chip { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22); box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); }
.round { background: linear-gradient(180deg, #fffdf6, #efe4c8); color: var(--forest); box-shadow: 0 2px 0 rgba(60,40,10,0.35), 0 4px 10px rgba(0,0,0,0.18); border: 1px solid rgba(94,74,48,0.25); transition: transform 0.08s; }
.round:active { transform: translateY(2px) scale(0.96); box-shadow: 0 0 0 rgba(0,0,0,0.2); }
.topbar .round { background: linear-gradient(180deg, #fffdf6, #efe4c8); }

/* buttons with depth and press feedback */
.big { background: linear-gradient(180deg, #fffdf7, #f1e8d2); color: var(--forest); border: 1px solid rgba(94,74,48,0.22); box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 3px 0 rgba(94,74,48,0.35), 0 8px 16px -8px rgba(60,40,10,0.35); transition: transform 0.08s, box-shadow 0.08s, filter 0.15s; }
.big.go { background: linear-gradient(180deg, #4fa24c, var(--go2)); color: #fff; border-color: #245a25; text-shadow: 0 1px 0 rgba(0,0,0,0.3); box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 3px 0 #1f4f20, 0 8px 16px -8px rgba(20,60,20,0.5); }
.big.danger { background: linear-gradient(180deg, #d24c3a, #a02e22); color: #fff; border-color: #7a2016; box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 3px 0 #6e1a12; }
.big.call { background: linear-gradient(180deg, #f28a3e, #cf5d1c); color: #fff; border-color: #9a4210; text-shadow: 0 1px 0 rgba(0,0,0,0.3); box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 3px 0 #8a3a0c, 0 8px 18px -8px rgba(160,70,10,0.6); }
.big:active, .tile:active, .choice:active, .basinbtn:active, .pill:active, .segb:active, .togb:active, .swatch:active, .tab:active, .stile:active, .minicard:active, .legbtn:active { transform: translateY(2px) scale(0.985); filter: brightness(0.97); }
.big:active { box-shadow: 0 1px 0 rgba(94,74,48,0.35); }
button.small { background: linear-gradient(180deg, #fffdf7, #f1e8d2); color: var(--forest); border: 1px solid rgba(94,74,48,0.2); box-shadow: 0 2px 0 rgba(94,74,48,0.3); }
.pill { background: linear-gradient(180deg, #fffdf7, #f1e8d2); color: var(--forest); border: 1px solid rgba(94,74,48,0.2); box-shadow: var(--shadow); }

/* hub */
.hubhero { position: relative; height: 210px; border-radius: 20px; overflow: hidden; margin: 2px 0 10px; box-shadow: 0 10px 24px -10px rgba(40,30,10,0.55), 0 0 0 1px rgba(94,74,48,0.25); }
.hubhero canvas { position: absolute; inset: 0; }
.hubhero .herotext { position: absolute; left: 16px; bottom: 12px; color: #fffaf0; text-shadow: 0 2px 8px rgba(0,0,0,0.45), 0 1px 0 rgba(0,0,0,0.5); pointer-events: none; }
.hubhero h1 { font-family: var(--display); font-size: 2.3em; color: #fffaf0; margin: 0; line-height: 1; letter-spacing: 0.3px; }
.hubhero .sub { display: inline-block; margin-top: 6px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; font-size: 0.72em; background: rgba(46,74,52,0.85); border: 1px solid rgba(255,255,255,0.35); padding: 3px 10px; border-radius: 999px; }
.hubhead { display: none; }
@media (max-width: 500px) { .hubhero { height: 160px; } .hubhero h1 { font-size: 1.8em; } }
.rankcard { background: var(--card); border: 1px solid rgba(94,74,48,0.18); box-shadow: var(--shadow); border-radius: 18px; }
.rkicon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 35% 30%, #fff, #e3edf3); border: 3px solid var(--ochre); box-shadow: 0 2px 0 rgba(94,74,48,0.3); flex: none; }
.rkname { color: var(--forest); }
.bar { background: #e3d9bf; box-shadow: inset 0 1px 2px rgba(0,0,0,0.15); }
.bar i { background: linear-gradient(90deg, #2b78b8, #3fa0c8 45%, #4fa24c); box-shadow: inset 0 1px 0 rgba(255,255,255,0.4); }
.goal { background: linear-gradient(180deg, #fff6dc, #fbe9bd); border: 2px dashed var(--ochre); color: var(--ink); box-shadow: var(--shadow); }
.goal .lbl { background: var(--ochre); }
.tile { background: linear-gradient(180deg, #fffdf6 0%, #f7efdb 100%); border: 1px solid rgba(94,74,48,0.18); box-shadow: var(--shadow); padding: 12px 12px 14px; overflow: hidden; transition: transform 0.08s; }
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--tc, var(--sky)); }
.tile .tico { display: inline-flex; width: 52px; height: 52px; border-radius: 16px; align-items: center; justify-content: center; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.9), rgba(255,255,255,0) 60%), var(--tcl, #e4eff7); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06), 0 2px 0 rgba(94,74,48,0.15); margin: 2px 0 4px; }
.tile b { color: var(--forest); font-size: 1.04em; }
.tile small { color: var(--ink2); }
.tile .num { top: 10px; right: 12px; color: rgba(94,74,48,0.3); font-family: var(--display); }
.tile.locked { background: linear-gradient(180deg, #ece6d6, #e2dac6); }
.tile.locked .tico { filter: grayscale(1); opacity: 0.55; }
.tile.locked b { color: #6e6450; }
.tile[data-mode=explorer] { --tc: #3b8a3c; --tcl: #dcefd5; } .tile[data-mode=predictor] { --tc: #2b78b8; --tcl: #dbeaf6; }
.tile[data-mode=logbook] { --tc: #8a5a2a; --tcl: #f3e4cc; } .tile[data-mode=lab] { --tc: #2f8fb0; --tcl: #d9eff5; }
.tile[data-mode=color] { --tc: #e0702a; --tcl: #fde6d3; } .tile[data-mode=shake] { --tc: #b8392a; --tcl: #f8dcd6; }
.tile[data-mode=rare] { --tc: #e8a400; --tcl: #fdf0c8; } .tile[data-mode=trivia] { --tc: #4a4f8a; --tcl: #e2e3f3; }
.tile[data-mode=build] { --tc: #6b5a40; --tcl: #ece3d2; } .tile[data-mode=cards] { --tc: #8e44ad; --tcl: #efe0f5; }

/* overlays */
.overlay { background: radial-gradient(ellipse at center, rgba(20,30,25,0.45), rgba(10,16,12,0.72)); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.overlay .panel { background: linear-gradient(180deg, #fffdf6, #f8f0dc); border: 1px solid rgba(94,74,48,0.25); box-shadow: 0 0 0 4px rgba(255,250,236,0.25), 0 20px 50px rgba(0,0,0,0.45); transform: translateY(10px) scale(0.97); transition: transform 0.22s cubic-bezier(.2,1.3,.4,1); border-radius: 22px; }
.overlay.in .panel { transform: none; }
.overlay h2 { color: var(--forest); font-size: 1.5em; }
.star.on { color: #f2b01e; text-shadow: 0 2px 0 #a06c00, 0 0 12px rgba(255,200,60,0.6); }
.bigpts { color: var(--go); text-shadow: 0 2px 0 rgba(0,0,0,0.08); }
.rankname { color: var(--call); font-size: 2em; text-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.burst { height: 80px; background: radial-gradient(circle, #ffe27a 0%, rgba(255,213,74,0.5) 30%, rgba(255,213,74,0) 70%), repeating-conic-gradient(from 0deg, rgba(255,200,60,0.35) 0deg 10deg, rgba(255,200,60,0) 10deg 20deg); border-radius: 50%; width: 160px; margin: 0 auto; -webkit-mask: radial-gradient(circle, #000 40%, transparent 70%); mask: radial-gradient(circle, #000 40%, transparent 70%); animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert .panel { border: 0; box-shadow: 0 0 0 4px var(--call), 0 0 30px rgba(224,112,42,0.6), 0 20px 50px rgba(0,0,0,0.45); }
.alertbar { background: linear-gradient(90deg, #e0702a, #f2a03e); box-shadow: inset 0 1px 0 rgba(255,255,255,0.3); }

/* toasts */
.toast { background: linear-gradient(180deg, rgba(46,64,50,0.97), rgba(30,44,34,0.97)); border: 1px solid rgba(255,255,255,0.15); border-radius: 999px; padding: 10px 18px; box-shadow: 0 8px 24px rgba(0,0,0,0.3); animation: toastIn 0.3s cubic-bezier(.2,1.3,.4,1); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.95); } to { opacity: 1; transform: none; } }
.toast.card { background: linear-gradient(180deg, #2f6aa0, #1f4f7c); } .toast.tpatch, .toast.tbadge { background: linear-gradient(180deg, #b57a12, #8a5a00); } .toast.info { background: linear-gradient(180deg, #6a4a26, #4a3218); }
.rar { box-shadow: inset 0 1px 0 rgba(255,255,255,0.35); }
.rar.r3 { background: linear-gradient(135deg, #f7c948, #d48f00); }

/* mode layouts */
.scenebox { background: #9cc6e6; box-shadow: 0 6px 14px -8px rgba(0,0,0,0.4); }
.scenebox::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 55%, rgba(20,14,4,0.28) 100%); z-index: 1; }
.mapbox { background: #d9cba8; }
.mapbox::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 40px rgba(60,40,10,0.25); }
.clockchip { background: linear-gradient(180deg, #fffdf6, #efe4c8); border: 1px solid rgba(94,74,48,0.25); box-shadow: 0 2px 6px rgba(0,0,0,0.2); color: var(--forest); }
.q-n { color: var(--ochre); letter-spacing: 0.5px; text-transform: uppercase; font-size: 0.8em; }
.q-n b { text-transform: none; letter-spacing: 0; font-size: 1.3em; color: #2e3a26; }
.night .q-n b { color: #fff; }
.q-text { font-family: var(--display); font-weight: 700; font-size: 1.2em; color: var(--ink); }
.choice { background: linear-gradient(180deg, #fffdf7, #f6eedb); border: 2px solid rgba(94,74,48,0.15); box-shadow: 0 2px 0 rgba(94,74,48,0.25), 0 6px 12px -8px rgba(60,40,10,0.3); transition: transform 0.08s, background 0.2s; }
.choice.sel { border-color: var(--sky); background: #e3effa; }
.choice.right { background: linear-gradient(180deg, #e3f6e1, #cdebc9); border-color: var(--go); }
.choice.wrong { background: linear-gradient(180deg, #fde8e3, #f6d2ca); border-color: var(--danger); }
.why { border-left: 5px solid; } .why.ok { background: #e6f5e2; border-color: var(--go); } .why.no { background: #fdeee9; border-color: var(--danger); }
.goalbar { background: linear-gradient(180deg, #fff6dc, #fbecc4); border-bottom: 2px solid #e3c98a; }
.cluecard { background: linear-gradient(180deg, #fffcf3, #f6eedb); border-top: 4px solid var(--ochre); box-shadow: 0 -6px 16px -8px rgba(60,40,10,0.35); position: relative; z-index: 3; }
.cl-top { color: var(--ochre); }
.cl-text { font-family: var(--display); font-weight: 600; }
.zoomctl .round { width: 46px; height: 46px; }
.basinbtn { background: linear-gradient(180deg, #fffdf6, #f5ecd6); border: 1px solid rgba(94,74,48,0.18); border-left: 6px solid var(--go); box-shadow: var(--shadow); }
.basinbtn.locked { background: linear-gradient(180deg, #ece6d6, #e2dac6); border-left-color: #a89c84; }
.parkmap { border-radius: 0 0 18px 18px; box-shadow: 0 8px 18px -10px rgba(0,0,0,0.45); }
.segb, .togb { background: linear-gradient(180deg, #fffdf7, #f1e8d2); border: 1px solid rgba(94,74,48,0.2); box-shadow: 0 2px 0 rgba(94,74,48,0.28); }
.segb.on, .togb.on { background: linear-gradient(180deg, #3d6e9e, #24507a); color: #fff; border-color: #1c3f60; box-shadow: inset 0 2px 4px rgba(0,0,0,0.25); }
.dial .dl { color: var(--ochre); text-transform: uppercase; letter-spacing: 0.5px; }
.labres.ok { background: #e6f5e2; border-left: 5px solid var(--go); } .labres.no { background: #fdeee9; border-left: 5px solid var(--danger); }
.swatch { background: linear-gradient(180deg, #fffdf7, #f4ecd8); box-shadow: 0 2px 0 rgba(94,74,48,0.25); }
.swatch i { box-shadow: inset 0 -3px 6px rgba(0,0,0,0.2), inset 0 2px 3px rgba(255,255,255,0.5); }
.swatch.on { border-color: var(--forest); background: #eef5ea; }
.stile { background: linear-gradient(180deg, #fffdf6, #f3ead4); border: 3px solid transparent; box-shadow: var(--shadow); }
.stile canvas { border-radius: 10px; }
.stile.sel { border-color: var(--call); background: #fff1e6; }
.tab { background: linear-gradient(180deg, #fffdf7, #f1e8d2); border: 1px solid rgba(94,74,48,0.2); box-shadow: 0 2px 0 rgba(94,74,48,0.22); }
.tab.on { background: linear-gradient(180deg, #3d5e44, #2b4631); color: #fff; border-color: #1f3524; }
.fsel { background: #fffdf7; border-color: rgba(94,74,48,0.35); }
.listenbtn { background: linear-gradient(180deg, #ffe27a, #f2b01e); color: #3a2a00; }
.screen.night, .night { background: radial-gradient(120% 70% at 50% 0%, #2a3768, #121a36 70%); }

/* Ranger Cards: rarity frames and a foil sheen on Legendary */
.rcard .face { border: 8px solid transparent; border-radius: 20px; background: linear-gradient(#fffbf2, #fffbf2) padding-box, var(--frame, linear-gradient(135deg, #9aab86, #6a7a5a)) border-box; box-shadow: 0 14px 30px -10px rgba(0,0,0,0.55); }
.rcard.r1 { --frame: linear-gradient(135deg, #7fb8ef, #2e6fb8 55%, #a8d0f5); } .rcard.r2 { --frame: linear-gradient(135deg, #d7b0ea, #7d3aa0 55%, #c69ae0); }
.rcard.r3 { --frame: linear-gradient(135deg, #fff0a8, #e8a400 30%, #a86e00 55%, #ffe27a 80%, #c98a00); }
.rcard.r1 .face, .rcard.r2 .face, .rcard.r3 .face { border-color: transparent; }
.rcard .front canvas { border-radius: 12px 12px 0 0; }
.rcard .front::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.rcard.r3 .front::before, .rcard.shiny .front::before { content: ""; position: absolute; inset: -40%; pointer-events: none; z-index: 2; background: linear-gradient(115deg, rgba(255,255,255,0) 35%, rgba(255,240,170,0.5) 45%, rgba(170,240,255,0.35) 50%, rgba(255,170,230,0.3) 55%, rgba(255,255,255,0) 65%); mix-blend-mode: soft-light; animation: foil 3.2s ease-in-out infinite; }
@keyframes foil { 0% { transform: translateX(-40%); } 100% { transform: translateX(40%); } }
.rcard.shiny .front { box-shadow: 0 0 0 2px #ffe27a, 0 0 30px rgba(255,213,74,0.7), 0 14px 30px -10px rgba(0,0,0,0.55); }
.cname { color: var(--forest); font-size: 1.35em; }
.crar { display: inline-block; align-self: flex-start; padding: 3px 10px; border-radius: 999px; color: #fff !important; font-size: 0.75em; box-shadow: inset 0 1px 0 rgba(255,255,255,0.35); }
.crar.r0 { background: #6a7a5a; } .crar.r1 { background: #2e6fb8; } .crar.r2 { background: #7d3aa0; } .crar.r3 { background: linear-gradient(135deg, #f7c948, #c98a00); }
.rcard .back { background: linear-gradient(#fffbf2, #f6eedb) padding-box, var(--frame, linear-gradient(135deg, #9aab86, #6a7a5a)) border-box; }
.back h3 { color: var(--forest); border-bottom: 2px solid rgba(94,74,48,0.2); padding-bottom: 6px; }
.back dt { color: var(--ochre); }
.back .tip { background: #fff3d2; border-left: 4px solid var(--ochre); }
.rcard.locked .face { --frame: linear-gradient(135deg, #8a8678, #5e5a50); }

/* binder */
.binder { gap: 10px; }
.minicard { position: relative; background: linear-gradient(180deg, #fffdf6, #f5ecd8) padding-box, linear-gradient(135deg, #b9c2a8, #7a8a6a) border-box; border: 3px solid transparent; border-radius: 14px; box-shadow: 0 2px 0 rgba(94,74,48,0.2), 0 8px 14px -10px rgba(60,40,10,0.5); overflow: hidden; }
.minicard.r1 { background: linear-gradient(180deg, #fffdf6, #eef4fb) padding-box, linear-gradient(135deg, #9cc3ee, #2e6fb8) border-box; }
.minicard.r2 { background: linear-gradient(180deg, #fffdf6, #f5eefa) padding-box, linear-gradient(135deg, #d9b6ea, #7d3aa0) border-box; }
.minicard.r3 { background: linear-gradient(180deg, #fffdf6, #fdf4d8) padding-box, linear-gradient(135deg, #fff0a8, #e8a400 40%, #a86e00 70%, #ffe27a) border-box; }
.minicard.locked { background: linear-gradient(180deg, #e9e3d4, #ddd5c2) padding-box, linear-gradient(135deg, #c8c0ac, #a89e88) border-box; }
.minicard.shiny::after, .minicard.r3:not(.locked)::after { content: ""; position: absolute; inset: -50%; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,0) 40%, rgba(255,245,190,0.55) 48%, rgba(180,235,255,0.35) 52%, rgba(255,255,255,0) 60%); animation: foil 3.6s ease-in-out infinite; }
.minicard.shiny { box-shadow: 0 0 0 2px #f2b01e, 0 0 16px rgba(255,200,60,0.55); }
.minicard .mn { color: var(--ink); }

/* progress */
.rung { background: var(--card); border: 1px solid rgba(94,74,48,0.15); box-shadow: 0 2px 0 rgba(94,74,48,0.12); }
.rung.done { background: linear-gradient(90deg, #e3f3df, #f3f9f0); border-left: 5px solid var(--go); }
.rung.cur { background: linear-gradient(90deg, #fff1c8, #fff9e8); border: 2px solid var(--ochre); box-shadow: 0 0 0 3px rgba(201,138,42,0.2); }
.legbtn { background: var(--card); border: 2px solid #eadfc2; box-shadow: 0 2px 0 rgba(94,74,48,0.15); }
.legbtn.got { background: linear-gradient(135deg, #fff8e0, #fdecb4); border-color: var(--gold); }
.patch { position: relative; background: radial-gradient(circle at 30% 25%, #4d7a52, #2e4a34); color: #fff4d6; border-radius: 999px; padding: 7px 14px; outline: 2px dashed rgba(255,240,200,0.55); outline-offset: -5px; box-shadow: 0 0 0 3px #c98a2a, 0 3px 6px rgba(0,0,0,0.3); font-family: var(--display); letter-spacing: 0.3px; margin: 3px; }
.badge { background: linear-gradient(180deg, #efe9da, #e5dcc6); border: 1px solid rgba(94,74,48,0.12); }
.badge.got { background: linear-gradient(135deg, #fff8e0, #fbe7a8); border-color: var(--gold); box-shadow: 0 2px 0 rgba(160,110,0,0.25); }
/* tall portrait tablets: give the scenes more room */
@media (min-height: 900px) and (orientation: portrait) {
  .screen > .scenebox { height: 48vh; max-height: 640px; }
  .screen > .scenebox.lab { height: 44vh; max-height: 600px; }
  .screen > .scenebox.color, .screen > .scenebox.build { height: 50vh; max-height: 640px; }
}
