:root{--ink:#2a263d;--muted:#706a80;--line:#312a43;--paper:#fffefa;--purple:#a687f3;--yellow:#ffdf69;--sh:4px 4px 0 var(--line);--mono:"SFMono-Regular",Consolas,"Liberation Mono",monospace;color:var(--ink);font:16px/1.45 "Apple SD Gothic Neo","Malgun Gothic","Noto Sans KR",system-ui,sans-serif;font-synthesis:weight}
*{box-sizing:border-box}body{margin:0;min-height:100vh;background-color:#f2effa;background-image:radial-gradient(#ccc5dd .8px,transparent .85px);background-size:8px 8px}button,a{font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:default}a{text-decoration:none}button:focus-visible,a:focus-visible{outline:3px solid #6844c1;outline-offset:4px}button{background:none;border:0}h1,h2,h3,p{margin:0}svg,.pixel{flex-shrink:0}.pixel{image-rendering:pixelated}em{font-style:normal}button,a{-webkit-tap-highlight-color:transparent}.topbar{background:var(--paper);border-bottom:2px solid var(--line)}.topinner{max-width:1256px;width:calc(100% - 88px);margin:auto;height:72px;display:flex;align-items:center;gap:60px}.brand{display:flex;align-items:center;gap:10px;flex-shrink:0}.brand-icon{width:37px;height:auto}.wordmark{width:160px;height:18px}.topinner nav{display:flex;align-items:center;gap:8px}.topinner nav a{padding:8px 14px;border:1.5px solid transparent;border-radius:7px;display:flex;align-items:center;gap:8px;white-space:nowrap;font-weight:750;font-size:.94rem;color:#625b70}.topinner nav .active{background:#e9dfff;border-color:var(--line);box-shadow:2px 2px 0 var(--line);color:#483268}.topinner nav a:hover:not(.active){background:#f3effa}.utilities{margin-left:auto;display:flex;gap:9px}.square,.help-btn,.mini-btn{background:var(--paper);border:1.5px solid var(--line);border-radius:6px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font-weight:750;font-size:.88rem}.square,.help-btn{height:35px}.square{width:36px}.help-btn{padding:0 12px}.utilities button:hover,.mini-btn:hover{background:#f0e9ff}
main{max-width:1256px;width:calc(100% - 88px);margin:32px auto 44px}.heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:23px}.eyebrow,.modal-eyebrow{display:flex;align-items:center;gap:8px;font:800 .75rem/1.2 var(--mono);letter-spacing:.115em;color:#7256a0}.eyebrow i{display:inline-block;background:#aa85f0;width:8px;height:8px;box-shadow:2px 2px 0 #583c83}.heading h1{font-size:clamp(2rem,3.1vw,2.72rem);font-weight:900;letter-spacing:-.075em;line-height:1.18;margin:6px 0 6px}.heading p{color:#685f78;font-size:1rem;letter-spacing:-.035em}.wallet{display:flex;align-items:center;gap:14px;padding:10px 21px 10px 16px;border:2px solid var(--line);background:#fff5c5;box-shadow:3px 3px var(--line);border-radius:10px;min-width:168px}.wallet img{width:43px}.wallet small,.cost small{display:block;font-size:.8rem;line-height:1.3;font-weight:750;color:#5d5262}.wallet strong,.cost strong{display:block;font:850 1.6rem/1.2 var(--mono);letter-spacing:-.065em;margin-top:3px}.wallet em,.cost em{font:800 1rem/1 sans-serif;margin-left:4px}
.playgrid{display:grid;grid-template-columns:minmax(0,1.95fr) minmax(305px,1fr);gap:22px;align-items:stretch}.playgrid aside{display:grid;grid-template-rows:1fr auto;gap:16px;min-width:0}.machine,.panel,.job-panel{border:2px solid var(--line);box-shadow:var(--sh);border-radius:12px}.machine{overflow:hidden;min-width:0;padding:0 12px;background:#b69af2;display:flex;flex-direction:column}.machine-top{display:flex;align-items:center;justify-content:space-between;gap:12px;height:33px;flex-shrink:0;color:#47375e}.machine-top>span{font:800 .72rem/1 var(--mono);letter-spacing:.17em}.lamps,.vents{display:flex;gap:5px;align-items:center;padding:0 3px}.lamps i{width:8px;height:8px;background:#f08ca1;border:1.5px solid var(--line);border-radius:50%}.lamps i:nth-child(2){background:#ffdd72}.lamps i:nth-child(3){background:#9bdfb5}.vents i{width:4px;height:11px;background:#796596;transform:skew(-18deg);border-radius:1px}
.screen{position:relative;min-height:315px;flex:1;background:#31284d url(assets/starfield.png) center/100% 100% no-repeat;image-rendering:pixelated;border:2px solid var(--line);border-radius:7px;box-shadow:inset 0 0 0 3px #ffffff16;overflow:hidden;isolation:isolate}.screen-title{position:absolute;top:19px;left:24px;z-index:2;color:#fff;pointer-events:none}.screen-title b,.on-badge,.available{display:inline-block}.screen-title b{background:var(--yellow);color:var(--ink);padding:4px 8px 3px;border:1px solid var(--ink);font:900 .73rem/1 var(--mono);letter-spacing:.09em;box-shadow:2px 2px 0 #161328}.screen-title h2{color:#fff;font-size:clamp(1.55rem,2.4vw,2.12rem);letter-spacing:-.07em;font-weight:900;margin-top:5px;text-shadow:2px 3px 0 #21182d;line-height:1.2}.screen-index{position:absolute;left:9%;bottom:13%;font-size:22px;color:#ffdf90;text-shadow:2px 2px #58446c}.fan{position:absolute;left:50%;bottom:17px;transform:translateX(-50%);width:100%;height:72%;max-height:267px}.photocard{--edge:#dfbac4;position:relative;aspect-ratio:0.72;border:2px solid #332b47;background:var(--edge);border-radius:10px;padding:5px;box-shadow:3px 4px 0 #1b142c;overflow:hidden;text-align:left}.photo-art{height:100%;width:100%;position:relative;border:1.5px solid #433657;border-radius:5px;overflow:hidden;background:#b296da}.photo-art>img{display:block;width:100%;height:100%;object-fit:cover;image-rendering:auto}.photo-art:after{content:"";position:absolute;inset:55% 0 0;background:linear-gradient(transparent,#171329b8);pointer-events:none}.photo-grade{position:absolute;top:6px;left:6px;min-width:24px;text-align:center;padding:2px 5px 1px;font:900 .82rem/1.1 var(--mono);color:#30263c;border:1px solid #332b47;border-radius:3px;background:var(--edge)}.grade-0{--edge:#ccdaeb}.grade-1{--edge:#94e1d2}.grade-2{--edge:#e2adf9}.grade-3{--edge:#ffdc7f}.photo-caption{position:absolute;left:8px;right:8px;bottom:7px;display:flex;flex-direction:column;align-items:flex-start;gap:4px;z-index:1}.signature{height:12px;width:auto;filter:drop-shadow(1px 2px #342747)}.stars{font:bold 10px/1 sans-serif;letter-spacing:1px;color:var(--edge);text-shadow:1px 1px #2b1d3b}.fan .photocard{position:absolute;left:50%;bottom:0;height:93%;width:auto;transform-origin:50% 86%}.fan .left-card{transform:translateX(-117%) rotate(-14deg);bottom:2%;--edge:#e6aae7}.fan .right-card{transform:translateX(17%) rotate(14deg);bottom:2%}.fan .center-card{height:100%;transform:translateX(-50%) rotate(1.8deg);z-index:1;box-shadow:4px 6px 0 #20172f}.deck{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 8px 16px}.cost strong{font-size:1.55rem;display:flex;align-items:center;gap:5px}.cost strong em{margin-left:0}.cost small{color:#47365f}.coin{width:22px;height:20px}.big-action,.primary,.job-button,.secondary{display:inline-flex;align-items:center;justify-content:center;gap:10px;border:2px solid var(--line);font-weight:850;border-radius:7px;box-shadow:3px 3px 0 var(--line);transition:transform .12s,box-shadow .12s}.big-action,.primary{background:var(--yellow)}.pull{min-height:52px;width:45%;max-width:310px;font-size:1.25rem;letter-spacing:-.06em}.big-action:hover:not(:disabled),.primary:hover:not(:disabled),.job-button:hover:not(:disabled),.secondary:hover{filter:brightness(1.04);transform:translate(-1px,-1px);box-shadow:4px 4px 0 var(--line)}.big-action:active:not(:disabled),.primary:active:not(:disabled),.job-button:active:not(:disabled),.secondary:active{transform:translate(2px,2px);box-shadow:1px 1px var(--line)}button.primary:disabled,button.pull:disabled{background:#d9d5df;color:#696573;box-shadow:1px 1px 0 var(--line)}
.panel{background:var(--paper)}.panel h2,.job-panel h2{display:flex;align-items:center;gap:8px;font-size:1.17rem;font-weight:850;line-height:1.25;letter-spacing:-.055em}.stage-panel{padding:17px 17px 16px}.stage-list{display:grid;gap:8px;margin-top:13px}.stage{width:100%;padding:8px 11px 8px 9px;display:flex;gap:12px;align-items:center;text-align:left;background:#f7f6f9;border:1.5px solid #d4cfda;border-radius:7px;min-height:65px}.stage:hover{border-color:#82768f;background:#f0ecf8}.stage.chosen{background:#f0e8ff;border:1.7px solid #60428d;box-shadow:inset 3px 0 #a17adc}.stage-art{display:flex;align-items:center;justify-content:center;width:45px;height:45px;flex-shrink:0;border-radius:5px;background:#e2d2f7}.art-1{background:#dcecf0}.art-2{background:#f4e9d6}.stage-art img{width:36px;height:40px}.stage-copy{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.stage-copy small,.set-title small{font:800 .68rem/1.1 var(--mono);letter-spacing:.09em;color:#746782}.stage-copy strong{font-size:1rem;letter-spacing:-.055em;line-height:1.35}.stage-copy>span{font-size:.78rem;color:#685f73;line-height:1.3}.on-badge,.available{margin-left:auto;padding:3px 7px;border:1px solid #775ba2;border-radius:4px;background:#d9c5fa;color:#4a316d;font-size:.72rem;font-weight:800;white-space:nowrap}.lock-icon{margin-left:auto;color:#80798a;display:flex}.job-panel{padding:14px 17px 15px;background:#fff1bd;position:relative}.job-heading{display:flex;justify-content:space-between;align-items:center;gap:4px}.job-heading h2{font-size:1.1rem}.job-heading p{margin-top:4px;font-size:.85rem;color:#695642}.job-heading p>b{margin:0 3px}.job-heading strong{color:#46382c}.shop{width:62px;height:49px;object-fit:contain}.job-button{width:100%;height:35px;margin-top:7px;background:linear-gradient(to right,#ffe284 var(--progress),#fffaf0 var(--progress));font-size:.92rem;gap:6px;box-shadow:2px 2px 0 var(--line)}.job-button:disabled{border-color:#93845f;color:#796b4c;box-shadow:1px 1px #93845f}
.price-panel{margin-top:24px;padding:20px 20px 13px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.meta{font-size:.8rem;color:#746d80;letter-spacing:-.025em}.meta b{color:#41394c}.g0{--grade-bg:#eef2f8;--grade-border:#c5cedc;--grade:#d4deef}.g1{--grade-bg:#e7f7f0;--grade-border:#b4d9ca;--grade:#ade4cf}.g2{--grade-bg:#f1eafa;--grade-border:#d3bfe8;--grade:#d9bdf2}.g3{--grade-bg:#fff2d8;--grade-border:#e5cd99;--grade:#ffdc8d}.gem{width:26px;height:25px;margin-right:2px}.grade-pill,.grade-chip{font:900 .73rem/1 var(--mono);display:inline-block;border:1px solid #7d7585;background:var(--grade);border-radius:3px;padding:3px 4px 2px;color:#383044}.bonus-note{display:flex;align-items:center;gap:7px;margin-top:13px;color:#766e80;font-size:.81rem;letter-spacing:-.03em}.bonus-note b{color:#6a4695}.view-panel{padding:22px}.count{border:1px solid #b7a6c8;color:#6c508b;background:#eee6fa;padding:2px 7px;border-radius:4px;font-size:.83rem}.filters,.modal-actions{display:flex;gap:9px}.filters{margin:19px 0;flex-wrap:wrap}.filters button{border:1.4px solid #b3aaba;border-radius:6px;padding:5px 13px;font-size:.9rem;font-weight:750;background:#fcfaff}.filters button.selected{border-color:var(--line);background:#e3d2ff;box-shadow:2px 2px var(--line)}.empty{text-align:center;padding:50px 10px 65px}.empty>img{width:55px;transform:rotate(-7deg);margin-bottom:10px}.empty h3{font-size:1.3rem;letter-spacing:-.045em}.empty p,.muted{color:#74697f;margin:8px 0 16px}.primary,.secondary{padding:9px 16px;font-size:.95rem}.secondary{background:#f7f2ff}.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(156px,1fr));gap:18px}.inventory-tile{padding:11px;background:#f7f3fc;border:1.5px solid #cbbdd7;border-radius:8px;max-width:242px}.inventory-tile .photocard{width:100%;height:auto}.tile-info{margin-top:12px}.tile-info small{font-size:.78rem;color:#73667f}.tile-info h3{font-size:1.12rem}.tile-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:7px}.mini-btn{padding:4px 7px;font-size:.8rem}.set-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.set-tile{padding:16px;border:1.5px solid #c8bdd8;border-radius:8px;background:#f7f2fe}.set-title{display:flex;align-items:center;justify-content:space-between}.set-title b{font:700 .82rem var(--mono)}.set-tile h3{font-size:1.15rem;margin:5px 0 13px}.set-members{display:flex;gap:5px}.set-members>div{width:33.333%;position:relative}.set-members img{width:100%;border-radius:5px;display:block}.set-members .missing img{filter:grayscale(90%);opacity:.54}.set-members span{display:block;text-align:center;font-size:.82rem;margin-top:3px}.set-tile p{display:flex;justify-content:space-between;align-items:center;font-size:.87rem;margin:13px 0 9px}.set-tile button{width:100%}
dialog{border:2px solid var(--line);border-radius:14px;background:#fffcff;padding:0;color:var(--ink);box-shadow:6px 6px 0 #211b37;width:min(425px,calc(100vw - 38px));max-height:90dvh;overflow:auto}dialog::backdrop{background:#21192d99;backdrop-filter:blur(3px)}#dialog-inner{position:relative;padding:26px;text-align:center}.modal-x{position:absolute;right:11px;top:11px;width:30px;height:30px;display:grid;place-items:center;z-index:2}.modal-eyebrow{justify-content:center}.modal-eyebrow+h2,.locked-art+h2{font-size:1.55rem;letter-spacing:-.06em;margin:6px 0 15px}.modal-actions{margin-top:16px}.modal-actions>*{flex:1}.receipt{background:#f4edf9;border:1px solid #d6c7e0;border-radius:6px;padding:9px 12px;display:flex;justify-content:space-between;gap:9px;align-items:center;text-align:left;font-size:.91rem}.receipt b{font-size:1.03rem}.result-name{font-size:1.3rem;margin-top:14px}.result-name+.muted{margin:1px 0 13px;font-size:.9rem}.locked-art{width:76px;margin:12px}.full{width:100%;margin-top:15px}.sale-lines>div{display:flex;justify-content:space-between;padding:5px 0;font-size:.9rem}.sale-lines{margin:14px 0}.guide-list{text-align:left;display:grid;gap:12px}.guide-list p{font-size:.9rem;color:#675f70}.guide-list b{display:block;font-size:.95rem;color:var(--ink);margin-bottom:2px}.odds{border-collapse:collapse;text-align:center;width:100%;font:500 .79rem var(--mono);margin:8px 0}.odds td,.odds th{padding:5px;border:1px solid #d9cede}.odds thead{background:#f0e7ff}.smallprint{font-size:.8rem;color:#726a79;margin:10px 0 0}#toast{position:fixed;z-index:10;bottom:23px;left:50%;transform:translate(-50%,12px);max-width:calc(100% - 32px);width:max-content;pointer-events:none;opacity:0;transition:.2s;border:1px solid #554768;background:#30273f;color:white;padding:10px 16px;border-radius:7px;font-size:.92rem;box-shadow:3px 3px 0 #b59fd4}#toast.show{opacity:1;transform:translate(-50%,0)}
@media(min-width:1500px){main{margin-top:42px}.screen{min-height:347px}.stage{min-height:73px}}
@media(max-width:1000px){.topinner,main{width:calc(100% - 48px)}.topinner{gap:24px}.topinner nav{gap:3px}.topinner nav a{padding:7px 10px}.playgrid{grid-template-columns:minmax(0,1.7fr) minmax(268px,1fr);gap:16px}.stage-panel,.job-panel{padding-left:12px;padding-right:12px}.stage{gap:8px}.topinner .wordmark{width:136px;height:16px}.fan{height:66%}.deck{padding-left:0;padding-right:0}.price-panel{padding:16px}.stage-copy strong{font-size:.95rem}}
@media(max-width:760px){.topinner,main{width:calc(100% - 32px)}.topinner{height:auto;min-height:94px;display:grid;grid-template-columns:1fr auto;gap:0;padding-top:8px}.brand{gap:6px}.brand-icon{width:30px}.topinner .wordmark{width:131px;height:15px}.utilities{grid-column:2;grid-row:1}.square,.help-btn{height:31px}.square{width:32px}.help-btn{padding:0 8px}.topinner nav{grid-row:2;grid-column:1/3;justify-content:space-between;gap:8px;padding:8px 0 10px}.topinner nav a{flex:1;justify-content:center;font-size:.85rem;padding:5px 4px}.topinner nav a svg{width:15px}main{margin-top:23px}.heading{gap:8px;align-items:flex-start;margin-bottom:17px}.heading h1{font-size:2.05rem}.heading p{font-size:.9rem;line-height:1.48}.wallet{min-width:0;gap:8px;padding:8px 11px;margin-top:6px;flex-shrink:0}.wallet img{width:29px}.wallet strong{font-size:1.15rem}.wallet em{font-size:.8rem;margin-left:2px}.wallet small{font-size:.7rem}.playgrid{grid-template-columns:1fr;gap:18px}.machine{padding:0 10px}.screen{height:310px;min-height:0;flex:auto}.fan{height:69%;bottom:15px}.screen-title{top:14px;left:15px}.screen-title h2{font-size:1.65rem}.deck{padding:12px 3px 14px}.pull{min-height:45px;font-size:1.08rem}.playgrid aside{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);grid-template-rows:auto;gap:13px;align-items:start}.job-heading{flex-wrap:wrap}.job-panel{padding:14px 12px}.job-button{margin-top:11px}.price-panel{margin-top:18px}.view-panel{padding:16px}.set-grid{grid-template-columns:1fr}.set-members>div{max-width:120px}.set-members{justify-content:center}.card-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}.stage-copy small{font-size:.65rem}.stage-panel h2,.panel h2{font-size:1.08rem}}
@media(max-width:510px){.topinner,main{width:calc(100% - 28px)}.eyebrow{font-size:.65rem}.heading{position:relative;display:block;padding-top:1px}.heading h1{margin:5px 0 12px;font-size:1.88rem}.heading p{font-size:.86rem}.wallet{position:absolute;right:0;top:-2px;box-shadow:2px 2px var(--line)}.screen{height:267px}.fan{height:62%;bottom:16px}.fan .photocard{padding:3px;border-radius:7px}.fan .photo-art{border-radius:3px}.fan .left-card{transform:translateX(-108%) rotate(-13deg)}.fan .right-card{transform:translateX(8%) rotate(13deg)}.fan .signature{height:9px}.fan .photo-grade{font-size:.65rem;left:3px;top:3px;min-width:0;padding:2px 3px}.fan .photo-caption{left:5px;bottom:4px}.fan .stars{font-size:7px}.machine-top{height:27px}.machine-top>span{font-size:.61rem}.cost strong{font-size:1.25rem}.pull{width:49%}.playgrid aside{grid-template-columns:1fr;gap:15px}.stage-panel,.job-panel{padding:13px}.stage-panel h2{margin-bottom:10px}.stage-list{margin-top:0;gap:6px}.stage{min-height:54px;padding:5px 10px}.stage-art{width:39px;height:39px}.stage-art img{width:29px;height:34px}.stage-copy strong{font-size:.92rem}.job-heading{flex-wrap:nowrap}.price-panel{padding:13px}.gem{width:22px;height:21px}.grade-pill{font-size:.66rem}.bonus-note{align-items:flex-start}.view-panel .section-head{flex-wrap:wrap}.card-grid{gap:9px}.inventory-tile{padding:7px}.tile-bottom{flex-wrap:wrap;gap:5px}#dialog-inner{padding:22px 17px}.help-btn span{font-size:.78rem}.modal-actions{gap:7px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.fan .right-card .photo-grade{left:auto;right:6px}.fan .right-card .photo-caption{align-items:flex-end}

.topinner { gap: clamp(12px, 3vw, 42px); }
.utilities { align-items: center; }
.utility-action, .utilities [data-pwa-install="gacha"] {
  min-height: 35px;
  padding: 0 10px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font: 750 .85rem/1.2 system-ui, sans-serif;
  white-space: nowrap;
}
.utilities #account-open { order: 1; }
.utilities [data-pwa-install] { order: 2; }
.stage-list { max-height: 308px; overflow-y: auto; }
#account-dialog p { margin-top: 12px; }
#account-status { color: #594179; }
#account-status:empty { display: none; }
#account-dialog .modal-x { font-size: 1.5rem; line-height: 1; }
@media (max-width: 880px) {
  .topinner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 8px;
    height: auto;
    min-height: 94px;
    padding-top: 8px;
  }
  .topinner nav { grid-area: 2 / 1 / 3 / 3; justify-content: space-between; }
  .utilities { grid-area: 1 / 2 / 2 / 3; }
  .utilities #help span { display: none; }
}
@media (max-width: 760px) {
  .topinner .wordmark { width: clamp(78px, 25vw, 131px); height: auto; }
  .utilities { gap: 5px; }
  .utility-action, .utilities [data-pwa-install="gacha"] { min-height: 32px; padding: 0 7px; }
}
@media (max-width: 375px) {
  .topinner .brand-icon { width: 23px; }
  .utilities .square, .utilities .help-btn { width: 29px; padding: 0; }
  .utility-action, .utilities [data-pwa-install="gacha"] { font-size: .78rem; }
}

/* Group names and colors stay consistent in the stage list, machine and market. */
.group-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--group-border);
  border-radius: 4px;
  background: var(--group-bg);
  color: var(--group-ink);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
}
.girls { --group-bg: #f9ddf0; --group-border: #d698c7; --group-ink: #753260; }
.boys { --group-bg: #d9f0f6; --group-border: #87bac9; --group-ink: #225869; }
.screen-group, .stage-label, .set-group, .locked-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
}
.screen-group-name {
  color: #f1e5ff;
  font: 700 .7rem/1.1 var(--mono);
  letter-spacing: .05em;
}
.stage-filters { margin: 11px 0 8px; gap: 6px; }
.stage-filters button { min-height: 34px; padding-inline: 9px; }
.stage-filters button[aria-pressed="true"] {
  border-color: var(--group-border, var(--line));
  background: var(--group-bg, #e9dfff);
  color: var(--group-ink, var(--ink));
  box-shadow: 1px 2px 0 var(--group-border, var(--line));
}
.stage-list { margin-top: 0; }
.stage .stage-art { background: var(--group-bg); }
.stage-copy { display: flex; flex: 1; align-items: flex-start; gap: 2px; }
.stage .stage-group-name {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  color: var(--group-ink);
  line-height: 1.35;
}
.stage-group-name > span { white-space: nowrap; }
.set-group { justify-content: center; margin: 5px 0 10px; font-size: .75rem; }
.locked-group { justify-content: center; margin: 5px 0 11px; font-size: .82rem; }

.price-table {
  width: 100%;
  margin-top: 14px;
  border-collapse: separate;
  border-spacing: 4px;
  table-layout: fixed;
}
.price-table th, .price-table td {
  padding: 8px 3px;
  border-radius: 5px;
  text-align: center;
}
.price-table th:first-child {
  background: #f2ebf9;
  font-size: .84rem;
}
.price-table th:not(:first-child), .price-table td { background: var(--grade-bg); }
.price-table td {
  color: #332a43;
  font: 700 clamp(.74rem, 2.2vw, 1rem)/1.35 var(--mono);
  white-space: nowrap;
}
.price-table .gem { width: 18px; height: 18px; margin-right: 5px; vertical-align: middle; }
.price-table .grade-pill { vertical-align: middle; }

.bulk-toolbar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 18px;
  padding: 11px;
  border: 1.5px solid #c6b5dc;
  border-radius: 8px;
  background: #f4ecff;
  box-shadow: 0 3px 0 #59407919;
}
.bulk-choices, .bulk-total { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.bulk-choices button { min-height: 35px; padding: 4px 8px; white-space: nowrap; }
.bulk-choices button:disabled { color: #70677b; box-shadow: none; opacity: .65; }
.bulk-total { justify-content: space-between; gap: 10px; }
.bulk-total .primary, .sell-sets .primary { min-height: 42px; padding: 5px 11px; white-space: nowrap; }
#market-selection { display: grid; line-height: 1.25; }
#market-selection span { color: #594a6b; font-size: .82rem; }
#market-selection small { display: block; color: #623982; }
#market-selection strong { font-size: 1.08rem; }
.market-tile { position: relative; }
.market-tile:has(:checked) { border-color: #7852ba; box-shadow: 0 0 0 2px #7852ba; }
.market-tile:focus-within { outline: 2px solid #6844c1; outline-offset: 2px; }
.market-tile .tile-info { display: grid; gap: 5px; }
.market-tile-name { display: flex; align-items: center; gap: 4px; margin-top: 7px; cursor: pointer; }
.market-tile-name::after { content: ""; position: absolute; inset: 0; }
.market-tile-name input { position: relative; z-index: 1; margin: 0; width: 17px; height: 17px; flex: 0 0 17px; accent-color: #7044b8; }
.market-tile-name strong { font-size: .86rem; white-space: nowrap; }
.market-card-price { font-weight: 800; }
.sell-sets { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.sale-lines { max-height: min(22dvh, 165px); overflow-y: auto; padding-inline: 2px; }
.sale-bonus { display: flex; justify-content: space-between; gap: 6px; color: #634083; font-size: .86rem; }

/* The foil stays on collected cards. Motion belongs to the draw reveal. */
.photocard { background: var(--card-foil, var(--edge)); }
.grade-0 {
  --card-foil: linear-gradient(145deg, #edfaff, #afc8da 50%, #dcebf4);
  --portrait-tint: linear-gradient(155deg, #cdf5ff24, transparent 40%, #34678230);
}
.grade-1 {
  --card-foil: linear-gradient(135deg, #dafdec, #5cc9ad 45%, #9ef0ff 70%, #4b9ecc);
  --portrait-tint: repeating-linear-gradient(135deg, #85ffe141 0 7px, transparent 7px 26px);
}
.grade-2 {
  --card-foil: linear-gradient(135deg, #ffe4ff, #b07bfc 29%, #f8b2ff 52%, #7149d0 76%, #bce5ff);
  --portrait-tint: conic-gradient(from 28deg at 20% 110%, #a76aff63, transparent 18%, #cf85ff56 28%, transparent 44%, #7ccaff63);
}
.grade-3 {
  --card-foil: linear-gradient(133deg, #fffbe5, #ffdf62 20%, #f28f38 40%, #fff9c4 54%, #ffbc5d 73%, #ffa5c6 89%, #ffed9a);
  --portrait-tint: conic-gradient(from 55deg at 50% 95%, #ffd56b62, #ff80c427, #78caff3b, #ffd07359, #ffd56b62);
}
.photo-foil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--portrait-tint);
  box-shadow: inset 0 0 12px var(--edge);
  mix-blend-mode: screen;
}

.rarity-0 {
  --scene: radial-gradient(ellipse at 50% 52%, #56728d, #283449 65%, #202b40);
  --pattern: radial-gradient(#c6ebff95 1px, transparent 1.5px);
  --pattern-size: 24px 24px;
  --glow: #bde9ff;
  --spark: #ebfbff;
  --reveal-time: .42s;
}
.rarity-1 {
  --scene: radial-gradient(ellipse at 50% 52%, #408f8e, #164d5b 66%, #12293d);
  --pattern: repeating-linear-gradient(128deg, #ccfff032 0 1px, transparent 1px 16px);
  --pattern-size: auto;
  --glow: #88ffe2;
  --spark: #d6fff3;
  --reveal-time: .62s;
}
.rarity-2 {
  --scene: radial-gradient(ellipse at 54% 46%, #a66aed, #562661 57%, #231442);
  --pattern: repeating-conic-gradient(from 24deg at 50% 52%, #e3a6ff2c 0deg 9deg, transparent 9deg 28deg);
  --pattern-size: auto;
  --glow: #f2bbff;
  --spark: #f5dfff;
  --reveal-time: .82s;
}
.rarity-3 {
  --scene: radial-gradient(ellipse at 50% 54%, #ffed9c, #bc633d 29%, #55255e 60%, #20123a);
  --pattern: repeating-conic-gradient(from 31deg at 50% 52%, #ffdf8673 0deg 7deg, transparent 7deg 16deg, #ffc8fa5b 16deg 20deg, transparent 20deg 30deg);
  --pattern-size: auto;
  --glow: #ffe28a;
  --spark: #fff5bd;
  --reveal-time: 1.05s;
}
.reveal-pad {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 18px 12px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--scene);
}
.reveal-pad::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -28%;
  background: var(--pattern);
  background-size: var(--pattern-size);
}
.reveal-pad .photocard {
  z-index: 1;
  width: clamp(124px, 43%, 156px);
  transform: rotate(3deg);
  box-shadow: 3px 4px 0 #20172f, 0 0 13px var(--glow);
}
.reveal-pad.rarity-3 .photocard { width: clamp(140px, 49%, 180px); }
.reveal-halo, .reveal-halo::before, .reveal-halo::after {
  position: absolute;
  inset: 10% 16%;
  border: 1px solid var(--glow);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--glow), inset 0 0 14px var(--glow);
  pointer-events: none;
}
.reveal-halo { z-index: -1; opacity: .72; }
.rarity-2 .reveal-halo::before, .rarity-3 .reveal-halo::before {
  content: "";
  inset: 12% -11%;
  transform: rotate(-26deg);
}
.rarity-3 .reveal-halo::after {
  content: "";
  inset: -9% -13%;
  border-style: dashed;
  transform: rotate(15deg);
}
.reveal-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--spark);
  pointer-events: none;
  filter: drop-shadow(0 0 4px var(--glow));
}
.reveal-spark:nth-child(3n) { fill: var(--glow); }
.rarity-3 .reveal-spark:nth-child(4n) { fill: #ffd2fa; }
.is-draw .photocard { animation: card-arrival var(--reveal-time) cubic-bezier(.19,.85,.36,1.24) both; }
.is-draw .reveal-halo { animation: ring-arrival var(--reveal-time) ease-out both; }
.is-draw .reveal-particles { animation: spark-arrival var(--reveal-time) ease-out both; }
.is-draw.rarity-2::before, .is-draw.rarity-3::before { animation: ray-arrival var(--reveal-time) ease-out both; }
.is-draw.rarity-3 .photo-foil { animation: foil-arrival 1.15s ease-out both; }
.is-draw.rarity-2 .reveal-particles {
  animation: spark-arrival var(--reveal-time) ease-out, sr-orbit 9s linear var(--reveal-time) infinite;
}
.is-draw.rarity-2 .reveal-halo::before {
  border-style: dashed;
  animation: sr-ring 6s linear infinite;
}

.character-action {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .character-action { display: none; }
}

@keyframes card-arrival {
  from { opacity: .2; transform: translateY(15px) scale(.56) rotate(-12deg); }
  to { opacity: 1; transform: rotate(3deg); }
}
@keyframes ring-arrival { from { opacity: 0; transform: scale(.72); } }
@keyframes spark-arrival { from { opacity: .1; transform: scale(.25) rotate(-14deg); } }
@keyframes ray-arrival { from { opacity: .2; transform: rotate(-19deg) scale(.9); } }
@keyframes foil-arrival { from { opacity: .3; } 55% { opacity: 1; } to { opacity: .75; } }
@keyframes sr-orbit { to { transform: rotate(1turn); } }
@keyframes sr-ring {
  from { transform: rotate(-26deg); }
  to { transform: rotate(334deg); }
}
@media (max-width: 620px) {
  .bulk-toolbar { align-items: stretch; flex-direction: column; }
  .bulk-total { flex-wrap: nowrap; }
}
@media (max-width: 390px) {
  .price-table { border-spacing: 2px; }
  .price-table .gem { width: 13px; height: 13px; margin-right: 2px; }
  .price-table .grade-pill { padding-inline: 3px; }
  .bulk-choices button { font-size: .78rem; }
}

.machine-odds {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 49px;
  margin: 0 8px 12px;
  padding: 6px 8px 6px 11px;
  border: 1px solid #6e5696;
  border-radius: 6px;
  background: #eee0ff;
}
.machine-odds > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1px 8px;
  font-size: .83rem;
}
.machine-odds span { color: #5d417a; }
.machine-odds .mini-btn { padding: 6px 9px; white-space: nowrap; }

.stage-set-progress { padding: 12px 16px; border-top: 1px solid #d7c7eb; background: #f8f1ff; }
.stage-set-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.stage-set-header h3 { color: #392553; font-size: .94rem; }
.stage-set-progress ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 8px 0 0; list-style: none; }
.stage-set-progress li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px; border: 1px solid var(--grade-border); border-radius: 6px; background: var(--grade-bg); }
.stage-set-progress li span { display: flex; align-items: center; gap: 2px; font-size: .74rem; font-weight: 700; color: #57476b; }
.stage-set-progress li .complete { color: #235e46; }
.stage-set-progress p, .draw-funding p { font-size: .78rem; color: #57476b; }
.stage-set-progress p { margin-top: 7px; }
@media (max-width: 500px) {
  .stage-set-progress ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.draw-funding { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 16px; background: #fff4cf; border-top: 1px solid #e2c981; }
.draw-funding > div { display: flex; flex-wrap: wrap; gap: 6px; }
.draw-funding .secondary { display: flex; align-items: center; gap: 5px; padding: 4px 8px; font-size: .8rem; }
.draw-funding .secondary svg { width: 15px; height: 15px; }
.stage-clear { display: grid; gap: 3px; margin-top: 10px; padding: 8px; border: 1px solid #b5cdbb; border-radius: 7px; background: #e9f7ed; color: #215c45; }
.stage-clear span { font-size: .82rem; }
.collection-actions { display: flex; justify-content: end; margin-bottom: 10px; }

.odds-current, .odds-all table { margin: 12px 0; }
.odds-current th[scope="row"] { background: var(--grade-bg); }
.odds-current td:last-child { background: #f7f1ff; }
.set-odds {
  padding: 11px;
  text-align: left;
  background: #f3edff;
  border: 1px solid #d8caed;
  border-radius: 7px;
}
.set-odds h3 { margin: 0 0 5px; font-size: .95rem; }
.set-editions, .set-odds-effects { display: grid; gap: 5px; padding: 0; margin: 10px 0 0; list-style: none; }
.set-editions li, .set-odds-effects li {
  display: grid;
  grid-template-columns: 33px 1fr;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 3px 6px;
  border: 1px solid var(--grade-border);
  border-radius: 5px;
  background: var(--grade-bg);
  font-size: .8rem;
}
.set-editions .grade-chip, .set-odds-effects .grade-chip { justify-self: center; }
.set-editions button { min-height: 30px; font-size: .78rem; }
.set-odds-effects li { grid-template-columns: 33px 43px 1fr; text-align: left; }
.set-odds-effects li[data-active] { outline: 2px solid #7b53b0; }
.set-odds .local-set-title { margin-top: 12px; }
.odds-buff-sources { margin-top: 8px; }
.odds-buff-sources summary { color: #533779; font-size: .85rem; font-weight: 750; cursor: pointer; }
.odds-buff-sources .set-odds-effects li { grid-template-columns: 33px 1fr; }
.odds-buff-sources .set-odds-effects li span:last-child { grid-column: 2; }
.set-odds p { margin-top: 6px; font-size: .82rem; }
.set-odds p:not(.muted) { color: #603695; font-weight: 800; }
.odds-all { margin: 13px 0; text-align: left; }
.odds-all summary { color: #533779; font-size: .85rem; font-weight: 750; cursor: pointer; }
.odds-all th[scope="row"] { text-align: left; color: #50416a; }

.collection-albums { display: grid; gap: 12px; }
.collection-stage { min-width: 0; border: 1.5px solid #cdbedc; border-radius: 9px; background: #fbf7ff; }
.collection-stage > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}
.collection-stage > summary::-webkit-details-marker { display: none; }
.collection-stage > summary::after {
  content: "";
  flex: 0 0 8px;
  height: 8px;
  margin: -4px 4px 0;
  border: solid #684d8a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.collection-stage[open] > summary::after { margin-top: 4px; transform: rotate(225deg); }
.collection-stage-title { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
.collection-stage-title small { color: #6f5a86; font: 700 .67rem var(--mono); white-space: nowrap; }
.collection-stage-title strong { font-size: .92rem; }
.collection-stage-progress { font-size: .75rem; font-weight: 750; color: #5d417a; text-align: right; }
.collection-sets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  padding: 0 10px 10px;
}
.collection-set { min-width: 0; padding: 9px; border: 1px solid var(--grade-border); border-radius: 8px; background: var(--grade-bg); }
.collection-set-title { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 9px; }
.collection-set-title h3 { display: flex; align-items: center; gap: 5px; font-size: .85rem; }
.collection-set-progress { display: flex; align-items: center; gap: 3px; font-size: .75rem; font-weight: 750; color: #514561; }
.collection-set-progress.complete { color: #235e46; }
.collection-members {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 132px));
  justify-content: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.collection-slot { position: relative; min-width: 0; text-align: center; }
.collection-slot .photocard { width: 100%; }
.collection-slot .photo-caption { padding-inline: 4px; }
.collection-missing {
  display: grid;
  place-items: center;
  aspect-ratio: .72;
  border: 1.5px dashed var(--grade-border);
  border-radius: 8px;
  background: #ffffff82;
  color: #716381;
}
.collection-quantity {
  position: absolute;
  top: 7px;
  right: 5px;
  padding: 2px 4px;
  border-radius: 4px;
  background: #30243f;
  color: #fff;
  font: 750 .7rem var(--mono);
  pointer-events: none;
}
.collection-open-card { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; }
.collection-open-card::after { content: ""; position: absolute; inset: 0; border-radius: 9px; }
.collection-open-card:focus-visible { outline: 0; }
.collection-open-card:focus-visible::after { outline: 2px solid #6435a0; outline-offset: 2px; }
.collection-open-card:hover .collection-card-name { text-decoration: underline; }
.collection-card-name { display: block; margin-top: 6px; font-size: .8rem; font-weight: 850; }
.collection-slot small { font-size: .68rem; color: #5e526a; white-space: nowrap; }

.card-opening {
  --opening-color: #d98aff;
  --opening-core: #743ac1;
  --opening-ink: #28153d;
  --opening-time: 1.4s;
  --spark: #f5e2ff;
  --glow: #ce87ff;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  min-height: 255px;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: radial-gradient(ellipse at 50% 50%, var(--opening-core), var(--opening-ink) 48%, #100d1d 82%);
  perspective: 500px;
}
.opening-ssr {
  --opening-color: #ffe094;
  --opening-core: #b86437;
  --opening-ink: #412250;
  --opening-time: 1.95s;
  --spark: #fff4c1;
  --glow: #ffc365;
}
.opening-rays, .opening-ring { position: absolute; pointer-events: none; }
.opening-rays {
  inset: -46%;
  z-index: -2;
  background: repeating-conic-gradient(transparent 0 20deg, var(--opening-color) 20deg 22deg, transparent 22deg 30deg);
  mask-image: radial-gradient(circle, #000 12%, #0005 52%, transparent 72%);
  animation: opening-rays var(--opening-time) ease-out both;
}
.opening-ring {
  z-index: -1;
  width: 64%;
  aspect-ratio: 1;
  border: 1px solid var(--opening-color);
  border-radius: 50%;
  box-shadow: 0 0 18px var(--glow), inset 0 0 20px var(--glow);
  animation: opening-ring var(--opening-time) ease-out both;
}
.opening-ssr .opening-ring::after {
  content: "";
  position: absolute;
  inset: -12%;
  border: 1px dashed #fff0a3;
  border-radius: inherit;
}
.card-opening .reveal-particles { animation: opening-particles var(--opening-time) ease-out both; }
.card-seal {
  position: relative;
  display: grid;
  place-items: center;
  width: 111px;
  aspect-ratio: .71;
  overflow: hidden;
  border: 3px solid var(--opening-color);
  border-radius: 8px;
  background:
    repeating-linear-gradient(45deg, #ffffff17 0 1px, transparent 1px 13px),
    linear-gradient(143deg, var(--opening-core), #1b142b 66%);
  box-shadow: 0 0 25px var(--glow), inset 0 0 0 5px #eee3ff29;
  transform-style: preserve-3d;
  animation: opening-seal var(--opening-time) cubic-bezier(.21,.61,.35,1) both;
}
.card-seal img { width: 48px; filter: drop-shadow(0 3px 0 #1d1533); }
.card-seal span {
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, transparent 23%, var(--opening-color) 50%, transparent 75%);
  mix-blend-mode: screen;
  animation: opening-sweep var(--opening-time) ease-in-out both;
}
.opening-skip { min-height: 42px; margin-top: 2px; }

@keyframes opening-seal {
  0% { opacity: 0; transform: translateY(100px) rotate(-26deg) rotateY(75deg) scale(.62); }
  28% { opacity: 1; transform: translateY(0) rotate(8deg) rotateY(-28deg) scale(.98); }
  68% { opacity: 1; transform: translateY(-5px) rotate(-3deg) rotateY(12deg) scale(1.04); }
  100% { opacity: 0; transform: translateY(-17px) rotate(13deg) rotateY(85deg) scale(1.32); }
}
@keyframes opening-rays {
  from { opacity: .12; transform: rotate(-12deg) scale(.45); }
  to { opacity: .80; transform: rotate(28deg) scale(1.2); }
}
@keyframes opening-ring {
  from { opacity: .12; transform: scale(.30) rotateX(38deg); }
  to { opacity: .78; transform: scale(1.07) rotateX(-12deg); }
}
@keyframes opening-particles {
  from { transform: scale(.15) rotate(-20deg); opacity: 0; }
  to { transform: scale(1.22) rotate(10deg); opacity: .9; }
}
@keyframes opening-sweep {
  from { transform: translateY(100%); opacity: .25; }
  to { transform: translateY(-100%); opacity: .85; }
}
