:root {
  --ink: #14211a;
  --panel: rgba(20, 33, 26, .88);
  --panel-b: rgba(255, 214, 140, .26);
  --cream: #fbf3df;
  --muted: #b7c7b9;
  --gold: #f4a93c;
  --gold2: #ffd36e;
  --ok: #62d68b;
  --bad: #ff7a64;
  --line: rgba(255, 244, 214, .28);
  --font: "Fredoka", "Trebuchet MS", "Segoe UI Rounded", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: #16251d; color: var(--cream); font-family: var(--font); touch-action: none; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; cursor: pointer; }
a { color: var(--gold2); }

.screen { position: fixed; inset: 0; z-index: 10; }
.screen.center { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #2c4a36, #14211a 70%); z-index: 100; }
.load-box { text-align: center; width: min(86vw, 360px); }
.load-icon { font-size: 54px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-5deg); } }
.bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .14); overflow: hidden; margin-top: 12px; }
.bar i { display: block; height: 100%; width: 5%; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: inherit; transition: width .25s; }
.error { color: var(--bad); }

/* ------------------------------------------------ botões */
.btn { border: 0; border-radius: 16px; padding: 12px 20px; font-weight: 600; font-size: 17px; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #3b2406; box-shadow: 0 5px 0 #b46f16, 0 10px 18px rgba(0, 0, 0, .3); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b46f16; }
.btn.big { font-size: 21px; padding: 15px 26px; width: 100%; }
.btn.ghost { background: rgba(255, 255, 255, .1); color: var(--cream); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:active { transform: none; background: rgba(255, 255, 255, .2); }
.btn.small { padding: 8px 14px; font-size: 15px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--panel); color: var(--cream); font-size: 19px; box-shadow: inset 0 0 0 1.5px var(--panel-b), 0 4px 12px rgba(0, 0, 0, .3); display: grid; place-items: center; backdrop-filter: blur(6px); }
.round.sm { width: 38px; height: 38px; font-size: 20px; }
.round:active { transform: scale(.94); }
.seg { display: inline-flex; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--line); }
.seg button { border: 0; background: transparent; padding: 8px 12px; font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--gold); color: #3b2406; }
.row { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------ menu */
#menu { display: grid; place-items: center; pointer-events: none; }
#menu .menu-wrap { pointer-events: auto; text-align: center; padding: 16px; width: min(94vw, 460px); margin-top: auto; margin-bottom: auto; }
.logo-kicker { letter-spacing: .3em; font-size: 14px; margin: 0 0 4px; opacity: .85; }
.logo h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(46px, 11vw, 78px); line-height: .95; margin: 0; text-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .45); }
.logo h1 em { color: var(--gold2); font-style: normal; }
.tagline { margin: 12px auto 18px; max-width: 34ch; font-size: 17px; line-height: 1.35; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.menu-card { background: var(--panel); border-radius: 22px; padding: 18px; box-shadow: inset 0 0 0 1.5px var(--panel-b), 0 18px 40px rgba(0, 0, 0, .4); display: grid; gap: 12px; backdrop-filter: blur(8px); }
.menu-progress { font-size: 14px; color: var(--muted); }
.menu-progress .bar { margin: 6px 0 0; }
.back { margin: 14px 0 0; font-size: 14px; text-shadow: 0 1px 6px #000; }
.back a { text-decoration: none; }

/* ------------------------------------------------ barras superiores */
.topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l)); pointer-events: none; z-index: 20; }
.topbar > * { pointer-events: auto; }
.topbar .title { flex: 1; text-align: center; font-family: var(--serif); font-weight: 900; font-size: 18px; text-shadow: 0 2px 8px #000; display: grid; line-height: 1.15; pointer-events: none; }
.topbar .title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title small { font-family: var(--font); font-weight: 500; font-size: 13px; color: var(--gold2); }
.actions { display: flex; gap: 8px; }

/* ------------------------------------------------ mapa */
.pins { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.pin { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; align-items: center; gap: 6px; border: 0; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--c), 0 6px 14px rgba(0, 0, 0, .4); will-change: transform; }
.pin::after { content: ''; position: absolute; left: 18px; bottom: -7px; width: 12px; height: 12px; background: var(--c); transform: rotate(45deg); border-radius: 2px; z-index: -1; }
.pin-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: var(--c); }
.pin-label { display: grid; text-align: left; line-height: 1.1; font-size: 14px; white-space: nowrap; }
.pin-label small { color: var(--muted); font-size: 12px; }
.pin.sel { box-shadow: inset 0 0 0 3px var(--gold2), 0 0 0 4px rgba(255, 211, 110, .35), 0 6px 14px rgba(0, 0, 0, .4); animation: pulse 1.4s infinite; }
.pin.soon { opacity: .75; filter: grayscale(.6); cursor: default; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 3px var(--gold2), 0 0 0 9px rgba(255, 211, 110, .15), 0 6px 14px rgba(0, 0, 0, .4); } }
.biome-card { max-height: calc(100dvh - 90px); overflow-y: auto; }
.biome-card { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); width: min(94vw, 520px); background: var(--panel); border-radius: 24px; padding: 16px 18px; box-shadow: inset 0 0 0 1.5px var(--panel-b), 0 18px 40px rgba(0, 0, 0, .5); backdrop-filter: blur(10px); z-index: 25; animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 24px); } }
.bc-head { display: flex; gap: 12px; align-items: center; padding-right: 44px; }
.bc-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; font-size: 16px; }
.bc-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 32px; flex: none; }
.bc-head h2 { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.1; }
.bc-head small { color: var(--gold2); font-size: 13px; }
.bc-blurb { margin: 10px 0; font-size: 15px; line-height: 1.35; color: #e9efe3; }
.bc-prog { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.bc-prog .bar { flex: 1; margin: 0; }
.bc-dots { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.bc-dots span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .45); overflow: hidden; }
.bc-dots span.on { background: var(--ok); color: #0c2a17; }
.bc-dots span img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud .topbar { pointer-events: none; }
.minimap { position: absolute; right: calc(12px + var(--safe-r)); top: calc(66px + var(--safe-t)); width: 104px; height: 104px; border-radius: 50%; overflow: hidden; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 3px rgba(255, 244, 214, .5), 0 6px 16px rgba(0, 0, 0, .45); pointer-events: none !important; }
.minimap canvas { width: 100%; height: 100%; display: block; }
.tracker { position: absolute; left: 50%; top: calc(62px + var(--safe-t)); transform: translateX(-50%); background: var(--panel); border-radius: 99px; padding: 7px 14px; font-size: 14px; box-shadow: inset 0 0 0 1.5px var(--gold); white-space: nowrap; pointer-events: none !important; animation: pulse2 1.6s infinite; }
@keyframes pulse2 { 50% { box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 14px rgba(244, 169, 60, .6); } }
.tip { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(150px + var(--safe-b)); width: min(86vw, 460px); text-align: center; font-size: 15px; background: var(--panel); border-radius: 14px; padding: 9px 14px; box-shadow: inset 0 0 0 1.5px var(--panel-b); pointer-events: none !important; transition: opacity .4s; }
.tip:empty { display: none; }
.stick { position: absolute; left: calc(18px + var(--safe-l)); bottom: calc(22px + var(--safe-b)); width: 132px; height: 132px; touch-action: none; }
.stick .ring { position: absolute; inset: 0; border-radius: 50%; background: rgba(20, 33, 26, .5); box-shadow: inset 0 0 0 3px rgba(255, 244, 214, .35); backdrop-filter: blur(4px); }
.stick .ring::before { content: '▲'; position: absolute; left: 50%; top: 6px; transform: translateX(-50%); font-size: 11px; opacity: .5; }
.stick .knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3d0, var(--gold)); box-shadow: 0 4px 10px rgba(0, 0, 0, .45); }
.cam-btn { position: absolute; right: calc(20px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: 92px; height: 92px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #ffe6a0, var(--gold)); box-shadow: 0 6px 0 #b46f16, 0 12px 22px rgba(0, 0, 0, .45); font-size: 42px; display: grid; place-items: center; }
.cam-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #b46f16; }
.cam-btn.ready { animation: glow 1s infinite; }
@keyframes glow { 50% { box-shadow: 0 6px 0 #b46f16, 0 0 0 12px rgba(255, 211, 110, .35), 0 12px 22px rgba(0, 0, 0, .45); } }
.mini-btn { position: absolute; right: calc(122px + var(--safe-r)); bottom: calc(30px + var(--safe-b)); width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--panel); font-size: 22px; box-shadow: inset 0 0 0 1.5px var(--panel-b); }

/* submarino: subir/descer */
.vert { position: absolute; right: calc(32px + var(--safe-r)); bottom: calc(136px + var(--safe-b)); display: grid; gap: 10px; }
.vert button { width: 62px; height: 62px; border-radius: 50%; border: 0; font-size: 24px; background: var(--panel); color: var(--cream); box-shadow: inset 0 0 0 2px #7fd6f2, 0 6px 14px rgba(0, 0, 0, .4); touch-action: none; }
.vert button.on, .vert button:active { background: #2a8ab8; }
.bc-veh { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; background: rgba(255, 255, 255, .1); border-radius: 99px; padding: 3px 10px; margin-top: 4px; }

/* ------------------------------------------------ modo foto */
#photo { position: fixed; inset: 0; z-index: 14; touch-action: none; cursor: crosshair; }
.pframe { position: absolute; left: 0; top: 0; width: 100px; height: 100px; box-shadow: 0 0 0 200vmax rgba(8, 14, 10, .5); pointer-events: none; }
.pframe .c { position: absolute; width: 34px; height: 34px; border: 0 solid #fff; opacity: .95; }
.pframe .tl { left: -2px; top: -2px; border-width: 4px 0 0 4px; border-top-left-radius: 8px; }
.pframe .tr { right: -2px; top: -2px; border-width: 4px 4px 0 0; border-top-right-radius: 8px; }
.pframe .bl { left: -2px; bottom: -2px; border-width: 0 0 4px 4px; border-bottom-left-radius: 8px; }
.pframe .br { right: -2px; bottom: -2px; border-width: 0 4px 4px 0; border-bottom-right-radius: 8px; }
.pframe .dot { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 0 0 2px rgba(0, 0, 0, .3); }
#targets { position: absolute; inset: 0; overflow: visible; }
.tgt { position: absolute; border: 3px solid #fff; border-radius: 10px; transition: border-color .15s; }
.tgt::after { content: attr(data-s); position: absolute; left: 50%; top: -26px; transform: translateX(-50%); font-size: 14px; letter-spacing: 2px; color: var(--gold2); text-shadow: 0 1px 4px #000; white-space: nowrap; }
.tgt.s1 { border-color: #fff; } .tgt.s2 { border-color: var(--gold2); } .tgt.s3 { border-color: var(--ok); box-shadow: 0 0 14px var(--ok); }
.tgt.track { border-width: 4px; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25), 0 0 16px rgba(255, 211, 110, .6); }
.tgt.hid { border-style: dashed; border-color: rgba(255, 255, 255, .5); }
.round.exit { position: absolute; left: calc(14px + var(--safe-l)); top: calc(14px + var(--safe-t)); }
.phint { position: absolute; left: 50%; transform: translateX(-50%); top: calc(16px + var(--safe-t)); max-width: min(70vw, 560px); text-align: center; background: var(--panel); border-radius: 99px; padding: 8px 16px; font-size: 14px; box-shadow: inset 0 0 0 1.5px var(--panel-b); pointer-events: none; }
.phint.good { box-shadow: inset 0 0 0 2px var(--ok); }
.zoombox { position: absolute; right: calc(16px + var(--safe-r)); top: 50%; transform: translateY(-50%); display: grid; justify-items: center; gap: 8px; background: var(--panel); padding: 10px 6px; border-radius: 26px; box-shadow: inset 0 0 0 1.5px var(--panel-b); }
.zoombox input { -webkit-appearance: none; appearance: none; width: 150px; height: 34px; margin: 58px -58px; transform: rotate(-90deg); background: transparent; touch-action: none; }
.zoombox input::-webkit-slider-runnable-track { height: 8px; border-radius: 9px; background: rgba(255, 255, 255, .28); }
.zoombox input::-moz-range-track { height: 8px; border-radius: 9px; background: rgba(255, 255, 255, .28); }
.zoombox input::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3d0, var(--gold)); box-shadow: 0 2px 6px #000a; }
.zoombox input::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--gold); }
.zoombox b { font-size: 14px; min-width: 40px; text-align: center; }
.shutter { position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); width: 88px; height: 88px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, .2); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(0, 0, 0, .5); }
.shutter i { width: 62px; height: 62px; border-radius: 50%; background: #fff; display: block; transition: transform .08s; }
.shutter:active i { transform: scale(.85); }
.shutter.lock { border-color: var(--ok); animation: glow2 .9s infinite; }
@keyframes glow2 { 50% { box-shadow: 0 0 0 12px rgba(98, 214, 139, .35), 0 8px 20px rgba(0, 0, 0, .5); } }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 60; }
#flash.on { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }

/* ------------------------------------------------ janelas */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(8, 14, 10, .62); backdrop-filter: blur(5px); padding: 12px; touch-action: pan-y; }
.sheet { width: min(96vw, 560px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; background: #1b2c22; border-radius: 24px; padding: 18px; box-shadow: inset 0 0 0 1.5px var(--panel-b), 0 24px 60px rgba(0, 0, 0, .6); animation: pop .3s ease-out; -webkit-user-select: text; user-select: text; }
.sheet.wide { width: min(98vw, 980px); }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.sheet h2 { font-family: var(--serif); margin: 0 0 6px; font-size: 24px; }
.sheet .close { position: sticky; top: 0; float: right; z-index: 5; }
.sheet p { line-height: 1.45; }
.stars { color: var(--gold2); letter-spacing: 2px; }
.stars .off { color: rgba(255, 255, 255, .25); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 4px 11px; font-size: 13px; background: rgba(255, 255, 255, .12); }
.chip.cls { color: #10201a; font-weight: 600; }

/* resultado da foto */
.polaroid { background: #fffdf5; color: #2a2a22; border-radius: 6px; padding: 12px 12px 14px; box-shadow: 0 14px 30px rgba(0, 0, 0, .5); transform: rotate(-1.5deg); animation: drop .5s cubic-bezier(.2, 1.3, .4, 1); margin: 4px 6px 14px; }
@keyframes drop { from { transform: translateY(-60px) rotate(8deg) scale(.9); opacity: 0; } }
.polaroid img { width: 100%; display: block; border-radius: 2px; background: #333; aspect-ratio: 3 / 2; object-fit: cover; }
.polaroid .cap { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-family: var(--serif); font-weight: 700; font-size: 18px; }
.polaroid .stars { font-size: 22px; }
.badge-new { display: inline-block; background: linear-gradient(90deg, var(--gold), var(--gold2)); color: #3b2406; font-weight: 700; border-radius: 99px; padding: 5px 14px; margin: 4px 0 8px; animation: pulse3 1.2s infinite; }
@keyframes pulse3 { 50% { transform: scale(1.06); } }
.taxbox { background: rgba(255, 255, 255, .06); border-radius: 16px; padding: 12px 14px; margin: 10px 0; }
.taxbox dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.taxbox dt { color: var(--gold2); font-weight: 600; }
.taxbox dd { margin: 0; }
.taxbox em { opacity: .8; }
.fact { background: rgba(244, 169, 60, .13); border-left: 4px solid var(--gold); border-radius: 0 12px 12px 0; padding: 10px 14px; font-size: 15px; margin: 10px 0; }
.quiz { margin-top: 14px; background: rgba(255, 255, 255, .06); border-radius: 16px; padding: 14px; }
.quiz h3 { margin: 0 0 8px; font-size: 16px; color: var(--gold2); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.opt { border: 0; border-radius: 12px; padding: 11px 8px; font-size: 16px; font-weight: 600; background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1.5px var(--line); }
.opt.ok { background: var(--ok); color: #0c2a17; }
.opt.bad { background: var(--bad); color: #3a0e08; }
.opt small { display: block; font-weight: 400; font-size: 11px; opacity: .8; }
.shots { display: grid; gap: 8px; }
.shot { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .07); border-radius: 14px; padding: 8px 12px; }
.shot b { flex: 1; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 150px; }

/* caderneta */
.j-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.j-head h2 { flex: 1; margin: 0; }
.tabs { display: flex; gap: 8px; margin: 8px 0; }
.tabs button { flex: 1; border: 0; border-radius: 14px; padding: 10px; font-weight: 600; font-size: 16px; background: rgba(255, 255, 255, .08); }
.tabs button.on { background: var(--gold); color: #3b2406; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; border: 0; border-radius: 99px; padding: 6px 12px; font-size: 14px; background: rgba(255, 255, 255, .08); white-space: nowrap; }
.filters button.on { background: var(--cream); color: #1b2c22; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; }
.card { border: 0; padding: 0; border-radius: 16px; overflow: hidden; text-align: left; background: #243a2d; box-shadow: inset 0 0 0 1.5px var(--panel-b); position: relative; }
.card .ph { aspect-ratio: 3 / 2; display: grid; place-items: center; background: linear-gradient(135deg, #2b4535, #1a2a21); font-size: 38px; position: relative; overflow: hidden; }
.card .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card.lock .ph { color: rgba(255, 255, 255, .22); filter: grayscale(1); }
.card.lock .ph::after { content: '?'; position: absolute; font-family: var(--serif); font-size: 58px; font-weight: 900; color: rgba(255, 255, 255, .55); }
.card .meta { padding: 7px 10px 9px; font-size: 14px; line-height: 1.2; }
.card .meta small { display: block; color: var(--muted); font-size: 12px; font-style: italic; }
.card .meta .stars { font-size: 13px; }
.card .tag { position: absolute; left: 6px; top: 6px; font-size: 14px; background: rgba(0, 0, 0, .5); border-radius: 99px; padding: 1px 6px; z-index: 2; }
.card .learn { position: absolute; right: 6px; top: 6px; font-size: 14px; background: rgba(0, 0, 0, .5); border-radius: 99px; padding: 1px 6px; z-index: 2; }

/* árvore */
.tree-wrap { overflow: auto; padding: 8px 4px 16px; max-height: 62vh; background: rgba(0, 0, 0, .15); border-radius: 16px; touch-action: pan-x pan-y; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree { display: inline-block; min-width: 100%; }
.tree li.n { display: flex; align-items: center; }
.tree ul.ch { display: flex; flex-direction: column; margin-left: 26px; position: relative; }
.tree ul.ch::before { content: ''; position: absolute; left: -26px; top: 50%; width: 26px; border-top: 2px solid var(--line); }
.tree ul.ch > li { position: relative; padding: 3px 0 3px 26px; }
.tree ul.ch > li::before { content: ''; position: absolute; left: 0; top: 50%; width: 26px; border-top: 2px solid var(--line); }
.tree ul.ch > li::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--line); }
.tree ul.ch > li:first-child::after { top: 50%; }
.tree ul.ch > li:last-child::after { bottom: 50%; }
.tree ul.ch > li:only-child::after { display: none; }
.tree li.n.dim > .chip { opacity: .5; }
.tn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 12px; padding: 6px 11px; font-size: 14px; background: #2c4636; box-shadow: inset 0 0 0 2px var(--c, #5b7a66); white-space: nowrap; text-align: left; line-height: 1.15; }
.tn small { display: block; font-size: 11px; opacity: .75; font-style: italic; font-weight: 400; }
.tn.root { background: #fff3d0; color: #2c2a18; font-weight: 700; --c: var(--gold); }
.tn.cl { background: var(--c); color: #10201a; font-weight: 700; }
.tn.leaf { padding: 3px 11px 3px 3px; border-radius: 99px; }
.tn.leaf .av { width: 34px; height: 34px; border-radius: 50%; background: #1a2a21; display: grid; place-items: center; overflow: hidden; font-size: 17px; flex: none; }
.tn.leaf .av img { width: 100%; height: 100%; object-fit: cover; }
.tn.leaf.lock { opacity: .55; }
.tn.leaf.lock .av { color: rgba(255, 255, 255, .6); font-weight: 700; }
.tn .cnt { font-size: 11px; background: rgba(0, 0, 0, .3); border-radius: 99px; padding: 1px 6px; }
.tn.cl .cnt { background: rgba(255, 255, 255, .5); }
.tn .car { font-size: 11px; opacity: .8; }
.tree-tools { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; }
.tree-tools p { margin: 0; flex: 1; font-size: 13px; color: var(--muted); }

/* detalhe da espécie */
.d-photo { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px; display: block; background: #243a2d; }
.d-name { font-family: var(--serif); font-size: 28px; margin: 10px 0 0; line-height: 1.05; }
.d-sci { font-style: italic; color: var(--gold2); margin: 2px 0 6px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--muted); align-items: center; margin: 4px 0 8px; }
.crumbs span:not(.sep) { background: rgba(255, 255, 255, .08); border-radius: 99px; padding: 2px 8px; }
.rel { display: flex; flex-wrap: wrap; gap: 8px; }
.rel button { border: 0; border-radius: 99px; padding: 4px 12px 4px 4px; background: rgba(255, 255, 255, .1); display: flex; align-items: center; gap: 6px; font-size: 13px; }
.rel .av { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #1a2a21; }
.rel .av img { width: 100%; height: 100%; object-fit: cover; }
.status { display: inline-block; border-radius: 8px; padding: 1px 8px; font-weight: 700; font-size: 12px; color: #fff; margin-right: 6px; }
.st-LC { background: #3a9a58; } .st-NT { background: #8ab03a; } .st-VU { background: #d8a62a; color: #2a2008; } .st-EN { background: #d8662a; } .st-CR { background: #c8302a; } .st-NE { background: #6a7a74; } .st-DD { background: #7a7a8a; }

/* wikipédia */
.wiki-note { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.wiki-frame { position: relative; height: min(62vh, 640px); background: #fff; border-radius: 14px; overflow: hidden; }
.wiki-frame iframe { position: relative; width: 100%; height: 100%; border: 0; background: #fff; }
.wiki-load { position: absolute; inset: 0; display: grid; place-items: center; color: #44514a; font-size: 15px; }
.btn-row a.btn { display: block; }
/* créditos */
.credit { font-size: 12px; color: var(--muted); margin: 6px 0; padding-left: 0; list-style: none; }
.credit a { color: var(--gold2); }

/* ajuda */
.help-list { margin: 10px 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.help-list li { background: rgba(255, 255, 255, .07); padding: 10px 14px; border-radius: 14px; line-height: 1.4; }

.toast { position: fixed; left: 50%; top: calc(76px + var(--safe-t)); transform: translate(-50%, -20px); background: var(--panel); border-radius: 99px; padding: 9px 18px; font-size: 15px; box-shadow: inset 0 0 0 1.5px var(--gold); opacity: 0; pointer-events: none; z-index: 70; transition: opacity .25s, transform .25s; text-align: center; max-width: 92vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .topbar .title { font-size: 15px; min-width: 0; }
  .topbar .title small { font-size: 12px; }
  .round { width: 40px; height: 40px; font-size: 17px; }
  .vert { bottom: calc(132px + var(--safe-b)); right: calc(30px + var(--safe-r)); }
  .vert button { width: 52px; height: 52px; font-size: 20px; }
  #hud.sea .tip { bottom: calc(262px + var(--safe-b)); width: min(70vw, 460px); left: 16px; transform: none; }
  .tracker { left: calc(12px + var(--safe-l)); transform: none; top: calc(60px + var(--safe-t)); font-size: 13px; padding: 6px 12px; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
  .minimap { top: calc(104px + var(--safe-t)); width: 92px; height: 92px; }
  .tip { bottom: calc(170px + var(--safe-b)); font-size: 14px; }
  .pin-label { font-size: 12px; }
  .pin-icon { width: 30px; height: 30px; font-size: 17px; }
  .zoombox { right: calc(8px + var(--safe-r)); }
  .btn-row { display: grid; grid-template-columns: 1fr 1fr; }
  .btn-row .btn { min-width: 0; padding: 11px 8px; font-size: 15px; }
}
@media (max-height: 520px) {
  .minimap { width: 82px; height: 82px; top: calc(58px + var(--safe-t)); }
  .tip { bottom: calc(96px + var(--safe-b)); }
  .stick { width: 108px; height: 108px; }
  .cam-btn { width: 74px; height: 74px; font-size: 34px; }
  .mini-btn { right: calc(106px + var(--safe-r)); }
  .tracker { top: calc(56px + var(--safe-t)); }
  .shutter { width: 72px; height: 72px; }
  .shutter i { width: 50px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
