@font-face{font-family:"Card Mincho";src:url("card-mincho.woff?v=17") format("woff");font-display:swap;font-weight:100 900}
:root{color-scheme:dark;--bg:#101112;--ink:#f2f2ef;--muted:#8d9094;--line:#2b2d30;--accent:#e9d3a7}
body{background:var(--bg);font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased}
body:before,.arena:before,.portrait:before,.sigil,.step,.edition,.notice,.portrait .eyebrow,.portrait .hint,.section> .hint,#modeHint,#analysisPanel,#photoStatus,#cardName,#resultDetail,#photoResult,#shineDescription,#sensorMeter,#lightStatus,#typeBadge,#reveal{display:none!important}
header{max-width:1160px;padding:27px 36px;border:0}.brand{font-size:13px;font-weight:750;letter-spacing:2px;gap:11px}.logo{width:17px;height:23px;border:1.5px solid #d6c09a;border-radius:3px;transform:rotate(-9deg);color:#d6c09a}.logo span{font-size:11px}.brand small{display:none}
main{max-width:1100px;padding:22px 36px 48px}.workspace{grid-template-columns:minmax(300px,.9fr) minmax(340px,1.1fr);gap:64px;align-items:start}.editor{background:transparent;border:0;border-radius:0;overflow:visible}.section{padding:0 0 28px;border:0}.sectiontitle{font-size:12px;font-weight:650;letter-spacing:.05em;color:#bfc1c4;margin-bottom:11px}
input[type=text]{padding:15px 16px;border:1px solid var(--line);border-radius:12px;background:#191a1c;font-size:17px;transition:border-color .2s,background .2s}input[type=text]:focus{border-color:#b7a384;background:#1d1e20;outline:none}input::placeholder{color:#61656a}button,input,select,summary,a{-webkit-tap-highlight-color:transparent}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible{outline:2px solid var(--accent);outline-offset:4px}.twocol{gap:10px}
.btn{border:1px solid #35373b;background:#202225;border-radius:12px;padding:13px 14px;min-height:49px;font-size:13px;font-weight:600;box-shadow:none;transition:background .2s,border-color .2s,transform .2s}.btn:hover{background:#2a2d31;border-color:#4c5056}.btn:active{transform:scale(.97)}.primary{background:#ead9b8;color:#282218;border-color:#ead9b8}.primary:hover{background:#f4e4c7;border-color:#f4e4c7}button:disabled{opacity:.35}.hint,label{color:var(--muted);font-size:11px}
.photo-kind{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:14px}select{font:12px system-ui;color:#b7babe;border:1px solid var(--line);border-radius:8px;background:#191a1c;padding:8px 28px 8px 10px;max-width:160px}#kindStatus{flex:1;font-size:11px;min-width:140px}#savePhoto{border:0;background:none;padding:3px 0;min-height:0;color:#8d9094;font-size:11px;margin:0!important}#savePhoto:hover{color:#ddd}.adjust{padding:0;border:0;margin-top:16px}.adjust summary,.original-saves summary{cursor:pointer;list-style:none;color:#9b9ea3;font-size:11px;padding:8px 0;width:fit-content}.adjust summary::after,.original-saves summary::after{content:'＋';margin-left:8px;color:#757980}.adjust[open] summary::after,.original-saves[open] summary::after{content:'−'}summary::-webkit-details-marker{display:none}label{margin-top:9px}input[type=range]{height:18px}
.portrait{min-height:0;aspect-ratio:1;border:1px solid #2a2c30;border-radius:20px;background:#181a1d;padding:20px;box-shadow:none}.portrait canvas{width:100%;max-width:none;aspect-ratio:1;border:0;border-radius:12px;box-shadow:none}.placeholder{width:100%;height:100%;color:#535860}.placeholder svg{width:42px;height:42px;stroke:currentColor}.portrait .placeholder .hint{display:block!important;margin:16px 0 0;font-size:12px;color:#656a72}
.deck-zone{padding:12px 0 0;background:none}.deck-button{width:128px;height:187px;transform:rotate(-6deg);transition:transform .35s cubic-bezier(.2,.8,.2,1),filter .35s;filter:drop-shadow(0 14px 18px #0003)}.deck-button:not(:disabled):hover{transform:translateY(-6px) rotate(-3deg)}.deck-button:not(:disabled):active{transform:translateY(-2px) rotate(-3deg) scale(.98)}.deck-button canvas{box-shadow:0 10px 25px #0006}.deck-zone .eyebrow{display:none}.deck-zone>.hint{font-size:11px;letter-spacing:.08em;margin-top:22px;color:#b9b5ae}.deck-extracted{background:url('assets/card-back.jpg') center/100% 100%;border:0;box-shadow:0 18px 32px #0008}.dealing .deck-extracted{animation:extract .65s cubic-bezier(.35,0,.18,1) both}@keyframes extract{0%{transform:translate(0,0);opacity:1}38%{transform:translate(5px,-40px) rotate(2deg);opacity:1}78%{transform:translate(16px,-105px) rotate(5deg) scale(1.04);opacity:1}100%{transform:translate(25px,-155px) rotate(7deg) scale(1.06);opacity:0}}
#inputMessage:empty,#message:empty{display:none}#inputMessage,#message{font-size:11px;text-align:center;margin:14px 0 0;color:#d8c6a5}.section,.workspace>.portrait,.workspace>div:last-child{animation:enter .6s ease both}.section:nth-child(2){animation-delay:.08s}.section:nth-child(3){animation-delay:.16s}.workspace>div:last-child{animation-delay:.12s}@keyframes enter{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
.result{max-width:600px}.result h1{font-family:system-ui,sans-serif;font-weight:500;font-size:13px;color:#a7a9ae;letter-spacing:.06em;margin:0 0 22px;outline:none}.arena{padding:0 24px 26px;min-height:0;perspective:1600px}.flipcard{width:min(100%,350px);max-width:none;transform:rotate(-2deg) rotateX(var(--rx)) rotateY(var(--ry));will-change:transform}.flipcard.revealed{transform:rotateY(180deg) rotate(1deg) rotateX(var(--rx)) rotateY(var(--ry));transition:transform .16s ease-out}.flipcard.turning{transition:transform 1.05s cubic-bezier(.22,.7,.2,1)}.arena .flipcard.arriving{animation:arrive .7s cubic-bezier(.16,1,.3,1)}@keyframes arrive{from{opacity:0;translate:0 52px;scale:.95}to{opacity:1;translate:0 0;scale:1}}.face{border-radius:5px;overflow:visible;box-shadow:0 24px 55px #0008}.face canvas{border-radius:5px}.front{background:none!important;isolation:auto}.front .foil-canvas{display:none!important}.resultactions{max-width:350px}.resultmeta{margin:0 0 12px;gap:6px}.badge{border:0;background:none;color:#c0bba9;border-radius:0;font-size:10px;letter-spacing:.12em;padding:0}.result[data-rarity=secret] .badge:first-child{color:#d9c9ee}.result[data-rarity=ultra] .badge:first-child{color:#e9ce93}.tilt-tools{display:flex;justify-content:center;margin:0}.tilt-button{min-height:0;border:0;background:none;padding:7px 12px;color:#a5a8ad;font-size:11px;margin:0}.tilt-button:hover{background:#202225}.tilt-button[aria-pressed=true]{color:#e7d1aa}#tiltStatus{margin:3px auto 11px;max-width:310px;font-size:10px}#tiltStatus:empty{display:none}#resultInfo{animation:actions-in .45s .6s both}@keyframes actions-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.resultactions>.twocol,#resultInfo>.twocol{display:block;margin:8px 0 0}#download{width:100%}.original-saves{margin-top:10px}.original-saves summary{margin:auto}.original-saves .btn{font-size:11px;min-height:40px;padding:9px 8px}#redraw{background:none;border:0;color:#8d9094;min-height:40px;padding:10px;font-size:11px;margin:4px 0 0;width:auto}#redraw:hover{color:#e3e3de}.result.reveal-burst .arena:before{display:none}
dialog{color:var(--ink);background:#1c1e21;border:1px solid #383b40;border-radius:20px;padding:20px;box-shadow:0 35px 90px #0007}dialog[open]{animation:dialog-in .25s ease-out}dialog::backdrop{background:#000b;backdrop-filter:blur(8px)}@keyframes dialog-in{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.modalbar{align-items:center;margin-bottom:16px}.modalbar strong{font-size:13px;font-weight:600}.close{color:#9da1a7;line-height:1;width:32px;height:32px;border-radius:8px}.close:hover{background:#2d3035;color:#fff}video{transform:none;border-radius:12px;background:#111}#savedImage{-webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important;touch-action:auto;transform:none;border-radius:4px}#saveDialog{max-height:92svh;overflow:auto}#saveDialog p{font-size:11px;color:#9da1a7}#saveLink,#openSavedImage,#saveToPhotos{width:100%;text-decoration:none}#openSavedImage{display:flex;background:none;border:0;font-size:11px;min-height:35px}#saveToPhotos{background:#202225}.dialogactions{flex-wrap:wrap}
@media(max-width:750px){header{padding:23px 22px 20px}.brand{font-size:11px;letter-spacing:1.8px}main{padding:10px 22px 30px}.workspace{grid-template-columns:1fr;gap:0}.editor{display:contents}.section{padding-bottom:23px}.section:nth-child(1){order:1}.section:nth-child(2){order:2}.workspace>div:last-child{order:3}.section:nth-child(3){order:4;padding-bottom:0}.portrait{aspect-ratio:1;max-width:350px;margin:auto;padding:12px;border-radius:16px}.portrait canvas{max-width:none;border-radius:8px}.portrait:has(canvas[hidden]){aspect-ratio:auto;min-height:118px}.placeholder{display:flex;flex-direction:row;gap:14px}.placeholder svg{width:28px;height:28px}.portrait .placeholder .hint{margin:0}.deck-zone{padding-top:27px}.deck-button{width:105px;height:153px}.deck-zone>.hint{margin-top:20px}.result h1{margin:0 0 18px;font-size:12px}.arena{padding:0 12px 23px}.flipcard{width:min(78vw,330px);max-width:none}.resultactions{max-width:330px}.btn{min-height:47px}.photo-kind{margin-top:11px}.sectiontitle{margin-bottom:9px}.original-saves .twocol{margin:7px 0}.resultactions .large{margin-bottom:0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.flipcard{will-change:auto}}
#archiveTrigger{cursor:pointer;user-select:none;width:fit-content}#collectionDialog{width:min(94vw,1020px);height:min(90svh,900px);max-height:90svh;padding:24px;overflow:auto}#collectionDialog .modalbar{position:sticky;top:-24px;background:#1c1e21;padding:18px 0;margin-top:-18px;z-index:1}#collectionStatus{font-size:12px;text-align:center;color:#969ba3;margin-top:28px}#collectionStatus:empty{display:none}#collectionGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:26px 18px}.collection-card{background:none;border:0;text-align:left;color:var(--ink);padding:0;min-width:0;transition:transform .25s ease;animation:enter .4s ease both}.collection-card:hover{transform:translateY(-5px)}.collection-card img{display:block;width:100%;height:auto;aspect-ratio:59/86;border-radius:4px;box-shadow:0 10px 24px #0004}.collection-title{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:9px}.collection-rarity{display:block;font-size:9px;color:#999dA5;margin-top:3px}@media(max-width:750px){#collectionDialog{padding:18px;border-radius:16px}#collectionDialog .modalbar{top:-18px}#collectionGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 13px}.collection-title{font-size:10px}.collection-rarity{font-size:9px}}
.collection-tabs{display:flex;gap:5px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;margin:0 0 24px;padding:0 0 3px}.collection-tabs::-webkit-scrollbar{display:none}.collection-tabs button{flex-shrink:0;border:1px solid transparent;color:#999fa7;font-size:12px;background:none;padding:9px 14px;border-radius:9px;transition:background .2s,color .2s}.collection-tabs button:hover{color:#ededeb;background:#282b30}.collection-tabs button[aria-selected=true]{color:#f0e5d0;background:#35312b;border-color:#645843}#collectionGrid:focus-visible{outline:2px solid var(--accent);outline-offset:4px}@media(max-width:750px){.collection-tabs{gap:3px;margin-bottom:18px}.collection-tabs button{font-size:11px;padding:8px 12px}}
/* A quiet duel table: lacquer, engraved gold and the six OCG frame colours. */
:root{--bg:#100e12;--ink:#f2ebdc;--muted:#a19a91;--line:#4a3d2d;--accent:#e1ba70}body{background:linear-gradient(120deg,#19111d 0%,#100e12 42%,#15100e 100%);background-attachment:fixed}header{border-bottom:1px solid #b78a3e30;margin-bottom:22px}.brand{font-family:var(--mincho);font-size:16px;letter-spacing:2.5px;color:#e3bd78}.logo{width:23px;height:27px;border:0;transform:none;color:#e6c586;background:none}.logo span{display:none}.logo::after{content:'';display:block;width:22px;height:22px;background:currentColor;clip-path:polygon(50% 0,100% 100%,0 100%);mask:linear-gradient(#000 0 0)}.sectiontitle{font-family:var(--mincho);color:#d1b98b;font-size:13px;letter-spacing:.15em}input[type=text]{background:linear-gradient(120deg,#211b22,#171317);border-color:#6c5336;border-radius:5px;color:#f2dfb8;font-family:var(--mincho);box-shadow:inset 0 0 0 3px #100d12,0 2px 0 #0004}input[type=text]:focus{background:#251c27;border-color:#b69557}input::placeholder{color:#8e7a60}.btn{border-radius:5px;border-color:#735a38;background:linear-gradient(135deg,#2a202d,#1b141d);color:#daceb8}.btn:hover{background:#37283b;border-color:#b18c52}.primary{color:#2a190b;background:linear-gradient(120deg,#f1deb3,#d5af67);border-color:#ddbc7d;box-shadow:inset 0 0 0 2px #8b602622}.primary:hover{background:linear-gradient(120deg,#faebc9,#eac686)}select{background:#201920;color:#d2bf9e;border-color:#604a30;border-radius:4px;font-size:11px;padding:8px 24px 8px 10px;max-width:190px}.photo-kind{gap:9px}.photo-kind #kindStatus{flex-basis:100%;color:#9e8c70}.portrait{border-radius:5px;padding:15px;border:1px solid #987441;background:linear-gradient(140deg,#27202c,#171219);box-shadow:inset 0 0 0 4px #100d12,inset 0 0 0 5px #55402c,0 18px 40px #0003}.portrait canvas{border-radius:1px;border:1px solid #74644f}.placeholder{color:#9c7847}.portrait .placeholder .hint{color:#a08d72;font-family:var(--mincho)}.deck-zone>.hint{color:#d1b787;font-family:var(--mincho);letter-spacing:.18em}.deck-button:not(:disabled){filter:drop-shadow(0 16px 22px #0006)}.adjust summary,.original-saves summary,#savePhoto{color:#a18d6a}.result h1{font-family:var(--mincho);letter-spacing:.18em;color:#d2b989}.result[data-rarity=secret] .badge{color:#ddc2ff}.badge{font-family:var(--mincho);color:#c7ac75}.tilt-button{color:#b29b79;background:none;border:0;box-shadow:none}.tilt-button:hover{background:#2a202d}.tilt-button[aria-pressed=true]{color:#ecd3a1}#redraw{color:#ad9675;background:none;border:0;box-shadow:none}dialog{background:linear-gradient(140deg,#251b29,#171218);border-color:#9c7847;border-radius:7px}.modalbar strong{font-family:var(--mincho);color:#e4c68c}#collectionDialog .modalbar{background:#251b29}.collection-tabs button{border-radius:4px;color:#b2a18b}.collection-tabs button[aria-selected=true]{background:#403023;border-color:#a17b46;color:#f0d8a4}.collection-tabs button[data-kind=normal][aria-selected=true]{border-color:#c3a36c}.collection-tabs button[data-kind=effect][aria-selected=true]{border-color:#c38953}.collection-tabs button[data-kind=fusion][aria-selected=true]{border-color:#ad83cd;background:#37283f}.collection-tabs button[data-kind=ritual][aria-selected=true]{border-color:#7cb1d0;background:#20313e}.collection-tabs button[data-kind=spell][aria-selected=true]{border-color:#71b29a;background:#1e342e}.collection-tabs button[data-kind=trap][aria-selected=true]{border-color:#d397b7;background:#3b2535}.collection-title{font-family:var(--mincho);color:#e5d2ac}.collection-rarity{color:#a08b6e}#saveToPhotos{background:#2a202d}#openSavedImage{background:none}@media(max-width:750px){header{margin-bottom:16px;padding:21px 22px 18px}.brand{font-size:14px;letter-spacing:2px}.portrait{border-radius:4px;padding:11px}.portrait canvas{border-radius:1px}.photo-kind select{max-width:calc(50% - 5px)}#collectionDialog{border-radius:7px}}
.logo::after{display:none}.logo svg{width:26px;height:30px;display:block;filter:drop-shadow(0 1px 0 #674516)}
.collection-sort{display:flex;justify-content:flex-end;margin:0 0 16px}.collection-sort select{max-width:none;min-width:155px;color:#d6bf95;font-size:11px;padding:8px 28px 8px 11px}.collection-sort select:disabled{opacity:.4}

:root{--mincho:"Card Mincho","Hiragino Mincho ProN","Yu Mincho","YuMincho","Noto Serif JP",serif}body,button,input,select,option,textarea,.eyebrow,.edition,.step,.sensor-meter span{font-family:var(--mincho)}
.collection-sort{justify-content:space-between;align-items:center;gap:12px}.collection-sort .tilt-button{padding:4px 0;font-size:10px;min-height:30px}#collectionGrid{perspective:1200px}.archive-surface{position:relative;display:block;aspect-ratio:59/86;isolation:isolate;transform:rotateX(var(--archive-rx,0deg)) rotateY(var(--archive-ry,0deg));transform-origin:center;border-radius:4px;overflow:hidden}.archive-surface>img{width:100%;height:100%;object-fit:contain;margin:0}.archive-art-foil,.archive-name-foil,.archive-gloss-foil{position:absolute;inset:0;pointer-events:none;mix-blend-mode:screen}.archive-art-foil{display:none;clip-path:inset(18.55% 12.3% 29.82% 12.45%);background:radial-gradient(ellipse at var(--archive-x,50%) var(--archive-y,45%),#fffbe790,#a6fff34a 22%,transparent 62%),linear-gradient(125deg,transparent 10%,#88bdff26 26%,#a5fff566 39%,#f9ffa960 48%,#ffc5ed60 60%,#bba2ff25 73%,transparent 90%);background-size:100% 100%,220% 180%;background-position:0 0,var(--archive-x,50%) var(--archive-y,45%);filter:hue-rotate(var(--archive-hue,0deg))}.archive-surface[data-rarity=super] .archive-art-foil,.archive-surface[data-rarity=ultra] .archive-art-foil,.archive-surface[data-rarity=secret] .archive-art-foil{display:block}.archive-surface[data-rarity=secret] .archive-art-foil::after{content:'';position:absolute;inset:0;background:repeating-linear-gradient(45deg,transparent 0 3px,#e2d5ff55 3.3px 3.8px,transparent 4px 6px);background-position:var(--archive-x,50%) var(--archive-y,45%);background-size:180% 180%;opacity:.45}.archive-name-foil{display:none;mask-image:var(--archive-name-mask);-webkit-mask-image:var(--archive-name-mask);mask-size:100% 100%;-webkit-mask-size:100% 100%;background:linear-gradient(110deg,#76818c 10%,#fff 48%,#8796a3 70%);background-size:230% 100%;background-position:var(--archive-x,50%) 0}.archive-surface[data-rarity=rare] .archive-name-foil,.archive-surface[data-rarity=ultra] .archive-name-foil,.archive-surface[data-rarity=secret] .archive-name-foil{display:block}.archive-surface[data-rarity=ultra] .archive-name-foil{background-image:linear-gradient(110deg,#81500d 10%,#fff2b7 48%,#d4a63a 70%)}.archive-surface[data-rarity=secret] .archive-name-foil{background-image:linear-gradient(110deg,#e0baff,#b3fbec,#fff5bb,#ffc6f6,#c3bdff);filter:hue-rotate(var(--archive-hue,0deg))}.archive-gloss-foil{background:radial-gradient(ellipse at var(--archive-x,50%) var(--archive-y,45%),#ffffff14,transparent 70%)}#savedSurface{max-width:100%;margin:auto}#savedSurface.archive-surface{width:min(100%,calc(65svh * 59 / 86));max-height:65svh}#savedSurface.archive-surface #savedImage{width:100%;height:100%;max-height:none;object-fit:contain}#savedSurface.archive-surface .archive-art-foil{opacity:.8}.collection-card{perspective:900px}.collection-card:active .archive-surface{scale:.99}@media(prefers-reduced-motion:reduce){.archive-surface{transform:none}}
#saveDialog{perspective:1100px}#savedSurface.archive-surface{transform:rotateX(calc(var(--archive-rx,0deg) * 1.7)) rotateY(calc(var(--archive-ry,0deg) * 1.7));overflow:visible;box-shadow:0 18px 34px #0006}.archive-detail-canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;border-radius:4px}.modalbar #previewTilt{font-size:10px;min-height:30px;margin-left:auto;margin-right:8px;white-space:nowrap}.modalbar #saveTitle{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.archive-surface[data-rarity=secret] .archive-name-foil,.archive-surface[data-rarity=prismatic] .archive-name-foil{background-image:linear-gradient(110deg,#758393 5%,#fff 42%,#dce8fb 58%,#8594a6 80%);filter:none}.archive-surface[data-rarity=secret] .archive-art-foil::after,.archive-surface[data-rarity=prismatic] .archive-art-foil::after{content:'';position:absolute;inset:0;background-image:repeating-linear-gradient(45deg,transparent 0 3px,#d1e8ff88 3.2px 3.7px,transparent 4px 6px),repeating-linear-gradient(-45deg,transparent 0 3px,#ffe9da77 3.2px 3.7px,transparent 4px 6px),radial-gradient(ellipse at var(--archive-x,50%) var(--archive-y,45%),#fff8d8a0,transparent 58%);background-size:160% 160%;background-position:var(--archive-x,50%) var(--archive-y,45%);opacity:.75}.archive-surface[data-rarity=prismatic] .archive-art-foil,.archive-surface[data-rarity=prismatic] .archive-name-foil{display:block}.archive-surface[data-rarity=prismatic] .archive-art-foil{clip-path:inset(2.5% 3.6%)}.archive-surface[data-variant=overframe] .archive-art-foil{clip-path:inset(10.75% 5.42% 28.08%)}.archive-surface[data-variant=overframe][data-rarity=prismatic] .archive-art-foil{clip-path:inset(2.5% 3.6%)}.result[data-rarity=prismatic] .badge{color:#e5c7fc}

.archive-surface:not([data-rarity=normal]):not([data-rarity=rare]) .archive-art-foil{display:block}.archive-surface:not([data-rarity=normal]):not([data-rarity=super]) .archive-name-foil{display:block}.archive-surface:is([data-rarity=ultimate],[data-rarity=collector],[data-rarity=extra],[data-rarity=quarter],[data-rarity=holographic]) .archive-art-foil{clip-path:inset(2.5% 3.6%)}.archive-surface:is([data-rarity=ultimate],[data-rarity=collector]) .archive-art-foil::after{content:'';position:absolute;inset:0;background:repeating-radial-gradient(ellipse at var(--archive-x,50%) var(--archive-y,45%),#efffe960 0 .5px,#414e3918 1px,transparent 1.5px 3px)}.archive-surface:is([data-rarity=ultra],[data-rarity=ultimate],[data-rarity=gold],[data-rarity=goldsecret],[data-rarity=premiumgold],[data-rarity=quarter]) .archive-name-foil{background-image:linear-gradient(110deg,#81500d 10%,#fff2b7 48%,#d4a63a 70%)}.archive-surface:is([data-rarity=extra],[data-rarity=quarter],[data-rarity=goldsecret]) .archive-art-foil::after{content:'';position:absolute;inset:0;background:repeating-linear-gradient(45deg,transparent 0 2px,#fff9b780 2.5px 3px),repeating-linear-gradient(-45deg,transparent 0 2px,#d5edff60 2.5px 3px);background-size:150% 150%;background-position:var(--archive-x,50%) var(--archive-y,45%)}.archive-surface:is([data-rarity=gold],[data-rarity=goldsecret],[data-rarity=premiumgold]){outline:1px solid #e4c267}.archive-surface[data-rarity=holographic] .archive-art-foil{background:linear-gradient(110deg,transparent,#dbe9edcc,#ffffffd0,#b1c4ceaa,transparent);background-size:230% 100%;background-position:var(--archive-x,50%) 0}

body,body *{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}input,textarea,[contenteditable=true]{-webkit-touch-callout:default;-webkit-user-select:text;user-select:text}.archive-surface{backface-visibility:hidden;-webkit-backface-visibility:hidden}.collection-card img,#savedImage{-webkit-user-drag:none;pointer-events:none}#savedSurface{touch-action:pan-y}

.archive-name-foil{mix-blend-mode:normal;background-image:linear-gradient(110deg,#465666 8%,#a8b8c9 30%,#fff 44%,#63788b 51%,#dfeaff 64%,#506174 80%);filter:drop-shadow(0 .4px .3px #21191099)}.archive-surface:is([data-rarity=ultra],[data-rarity=ultimate],[data-rarity=gold],[data-rarity=goldsecret],[data-rarity=premiumgold],[data-rarity=quarter]) .archive-name-foil{background-image:linear-gradient(110deg,#774812 8%,#d5a343 30%,#fff3ae 44%,#a66f18 51%,#efd58a 64%,#734616 80%)}

/* Collected cards use a brighter moving reflection at thumbnail sizes. */
.archive-art-foil{background-image:radial-gradient(ellipse at var(--archive-x,50%) var(--archive-y,45%),#ffffffb8 0%,#d8ffff66 18%,transparent 48%),linear-gradient(115deg,transparent 15%,#78bdff50 28%,#a4ffeaa0 39%,#fff8dadd 47%,#ffffffef 50%,#ffcfbfc0 54%,#e6acff90 62%,#8fe6ff40 74%,transparent 88%);background-size:100% 100%,250% 180%;background-position:0 0,var(--archive-x,50%) var(--archive-y,45%);filter:hue-rotate(var(--archive-hue,0deg)) saturate(1.6) contrast(1.12);opacity:1}.archive-art-foil::before{content:'';position:absolute;inset:0;background:linear-gradient(115deg,transparent 35%,#fff7bb60 44%,#ffffffd0 49%,#e4eaff75 54%,transparent 66%);background-size:300% 200%;background-position:var(--archive-x,50%) var(--archive-y,45%)}.archive-surface:is([data-rarity=secret],[data-rarity=prismatic],[data-rarity=extra],[data-rarity=quarter],[data-rarity=goldsecret]) .archive-art-foil::after{opacity:1;filter:contrast(1.35) brightness(1.25);mask-image:radial-gradient(ellipse at var(--archive-x,50%) var(--archive-y,45%),#000 0%,#000c 48%,#0002 90%);-webkit-mask-image:radial-gradient(ellipse at var(--archive-x,50%) var(--archive-y,45%),#000 0%,#000c 48%,#0002 90%)}.archive-name-foil{background-size:300% 100%}.archive-surface[data-rarity=holographic] .archive-art-foil{background-image:linear-gradient(110deg,transparent,#c8e2edcc,#ffffffef,#c3d3e5cc,transparent);background-size:250% 100%}

/* v20: edge-lit foil with visibly different physical textures. */
.archive-art-foil{background:radial-gradient(circle at var(--archive-x,90%) var(--archive-y,14%),#fff7b852,transparent 26%),linear-gradient(125deg,transparent 10%,#80aaff20 26%,#91eedc35 39%,#fff1ae40 48%,#f9a5df30 60%,#aab2ff20 73%,transparent 90%);background-size:100% 100%,250% 180%;background-position:0 0,var(--archive-x,90%) var(--archive-y,14%);filter:none;opacity:.7}
.archive-art-foil::before{display:none}.archive-art-foil::after{filter:none!important;opacity:.8!important}
.archive-surface[data-rarity=secret] .archive-art-foil::after{background:repeating-linear-gradient(45deg,transparent 0 4px,#e8f8ff99 4.2px 4.8px,transparent 5px 8px)}
.archive-surface:is([data-rarity=prismatic],[data-rarity=quarter]) .archive-art-foil::after{background:repeating-linear-gradient(45deg,transparent 0 4px,#8affdf88 4.5px 5.5px,transparent 6px 10px),repeating-linear-gradient(-45deg,transparent 0 4px,#ffa0e999 4.5px 5.5px,transparent 6px 10px)}
.archive-surface[data-rarity=extra] .archive-art-foil::after{background:repeating-linear-gradient(45deg,transparent 0 2px,#e3efffa0 2.3px 2.7px),repeating-linear-gradient(-45deg,transparent 0 2px,#e3efff80 2.3px 2.7px)}
.archive-surface:is([data-rarity=ultimate],[data-rarity=collector]) .archive-art-foil{background:radial-gradient(circle at var(--archive-x,90%) var(--archive-y,14%),#ffecc85a,transparent 36%)}
.archive-surface[data-rarity=ultimate] .archive-art-foil::after{background:repeating-radial-gradient(ellipse at 30% 40%,#e5c78b50 0 .6px,#64533430 1px,transparent 1.5px 3px)}
.archive-surface[data-rarity=collector] .archive-art-foil::after{background:radial-gradient(#b8ffe58a .6px,transparent 1px);background-size:3px 3px}
.archive-surface:is([data-rarity=gold],[data-rarity=goldsecret],[data-rarity=premiumgold]) .archive-art-foil{background:radial-gradient(circle at var(--archive-x,90%) var(--archive-y,14%),#ffeac477,transparent 30%);filter:none}
.archive-surface[data-rarity=goldsecret] .archive-art-foil::after{background:repeating-linear-gradient(45deg,transparent 0 4px,#ffdb8daa 4.3px 5px,transparent 5px 8px)}
.archive-surface[data-rarity=premiumgold]{box-shadow:inset 0 0 0 3px #dba83c,inset 0 0 0 4px #fff0ba}
.archive-surface[data-rarity=holographic] .archive-art-foil{background:linear-gradient(110deg,transparent 35%,#90b0c833 46%,#e8f8ff77 50%,#aec5d633 54%,transparent 65%);background-size:250% 100%;background-position:var(--archive-x,90%) 0;filter:none}
.archive-gloss-foil{background:radial-gradient(circle at var(--archive-x,90%) var(--archive-y,14%),#ffffff18,transparent 25%)}
.archive-surface:is([data-rarity=normal],[data-rarity=rare]) .archive-gloss-foil{display:none}
.archive-surface:is([data-rarity=prismatic],[data-rarity=extra],[data-rarity=quarter],[data-rarity=ultimate],[data-rarity=collector]) .archive-art-foil{clip-path:polygon(evenodd,3.6% 2.5%,96.4% 2.5%,96.4% 97.5%,3.6% 97.5%,3.6% 2.5%,7.54% 75.64%,7.54% 94.07%,92.46% 94.07%,92.46% 75.64%,7.54% 75.64%)}

/* v21: upright at rest; only the live reflection layer carries shine. */
.archive-surface{--archive-rx:0deg;--archive-ry:0deg;transform:perspective(700px) rotateX(0deg) rotateY(0deg)}
#savedSurface.archive-surface{transform:perspective(1100px) rotateX(0deg) rotateY(0deg)}
.archive-surface:is([data-rarity=gold],[data-rarity=goldsecret],[data-rarity=premiumgold]){outline:none;box-shadow:none}
.archive-art-foil{mask-image:radial-gradient(circle at var(--archive-x,90%) var(--archive-y,14%),#000 0%,#000a 15%,transparent 55%);-webkit-mask-image:radial-gradient(circle at var(--archive-x,90%) var(--archive-y,14%),#000 0%,#000a 15%,transparent 55%)}
.archive-art-foil::after{background-position:var(--archive-shift,0%) var(--archive-y,14%)!important}

.word-sources{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin:8px 0}.word-sources a{color:#b8a383;font-size:10px;text-decoration:underline;text-underline-offset:3px}

/* Gyro interpolation owns the transform; CSS transitions must not lag behind it. */
.flipcard.revealed:not(.turning),.archive-surface,#savedSurface.archive-surface{transition: none;will-change:transform}
/* Sealed booster pack, horizontal tear, then a face-up card reveal. */
.pack-zone{display:grid;justify-items:center;gap:20px;padding:22px 0 10px}.pack-zone>.hint{font-family:var(--mincho);color:#cfb581;letter-spacing:.12em}.pack-preview,.pack-body{background:repeating-linear-gradient(100deg,#ffffff00 0 7%,#fff8d512 7.5%,#fff0 9%),linear-gradient(120deg,#17101f 0%,#413045 24%,#100d1a 49%,#624334 73%,#18121e 100%);border:1px solid #c8a065;box-shadow:inset 3px 0 5px #ffedd155,inset -4px 0 9px #0009,0 16px 28px #0007;color:#ecd5a1}.pack-preview{position:relative;width:176px;height:266px;padding:24px 12px;border-radius:2px;transform:rotate(-4deg);transition:transform .3s,filter .3s;cursor:pointer;isolation:isolate}.pack-preview:not(:disabled):hover{transform:rotate(0) translateY(-5px);filter:brightness(1.15)}.pack-preview:disabled{cursor:default;opacity:.4}.pack-art{position:relative;display:flex;align-items:center;flex-direction:column;justify-content:center;height:100%;pointer-events:none;overflow:hidden}.pack-art::before,.pack-art::after{content:'';position:absolute;inset:18% -65%;border:1px solid #d9ab6544;transform:rotate(48deg);background:linear-gradient(90deg,#0000,#c78fe014,#0000);z-index:-1}.pack-art::after{transform:rotate(-48deg)}.pack-series{font-size:10px;letter-spacing:.18em;font-family:var(--mincho);text-shadow:0 2px 2px #000}.pack-emblem{width:91%;max-width:165px;flex:1;min-height:0;display:grid;place-items:center;color:#e9c77e;filter:drop-shadow(0 0 13px #ae7b4055)}.pack-emblem svg{width:100%;max-height:100%;height:auto}.pack-title{font-family:var(--mincho);font-size:21px;letter-spacing:.15em;white-space:nowrap;color:#f5d89f;text-shadow:0 2px 5px #000}.pack-subtitle{font:7px system-ui,sans-serif;letter-spacing:.22em;margin-top:5px}.pack-count{font-size:7px;letter-spacing:.12em;margin-top:14px;color:#c3b29a}.pack-crimp{position:absolute;left:-1px;right:-1px;height:23px;background:repeating-linear-gradient(90deg,#978269 0 1px,#f1d7a4 1px 2px,#715742 2px 4px);border:1px solid #ba9662;box-shadow:inset 0 4px 9px #0007}.pack-top{top:-1px;clip-path:polygon(0 7%,100% 0,100% 100%,0 100%)}.pack-bottom{bottom:-1px;clip-path:polygon(0 0,100% 0,100% 96%,0 100%)}
#packDialog{width:min(94vw,560px);max-height:96svh;overflow:auto;padding:22px 26px 24px;text-align:center;background:radial-gradient(ellipse at 50% 40%,#49344877,#130f1b 68%);border-color:#856440}#packDialog::backdrop{background:#07050bf2;backdrop-filter:blur(12px)}.pack-modalbar{display:flex;justify-content:space-between;align-items:center;gap:12px}.pack-kicker{color:#9c8668;font-size:9px;letter-spacing:.2em}#packHeading{font:22px var(--mincho);color:#ecd29c;letter-spacing:.14em;margin:12px 0 2px}.pack-stage{position:relative;height:390px;width:100%;display:grid;place-items:center;isolation:isolate;--tear:0}.pack-wrapper{position:absolute;top:64px;width:230px;height:314px;transform:rotate(-3deg);transition:transform .7s,opacity .6s;z-index:2}.pack-body{position:absolute;inset:36px 0 0;padding:17px 16px 26px;border-top:0;clip-path:polygon(0 0,8% 2%,17% 0,25% 2%,33% 0,42% 2%,51% 0,60% 2%,69% 0,78% 2%,89% 0,100% 2%,100% 100%,0 100%);isolation:isolate}.pack-lid{position:absolute;top:0;left:0;right:0;height:37px;width:100%;padding:0;cursor:ew-resize;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:transform .7s cubic-bezier(.2,.8,.3,1),opacity .7s;transform-origin:right center}.pack-lid:focus-visible{outline:2px solid #fff1c1;outline-offset:5px}.tear-line{position:absolute;left:0;right:0;bottom:0;height:3px;background:#fff0bc;transform-origin:left;transform:scaleX(var(--tear));box-shadow:0 0 14px #ffe6a0}.tear-arrow{position:absolute;top:5px;right:12px;color:#402619;font-size:23px;line-height:1;text-shadow:0 1px #fff8}.pack-stage.cut .pack-lid{transform:translate(66px,-86px) rotate(24deg);opacity:0;pointer-events:none}.pack-halo{position:absolute;width:210px;height:270px;top:69px;background:radial-gradient(ellipse,#efd4a633,#deb27608 60%,#0000 72%);opacity:0;transition:opacity .6s,transform 1.2s}.pack-stage.cut .pack-halo{opacity:1;transform:scale(1.7)}#packCard{position:absolute;top:115px;width:196px;height:auto;aspect-ratio:590/860;border-radius:4px;opacity:0;z-index:1;transform:translateY(85px) scale(.88);transition:transform 1.1s cubic-bezier(.18,.8,.2,1),opacity .3s;box-shadow:0 20px 40px #0008}.pack-stage.ejecting #packCard{opacity:1;transform:translateY(-95px) scale(1.12)}.pack-stage.ejecting .pack-wrapper{transform:translateY(115px) rotate(9deg);opacity:0}.pack-stage[data-rarity=overframe] .pack-halo,.pack-stage[data-rarity=prismatic] .pack-halo{background:conic-gradient(from 0deg,#b7b0ff38,#8cddd838,#f0b8ca38,#d7bd7138,#b7b0ff38);filter:blur(25px)}#packHint{font-size:12px;color:#e2c692;min-height:20px;margin:8px 0}#packStatus{font-size:11px;color:#ac9e88;min-height:18px;line-height:1.6;margin:6px 0 12px}#packAuto{min-height:38px;padding:8px 20px;font-size:11px;background:transparent;border-color:#69523a}#packClose:disabled{opacity:0;pointer-events:none}.pack-result .flipcard.revealed{transform:rotateX(var(--rx)) rotateY(var(--ry));transition:none}.pack-result .flipcard .front{transform:none}.pack-result .flipcard .back{display:none}.pack-result .flipcard.arriving{animation:pack-card-arrive .55s ease-out}@keyframes pack-card-arrive{from{opacity:.2;translate:0 24px;scale:.96}to{opacity:1;translate:0 0;scale:1}}@media(max-width:750px){.pack-preview{width:158px;height:238px}.pack-zone{padding-top:22px}.pack-stage{height:min(390px,53svh);min-height:295px}.pack-wrapper{width:204px;height:282px;top:32px}#packDialog{padding:14px 20px 18px}#packHeading{font-size:20px}#packCard{width:178px;top:95px}.pack-stage.ejecting #packCard{transform:translateY(-73px) scale(1.08)}.pack-body .pack-title{font-size:24px}.pack-body .pack-series{font-size:12px}}@media(prefers-reduced-motion:reduce){.pack-stage.ejecting .pack-wrapper{display:none}.pack-stage.ejecting #packCard{transform:none;top:20px}.pack-halo{display:none}}
/* Uploaded wrapper faces: crop in the layout, keeping both source photographs intact. */
.pack-preview{width:144px;height:276px;padding:0;background:none;border:0;box-shadow:0 20px 30px #0007;transform:rotate(-3deg);overflow:hidden}.pack-photo{position:absolute;inset:0;display:block;pointer-events:none;background-repeat:no-repeat}.pack-photo-front{background-image:url('assets/pack-front-photo.jpg');background-size:212.34% 109.55%;background-position:51.26% 30.56%}.pack-photo-back{background-image:url('assets/pack-back-photo.jpg');background-size:174.19% 130.28%;background-position:44.93% 45.82%;display:none;clip-path:polygon(0 1.5%,100% 0,94% 99%,13% 100%)}.is-back .pack-photo-front{display:none}.is-back .pack-photo-back{display:block}.pack-wrapper{width:184px;height:351px;top:26px}.pack-body{inset:0;width:100%;height:100%;padding:0;background:none;border:0;box-shadow:none;border-radius:0;cursor:pointer;clip-path:polygon(0 12%,100% 12%,100% 100%,0 100%);touch-action:manipulation}.pack-body:disabled{opacity:1;cursor:default}.pack-body:focus-visible{outline:2px solid #ecd29c;outline-offset:4px}.pack-lid{left:0;right:0;top:0;height:12%;background:none;border:0;box-shadow:none;overflow:hidden}.pack-lid .pack-photo{height:833.333%;bottom:auto}.pack-lid .pack-photo-back{clip-path:polygon(0 1.5%,100% 0,94% 99%,13% 100%)}.tear-arrow{color:white;text-shadow:0 1px 3px #000;background:#0005;border-radius:20px;padding:0 6px}.tear-line{z-index:3}.pack-stage.flipping .pack-wrapper{animation:wrapper-turn .38s ease}@keyframes wrapper-turn{0%{transform:rotate(-3deg) rotateY(-75deg)}100%{transform:rotate(-3deg) rotateY(0)}}#packHint{font-size:11px;line-height:1.7}#packStatus:empty{display:none}.pack-result.pack-back-result .flipcard:not(.revealed){transform:rotateX(var(--rx)) rotateY(var(--ry))}.pack-result.pack-back-result .flipcard.revealed{transform:rotateY(180deg) rotateX(var(--rx)) rotateY(var(--ry))}.pack-result.pack-back-result .flipcard .front{transform:rotateY(180deg)}.pack-result.pack-back-result .flipcard .back{display:block}.pack-result.pack-back-result .flipcard.turning{transition:transform 1.05s cubic-bezier(.22,.7,.2,1)}@media(max-width:750px){.pack-preview{width:132px;height:253px}.pack-wrapper{width:164px;height:314px;top:10px}.pack-stage{min-height:335px}#packCard{width:172px;top:95px}.pack-stage.ejecting #packCard{transform:translateY(-73px) scale(1.08)}}
.pack-stage #packCard{width:154px}.pack-stage.ejecting #packCard{transform:translateY(-95px) scale(1.3)}@media(max-width:750px){.pack-stage #packCard{width:136px}.pack-stage.ejecting #packCard{transform:translateY(-73px) scale(1.3)}}
/* Single-screen editorial interface. Card artwork keeps its own Mincho typography. */
:root{color-scheme:light;--bg:#f3f2ed;--ink:#202120;--muted:#787970;--line:#d5d6cd;--accent:#6054d5;--screen-height:100dvh}html,body{height:var(--screen-height);min-height:0;overflow:hidden}body{display:flex;flex-direction:column;background:var(--bg);background-attachment:initial;font:13px/1.5 -apple-system,BlinkMacSystemFont,"Helvetica Neue","Noto Sans JP",sans-serif;color:var(--ink)}header{flex:none;width:100%;max-width:none;height:58px;margin:0;padding:0 4vw;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{font-family:inherit;font-size:12px;letter-spacing:.13em;color:var(--ink)}.logo{color:var(--ink);width:18px;height:20px;transform:none}.header-index{font:10px monospace;color:var(--muted);letter-spacing:.12em}main{width:100%;max-width:1280px;margin:0 auto;flex:1;min-height:0;padding:20px 4vw 12px;overflow:hidden}#inputPage{height:100%;display:flex;flex-direction:column;min-height:0}#inputPage[hidden],#resultPage[hidden]{display:none!important}.screen-intro{display:flex;align-items:center;justify-content:space-between;flex:none;padding-bottom:20px}.screen-kicker{font:9px monospace;color:var(--muted);letter-spacing:.16em}.screen-intro h1{font-family:inherit;font-weight:500;font-size:clamp(24px,3.6vw,46px);line-height:1.2;letter-spacing:-.05em;margin:6px 0 0}.intro-mark{font-size:47px;line-height:1;color:var(--accent)}.workspace{display:grid;grid-template-columns:minmax(235px,300px) minmax(0,1fr);gap:clamp(30px,6vw,90px);align-items:stretch;min-height:0;flex:1}.editor{display:flex;flex-direction:column;gap:20px;min-height:0;padding-top:12px}.section{padding:0!important;margin:0;border:0;animation:none;background:none}.sectiontitle{font-family:inherit;font-size:11px;line-height:1.3;color:var(--ink);letter-spacing:.03em;margin-bottom:9px;display:flex;align-items:center;gap:9px}.step{display:inline!important;font:9px monospace;color:var(--muted);padding-right:4px}input[type=text]{width:100%;height:45px;padding:8px 12px;border:1px solid var(--line);border-radius:7px;background:#e9e9e2;box-shadow:none;font-family:inherit;font-size:16px;color:var(--ink)}input[type=text]:focus{background:#fff;border-color:var(--accent)}input::placeholder{color:#989991}.photo-row{display:flex;gap:12px;align-items:center}.photo-buttons{flex:1;min-width:0}.photo-buttons .twocol{display:flex;flex-direction:column;gap:7px}.btn{font-family:inherit;border-radius:6px;background:#e9e9e2;border:1px solid var(--line);color:var(--ink);box-shadow:none;padding:9px 12px;min-height:39px;font-size:11px}.btn:hover{background:#dfdfd7;border-color:#b4b5a9}.primary{background:#222520;border-color:#222520;color:#f8f8f0}.primary:hover{background:#3b4037;color:#fff}.portrait{width:90px;height:90px;aspect-ratio:1;min-height:0;flex:none;border:0;background:#e5e6de;border-radius:6px;box-shadow:none;padding:5px;margin:0}.portrait:has(canvas[hidden]){min-height:0;aspect-ratio:1}.portrait canvas{width:100%;height:100%;max-width:none;object-fit:contain;border:0;border-radius:3px}.placeholder{display:grid;place-items:center;height:100%;width:100%;gap:0}.placeholder svg{width:28px;height:28px;color:#999b8c}.placeholder .hint{display:none!important}.photo-kind{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:12px}.photo-kind select{width:100%;max-width:none!important;min-width:0;height:32px;font-size:10px;padding:4px 19px 4px 8px;border-color:var(--line);background:#e9e9e2;color:#50534b;border-radius:5px}.photo-kind #kindStatus,#savePhoto{display:none!important}.micro-button{font-family:inherit;font-size:10px;letter-spacing:.01em;color:var(--muted);border:0;background:none;box-shadow:none;padding:6px 0;min-height:30px;cursor:pointer;white-space:nowrap}.micro-button:hover{color:var(--ink)}#adjustOpen{margin-top:4px}.editor-note{font-size:10px;line-height:1.8;color:var(--muted);margin-top:auto;padding-bottom:12px}.pack-hero{position:relative;display:flex;flex-direction:column;justify-content:center;min-height:0;border:1px solid var(--line);border-radius:12px;padding:22px!important;overflow:hidden;background:radial-gradient(ellipse at 50% 50%,#e7e6de 0,#efeee8 70%)}.hero-watermark{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;text-align:center;font-family:Arial,Helvetica,sans-serif;font-size:clamp(90px,12vw,170px);font-weight:800;letter-spacing:-.08em;line-height:.8;color:#dcded3;pointer-events:none}.pack-zone{position:relative;z-index:1;display:grid;grid-template-rows:minmax(0,1fr) auto;justify-items:center;gap:14px;padding:0;height:100%;min-height:0}.pack-preview{height:100%;max-height:360px;aspect-ratio:144/276;width:auto;max-width:70%;border:0;transform:none;align-self:center;box-shadow:0 18px 30px #20252025;filter:none}.pack-preview:not(:disabled):hover{transform:translateY(-4px);filter:brightness(1.06)}.pack-preview:not(:disabled):active{transform:scale(.98)}.pack-preview:disabled{opacity:.55;filter:grayscale(.5)}.pack-zone>.hint{font-family:inherit;font-size:10px;letter-spacing:.06em;color:#737667;margin:0}.screen-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none;height:38px;padding-top:8px;color:#8d8f83;font:8px monospace;letter-spacing:.1em}#inputMessage,#message{font-family:inherit;font-size:10px;color:#9a574c;margin:5px 0 0;text-align:center;position:relative;z-index:2}#modeHint{display:none!important}
/* The reveal gets its own viewport, with all primary actions remaining visible. */
.result{height:100%;max-width:none;display:grid;grid-template-columns:minmax(0,1fr) 250px;grid-template-rows:auto minmax(0,1fr);column-gap:60px;align-items:center;padding:10px 0}.result h1{grid-column:1 / -1;text-align:left;font-family:inherit;color:var(--muted);font-size:12px;margin:0 0 16px;letter-spacing:0}.arena{height:100%;min-height:0;padding:0;display:flex;align-items:center;justify-content:center;overflow:visible}.flipcard{height:100%;max-height:560px;width:auto;max-width:90%;aspect-ratio:1180/1720;margin:0}.resultactions{width:100%;max-width:none;margin:0}.resultmeta{margin:0 0 17px}.badge{color:var(--muted);font-size:10px}.result[data-rarity=secret] .badge:first-child{color:#60549b}.result[data-rarity=ultra] .badge:first-child{color:#8b652b}#cardName{display:block!important;font-family:inherit;font-size:18px;line-height:1.4;color:var(--ink);margin:0 0 16px}.tilt-button{font-family:inherit;color:#757970;background:none;font-size:10px;margin:0;padding:6px}.tilt-button[aria-pressed=true]{color:var(--accent)}.tilt-button:hover{background:#e3e4db}#tiltStatus{font-size:9px;margin:2px 0 8px;max-width:none;color:var(--muted)}.word-sources{margin:6px 0 10px;display:flex;justify-content:center}.word-sources a{color:#858879!important;font-size:9px}.resultactions #download{width:100%;min-height:42px}#redraw{font-size:11px;color:var(--ink);width:100%;padding:9px;border:1px solid var(--line);border-radius:6px;background:transparent;min-height:36px;margin-top:9px}#redraw:hover{background:#e2e3d9}#originalOpen{width:100%;text-align:center;margin-top:5px}#resultInfo{animation:none}#message{grid-column:1/-1}
/* Secondary controls live in dialogs rather than expanding the main canvas. */
dialog{color:#202120;background:#f3f2ed;border-color:#d2d4c8;border-radius:12px}dialog::backdrop{background:#20252099;backdrop-filter:blur(12px)}.modalbar strong{font-family:inherit;color:#30342b}.close{color:#7c8071}.close:hover{background:#e4e6dc;color:#202520}#adjustDialog{max-height:85dvh;width:min(90vw,390px)}#adjustDialog .adjust{margin:0}#adjustDialog .adjust summary{display:none}#adjustDialog label{color:#737967;font-size:12px}#adjustDialog input[type=range]{accent-color:var(--accent)}#saveDialog p{color:#747a6a}#collectionDialog .modalbar{background:#f3f2ed}.collection-tabs button{color:#767b6b;background:transparent}.collection-title{color:#34392d}.collection-rarity{color:#838774}#originalDialog .twocol{display:flex;flex-direction:column;gap:9px}
/* Opening scene: same upright pack, automatically scaled to the available height. */
#packDialog{height:min(690px,92dvh);max-height:92dvh;width:min(92vw,520px);display:none;grid-template-rows:auto auto minmax(0,1fr) auto auto auto;gap:6px;overflow:hidden;padding:18px 24px 20px;background:#f3f2ed;border-color:#d2d4c8}#packDialog[open]{display:grid}#packDialog::backdrop{background:#e5e6dcdd}.pack-kicker{color:#8a8d7e;font-size:8px}#packHeading{font-family:inherit;font-size:22px;color:#30342b;margin:8px 0;letter-spacing:-.03em}.pack-stage{height:100%;min-height:0;width:100%;perspective:1000px}.pack-wrapper{height:84%;max-height:351px;width:auto;aspect-ratio:184/351;top:8%;transform:none}.pack-stage.ejecting .pack-wrapper{transform:translateY(80px);opacity:0}.pack-stage.flipping .pack-wrapper{animation:wrapper-turn-straight .38s ease}@keyframes wrapper-turn-straight{from{transform:rotateY(-75deg)}to{transform:rotateY(0)}}#packHint{color:#767c6c;font-family:inherit;font-size:10px;min-height:15px;margin:4px 0}#packStatus{color:#ad6751;font-size:10px;margin:0}.tear-arrow{font-family:system-ui}#packAuto{font-family:inherit;background:#222520;color:#f4f5ec;border:0;min-height:38px}#packCard{top:26%;width:auto!important;height:65%;max-height:270px;aspect-ratio:590/860;max-width:70%;transform:translateY(25%) scale(.85)}.pack-stage.ejecting #packCard{transform:translateY(-24%) scale(1.06)}.pack-halo{display:none}
@media(max-width:750px){header{height:48px;padding:0 20px}.brand{font-size:11px;letter-spacing:.1em}.header-index{font-size:8px}main{padding:12px 20px 5px}.screen-intro{padding-bottom:12px}.screen-intro h1{font-size:27px;margin-top:4px}.screen-kicker{font-size:8px}.intro-mark{font-size:33px}.workspace{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);gap:12px}.editor{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:14px;align-items:start;padding:0}.editor .section:nth-child(1),.editor .section:nth-child(2){order:initial}.sectiontitle{font-size:10px;margin-bottom:6px}.step{font-size:8px}input[type=text]{height:38px;font-size:16px;padding:6px 10px}.photo-row{gap:7px}.portrait{width:50px;height:50px;padding:3px;border-radius:4px}.photo-buttons .twocol{gap:4px}.photo-buttons .btn{min-height:23px;padding:3px 5px;font-size:9px;line-height:1.4;border-radius:4px}.photo-kind{margin-top:6px;gap:4px;grid-column:1/-1}.photo-kind select{height:27px;font-size:9px;padding:3px 15px 3px 5px}.editor-note{display:none}.micro-button{font-size:9px;min-height:24px;padding:3px 0}#adjustOpen{margin-top:0}.pack-hero{padding:12px!important;border-radius:9px}.hero-watermark{font-size:clamp(86px,27vw,135px)}.pack-zone{gap:9px}.pack-preview{height:100%;width:auto;max-height:300px;max-width:70%;transform:none}.pack-zone>.hint{font-size:9px}.screen-footer{height:30px;padding-top:2px;font-size:7px}.result{display:flex;flex-direction:column;gap:0;padding:2px 0;min-height:0}.result h1{width:100%;text-align:center;font-size:11px;margin:0 0 10px;flex:none}.arena{flex:1;width:100%;min-height:0;padding:0 20px 8px}.flipcard{height:100%;width:auto;max-width:100%;max-height:none;aspect-ratio:1180/1720}.resultactions{flex:none;width:100%;max-width:330px;padding-top:5px}.resultmeta{margin:0 0 5px;gap:6px}.badge{font-size:9px}#cardName{display:none!important}.word-sources{margin:0 0 4px}.tilt-tools{margin:0}.tilt-button{padding:3px 7px;font-size:9px}#tiltStatus{font-size:8px;margin:0 0 4px}.resultactions #download{min-height:35px;font-size:11px;padding:7px}.resultactions #redraw{min-height:30px;padding:5px;font-size:10px;margin-top:6px}#originalOpen{min-height:21px;padding:2px;margin-top:3px}#resultInfo>.twocol{margin:4px 0 0}.resultactions{max-width:330px}.pack-stage{min-height:0;height:100%}.pack-wrapper{height:84%;width:auto;max-height:314px;top:8%}#packCard{height:65%;width:auto!important;top:26%}.pack-stage.ejecting #packCard{transform:translateY(-24%) scale(1.06)}#packDialog{height:88dvh;max-height:88dvh;padding:14px 20px;gap:5px}#packHeading{font-size:20px;margin:5px 0}}
@media(max-height:600px) and (min-width:751px){header{height:44px}main{padding-top:10px}.screen-intro{padding-bottom:10px}.screen-intro h1{font-size:27px}.editor{gap:12px;padding-top:0}.screen-footer{height:27px}.pack-hero{padding:12px!important}.result{padding:0}.result h1{margin-bottom:7px}.resultactions #cardName{font-size:14px;margin-bottom:7px}}
@media(max-height:500px) and (max-width:750px){header{height:36px;padding:0 16px}main{padding:8px 16px 3px}.screen-intro{padding-bottom:8px}.screen-intro h1{font-size:21px}.screen-kicker{display:none}.intro-mark{font-size:24px}.workspace{grid-template-columns:minmax(200px,.9fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:18px}.editor{display:flex;gap:10px;min-height:0}.photo-row{max-width:270px}.portrait{width:44px;height:44px}.photo-buttons .twocol{flex-direction:row}.photo-kind{margin-top:5px}.screen-footer{height:24px}.result{display:grid;grid-template-columns:minmax(0,1fr) 210px;grid-template-rows:auto minmax(0,1fr);column-gap:24px}.resultactions{padding:0}.result h1{grid-column:1/-1}.arena{height:100%;padding:0}.flipcard{max-height:100%}.pack-preview{max-height:100%}#packHeading{font-size:16px}.pack-kicker{font-size:7px}.pack-modalbar{height:22px}#packDialog{padding:10px 15px;gap:2px}#packAuto{min-height:29px;font-size:10px}#packHint{font-size:8px;min-height:12px;margin:1px 0}}
.keyboard-open .pack-hero,.keyboard-open .screen-footer{display:none}.keyboard-open .workspace{grid-template-rows:auto}.keyboard-open .screen-intro{padding-bottom:8px}

[hidden]{display:none!important}@media(max-width:750px){.photo-buttons .twocol{flex-direction:row}.photo-buttons .btn{flex:1;min-width:0;min-height:40px;font-size:10px;padding:4px 3px}.photo-kind select{height:32px}.micro-button{min-height:30px}}

#cropPreview{display:block;width:min(100%,270px,35dvh);height:auto;aspect-ratio:1;margin:0 auto 14px;border-radius:5px}#adjustDialog{overflow:auto}
@media(min-width:751px) and (max-height:600px){.editor-note{display:none}.portrait{width:50px;height:50px;padding:3px}.photo-buttons .twocol{flex-direction:row}.photo-buttons .btn{flex:1;min-height:39px;padding:5px;font-size:10px}.photo-kind{margin-top:6px}.photo-kind select{height:32px}#adjustOpen{margin-top:0;min-height:27px}input[type=text]{height:38px}}
@media(min-width:751px) and (max-height:420px){header{height:36px}.screen-intro{display:none}main{padding-top:8px;padding-bottom:8px}.screen-footer{height:24px}#cardName{display:none!important}.result h1{margin-bottom:5px}}
@media(max-width:359px) and (min-height:501px){.photo-kind{grid-template-columns:1fr}.screen-intro h1{font-size:25px}.photo-buttons .btn{font-size:9px}}
/* Remove double-tap zoom while retaining panning and pinch zoom. */
html,body,main,header,dialog,button,a,canvas,img{touch-action:manipulation}.pack-lid{touch-action:none}
/* Dark, touch-first refinement: fixed step badges and full-size controls. */
:root{color-scheme:dark;--bg:#101010;--ink:#efefea;--muted:#96968f;--line:#30302d;--accent:#e9d2a7}body{background:#101010;color:var(--ink)}header{border-color:#272725}.brand,.logo{color:#e5e4dd}.header-index,.screen-kicker{color:#777770}.screen-intro h1{font-weight:500;color:#f0f0e9}.sectiontitle{display:flex;align-items:center;gap:10px;min-height:26px;color:#d8d8d0;font-size:13px;line-height:1;white-space:nowrap}.step{display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 24px;width:24px;height:24px;padding:0;border:1px solid #42423c;border-radius:6px;line-height:1;font:10px/1 ui-monospace,monospace;color:#bbbbae;background:#20201d;vertical-align:middle}.sectiontitle #adjustOpen{margin:0 0 0 auto}.editor{gap:20px}input[type=text]{height:48px;font-size:16px;border-radius:8px;background:#1b1b19;border-color:#363630;color:#f1f1e8;padding:10px 13px}input[type=text]:focus{background:#21211e;border-color:#9b8f72}input::placeholder{color:#77776d}.btn{min-height:46px;font-size:13px;padding:10px 14px;border-color:#3b3b35;border-radius:8px;background:#242421;color:#e4e4db}.btn:hover{background:#30302b;border-color:#5b5b50}.primary{background:#eee8db;border-color:#eee8db;color:#24241e}.primary:hover{background:#fffaf0;color:#202019}.photo-buttons .twocol{flex-direction:row;gap:10px}.photo-buttons .btn{flex:1;min-width:0;min-height:46px;font-size:13px;padding:8px}.portrait{width:72px;height:72px;background:#22221e;border-radius:8px}.placeholder svg{color:#77776b}.photo-kind{gap:10px;margin-top:12px}.photo-kind select{height:44px;font-size:13px;background:#1b1b19;border-color:#373730;border-radius:7px;padding:8px 25px 8px 10px;color:#cacac0}.micro-button{min-height:40px;font-size:12px;color:#a3a393;padding:8px 4px}.micro-button:hover{color:#f1f1e6}#adjustOpen{min-height:40px;font-size:11px;margin:0;color:#b3b39e}.editor-note{color:#747469}.pack-hero{background:#161615;border-color:#2a2a26;box-shadow:none;border-radius:12px}.pack-zone>.hint{color:#a4a491;font-size:12px;letter-spacing:.01em}.pack-preview{box-shadow:0 18px 32px #0009;transform:none}.pack-preview:not(:disabled):hover{transform:translateY(-3px)}.screen-footer{height:44px;color:#737366}.screen-footer .micro-button{font-size:12px;color:#c6c6b4}.result h1{color:#b1b1a0}.badge{color:#b8b8a4}.result[data-rarity=secret] .badge:first-child{color:#d5c4ed}.result[data-rarity=ultra] .badge:first-child{color:#e5cb8f}#cardName{color:#e9e9db}.tilt-button{min-height:40px;font-size:12px;color:#a3a392}.tilt-button[aria-pressed=true]{color:#e8d2a7}.tilt-button:hover{background:#272723}#tiltStatus{color:#a6a692}.word-sources a{color:#979783!important}#redraw{color:#dedecf;border-color:#424239;background:#20201c;min-height:44px;font-size:13px}#redraw:hover{background:#2d2d26}#originalOpen{min-height:36px;font-size:11px}dialog,#collectionDialog .modalbar{background:#1b1b19;color:#eeeedd;border-color:#44443a}.modalbar strong{color:#e5e5d5}.close{width:44px;height:44px;color:#b1b19b}.close:hover{background:#33332b;color:#f2f2e0}dialog::backdrop{background:#000c}.collection-title{color:#e3e3ce}.collection-rarity{color:#999985}.collection-tabs button{color:#b5b59d}#adjustDialog label,#saveDialog p{color:#b1b19b}#packDialog{background:#151513;border-color:#444437}#packDialog::backdrop{background:#070707ed}.pack-kicker{color:#8a8a77}#packHeading{color:#eaeada}#packHint{color:#b2b299;font-size:12px}#packAuto{background:#eee8d9;color:#24241a;min-height:46px;font-size:14px;border-radius:8px}.pack-wrapper{transform:none}
@media(max-width:750px){header{height:48px;padding:0 18px}.brand{font-size:11px}.header-index{font-size:9px}main{padding:10px 18px 4px}.screen-intro{padding-bottom:10px}.screen-intro h1{font-size:24px;line-height:1.2;margin:0}.screen-kicker{display:none}.workspace{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);gap:12px}.editor{display:flex;flex-direction:column;gap:12px;padding:0}.sectiontitle{font-size:12px;gap:9px;margin-bottom:8px;min-height:24px}.step{flex-basis:24px;width:24px;height:24px;font-size:10px}.editor .section:nth-child(1),.editor .section:nth-child(2){width:100%;order:initial}input[type=text]{height:46px;font-size:16px;padding:9px 12px}.photo-row{gap:12px}.portrait{width:64px;height:64px;padding:4px;border-radius:7px}.photo-buttons .twocol{flex-direction:row;gap:8px}.photo-buttons .btn{min-height:46px;font-size:13px;padding:9px 6px;flex:1;min-width:0;line-height:1.3}.photo-kind{grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.photo-kind select{height:44px;font-size:12px;padding:8px 22px 8px 9px}#adjustOpen{min-height:40px;margin-left:auto;padding:8px 4px;font-size:11px}.micro-button{min-height:40px;font-size:12px}.pack-hero{padding:12px!important;border-radius:10px}.pack-zone{gap:8px}.pack-zone>.hint{font-size:11px;line-height:1.4}.pack-preview{max-height:300px;transform:none}.screen-footer{height:42px;padding-top:2px;font-size:7px}.screen-footer .micro-button{min-height:40px;font-size:12px;padding:8px 0}.editor-note{display:none}.resultactions{max-width:360px}.resultactions #download{min-height:46px;font-size:14px;padding:10px}.resultactions #redraw{min-height:44px;font-size:13px;padding:8px;margin-top:8px}#originalOpen{min-height:36px;font-size:11px;padding:7px;margin:2px 0 0}.tilt-button{min-height:36px;font-size:11px;padding:6px 9px}.word-sources a{font-size:10px}.result h1{margin-bottom:8px;font-size:12px}.badge{font-size:10px}.resultmeta{margin-bottom:3px}#packAuto{min-height:46px;font-size:14px}#packHint{font-size:11px;line-height:1.4}#packHeading{font-size:21px}.pack-wrapper{transform:none}}
@media(max-width:750px) and (max-height:700px){.screen-intro{display:none}.editor{gap:8px}.sectiontitle{margin-bottom:6px}.portrait{height:56px;width:56px}.photo-kind{margin-top:8px}.workspace{gap:9px}.pack-hero{padding:9px!important}.screen-footer{height:40px}.pack-zone{gap:6px}}
@media(max-height:500px) and (min-width:600px){header{height:38px}main{padding:8px 18px 4px}.screen-intro{display:none}.workspace{grid-template-columns:minmax(260px,.9fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:24px}.editor{display:flex;gap:8px}.sectiontitle{margin-bottom:6px}.portrait{width:50px;height:50px}.photo-buttons .btn{min-height:44px;font-size:12px}.photo-kind{margin-top:6px}.photo-kind select{height:42px;font-size:12px}.editor-note{display:none}.screen-footer{height:40px}input[type=text]{height:44px}.result{display:grid;grid-template-columns:minmax(0,1fr) 250px;grid-template-rows:auto minmax(0,1fr);column-gap:24px}.resultactions{padding:0}.result h1{grid-column:1/-1}.arena{height:100%;padding:0}.flipcard{max-height:100%}.resultactions #download{min-height:44px}.resultactions #redraw{min-height:42px}#originalOpen{min-height:34px}.tilt-button{min-height:32px}.pack-preview{max-height:100%}}
.keyboard-open .screen-intro,.keyboard-open .pack-hero,.keyboard-open .screen-footer{display:none}
.pack-photo-back,.pack-lid .pack-photo-back{clip-path:none;transform-origin:0 0}.pack-preview,.pack-body{overflow:hidden}

/* Keep the hidden collection entrance available on every screen size. */
#archiveTrigger{display:grid!important;place-items:center;flex:0 0 44px;width:44px;height:44px;cursor:pointer;touch-action:manipulation}#archiveTrigger svg{display:block!important;width:24px;height:28px;filter:none}#archiveTrigger:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-radius:6px}

.collection-sync{padding:12px 0 16px;border-bottom:1px solid var(--line);margin-bottom:12px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}.collection-sync p{font:11px/1.6 system-ui;overflow-wrap:anywhere;flex:1 1 100%;margin:0}.collection-sync .btn{font-size:12px;min-height:44px;padding:10px 14px;text-decoration:none;text-align:center}#collectionSignIn{flex:1}.collection-sort{flex-wrap:wrap}

/* Anchor the app to the visible viewport after iOS input focus/browser chrome changes. */
html{height:100%;overflow:hidden;overscroll-behavior:none}body{position:fixed;top:var(--screen-top,0px);left:0;right:0;width:100%;height:var(--screen-height,100dvh);margin:0;overflow:hidden;overscroll-behavior:none;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}header{flex:0 0 auto;min-height:48px}main{flex:1 1 0;min-height:0}#inputPage>.workspace{min-height:0}.editor{flex-shrink:0}.editor .section{flex-shrink:0}.placeholder .hint{display:none!important}

.collection-image-status{position:absolute;inset:0;display:grid;place-items:center;z-index:2;background:#20201c;font-size:11px;color:#dedecb;text-align:center;padding:12px;pointer-events:none}.collection-card img{min-height:1px}.collection-card .archive-surface{contain:layout}

#savedCardMeta{text-align:center;margin:2px 0 12px;line-height:1.5}#savedCardRarity{font-size:12px;color:#e9d2a7;letter-spacing:.03em}#saveDialog .modalbar strong{min-width:0;overflow-wrap:anywhere;line-height:1.4}#saveDialog .modalbar .close{flex-shrink:0}

/* Full-screen viewing mode retains the same live sensor/foil surface. */
#saveDialog.card-lightbox[open]{position:fixed;inset:var(--screen-top,0px) 0 auto;width:100vw;height:var(--screen-height,100dvh);max-width:none;max-height:none;margin:0;padding:calc(8px + env(safe-area-inset-top,0px)) 16px calc(14px + env(safe-area-inset-bottom,0px));border:0;border-radius:0;background:transparent;box-shadow:none;overflow:hidden;display:grid;grid-template-columns:1fr;grid-template-rows:44px minmax(0,1fr) auto;gap:10px}
#saveDialog.card-lightbox::backdrop{background:rgba(0,0,0,.6)}
#saveDialog.card-lightbox>:not(.modalbar):not(#savedSurface):not(#savedCardMeta){display:none!important}
#saveDialog.card-lightbox .modalbar{grid-row:1;margin:0;padding:0;background:transparent;justify-content:flex-end;border:0;gap:10px}
#saveDialog.card-lightbox .modalbar strong{display:none}
#saveDialog.card-lightbox #previewTilt{margin-right:auto;min-height:44px;padding:8px 12px;background:#10101080;color:#f1eee2;border:1px solid #ffffff25;border-radius:24px}
#saveDialog.card-lightbox .close{background:#10101080;border:1px solid #ffffff25;border-radius:50%;color:#fff;width:44px;height:44px;font-size:28px}
#saveDialog.card-lightbox #savedSurface,#saveDialog.card-lightbox #savedSurface.archive-surface{grid-row:2;justify-self:center;align-self:center;width:min(calc(100vw - 44px),calc((var(--screen-height,100dvh) - 130px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)) * 59 / 86));height:auto;max-width:none;max-height:none;aspect-ratio:59/86;margin:0;overflow:visible;box-shadow:0 20px 80px #0008;touch-action:manipulation}
#saveDialog.card-lightbox #savedImage{display:block;width:100%;height:100%;max-height:none;object-fit:contain;border-radius:5px}
#saveDialog.card-lightbox #savedCardMeta{grid-row:3;margin:0;text-align:center}
#saveDialog.card-lightbox #savedCardRarity{font-size:12px;color:#fff0c9;text-shadow:0 1px 8px #000}

/* Front and reverse are sampled from the supplied illustrated pack photograph. */
.pack-photo-front{background-image:url('assets/pack-yutoh-photo.jpg');background-size:214.35407% 139.11525%;background-position:7.94979% 55.05952%;transform-origin:0 0;clip-path:none}
.pack-photo-back,.pack-lid .pack-photo-back{background-image:url('assets/pack-yutoh-photo.jpg');background-size:218.00487% 140.91981%;background-position:96.70103% 54.46686%;transform-origin:0 0;clip-path:none}
.pack-preview,.pack-wrapper{aspect-ratio:410/850}

/* Reveal a back-facing pull in the opening scene, without a rear enlargement. */
.pack-stage.is-back #packCard{transform:translateY(25%)}
.pack-stage.is-back.ejecting #packCard{transform:translateY(-24%)}
.pack-stage.is-back.opened #packCard{cursor:pointer;touch-action:manipulation}
.pack-stage.is-back.opened #packCard:focus-visible{outline:2px solid #ecd29c;outline-offset:5px}

.pack-open-instruction{flex:none;position:relative;z-index:2;margin:0 0 16px;padding:10px 16px;color:#f6f2e7;font-size:clamp(15px,1.5vw,19px);font-weight:750;line-height:1.4;letter-spacing:.025em;text-align:center;background:#ffffff0b;border:1px solid #ffffff22;border-radius:8px}
.pack-mouse-label{display:none}
@media(hover:hover) and (pointer:fine){.pack-touch-label{display:none}.pack-mouse-label{display:inline}}
@media(max-height:500px){.pack-open-instruction{font-size:13px;padding:7px 10px;margin-bottom:8px}}

.pack-zone{grid-template-rows:auto minmax(0,1fr);align-items:center}.pack-open-instruction{margin:0;align-self:start}

:root{--mincho:"Card Mincho","Hiragino Mincho ProN","Yu Mincho","Noto Serif JP",serif}
body,body *{font-family:var(--mincho)!important}
.pack-open-instruction{border:0;background:none;border-radius:0;padding:6px 0;box-shadow:none;text-shadow:0 2px 12px #0009}
.pack-result .flipcard{animation:none!important;transition:none!important}

#adjustOpen{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:7px 12px;border:1px solid #77756b;border-radius:6px;background:#272724;color:#f1ecdf;font-size:12px;line-height:1.3;letter-spacing:0;box-shadow:0 2px 0 #0005}
#adjustOpen:hover{background:#393832;border-color:#c4b38b}
#adjustOpen:active{transform:translateY(1px);box-shadow:none}
.portrait .placeholder{display:grid;place-items:center;width:100%;height:100%;gap:0}
.pack-stage.ejecting .pack-wrapper{pointer-events:none}
.pack-stage.is-back.ejecting #packCard{z-index:3;cursor:pointer;touch-action:manipulation}
@media(max-width:750px){#adjustOpen{min-height:38px;padding:7px 10px;font-size:11px}}

/* One button style across the card result and image-save menu. */
.resultactions #download,.resultactions #originalOpen,.resultactions #redraw,#saveLink,#openSavedImage,#saveToPhotos{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:46px;padding:10px 14px;border:1px solid #eee8db;border-radius:8px;background:#eee8db;color:#24241e;box-shadow:none;font-size:14px;font-weight:650;line-height:1.4;text-align:center;text-decoration:none;letter-spacing:0;cursor:pointer}
.resultactions #originalOpen,.resultactions #redraw{margin:8px 0 0}
.resultactions #download:hover,.resultactions #originalOpen:hover,.resultactions #redraw:hover,#saveLink:hover,#openSavedImage:hover,#saveToPhotos:hover{background:#fffaf0;border-color:#fffaf0;color:#202019}
.resultactions #download:active,.resultactions #originalOpen:active,.resultactions #redraw:active,#saveLink:active,#openSavedImage:active,#saveToPhotos:active{background:#dfd8cb;transform:translateY(1px)}
@media(max-height:500px){.resultactions #download,.resultactions #originalOpen,.resultactions #redraw{min-height:38px;padding:7px 12px;font-size:13px}}

.pack-stage.is-back.ejecting #packCard.card-turn{animation:pack-card-turn .36s linear both;transition:none;will-change:transform;transform-origin:center}
@keyframes pack-card-turn{0%{transform:translateY(-24%) rotateY(0deg)}49.999%{transform:translateY(-24%) rotateY(90deg)}50%{transform:translateY(-24%) rotateY(-90deg)}100%{transform:translateY(-24%) rotateY(0deg)}}

#saveDialog.card-lightbox #previewSave{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;min-height:44px;padding:8px 14px;border:1px solid #eee8db;border-radius:8px;background:#eee8db;color:#24241e;font-size:13px;font-weight:650;line-height:1.3;white-space:nowrap}
#saveDialog.card-lightbox #previewSave:hover{background:#fffaf0}
#saveDialog.card-lightbox .modalbar{gap:8px}

/* Pack and odds share one screen; rates come from the actual draw weights. */
.pack-zone{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);grid-template-rows:auto minmax(0,1fr);column-gap:clamp(16px,3vw,40px);row-gap:16px;align-items:center;justify-items:stretch}
.pack-open-instruction{grid-column:1/-1}.pack-zone>.pack-preview{grid-column:1;grid-row:2;justify-self:center;max-width:100%;max-height:440px;height:100%;width:auto;min-height:0;object-fit:contain}
.rarity-panel{grid-column:2;grid-row:2;width:100%;height:100%;max-height:450px;min-height:0;max-width:330px;justify-self:end;display:flex;flex-direction:column;container-type:size;color:#c8c5bb;padding-left:clamp(12px,2vw,24px);border-left:1px solid #ffffff16}
.rarity-panel-heading{flex:none;display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding-bottom:10px}.rarity-panel-heading>span{order:2;font-size:9px;letter-spacing:.1em;color:#858071}.rarity-panel-heading h2{margin:0;color:#eadbc0;font-size:20px;font-weight:500;letter-spacing:.08em}
.rarity-table{display:flex;flex-direction:column;width:100%;flex:1;min-height:0;border-collapse:collapse;font-size:clamp(9px,3cqh,12px);line-height:1.15}.rarity-table thead{display:block;flex:none;padding-bottom:5px;color:#827e71;font-size:9px}.rarity-table tr{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%}.rarity-table th{text-align:left;font-weight:400;min-width:0}.rarity-table thead th:last-child{text-align:right}.rarity-table tbody{display:grid;grid-template-rows:repeat(14,minmax(0,1fr));flex:1;min-height:0}.rarity-table tbody tr{border-top:1px solid #ffffff09}.rarity-table tbody th{display:flex;align-items:center;gap:7px;letter-spacing:-.025em}.rarity-table tbody th:before{content:'';width:4px;height:4px;flex:none;background:var(--rarity-color);transform:rotate(45deg)}.rarity-table td{flex:none;text-align:right;color:var(--rarity-color);font-variant-numeric:tabular-nums;letter-spacing:.03em}.rarity-short-name{display:none}
.overframe-rate{flex:none;display:flex;justify-content:space-between;align-items:center;gap:8px;border-top:1px solid #a896683e;margin-top:8px;padding-top:8px;color:#ead3a1;font-size:clamp(10px,3cqh,12px)}.overframe-rate strong{font-size:1.3em;font-weight:500}.overframe-rate small{font-size:.7em;margin-left:2px}.rarity-rate-note{flex:none;margin:4px 0 0;font-size:9px;line-height:1.3;color:#898475}
@media(max-width:1050px){.rarity-full-name{display:none}.rarity-short-name{display:inline}}
@media(max-width:750px){.pack-zone{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);column-gap:14px;row-gap:8px}.pack-hero{padding:12px!important}.pack-zone>.pack-preview{max-height:350px}.rarity-panel{padding-left:12px;max-height:390px}.rarity-panel-heading{padding-bottom:6px;gap:4px}.rarity-panel-heading h2{font-size:15px}.rarity-panel-heading>span{font-size:7px}.rarity-table{font-size:clamp(9px,3.4cqh,11px)}.rarity-table thead{font-size:8px}.rarity-table tbody th{gap:5px}.rarity-table tr{gap:4px}.overframe-rate{margin-top:5px;padding-top:5px}.rarity-rate-note{font-size:8px;letter-spacing:-.04em}}
@media(max-height:700px){.rarity-panel-heading h2{font-size:14px}.rarity-panel-heading{padding-bottom:3px}.rarity-table thead{padding-bottom:3px}.overframe-rate{margin-top:3px;padding-top:3px;font-size:9px}.rarity-rate-note{margin-top:2px;font-size:8px}.pack-zone{row-gap:4px}}

.pack-display{grid-column:1;grid-row:2;display:grid;place-items:center;min-width:0;min-height:0;height:100%;width:100%;container-type:size}.pack-display .pack-preview{width:min(100cqw,calc(100cqh * .48235),212px);height:auto;max-width:100%;max-height:100%;aspect-ratio:410/850;justify-self:center;align-self:center}

/* The stone texture stays behind dark reading surfaces. */
body{background:linear-gradient(180deg,#0b0b0bdf 0%,#0b0b0bea 55%,#0b0b0bf3 100%),url('assets/hieroglyphs.jpg') center center/cover no-repeat;background-color:#101010}
header{position:relative;height:68px;min-height:68px;background:#1010109c;border-bottom-color:#d4b77c22;justify-content:center}
header .brand{width:100%;display:flex;align-items:center;justify-content:center;gap:0;letter-spacing:0}
header #archiveTrigger{position:absolute;left:4vw;top:50%;transform:translateY(-50%);color:#d8c6a4}
.site-title{font-size:34px;font-weight:600;line-height:1;letter-spacing:.055em;color:#f1e7d4;text-align:center;text-shadow:0 2px 14px #000}
.pack-hero{background:#11110fed}.pack-open-instruction{transform:translateY(-6px);text-shadow:0 2px 8px #000}
@media(max-width:750px){header{height:62px;min-height:62px}.site-title{font-size:28px;letter-spacing:.04em}header #archiveTrigger{left:12px}.pack-open-instruction{transform:translateY(-5px)}}
@media(max-height:700px){header{height:56px;min-height:56px}.site-title{font-size:26px}}

.site-title{text-decoration:none;cursor:pointer;touch-action:manipulation}.site-title:focus-visible{outline:1px solid #ead3a1;outline-offset:6px;border-radius:3px}.site-title:hover{color:#fff4df}

/* Reveal the stone backdrop behind the pack and rarity list. */
.pack-hero{background:transparent;border:0;box-shadow:none}
.rarity-panel{background:transparent;color:#e2ddd1;text-shadow:0 1px 3px #000b}
.rarity-panel-heading>span,.rarity-table thead,.rarity-rate-note{color:#b5ad9a;text-shadow:0 1px 3px #000b}
.rarity-panel-heading h2,.overframe-rate{color:#f1deb7;text-shadow:0 1px 4px #000c}
.rarity-table tbody tr{border-top-color:#e8dbc018}.rarity-panel{border-left-color:#e8dbc025}

/* Sharing follows the same cream controls as card saving. */
.resultactions #shareCard{min-height:46px;padding:10px 12px;font-size:14px;white-space:nowrap}.resultactions #resultInfo>.twocol{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#saveDialog #previewShare{min-height:44px;padding:8px 12px;border:1px solid #eee8db;background:#eee8db;color:#24241e;white-space:nowrap;font-size:13px;border-radius:8px;flex-shrink:0}
#shareDialog{width:min(92vw,440px);max-height:calc(var(--screen-height,100dvh) - 36px);padding:18px 20px;background:#171715;border-color:#766947;overflow:auto;box-shadow:0 24px 90px #0008}#shareDialog::backdrop{background:#000b}
.share-summary{display:flex;gap:18px;align-items:center;margin:12px 0 18px}.share-summary img{width:76px;height:auto;aspect-ratio:59/86;object-fit:contain;border-radius:4px;box-shadow:0 8px 20px #0006}.share-summary>div{min-width:0}.share-kicker{font-size:10px;letter-spacing:.1em;color:#bcaa83;margin:0 0 6px}.share-summary h2{margin:0;color:#f1e6d2;font-size:18px;line-height:1.5;overflow-wrap:anywhere}.share-summary #shareRarity{margin:6px 0 0;font-size:11px;color:#b7aa92}
.share-caption-label{font-size:11px;color:#c2b7a0}#shareCaption{display:block;width:100%;resize:vertical;min-height:98px;max-height:160px;margin:6px 0 10px;padding:10px 12px;background:#101010;color:#e7e0d0;border:1px solid #494438;border-radius:8px;font-size:12px;line-height:1.7}#shareCaption:focus{outline:1px solid #b8a078;outline-offset:1px}.share-include{display:flex;align-items:center;gap:8px;font-size:11px;color:#c6bca7;margin:0 0 14px}.share-include input{accent-color:#d8c5a0;width:16px;height:16px}#shareNative{width:100%;font-size:14px;min-height:46px}#shareStatus{font-size:11px;color:#bdb39c;line-height:1.6;margin:10px 0;min-height:18px}.share-secondary{display:grid;grid-template-columns:1fr 1fr;gap:8px}.share-secondary .btn{display:flex;align-items:center;justify-content:center;text-decoration:none;font-size:12px;min-height:44px}.share-x{display:block;text-align:center;padding:12px 0 4px;color:#e7d4b1;font-size:12px;text-decoration:none}.share-x:hover{text-decoration:underline}.share-footnote{font-size:10px;color:#9c9482;text-align:center;margin:5px 0 0;line-height:1.5}
@media(max-width:380px){#saveDialog.card-lightbox .modalbar{gap:5px}#saveDialog.card-lightbox #previewSave,#saveDialog #previewShare{padding:8px;font-size:11px}#saveDialog.card-lightbox #previewTilt{padding:8px;font-size:11px}}
@media(max-height:600px){.resultactions #shareCard{min-height:38px;padding:7px 10px;font-size:13px}.share-summary{margin:6px 0 10px}.share-summary img{width:48px}#shareDialog{padding:12px 16px}#shareCaption{min-height:76px;font-size:11px}.share-include{margin-bottom:8px}}

.share-include[hidden]{display:none!important}

#shareNative[hidden],#previewShare[hidden]{display:none!important}
