:root {
  --bg: #0E1012; --bg2: #121518; --card: #14171A; --card2: #1A1E22;
  --line: #1F2328; --line2: #23272C; --line3: #2A2F35;
  --text: #ECEFF1; --text2: #C9CFD4; --muted: #9AA3AB; --muted2: #8A939B;
  --err-bg: #2A1517; --err-line: #5A2328; --err: #FF8A8F; --err-input: #C9454B;
  --accent: #5BE37D; --d1: #2F8A4A; --d2: #1F5C33; --soft: #173322; --ink: #0B1A10;
  --d1-dark: #1F533A; --d2-dark: #173A27;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { color: var(--text); font-family: Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--text2); } a:hover { color: var(--text); }
button { font-family: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: not-allowed; }
input { font-family: inherit; }
input[type=checkbox] { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--accent); flex-shrink: 0; }
button:focus-visible, input:focus-visible, a:focus-visible, label:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
[hidden] { display: none !important; }
.display { font-family: Unbounded, sans-serif; font-weight: 700; }
.app { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { max-width: 1200px; width: 100%; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }

/* кнопки */
.btn { height: 44px; padding: 0 18px; border-radius: 12px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.btn-primary { border: 0; background: var(--accent); color: var(--ink); font-weight: 700; }
.btn-primary:hover { color: var(--ink); filter: brightness(1.06); }
.btn-ghost { border: 1px solid var(--line3); background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--card); color: var(--text); }
.btn-soft { height: 40px; padding: 0 16px; border: 1px solid var(--line3); border-radius: 10px; background: var(--card2); color: var(--text); font-size: 14px; font-weight: 600; }
.btn-lg { height: 54px; padding: 0 26px; border-radius: 14px; font-size: 16px; }
.btn-md { height: 50px; padding: 0 24px; border-radius: 14px; font-size: 15px; }
.link-btn { height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--accent); font-size: 14px; font-weight: 700; }

/* шапка */
header.top { border-bottom: 1px solid #1C2024; background: var(--bg); position: relative; z-index: 5; }
header.top .wrap { padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.logo { height: 44px; border: 0; background: transparent; color: var(--text); display: flex; align-items: center; gap: 10px; padding: 0 4px; text-decoration: none; }
.logo span { font-family: Unbounded, sans-serif; font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.logo:hover { color: var(--text); }
.cube-a { fill: var(--accent); } .cube-1 { fill: var(--d1); } .cube-2 { fill: var(--d2); }
nav.main { display: flex; gap: 4px; }
nav.main a { height: 44px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; text-decoration: none; }
nav.main a[aria-current=page] { background: #1F2429; color: var(--text); font-weight: 700; }
.spacer { flex: 1; }
.palette { position: relative; }
.palette-btn { height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.swatch-dot { width: 18px; height: 18px; border-radius: 6px; background: var(--accent); flex-shrink: 0; }
.palette-menu { position: absolute; top: 52px; right: 0; width: 220px; z-index: 20; padding: 6px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line3); box-shadow: 0 16px 40px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 2px; }
.palette-menu .title { padding: 8px 10px 6px; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted2); }
.palette-row { height: 44px; border: 0; border-radius: 10px; padding: 0 10px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; background: transparent; color: var(--text2); }
.palette-row[aria-pressed=true] { background: #23282E; color: var(--text); }
.palette-row .name { flex: 1; text-align: left; }
.palette-row .check { visibility: hidden; } .palette-row[aria-pressed=true] .check { visibility: visible; }
.auth-btns { display: flex; gap: 8px; }
.user-btn { height: 44px; padding: 0 14px 0 6px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); color: var(--text); display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; text-decoration: none; }
.user-btn:hover { color: var(--text); }
.avatar-box { width: 32px; height: 32px; border-radius: 8px; background: var(--card2); display: flex; align-items: center; justify-content: center; }
canvas.px { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

main { flex: 1; display: flex; flex-direction: column; }
.view { display: flex; flex-direction: column; }

/* главная */
.hero { padding-top: 80px; padding-bottom: 72px; display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.hero-text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero h1 { margin: 0; font-size: clamp(38px, 5vw, 60px); line-height: 1.08; letter-spacing: -1px; }
.hero p { margin: 0; max-width: 460px; font-size: 17px; line-height: 1.6; color: var(--muted); }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.small-meta { font-size: 13px; color: var(--muted2); }
.hero-art { flex: 1 1 420px; min-width: 0; height: 460px; position: relative; display: flex; align-items: center; justify-content: center; perspective: 1100px; }
.glow { position: absolute; left: 50%; top: 50%; width: 340px; height: 340px; margin: -190px 0 0 -170px; border-radius: 50%; background: var(--accent); opacity: .12; filter: blur(80px); }
.floor-shadow { position: absolute; left: 50%; bottom: 48px; width: 200px; height: 30px; margin-left: -100px; border-radius: 50%; background: #000; opacity: .45; filter: blur(14px); }
.cube { position: relative; transform-style: preserve-3d; }
.cube .spin { position: absolute; inset: 0; transform-style: preserve-3d; }
.cube .f { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; }
.cube-big { width: 210px; height: 210px; }
.cube-big .f { --z: 105px; }
.cube .f.s1 { background: linear-gradient(to bottom, var(--d1) 0%, var(--d1) 55%, var(--d1-dark) 100%); }
.cube .f.s2 { background: linear-gradient(to bottom, var(--d2) 0%, var(--d2) 55%, var(--d2-dark) 100%); }
.cube .f.top { background: var(--accent); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.cube .f.bot { background: var(--bg); }
.cube .f.front { transform: rotateY(0deg) translateZ(var(--z)); }
.cube .f.right { transform: rotateY(90deg) translateZ(var(--z)); }
.cube .f.back { transform: rotateY(180deg) translateZ(var(--z)); }
.cube .f.left { transform: rotateY(-90deg) translateZ(var(--z)); }
.cube .f.top { transform: rotateX(90deg) translateZ(var(--z)); }
.cube .f.bot { transform: rotateX(-90deg) translateZ(var(--z)); }
.cube-mini .f { box-shadow: inset 0 0 0 1px rgba(0,0,0,.28); }
.cube-mini .f.s1 { background: var(--d1); } .cube-mini .f.s2 { background: var(--d2); } .cube-mini .f.bot { background: var(--d2); }
.cube-a1 { position: absolute; right: 9%; top: 12%; width: 54px; height: 54px; } .cube-a1 .f { --z: 27px; }
.cube-a2 { position: absolute; left: 10%; bottom: 24%; width: 34px; height: 34px; } .cube-a2 .f { --z: 17px; }
.cb-l { position: absolute; inset: 0; background: #000; opacity: 0; animation: cbLight 14s linear infinite; }
@keyframes cbSpin { from { transform: rotateX(-26deg) rotateY(0deg); } to { transform: rotateX(-26deg) rotateY(360deg); } }
@keyframes cbSpinR { from { transform: rotateX(32deg) rotateZ(18deg) rotateY(360deg); } to { transform: rotateX(32deg) rotateZ(18deg) rotateY(0deg); } }
@keyframes cbFloat { 0%,100% { transform: translateY(-12px); } 50% { transform: translateY(12px); } }
@keyframes cbShadow { 0%,100% { transform: scale(.82); opacity: .35; } 50% { transform: scale(1); opacity: .6; } }
@keyframes cbLight { 0%,100% { opacity: 0; } 25% { opacity: .25; } 50% { opacity: .45; } 75% { opacity: .25; } }
.cb-spin { animation: cbSpin 14s linear infinite; }
.cb-spin-r { animation: cbSpinR 9s linear infinite; }
.cb-spin-r2 { animation: cbSpinR 6s linear infinite reverse; }
.cb-float { animation: cbFloat 5s ease-in-out infinite; }
.cb-mini { animation: cbFloat 4s ease-in-out infinite reverse; }
.cb-mini2 { animation: cbFloat 3.4s ease-in-out infinite; }
.cb-shadow { animation: cbShadow 5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .cb-spin, .cb-spin-r, .cb-spin-r2, .cb-float, .cb-mini, .cb-mini2, .cb-shadow, .cb-l { animation: none; }
  .cb-spin { transform: rotateX(-26deg) rotateY(-35deg); }
}

.section { padding-top: 24px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 28px; }
h2.h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.5px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card { padding: 24px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.card h3 { margin: 0; font-size: 17px; font-weight: 700; }
.card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.icon-tile { width: 44px; height: 44px; border-radius: 12px; background: var(--soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.band { background: var(--bg2); border-top: 1px solid #1C2024; border-bottom: 1px solid #1C2024; }
.band .wrap { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 32px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps .card { background: var(--bg); }
.num { width: 32px; height: 32px; border-radius: 9px; background: var(--soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; flex-shrink: 0; }
.num.on { background: var(--accent); color: var(--ink); }

/* скачать */
.narrow { max-width: 1000px; }
.page { padding-top: 64px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 28px; }
.page h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.8px; }
.dl-row { display: flex; flex-wrap: wrap; gap: 12px; }
.dl-main { flex: 999 1 420px; min-width: 0; padding: 28px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.dl-file { display: flex; align-items: center; gap: 16px; }
.dl-file b { font-size: 17px; }
.specs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.specs li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.specs li:last-child { border-bottom: 0; }
.specs li span:first-child { color: var(--muted); } .specs li span:last-child { font-weight: 600; text-align: right; }
.dl-side { flex: 1 1 300px; min-width: 0; padding: 24px; border-radius: 18px; background: var(--bg); border: 1px solid var(--line2); display: flex; flex-direction: column; justify-content: space-between; gap: 22px; }
.blocks { height: 14px; border-radius: 4px; background: var(--card2); overflow: hidden; display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 3px; padding: 3px; }
.blocks span { border-radius: 2px; background: #23282D; }
.blocks span.on { background: var(--accent); }
.howto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.howto li { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--card); font-size: 15px; line-height: 1.5; }
.howto li:last-child { border-bottom: 0; }
.howto .num { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }

/* формы */
.form-page { flex: 1; padding: 64px 24px 80px; display: flex; justify-content: center; }
.form { width: 100%; max-width: 420px; padding: 32px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.form.wide { max-width: 460px; }
.form h1 { margin: 0; font-size: 28px; letter-spacing: -.5px; }
.form-head { display: flex; flex-direction: column; gap: 8px; }
.form-head p { margin: 0; font-size: 14px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text2); }
.input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line3); border-radius: 12px; background: var(--bg); color: var(--text); font-size: 15px; }
.input.err { border-color: var(--err-input); }
.pw-wrap { position: relative; } .pw-wrap .input { padding-right: 52px; }
.pw-eye { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.hint { font-size: 12px; color: var(--muted2); } .hint.err { color: var(--err); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--text2); cursor: pointer; }
.check.top { align-items: flex-start; line-height: 1.5; } .check.top input { margin-top: 2px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.alert { padding: 12px 14px; border-radius: 12px; background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err); font-size: 14px; }
.submit { height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: var(--ink); font-size: 16px; font-weight: 700; }
.center-note { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }

/* кабинет */
.acc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.acc-ava { width: 88px; height: 88px; border-radius: 20px; background: var(--card2); border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; }
.acc-name { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.acc-name h1 { margin: 0; font-size: clamp(26px, 3.5vw, 36px); letter-spacing: -.6px; word-break: break-all; }
.acc-sub { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.badge { width: 26px; height: 26px; border-radius: 7px; background: var(--soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; letter-spacing: .3px; }
.tabs { align-self: flex-start; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.tabs button { height: 40px; padding: 0 18px; border: 0; border-radius: 9px; font-size: 14px; font-weight: 700; background: transparent; color: var(--muted); }
.tabs button[aria-selected=true] { background: #262B31; color: var(--text); }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line2); }
.seg button { height: 40px; padding: 0 14px; border: 0; border-radius: 9px; font-size: 13px; font-weight: 600; background: transparent; color: var(--muted2); }
.seg button[aria-checked=true] { background: #262B31; color: var(--text); }
.panel { min-width: 0; padding: 24px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.skin-preview-card { flex: 1 1 340px; padding: 20px; align-items: center; gap: 16px; }
.skin-stage { position: relative; width: 100%; height: 420px; border-radius: 14px; background: var(--bg); border: 1px solid #1C2024; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.skin-stage .glow2 { position: absolute; left: 50%; top: 50%; width: 240px; height: 240px; margin: -150px 0 0 -120px; border-radius: 50%; background: var(--accent); opacity: .08; filter: blur(60px); }
.skin-stage .sh { position: absolute; left: 50%; bottom: 36px; width: 170px; height: 20px; margin-left: -85px; border-radius: 50%; background: #000; opacity: .55; filter: blur(9px); }
.skin-stage canvas { position: relative; }
.skin-edit { flex: 1 1 420px; }
.status { height: 28px; padding: 0 10px; border-radius: 8px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--accent); }
.status.dirty { background: #3A2A12; color: #FFB547; }
.drop { position: relative; min-height: 150px; padding: 20px; border-radius: 14px; border: 1.5px dashed #2F353B; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; cursor: pointer; }
.drop.drag { border-color: var(--accent); background: var(--soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.preset { min-height: 96px; padding: 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 13px; font-weight: 700; }
.preset[aria-pressed=true] { border-color: var(--accent); }
.ok-msg { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text2); }
.settings { padding: 8px 24px; }
.set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .lbl { display: flex; flex-direction: column; gap: 2px; }
.set-row .lbl b { font-size: 14px; font-weight: 600; } .set-row .lbl span { font-size: 12px; color: var(--muted2); word-break: break-all; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 10px; border: 0; }
.swatch[aria-pressed=true] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--sw); }
.inline-form { width: 100%; display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.inline-form .row-btns .btn { height: 44px; }

footer.bottom { border-top: 1px solid #1C2024; }
footer.bottom .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 13px; color: var(--muted2); }
footer.bottom nav { display: flex; flex-wrap: wrap; gap: 18px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 12px 16px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line3); box-shadow: 0 16px 40px rgba(0,0,0,.5); font-size: 14px; max-width: calc(100% - 32px); }

@media (max-width: 640px) {
  .hero { padding-top: 40px; padding-bottom: 40px; }
  .hero-art { height: 340px; }
  .form { padding: 24px; }
  .form-page { padding: 32px 16px 56px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .skin-stage { height: 360px; }
}
