/* Buyer accounts and community */
.text-link { padding: 0; border: 0; background: none; color: var(--muted); font: 600 0.9rem var(--font-body); text-decoration: none; cursor: pointer; transition: color 0.2s ease; }
.text-link:hover { color: var(--fg); }
.text-link.accent { color: var(--accent); }
.auth-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: -4px; }
.auth-switch { margin: 0; color: var(--muted); font-size: 0.92rem; text-align: center; }
.auth-switch .text-link { color: var(--accent); font-size: inherit; }
.auth-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 4px auto 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.auth-icon svg { width: 24px; height: 24px; }
.auth-icon.ok { background: var(--ok-soft); color: var(--ok); }
.auth-card.center h1, .auth-card.center .auth-sub { text-align: center; }
.auth-card.center .auth-sub b { color: var(--fg); }
.auth-busy { display: grid; justify-items: center; gap: 12px; padding: 18px 0 6px; color: var(--muted); }
.auth-busy .spinner { display: block; width: 26px; height: 26px; color: var(--accent); }

.auth-chip { display: flex; align-items: center; gap: 10px; margin-top: -4px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-deep); color: var(--muted); }
.auth-chip svg { width: 16px; height: 16px; color: var(--accent); }
.auth-chip .mono { overflow: hidden; color: var(--fg); text-overflow: ellipsis; white-space: nowrap; }
.auth-chip .text-link { margin-left: auto; font-size: 0.85rem; }
.input.code-input input { padding: 0 12px; font: 600 1.45rem var(--font-code, monospace); letter-spacing: 0.45em; text-align: center; }
.input.code-input input::placeholder { color: var(--line-strong); }
.auth-links button:disabled { color: var(--faint); cursor: default; }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength i { height: 4px; border-radius: 4px; background: var(--line); transition: background-color 0.25s ease; }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--bad); }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--warn); }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--accent); }
.strength[data-score="4"] i { background: var(--ok); }
.strength-label { margin: 0; color: var(--faint); font-size: 0.8rem; }

.side-count.soon { background: var(--accent-soft); color: var(--accent); }

.profile-card { overflow: hidden; }
.profile-banner {
  height: 92px;
  background-color: var(--bg-deep);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.5px), linear-gradient(160deg, var(--accent-soft), transparent 70%);
  background-size: 18px 18px, auto;
}
.profile-main { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; padding: 0 20px 18px; }
.profile-avatar { display: grid; flex-shrink: 0; place-items: center; width: 84px; height: 84px; margin-top: -42px; border: 4px solid var(--surface); border-radius: 50%; background: var(--surface-2); color: var(--fg); font: 700 2rem/1 var(--font-display); overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { min-width: 0; padding-bottom: 4px; }
.profile-name h2 { margin: 0; font-size: 1.45rem; font-weight: 700; }
.profile-name p { margin: 2px 0 0; color: var(--faint); font-size: 0.88rem; }
.profile-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; padding-bottom: 6px; }
.chip-line { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 4px; border-radius: 999px; background: var(--surface-2); color: var(--prose); font-size: 0.86rem; font-weight: 600; }
.chip-line img, .chip-line .dot-ico { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.chip-line .dot-ico { display: grid; place-items: center; background: var(--line); color: var(--muted); }
.chip-line .dot-ico svg { width: 13px; height: 13px; }
.chip-line.muted { color: var(--faint); }
.chip-line.plain { padding-left: 12px; }

.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 18px; align-items: start; }
.key-card { animation: view-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.key-card .ticket-top .pill { margin-left: auto; }
.key-card .ticket-bottom > div { min-width: 0; }
.key-card .ticket-key { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--fg); }
.key-card .ticket-bottom .key-tools { display: flex; gap: 2px; margin-left: auto; }
.key-card.banned { border-color: color-mix(in srgb, var(--bad) 55%, var(--line-strong)); }
.key-card.banned .ticket-key { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--bad); }
.key-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 16px; border-top: 1px solid var(--line); }
.key-stats div { padding: 12px 6px; }
.key-stats div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.key-stats small { display: block; color: var(--faint); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.key-stats b { display: block; overflow: hidden; color: var(--fg); font: 700 1.1rem/1.4 var(--font-display); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.key-stats b.dim { color: var(--faint); }
.key-ban { display: flex; align-items: flex-start; gap: 10px; margin: 0 16px 14px; padding: 10px 12px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 0.88rem; font-weight: 600; }
.key-ban svg { width: 16px; height: 16px; margin-top: 3px; }
.key-actions { display: flex; align-items: center; gap: 8px; padding: 4px 16px 16px; }
.key-actions .reset { position: relative; flex: 1; overflow: hidden; font-variant-numeric: tabular-nums; }
.key-actions .reset .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); transition: width 1s linear; }
.key-actions .reset.wait { color: var(--muted); }
.key-actions .icon-btn { border: 1px solid var(--line-strong); width: 38px; height: 38px; }
.key-note { margin: 0 16px 14px; color: var(--faint); font-size: 0.82rem; }

.suggest { display: grid; gap: 8px; margin: 0; padding: 4px 18px 18px; list-style: none; }
.suggest li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.suggest b { display: block; font-family: var(--font-code); font-size: 0.9rem; font-weight: 500; }
.suggest small { color: var(--faint); font-size: 0.82rem; }
.suggest .button { margin-left: auto; height: 34px; }

.soon-card { position: relative; overflow: hidden; padding: 28px 28px 30px; }
.soon-card::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--dot) 1.1px, transparent 1.4px); background-size: 16px 16px; -webkit-mask-image: linear-gradient(120deg, #000, transparent 65%); mask-image: linear-gradient(120deg, #000, transparent 65%); pointer-events: none; }
.soon-card > * { position: relative; }
.soon-card h2 { margin: 12px 0 6px; font-size: 1.6rem; font-weight: 700; }
.soon-card p { margin: 0; max-width: 60ch; color: var(--muted); }
.soon-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.soon-steps div { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-deep); }
.soon-steps svg { width: 18px; height: 18px; color: var(--accent); }
.soon-steps b { display: block; margin-top: 8px; font-size: 0.95rem; }
.soon-steps small { color: var(--faint); font-size: 0.85rem; }
.soon-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.script-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.script-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.script-thumb { height: 104px; border-radius: 8px; background: var(--bg-deep); background-image: radial-gradient(var(--dot) 1.1px, transparent 1.4px); background-size: 14px 14px; }
.sk { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%); background-size: 220% 100%; animation: shimmer 2.4s ease-in-out infinite; }
.sk.w40 { width: 40%; } .sk.w55 { width: 55%; } .sk.w70 { width: 70%; } .sk.w90 { width: 90%; }
.sk.title { height: 14px; }
.script-author { display: flex; align-items: center; gap: 9px; padding-top: 10px; border-top: 1px solid var(--line); }
.script-author .avatar { width: 26px; height: 26px; font-size: 0.75rem; }
.script-author .sk { flex: 1; }
.script-tags { display: flex; gap: 6px; }
.script-tags .sk { width: 52px; height: 18px; border-radius: 999px; }
.script-card.mine { border-style: dashed; border-color: var(--line-strong); }
.script-card.mine .script-author b { color: var(--fg); font-size: 0.9rem; }
.script-card.mine .script-author small { margin-left: auto; color: var(--faint); font-size: 0.8rem; }

.profile-page .profile-card { margin-top: 28px; }
.profile-page .profile-main { padding-bottom: 22px; }
.profile-page .profile-avatar { width: 104px; height: 104px; margin-top: -52px; font-size: 2.5rem; }
.profile-page .profile-name h1 { margin: 0; font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 700; }
.profile-page .profile-name p { margin: 4px 0 0; color: var(--faint); font-size: 0.92rem; }
.profile-id { padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 700 0.85rem/1.6 var(--font-body); }
.profile-page .stats { margin-top: 18px; }
.profile-section { margin: 30px 0 14px; font-size: 1.3rem; font-weight: 700; }
.profile-note { margin: 0; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; }
a.script-card { color: inherit; text-decoration: none; }

.community { width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: 20px; padding-block: 28px 72px; }
.community h1 { margin: 36px 0 10px; font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 700; }
.community-tag { margin: 0 0 30px; max-width: 56ch; color: var(--muted); }
.community .soon-card { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.community-foot { margin: 22px 0 0; color: var(--faint); font-size: 0.92rem; text-align: center; }

.build { display: grid; justify-items: center; padding: 34px 20px 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: center; }
.build-title { margin: 14px 0 6px; font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 700; }
.build-sub { margin: 0; max-width: 48ch; color: var(--muted); }
.build-art { display: block; width: min(520px, 100%); height: auto; margin: 22px 0 18px; overflow: visible; }
.ba-ground { stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.ba-block { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; }
.ba-wins rect { fill: var(--bg-deep); }
.ba-wins .ba-lit { fill: var(--accent); opacity: 0.4; animation: lit 4.5s ease-in-out infinite; }
.ba-door { fill: var(--bg-deep); }
.ba-scaf line { stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 4 4; }
.ba-crane line, .ba-crane polyline { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ba-crane .ba-lattice { stroke-width: 1.5; opacity: 0.7; }
.ba-weight, .ba-cab, .ba-trolley { fill: var(--surface-2); stroke: var(--accent); stroke-width: 1.5; }
.ba-cable { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.ba-panel { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.ba-code { fill: var(--accent); font: 600 18px var(--font-code, monospace); }
.ba-cursor { fill: var(--fg); animation: blink 1.1s steps(1) infinite; }
.ba-sway { transform-origin: 214px 76px; animation: sway 5s ease-in-out infinite; }
.ba-barrier rect { fill: var(--warn); }
.ba-barrier .ba-stripe { fill: var(--bg-deep); }
.ba-leg { stroke: var(--line-strong); stroke-width: 3; stroke-linecap: round; }
.ba-cone path { fill: var(--warn); }
.ba-cone .ba-stripe { fill: var(--surface); }
.build-notes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 20px; }
.build-notes span { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); color: var(--prose); font-size: 0.88rem; font-weight: 600; }
.build-notes svg { width: 15px; height: 15px; color: var(--accent); }
.build-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.comm { display: grid; gap: 16px; }
.comm-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.comm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.comm-pane { display: grid; gap: 16px; }
.comm-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.comm-filters .seg { margin-left: auto; }
.comm-filters .chips .chip { height: 32px; padding: 0 12px; font-size: 0.86rem; }
.script-card.live { align-content: start; cursor: pointer; text-align: left; transition: border-color 0.2s ease, transform 0.2s ease; animation: view-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.script-card.live:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.script-card.live:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.script-card h3 { margin: 0; overflow: hidden; color: var(--fg); font: 700 1.1rem/1.3 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.script-card > p { display: -webkit-box; min-height: 4.4em; margin: 0; overflow: hidden; color: var(--muted); font-size: 0.9rem; line-height: 1.47; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.script-top { display: flex; align-items: center; justify-content: space-between; }
.script-likes { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.script-likes svg { width: 15px; height: 15px; }
.script-likes.on { color: var(--bad); }
.script-likes.on svg { fill: currentColor; }
.script-author b { overflow: hidden; color: var(--fg); font-size: 0.9rem; text-overflow: ellipsis; white-space: nowrap; }
.script-author small { margin-left: auto; color: var(--faint); font-size: 0.8rem; white-space: nowrap; }
.req-list { display: grid; gap: 10px; }
.req { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); animation: view-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.req > .pill { flex-shrink: 0; margin-left: auto; }
.req-body { min-width: 0; }
.req h3 { margin: 0 0 2px; color: var(--fg); font: 700 1.05rem/1.3 var(--font-display); }
.req p { margin: 0 0 8px; color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.req-meta { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 0.82rem; }
.avatar.sm { width: 22px; height: 22px; font-size: 0.7rem; }
.vote { display: grid; flex-shrink: 0; justify-items: center; gap: 0; width: 48px; padding: 6px 0 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-deep); color: var(--muted); font: inherit; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease; }
.vote svg { width: 18px; height: 18px; stroke-width: 2.4; }
.vote b { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.vote:hover { border-color: var(--line-strong); color: var(--fg); }
.vote.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.vote:disabled { cursor: default; opacity: 0.7; }
.cm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.cm-meta .avatar { width: 28px; height: 28px; font-size: 0.8rem; }
.cm-meta b { color: var(--fg); }
.cm-author { color: var(--fg); font-weight: 700; text-decoration: none; }
.cm-author:hover { color: var(--accent); }
.cm-meta small { color: var(--faint); font-size: 0.85rem; }
.cm-desc { margin: 0; color: var(--prose); white-space: pre-line; overflow-wrap: anywhere; }
.cm-like { margin-right: auto; }
.cm-like.on { border-color: color-mix(in srgb, var(--bad) 50%, var(--line-strong)); color: var(--bad); }
.cm-like.on svg { fill: currentColor; }
.textarea.short { min-height: 110px; font: 400 0.95rem/1.55 var(--font-body); }
.textarea.invalid { border-color: var(--bad); }
.toggle-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.toggle-row b { display: block; font-size: 1rem; }
.toggle-row small { color: var(--faint); font-size: 0.88rem; }
.toggle-row .switch { margin-left: auto; transform: scale(1.15); }

@keyframes sway { 0%, 100% { transform: rotate(2deg); } 50% { transform: rotate(-2deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes lit { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.15; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -120% 0; } }

@media (max-width: 860px) {
  .soon-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .key-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key-stats div:nth-child(3) { border-left: 0; padding-left: 6px; }
  .key-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .profile-chips { margin-left: 0; }
  .key-card .ticket-top { gap: 12px; padding: 0 16px; }
  .key-card .ticket-name b { white-space: nowrap; }
  .key-card .ticket-name span { display: none; }
  .soon-card { padding: 22px 18px 24px; }
}
@media (max-width: 640px) {
  .comm-actions { width: 100%; margin-left: 0; }
  .comm-actions .button { flex: 1; }
  .comm-filters .seg { margin-left: 0; }
  .comm-filters .input.search { width: 100%; }
  .req { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .sk, .key-card, .ba-sway, .ba-cursor, .ba-lit, .script-card.live, .req { animation: none; }
  .script-card.live:hover { transform: none; }
  .key-actions .reset .bar, .strength i { transition: none; }
}

/* Discord on a key card, and the Change Discord window */
.key-discord { display: flex; align-items: center; gap: 8px; margin: 0 16px 12px; color: var(--muted); font-size: 0.86rem; min-width: 0; }
.key-discord img, .key-discord .dot-ico { flex: none; width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.key-discord .dot-ico { display: grid; place-items: center; background: var(--line); color: var(--muted); }
.key-discord .dot-ico svg { width: 13px; height: 13px; }
.key-discord b { color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-discord small { color: var(--faint); font-family: var(--font-code); font-size: 0.76rem; }
.key-dc { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin: 0 16px 12px; padding: 9px 12px; border-radius: 8px; background: var(--surface-2); color: var(--prose); font-size: 0.85rem; line-height: 1.45; }
.key-dc > svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.key-dc > span { flex: 1; min-width: 0; }
.key-dc.ok { background: var(--ok-soft); color: var(--ok); }
.key-dc.bad { background: var(--bad-soft); color: var(--bad); }
.key-dc.warn { background: var(--warn-soft); color: var(--warn); }
.link-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.key-actions .dc-btn { flex: none; }
.dc-who { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-deep); }
.dc-who img, .dc-who .dot-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.dc-who .dot-ico { display: grid; place-items: center; background: var(--line); color: var(--muted); }
.dc-who .dot-ico svg { width: 16px; height: 16px; }
.dc-who div { display: grid; min-width: 0; }
.dc-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-who small { color: var(--faint); font-family: var(--font-code); font-size: 0.78rem; }
.dc-who .pill { margin-left: auto; }
.dc-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dc-option { position: relative; display: grid; justify-items: start; gap: 2px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg-deep); cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.dc-option input { position: absolute; opacity: 0; pointer-events: none; }
.dc-option .dc-ico { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 8px; border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.dc-option .dc-ico svg { width: 16px; height: 16px; }
.dc-option b { color: var(--fg); font-size: 0.98rem; }
.dc-option small { color: var(--muted); font-size: 0.84rem; }
.dc-option .dc-tag { margin-top: 10px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--prose); font-size: 0.78rem; font-weight: 600; }
.dc-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.dc-option:has(input:checked) .dc-ico { background: var(--accent-soft); color: var(--accent); }
.dc-option:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-soft); }
.dc-methods { display: flex; width: 100%; }
.dc-methods button { flex: 1; }
.dc-amount { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.dc-amount small { color: var(--muted); }
.dc-amount b { font-family: var(--font-code); font-size: 1.05rem; }
@media (prefers-reduced-motion: reduce) { .dc-option { transition: none; } }
