.certificate-dialog{width:min(94vw,760px);max-height:96vh;padding:0;border:0;border-radius:2rem;background:transparent;color:var(--secondary);box-shadow:0 35px 110px rgba(15,23,42,.5)}
.certificate-dialog::backdrop{background:radial-gradient(circle,rgba(23,54,93,.68),rgba(10,20,36,.92));backdrop-filter:blur(7px)}
.certificate-dialog__shell{position:relative;max-height:94vh;overflow-y:auto;padding:1rem;background:linear-gradient(135deg,#fff,#fff6e4);border-radius:2rem}.certificate-dialog__close{position:absolute;z-index:10;right:1.55rem;top:1.45rem;display:grid;place-items:center;width:2.5rem;height:2.5rem;border:2px solid rgba(23,54,93,.12);border-radius:50%;background:#fff;font-size:1.6rem;box-shadow:0 5px 16px rgba(15,23,42,.18)}
.certificate{position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;gap:.18rem;min-height:500px;padding:1.25rem 2.5rem 1rem;text-align:center;border:9px solid var(--primary);outline:5px solid #f3b62f;outline-offset:-20px;background:radial-gradient(circle at 50% -10%,#fff9ce,transparent 38%),radial-gradient(circle at 0 100%,rgba(199,53,58,.14),transparent 34%),radial-gradient(circle at 100% 100%,rgba(45,148,214,.16),transparent 34%),#fffdf8;box-shadow:inset 0 0 0 28px rgba(255,255,255,.62)}
.certificate__rays{position:absolute;z-index:-2;inset:-60%;opacity:.16;background:repeating-conic-gradient(from 0deg,#f59e0b 0deg 6deg,transparent 6deg 13deg);animation:certificate-rays 80s linear infinite}.certificate:after{content:"";position:absolute;z-index:-1;inset:32px;border:2px solid rgba(23,54,93,.5);clip-path:polygon(0 14px,14px 14px,14px 0,calc(100% - 14px) 0,calc(100% - 14px) 14px,100% 14px,100% calc(100% - 14px),calc(100% - 14px) calc(100% - 14px),calc(100% - 14px) 100%,14px 100%,14px calc(100% - 14px),0 calc(100% - 14px))}
.certificate__corner{position:absolute;color:#f3b62f;font-size:2.1rem;text-shadow:0 2px 0 #fff}.certificate__corner--one{left:44px;top:39px}.certificate__corner--two{right:44px;top:39px}.certificate__corner--three{left:48px;bottom:42px;color:var(--primary)}.certificate__corner--four{right:48px;bottom:42px;color:var(--primary)}
.certificate__brand{position:relative;z-index:2;display:flex;flex:0 0 auto;align-items:center;justify-content:center;gap:.75rem;width:max-content;max-width:88%;min-height:68px;margin:0 auto .25rem;padding:0 1.25rem;border-radius:999px;background:radial-gradient(ellipse,#fffdf8 60%,rgba(255,253,248,.88) 78%,transparent);font:800 1.2rem Georgia,serif;letter-spacing:.06em}.certificate__brand img{width:auto;height:68px;max-width:220px;object-fit:contain}.certificate__brand>span{display:grid;place-items:center;width:58px;height:58px;border-radius:50%;background:linear-gradient(145deg,var(--secondary),#2f639b);color:#ffd45e;font-size:1.7rem;box-shadow:0 4px 0 #0c2643}
.certificate__eyebrow{margin:.2rem 0;text-transform:uppercase;letter-spacing:.24em;font-size:.72rem;font-weight:950;color:var(--primary)}.certificate h2{margin:.2rem 0 .45rem;font-family:Georgia,serif;font-size:clamp(1.85rem,5vw,3rem);line-height:1.05;text-shadow:0 2px 0 #fff}.certificate h2+p{font-weight:700;color:#64748b}.certificate__name{display:block;width:max-content;max-width:90%;margin:.2rem auto .45rem;padding:0 1.5rem .2rem;border-bottom:3px double #e8b342;font-family:Georgia,serif;font-size:clamp(1.8rem,5vw,3rem);line-height:1.15;color:var(--primary)}
.certificate__achievement{display:grid;flex:0 0 auto;grid-template-columns:116px minmax(0,1fr) 88px;align-items:center;gap:1.4rem;width:100%;max-width:650px;margin:1.2rem auto 0;padding:1rem 1.2rem;border:1px solid rgba(23,54,93,.14);border-radius:1.4rem;background:rgba(255,255,255,.73);box-shadow:0 8px 28px rgba(23,54,93,.09)}.certificate__progress-ring{--certificate-progress:0deg;display:flex;flex-direction:column;align-items:center;justify-content:center;width:108px;height:108px;border-radius:50%;background:radial-gradient(circle,#fff 0 56%,transparent 58%),conic-gradient(#22a06b 0 var(--certificate-progress),#e5e9ee var(--certificate-progress) 360deg);box-shadow:0 5px 15px rgba(34,160,107,.22)}.certificate__progress-ring strong{font-size:1.55rem;color:#168055}.certificate__progress-ring span{font-size:.62rem;text-transform:uppercase;letter-spacing:.08em}.certificate__progress{display:flex;flex-direction:column;text-align:left}.certificate__progress>span{font-size:.72rem;text-transform:uppercase;letter-spacing:.12em;font-weight:850;color:#64748b}.certificate__progress>strong{font-size:1.6rem;color:var(--primary)}.certificate__progress-track{overflow:hidden;height:.8rem;margin-top:.5rem;border:2px solid #fff;border-radius:1rem;background:#dfe5eb;box-shadow:inset 0 1px 3px rgba(0,0,0,.15)}.certificate__progress-track i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--primary),#f3b62f 58%,#22a06b);transition:width .8s cubic-bezier(.2,.8,.2,1)}.certificate__seal{display:grid;grid-template-rows:1fr auto;place-items:center;width:78px;height:78px;border:5px double #ffd45e;border-radius:50%;background:linear-gradient(145deg,var(--secondary),#28598b);color:#ffd45e;box-shadow:0 6px 0 #0e2948}.certificate__seal b{font-size:1.5rem}.certificate__seal small{margin-top:-.65rem;font-weight:950}
.certificate__ribbon{display:flex;align-items:center;justify-content:center;gap:.5rem;margin:1.15rem auto 0;color:#f3b62f}.certificate__ribbon span{width:90px;height:2px;background:linear-gradient(90deg,transparent,#f3b62f)}.certificate__ribbon span:last-child{transform:scaleX(-1)}.certificate__ribbon b{font-size:1.35rem}
.certificate-dialog__hint{margin:1rem auto;text-align:center;color:#64748b}.certificate-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:.65rem}.certificate-actions>*{display:inline-flex;align-items:center;justify-content:center;padding:.7rem 1rem;border-radius:.8rem;font-weight:850;cursor:pointer}.certificate-actions>*:disabled{cursor:wait;opacity:.65}.certificate-share-button{background:var(--secondary);color:#fff}
@keyframes certificate-rays{to{transform:rotate(360deg)}}
.certificate__achievement{grid-template-columns:100px minmax(0,1fr) 78px;gap:1.1rem;max-width:610px;margin:.75rem auto 0;padding:.7rem 1rem}.certificate__progress-ring{width:92px;height:92px}.certificate__seal{width:70px;height:70px}.certificate__ribbon{margin:.7rem auto 0}.certificate-dialog__hint{margin:.7rem auto}.certificate-actions{position:sticky;z-index:5;bottom:-1rem;margin:0 -1rem -1rem;padding:.6rem 1rem 1rem;background:linear-gradient(0deg,#fff 75%,rgba(255,255,255,0))}
.certificate__finale-mark{display:none}
.certificate[data-certificate-card]{cursor:pointer;transition:transform .2s,box-shadow .2s}.certificate[data-certificate-card]:hover{transform:translateY(-2px)}.certificate[data-certificate-card]:focus-visible{outline:5px solid #3b82f6;outline-offset:4px}.certificate--sharing{cursor:wait!important;opacity:.82}
.certificate--quest-complete{border-color:#d4a62a;outline-color:#17365d;background:radial-gradient(circle at 50% -10%,rgba(255,221,101,.38),transparent 37%),radial-gradient(circle at 0 100%,rgba(23,54,93,.18),transparent 35%),radial-gradient(circle at 100% 100%,rgba(212,166,42,.23),transparent 35%),linear-gradient(145deg,#fffef7,#fff5c9);box-shadow:inset 0 0 0 28px rgba(255,255,255,.7),inset 0 0 80px rgba(212,166,42,.18)}
.certificate--quest-complete:before{content:"★  ✦  ★";position:absolute;z-index:-1;left:50%;bottom:30px;transform:translateX(-50%);width:72%;color:rgba(181,138,24,.2);font-size:2.4rem;letter-spacing:1.6rem;white-space:nowrap}
.certificate--quest-complete:after{border-color:#b58a18;border-width:3px}.certificate--quest-complete .certificate__rays{opacity:.22;background:repeating-conic-gradient(from 0deg,#d4a62a 0deg 5deg,transparent 5deg 12deg)}.certificate--quest-complete .certificate__corner{color:#17365d;font-size:2.45rem}.certificate--quest-complete .certificate__corner--three,.certificate--quest-complete .certificate__corner--four{color:#d4a62a}
.certificate--quest-complete .certificate__finale-mark{position:relative;z-index:3;display:flex;align-items:center;justify-content:center;gap:.8rem;height:34px;margin:-.55rem auto -.15rem;color:#b18312}.certificate--quest-complete .certificate__finale-mark span{font-size:2rem}.certificate--quest-complete .certificate__finale-mark span:last-child{transform:scaleX(-1)}.certificate--quest-complete .certificate__finale-mark b{font-size:1.8rem;color:#17365d;text-shadow:0 2px #f6cc55}
.certificate--quest-complete .certificate__brand{min-height:60px;background:radial-gradient(ellipse,#fff9d7 55%,rgba(255,249,215,.92) 75%,transparent)}.certificate--quest-complete .certificate__eyebrow{max-width:88%;margin:.35rem auto;color:#926c08;font-size:clamp(.95rem,2.6vw,1.35rem);line-height:1.2;letter-spacing:.12em;text-wrap:balance}.certificate--quest-complete h2{color:#17365d;text-shadow:0 2px #f3cf69;font-size:clamp(2rem,5.5vw,3.3rem)}.certificate--quest-complete .certificate__name{color:#17365d;border-bottom-color:#b98b16;text-shadow:0 1px #fff}
.certificate--quest-complete .certificate__achievement{border:2px solid rgba(181,138,24,.3);background:linear-gradient(135deg,rgba(255,255,255,.9),rgba(255,246,199,.88));box-shadow:0 8px 28px rgba(96,70,5,.16)}.certificate--quest-complete .certificate__progress-ring{background:radial-gradient(circle,#fffbed 0 56%,transparent 58%),conic-gradient(#d4a62a 0 var(--certificate-progress),#e8dfbf var(--certificate-progress) 360deg);box-shadow:0 5px 18px rgba(181,138,24,.35)}.certificate--quest-complete .certificate__progress-ring strong{color:#9b7208}.certificate--quest-complete .certificate__progress>strong{color:#9b7208}.certificate--quest-complete .certificate__progress-track i{background:linear-gradient(90deg,#17365d,#d4a62a 55%,#f4cc55)}.certificate--quest-complete .certificate__seal{border-color:#fff1a5;background:radial-gradient(circle,#d4a62a,#8b6508);color:#fff8cb;box-shadow:0 6px 0 #6e5008,0 8px 20px rgba(110,80,8,.3)}.certificate--quest-complete .certificate__ribbon{color:#17365d}.certificate--quest-complete .certificate__ribbon span{background:linear-gradient(90deg,transparent,#b58a18)}
.quest-completion-celebration{display:none}.certificate-dialog__shell--quest-complete .quest-completion-celebration{position:fixed;z-index:20;inset:0;display:block;overflow:hidden;pointer-events:none}.quest-firework{position:absolute;width:12rem;height:12rem;border-radius:50%;opacity:0;background:repeating-conic-gradient(from 0deg,#ffd34e 0deg 3deg,transparent 3deg 14deg);mask:radial-gradient(circle,transparent 0 28%,#000 30% 34%,transparent 36% 48%,#000 50% 53%,transparent 55%);animation:quest-firework 1.7s ease-out forwards}.quest-firework--one{left:8%;top:12%}.quest-firework--two{right:7%;top:20%;animation-delay:.35s;background:repeating-conic-gradient(from 5deg,#ef476f 0deg 3deg,transparent 3deg 13deg)}.quest-firework--three{left:46%;top:4%;animation-delay:.7s;background:repeating-conic-gradient(from 3deg,#53d8fb 0deg 3deg,transparent 3deg 12deg)}.quest-firework--four{left:18%;top:48%;animation-delay:1.05s;background:repeating-conic-gradient(from 7deg,#a78bfa 0deg 4deg,transparent 4deg 15deg)}.quest-firework--five{right:16%;top:53%;animation-delay:1.35s;background:repeating-conic-gradient(from 2deg,#70d68c 0deg 3deg,transparent 3deg 12deg)}.quest-firework--six{left:44%;top:58%;animation-delay:1.65s;background:repeating-conic-gradient(from 6deg,#ff7b35 0deg 4deg,transparent 4deg 14deg)}.quest-confetti i{position:absolute;top:-8%;width:.65rem;height:1.15rem;border-radius:2px;background:#ffd34e;animation:quest-confetti 4.2s ease-in forwards}.quest-confetti i:nth-child(3n){background:#ef476f}.quest-confetti i:nth-child(3n+1){background:#53d8fb}.quest-confetti i:nth-child(4n){border-radius:50%;background:#70d68c}.quest-confetti i:nth-child(5n){background:#a78bfa}.quest-confetti i:nth-child(7n){background:#ff7b35}.quest-confetti i:nth-child(1){left:4%;animation-delay:.1s}.quest-confetti i:nth-child(2){left:10%;animation-delay:.55s}.quest-confetti i:nth-child(3){left:16%;animation-delay:.2s}.quest-confetti i:nth-child(4){left:23%;animation-delay:.85s}.quest-confetti i:nth-child(5){left:29%;animation-delay:.35s}.quest-confetti i:nth-child(6){left:35%;animation-delay:1s}.quest-confetti i:nth-child(7){left:41%;animation-delay:.05s}.quest-confetti i:nth-child(8){left:47%;animation-delay:.7s}.quest-confetti i:nth-child(9){left:53%;animation-delay:.25s}.quest-confetti i:nth-child(10){left:59%;animation-delay:.95s}.quest-confetti i:nth-child(11){left:65%;animation-delay:.45s}.quest-confetti i:nth-child(12){left:71%;animation-delay:.12s}.quest-confetti i:nth-child(13){left:77%;animation-delay:.78s}.quest-confetti i:nth-child(14){left:83%;animation-delay:.3s}.quest-confetti i:nth-child(15){left:89%;animation-delay:.65s}.quest-confetti i:nth-child(16){left:94%;animation-delay:.18s}.quest-confetti i:nth-child(17){left:20%;animation-delay:1.1s}.quest-confetti i:nth-child(18){left:80%;animation-delay:1.2s}.quest-confetti i:nth-child(19){left:7%;animation-delay:1.4s}.quest-confetti i:nth-child(20){left:13%;animation-delay:.72s}.quest-confetti i:nth-child(21){left:19%;animation-delay:1.65s}.quest-confetti i:nth-child(22){left:26%;animation-delay:.42s}.quest-confetti i:nth-child(23){left:32%;animation-delay:1.3s}.quest-confetti i:nth-child(24){left:38%;animation-delay:.62s}.quest-confetti i:nth-child(25){left:44%;animation-delay:1.75s}.quest-confetti i:nth-child(26){left:50%;animation-delay:.32s}.quest-confetti i:nth-child(27){left:56%;animation-delay:1.5s}.quest-confetti i:nth-child(28){left:62%;animation-delay:.82s}.quest-confetti i:nth-child(29){left:68%;animation-delay:1.22s}.quest-confetti i:nth-child(30){left:74%;animation-delay:.52s}.quest-confetti i:nth-child(31){left:80%;animation-delay:1.82s}.quest-confetti i:nth-child(32){left:86%;animation-delay:.28s}.quest-confetti i:nth-child(33){left:92%;animation-delay:1.45s}.quest-confetti i:nth-child(34){left:97%;animation-delay:.9s}.quest-confetti i:nth-child(35){left:2%;animation-delay:1.95s}.quest-confetti i:nth-child(36){left:72%;animation-delay:2.05s}
@keyframes quest-firework{0%{opacity:0;transform:scale(.08) rotate(0)}25%{opacity:1}75%{opacity:1}100%{opacity:0;transform:scale(1.65) rotate(25deg)}}@keyframes quest-confetti{0%{transform:translateY(-10vh) rotate(0);opacity:1}100%{transform:translateY(115vh) rotate(720deg);opacity:.4}}
@media(max-width:620px){.certificate-dialog__shell{padding:.55rem}.certificate{min-height:480px;padding:1.5rem 1rem 1rem}.certificate__achievement{grid-template-columns:82px 1fr;padding:.65rem;gap:.7rem}.certificate__progress-ring{width:78px;height:78px}.certificate__seal{display:none}.certificate__corner{font-size:1.5rem}.certificate-actions{bottom:-.55rem;margin:0 -.55rem -.55rem;padding:.55rem}.certificate-actions>*{flex:1 1 42%}}
@media(max-height:700px) and (min-width:621px){.certificate{min-height:455px;padding-top:.8rem}.certificate__brand{min-height:56px}.certificate__brand img{height:56px;max-width:190px}.certificate__achievement{margin-top:.5rem}.certificate__ribbon{margin-top:.4rem}.certificate-dialog__hint{font-size:.85rem;margin:.45rem auto}}
@media(prefers-reduced-motion:reduce){.certificate__rays,.quest-firework,.quest-confetti i{animation:none}.certificate__progress-track i,.certificate[data-certificate-card]{transition:none}}
