/* =========================================================
   GregPlay — Загрузка скина (profile-skin) redesign
   ========================================================= */
.skin-page {
    min-height: 100vh;
    position: relative;
    color: #f3eefb;
    background:
        radial-gradient(circle at 10% 6%, rgba(129, 79, 216, 0.16), transparent 26%),
        radial-gradient(circle at 92% 8%, rgba(99, 70, 168, 0.14), transparent 30%),
        linear-gradient(180deg, #0a0617 0%, #0d0915 100%);
}

/* космический фон страницы */
.skin-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url(/img/background_skin.webp?v=1) center / cover no-repeat;
    opacity: 0.95;
}
.skin-page::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(42% 32% at 18% 28%, rgba(160, 107, 255, 0.16), transparent 70%),
        radial-gradient(38% 30% at 82% 62%, rgba(99, 70, 168, 0.14), transparent 70%),
        linear-gradient(180deg, rgba(8, 4, 18, 0.06) 0%, rgba(8, 4, 18, 0.16) 55%, rgba(11, 7, 20, 0.5) 100%);
    background-size: 200% 200%, 200% 200%, 100% 100%;
    animation: skin-aurora 20s ease-in-out infinite alternate;
}
@keyframes skin-aurora {
    0% { background-position: 0% 0%, 100% 100%, 0 0; }
    100% { background-position: 70% 50%, 25% 60%, 0 0; }
}
@media (prefers-reduced-motion: reduce) { .skin-page::after { animation: none; } }
.skin-page .nav,
.skin-main,
.skin-page .footer { position: relative; z-index: 1; }

.skin-page .footer { margin-top: 72px; }
.skin-main { padding: 104px 0 0; }

.skin-wrap {
    width: calc(100% - (var(--page-gutter, 64px) * 2));
    max-width: 1500px;
    margin: 0 auto;
}

.skin-breadcrumb { display: flex; align-items: center; gap: 8px; color: #8d83a3; font-size: 13px; margin-bottom: 18px; }
.skin-breadcrumb a { color: #b69bff; text-decoration: none; }
.skin-breadcrumb a:hover { color: #d7c4ff; }
.skin-breadcrumb svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.skin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 24px;
    align-items: start;
}
.skin-col-main { display: grid; gap: 22px; min-width: 0; }
.skin-col-side { display: grid; gap: 22px; position: sticky; top: 92px; }

/* ============ PANEL ============ */
.skin-panel {
    position: relative;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(180deg, rgba(21, 15, 31, 0.92), rgba(13, 10, 19, 0.94));
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.26);
    padding: 22px;
    overflow: hidden;
    animation: skin-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.skin-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(160, 107, 255, 0.5), transparent);
}
.skin-panel > * { position: relative; z-index: 1; }

.skin-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.skin-widget-title { font-family: "Sora", sans-serif; font-size: 16px; font-weight: 700; color: #f4f0fc; }

/* ============ HERO ============ */
.skin-hero { display: flex; gap: 20px; align-items: flex-start; }
.skin-hero-ico {
    flex-shrink: 0;
    width: 70px; height: 70px;
    display: grid; place-items: center;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    background: linear-gradient(140deg, #ab83ef, #7a45cf);
    box-shadow: 0 0 26px rgba(160, 107, 255, 0.5);
    animation: skin-pulse 2.8s ease-in-out infinite;
}
.skin-hero-ico svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skin-hero-title { font-family: "Sora", sans-serif; font-size: clamp(26px, 3vw, 34px); color: #fff; line-height: 1.05; }
.skin-hero-sub { margin-top: 8px; color: #b9afce; line-height: 1.6; font-size: 14px; }

.skin-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.skin-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 13px; border-radius: 999px;
    background: rgba(160, 107, 255, 0.1);
    border: 1px solid rgba(160, 107, 255, 0.26);
    color: #cdbff0; font-size: 12.5px; font-weight: 600;
}
.skin-chip svg { width: 15px; height: 15px; fill: none; stroke: #c4a5ff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ============ PROFILE ============ */
.skin-profile { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.skin-profile-head { display: flex; align-items: center; gap: 12px; }
.skin-profile-ico {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    color: #c4a5ff; background: rgba(160, 107, 255, 0.14); border: 1px solid rgba(160, 107, 255, 0.28);
}
.skin-profile-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skin-profile-label { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #a99fc0; }
.skin-profile-data { display: grid; gap: 12px; }
.skin-profile-row { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 14px; }
.skin-profile-key { color: #8d83a3; font-size: 12.5px; font-weight: 600; }
.skin-profile-val { color: #f3eefb; font-weight: 700; font-family: "JetBrains Mono", monospace; }
.skin-uuid-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.skin-profile-code { color: #c8b8ee; font: 500 13px "JetBrains Mono", monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skin-copy {
    flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
    color: #c4a5ff; cursor: pointer; background: rgba(160, 107, 255, 0.14); border: 1px solid rgba(160, 107, 255, 0.3);
    transition: background 0.2s ease, transform 0.2s ease;
}
.skin-copy:hover { background: rgba(160, 107, 255, 0.28); transform: scale(1.06); }
.skin-copy.copied { color: #20e898; border-color: rgba(32, 232, 152, 0.5); background: rgba(32, 232, 152, 0.16); }
.skin-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ============ DROPZONE ============ */
.skin-form { display: grid; gap: 16px; }
.skin-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 44px 24px; border-radius: 20px; cursor: pointer; text-align: center;
    border: 2px dashed rgba(160, 107, 255, 0.4);
    background: radial-gradient(circle at 50% 36%, rgba(129, 79, 216, 0.12), transparent 60%), rgba(13, 8, 24, 0.5);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.skin-drop:hover, .skin-drop.is-drag { border-color: rgba(196, 165, 255, 0.75); background: radial-gradient(circle at 50% 36%, rgba(129, 79, 216, 0.2), transparent 60%), rgba(18, 11, 32, 0.6); }
.skin-drop input { display: none; }
.skin-drop-ico {
    display: grid; place-items: center; width: 74px; height: 74px; margin-bottom: 8px;
    border-radius: 18px; color: #c4a5ff;
    background: rgba(160, 107, 255, 0.14); border: 1px solid rgba(160, 107, 255, 0.3);
    box-shadow: 0 0 26px rgba(160, 107, 255, 0.3);
}
.skin-drop-ico svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skin-drop-title { font-family: "Sora", sans-serif; font-size: 20px; font-weight: 700; color: #f4f0fc; }
.skin-drop-or { color: #a99fc0; font-size: 14px; }
.skin-drop-or i { color: #b69bff; font-style: normal; font-weight: 600; }
.skin-drop-name { margin-top: 6px; color: #8d83a3; font-size: 12.5px; }

/* ============ CONTROLS ============ */
.skin-controls { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 14px; align-items: end; }
.skin-field { display: grid; gap: 7px; min-width: 0; }
.skin-field-label { font-size: 13px; font-weight: 600; color: #c4bbd9; }
.skin-select-wrap { position: relative; display: flex; align-items: center; }
.skin-select-ico { position: absolute; left: 12px; color: #8a7cb0; pointer-events: none; }
.skin-select-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skin-select {
    width: 100%; min-height: 48px; border-radius: 12px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04);
    color: #f0edf6; font: inherit; padding: 12px 40px 12px 38px;
    appearance: none; -webkit-appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.skin-select:focus { outline: none; border-color: rgba(160, 107, 255, 0.6); box-shadow: 0 0 0 4px rgba(129, 79, 216, 0.14); }
.skin-select option { background: #160d26; color: #f0edf6; }
.skin-select-arrow { position: absolute; right: 12px; color: #8a7cb0; pointer-events: none; }
.skin-select-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.skin-btn { min-height: 48px; padding: 12px 22px; border-radius: 12px; gap: 8px; font-size: 14px; white-space: nowrap; }
.skin-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skin-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

.skin-progress { display: flex; align-items: center; gap: 12px; }
.skin-progress-track { flex: 1; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.skin-progress-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #a06bff, #814fd8); box-shadow: 0 0 12px rgba(160, 107, 255, 0.6); transition: width 0.25s ease; }
.skin-progress-text { color: #b69bff; font-weight: 700; font-size: 13px; min-width: 40px; text-align: right; }

.inline-message { border-radius: 12px; padding: 12px 14px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); color: #dbd5e5; line-height: 1.55; font-size: 14px; }
.inline-message.error { color: #ffd4d1; border-color: rgba(255, 96, 125, 0.4); background: rgba(255, 96, 125, 0.12); }
.inline-message.success { color: #dcffe9; border-color: rgba(32, 232, 152, 0.4); background: rgba(32, 232, 152, 0.12); }
.inline-message.info { color: #d7e3ff; border-color: rgba(110, 150, 255, 0.34); background: rgba(110, 150, 255, 0.1); }

/* ============ STATUS ============ */
.skin-status-head { margin-bottom: 14px; }
.skin-status-title { font-family: "Sora", sans-serif; font-size: 20px; color: #f4f0fc; }
.skin-status-sub { color: #a99fc0; font-size: 13px; margin-top: 4px; }
.skin-current { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.skin-current-image { width: 44px; height: 44px; border-radius: 8px; image-rendering: pixelated; }
.skin-current-empty { color: #8d83a3; font-size: 13px; }
.skin-current-link { color: #b69bff; font-size: 13px; font-weight: 600; text-decoration: none; }

.skin-status-list { display: flex; flex-direction: column; gap: 8px; }
.skin-status-card {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 14px 16px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.18s ease, border-color 0.18s ease;
}
.skin-status-card:hover { background: rgba(160, 107, 255, 0.06); border-color: rgba(160, 107, 255, 0.2); }
.skin-status-card > div { display: flex; align-items: center; gap: 16px; min-width: 0; flex-wrap: wrap; }
.skin-status-title2 { display: none; }
.skin-status-card .skin-status-title { font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.skin-status-card .skin-status-title::before {
    content: ""; width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
    background: rgba(32, 232, 152, 0.16) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2320e898" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="m5 12 5 5 9-10"/></svg>') center/12px no-repeat;
    border: 1px solid rgba(32, 232, 152, 0.4);
}
.skin-status-applied { color: #7df3bd; }
.skin-status-pending { color: #dbc6ff; }
.skin-status-applying { color: #c4a5ff; }
.skin-status-failed { color: #ff9aab; }
.skin-status-superseded { color: #a99fc0; }
.skin-status-failed.skin-status-meta { color: #ff9aab; }
.skin-status-meta { color: #8d83a3; font-size: 12.5px; }
.skin-status-pill {
    flex-shrink: 0; padding: 5px 11px; border-radius: 999px; font: 600 11.5px "JetBrains Mono", monospace;
    color: #cbb9f2; background: rgba(160, 107, 255, 0.14); border: 1px solid rgba(160, 107, 255, 0.3);
}

/* ============ 3D PREVIEW ============ */
.skin-3d-badge { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: #cdbdf2; background: rgba(160, 107, 255, 0.2); border: 1px solid rgba(160, 107, 255, 0.4); border-radius: 7px; padding: 4px 9px; }
.skin-stage {
    position: relative; width: 100%; aspect-ratio: 1 / 1.05; border-radius: 16px; overflow: hidden;
    background:
        radial-gradient(circle at 50% 78%, rgba(129, 79, 216, 0.28), transparent 52%),
        radial-gradient(circle at 50% 20%, rgba(99, 70, 168, 0.16), transparent 60%),
        linear-gradient(180deg, rgba(12, 7, 24, 0.7), rgba(8, 5, 16, 0.85));
    border: 1px solid rgba(160, 107, 255, 0.18);
    display: grid; place-items: center;
}
.skin-stage canvas, .skin-stage img { max-width: 100%; max-height: 100%; }
#skin-3d { width: 100%; height: 100%; display: block; }
#skin-3d-fallback { image-rendering: pixelated; width: auto; height: 78%; object-fit: contain; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5)); z-index: 1; }
.skin-stage-glow {
    position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%);
    width: 62%; height: 26px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(160, 107, 255, 0.7), rgba(160, 107, 255, 0) 70%);
    filter: blur(2px); z-index: 0;
    animation: skin-glow 3s ease-in-out infinite;
}
#skin-preview { position: absolute; opacity: 0; pointer-events: none; }
.skin-preview-empty { position: absolute; opacity: 0; pointer-events: none; }

.skin-stage-controls { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.skin-ctl {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
    color: #c4a5ff; background: rgba(160, 107, 255, 0.1); border: 1px solid rgba(160, 107, 255, 0.26);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.skin-ctl:hover { background: rgba(160, 107, 255, 0.24); transform: translateY(-2px); }
.skin-ctl.is-on { color: #fff; background: linear-gradient(135deg, #ab83ef, #814fd8); border-color: transparent; }
.skin-ctl svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ============ REQUIREMENTS / TIPS ============ */
.skin-req-list, .skin-tip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.skin-req-list li { display: flex; align-items: center; gap: 11px; color: #d8d1e8; font-size: 13.5px; }
.skin-req-list li svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: #20e898; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skin-tip-list li { display: flex; align-items: flex-start; gap: 11px; color: #b9afce; font-size: 13px; line-height: 1.5; }
.skin-tip-list li svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; fill: none; stroke: #c4a5ff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skin-tip-list a { color: #b69bff; text-decoration: none; font-weight: 600; }
.skin-tip-list a:hover { color: #d7c4ff; }

.skin-foot-actions { display: flex; justify-content: center; margin-top: 24px; }

/* ============ ANIMATIONS ============ */
@keyframes skin-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes skin-pulse { 0%, 100% { box-shadow: 0 0 22px rgba(160, 107, 255, 0.45); } 50% { box-shadow: 0 0 38px rgba(160, 107, 255, 0.7); } }
@keyframes skin-glow { 0%, 100% { opacity: 0.7; width: 62%; } 50% { opacity: 1; width: 70%; } }
@media (prefers-reduced-motion: reduce) { .skin-panel, .skin-hero-ico, .skin-stage-glow { animation: none !important; } }

/* 21st.dev — border beam (бегущая подсветка) на карточке превью */
@property --skin-beam { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.skin-preview-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    height: auto;
    border-radius: 20px;
    padding: 1.5px;
    z-index: 3;
    pointer-events: none;
    background: conic-gradient(from var(--skin-beam),
        transparent 0deg, transparent 285deg,
        rgba(196, 165, 255, 0.1) 312deg, #c4a5ff 344deg, #ffffff 357deg, #c4a5ff 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    animation: skin-beam 4.5s linear infinite;
}
@keyframes skin-beam { to { --skin-beam: 360deg; } }

/* 21st.dev — shimmer на основной кнопке */
.skin-btn.btn-primary { position: relative; overflow: hidden; }
.skin-btn.btn-primary::after {
    content: "";
    position: absolute;
    top: 0; left: -70%;
    width: 55%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
    animation: skin-shimmer 3.6s ease-in-out infinite;
}
@keyframes skin-shimmer { 0% { left: -70%; } 55%, 100% { left: 140%; } }

@media (prefers-reduced-motion: reduce) {
    .skin-preview-panel::before { animation: none; }
    .skin-btn.btn-primary::after { display: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
    .skin-grid { grid-template-columns: 1fr; }
    .skin-col-side { position: static; grid-template-columns: 1fr 1fr; display: grid; }
    .skin-preview-panel { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .skin-profile { grid-template-columns: 1fr; gap: 16px; }
    .skin-controls { grid-template-columns: 1fr; }
    .skin-col-side { grid-template-columns: 1fr; }
    .skin-hero { flex-direction: column; }
}
@media (max-width: 560px) {
    .skin-wrap { width: calc(100% - 32px); }
    .skin-profile-row { grid-template-columns: 1fr; gap: 4px; }
}
