@layer page {
    #scanner { display: grid; gap: .75lh; padding-block: 1lh;
        .row { display: flex; flex-wrap: wrap; gap: .5lh 3ch; align-items: center; justify-content: center; } }
    #view { margin: 0; position: relative; border-radius: var(--round); overflow: hidden; background: light-dark(var(--ink), var(--black)); aspect-ratio: 4 / 3; display: grid;
        video { width: 100%; height: 100%; object-fit: cover; display: block; grid-area: 1 / 1; }
        .window { position: absolute; inset: 30% 6%; border: 3px dashed var(--sun); border-radius: var(--round); overflow: hidden;
            .beam { display: none; position: absolute; inset-inline: 0; height: 3px; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: sweep 1.6s ease-in-out infinite alternate; } }
        #hint { position: absolute; inset-inline: 0; inset-block-end: 0; padding: .25lh 2ch; text-align: center; font-size: .875em; color: var(--white); background: color-mix(in oklab, var(--black) 70%, transparent); text-wrap: balance; }
        &.on .beam { display: block; }
        &:not(.on) video { opacity: 0; }
        &:not(.on)::before { content: ''; grid-area: 1 / 1; place-self: center; width: 40%; aspect-ratio: 1; background: var(--sun); mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect x="12" y="20" width="3" height="24"/><rect x="18" y="20" width="2" height="24"/><rect x="23" y="20" width="4" height="24"/><rect x="30" y="20" width="2" height="24"/><rect x="35" y="20" width="3" height="24"/><rect x="41" y="20" width="2" height="24"/><rect x="46" y="20" width="4" height="24"/></svg>') center / contain no-repeat; opacity: .6; } }
    @keyframes sweep { from { inset-block-start: 4%; } to { inset-block-start: 92%; } }
    @media (prefers-reduced-motion: reduce) { #view .beam { animation: none; inset-block-start: 50%; } }
    #typed { font-size: .875em; input { font-size: 1.25em; letter-spacing: .1em; } }

    :is(#found, #one)[open] { width: min(44ch, 100% - 4ch); text-align: center; justify-items: center;
        .critter { width: 60%; max-width: 24ch; aspect-ratio: 1; display: grid; place-items: center; position: relative; margin-block: .5lh;
            &::before { content: ''; position: absolute; inset: -12%; border-radius: 50%; background: repeating-conic-gradient(var(--sun) 0 10deg, transparent 0 20deg); opacity: .35; animation: turn 24s linear infinite; }
            svg { width: 100%; height: 100%; position: relative; filter: drop-shadow(0 .25lh 0 color-mix(in oklab, var(--black) 25%, transparent)); } }
        h3 { font-size: 1.5em; line-height: 1.5lh; color: var(--accent); }
        .story { text-wrap: balance; }
        form { grid-template-columns: 1fr; justify-items: stretch; width: 100%; max-width: 32ch;
            label { display: grid; gap: .125lh; text-align: start; }
            .acts { display: flex; flex-wrap: wrap; gap: .5lh 2ch; justify-content: center; align-items: center; margin-block-start: .25lh; } } }
    @keyframes turn { to { rotate: 1turn; } }
    @media (prefers-reduced-motion: reduce) { :is(#found, #one) .critter::before { animation: none; } }
    .rarity { display: inline-block; padding: .125lh 1.5ch; border-radius: 999px; font-size: .75em; font-weight: 700; background: var(--sky); color: var(--black);
        &.rare { background: var(--berry); } &.legendary { background: var(--sun); box-shadow: 0 0 0 3px var(--accent); } }
    .again { color: var(--good); font-weight: 700; }

    #collection { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14ch, 1fr)); gap: 1lh 2ch;
        li { display: grid; gap: 0; justify-items: center; text-align: center; padding: .5lh 1ch .75lh; cursor: pointer; margin: 0;
            svg { width: 80%; height: auto; }
            .name { font-weight: 700; line-height: 1lh; }
            .what, .n { font-size: .75em; color: var(--mute); line-height: 1lh; }
            .rarity { margin-block-start: .25lh; }
            &.new { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); } }
        &:empty::after { content: 'nothing yet: scan something!'; grid-column: 1 / -1; text-align: center; font-style: italic; color: var(--mute); } }
    @keyframes pop { from { scale: .6; rotate: -8deg; } }
    #tally { text-align: center; color: var(--accent); min-height: 1lh; }
    #kept { font-size: .875em; text-align: center; }
}
