/* Decorly: "Try it on your profile" studio (tryon.js) */

/* the button in the item window */
.try-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
  margin: 0 0 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(196, 166, 251, .35);
  background: linear-gradient(135deg, rgba(161, 98, 248, .16), rgba(255, 127, 176, .10)); color: #efe7ff;
  font: 700 14.5px var(--font-display, "Plus Jakarta Sans", system-ui, sans-serif); cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s; }
.try-btn::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .14) 50%, transparent 70%); animation: to-shine 3.2s ease-in-out infinite; }
@keyframes to-shine { 60%, 100% { transform: translateX(100%); } }
.try-btn:hover { border-color: #a162f8; transform: translateY(-1px); box-shadow: 0 12px 26px -14px rgba(161, 98, 248, .9); }
.try-btn svg { width: 17px; height: 17px; fill: #ffd54a; filter: drop-shadow(0 0 6px rgba(255, 213, 74, .6)); }

/* the studio */
dialog.tryon { width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #2a2531; border-radius: 22px;
  background: #0d0b10; color: #f4f3f6; overflow: auto; font-family: var(--font-display, "Plus Jakarta Sans", system-ui, sans-serif);
  box-shadow: 0 50px 120px -30px #000, 0 0 0 1px rgba(161, 98, 248, .1); }
dialog.tryon::backdrop { background: rgba(4, 3, 6, .8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.to-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid #1d1a22; }
.to-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.to-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.to-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; color: #c4a6fb; background: rgba(161, 98, 248, .12); border: 1px solid rgba(196, 166, 251, .3); }
.to-pill svg { width: 12px; height: 12px; fill: #ff7fb0; }
.to-x { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #2a2531; border-radius: 10px; background: #16131a; color: #a09fa6; cursor: pointer; }
.to-x svg { width: 18px; height: 18px; fill: currentColor; }
.to-x:hover { color: #fff; border-color: #3a3346; }

.to-body { display: grid; grid-template-columns: minmax(0, 1fr) 310px; min-height: 560px; }

/* preview side */
.to-preview { position: relative; display: grid; grid-template-rows: auto 1fr; gap: 14px; padding: 16px 20px 24px; overflow: hidden;
  background: radial-gradient(60% 50% at 50% 45%, rgba(161, 98, 248, .22), transparent 70%),
              radial-gradient(circle, rgba(255, 255, 255, .05) 1px, transparent 1.3px) 0 0 / 22px 22px, #0d0b10; }
.to-tabs { justify-self: center; display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #16131a; border: 1px solid #241f2b; }
.to-tabs button { padding: 8px 16px; border: 0; border-radius: 9px; background: none; color: #a09fa6; font-family: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; transition: background .15s, color .15s; }
.to-tabs button:hover { color: #fff; }
.to-tabs button[aria-selected="true"] { background: #2a2333; color: #fff; box-shadow: inset 0 0 0 1px #3a3346; }
.to-stage { display: grid; place-items: center; min-height: 480px; }
.to-stage > * { animation: to-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes to-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* avatar + decoration (Discord draws the decoration at 1.2x the avatar) */
.to-av { position: relative; flex: none; width: var(--s); height: var(--s); }
.to-face { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: #5865f2 center / cover no-repeat; color: #fff; font-weight: 800; font-size: calc(var(--s) * .4); }
.to-logo { width: 58%; height: 58%; fill: #fff; }
.to-deco { position: absolute; left: -10%; top: -10%; width: 120%; height: 120%; pointer-events: none; z-index: 2; }
.to-status { position: absolute; right: 2%; bottom: 2%; width: 26%; height: 26%; border-radius: 50%; background: #23a55a; z-index: 3;
  box-shadow: 0 0 0 calc(var(--s) * .06) var(--ring, #232428); }

/* profile popout */
.to-pwrap { position: relative; width: 340px; max-width: 100%; margin: 26px 18px 30px; }
.to-card { position: relative; overflow: hidden; border-radius: 12px; background: #232428; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .04); }
.to-banner { height: 120px; background: linear-gradient(135deg, var(--bn, #a162f8), color-mix(in srgb, var(--bn, #a162f8) 55%, #000)); transition: background .3s; }
.to-card-av { position: absolute; left: 16px; top: 72px; z-index: 2; --ring: #232428; }
.to-card-av .to-face { box-shadow: 0 0 0 6px #232428; }
.to-cbody { position: relative; z-index: 1; display: grid; gap: 4px; padding: 54px 16px 16px; }
.to-dn { font-size: 20px; font-weight: 800; line-height: 1.2; }
.to-un { display: flex; align-items: center; gap: 8px; color: #b5bac1; font-size: 14px; }
.to-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; background: rgba(161, 98, 248, .2); color: #d9c7fd;
  font-style: normal; font-size: 11.5px; font-weight: 700; }
.to-badge svg { width: 10px; height: 10px; fill: #ff7fb0; }
.to-box { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #1e1f22; }
.to-box small { display: block; font-size: 11.5px; font-weight: 800; color: #b5bac1; }
.to-box p { margin: 4px 0 0; font-size: 13.5px; color: #dbdee1; }
.to-msg { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #383a40; color: #949ba4; font-size: 13.5px; }
.to-fx { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.to-fx img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
/* frame around the card */
.to-pwrap .fl { position: absolute; left: -7%; width: 114%; max-width: none; pointer-events: none; opacity: 0; z-index: 5; transition: opacity .3s; }
.to-pwrap .fl.fl-full { top: -5%; height: 110%; object-fit: fill; opacity: 1; }
.to-pwrap .fl.fl-top { top: -7%; height: auto; opacity: 1; }
.to-pwrap .fl.fl-bottom { bottom: -6%; height: auto; opacity: 1; }

/* chat */
.to-chat { width: min(520px, 100%); display: grid; gap: 4px; padding: 14px 6px; border-radius: 14px; background: #313338; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .95); }
.to-msgrow { display: flex; gap: 14px; padding: 8px 14px; border-radius: 6px; }
.to-msgrow.me { background: rgba(88, 101, 242, .08); }
.to-msgrow .to-av { --ring: #313338; margin-top: 2px; }
.to-mtext { display: grid; gap: 2px; min-width: 0; }
.to-mtext p { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.to-mtext b { font-size: 15px; color: #f2f3f5; }
.to-msgrow.me .to-mtext b { color: #c4a6fb; }
.to-mtext time { font-size: 11.5px; color: #949ba4; }
.to-mtext span { font-size: 15px; color: #dbdee1; }

/* member list */
.to-list { width: min(300px, 100%); display: grid; gap: 2px; padding: 14px 8px; border-radius: 14px; background: #2b2d31; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .95); }
.to-grp { padding: 2px 8px 8px; font-size: 12px; font-weight: 800; letter-spacing: .02em; color: #949ba4; text-transform: uppercase; }
.to-lrow { position: relative; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 10px; border-radius: 8px; overflow: hidden; }
.to-lrow .to-av { --ring: #2b2d31; z-index: 1; }
.to-lrow span { position: relative; z-index: 1; font-size: 15px; font-weight: 600; color: #f2f3f5; }
.to-lrow.dim span { color: #949ba4; }
.to-lrow.me:not(.has-plate) { background: rgba(255, 255, 255, .05); }
.to-lrow.has-plate span { text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.to-plate { position: absolute; inset: 0; background: center / cover no-repeat; }
.to-plate video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* controls side */
.to-side { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; align-content: start; gap: 18px; padding: 18px; border-left: 1px solid #1d1a22; background: #110f14; }
.to-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.to-group[hidden] { display: none; }
.to-lbl { margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #6e6d74; }
.to-drop { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1.5px dashed #3a3346; background: #16131a; cursor: pointer;
  transition: border-color .15s, background .15s; }
.to-drop:hover, .to-drop:focus-visible, .to-drop.over { border-color: #a162f8; background: rgba(161, 98, 248, .08); outline: none; }
.to-drop-av { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #2b2d31 center / cover no-repeat; }
.to-drop-av svg { width: 22px; height: 22px; fill: #6e6d74; }
.to-drop-t { display: grid; gap: 2px; min-width: 0; }
.to-drop-t b { font-size: 14px; }
.to-drop-t small { font-size: 12px; color: #a09fa6; line-height: 1.35; }
.to-row2 { display: flex; gap: 8px; }
.to-name { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid #2e2d32; background: #0d0b10; color: #f4f3f6;
  font-family: inherit; font-weight: 600; font-size: 14px; outline: none; }
.to-name:focus { border-color: #a162f8; box-shadow: 0 0 0 3px rgba(161, 98, 248, .18); }
.to-reset { flex: none; padding: 0 12px; border: 1px solid #2e2d32; border-radius: 10px; background: none; color: #a09fa6; font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.to-reset:hover { color: #fff; }
.to-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.to-color { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); transition: transform .15s; }
.to-color:hover { transform: scale(1.08); }
.to-color[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px rgba(161, 98, 248, .45); }
.to-show { display: flex; flex-wrap: wrap; gap: 6px; }
.to-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; border: 1px solid #2e2d32; background: #16131a;
  color: #a09fa6; font-family: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; transition: all .15s; }
.to-chip i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid #4a4452; }
.to-chip[aria-pressed="true"] { color: #fff; border-color: rgba(161, 98, 248, .55); background: rgba(161, 98, 248, .14); }
.to-chip[aria-pressed="true"] i { border-color: #a162f8; background: #a162f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='m9.5 16.2-4-4 1.4-1.4 2.6 2.6 6.6-6.6 1.4 1.4z'/%3E%3C/svg%3E") center / 12px no-repeat; }
.to-switch { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.to-switch input { position: absolute; opacity: 0; pointer-events: none; }
.to-sw { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #2e2d32; transition: background .2s; }
.to-sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.to-switch input:checked + .to-sw { background: #a162f8; }
.to-switch input:checked + .to-sw::after { transform: translateX(16px); }
.to-switch input:focus-visible + .to-sw { box-shadow: 0 0 0 3px rgba(161, 98, 248, .35); }
.to-buy { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; margin-top: 4px; }
.to-buy button { height: 44px; border-radius: 12px; font-family: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.to-cart { border: 1px solid #3a3346; background: #16131a; color: #f4f3f6; }
.to-cart:hover:not(:disabled) { border-color: #a162f8; }
.to-now { border: 0; background: linear-gradient(180deg, #b17cfa, #8a4ff0); color: #fff; box-shadow: 0 12px 26px -12px rgba(161, 98, 248, .9); }
.to-now:hover:not(:disabled) { filter: brightness(1.08); }
.to-buy button:disabled { opacity: .5; cursor: not-allowed; }
.to-note { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.45; color: #6e6d74; }
.to-note svg { flex: none; width: 14px; height: 14px; fill: #3ddc97; margin-top: 1px; }

@media (max-width: 760px) {
  .to-body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .to-side { border-left: 0; border-top: 1px solid #1d1a22; }
  .to-stage { min-height: 0; }
  .to-preview { padding: 14px 12px 18px; }
  .to-pwrap { width: 300px; margin: 18px 10px 22px; }
  .to-banner { height: 100px; }
  .to-card-av { top: 56px; }
  .to-tabs button { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .try-btn::after, .to-stage > * { animation: none; }
}
