@layer page {
    body { overflow-x: clip; }
    #page { max-width: 110ch; }
    #bench { display: grid; gap: 1lh 3ch; align-items: start; }
    #stage { position: sticky; inset-block-start: 0; z-index: 1; display: grid; gap: .25lh; justify-items: center; background: var(--paper); padding-block: .25lh; margin-inline: -1.5ch; padding-inline: 1.5ch; border-block-end: var(--hair); }
    #card { display: block; max-width: 100%; max-height: 44svh; width: auto; height: auto; border: var(--edge); box-shadow: .6ch .25lh 0 var(--shade), .6ch .25lh 1.4ch var(--glow); cursor: pointer; touch-action: pan-y; user-select: none; -webkit-touch-callout: none;
        &.held { touch-action: none; cursor: grab; } }
    @container page (min-width: 80ch) {
        #bench { grid-template-columns: minmax(0, 1fr) 46ch; }
        #stage { inset-block-start: .5lh; gap: .5lh; background: none; border: 0; margin: 0; padding: 0; }
        #card { max-height: 80svh; }
    }
    #photo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 2ch; width: 100%;
        label { display: flex; align-items: center; gap: 1ch; flex: 1 1 16ch; } }
    #photo[hidden], #acts [hidden], #make [hidden] { display: none; }
    input[type=range] { accent-color: var(--accent); border: 0; }
    #say:empty { display: none; }
    #say { font-size: .875em; text-align: center; }
    #acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25lh 2ch; }
    .flake { position: absolute; inset-block-start: 0; font-style: normal; color: var(--white); text-shadow: 0 0 3px var(--black); pointer-events: none; animation: fall 1.6s ease-in both; }
    @keyframes fall { from { opacity: 0; } 15% { opacity: 1; } to { translate: 2ch 60svh; rotate: 200deg; opacity: 0; } }

    #make { display: grid; gap: .75lh; padding-block: .75lh; justify-items: start; > * { width: 100%; } > button { width: auto; } }
    fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25lh 2ch;
        legend { padding: 0; font-size: .75em; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin-block-end: .25lh; }
        label { cursor: pointer; }
        :is([type=radio], [type=checkbox]) { appearance: none; position: absolute; width: 1px; height: 1px; opacity: 0; }
        label:has([type=checkbox])::before { content: '☐ '; }
        label:has([type=checkbox]:checked)::before { content: '☑ '; } }
    .count { flex: 1 1 100%; display: flex; align-items: center; gap: 1ch;
        button { font-size: 1.25em; text-decoration: none; padding: 0 1ch; border: var(--hair); }
        input { flex: 1; }
        output { min-width: 9ch; text-align: end; font-weight: 700; } }
    #styles { flex: 1 1 100%; display: flex; gap: 1.5ch; overflow-x: auto; scroll-snap-type: x proximity; padding: .25lh .5ch .5lh; margin-inline: -.5ch;
        button { flex: none; display: grid; gap: .25lh; justify-items: center; padding: 0; text-decoration: none; scroll-snap-align: start; font-size: .625em;
            canvas { display: block; height: 15ch; width: auto; border: var(--hair); box-shadow: .4ch .15lh 0 var(--shade); transition: translate .12s; font-size: 1.6em; }
            &:hover canvas, &:focus-visible canvas { translate: 0 -.3ch; }
            &:active canvas { translate: .2ch .1lh; box-shadow: none; } } }
    .words { display: grid; gap: .5lh;
        label { display: grid; cursor: auto; }
        textarea { width: 100%; background: none; border: 0; border-block-end: 1px solid var(--line); border-radius: 0; padding: 0; line-height: 1lh; resize: vertical; field-sizing: content;
            &:focus { outline: none; border-block-end-color: var(--accent); box-shadow: 0 1px var(--accent); } } }
    details { border-block-start: var(--hair); padding-block-start: .5lh;
        summary { cursor: pointer; font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; list-style: none; &::-webkit-details-marker { display: none; } &::after { content: '+'; } }
        &[open] summary::after { content: '−'; }
        &[open] { display: grid; gap: .75lh; } }
    .dials label { flex: 1 1 16ch; display: grid; cursor: auto; text-decoration: none; }
    .year { display: grid; flex: 0 1 12ch; cursor: auto; }
    .theme { background: var(--bg); color: var(--fg); border: 3px solid var(--hi); padding: 0 1.25ch; text-decoration: none;
        &:has([value=holly]) { --bg: color-mix(in oklab, var(--green) 62%, var(--black)); --fg: var(--white); --hi: var(--yellow); }
        &:has([value=berry]) { --bg: color-mix(in oklab, var(--red) 82%, var(--black)); --fg: var(--white); --hi: var(--yellow); }
        &:has([value=snow]) { --bg: var(--white); --fg: color-mix(in oklab, var(--red) 78%, var(--black)); --hi: var(--green); }
        &:has([value=night]) { --bg: color-mix(in oklab, var(--violet) 45%, var(--black)); --fg: var(--white); --hi: var(--yellow); }
        &:has([value=frost]) { --bg: color-mix(in oklab, var(--blue) 72%, var(--black)); --fg: var(--white); --hi: var(--white); }
        &:has([value=pine]) { --bg: color-mix(in oklab, var(--green) 32%, var(--black)); --fg: var(--white); --hi: var(--red); }
        &:has([value=gold]) { --bg: color-mix(in oklab, var(--yellow) 82%, var(--white)); --fg: var(--black); --hi: var(--red); }
        &:has([value=plum]) { --bg: color-mix(in oklab, var(--violet) 86%, var(--red)); --fg: var(--white); --hi: var(--orange); }
        &:has([value=ember]) { --bg: color-mix(in oklab, var(--orange) 80%, var(--black)); --fg: var(--white); --hi: var(--yellow); }
        &:has([value=kraft]) { --bg: color-mix(in oklab, var(--white) 68%, color-mix(in oklab, var(--orange), var(--black))); --fg: var(--black); --hi: var(--red); }
        &:has([value=mint]) { --bg: color-mix(in oklab, var(--white) 72%, var(--green)); --fg: color-mix(in oklab, var(--green) 45%, var(--black)); --hi: var(--red); }
        &:has([value=ink]) { --bg: var(--black); --fg: var(--white); --hi: var(--red); }
        &:has(:checked) { color: var(--fg); text-decoration: none; outline: 2px solid var(--ink); outline-offset: 2px; } }

    @media print {
        @page { margin: 0; }
        body { background: none; }
        #grain, #page > :not(#bench), #bench > :not(#stage), #stage > :not(canvas) { display: none !important; }
        #page { max-width: none; padding: 0; }
        #stage { position: static; background: none; border: 0; }
        #card { max-height: 100vh; border: 0; box-shadow: none; margin: auto; }
    }
}
