:root{font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;color:#9aa6b5;background:#fff}*{box-sizing:border-box}html,body{margin:0;min-width:320px;background:#fff}body{min-height:100vh}.guest-header{display:none}.archive-view{padding:100px 24px 70px}.archive-view[hidden],.details[hidden]{display:none}.grid{display:grid;grid-template-columns:repeat(6,minmax(0,90px));justify-content:center;gap:48px 30px;max-width:740px;margin:0 auto}.card{position:relative;width:90px;max-width:100%;height:auto;border:0;padding:0;background:none;color:inherit;text-align:center;cursor:pointer;transition:opacity .28s ease}.card:focus-visible{outline:1px solid #aab3be;outline-offset:5px}.card-media{position:relative;display:grid;place-items:center;width:100%;height:190px;overflow:hidden}.card-figure{display:grid;place-items:center;width:100%;height:100%;overflow:hidden}.card-image{display:block;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity .35s ease}.card.is-pending .card-image{visibility:hidden}.card.is-unavailable .card-image{display:none}.unavailable{position:absolute;inset:auto 0;top:50%;color:#b5bdc7;font-size:10px}.card-meta{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:1.3em 1.3em;min-width:0;gap:3px;padding-top:7px;color:#a3adb9;font-size:10px;line-height:1.3;white-space:nowrap}.card-label{grid-row:1;min-width:0;overflow:hidden;text-overflow:ellipsis;color:#8793a0}.card-meta>span:last-child{grid-row:2}.empty{grid-column:1/-1;text-align:center;color:#a3adb9;font-size:12px}.load-more{display:block;margin:32px auto 0;border:0;background:none;color:#9aa6b5;font:inherit;font-size:12px;cursor:pointer}.load-more[hidden],[hidden]{display:none!important}.load-more:disabled{opacity:.5;cursor:wait}.details{min-height:100vh;padding:38px 24px 48px}.details .back{position:absolute;top:24px;left:24px;color:#a3adb9;text-decoration:none;font-size:11px}.details .back:hover{text-decoration:underline}.details .detail-layout{display:flex;flex-direction:column;align-items:center;gap:8px;max-width:440px;margin:26px auto 0}.details .detail-preview{position:relative;display:grid;place-items:center;width:min(100%,400px);height:min(56vh,430px);overflow:hidden}.details .detail-preview img{display:block;width:100%;height:100%;object-fit:contain}.details .detail-preview p{position:absolute;bottom:0;margin:0;color:#a3adb9;font-size:11px}.detail-form{width:min(100%,340px);margin:0 auto;color:#9aa6b5;text-align:center;opacity:0;animation:form-in .35s .18s ease both}.detail-form h1{display:none}.detail-form p{font-size:12px;line-height:1.6}.detail-form [role=status]{min-height:20px;margin:5px 0;color:#8793a0;font-size:12px}.detail-form [role=status]:empty{display:none}.detail-form [role=status].error{color:#b46d6d}.primary,.button-row button,#profile-form>button,#claimed-panel button{border:1px solid #a3adb9;border-radius:999px;background:#a3adb9;color:white;padding:11px 17px;font:inherit;font-size:12px;cursor:pointer}.primary{min-height:44px}.primary:disabled{opacity:.45;cursor:default}.detail-form>.primary,#claim-panel>.primary{width:100%}.button-row{display:flex;justify-content:center;align-items:center;gap:10px;margin-top:14px}.button-row button:not(.primary),#profile-form>button:not(.primary){border:0;background:none;color:#9aa6b5;padding:10px 8px;font:inherit;font-size:12px;cursor:pointer}.detail-form video{display:block;width:min(100%,340px);max-height:320px;margin:16px auto 0;object-fit:contain;background:#f4f5f6}.detail-form #photo-preview{display:block;width:min(100%,300px);max-height:300px;margin:16px auto 0;object-fit:contain}.consent{display:flex;gap:9px;align-items:flex-start;margin-top:15px;color:#8793a0;font-size:12px;line-height:1.5;text-align:left}.consent input{margin-top:2px;accent-color:#9aa6b5}.detail-form form label:not(.consent){display:grid;gap:7px;margin:15px 0;color:#8793a0;font-size:12px;text-align:left}.detail-form input:not([type=checkbox]){width:100%;min-height:44px;padding:9px 10px;border:1px solid #e3e7eb;border-radius:7px;color:#657181;font:inherit}.small-note{color:#a3adb9!important;font-size:11px!important}.handle-input{display:flex;align-items:center;gap:7px}.handle-input>span{color:#a3adb9}.handle-input input{min-width:0;flex:1}#claimed-social{display:flex;justify-content:center;gap:12px;margin-top:10px;font-size:12px}#claimed-social a{color:#9aa6b5;text-decoration:none}#claimed-social a:hover{text-decoration:underline}@keyframes form-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}body.detail-open .card:not(.is-selected){opacity:0;pointer-events:none}body.detail-open .card.is-selected{opacity:0}.selected-character{view-transition-name:selected-character}/* Move one figure between layouts; crossfading differently fitted snapshots creates a ghost. */
::view-transition-group(selected-character){animation-duration:.5s;animation-timing-function:cubic-bezier(.2,.7,.2,1)}
::view-transition-old(selected-character){display:none}
body:has(.create-entry) .archive-view{padding-bottom:calc(20svh + 152px)}
.create-entry{position:fixed;z-index:6;top:0;right:0;pointer-events:none}
.create-entry .experience-action{position:relative;top:20px;right:24px;pointer-events:auto}
@media(prefers-reduced-motion:reduce){.create-entry .experience-action{animation:none}}
::view-transition-new(selected-character){animation:none;mix-blend-mode:normal}
@media(max-width:1100px){.grid{grid-template-columns:repeat(3,minmax(0,90px));gap:44px 30px}}@media(max-width:680px){.archive-view{padding:58px 15px 48px}.grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:26px 12px;max-width:420px}.card{width:100%}.card-media{height:clamp(120px,40vw,180px)}.details .detail-layout{margin-top:20px;gap:3px}.details{padding:38px 18px 40px}.details .detail-preview{width:min(100%,360px);height:min(46vh,360px)}.detail-form{margin-top:4px}.details:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])) .detail-preview{height:min(36vh,270px)}.detail-form video{max-height:250px}}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation-duration:.01ms!important}}
/* Keep the figure, age and action in separate rows at every viewport size. */
.details .detail-layout{gap:22px}.details .detail-preview{display:flex;flex-direction:column;gap:12px}.details .detail-preview img{min-height:0;flex:1;height:0;object-fit:contain}.details .detail-preview p{position:static;flex:none;line-height:16px}

#code-form input{text-align:center;font-size:28px;letter-spacing:.35em;font-variant-numeric:tabular-nums}
#code-form button{width:100%}


/* Prepared avatars are square with transparent sides. Size the square by figure height,
   as in Controls, rather than squeezing it to the narrow gallery column. */
@media(min-width:681px){
  .grid{gap:62px 34px}
  .card-media{height:220px;overflow:visible;grid-template-columns:minmax(0,1fr)}
  .card-figure{width:220px;height:220px;pointer-events:none}
  .details{display:flex;flex-direction:column;min-height:100svh}
  .details .detail-layout{max-width:650px;margin:auto}
  .details .detail-preview{width:100%;height:auto;overflow:visible}
  .details .detail-preview img{flex:none;width:min(100%,650px,calc(100svh - 230px));height:auto;aspect-ratio:1}
}

@media(max-width:680px){
  .archive-view{padding:112px 28px 48px;overflow-x:clip}
  .grid{max-width:315px;column-gap:16px}
  .card-media{height:160px;overflow:visible;grid-template-columns:minmax(0,1fr)}
  .card-figure{width:160px;height:160px;pointer-events:none}
  .card-meta{padding-top:2px}
}

.card-figure{transition:transform .18s ease}
.card.is-opening .card-figure{transform:scale(1.04)}
.grid:has(.is-opening) .card:not(.is-opening){opacity:0}
@media(prefers-reduced-motion:reduce){.card-figure{transition:none}}

/* Keep camera capture inside a phone viewport, with the character out of the way. */
.details:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])) .detail-preview,
.details.is-pending .detail-preview{display:none}
.details:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])) .detail-layout,
.details.is-pending .detail-layout{margin:0 auto;max-width:520px}
.details:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])) .detail-form,
.details.is-pending .detail-form{width:100%;margin:0 auto}
#camera-panel{width:min(100%,380px);margin:0 auto}
.camera-instruction{margin:0 0 12px!important;color:#657181;font-size:14px!important;line-height:1.4!important}
.camera-frame{position:relative;width:min(100%,360px);height:min(58svh,470px);min-height:250px;margin:0 auto;padding:0;border:1px solid #e3e7eb;border-radius:18px;background:#fff;overflow:hidden}
#camera-panel video#camera{display:block;width:100%;height:100%;min-height:0;max-height:none;margin:0;padding:0;border:0;object-fit:contain;transform:scaleX(-1);border-radius:17px;background:#f4f5f6}
.details:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])) .button-row .primary{min-width:148px;min-height:50px;border-color:#222;background:#222;border-radius:12px;color:#fff;font-size:14px}
#photo-preview{transform:scaleX(-1)}
.claim-note{max-width:340px;margin:12px auto 0!important;color:#657181;font-size:13px!important;line-height:1.5!important;text-align:center}
/* Give the claim review one clear action, with its photo note at the bottom. */
body:has(#detail:not([hidden]) :is(#camera-panel,#photo-panel,#code-form):not([hidden]),#detail.is-pending:not([hidden])) .create-entry{display:none}
#photo-panel:not(.is-matching){display:flex;flex-direction:column;align-items:center}
#photo-panel .photo-frame{flex-shrink:0}
#photo-panel .button-row{flex-direction:column;gap:12px;margin:auto 0;padding:24px 0}
#photo-panel #retake{min-width:148px;min-height:44px;border:1px solid #cdd2d8;border-radius:12px;background:#fff;color:#596575;font-size:14px}
#photo-panel .claim-note{margin:0 auto!important;text-align:center;text-wrap:pretty}
.claim-note svg{display:inline-block;width:16px;height:16px;margin-right:5px;vertical-align:-3px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round}
.claim-note .info-dot{fill:currentColor;stroke:none}
.details:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])) #detail-message{margin:5px 0;min-height:0}
.details.is-pending #detail-message{margin:26px 0;font-size:15px}

.claimed-check{display:grid;place-items:center;width:34px;height:34px;margin:0;border-radius:50%;background:#eef3f8;color:#7890aa;font-size:22px;animation:claimed-pop .38s cubic-bezier(.2,.8,.2,1) both}
.details:not(.is-owned) .claimed-check{display:none}
#claimed-name{margin:0;color:#657181;font-size:22px;font-weight:500;line-height:1.15}
.details.is-owned #claimed-social{display:none}
@keyframes claimed-pop{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:scale(1)}}

@media(max-width:680px){
  .details:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])),.details.is-pending{min-height:100svh;padding:62px 16px 12px}
  .details:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])) .detail-layout,
  .details.is-pending .detail-layout{min-height:calc(100svh - 74px);gap:0}
  .details:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])) .detail-form{margin:0}
  .camera-frame{width:min(100%,360px);height:min(56svh,470px);max-height:calc(100svh - 230px);min-height:230px}
  .detail-form #photo-preview{width:min(100%,390px);height:min(56svh,460px);max-height:calc(100svh - 250px);margin:0 auto 5px;object-fit:contain;border-radius:14px;background:#f7f7f7}
}
@media(max-height:700px) and (max-width:680px){
  .camera-frame{height:48svh;min-height:210px}
  .detail-form #photo-preview{height:44svh}
}
@media(prefers-reduced-motion:reduce){.claimed-check{animation:none}}

/* The claimed character is one portrait card. The story export uses this layout. */
.details.is-owned{height:var(--visible-height,100svh);min-height:0;padding:48px 16px 28px;overflow:hidden}
body.detail-open:has(.details.is-owned){overflow:hidden;min-height:0;height:var(--visible-height,100svh)}
.details.is-card .detail-layout{display:flex;flex-direction:column;justify-content:flex-start;gap:0;width:min(100%,var(--owned-card-width,380px));min-height:0;margin:0 auto}
.details.is-card .detail-preview{position:relative;display:block;width:100%;height:auto;max-height:none;min-height:0;aspect-ratio:9/16;margin:0 auto;border-radius:20px;background:#fff;box-shadow:0 4px 24px #00000018,0 1px 4px #0000000c;overflow:hidden}
.details.is-card .detail-preview img{position:absolute;left:0;top:21.09375%;width:100%;height:56.25%;object-fit:contain}
.details.is-card .detail-preview p{display:none}
.details.is-card .detail-form{display:contents;opacity:1;animation:none}
.details.is-card .card-number{position:absolute;top:6%;right:7%;z-index:1;color:#777777;font-size:11px;font-weight:500;letter-spacing:.12em}
.details.is-card .card-handles{position:absolute;top:79.5%;left:7%;right:7%;z-index:1;display:grid;justify-items:center;gap:4px;min-height:38px;padding:3px 6px;border:0;border-radius:9px;background:transparent;color:#333333;font:inherit;font-size:clamp(13px,3vw,18px);font-weight:500;line-height:1.25;text-align:center;overflow-wrap:anywhere;cursor:pointer}
.details.is-card .card-handles:hover,.details.is-card .card-handles:focus-visible{background:#f5f5f5;outline:2px solid #cccccc;outline-offset:2px}
.card-handle{display:flex;align-items:center;justify-content:center;gap:7px;max-width:100%}
.card-handle svg{width:1.1em;height:1.1em;flex:none;stroke:currentColor;stroke-width:1.6;fill:none}
.card-handle.placeholder{color:#777777;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:4px}
.details.is-owned #claimed-panel{position:fixed;inset:0;z-index:5;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#fff;animation:depart-claim .35s 1s forwards}
.details.is-owned #claimed-panel[hidden]{display:none}
.details.is-owned #claimed-name{display:block;color:#333333;font-size:27px}
.details.is-owned #open-share{order:1;width:100%;min-height:54px;margin-top:12px;border:0;border-radius:14px;background:#222222;color:white;font-size:15px}
.details.is-owned #open-share span{margin-left:8px}
.details.is-owned #detail-message{order:2;min-height:0;margin:4px 0;text-align:center}
.details #profile-form{--profile-spacing:clamp(8px,calc(8px + (var(--profile-viewport-height,100dvh) - 400px) / 8),22px);position:fixed;inset:auto 0 var(--profile-viewport-bottom,0px);z-index:8;display:block;width:min(100%,480px);max-height:calc(var(--profile-viewport-height,100dvh) - max(12px,env(safe-area-inset-top)));overflow-y:auto;overscroll-behavior:contain;scroll-padding-block:12px;margin:auto;padding:calc(var(--profile-spacing) + 20px) 24px max(calc(var(--profile-spacing) + 6px),env(safe-area-inset-bottom));border-radius:20px 20px 0 0;background:#fff;text-align:left}
.details #profile-form[hidden]{display:none}
@media(prefers-reduced-motion:reduce){.details #profile-form{transition-property:none}}
.details #profile-form label.social-field{display:flex;align-items:center;gap:15px;margin:0 0 var(--profile-spacing);color:#777777;font-size:11px}
.details #profile-form input:not([type=checkbox]){font-size:16px}
.details #profile-form .social-field svg{width:24px;height:24px;flex:none;stroke:#555555;stroke-width:1.6;fill:none}
.details #profile-form .social-field > span{flex:1;min-width:0}
.details #profile-form .social-input{display:flex;align-items:center;gap:2px;margin-top:2px;border-bottom:1px solid #dddddd;color:#333333;font-size:17px}
.details #profile-form .social-input input{display:block;min-width:0;min-height:0;width:100%;margin:0;padding:7px 0 10px;border:0;border-radius:0;color:#333333;font-size:17px}
.details #profile-form .social-input:focus-within{border-color:#4f6074;box-shadow:0 1px #4f6074}
.details #profile-form .social-input input:focus{outline:none}
@media(forced-colors:active){.details #profile-form .social-input:focus-within{border-color:Highlight}}
.details #profile-form>button.primary{width:100%;min-height:50px;border-radius:12px;background:#222222}
.details #skip-profile{display:block;margin:min(14px,var(--profile-spacing)) auto 0;border:0;background:none;color:#777777;font:inherit;font-size:13px;padding:8px}
.sheet-close{position:absolute;top:14px;right:18px;border:0;background:none;color:#777777;font:inherit;font-size:26px;cursor:pointer}
.details #profile-form > .sheet-close{width:auto;min-height:0;padding:0;border:0;background:none;color:#777777;font-size:26px}
@keyframes depart-claim{to{opacity:0;visibility:hidden}}


#profile-backdrop{position:fixed;inset:0;z-index:7;background:#00000077}

/* Start from zero even when preparation reveals and decodes in one frame. */
.card:not(.is-pending):not(.is-unavailable) .card-image,.card:not(.is-pending):not(.is-unavailable) .card-meta{animation:gallery-figure-in .45s ease both}
.card.is-pending .card-meta,.card.is-unavailable .card-meta{opacity:0;visibility:hidden}
.card.is-staged{position:absolute;visibility:hidden;pointer-events:none}
@keyframes gallery-figure-in{from{opacity:0}to{opacity:1}}

/* Show exactly the same full camera frame before and after capture. */
#detail{--camera-ratio:.75;--capture-height:min(58svh,470px,calc(100svh - 230px))}
.camera-frame,.photo-frame{position:relative;width:min(100%,360px,calc(var(--capture-height) * var(--camera-ratio)));height:auto;min-height:0;max-height:none;aspect-ratio:var(--camera-ratio);margin:0 auto}
.detail-form .photo-frame #photo-preview{position:absolute;left:0;top:0;width:100%;height:100%;max-height:none;max-width:none;margin:0;object-fit:contain;border-radius:17px;background:#f4f5f6;transition:left .38s cubic-bezier(.2,.7,.2,1),top .38s cubic-bezier(.2,.7,.2,1),width .38s cubic-bezier(.2,.7,.2,1),height .38s cubic-bezier(.2,.7,.2,1),transform .38s cubic-bezier(.2,.7,.2,1),border-radius .3s ease}
/* Let the two portraits sit in the same open space as the gallery figures. */
.detail-form .matching{position:absolute;inset:0;min-height:0;margin:0;opacity:0;visibility:hidden;transition:opacity .45s ease,visibility .45s ease;pointer-events:none}
.matching.is-active{opacity:1;visibility:visible}
.matching-image{position:absolute;right:0;top:17%;display:block;width:58%;height:66%;object-fit:contain;opacity:0;transform:translateX(12px);transition:opacity .6s .15s ease,transform .7s cubic-bezier(.2,.7,.2,1)}
.matching.is-active .matching-image:not([hidden]){opacity:1;transform:translateX(0)}
.matching-connector{position:absolute;top:50%;height:2px;background:radial-gradient(circle,#b4bdc8 1px,transparent 1.3px) left center/9px 2px repeat-x;animation:matching-dots 1.8s linear infinite}
.matching-connector:first-child{left:37%;width:8%}
.matching-connector:last-of-type{left:55%;width:9%}
.matching-status{position:absolute;left:50%;top:calc(50% - 3px);display:grid;justify-items:center;gap:10px;transform:translateX(-50%)}
.detail-form #matching-label{color:#8793a0;font-size:12px;font-weight:400;line-height:1.4;white-space:nowrap}
.matching-pulse{display:flex;align-items:center;gap:4px;height:6px}
.matching-pulse i{display:block;width:4px;height:4px;border-radius:50%;background:#8793a0;animation:matching-breathe 1.8s ease-in-out infinite}
.matching-pulse i:nth-child(2){animation-delay:.2s}
.matching-pulse i:nth-child(3){animation-delay:.4s}
.details:has(#photo-panel.is-matching) .detail-layout{width:100%;min-height:calc(100svh - 86px);justify-content:center}
#photo-panel.is-matching .photo-frame{width:min(100%,420px);height:auto;aspect-ratio:1;overflow:visible;transition:width .7s cubic-bezier(.2,.7,.2,1)}
#photo-panel.is-matching .photo-frame #photo-preview{left:0;top:50%;width:34%;height:calc(34% / var(--camera-ratio));max-height:70%;border-radius:12px;background:transparent;transform:translateY(-50%) scaleX(-1);transition:left .7s cubic-bezier(.2,.7,.2,1),top .7s cubic-bezier(.2,.7,.2,1),width .7s cubic-bezier(.2,.7,.2,1),height .7s cubic-bezier(.2,.7,.2,1),transform .7s cubic-bezier(.2,.7,.2,1),border-radius .7s ease}
#photo-panel.is-matching .claim-note,#photo-panel.is-matching .button-row{display:none}
.matching.is-waiting .matching-status{left:50%;top:78%}
.matching.is-waiting .matching-connector{display:none}
.matching.is-waiting .matching-image{right:21%;top:4%}
@keyframes matching-dots{to{background-position:9px center}}
@keyframes matching-breathe{0%,70%,100%{opacity:.25;transform:scale(.8)}35%{opacity:1;transform:scale(1)}}
@media(max-width:680px){#detail{--capture-height:min(56svh,470px,calc(100svh - 230px))}}
@media(max-width:360px){.matching-status{left:47%}.matching-connector:first-child{width:6%}.matching-connector:last-of-type{left:52%;width:12%}}
@media(max-height:700px) and (max-width:680px){#detail{--capture-height:48svh}}
@media(prefers-reduced-motion:reduce){.detail-form .matching,.matching-image,.matching.is-active .matching-image,#photo-panel.is-matching .photo-frame,#photo-panel .photo-frame #photo-preview,#photo-panel.is-matching .photo-frame #photo-preview{transition:none}.matching-connector,.matching-pulse i{animation:none}}
.public-note-field{display:grid;gap:8px;text-align:left;font-size:13px;color:#657181}
.public-note-field>span{font-size:11px;color:#9aa6b5}
.public-note-field textarea{width:100%;resize:none;border:1px solid #d5dbe1;border-radius:12px;padding:12px;font:inherit;font-size:16px;line-height:1.4;color:#657181;background:#fff}
.public-note-field textarea:focus{outline:2px solid #a3adb9;outline-offset:2px}

/* Public character cards keep the same portrait layout as an owned card. */
.details.is-card{min-height:100svh;padding:48px 16px 28px}
.details.is-card .detail-layout{width:min(100%,var(--owned-card-width,380px));margin:0 auto}
.details.is-card .detail-preview{border-radius:20px;background:#fff;box-shadow:0 4px 24px #00000018,0 1px 4px #0000000c}
.details.is-card .card-handles:disabled{cursor:default}
.details.is-card #download-card{order:1;width:100%;min-height:54px;margin-top:12px;border:0;border-radius:14px;background:#222;color:#fff;font-size:15px}
.details.is-card #download-card svg{width:18px;height:18px;margin-left:7px;vertical-align:-4px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.details.is-card #download-card[aria-busy=true]{opacity:.7}
.details.is-card #open-share{order:2;width:100%;min-height:48px;margin-top:8px;border:1px solid #d5d5d5;border-radius:14px;background:#fff;color:#333;font-size:14px}
.details.is-card #claim-panel{order:3;width:100%;margin-top:10px}
.details.is-card #claim-panel>.primary{border-color:#222;background:#222}
.details.is-card #claim-panel>#start-camera{display:none}
#claim-readiness p{margin:0 0 8px;color:#657181}
#cancel-readiness{min-height:44px;padding:0 16px;border:1px solid #cdd2d8;border-radius:12px;background:#fff;color:#596575;font-size:14px}
.details.is-card #code-form{margin-top:12px}
.details.is-card #code-form label{display:grid;gap:8px}
.details.is-card:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])) #download-card{display:none}
.details.is-card #detail-message{order:4}
.details.is-owned:has(#open-share:not([hidden])){--visible-height:100svh;--owned-card-width:min(380px,max(90px,calc((100svh - 240px)*.5625)));height:100svh}
@media(max-width:680px){.details.is-card{padding:62px 16px 24px}.details.is-card .detail-layout{margin:0 auto}.details.is-card .detail-form{margin:0}}

/* The inline export preview replaces the duplicate card and keeps page actions quiet. */
body.detail-open:has(.story-viewer:not([hidden])){height:auto;min-height:100svh;overflow:auto}
.details.is-card:has(.story-viewer:not([hidden])){height:auto;min-height:100svh;padding:64px 0 20px;overflow:visible;justify-content:center}
.details.is-card:has(.story-viewer:not([hidden])) .detail-layout{width:100%;max-width:none;margin:0 auto;gap:12px}
.details.is-card:has(.story-viewer:not([hidden])) .detail-preview{display:none}
.details:has(#camera-panel:not([hidden]),#photo-panel:not([hidden])) .story-viewer,.details.is-pending .story-viewer{display:none}
.details .story-viewer #card-handles{position:static;display:block;width:auto;max-width:100%;min-height:32px;margin:0 auto;padding:6px 10px;border:0;background:none;color:#888;font:inherit;font-size:12px;cursor:pointer}
.details .story-viewer #card-handles:disabled{cursor:default}
.details.is-card:has(.story-viewer:not([hidden])) .detail-form{width:min(calc(100% - 32px),340px);margin:0 auto}
body.detail-open .create-entry .experience-action{font-size:12px;padding:8px 12px;min-height:32px}
@media(max-height:540px) and (min-width:480px){
 .details.is-card:has(.story-viewer:not([hidden])){padding:48px 16px 12px}
 .details.is-card:has(.story-viewer:not([hidden])) .detail-layout{position:relative;gap:0}
}
.details.is-card:has(.story-viewer:not([hidden])) .detail-form{animation:none;opacity:1}

/* The captured-photo review fills the page independently of the card viewer. */
#detail:has(#photo-panel:not([hidden]):not(.is-matching)){padding:72px 16px 16px;min-height:100svh;height:auto;--capture-height:min(56svh,470px,calc(100svh - 270px))}
#detail:has(#photo-panel:not([hidden]):not(.is-matching)) .detail-layout{width:100%;max-width:520px;min-height:calc(100svh - 88px);margin:0 auto;gap:0}
#detail:has(#photo-panel:not([hidden]):not(.is-matching)) .detail-form{display:flex;flex-direction:column;flex:1;width:100%;min-height:calc(100svh - 88px);margin:0}
#detail:has(#photo-panel:not([hidden]):not(.is-matching)) #claim-panel{display:flex;flex-direction:column;flex:1;margin:0}
#detail:has(#photo-panel:not([hidden]):not(.is-matching)) #photo-panel{flex:1}
#detail:has(#photo-panel:not([hidden]):not(.is-matching)) #detail-message{order:-1;flex-shrink:0}
@media(max-height:540px){
 #detail:has(#photo-panel:not([hidden]):not(.is-matching)){padding-top:54px;--capture-height:max(48px,calc(100svh - 330px))}
 #detail:has(#photo-panel:not([hidden]):not(.is-matching)) .detail-layout,
 #detail:has(#photo-panel:not([hidden]):not(.is-matching)) .detail-form{min-height:calc(100svh - 70px)}
}

/* A claim result is a reading page. Its full message and actions share one scroll. */
body.detail-open:has(.details.is-claim-result){height:auto;min-height:100svh;overflow:auto}
body:has(.details.is-claim-result:not([hidden])) .create-entry{display:none}
.details.is-claim-result{display:flex;min-height:100svh;height:auto;overflow:visible;padding:72px 24px 32px}
.details.is-claim-result .back{font-size:0;min-width:36px;min-height:36px}
.details.is-claim-result .back::before{content:'←';font-size:23px}
.details.is-claim-result .detail-layout{width:min(100%,328px);max-width:none;min-height:calc(100svh - 104px);margin:0 auto;justify-content:center;gap:28px;padding:24px 0}
.details.is-claim-result .detail-preview{display:grid;width:190px;height:190px;max-height:none;min-height:0;aspect-ratio:auto;margin:0;overflow:visible;border-radius:0;background:none;box-shadow:none;flex-shrink:0}
.details.is-claim-result .detail-preview img{position:static;display:block;width:100%;height:100%;object-fit:contain}
.details.is-claim-result .detail-preview p,.details.is-claim-result .card-number,.details.is-claim-result .card-handles,.details.is-claim-result .story-viewer,.details.is-claim-result #detail-message{display:none!important}
.details.is-claim-result .detail-form{display:block;width:100%;margin:0;opacity:1;animation:none;text-align:left}
#claim-result-message{color:#596575;font-size:16px;line-height:1.6;overflow-wrap:anywhere;outline:none}
#claim-result-message p{margin:0;font:inherit;line-height:inherit;text-wrap:pretty}
#claim-result-message p+p{margin-top:16px}
.claim-result-actions{display:flex;flex-direction:column;gap:12px;margin-top:28px}
.claim-result-actions button{width:100%;min-height:52px;flex-shrink:0;border:1px solid #cdd2d8;border-radius:12px;padding:12px 16px;background:#fff;color:#596575;font:inherit;font-size:14px;line-height:1.4;cursor:pointer}
.claim-result-actions #result-download,.can-retry .claim-result-actions #result-retry{border-color:#222;background:#222;color:#fff}
.can-retry .claim-result-actions #result-download{border-color:#cdd2d8;background:#fff;color:#596575}
.claim-result-actions button:disabled{opacity:.45;cursor:default}
.claim-result-actions button:focus-visible{outline:2px solid #9aa6b5;outline-offset:4px}
#result-download-status{margin:12px 0 0;color:#596575;font-size:13px;line-height:1.5}
#result-download-status:empty{display:none}
@media(max-height:650px){
 .details.is-claim-result{padding-top:60px;padding-bottom:24px}
 .details.is-claim-result .detail-layout{min-height:calc(100svh - 84px);gap:24px;padding:12px 0}
 .details.is-claim-result .detail-preview{width:130px;height:130px}
 .claim-result-actions{margin-top:24px}
}

.details #profile-form h1{display:block;margin:0 0 6px;color:#333;font-size:24px}#profile-form>p:not([role]){margin:0 0 calc(var(--profile-spacing) + 4px);color:#777;font-size:15px}#profile-extra{margin:min(12px,var(--profile-spacing)) 0 var(--profile-spacing);color:#777;font-size:12px}#other-character{display:block;margin:10px auto 0;text-align:center;color:#777;font-size:12px}

/* A grouped cover stays one grid item; rear figures sit inside its media box. */
.card.look-stack{--look-stack-spread:26px;isolation:isolate;overflow:visible}
.card.look-stack .card-media{overflow:visible;isolation:isolate}
.card.look-stack .card-figure{position:relative;z-index:3;overflow:visible}
.card.look-stack .card-image{position:relative;z-index:3}
.card.look-stack .card-figure{overflow:visible}
.card.look-stack .card-image{transform:translateX(calc(var(--look-stack-spread) * -.65));}
.look-rear{position:absolute;top:50%;left:50%;width:220px;height:220px;max-width:none;object-fit:contain;pointer-events:none;transform-origin:50% 97%}
.look-rear-1{left:calc(50% - var(--look-stack-spread) * .65);filter:blur(1.2px);opacity:.48;transform:translate(calc(-50% + var(--look-stack-spread)),calc(-50% - 3px)) scale(.94);z-index:2}
.look-rear-2{left:calc(50% - var(--look-stack-spread) * .65);filter:blur(1.5px);opacity:.39;transform:translate(calc(-50% + var(--look-stack-spread) * 2),calc(-50% - 8px)) scale(.89);z-index:1}
.look-count{position:static;display:inline;color:#8793a0;font-size:10px;line-height:1.3;white-space:nowrap;pointer-events:none}
.card.look-stack .card-meta{grid-template-columns:auto auto;grid-template-rows:1.3em 1.3em;justify-content:center;column-gap:6px}
.card.look-stack .card-label{grid-row:1;grid-column:1/-1}
.card.look-stack .card-meta>span:not(.card-label){grid-row:2}
.card.look-stack .look-count{grid-row:2}
.album{padding-top:2px}
.album-back{display:block;margin:0 auto 28px;border:0;background:none;color:#a3adb9;font:inherit;font-size:11px;cursor:pointer}
.album-back:hover{text-decoration:underline}
@media(max-width:1100px){.card.look-stack{--look-stack-spread:21px}}
@media(max-width:680px){.card.look-stack{--look-stack-spread:16.9px}.look-rear{width:160px;height:160px}}
@media(prefers-reduced-motion:reduce){.look-rear{scroll-behavior:auto}}
#grid[hidden],#album[hidden]{display:none!important}

/* Prepared fronts paint directly from the document, before the gallery module starts. */
.card.has-prepared-front .card-image{opacity:1;animation:none}

/* The return animates the whole card. Prepared art and labels paint with it. */
#grid .card[data-created-character] :is(.card-image,.card-meta){opacity:1;animation:none}
