/* Natural selection lesson. All rules scoped under .ns-* */
.ns-sc { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ns-cap { font-size: 13px; color: var(--dim); text-align: center; }
.ns-note { font-size: 12px; color: var(--faint); text-align: center; }
.ns-hero { display: grid; place-items: center; }
.ns-hero img { width: 300px; max-width: 100%; max-height: 34vh; object-fit: contain; filter: drop-shadow(0 16px 28px rgba(123,92,253,.3)); }

/* the forest */
.ns-wrap { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.ns-hud { display: flex; align-items: center; gap: 10px; height: 18px; visibility: hidden; }
.ns-time { flex: 1; height: 8px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.ns-time i { display: block; height: 100%; width: 100%; border-radius: 999px; background: var(--gold); }
.ns-time.on, .ns-count.on { visibility: visible; }
.ns-count { font: 700 13px var(--sans); color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; visibility: hidden; }
.ns-forest { position: relative; width: 100%; height: clamp(160px, 28vh, 250px); border-radius: 16px; overflow: hidden; background: #A9A698; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.ns-bark { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.ns-soot { opacity: 0; transition: opacity 0s linear; }
.ns-soot.on { opacity: 1; }
.ns-layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.ns-moth {
  position: absolute; width: 48px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(var(--k, 1));
  transition: left .6s cubic-bezier(.2,.8,.2,1), top .6s cubic-bezier(.2,.8,.2,1), transform .3s, opacity .3s, box-shadow .3s;
}
.ns-forest:not(.ns-hunting) .ns-moth { pointer-events: none; }
.ns-mo { width: 38px; height: 25px; display: block; overflow: visible; filter: drop-shadow(0 1px 1px rgba(0,0,0,.28)); }
.ns-sp { fill: #2B2926; opacity: .75; }
.ns-moth.ns-born { --k: .35; opacity: .2; transition: none; }
.ns-moth.ns-eaten { --k: 0; opacity: 0; }
.ns-moth.ns-new { box-shadow: 0 0 0 2px rgba(252,192,80,.9); }
.ns-moth.ns-ring { box-shadow: 0 0 0 2px var(--gold), 0 0 18px 4px rgba(252,192,80,.55); }
.ns-peck { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 3px solid var(--gold); animation: nsPeck .5s ease-out forwards; pointer-events: none; }
@keyframes nsPeck { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
.ns-strip { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ns-gen { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.ns-row { display: flex; gap: 2px; justify-content: center; padding: 4px 8px; border-radius: 10px; background: #8C897E; min-height: 22px; }
.ns-mini { width: 18px; height: 13px; display: block; }
.ns-mini .ns-sp { opacity: .6; }

.ns-three { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.ns-three > div { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.ns-three b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #2A1B00; font-weight: 800; font-size: 14px; }
.ns-three p { margin: 0; display: flex; flex-direction: column; gap: 1px; }
.ns-three span { font-weight: 800; font-size: 15px; line-height: 1.2; }
.ns-three small { font-size: 13px; color: var(--dim); line-height: 1.25; }
.ns-three em { display: flex; align-items: center; gap: 3px; padding: 6px 8px; border-radius: 10px; background: #8C897E; font-style: normal; }
.ns-three em i { font-style: normal; font-weight: 800; color: #2A1B00; font-size: 14px; }
.ns-ico { width: 26px; height: 17px; }


/* the tumor */
.ns-dish { width: 100%; max-height: 36vh; display: block; overflow: visible; }
.ns-plate { fill: #182036; stroke: rgba(169,155,255,.55); stroke-width: 2.5; }
.ns-drug { fill: rgba(99,224,240,.16); stroke: #63E0F0; stroke-width: 2; opacity: 0; transition: opacity .3s; }
.ns-drug.on { opacity: 1; }
.ns-bug circle { fill: #C9A8FF; transition: fill .3s, opacity .4s; }
.ns-bug.res circle { fill: var(--gold); }
.ns-bug.dead circle { fill: #4a4f5c; opacity: .25; }
.ns-bug.ok circle { fill: #FFE2A0; }
.ns-key { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--dim); }
.ns-key span { display: flex; align-items: center; gap: 8px; }
.ns-k { width: 10px; height: 10px; border-radius: 50%; background: #C9A8FF; flex: none; }
.ns-k.res { background: var(--gold); }
@media (max-height: 700px) {
  .ns-hero img { max-height: 30vh; }
  .ns-dish { max-height: 30vh; }
}
