/* rich-presence add-on stylesheet: docs, templates, community pages */

/* animation vocabulary (shapes mirrored from the reference bundle) */
@keyframes fade{0%{opacity:0}}
@keyframes pop{0%{opacity:0;transform:translateY(3px)}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes unsaved-in{0%{opacity:0;transform:translate(-50%,10px)}}
@keyframes rise{0%{opacity:0;transform:translateY(4px)}}
@keyframes drop{to{opacity:0;transform:translateY(2px)}}
@keyframes tpulse{0%,to{transform:scale(1)}50%{transform:scale(1.07)}}
@keyframes tin{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes sk{0%{background-position:100% 0}to{background-position:-100% 0}}

/* animation utilities */
.anim-fade{animation:.12s ease-out fade both}
.anim-pop{animation:.14s ease-out pop both}
.anim-rise{animation:.25s ease-out rise both}
.anim-tin{animation:.38s cubic-bezier(.4,0,.2,1) both tin}
.spinner{width:22px;height:22px;border:3px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:.8s linear infinite spin;display:inline-block}
.skeleton{background:linear-gradient(90deg,var(--panel) 0%,rgba(239,231,227,.12) 50%,var(--panel) 100%) 0 0/200% 100%;border-radius:6px;animation:1.4s ease-in-out infinite sk;display:block;min-height:12px}
.pulse{animation:1.4s ease-in-out 3 tpulse}

/* route entrance */
.doc-page,.page-enter{width:100%;max-width:980px;margin:0 auto;animation:.28s cubic-bezier(.4,0,.2,1) both tin}
.doc-page>*,.page-enter>*{animation:.38s cubic-bezier(.4,0,.2,1) both tin;animation-delay:calc(var(--i,0) * 30ms)}

/* document page */
.doc-head{display:grid;gap:10px;margin-bottom:32px}
.doc-badge{display:inline-flex;align-items:center;gap:6px;width:max-content;border:1px solid rgba(246,181,191,.28);background:rgba(246,181,191,.09);color:var(--accent);border-radius:20px;padding:4px 11px;font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
.doc-title{font-size:32px;line-height:1.18;letter-spacing:-1px;font-weight:600;margin:0}
.doc-lead{color:var(--muted);font-size:15px;line-height:1.7;max-width:62ch;margin:0}
.doc-section{margin:0 0 26px}
.doc-section h2{font-size:18px;line-height:1.3;font-weight:600;letter-spacing:-.3px;margin:0 0 12px;color:var(--text)}
.doc-section p{color:var(--muted);font-size:14px;line-height:1.7;margin:0 0 12px;max-width:70ch}
.doc-section a{color:var(--accent);border-bottom:1px solid rgba(246,181,191,.3);transition:color .15s,border-color .15s}
.doc-section a:hover{color:var(--text);border-color:var(--text)}
.doc-list{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:8px}
.doc-list li{position:relative;padding-left:22px;color:var(--muted);font-size:14px;line-height:1.6}
.doc-list li:before{content:"";position:absolute;left:4px;top:10px;width:6px;height:6px;border-radius:50%;background:var(--accent)}
.doc-steps{counter-reset:step;list-style:none;margin:14px 0 0;padding:0;display:grid;gap:14px}
.doc-steps li{counter-increment:step;position:relative;padding-left:42px;color:var(--muted);font-size:14px;line-height:1.6;min-height:32px}
.doc-steps li:before{content:counter(step);position:absolute;left:0;top:0;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:rgba(124,92,255,.16);border:1px solid rgba(124,92,255,.4);color:var(--accent);font-size:12px;font-weight:600}
.doc-section code{background:var(--panel);border:1px solid var(--line);border-radius:5px;padding:1px 6px;font-size:12px;color:var(--accent)}

/* frequently asked questions */
.faq-item{border:1px solid var(--line);background:var(--panel);border-radius:14px;margin-top:8px;transition:border-color .2s,background .2s,transform .2s}
.faq-item:hover{border-color:rgba(246,181,191,.25)}
.faq-item summary{color:var(--text);cursor:pointer;padding:13px 16px;font-size:14px;font-weight:500;list-style:none;transition:color .15s}
.faq-item summary:hover{color:var(--accent)}
.faq-item summary::-webkit-details-marker{display:none}
.faq-item summary:after{content:"+";float:right;color:var(--muted);transition:transform .2s,color .2s}
.faq-item[open]{background:var(--panel);border-color:rgba(246,181,191,.3)}
.faq-item[open] summary:after{content:"-";color:var(--accent)}
.faq-item .faq-body,.faq-item p{color:var(--muted);font-size:14px;line-height:1.7;margin:0;padding:0 16px 16px;animation:.18s ease-out fade both}

/* tabs */
.tabs{border-bottom:1px solid var(--line);scrollbar-width:none;gap:4px;padding:6px;display:flex;overflow-x:auto}
.tabs::-webkit-scrollbar{display:none}
.tab,.tabs button{height:36px;color:var(--muted);white-space:nowrap;border-radius:12px;display:flex;align-items:center;gap:8px;padding:0 14px;font-size:13px;font-weight:500;transition:background .14s,color .14s,transform .2s}
.tab:hover,.tabs button:hover{color:var(--text);background:rgba(239,231,227,.05)}
.tab.active,.tabs button.active,.tabs button.on{background:rgba(246,181,191,.12);color:var(--accent)}

/* template gallery */
.template-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px;margin-top:18px}
.template-card{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:10px;min-width:0;transition:transform .25s cubic-bezier(.4,0,.2,1),border-color .2s,box-shadow .25s;animation:.38s cubic-bezier(.4,0,.2,1) both tin;animation-delay:calc(var(--i,0) * 40ms)}
.template-grid .template-card:nth-child(1){--i:1}
.template-grid .template-card:nth-child(2){--i:2}
.template-grid .template-card:nth-child(3){--i:3}
.template-grid .template-card:nth-child(4){--i:4}
.template-grid .template-card:nth-child(5){--i:5}
.template-grid .template-card:nth-child(6){--i:6}
.template-grid .template-card:nth-child(7){--i:7}
.template-grid .template-card:nth-child(8){--i:8}
.template-card:hover{transform:translateY(-4px);border-color:rgba(246,181,191,.32);box-shadow:0 16px 34px rgba(0,0,0,.35)}
.template-card .act{display:flex;align-items:center;gap:8px;margin-left:auto;color:var(--muted);font-size:12px}
.template-card h3{font-size:15px;font-weight:600;letter-spacing:-.2px;margin:0;color:var(--text)}
.template-card p{color:var(--muted);font-size:12.5px;line-height:1.6;margin:0}
.template-card .meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:#8d7d76;font-size:11px;margin-top:auto;border-top:1px solid var(--line);padding-top:10px}
.favorite{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;border:1px solid var(--line);background:rgba(239,231,227,.04);color:var(--muted);transition:color .15s,border-color .15s,background .15s,transform .2s}
.favorite:hover{color:var(--accent);border-color:rgba(246,181,191,.4);transform:translateY(-2px)}
.favorite.on,.favorite[aria-pressed=true]{color:var(--accent);background:rgba(246,181,191,.12);border-color:rgba(246,181,191,.4)}
.favorite svg{width:16px;height:16px}

/* reviews and reporting */
.review-form,.report-form{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:20px;display:flex;flex-direction:column;gap:14px}
.stars{display:flex;gap:6px;align-items:center}
.star{width:30px;height:30px;display:grid;place-items:center;color:#6f6059;font-size:22px;line-height:1;transition:color .15s,transform .2s}
.star:hover{transform:scale(1.1)}
.star.on,.star.active,.star.selected{color:var(--accent)}
.review-list{display:grid;gap:10px;margin-top:18px}
.review{border:1px solid var(--line);background:var(--panel);border-radius:14px;padding:14px 16px;transition:border-color .2s,transform .2s;animation:.38s cubic-bezier(.4,0,.2,1) both tin;animation-delay:calc(var(--i,0) * 30ms)}
.review-list .review:nth-child(1){--i:1}
.review-list .review:nth-child(2){--i:2}
.review-list .review:nth-child(3){--i:3}
.review-list .review:nth-child(4){--i:4}
.review-list .review:nth-child(5){--i:5}
.review-list .review:hover{border-color:rgba(246,181,191,.25);transform:translateY(-2px)}
.review .stars .star{width:18px;height:18px;font-size:14px}
.report-form label{color:var(--muted);font-size:12px}
.report-form small{color:#8d7d76;font-size:11px}

/* upload and thumbnails */
.dropzone{border:1px dashed rgba(246,181,191,.35);border-radius:14px;background:rgba(239,231,227,.03);padding:26px 18px;text-align:center;color:var(--muted);font-size:13px;display:grid;place-items:center;gap:6px;cursor:pointer;transition:border-color .2s,background .2s,transform .2s}
.dropzone:hover{border-color:var(--accent);background:rgba(246,181,191,.07)}
.dropzone.active{border-color:var(--accent);background:rgba(246,181,191,.12);color:var(--text);transform:scale(1.01)}
.thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:10px;margin-top:10px}
.thumb{aspect-ratio:1.6;border:1px dashed rgba(239,231,227,.18);background:var(--bg) center/cover no-repeat;color:#8d7d76;border-radius:12px;place-items:center;font-size:12px;display:grid;cursor:pointer;transition:border-color .2s,transform .2s,box-shadow .2s;animation:.14s ease-out pop both}
.thumb:hover{transform:translateY(-3px);border-color:rgba(246,181,191,.45)}
.thumb.has{border-style:solid;color:transparent}
.thumb img{width:100%;height:100%;object-fit:cover;border-radius:inherit}

/* toast / unsaved notice */
.unsaved,.toast{z-index:40;border:1px solid rgba(239,231,227,.15);background:var(--panel);border-radius:14px;align-items:center;gap:10px;width:min(560px,calc(100vw - 28px));padding:10px 18px;font-size:13px;font-weight:500;display:flex;position:fixed;bottom:22px;left:50%;transform:translate(-50%);box-shadow:0 14px 34px rgba(0,0,0,.55);animation:.18s ease-out unsaved-in both}
.unsaved .spinner,.toast .spinner{width:16px;height:16px;border-width:2px}
.unsaved.out,.toast.out{animation:.11s ease-in forwards drop}

/* popovers */
.menu-pop,.lang-pop{z-index:35;border:1px solid rgba(239,231,227,.15);background:var(--panel);border-radius:12px;padding:5px;display:grid;gap:1px;position:absolute;top:calc(100% + 6px);right:0;min-width:160px;box-shadow:0 14px 34px rgba(0,0,0,.5);transform-origin:top;animation:.12s ease-out pop both}
.lang-pop{left:0;right:auto}
.menu-pop button,.lang-pop button{text-align:left;color:var(--muted);font-size:13px;padding:8px 10px;border-radius:8px;display:flex;align-items:center;gap:8px;transition:background .15s,color .15s}
.menu-pop button:hover,.lang-pop button:hover{background:rgba(239,231,227,.06);color:var(--text)}
.menu-pop button.active,.lang-pop button.active{color:var(--accent);background:rgba(246,181,191,.1)}

/* responsive */
@media(max-width:800px){
  .doc-page,.page-enter{max-width:100%;padding:0 4px}
  .doc-title{font-size:26px}
  .doc-lead{font-size:14px}
  .template-grid{grid-template-columns:1fr;gap:10px}
  .thumbs{grid-template-columns:1fr 1fr}
  .tabs{gap:2px;padding:4px;overflow-x:auto;scrollbar-width:none}
  .menu-pop,.lang-pop{max-width:calc(100vw - 32px);overflow:hidden}
  .unsaved,.toast{width:calc(100vw - 28px);bottom:14px}
  .doc-page .doc-list,.doc-page .doc-steps{padding-right:0}
}


/* account menu */
.menu-head{display:flex;align-items:center;gap:10px;padding:10px 10px 8px}
.menu-head img{width:34px;height:34px;border-radius:50%;object-fit:cover}
.menu-head b{display:block;font-size:13px;font-weight:600}
.menu-head span{display:block;font-size:11px;color:var(--muted)}
.menu-pop hr{border:0;border-top:1px solid var(--line);margin:3px 6px}
.menu-pop svg{width:16px;height:16px;color:var(--muted)}
.menu-pop button span{font-size:13px}
.user-button img{width:22px;height:22px;border-radius:50%;object-fit:cover;margin-right:8px;vertical-align:middle}


/* discord-style authorization screen */
.oauth-overlay{position:fixed;inset:0;z-index:60;background:rgba(0,0,0,.72);display:grid;place-items:center;padding:18px;animation:.12s ease-out fade both}
.oauth-card{width:min(440px,100%);max-height:min(86vh,760px);display:flex;flex-direction:column;background:#2b2d31;border-radius:10px;box-shadow:0 24px 70px rgba(0,0,0,.6);overflow:hidden;animation:.18s ease-out pop both}
.oauth-head{text-align:center;padding:22px 20px 14px}
.oauth-logo{width:56px;height:56px;margin:0 auto 10px;border-radius:50%;background:linear-gradient(135deg,#7c5cff,#ff4d8d);display:grid;place-items:center;font-size:26px;font-weight:600;color:#fff;border:5px solid #313338;box-sizing:content-box}
.oauth-head h2{font-size:22px;margin:0 0 4px;font-weight:600}
.oauth-head p{font-size:12px;color:var(--muted);margin:0}
.oauth-head a{color:#00a8fc}
.oauth-body{overflow-y:auto;padding:0 16px 12px}
.oauth-notice{background:#313338;border-radius:8px;padding:12px;font-size:12px;color:#dbdee1;line-height:1.5}
.oauth-notice a,.oauth-label a{color:#00a8fc}
.oauth-divider{height:1px;background:#3f4147;margin:14px 0}
.oauth-label{font-size:12px;font-weight:600;color:#f2f3f5;margin:0 0 10px}
.oauth-group{display:grid;gap:12px;margin-top:14px}
.oauth-row{display:flex;gap:10px;align-items:flex-start;font-size:13px;color:#dbdee1;line-height:1.45}
.oauth-row svg{width:18px;height:18px;flex:none;color:#b5bac1}
.oauth-row .check{width:18px;height:18px;flex:none;border-radius:50%;background:#3ba55c;color:#fff;display:grid;place-items:center;font-size:11px}
.oauth-actions{display:flex;gap:10px;padding:14px 16px 18px;background:#2b2d31}
.oauth-actions button{flex:1;border-radius:4px;padding:10px;font-size:13px;font-weight:500;transition:background .15s}
#oauthCancel{background:transparent;color:#f2f3f5}
#oauthCancel:hover{background:rgba(255,255,255,.06)}
#oauthAccept{background:#5865f2;color:#fff}
#oauthAccept:hover{background:#4752c4}
@media(max-width:520px){.oauth-card{max-height:92vh}}
