:root {
  color-scheme: light;
  --teal: #073f43;
  --teal-2: #0d6866;
  --paper: #fff9eb;
  --cream: #f5e8c8;
  --green: #7ebc58;
  --coral: #ef6c58;
  --coral-dark: #b83e35;
  --blue: #2e86a6;
  --gold: #f3b94e;
  --ink: #123c3c;
  --muted: #66817d;
  --peel-x: 92%;
  font-family: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; min-width: 1000px; min-height: 650px; overflow: hidden; }
body { margin: 0; color: var(--ink); background: var(--teal); }
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 4px solid #ffe47f; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.lab {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 650px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 77% 17%, rgba(76,164,147,.35), transparent 30%),
    linear-gradient(145deg, #0b5958, #063a3f 58%, #052e33);
}
.lab::before { position: absolute; inset: 0; content: ""; opacity: .12; pointer-events: none; background-image: radial-gradient(circle, #fff 1px, transparent 1px); background-size: 29px 29px; }
.leaf { position: absolute; z-index: 0; width: 220px; height: 300px; opacity: .22; pointer-events: none; }
.leaf::before, .leaf::after { position: absolute; content: ""; width: 68px; height: 132px; border-radius: 80% 10% 80% 10%; background: #94d477; transform: rotate(38deg); }
.leaf::after { left: 82px; top: 58px; transform: rotate(-48deg); }
.leaf-a { left: -45px; bottom: -68px; transform: rotate(-22deg); }
.leaf-b { right: -35px; top: 30px; transform: rotate(145deg) scale(.7); }

.mission-note {
  position: absolute;
  z-index: 20;
  top: 22px;
  left: 50%;
  width: 560px;
  min-height: 96px;
  padding: 14px 24px 15px;
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 20px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 9px 0 rgba(0,25,27,.24), 0 18px 42px rgba(0,0,0,.15);
  transform: translateX(-50%) rotate(-.4deg);
}
.mission-note span { color: var(--coral-dark); font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.mission-note h1 { margin: 2px 0 1px; font-size: 29px; line-height: 1.08; letter-spacing: -.035em; }
.mission-note p { margin: 0; color: var(--muted); font-size: 15px; font-weight: 700; }

.mute { position: absolute; z-index: 40; top: 28px; right: 28px; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 2px solid rgba(255,255,255,.5); border-radius: 50%; color: #fff; background: rgba(3,43,46,.78); box-shadow: 0 5px 0 rgba(1,24,26,.7); }
.mute svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sound-off { display: none; }.mute[aria-pressed="true"] .sound-on { display: none; }.mute[aria-pressed="true"] .sound-off { display: block; }

.workbench { position: absolute; z-index: 2; left: 50%; top: 56.5%; width: min(1030px, 96vw); height: min(680px, calc(100vh - 160px)); min-height: 520px; display: grid; grid-template-columns: 180px minmax(520px, 1fr) 200px; gap: 14px; align-items: center; transform: translate(-50%, -50%); }

.layer-tray { align-self: center; padding: 18px 14px; border: 2px solid rgba(255,255,255,.22); border-radius: 26px; background: rgba(2,48,50,.72); box-shadow: 0 12px 32px rgba(0,0,0,.16); }
.tray-title { display: block; margin: 0 7px 12px; color: #c6ece2; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.layer-chip { position: relative; width: 100%; min-height: 76px; display: grid; grid-template-columns: 32px 1fr; grid-template-rows: 26px 20px; align-items: center; column-gap: 10px; margin: 7px 0; padding: 10px 9px; border: 2px solid transparent; border-radius: 15px; text-align: left; background: rgba(255,255,255,.1); opacity: .54; transition: transform .16s ease-out, opacity .16s, background .16s, border-color .16s; }
.layer-chip i { grid-row: 1 / 3; width: 28px; height: 42px; border: 3px solid rgba(255,255,255,.55); border-radius: 9px 2px 9px 2px; background: #75af52; box-shadow: inset -6px 0 rgba(0,0,0,.1); }
.layer-chip[data-layer="muscles"] i { background: #e46b5b; }.layer-chip[data-layer="organs"] i { background: #8d6aa1; }.layer-chip[data-layer="skeleton"] i { background: #efe2bd; }
.layer-chip strong { color: #fff; font-size: 16px; }.layer-chip small { color: #aad2cb; font-size: 11px; font-weight: 700; }
.layer-chip.is-revealed, .layer-chip.is-current { opacity: 1; }
.layer-chip.is-current { border-color: #ffe47f; background: rgba(255,255,255,.17); transform: translateX(7px); }
.layer-chip.is-target { opacity: 1; border-color: rgba(255,228,127,.55); animation: target-breathe 1.4s ease-in-out infinite; }
.layer-chip.is-wrong { animation: shake .28s ease-out; }

.specimen-card { position: relative; align-self: center; height: 570px; padding: 34px 34px 22px; border: 3px solid #e7d6aa; border-radius: 30px 22px 32px 24px; background: var(--paper); box-shadow: 0 15px 0 #d2bd88, 0 28px 55px rgba(0,0,0,.25); transform: rotate(.25deg); }
.paper-pin { position: absolute; z-index: 3; left: 50%; top: -10px; width: 28px; height: 28px; border: 3px solid #d3a246; border-radius: 50%; background: #ffd06d; box-shadow: 0 4px 0 rgba(123,81,18,.22); transform: translateX(-50%); }
.animal-tag { position: absolute; z-index: 4; top: 18px; left: 28px; padding: 5px 10px; border-radius: 8px; color: #fff; background: var(--teal-2); font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.animal-canvas { --handle-left: 92%; position: relative; width: 100%; aspect-ratio: 3 / 2; margin-top: 20px; overflow: hidden; border: 2px solid #d9c99e; border-radius: 22px 16px 20px 14px; background: #fff8e9; box-shadow: inset 0 0 0 7px rgba(255,255,255,.48); touch-action: none; }
.animal-canvas img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.top-layer { position: absolute; z-index: 2; inset: 0; overflow: hidden; clip-path: inset(0 calc(100% - var(--peel-x)) 0 0); pointer-events: none; will-change: clip-path; }
.top-layer::after { position: absolute; right: calc(100% - var(--peel-x)); top: 0; bottom: 0; width: 18px; content: ""; background: linear-gradient(90deg, transparent, rgba(70,40,20,.18)); transform: translateX(100%); }
.peel-handle { position: absolute; z-index: 12; left: var(--peel-x); top: 50%; width: 76px; height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; border: 4px solid #fff6db; border-radius: 22px 10px 10px 22px; color: #fff; background: linear-gradient(145deg, #fb7d66, #d84a42); box-shadow: 0 7px 0 var(--coral-dark), 0 13px 22px rgba(54,24,17,.28); transform: translate(-50%, -50%); touch-action: none; user-select: none; transition: scale .12s ease, box-shadow .12s ease; }
.peel-handle span { font-size: 32px; line-height: .8; }.peel-handle strong { font-size: 10px; letter-spacing: .1em; }
.peel-handle:hover, .peel-handle:focus-visible { scale: 1.05; }.peel-handle.is-dragging { scale: .97; box-shadow: 0 3px 0 var(--coral-dark), 0 8px 15px rgba(54,24,17,.25); }
.peel-curl { position: absolute; z-index: 10; left: var(--peel-x); top: 50%; width: 56px; height: 84%; border-radius: 50%; opacity: .64; pointer-events: none; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,247,216,.86), rgba(86,50,24,.1)); filter: drop-shadow(5px 0 7px rgba(42,25,13,.15)); transform: translate(-92%, -50%) scaleX(.45); transform-origin: right; }
.peel-help { margin: 13px 0 0; color: var(--muted); font-size: 14px; font-weight: 850; text-align: center; }.peel-help span { color: var(--coral); font-size: 20px; vertical-align: -1px; }
.specimen-card.is-resetting .top-layer, .specimen-card.is-resetting .peel-handle, .specimen-card.is-resetting .peel-curl { transition: left .3s ease-out, clip-path .3s ease-out; }

.search-glow { position: absolute; z-index: 5; left: 50%; top: 50%; width: 180px; height: 180px; border: 4px solid rgba(82,211,209,.8); border-radius: 50%; opacity: 0; pointer-events: none; background: radial-gradient(circle, transparent 45%, rgba(32,146,149,.13)); box-shadow: 0 0 0 999px rgba(5,38,40,.32), 0 0 35px rgba(72,220,212,.75); transform: translate(-50%, -50%); transition: opacity .2s; }
.animal-canvas.is-searching .search-glow { opacity: 1; }
.part-hotspot, .body-hotspot { position: absolute; z-index: 8; display: none; border: 3px dashed rgba(255,255,255,.88); border-radius: 50%; background: rgba(62,207,193,.08); box-shadow: 0 0 0 6px rgba(62,207,193,.12), 0 0 22px rgba(62,207,193,.55); }
.part-hotspot.heart { z-index: 9; left: 43.5%; top: 35%; width: 11%; height: 20%; }.part-hotspot.lungs { left: 31%; top: 27%; width: 33%; height: 24%; }
.animal-canvas.is-finding .part-hotspot, .animal-canvas.is-matching .part-hotspot, .animal-canvas.is-transfer .heart { display: block; }
.animal-canvas.is-finding .part-hotspot { border-color: transparent; background: transparent; box-shadow: none; }
.animal-canvas.is-matching .part-hotspot, .animal-canvas.is-transfer .heart { box-shadow: 0 0 0 7px rgba(255,228,127,.16), 0 0 20px rgba(255,228,127,.34); }
.animal-canvas[data-animal="dog"] .part-hotspot.heart { left: 34%; top: 42%; width: 10%; height: 19%; }
.animal-canvas[data-animal="dog"] .part-hotspot.lungs { left: 28%; top: 32%; width: 23%; height: 27%; }
.body-hotspot { z-index: 7; inset: 18% 11% 12%; border-radius: 40%; }.animal-canvas.is-skin-match .body-hotspot { display: block; }
.part-hotspot.is-found { display: block; border-style: solid; border-color: #ffe47f; background: rgba(255,228,127,.18); animation: heart-pop .55s ease-out; }
.part-hotspot.heart.is-beating { display: block; border-color: #ff7867; animation: heartbeat .85s ease-in-out 3; }
.skeleton-wiggle { position: absolute; z-index: 14; right: 11%; top: 13%; padding: 7px 12px; border-radius: 999px; color: var(--teal); background: #ffe47f; font-size: 12px; font-weight: 900; opacity: 0; transform: rotate(7deg) scale(.7); }.skeleton-wiggle.is-showing { animation: wiggle-tag 1.05s ease-out; }

.discovery-card { align-self: center; min-height: 330px; padding: 25px 20px; border: 2px solid #dac79a; border-radius: 20px 28px 18px 30px; background: #fff8e6; box-shadow: 0 11px 0 #cbb27b, 0 22px 40px rgba(0,0,0,.18); transform: rotate(1.2deg); }
.discovery-icon { width: 60px; height: 60px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 18px 8px 18px 8px; color: #fff; background: var(--coral); font-size: 28px; box-shadow: 0 5px 0 var(--coral-dark); }
.discovery-card > p:first-of-type { margin: 0; color: var(--coral-dark); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.discovery-card h2 { margin: 5px 0 9px; font-size: 26px; line-height: 1.05; letter-spacing: -.035em; }
.discovery-card h2.is-popping { animation: copy-pop .35s ease-out; }
.discovery-card > p:last-of-type { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; font-weight: 650; }
.mini-meter { height: 8px; margin-top: 24px; overflow: hidden; border-radius: 999px; background: #e4d8bb; }.mini-meter i { display: block; width: 4%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--gold), var(--coral)); transition: width .3s ease-out; }

.pulse-transfer { position: absolute; z-index: 20; inset: auto 28px 18px; height: 86px; display: flex; align-items: center; gap: 18px; padding: 12px 15px; border: 2px dashed #77b4aa; border-radius: 18px; background: rgba(255,249,235,.94); }
.frog-memory { min-width: 120px; display: grid; grid-template-columns: 1fr 36px; align-items: center; }.frog-memory span { font-weight: 900; }.frog-memory b { grid-row: 1 / 3; grid-column: 2; color: var(--coral); font-size: 30px; animation: heartbeat 1s infinite; }.frog-memory small { color: var(--muted); font-weight: 700; }
.different-tray { margin-left: auto; min-height: 50px; padding: 0 14px; border: 2px dashed #aa9580; border-radius: 13px; color: #7b695a; background: #efe7d7; font-size: 12px; font-weight: 850; }
.drag-token { z-index: 30; min-width: 64px; min-height: 54px; padding: 0 20px; border: 3px solid #fff4d0; border-radius: 18px; color: #fff; background: linear-gradient(145deg, #ef715d, #c8433c); box-shadow: 0 6px 0 #9d312d, 0 10px 18px rgba(0,0,0,.18); font-weight: 900; touch-action: none; user-select: none; }
.pulse-token { width: 60px; min-width: 60px; padding: 0; font-size: 29px; }.drag-token.is-dragging { position: fixed; margin: 0; pointer-events: none; transform: translate(-50%, -50%) rotate(-3deg) scale(1.06); }
.drag-token.is-snapping { animation: magnetic-snap .42s ease-out; }

.job-dock { position: absolute; z-index: 20; left: 50%; bottom: 14px; min-width: 320px; display: flex; align-items: center; gap: 15px; padding: 10px 12px 10px 18px; border: 2px solid #d2ba80; border-radius: 18px; background: rgba(255,249,235,.97); box-shadow: 0 7px 0 #d1bc89; transform: translateX(-50%); }
.job-dock > span { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }.job-token { min-width: 150px; }

.success-card, .finish-card { position: absolute; z-index: 80; left: 50%; top: 53%; width: 470px; padding: 36px 42px 34px; overflow: hidden; border: 4px solid #fff0bb; border-radius: 34px 22px 38px 25px; color: var(--ink); background: #fff9e9; box-shadow: 0 18px 0 rgba(11,51,50,.45), 0 38px 90px rgba(0,0,0,.38); text-align: center; transform: translate(-50%, -50%); animation: card-in .38s cubic-bezier(.2,.9,.25,1.2); }
.success-mark { position: relative; width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 22px 10px 22px 10px; color: #fff; background: var(--green); box-shadow: 0 7px 0 #4e8635; font-size: 36px; font-weight: 900; }.success-card > p:first-of-type, .finish-card > span { margin: 0; color: var(--coral-dark); font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }.success-card h2, .finish-card h2 { margin: 5px 0 8px; font-size: 34px; letter-spacing: -.04em; }.success-card > p:last-of-type, .finish-card p { margin: 0 auto 23px; color: var(--muted); line-height: 1.45; font-weight: 650; }
.success-card button, .finish-card button { min-height: 52px; padding: 0 24px; border: 0; border-radius: 15px; color: #fff; background: var(--teal-2); box-shadow: 0 6px 0 #064442; font-weight: 900; }
.success-burst { position: absolute; inset: -90px; opacity: .1; pointer-events: none; background: repeating-conic-gradient(var(--gold) 0 5deg, transparent 5deg 14deg); animation: slow-spin 18s linear infinite; }
.compare-pair { height: 90px; display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 8px; }.compare-pair span { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 24px; color: #fff; background: var(--green); font-size: 30px; }.compare-pair .dog-heart { background: var(--gold); }.compare-pair i { width: 58px; border-top: 4px dotted var(--coral); }.compare-pair span { animation: heartbeat 1s infinite; }

.toast { position: absolute; z-index: 70; left: 50%; bottom: 25px; max-width: 520px; padding: 12px 20px; border-radius: 999px; color: #fff; background: rgba(4,47,49,.95); box-shadow: 0 7px 20px rgba(0,0,0,.22); font-size: 14px; font-weight: 850; opacity: 0; transform: translate(-50%, 16px); transition: opacity .18s, transform .18s; pointer-events: none; }.toast.is-showing { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: absolute; z-index: 90; inset: 0; overflow: hidden; pointer-events: none; }.confetti i { position: absolute; top: -18px; width: 10px; height: 18px; border-radius: 3px; animation: confetti-fall 1.55s ease-in forwards; }

@keyframes target-breathe { 50% { box-shadow: 0 0 0 7px rgba(255,228,127,.16), 0 0 20px rgba(255,228,127,.28); } }
@keyframes heartbeat { 0%,100% { scale: 1; } 18% { scale: 1.14; } 34% { scale: .98; } 48% { scale: 1.09; } }
@keyframes heart-pop { 0% { scale: .6; } 70% { scale: 1.13; } }
@keyframes wiggle-tag { 0% { opacity: 0; transform: rotate(7deg) scale(.7); } 20% { opacity: 1; } 35% { transform: rotate(-8deg) scale(1.08); } 55% { transform: rotate(6deg) scale(1); } 100% { opacity: 0; transform: rotate(0) scale(1); } }
@keyframes shake { 25% { transform: translateX(-7px); } 55% { transform: translateX(7px); } }
@keyframes copy-pop { 50% { transform: translateY(-4px); } }
@keyframes magnetic-snap { 50% { transform: scale(.84); } 85% { transform: scale(1.08); } }
@keyframes card-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.88) rotate(-2deg); } }
@keyframes slow-spin { to { transform: rotate(360deg); } }
@keyframes confetti-fall { to { transform: translate(var(--drift), 105vh) rotate(620deg); } }

@media (max-height: 760px) {
  .mission-note { top: 12px; min-height: 82px; padding-block: 10px; }.mission-note h1 { font-size: 25px; }
  .workbench { top: 58%; height: calc(100vh - 125px); grid-template-columns: 170px minmax(500px, 1fr) 190px; gap: 12px; }
  .specimen-card { height: 510px; }.discovery-card { min-height: 290px; padding: 22px 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
