/* =========================================================
   SparkVisuals — личный кабинет (поверх styles.css)
   ========================================================= */
.acc-body { min-height: 100vh; }
.acc-bg {
  position: fixed; inset: 0; z-index: -3; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #1b1450 0%, #0a0820 45%, var(--bg) 100%);
}
.acc-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; animation: accFloat 18s var(--ease) infinite alternate; }
.acc-orb--a { width: 520px; height: 520px; left: -140px; top: 10%; background: radial-gradient(circle, rgba(120, 90, 255, .55), transparent 65%); }
.acc-orb--b { width: 620px; height: 620px; right: -180px; top: 40%; background: radial-gradient(circle, rgba(70, 110, 255, .45), transparent 65%); animation-delay: -9s; }
@keyframes accFloat { to { transform: translate3d(60px, -40px, 0) scale(1.08); } }

.acc { max-width: 1080px; margin: 0 auto; padding: 120px 24px 80px; }
.acc-view { animation: accIn .5s var(--ease) both; }
@keyframes accIn { from { opacity: 0; transform: translateY(12px); } }
[hidden] { display: none !important; }

.acc-card {
  position: relative; padding: 26px 28px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .9);
}
.acc-card + .acc-card { margin-top: 16px; }
.acc-title { margin: 18px 0 6px; font-size: 28px; letter-spacing: -.03em; line-height: 1.15; }
.acc-h2 { margin: 0 0 18px; font-size: 18px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.acc-muted { margin: 0; color: var(--muted); font-size: 14.5px; }
.acc-dim { color: var(--dim); font-weight: 500; font-size: 15px; }
.acc-hint { margin: 6px 0 0; color: var(--dim); font-size: 13px; }
.acc-lead { margin-bottom: 18px; max-width: 760px; }
.acc-sep { height: 1px; background: var(--line); margin: 22px 0; }

/* loading */
.acc-loading { display: grid; place-items: center; min-height: 50vh; }
.acc-spinner { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,.1); border-top-color: var(--accent); animation: spin .9s linear infinite; }

/* auth */
.acc-auth { display: grid; place-items: center; min-height: calc(100vh - 220px); }
.acc-card--auth { width: min(440px, 100%); padding: 34px 32px 30px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.acc-card--auth .acc-muted { margin-bottom: 22px; }
.acc-seg { position: relative; left: auto; bottom: auto; display: flex; width: 100%; margin-bottom: 20px; }
.acc-seg .seg__btn { flex: 1; padding: 9px 14px; font-size: 14px; }
.acc-form { width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.acc-field { display: flex; flex-direction: column; gap: 7px; }
.acc-field span { font-size: 13px; font-weight: 600; color: var(--muted); }
.acc-field input, .acc-add input {
  height: 46px; padding: 0 14px; border-radius: 12px; font: inherit; font-size: 15px; color: var(--text);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); outline: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.acc-field input::placeholder, .acc-add input::placeholder { color: var(--dim); }
.acc-field input:focus, .acc-add input:focus { border-color: rgba(190, 175, 255, .55); background: rgba(255,255,255,.06); box-shadow: 0 0 0 4px rgba(155, 135, 255, .14); }
.acc-field input.bad { border-color: rgba(255, 110, 120, .7); }
.acc-turnstile { min-height: 65px; display: flex; justify-content: center; }
.acc-error { margin: 0; min-height: 0; color: #ff8e99; font-size: 13.5px; }
.acc-error:empty { display: none; }
.acc-submit { width: 100%; margin-top: 4px; }
.acc-submit.busy { pointer-events: none; opacity: .8; }
.acc-submit.busy .acc-submit__text::after { content: "…"; }

/* hero */
.acc-hero { display: flex; align-items: center; gap: 20px; }
.acc-avatar { position: relative; width: 72px; height: 72px; flex: none; }
.acc-avatar img { width: 100%; height: 100%; border-radius: 18px; image-rendering: pixelated; background: #0b0a12; border: 1px solid var(--line-2); box-shadow: 0 0 30px -6px rgba(155, 135, 255, .5); object-fit: cover; }
.acc-avatar__dot { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; background: #55516b; border: 3px solid #12101e; }
.acc-avatar__dot.on { background: #7ce38b; box-shadow: 0 0 12px rgba(124, 227, 139, .7); }
.acc-hero__info { flex: 1; min-width: 0; }
.acc-hero__name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-hero__name h1 { margin: 0; font-size: 26px; letter-spacing: -.03em; overflow-wrap: anywhere; }
.acc-hero__stats { display: flex; gap: 10px; }
.acc-hero__stats div { min-width: 86px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); text-align: center; }
.acc-hero__stats b { display: block; font-size: 20px; line-height: 1.1; }
.acc-hero__stats small { color: var(--dim); font-size: 12px; }
.acc-role { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.acc-role::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.acc-role--admin { color: #b197fc; background: rgba(177, 151, 252, .14); border: 1px solid rgba(177, 151, 252, .35); }
.acc-role--media { color: #6fb6ff; background: rgba(111, 182, 255, .14); border: 1px solid rgba(111, 182, 255, .35); }

/* tabs */
.acc-tabs { position: relative; left: auto; bottom: auto; display: flex; width: max-content; max-width: 100%; margin: 22px 0 18px; overflow-x: auto; scrollbar-width: none; }
.acc-tabs .seg__btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; font-size: 14px; white-space: nowrap; }
.acc-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; background: #ff5a6a; color: #fff; }
.acc-panel { animation: accIn .4s var(--ease) both; }
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.acc-grid .acc-card + .acc-card { margin-top: 0; }

/* profile */
.acc-info { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 12px 20px; font-size: 14.5px; }
.acc-info dt { color: var(--dim); }
.acc-info dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.acc-row b { font-size: 14.5px; }
.acc-danger { color: #ff8e99; border-color: rgba(255, 110, 120, .3); }
.acc-danger:hover { color: #fff; background: rgba(255, 90, 106, .16); border-color: rgba(255, 110, 120, .55); }

/* friends */
.acc-add { display: flex; gap: 10px; }
.acc-add input { flex: 1; min-width: 0; height: 40px; }
.acc-suggest { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.acc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.acc-list:empty::before { content: attr(data-empty); color: var(--dim); font-size: 14px; }
.acc-person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid transparent; transition: background .25s, border-color .25s; }
.acc-person:hover { background: rgba(255,255,255,.05); border-color: var(--line); }
.acc-person img { width: 36px; height: 36px; border-radius: 10px; image-rendering: pixelated; background: #0b0a12; flex: none; }
.acc-person__main { flex: 1; min-width: 0; }
.acc-person__name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.acc-person__name .acc-role { padding: 1px 7px; font-size: 10.5px; }
.acc-person__sub { color: var(--dim); font-size: 12.5px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-person__sub i { width: 7px; height: 7px; border-radius: 50%; background: #55516b; flex: none; }
.acc-person__sub i.on { background: #7ce38b; box-shadow: 0 0 8px rgba(124, 227, 139, .7); }
.acc-person__actions { display: flex; gap: 6px; flex: none; }
.acc-mini { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); color: var(--muted); transition: all .25s; }
.acc-mini:hover { color: var(--text); background: rgba(255,255,255,.06); }
.acc-mini--ok { background: #fff; color: #0c0a16; border-color: #fff; }
.acc-mini--ok:hover { background: #e7e1ff; color: #0c0a16; }
.acc-mini--x:hover { color: #ff8e99; border-color: rgba(255, 110, 120, .45); background: rgba(255, 90, 106, .1); }
.acc-mini:disabled { opacity: .5; pointer-events: none; }

/* cosmetics */
.acc-cos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.acc-cos .acc-card + .acc-card { margin-top: 0; }
.cos { display: flex; flex-direction: column; gap: 16px; transition: border-color .3s, box-shadow .3s; }
.cos.on { border-color: rgba(190, 175, 255, .3); box-shadow: 0 30px 60px -36px rgba(0,0,0,.9), 0 0 50px -24px rgba(155, 135, 255, .6); }
.cos__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cos__head h3 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.cos__preview { position: relative; height: 120px; border-radius: 16px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(80% 90% at 50% 100%, color-mix(in srgb, var(--c, #fff) 26%, transparent), transparent 70%), rgba(8, 7, 16, .5); border: 1px solid var(--line); }
.cos__preview svg { width: 64%; height: 86%; color: var(--c, #fff); filter: drop-shadow(0 0 14px color-mix(in srgb, var(--c, #fff) 70%, transparent)); transition: transform .5s var(--ease), opacity .3s; }
.cos:not(.on) .cos__preview svg { opacity: .35; filter: grayscale(1); }
.cos__preview.rainbow svg { animation: hue 4s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg) drop-shadow(0 0 14px rgba(255,255,255,.4)); } }
.cos__preview svg { transform: scale(var(--s, 1)); }
.cos__label { font-size: 12.5px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.cos__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cos__chip { padding: 6px 11px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); transition: all .25s; }
.cos__chip:hover { color: var(--text); }
.cos__chip.active { background: #fff; color: #0c0a16; border-color: #fff; }
.cos__line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.cos__line input[type=color] { width: 40px; height: 28px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }
.cos__line input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
.cos__line input[type=color]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.cos__line input[type=color]:disabled { opacity: .35; cursor: default; }
.cos__range { width: 100%; accent-color: #c9b8ff; }
.cos__body { display: flex; flex-direction: column; gap: 16px; transition: opacity .3s; }
.cos:not(.on) .cos__body { opacity: .45; }

/* toggle */
.tgl { position: relative; width: 40px; height: 23px; flex: none; border-radius: 12px; background: rgba(255,255,255,.12); transition: background .3s; }
.tgl::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #9a96b2; transition: transform .35s var(--ease), background .3s; }
.tgl.on { background: #fff; }
.tgl.on::after { transform: translateX(17px); background: #0c0a16; }
.tgl--sm { width: 34px; height: 20px; }
.tgl--sm::after { width: 14px; height: 14px; }
.tgl--sm.on::after { transform: translateX(14px); }

.acc-savebar {
  position: sticky; bottom: 18px; z-index: 5; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px 12px 20px; border-radius: 16px; background: rgba(16, 14, 28, .82); border: 1px solid var(--line-2);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 20px 40px -18px #000;
  transition: border-color .3s, box-shadow .3s;
}
.acc-savebar.dirty { border-color: rgba(190, 175, 255, .45); box-shadow: 0 20px 40px -18px #000, 0 0 40px -16px rgba(155, 135, 255, .7); }
.acc-savebar .btn:disabled { opacity: .45; pointer-events: none; box-shadow: none; }

/* download */
.acc-dl__head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.acc-dl__head > div { flex: 1; min-width: 180px; }
.acc-dl__head .acc-h2 { margin-bottom: 2px; }
.acc-steps { margin: 24px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 14.5px; }
.acc-steps b { color: var(--text); }

/* confirm */
.acc-modal { position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; padding: 20px; background: rgba(4, 3, 10, .6); backdrop-filter: blur(6px); animation: accFade .25s ease both; }
@keyframes accFade { from { opacity: 0; } }
.acc-modal__card { width: min(400px, 100%); padding: 26px; border-radius: var(--radius); background: #12101e; border: 1px solid var(--line-2); box-shadow: 0 40px 80px -20px #000; animation: accIn .35s var(--ease) both; }
.acc-modal__card h3 { margin: 0 0 8px; font-size: 19px; }
.acc-modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* responsive */
@media (max-width: 900px) {
  .acc-grid, .acc-cos { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .acc { padding: 100px 14px 60px; }
  .acc-card { padding: 22px 18px; }
  .acc-hero { flex-wrap: wrap; }
  .acc-hero__stats { width: 100%; }
  .acc-hero__stats div { flex: 1; }
  .acc-home span { display: none; }
  .acc-tabs { width: 100%; }
  .acc-tabs .seg__btn { flex: 1; justify-content: center; padding: 8px 6px; font-size: 13.5px; }
  .acc-row { flex-direction: column; align-items: flex-start; }
  .acc-person__sub { white-space: normal; }
}
