:root { color-scheme: dark; --ink:#f7efdf; --muted:#b7b0c1; --border:#343144; --canvas:#14121e; --sheet:#1e1a29; --gold:#f1bb77; }
* { box-sizing:border-box; }
body { margin:0; color:var(--ink); background:var(--canvas); font: 1rem/1.55 system-ui, "Yu Gothic", sans-serif; }
button { font:inherit; cursor:pointer; }
button:disabled { opacity:.56; cursor:default; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline:2px solid #ffe0a8; outline-offset:4px; }
a { color:inherit; }
.site-header { max-width:1240px; margin:auto; padding:1.25rem clamp(1rem,4vw,3rem); display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.site-header a { text-decoration:none; }
.site-header>a:last-child { font-size:.86rem; color:var(--muted); }
.brand { font-weight:800; }
.brand-mark { color:var(--gold); margin-right:.3rem; }
main { max-width:1240px; margin:auto; padding: 0 clamp(1rem,4vw,3rem) 3rem; }
.hero { position:relative; isolation:isolate; overflow:hidden; min-height:27rem; display:grid; grid-template-columns: minmax(22rem,1.06fr) minmax(20rem,1fr); align-items:center; padding:clamp(1.5rem,5vw,4rem); border-radius:1.5rem; border:1px solid #493c58; background:radial-gradient(ellipse at 74% 43%,#533156,transparent 62%),linear-gradient(130deg,#261a34,#1c182b); }
.hero-copy { z-index:1; }
.series { margin:0 0 .9rem; color:var(--gold); font-size:.87rem; font-weight:800; letter-spacing:.13em; }
h1 { font-size:clamp(2.55rem,6.3vw,5.1rem); line-height:1.05; margin:0; font-weight:860; letter-spacing:-.07em; }
.hero-copy>p:not(.series) { color:#ddd3e6; }
.draw-controls { display:flex; align-items:center; flex-wrap:wrap; gap:.85rem; margin-top:1.5rem; }
.draw-button { padding:.72rem 1.15rem; border:1px solid #ffc98b; border-radius:.65rem; background:#f6c27f; color:#281a22; font-weight:850; box-shadow:0 4px 0 #a46049; }
.draw-button:not(:disabled):hover { background:#ffd69f; }
.draw-button span { padding-left:.5rem; }
.draw-count { font-size:.85rem; font-weight:800; white-space:nowrap; }
.hero-copy .draw-note, .hero-copy .status { margin:.55rem 0 0; font-size:.78rem; }
.status { min-height:1.35em; }
.hero-art { position:relative; align-self:stretch; min-height:20rem; pointer-events:none; }
.hero-art .card-back { position:absolute; height:auto; width: min(54%, 13rem); top:50%; left:50%; box-shadow:0 16px 34px #0c0817ad; }
.hero-art .card-back:nth-child(1) { transform:translate(-110%,-43%) rotate(-15deg); }
.hero-art .card-back:nth-child(2) { transform:translate(-46%,-56%) rotate(1deg); z-index:1; }
.hero-art .card-back:nth-child(3) { transform:translate(18%,-43%) rotate(16deg); }
.details { margin:1rem .25rem 1.9rem; color:var(--muted); font-size:.84rem; }
summary { cursor:pointer; width:fit-content; }
.details p { margin:.35rem 0; }
.album-header { display:flex; align-items:end; justify-content:space-between; gap:.8rem; margin-bottom:1.15rem; }
h2 { font-size:clamp(1.45rem,3vw,2.4rem); margin:0; line-height:1.15; letter-spacing:-.035em; }
.album-header p { color:var(--muted); margin:.45rem 0 0; font-size:.85rem; }
.filters { display:flex; gap:.25rem; padding:.25rem; background:var(--sheet); border:1px solid var(--border); border-radius:.7rem; }
.filters button { white-space:nowrap; border:0; background:transparent; color:var(--muted); padding:.4rem .6rem; border-radius:.4rem; font-size:.82rem; }
.filters button[aria-pressed=true] { background:#544264; color:white; }
.card-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:clamp(.65rem,1.5vw,1.2rem); }
.card-trigger { display:block; color:inherit; background:none; border:0; padding:0; text-align:left; border-radius:.8rem; }
.card-trigger:hover .card { border-color:var(--tone); transform:translateY(-3px); }
.card { --tone:#ccc0d0; --edge:#655569; height:100%; display:flex; flex-direction:column; padding:.58rem; border:1px solid var(--edge); border-radius:.8rem; background:linear-gradient(155deg,#322841,#201b2b 57%); transition:transform .2s,border-color .2s; }
.card[data-rarity=R] { --tone:#acdff6; --edge:#4d829d; background:linear-gradient(155deg,#233b55,#211d30 64%); }
.card[data-rarity=SR] { --tone:#e0baff; --edge:#9d6ab8; background:linear-gradient(155deg,#483260,#241b32 65%); }
.card[data-rarity=SSR] { --tone:#ffe0a1; --edge:#cb9b5e; background:linear-gradient(155deg,#5b3c37,#2b2032 65%); box-shadow:inset 0 0 0 2px #f1c58924; }
.card header, .card footer { display:flex; align-items:center; justify-content:space-between; gap:.4rem; }
.card header { margin-bottom:.46rem; }
.rarity { font-size:.66rem; line-height:1; font-weight:900; letter-spacing:.05em; color:#251c2b; background:var(--tone); padding:.34rem .52rem; border-radius:.3rem; }
.card-series, .card-person { color:var(--tone); font-size:.7rem; }
.illustration { position:relative; overflow:hidden; border-radius:.42rem; border:1px solid var(--edge); background:#241e31; }
.illustration>.art { width:100%; aspect-ratio:640 / 480; height:auto; object-fit:cover; display:block; }
.rhino { position:absolute; width:29%; aspect-ratio:1.18; border-radius:.38rem; overflow:hidden; background:white; bottom:4%; right:4%; }
.rhino img { display:block; width:100%; height:auto; }
.card-content { flex:1; }
.card-person { margin:.5rem 0 0; }
.card h3 { margin:.1rem 0 .42rem; font-size:clamp(.9rem,1.65vw,1.15rem); line-height:1.28; }
.card-stats { display:grid; grid-template-columns:1fr 1fr; gap:.3rem; font-size:.65rem; }
.card-stats span { background:#0c091754; padding:.22rem .34rem; border-radius:.3rem; }
.card-stats strong { font-size:.78rem; font-variant-numeric:tabular-nums; color:var(--tone); }
.flavor { color:#e0d6e5; font-size:.72rem; margin:.5rem 0; }
.card footer { padding-top:.33rem; border-top:1px solid #ffffff24; color:#c7bcd0; font-size:.66rem; }
dialog { width:min(90vw,25rem); max-height:90dvh; overflow:auto; padding:.9rem; background:#211a2e; color:var(--ink); border:1px solid #956c9d; border-radius:.9rem; }
dialog::backdrop { background:#080613cf; }
.dialog-bar { display:flex; justify-content:space-between; align-items:center; margin-bottom:.65rem; }
.dialog-bar h2 { font-size:1.25rem; }
.dialog-bar button { border:0; background:none; color:var(--ink); font-size:1.5rem; }
#dialog-draw { display:block; width:100%; margin-top:.85rem; }
#dialog-draw[hidden] { display:none; }
@media(max-width:900px) { .card-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:740px) {
  .hero { grid-template-columns:minmax(0,1fr); padding-bottom:1.5rem; min-height:0; }
  .hero-art { min-height:15.5rem; margin-top:.6rem; }
  .hero-art .card-back { width:min(43%,9.7rem); }
}
@media(max-width:620px) { .card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(prefers-reduced-motion:reduce) { * { transition:none!important; } }

.album-selectors { display:flex; flex-wrap:wrap; gap:.65rem 1rem; margin-bottom:1.1rem; }
.album-selectors label { display:flex; align-items:center; gap:.45rem; color:var(--muted); font-size:.85rem; }
.album-selectors select, #more-cards { color:var(--ink); background:var(--sheet); border:1px solid var(--border); border-radius:.5rem; padding:.42rem .6rem; font:inherit; }
#more-cards { display:block; margin:1.2rem auto 0; padding:.55rem 1.1rem; }
#more-cards[hidden] { display:none; }
.illustration.art-sheet { aspect-ratio:10 / 9; }
.illustration.art-sheet > .art { position:absolute; width:300%; height:500%; max-width:none; max-height:none; aspect-ratio:auto; object-fit:fill; }

.brand { min-width:0; overflow-wrap:anywhere; }
.site-header > a:last-child { flex-shrink:0; }
.album-note { color:var(--muted); font-size:.85rem; margin:-.35rem 0 .9rem; }
.card-back { aspect-ratio: 5 / 7; display:grid; place-items:center; border:1px solid #806575; border-radius:.8rem; background:repeating-linear-gradient(45deg,#34263e,#34263e 7px,#3d2e47 7px,#3d2e47 8px); }
.card-back::before { content:"✦"; border:1px solid #a88591; border-radius:50%; color:#d5af8f; width:34%; aspect-ratio:1; display:grid; place-items:center; font-size:clamp(1.2rem,4vw,2.6rem); background:#2d2236; }
.locked-card { border:1px solid var(--border); border-radius:.8rem; padding:.58rem; background:#211b2b; }
.locked-card .card-back { min-height:0; aspect-ratio: 4 / 3; opacity:.8; }
.locked-card p { display:flex; justify-content:space-between; align-items:center; gap:.35rem; margin:.65rem .1rem .15rem; }
.locked-card strong { font-size:.76rem; color:var(--muted); }

.mystery-art .art { filter:blur(16px) brightness(.75) saturate(.65); }
.mystery-art:not(.art-sheet) .art { transform:scale(1.09); }
.mystery-art.art-sheet .art { filter:blur(16px) brightness(.75) saturate(.65); }
.pdf-controls button { display:block; width:100%; margin-top:.75rem; padding:.55rem; border:1px solid #956c9d; border-radius:.55rem; background:#31213e; color:var(--ink); }
.pdf-controls [hidden], .draw-reveal[hidden] { display:none; }
#pdf-status { margin:.4rem 0 0; font-size:.8rem; color:#ffd8cc; }
.draw-reveal { position:relative; height:clamp(18rem,60vh,24rem); isolation:isolate; display:grid; place-items:center; overflow:hidden; border-radius:.7rem; background:radial-gradient(ellipse at center,#43345c,#14101f 75%); perspective:800px; }
.draw-reveal canvas { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.draw-reveal .reveal-back { position:relative; width:40%; max-width:9rem; box-shadow:0 0 32px var(--reveal-ink,#eee); transform-style:preserve-3d; }
.draw-reveal.is-playing .reveal-back { animation:card-summon var(--reveal-time,1s) both; }
#skip-reveal { position:absolute; bottom:.6rem; right:.6rem; padding:.35rem .65rem; color:var(--ink); background:#211a2e; border:1px solid #805e8a; border-radius:.4rem; font-size:.83rem; }
@keyframes card-summon {
  0% { transform:translateY(45%) rotateY(-65deg) scale(.65); opacity:0; }
  38% { transform:translateY(-4%) rotateY(8deg) scale(.94); opacity:1; }
  58% { transform:translateY(-5%) rotateY(0) scale(1); opacity:1; }
  86% { transform:translateY(0) rotateY(90deg) scale(1.09); opacity:.8; }
  100% { transform:translateY(0) rotateY(100deg) scale(1.02); opacity:0; }
}
@media (prefers-reduced-motion:reduce) { .draw-reveal * { animation:none!important; } }
