.pet-card{--edge:#aab7bc;--edge-dark:#60747c;--edge-light:#dce5e7;--foil-opacity:.35;--frame:12px;--cycle:2.5s;--mx:50%;--my:35%;--tilt-x:0deg;--tilt-y:0deg;width:100%;aspect-ratio:2/3;position:relative;border:3px solid #28414a;padding:var(--frame);background:var(--edge);box-shadow:6px 7px 0 #91a3aa;isolation:isolate;transform:rotateX(var(--tilt-x)) rotateY(var(--tilt-y));transition:transform .18s ease-out;container-type:inline-size}.pet-card.rare{--edge:#27b8e8;--edge-dark:#12658a;--edge-light:#8ddff4}.pet-card.epic{--edge:#9870e5;--edge-dark:#4c317a;--edge-light:#d6bcff}.pet-card.legendary{--edge:#ffcb42;--edge-dark:#926021;--edge-light:#fff0a4}.card-window{height:100%;position:relative;overflow:hidden;border:2px solid var(--edge-dark);background:#b8d5d4;z-index:2}.card-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% var(--crop,50%);image-rendering:pixelated}.card-art.original{object-fit:contain;padding:12%;background:#a9dfb0}.card-info{position:absolute;inset:auto 0 0;background:#f4f7f8;color:#28414a;padding:12px 13px;border-top:2px solid #28414a;z-index:5}.pet-card.legendary .card-info,.pet-card.epic .card-info{background:#28414a;color:#fff}.card-head{position:absolute;top:10px;left:10px;right:10px;display:flex;justify-content:space-between;align-items:flex-start;gap:6px;z-index:5}.nameplate{margin:0;max-width:80%;background:#f4f7f8;color:#28414a;padding:9px 10px;border:2px solid #28414a;font-weight:900;font-size:clamp(14px,7cqw,23px);line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.new-stamp{background:#ffcb42;color:#28414a;border:2px solid #28414a;font-family:Pixel,monospace;font-size:clamp(7px,2.4cqw,10px);padding:6px 5px;transform:rotate(5deg)}.rarity-label{display:flex;align-items:center;gap:8px;font-size:clamp(10px,3.8cqw,13px);font-weight:900;text-transform:uppercase;letter-spacing:.06em}.rarity-mark{display:block;width:15px;height:15px;background:var(--edge);border:2px solid currentColor}.rare .rarity-mark{transform:rotate(45deg);width:12px;height:12px;margin:2px}.epic .rarity-mark{clip-path:polygon(25% 0,75% 0,100% 35%,100% 65%,75% 100%,25% 100%,0 65%,0 35%);border:0}.legendary .rarity-mark{clip-path:polygon(50% 0,62% 32%,97% 35%,73% 58%,79% 93%,50% 74%,21% 93%,27% 58%,3% 35%,38% 32%);border:0}.card-collection{font-size:clamp(9px,3.1cqw,11px);opacity:.85;margin-top:5px}.corner{position:absolute;width:28px;height:28px;background:var(--edge-dark);z-index:4;pointer-events:none}.corner:after{content:'';position:absolute;inset:6px;background:var(--edge-light);clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}.corner.tl{top:0;left:0}.corner.tr{top:0;right:0}.corner.bl{bottom:0;left:0}.corner.br{bottom:0;right:0}.pet-card[data-ornament="0"] .corner,.pet-card[data-ornament="0"] .crest{display:none}.pet-card.common .corner,.pet-card.common .crest{display:none}.pet-card.rare .corner{width:15px;height:15px}.pet-card.rare .corner:after{inset:3px}.crest{position:absolute;top:-20px;left:50%;transform:translateX(-50%);width:50px;height:50px;background:var(--edge-dark);clip-path:polygon(50% 0,100% 25%,90% 80%,50% 100%,10% 80%,0 25%);z-index:6;display:grid;place-items:center}.crest:after{content:'';width:27px;height:27px;background:var(--edge-light);clip-path:polygon(50% 0,64% 33%,100% 37%,73% 60%,80% 100%,50% 79%,20% 100%,27% 60%,0 37%,36% 33%)}.rare .crest{display:none}.frame-inset{position:absolute;inset:5px;border:2px solid var(--edge-light);pointer-events:none;z-index:3}.common .frame-inset{border-width:1px}.foil{position:absolute;inset:0;z-index:3;pointer-events:none;opacity:0;background:linear-gradient(115deg,transparent 10%,#acf8e8 24%,#fbc4fa 29%,#fff3ab 34%,transparent 44%,transparent 62%,#c1e9ff 66%,#ffd0a7 71%,transparent 80%);background-size:250% 250%;mix-blend-mode:screen;background-position:var(--mx) var(--my)}.rare .foil,.epic .foil,.legendary .foil{opacity:calc(var(--foil-opacity)*.38)}.foil-edge{position:absolute;inset:0;pointer-events:none;z-index:1;background:conic-gradient(from 0deg at var(--mx) var(--my),transparent 0deg,#fff2a3 60deg,transparent 100deg,#ceafff 160deg,transparent 210deg,#c0f3e8 280deg,transparent 360deg);opacity:0}.legendary .foil-edge{opacity:var(--foil-opacity)}.epic .foil-edge{opacity:calc(var(--foil-opacity)*.65)}.rare .foil-edge{opacity:calc(var(--foil-opacity)*.4)}.pet-card[data-motion="true"].rare .foil,.pet-card[data-motion="true"].epic .foil,.pet-card[data-motion="true"].legendary .foil{animation:foil-sweep var(--cycle) ease-in-out infinite}.pet-card[data-motion="true"].rare .foil-edge,.pet-card[data-motion="true"].epic .foil-edge,.pet-card[data-motion="true"].legendary .foil-edge{animation:edge-sweep var(--cycle) ease-in-out infinite}.particles{position:absolute;inset:-26px;z-index:7;pointer-events:none}.particles i{position:absolute;left:var(--x);top:var(--y);width:var(--s);height:var(--s);background:var(--edge-light);clip-path:polygon(42% 0,58% 0,58% 42%,100% 42%,100% 58%,58% 58%,58% 100%,42% 100%,42% 58%,0 58%,0 42%,42% 42%);opacity:.8;transform:rotate(var(--r))}.pet-card[data-motion="true"] .particles i{animation:star-twinkle var(--cycle) ease-in-out infinite;animation-delay:var(--delay)}.pet-card.common .particles,.pet-card.rare .particles,.pet-card[data-ornament="0"] .particles,.pet-card[data-ornament="1"] .particles{display:none}.pet-card.trailbound{border-radius:0}.pet-card.trailbound .crest{width:43px;height:32px;top:-11px;clip-path:polygon(0 0,100% 0,100% 65%,80% 65%,80% 100%,20% 100%,20% 65%,0 65%)}.pet-card.trailbound .crest:after{width:18px;height:18px}.pet-card.trailbound .nameplate{border:0;padding:7px 9px}.pet-card.trailbound .card-info{background:#fff;color:#28414a}.pet-card.prism{clip-path:polygon(9% 0,91% 0,100% 6%,100% 94%,91% 100%,9% 100%,0 94%,0 6%);border:0;padding:calc(var(--frame) + 3px);box-shadow:none}.pet-card.prism .card-window{clip-path:polygon(7% 0,93% 0,100% 5%,100% 95%,93% 100%,7% 100%,0 95%,0 5%)}.pet-card.prism .frame-inset{inset:4px;border-width:3px;clip-path:polygon(7% 0,93% 0,100% 5%,100% 95%,93% 100%,7% 100%,0 95%,0 5%)}.pet-card.prism .crest{top:3px;width:34px;height:34px}.pet-card.prism .card-head{top:26px}.pet-card.prism .nameplate{background:#28414a;color:#fff;border:0}.pet-card.prism .corner{clip-path:polygon(0 0,100% 0,100% 100%)}.pet-card.prism .card-info{background:var(--edge-dark);color:#fff;border-top:2px solid var(--edge-light)}.pet-card.starfall{border:3px solid var(--edge-dark);border-radius:12px;background:var(--edge-dark)}.pet-card.starfall .frame-inset{inset:5px;border-radius:7px}.pet-card.starfall .card-window{border:2px solid var(--edge-light);border-radius:3px}.pet-card.starfall .corner{background:var(--edge-light);width:27px;height:27px;clip-path:polygon(0 0,100% 0,100% 25%,45% 25%,45% 45%,25% 45%,25% 100%,0 100%)}.pet-card.starfall .tr{transform:rotate(90deg)}.pet-card.starfall .bl{transform:rotate(-90deg)}.pet-card.starfall .br{transform:rotate(180deg)}.pet-card.starfall .crest{background:var(--edge-light);top:-18px;width:45px;height:45px;clip-path:polygon(50% 0,64% 33%,100% 37%,73% 60%,80% 100%,50% 79%,20% 100%,27% 60%,0 37%,36% 33%)}.pet-card.starfall .crest:after{background:var(--edge-dark);width:26px;height:26px}.pet-card.starfall .card-head{top:16px}.pet-card.starfall .nameplate{background:#28414a;color:#fff;border:1px solid var(--edge-light);padding:9px 12px}.pet-card[data-owned="preview"] .card-art{filter:grayscale(1);opacity:.5}.pet-card[data-owned="secret"] .card-art{filter:brightness(0);opacity:.9}.pet-card[data-owned="secret"] .card-window{background:#dce5e7}.locked-text{position:absolute;top:49%;left:12px;right:12px;text-align:center;background:#f4f7f8;color:#28414a;padding:10px;font-weight:850;z-index:6}.companion-page{height:100%;display:grid;place-items:center;background:#b6e5c9;position:relative;overflow:hidden}.companion-page:before{content:'';position:absolute;height:38%;bottom:0;left:0;right:0;background:#6dca86;border-top:4px solid #4f9961}.companion-sprite{width:72%;aspect-ratio:1;object-fit:contain;image-rendering:pixelated;z-index:1}.companion-caption{position:absolute;bottom:92px;left:10px;right:10px;font-size:12px;font-weight:800;text-align:center;background:#f4f7f8;padding:7px}.page-dots{display:flex;justify-content:center;gap:4px;margin:10px}.page-dots button{width:44px;height:44px;border:0;background:transparent;position:relative}.page-dots button:after{content:'';position:absolute;width:8px;height:8px;border-radius:50%;background:#91a3aa;top:18px;left:18px}.page-dots button[aria-pressed=true]:after{background:#28414a;width:12px;height:12px;top:16px;left:16px}.stage-note{text-align:center;font-size:13px;color:#526b74;margin:0 0 20px}.controls{position:sticky;top:20px}.controls>.control:first-child{margin-top:0}.control-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px}.control-note{font-size:13px;color:#526b74;margin-top:-5px}.control output{float:right;font-weight:500}.check{display:flex;align-items:center;gap:8px;min-height:44px;font-weight:750;font-size:14px}.check input{width:18px;height:18px;accent-color:#138fc4}.save-status{font-size:12px;margin:16px 0 0;color:#526b74}.section-heading{display:flex;justify-content:space-between;gap:20px;align-items:baseline;margin-bottom:26px}.section-heading p{font-size:14px;margin:0}.rarity-section,.directions-section,.saved-section{margin-top:55px}.rarity-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:30px}.rarity-example{max-width:245px;margin:auto;width:100%}.rarity-example>p{font-size:14px;margin:16px 0 0;font-weight:850}.rarity-example>small{display:block;font-size:12px;color:#526b74;margin-top:4px}.direction-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:40px}.direction-example{display:grid;justify-items:center;gap:18px}.direction-example .card-holder{max-width:240px}.direction-example h3{margin:0}.direction-example p{font-size:14px;max-width:32ch;margin:0}.direction-example .button{width:100%}.preset-item{padding:14px 0;border-bottom:1px solid #91a3aa;display:flex;gap:10px;align-items:center;justify-content:space-between}.preset-item span{font-weight:750}.empty-presets{font-size:14px;color:#526b74}.research{max-width:85ch;font-size:14px;margin-top:40px}.pet-card.revealing{animation:card-arrival .9s cubic-bezier(.16,1,.3,1)}.pet-card.revealing .particles{animation:particle-arrival 1s cubic-bezier(.16,1,.3,1)}@keyframes foil-sweep{0%,20%,100%{background-position:0% 0%}65%{background-position:100% 100%}}@keyframes edge-sweep{0%,100%{filter:hue-rotate(0deg)}50%{filter:hue-rotate(90deg)}}@keyframes star-twinkle{0%,100%{opacity:.2;transform:scale(.55) rotate(var(--r))}40%{opacity:1;transform:scale(1) rotate(var(--r))}75%{opacity:.45;transform:scale(.8) rotate(var(--r))}}@keyframes card-arrival{0%{transform:translateY(45px) scale(.82);filter:saturate(.4)}60%{transform:translateY(-8px) scale(1.025);filter:saturate(1.1)}100%{transform:translateY(0) scale(1);filter:saturate(1)}}@keyframes particle-arrival{0%{transform:scale(.5);opacity:0}40%{opacity:1}100%{transform:scale(1);opacity:1}}@media(max-width:1000px){.studio-workbench{grid-template-columns:minmax(0,1fr) 310px;gap:20px}.main-stage{min-height:570px}.card-holder{max-width:300px}.rarity-grid{gap:20px}}@media(max-width:760px){.studio-title{display:block}.studio-title>.row{justify-content:flex-start;margin-top:18px}.studio-workbench{grid-template-columns:1fr}.controls{position:static}.main-stage{min-height:580px}.section-heading{display:block}.rarity-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:32px 22px}.direction-grid{grid-template-columns:1fr}.direction-example{grid-template-columns:140px 1fr;justify-items:start;gap:12px 24px}.direction-example .card-holder{grid-row:1/5;max-width:140px}.direction-example .button{font-size:13px}.direction-example p{font-size:13px}.pet-card.revealing{animation-duration:.8s}}@media(max-width:380px){.main-stage{min-height:525px;padding:38px 22px}.card-holder{max-width:270px}.specimen-toolbar{font-size:13px}.specimen-toolbar .button{font-size:13px;padding:9px}.direction-example{grid-template-columns:120px 1fr;gap:12px}.control-pair{gap:9px}.rarity-grid{gap:26px 16px}}@media(prefers-reduced-motion:reduce){.pet-card[data-motion="false"],.pet-card[data-motion="false"] *{animation:none!important;transition:none!important}.pet-card[data-motion="false"]{transform:none}}
.companion-pair{display:flex;align-items:flex-end;justify-content:center;width:100%;position:relative;z-index:2;margin-top:-30px}.avatar-sprite{width:46%;image-rendering:pixelated}.walking-sprite{width:44%;image-rendering:pixelated;margin-left:-14px}.pet-card .particles{opacity:var(--foil-opacity)}
.pet-card[data-owned="secret"] .card-art.secret-art{object-fit:contain;padding:12%;background:transparent}

.card-art:not(.original):not(.secret-art){transform:scale(1.12);transform-origin:50% var(--crop,50%)}
.json-panel{margin-bottom:25px}.json-panel[hidden]{display:none}.json-panel textarea{width:100%;min-height:190px;border:2px solid #91a3aa;padding:12px;background:white;font:13px/1.5 ui-monospace,monospace;resize:vertical}.json-panel textarea:focus-visible{outline:3px solid #138fc4;outline-offset:3px}.json-panel p{font-size:14px}

/* Keep Prism's star field inside its cut silhouette and away from the pet's face. */
.pet-card.prism .particles{inset:4px}
.pet-card.prism .particles i:nth-child(9){left:1%}
.pet-card.prism .particles i:nth-child(10){left:96%}
.card-open{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;background:transparent;z-index:8}
.card-open:focus-visible{outline:3px solid #28414a;outline-offset:-8px;box-shadow:inset 0 0 0 5px #fff}
.pet-card[data-in-view="false"],.pet-card[data-in-view="false"] *,html[data-card-document-hidden="true"] .pet-card,html[data-card-document-hidden="true"] .pet-card *{animation-play-state:paused!important}
@container (max-width:180px){
 .card-head{left:6px;right:6px;gap:4px}
 .nameplate,.pet-card.prism .nameplate,.pet-card.starfall .nameplate,.pet-card.trailbound .nameplate{font-size:12px;padding:6px 5px}
 .new-stamp{padding:5px 3px;font-size:7px}
 .card-info{padding:8px}
 .card-collection{display:none}
 .rarity-label{gap:5px;font-size:10px;letter-spacing:.02em}
 .rarity-mark{width:12px;height:12px;flex-shrink:0}
 .rare .rarity-mark{width:10px;height:10px;margin:1px}
}
