        :root {
            --bg:       #070708;
            --surface:  #111113;
            --surface2: #17171a;
            --border:   rgba(255,255,255,0.07);
            --border2:  rgba(255,255,255,0.12);
            --text:     #f2f2f3;
            --muted:    #626875;
            --soft:     #9299a6;
            --red:      #FF4655;
            --red-dim:  rgba(255,70,85,0.14);
            --red-ring: rgba(255,70,85,0.22);
            --green:    #00EA61;
            --gold:     #F0A500;
            --cyan:     #00D4FF;
        }

        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        html { -webkit-font-smoothing: antialiased; }

        body {
            min-height: 100vh;
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 14px;
            line-height: 1.5;
            color: var(--text);
            background:
                radial-gradient(ellipse 54% 34% at 16% -10%, rgba(255,70,85,0.14), transparent 70%),
                radial-gradient(ellipse 48% 34% at 88% 108%, rgba(0,212,255,0.10), transparent 68%),
                radial-gradient(circle at 52% 36%, rgba(255,255,255,0.02), transparent 34%),
                var(--bg);
            overflow-x: hidden;
        }

        @keyframes heroAmbientDrift {
            0%   { transform: translate3d(0, 0, 0) scale(1); }
            50%  { transform: translate3d(3%, 2%, 0) scale(1.04); }
            100% { transform: translate3d(-2%, 1%, 0) scale(0.97); }
        }

        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background-image:
                linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255,255,255,0.026) 1px, transparent 1px);
            background-size: 52px 52px;
            mask-image: radial-gradient(ellipse 92% 72% at 50% 28%, rgba(0,0,0,0.38), transparent);
            -webkit-mask-image: radial-gradient(ellipse 92% 72% at 50% 28%, rgba(0,0,0,0.38), transparent);
            pointer-events: none;
            z-index: -1;
        }

        body::after {
            content: '';
            position: fixed;
            inset: -8%;
            pointer-events: none;
            z-index: -1;
            background:
                radial-gradient(circle at 14% 28%, rgba(255,70,85,0.22), transparent 32%),
                radial-gradient(circle at 84% 32%, rgba(0,212,255,0.17), transparent 30%);
            animation: heroAmbientDrift 16s ease-in-out infinite alternate;
        }

        button { cursor: pointer; font: inherit; border: none; background: none; }
        a { color: inherit; text-decoration: none; }
        input, select { font: inherit; }

        /* Visible focus only for keyboard users */
        button:focus { outline: none; }
        :focus-visible {
            outline: 2px solid rgba(255,140,150,0.85);
            outline-offset: 2px;
            border-radius: 6px;
        }
        .vis-chip:focus-within, .color-field:focus-within {
            outline: 2px solid rgba(255,140,150,0.85);
            outline-offset: 2px;
        }

        nav {
            position: sticky; top: 0; z-index: 100;
            border-bottom: 1px solid var(--border);
            background: rgba(8,8,8,0.82);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
        }
        .nav-inner {
            max-width: 1240px;
            margin: 0 auto;
            padding: 0 24px;
            height: 56px;
            display: flex; align-items: center; justify-content: space-between;
            gap: 16px;
        }
        .nav-brand {
            display: flex; align-items: center; gap: 8px;
            flex: 0 0 auto;
        }
        .nav-brand-main {
            display: flex; align-items: center; gap: 10px;
        }
        .nav-logo {
            width: 32px; height: 32px;
            border-radius: 8px;
            border: 1px solid var(--border2);
            overflow: hidden;
        }
        .nav-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
        .nav-wordmark {
            font-size: 15px; font-weight: 900; letter-spacing: -0.03em;
        }
        .nav-wordmark span { color: var(--red); }
        .nav-boosty {
            width: 32px; height: 28px; padding: 0;
            border-radius: 8px;
            border: 1px solid rgba(241,91,43,0.28);
            background: rgba(241,91,43,0.055);
            color: #f47a55;
            display: inline-flex; align-items: center; justify-content: center;
            font-size: 11px; font-weight: 800;
            letter-spacing: 0.01em;
            white-space: nowrap;
            transition: transform 0.15s, border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
        }
        .nav-boosty:hover {
            transform: translateY(-1px);
            border-color: rgba(241,91,43,0.55);
            background: rgba(241,91,43,0.12);
            color: #ff9a78;
            box-shadow: 0 0 18px rgba(241,91,43,0.10);
        }
        .nav-boosty svg {
            width: 12px; height: 12px;
            fill: currentColor;
            flex: 0 0 auto;
        }
        .nav-menu {
            display: flex; align-items: center; justify-content: center; gap: 8px;
            min-width: 0;
        }
        .nav-separator {
            width: 1px; height: 18px; flex: 0 0 auto;
            margin: 0 4px;
            background: rgba(255,255,255,0.10);
        }
        .nav-actions { display: flex; align-items: center; gap: 10px; }
        .nav-link,
        .nav-lang {
            height: 34px; padding: 0 11px;
            border-radius: 9px;
            background: transparent;
            border: 1px solid transparent;
            color: var(--soft);
            font-size: 12px; font-weight: 800;
            letter-spacing: 0.01em;
            display: inline-flex; align-items: center; justify-content: center; gap: 7px;
            transition: transform 0.15s, border-color 0.15s, color 0.15s, background 0.15s;
            white-space: nowrap;
        }
        .nav-link:hover,
        .nav-lang:hover {
            transform: translateY(-1px);
            border-color: rgba(255,255,255,0.16);
            color: #fff;
            background: rgba(255,255,255,0.035);
        }
        .nav-link[aria-current="page"] {
            border-color: rgba(255,70,85,0.48);
            color: rgba(255,120,130,0.98);
            background: rgba(255,70,85,0.06);
        }
        .nav-link svg,
        .nav-lang svg {
            width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.1;
            stroke-linecap: round; stroke-linejoin: round;
        }
        .nav-link[href^="https://t.me/"] svg {
            fill: currentColor;
            stroke: none;
        }
        .nav-lang {
            height: 30px;
            min-width: 56px;
            padding: 0 11px;
            gap: 6px;
            border-radius: 8px;
            border-color: rgba(255,255,255,0.13);
            background: rgba(16,17,20,0.72);
            color: rgba(184,192,205,0.94);
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.02em;
        }
        .nav-lang:hover {
            border-color: rgba(255,255,255,0.20);
            background: rgba(21,23,27,0.86);
            color: #fff;
        }
        .nav-lang svg {
            width: 12px;
            height: 12px;
            opacity: 0.72;
        }

        /* ─ Layout ─────────────────────────────────── */

        .app {
            position: relative;
            width: min(1160px, calc(100% - 48px));
            min-height: calc(100vh - 56px);
            margin: 0 auto;
            padding: 18px 0 10px;
            display: grid;
            grid-template-rows: auto 1fr auto;
            gap: 14px;
        }

        /* ─ Header ───────────────────────────────────  */

        .topbar {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 16px;
        }

        .topbar-right {
            display: flex;
            align-items: flex-end;
            gap: 8px;
        }

        .title-row {
            display: flex;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
        }

        .brand-avatar {
            width: 54px;
            height: 54px;
            border-radius: 50%;
            border: 2px solid rgba(255,70,85,0.45);
            background: url(./pa1kalogo.jpg) center/cover no-repeat;
            flex-shrink: 0;
            box-shadow: 0 0 20px rgba(255,70,85,0.22), 0 2px 8px rgba(0,0,0,0.4);
            user-select: none;
            -webkit-user-drag: none;
        }

        h1 {
            font-family: 'Inter', system-ui, sans-serif;
            font-size: clamp(30px, 5vw, 52px);
            font-weight: 800;
            letter-spacing: -1.5px;
            line-height: 1;
            color: #fff;
        }

        @keyframes textFlow {
            from { background-position: 0% center; }
            to   { background-position: 200% center; }
        }

        .h1-accent {
            background: linear-gradient(160deg, #ff9a9a, #ff4655, #cc2020, #ff4655, #ff9a9a);
            background-size: 200% auto;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: textFlow 5s linear infinite;
        }

        .title-row {
            display: flex;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
        }

        .brand { position: relative; }

        .subtitle {
            margin-top: 4px;
            color: var(--muted);
            font-size: 13px;
        }

        .hero-desc {
            margin-top: 6px;
            color: var(--soft);
            font-size: 14px;
            line-height: 1.5;
        }

        .home-link {
            height: 34px;
            padding: 0 12px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            border: 1px solid var(--border2);
            border-radius: 8px;
            background: rgba(255,255,255,0.035);
            color: var(--soft);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 12px;
            font-weight: 700;
            text-decoration: none;
            transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
        }

        .home-link:hover {
            color: var(--text);
            border-color: rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.055);
            transform: translateY(-1px);
        }

        .home-link svg {
            width: 14px;
            height: 14px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* ─ Workspace ────────────────────────────────  */

        .workspace {
            display: grid;
            grid-template-columns: minmax(380px, 480px) 1fr;
            gap: 16px;
            align-items: start;
        }

        /* ─ Card ─────────────────────────────────────  */

        .card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 14px;
        }

        /* ─ Generator ───────────────────────────────  */

        .generator {
            padding: 22px 28px 20px;
        }

        .gen-header {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 12px;
            min-height: 0;
            margin-bottom: 0;
        }

        .gen-header h2 {
            display: none;
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11px;
            font-weight: 600;
            color: var(--muted);
            letter-spacing: 0.8px;
            text-transform: uppercase;
        }

        .check-state {
            font-size: 12px;
            color: var(--muted);
            text-align: center;
            min-height: 0;
            transition: opacity 0.2s;
        }
        .check-state:empty { display: none; }
        .check-state.ok      { color: var(--green); }
        .check-state.error   { color: var(--red); }
        .check-state.pending { color: var(--gold); }

        /* ─ Quick steps ──────────────────────────────  */

        .quick-steps {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            counter-reset: qstep;
            margin-bottom: 20px;
            padding: 2px 0 16px;
            border-bottom: 1px solid var(--border);
            position: relative;
        }

        .quick-steps.is-hidden { display: none; }

        /* Tiny dismiss "✕" — top-right corner */
        .qs-close {
            position: absolute;
            top: -6px;
            right: -8px;
            width: 22px;
            height: 22px;
            display: grid;
            place-items: center;
            border: 1px solid var(--border);
            border-radius: 50%;
            background: var(--surface2);
            color: var(--muted);
            font-size: 13px;
            line-height: 1;
            font-weight: 600;
            transition: color 0.15s, border-color 0.15s, transform 0.15s, background 0.15s;
        }
        .qs-close:hover {
            color: var(--text);
            border-color: rgba(255,255,255,0.22);
            background: rgba(255,255,255,0.04);
            transform: scale(1.08);
        }

        .quick-step {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 4px;
            counter-increment: qstep;
            padding: 0 6px;
            position: relative;
        }

        .quick-step:not(:last-child) {
            border-right: 1px solid var(--border);
        }

        /* Number circle via CSS counter */
        .quick-step::before {
            content: counter(qstep);
            display: grid;
            place-items: center;
            width: 18px; height: 18px;
            border-radius: 50%;
            border: 1px solid rgba(255,70,85,0.22);
            background: rgba(255,70,85,0.06);
            color: rgba(255,110,120,0.75);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 9.5px;
            font-weight: 700;
            flex-shrink: 0;
            margin-bottom: 0;
        }

        .quick-step strong {
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 10.5px;
            font-weight: 600;
            color: var(--soft);
            letter-spacing: 0;
            margin-bottom: 0;
        }

        .quick-step span {
            display: block;
            font-size: 10px;
            color: var(--muted);
            line-height: 1.35;
        }

        /* ─ Form ─────────────────────────────────────  */

        .form-grid {
            display: grid;
            gap: 12px;
        }

        .form-group {
            display: grid;
            gap: 5px;
        }

        /* ─ Custom region dropdown (replaces native <select>) ─ */
        .region-select { position: relative; }

        .region-trigger {
            width: 100%;
            min-height: 44px;
            padding: 0 12px 0 12px;
            background: var(--surface2);
            border: 1px solid var(--border2);
            border-radius: 9px;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            text-align: left;
            font-family: 'Inter', system-ui, sans-serif;
            transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
        }
        .region-trigger:hover { border-color: rgba(255,255,255,0.18); }
        .region-trigger[aria-expanded="true"] {
            border-color: rgba(0,212,255,0.45);
            box-shadow: 0 0 0 3px rgba(0,212,255,0.12);
            background: #0f0f11;
        }
        .region-label {
            flex: 1;
            font-size: 14px;
            font-weight: 600;
            color: var(--text);
        }
        .region-caret {
            display: inline-flex;
            color: var(--soft);
            transition: transform 0.18s ease;
        }
        .region-caret svg { width: 11px; height: 7px; stroke: currentColor; fill: none; }
        .region-trigger[aria-expanded="true"] .region-caret { transform: rotate(180deg); color: var(--cyan); }

        .region-dropdown {
            position: absolute;
            top: calc(100% + 6px);
            left: 0; right: 0;
            background: linear-gradient(180deg, #15171b 0%, #101115 100%);
            border: 1px solid var(--border2);
            border-radius: 10px;
            list-style: none;
            padding: 5px;
            margin: 0;
            z-index: 30;
            box-shadow: 0 16px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02) inset;
            animation: regionFadeIn 0.16s ease-out;
        }
        .region-dropdown[hidden] { display: none; }
        @keyframes regionFadeIn {
            from { opacity: 0; transform: translateY(-4px); }
            to   { opacity: 1; transform: none; }
        }

        .region-option {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 7px;
            cursor: pointer;
            color: var(--soft);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 13px;
            font-weight: 600;
            transition: color 0.12s ease, background 0.12s ease;
            user-select: none;
        }
        .region-option:hover {
            background: rgba(255,255,255,0.04);
            color: var(--text);
        }
        .region-option[aria-selected="true"] {
            background: rgba(0,212,255,0.10);
            color: var(--text);
            box-shadow: 0 0 0 1px rgba(0,212,255,0.20) inset;
        }

        .region-flags {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 42px;
            height: 22px;
        }
        .region-flags .fi {
            width: 25px;
            height: 18px;
            border-radius: 3px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.45);
        }

        /* Visually hidden but still in form data + screen reader accessible */
        .visually-hidden {
            position: absolute;
            width: 1px; height: 1px;
            padding: 0; margin: -1px;
            overflow: hidden;
            clip: rect(0,0,0,0);
            white-space: nowrap;
            border: 0;
        }
        #region.visually-hidden {
            position: absolute !important;
            width: 1px !important;
            min-height: 1px !important;
            height: 1px !important;
            padding: 0 !important;
            margin: -1px !important;
            border: 0 !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }

        /* ─ Field action buttons (paste / toggle inside input) ─ */
        .field-actions {
            position: absolute;
            right: 6px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            gap: 2px;
            z-index: 2;
        }
        .field-action {
            width: 30px;
            height: 30px;
            display: grid;
            place-items: center;
            border-radius: 6px;
            color: var(--soft);
            border: 1px solid transparent;
            background: transparent;
            transition: color 0.15s, background 0.15s, border-color 0.15s;
            opacity: 0.85;
        }
        .field-action:hover {
            color: var(--text);
            background: rgba(255,255,255,0.06);
            opacity: 1;
        }
        .field-action:active {
            background: rgba(255,255,255,0.10);
        }
        .field-action svg {
            width: 14px; height: 14px;
            stroke: currentColor;
            stroke-width: 1.7;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        /* Reserve right space for inline action buttons */
        .field-shell:has(.field-actions) input { padding-right: 72px; }
        /* Fallback for browsers without :has() — hardcode for the API key field */
        #apiKey { padding-right: 72px; }

        /* ─ Live format status (Riot ID validation) ─ */
        .format-status {
            display: none;
            align-items: center;
            gap: 6px;
            font-size: 11.5px;
            line-height: 1.3;
            margin-top: 2px;
        }
        .format-status[data-state] { display: inline-flex; }
        .format-status[data-state="valid"]    { color: rgba(120,230,160,0.95); }
        .format-status[data-state="invalid"]  { color: rgba(255,140,148,0.95); }
        .format-status[data-state="checking"] { color: var(--soft); }
        .format-status[data-state="warn"]     { color: rgba(255,200,100,0.95); }
        .format-status .fs-icon {
            width: 14px; height: 14px;
            flex-shrink: 0;
            display: grid;
            place-items: center;
            border-radius: 50%;
        }
        .format-status[data-state="valid"]    .fs-icon { background: rgba(0,234,97,0.18); }
        .format-status[data-state="invalid"]  .fs-icon { background: rgba(255,70,85,0.18); }
        .format-status[data-state="checking"] .fs-icon { background: rgba(255,255,255,0.06); }
        .format-status[data-state="warn"]     .fs-icon { background: rgba(255,170,40,0.16); }
        .format-status .fs-icon svg {
            width: 9px; height: 9px;
            stroke: currentColor;
            stroke-width: 2.6;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .format-status[data-state="checking"] .fs-icon svg { animation: fsSpin 0.9s linear infinite; }
        @keyframes fsSpin { to { transform: rotate(360deg); } }

        /* When format-status is showing — hide the static hint to avoid duplicate text under the field */
        .form-group:has(.format-status[data-state]) .hint { display: none; }

        /* ─ Preview corner meta label ─ */
        .preview-meta {
            position: absolute;
            bottom: 8px;
            right: 12px;
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 9px;
            font-weight: 600;
            color: rgba(255,255,255,0.20);
            letter-spacing: 0.7px;
            text-transform: uppercase;
            pointer-events: none;
            z-index: 1;
            user-select: none;
        }

        /* ─ CTA attention pulse (first-visit only) ─ */
        @keyframes ctaAttention {
            0%, 100% {
                transform: scale(1);
                box-shadow:
                    inset 0 1px 0 rgba(255,255,255,0.16),
                    inset 0 -1px 0 rgba(0,0,0,0.18),
                    0 4px 14px rgba(200,43,57,0.22);
            }
            50% {
                transform: scale(1.018);
                box-shadow:
                    inset 0 1px 0 rgba(255,255,255,0.22),
                    inset 0 -1px 0 rgba(0,0,0,0.18),
                    0 10px 28px rgba(229,57,70,0.45);
            }
        }
        .primary-btn.attention-pulse {
            animation: ctaAttention 1.55s ease-in-out 1.2s 3;
        }

        label {
            font-size: 13px;
            font-weight: 500;
            color: var(--soft);
        }

        /* Field shell (icon inside) */
        .field-shell {
            position: relative;
        }

        .field-icon {
            position: absolute;
            left: 13px;
            top: 50%;
            width: 16px;
            height: 16px;
            transform: translateY(-50%);
            color: var(--muted);
            pointer-events: none;
        }

        .field-shell input,
        .field-shell select {
            padding-left: 40px;
        }

        input, select {
            width: 100%;
            min-height: 44px;
            padding: 0 14px;
            background: var(--surface2);
            border: 1px solid var(--border2);
            border-radius: 9px;
            color: var(--text);
            outline: none;
            transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
        }

        input::placeholder { color: var(--muted); }

        select {
            -webkit-appearance: none;
            appearance: none;
            cursor: pointer;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.25)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 14px center;
        }

        select option { background: #1a1a1d; color: var(--text); }

        input:focus, select:focus {
            border-color: rgba(255,70,85,0.5);
            box-shadow: 0 0 0 3px var(--red-ring);
            background: #0f0f11;
        }

        /* Invalid field state */
        .field-shell.invalid input,
        .field-shell.invalid select {
            border-color: rgba(255,70,85,0.55);
            background: rgba(255,70,85,0.05);
            box-shadow: 0 0 0 3px rgba(255,70,85,0.12);
        }

        .field-shell.invalid .field-icon {
            color: rgba(255,100,115,0.7);
        }

        .field-error {
            display: none;
            font-size: 12px;
            color: rgba(255,120,130,0.9);
        }

        .field-error.active { display: block; }

        /* Field row (input + button side by side) */
        .field-row {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 8px;
        }

        .field-row input { min-width: 0; }

        .hint {
            font-size: 11.5px;
            color: var(--muted);
            line-height: 1.35;
        }

        .hint a, .footer a {
            color: var(--soft);
            border-bottom: 1px solid rgba(255,255,255,0.15);
            transition: color 0.15s, border-color 0.15s;
        }

        .hint a:hover { color: var(--text); border-bottom-color: rgba(255,255,255,0.4); }

        /* Inline key help button */
        .inline-help-btn {
            min-height: 44px;
            padding: 0 14px;
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 9px;
            background: var(--surface2);
            color: var(--soft);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11px;
            font-weight: 600;
            white-space: nowrap;
            letter-spacing: 0.3px;
            transition: border-color 0.18s, color 0.18s, background 0.18s;
        }

        .inline-help-btn:hover {
            border-color: rgba(255,255,255,0.2);
            color: var(--text);
            background: rgba(255,255,255,0.04);
        }

        /* Toggle / checkbox */
        .option-row { padding: 0; margin-bottom: -4px; }
        .option-row.single { display: flex; }

        .toggle {
            display: inline-flex;
            align-items: center;
            gap: 9px;
            cursor: pointer;
            user-select: none;
            color: var(--soft);
            font-size: 13px;
        }

        .toggle input[type="checkbox"] {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-visual {
            width: 34px;
            height: 20px;
            border-radius: 99px;
            border: 1px solid rgba(255,255,255,0.12);
            background: rgba(255,255,255,0.06);
            position: relative;
            flex-shrink: 0;
            transition: background 0.2s, border-color 0.2s;
        }

        .toggle-visual::after {
            content: '';
            position: absolute;
            top: 3px; left: 3px;
            width: 12px; height: 12px;
            border-radius: 50%;
            background: var(--soft);
            transition: transform 0.2s, background 0.2s;
        }

        .toggle input:checked ~ .toggle-visual {
            background: rgba(255,70,85,0.18);
            border-color: rgba(255,70,85,0.45);
        }

        .toggle input:checked ~ .toggle-visual::after {
            transform: translateX(14px);
            background: var(--red);
        }

        /* ─ Buttons ──────────────────────────────────  */

        .form-actions { display: flex; flex-direction: column; gap: 0; }

        .primary-btn {
            width: 100%;
            min-height: 48px;
            border-radius: 10px;
            background: linear-gradient(180deg, #f54655 0%, #cc2b39 100%);
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.16),
                inset 0 -1px 0 rgba(0,0,0,0.18),
                0 4px 14px rgba(200,43,57,0.22);
            color: #fff;
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0.2px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition:
                background 0.18s ease,
                transform 0.14s ease,
                box-shadow 0.18s ease;
        }

        .primary-btn::before {
            content: '';
            width: 15px;
            height: 15px;
            flex-shrink: 0;
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E") center/contain no-repeat;
            opacity: 0.88;
        }

        .primary-btn:hover {
            background: linear-gradient(180deg, #e02f3f 0%, #b82533 100%);
            transform: translateY(-2px);
            box-shadow: 0 10px 28px rgba(200,43,57,0.38), inset 0 1px 0 rgba(255,255,255,0.1);
        }

        .primary-btn:active {
            transform: translateY(0);
            box-shadow: none;
        }

        .primary-btn.is-copied {
            background: linear-gradient(180deg, #00d86a 0%, #079246 100%);
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.12),
                inset 0 -1px 0 rgba(0,0,0,0.16),
                0 4px 14px rgba(0,216,106,0.18);
        }


        .copy-btn {
            min-height: 40px;
            padding: 0 16px;
            border: 1px solid rgba(0,234,97,0.2);
            border-radius: 8px;
            background: rgba(0,234,97,0.07);
            color: rgba(180,255,210,0.9);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 12px;
            font-weight: 600;
            transition: border-color 0.18s, background 0.18s, color 0.18s;
        }

        .copy-btn:hover {
            border-color: rgba(0,234,97,0.38);
            background: rgba(0,234,97,0.12);
            color: #fff;
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(0,234,97,0.10);
        }

        /* ─ Result box ───────────────────────────────  */

        .result-box {
            display: none;
            margin-top: 16px;
            padding: 16px;
            background: rgba(0,234,97,0.04);
            border: 1px solid rgba(0,234,97,0.1);
            border-radius: 10px;
            animation: fadeSlide 0.28s ease;
        }

        @keyframes fadeSlide {
            from { opacity: 0; transform: translateY(4px); }
            to   { opacity: 1; transform: none; }
        }

        .result-box h3 {
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 12px;
            font-weight: 700;
            color: rgba(180,255,210,0.9);
            letter-spacing: 0.3px;
            margin-bottom: 4px;
        }

        .result-box p {
            font-size: 12px;
            color: var(--muted);
            margin-bottom: 12px;
            line-height: 1.5;
        }

        .result-actions {
            display: flex;
            gap: 8px;
        }

        .result-actions .copy-btn { flex: 1; }

        /* Masked URL inside result box — shows the link with API key replaced by dots */
        .masked-url {
            display: none;
            margin-bottom: 12px;
            padding: 9px 11px;
            background: rgba(0,0,0,0.35);
            border: 1px solid var(--border2);
            border-radius: 7px;
            font-family: 'JetBrains Mono', ui-monospace, monospace;
            font-size: 11px;
            line-height: 1.4;
            color: rgba(220,225,232,0.78);
            word-break: break-all;
            user-select: text;
        }
        .masked-url.is-shown { display: block; }
        .masked-url .mu-key {
            color: var(--cyan);
            letter-spacing: 1.2px;
            opacity: 0.8;
        }

        /* ─ Service row ──────────────────────────────  */

        .service-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-top: 14px;
            padding-top: 14px;
            border-top: 1px solid var(--border);
            flex-wrap: wrap;
        }

        .footer-actions {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .footer-btn {
            height: 30px;
            padding: 0 12px;
            border: 1px solid var(--border2);
            border-radius: 6px;
            color: var(--soft);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.3px;
            transition: border-color 0.18s, color 0.18s, background 0.18s;
        }

        .footer-btn:hover {
            border-color: rgba(255,255,255,0.18);
            color: var(--text);
            background: rgba(255,255,255,0.03);
            transform: translateY(-1px);
        }

        /* Lang button — match width with other footer buttons; show globe + label */
        #langBtn {
            min-width: 50px;
            padding: 0 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }
        #langBtn svg {
            width: 12px;
            height: 12px;
            stroke: currentColor;
            stroke-width: 1.7;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
            opacity: 0.7;
        }

        /* FAQ "?" button — matches footer btn but circular for visual variety */
        .footer-btn.faq-btn {
            width: 30px;
            min-width: 30px;
            padding: 0;
            display: grid;
            place-items: center;
            font-size: 13px;
            font-weight: 700;
        }

        /* ─ Preview card ─────────────────────────────  */

        .preview {
            display: grid;
            grid-template-rows: auto 1fr auto;
            min-height: 460px;
        }

        .preview-top {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 12px;
            flex-wrap: wrap;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border);
            background: linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0));
        }

        .preview-label {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 34px;
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 12px;
            font-weight: 600;
            color: var(--soft);
            letter-spacing: 0.2px;
        }

        .preview-label::before {
            content: "";
            width: 7px;
            height: 7px;
            border-radius: 999px;
            background: #00e66a;
            box-shadow: 0 0 11px rgba(0,230,106,0.44);
        }

        .preview-preset-badge {
            display: inline-flex;
            align-items: center;
            min-height: 24px;
            padding: 0 9px;
            border: 1px solid rgba(0,212,255,0.20);
            border-radius: 999px;
            background: rgba(0,212,255,0.055);
            color: rgba(190,240,255,0.92);
            font-size: 11px;
            font-weight: 700;
            line-height: 1;
        }

        .hud-design-label {
            display: inline-flex;
            align-items: center;
            font-size: 11px;
            font-weight: 600;
            line-height: 1;
            color: var(--muted);
            letter-spacing: 0.2px;
            white-space: nowrap;
        }

        .hud-design-select {
            position: absolute;
            width: 1px;
            height: 1px;
            opacity: 0;
            pointer-events: none;
        }

        .hud-design-option-name {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .hud-design-recommended {
            flex: 0 0 auto;
            padding-top: 1px;
            color: rgba(251,191,36,0.92);
            font-size: 9px;
            font-weight: 700;
            line-height: 1.2;
            letter-spacing: 0;
        }

        .hud-design-field {
            padding: 10px 12px 11px;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 10px;
            background: rgba(255,255,255,0.016);
        }

        .hud-design-field .hud-design-label {
            height: auto;
            margin-bottom: 8px;
            color: var(--soft);
            font-size: 12px;
            font-weight: 700;
        }

        .hud-design-field .hud-design-label::after {
            content: none;
        }

        .hud-preset-grid {
            display: grid;
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 9px 7px;
        }

        .hud-preset-button {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            min-height: 32px;
            padding: 0 8px;
            border: 1px solid var(--border2);
            border-radius: 8px;
            background: rgba(255,255,255,0.035);
            color: var(--soft);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11.5px;
            font-weight: 700;
            cursor: pointer;
            transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
        }

        .hud-preset-button:hover {
            border-color: rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.055);
            color: var(--text);
        }

        .hud-preset-button.active {
            border-color: rgba(0,212,255,0.45);
            background: rgba(0,212,255,0.10);
            color: #fff;
            box-shadow: 0 0 0 1px rgba(0,212,255,0.14) inset;
        }

        .hud-preset-button {
            grid-column: span 2;
        }

        .hud-preset-button .hud-design-recommended {
            position: absolute;
            top: -8px;
            right: 7px;
            padding: 2px 6px;
            border: 1px solid rgba(251,191,36,0.36);
            border-radius: 999px;
            background: #1f1a0c;
            color: #fbbf24;
            font-size: 8px;
            font-weight: 800;
            line-height: 1;
            letter-spacing: 0.4px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.28);
        }

        .hud-design-option-name {
            display: block;
            width: 100%;
            line-height: 1.2;
            text-align: center;
        }

        .supporter-theme-btn {
            border-color: rgba(244,122,85,0.32);
            background: rgba(244,122,85,0.045);
            color: #ffcfbd;
        }

        .supporter-theme-btn:hover {
            border-color: rgba(244,122,85,0.48);
            background: rgba(244,122,85,0.08);
            color: #ffe0d3;
        }

        .supporter-theme-btn.active {
            border-color: rgba(244,122,85,0.62);
            background: rgba(244,122,85,0.14);
            color: #fff0e9;
            box-shadow: 0 0 0 1px rgba(244,122,85,0.12) inset;
        }

        .supporter-theme-btn.is-open {
            border-color: rgba(244,122,85,0.62);
            background: rgba(244,122,85,0.14);
            color: #fff0e9;
            box-shadow: 0 0 0 1px rgba(244,122,85,0.12) inset;
        }

        .hud-design-supporter-badge {
            position: absolute;
            top: -8px;
            right: 7px;
            min-width: 24px;
            height: 18px;
            padding: 0 7px;
            border: 1px solid rgba(244,122,85,0.34);
            border-radius: 999px;
            background: #1f130e;
            color: #f47a55;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.28);
        }

        .hud-design-supporter-badge svg {
            width: 10px;
            height: 10px;
            fill: currentColor;
        }

        .supporter-badge-text {
            font-size: 8px;
            font-weight: 800;
            line-height: 1;
            letter-spacing: 0.35px;
            color: #ffbf76;
            white-space: nowrap;
        }

        .supporter-theme-btn.is-locked .hud-design-supporter-badge {
            color: #ff9f7c;
            border-color: rgba(244,122,85,0.42);
        }

        .supporter-activation {
            margin-top: 10px;
            padding: 10px 12px 12px;
            border: 1px solid rgba(244,122,85,0.16);
            border-radius: 10px;
            background: linear-gradient(180deg, rgba(244,122,85,0.05), rgba(255,255,255,0.016));
        }

        .supporter-drawer-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 10px;
        }

        .supporter-drawer-copy {
            display: flex;
            align-items: flex-start;
            gap: 10px;
        }

        .supporter-drawer-brand svg {
            width: 12px;
            height: 12px;
            fill: currentColor;
        }

        .supporter-drawer-brand {
            display: inline-grid;
            place-items: center;
            width: 28px;
            height: 28px;
            border-radius: 999px;
            border: 1px solid rgba(244,122,85,0.22);
            background: rgba(244,122,85,0.08);
            color: #f47a55;
            box-shadow: 0 8px 20px rgba(0,0,0,0.22);
            flex-shrink: 0;
        }

        .supporter-drawer-copy span {
            color: var(--soft);
            font-size: 11.5px;
            line-height: 1.45;
            padding-top: 4px;
        }

        .supporter-drawer-close {
            width: 28px;
            height: 28px;
            border-radius: 7px;
            border: 1px solid rgba(244,122,85,0.18);
            background: rgba(255,255,255,0.02);
            color: #ffb397;
            font-size: 16px;
            line-height: 1;
            display: grid;
            place-items: center;
            flex-shrink: 0;
            transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
        }

        .supporter-drawer-close:hover {
            border-color: rgba(244,122,85,0.32);
            color: #ffd4c3;
            background: rgba(244,122,85,0.08);
        }

        .supporter-modal-live {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 28px;
            margin-bottom: 10px;
            padding: 0 10px;
            border-radius: 999px;
            border: 1px solid rgba(244,122,85,0.22);
            background: rgba(244,122,85,0.08);
            color: #ffd4c3;
        }

        .supporter-modal-live[hidden] {
            display: none;
        }

        .supporter-modal-live-label {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            color: #ffb397;
        }

        .supporter-modal-live strong {
            font-size: 12px;
            font-weight: 800;
            color: #fff0e9;
        }

        .supporter-thanks-modal {
            width: min(440px, 100%);
            position: relative;
            overflow: hidden;
            border-color: rgba(244,122,85,0.24);
            background:
                radial-gradient(circle at top left, rgba(244,122,85,0.18), transparent 34%),
                radial-gradient(circle at 82% 16%, rgba(255,184,125,0.12), transparent 22%),
                linear-gradient(180deg, rgba(34,22,21,0.98), rgba(20,20,26,0.98));
            box-shadow:
                0 32px 80px rgba(0,0,0,0.62),
                0 0 0 1px rgba(244,122,85,0.05) inset;
        }

        .supporter-thanks-glow {
            position: absolute;
            inset: -40% auto auto -18%;
            width: 220px;
            height: 220px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(244,122,85,0.28), rgba(255,166,104,0.12) 38%, transparent 70%);
            pointer-events: none;
            filter: blur(10px);
        }

        .supporter-thanks-headline {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
        }

        .supporter-thanks-brand {
            display: inline-grid;
            place-items: center;
            width: 42px;
            height: 42px;
            flex-shrink: 0;
            border-radius: 14px;
            border: 1px solid rgba(244,122,85,0.32);
            background: linear-gradient(180deg, rgba(244,122,85,0.18), rgba(244,122,85,0.08));
            color: #f47a55;
            box-shadow:
                0 10px 24px rgba(0,0,0,0.28),
                0 0 0 1px rgba(255,255,255,0.02) inset,
                0 0 32px rgba(244,122,85,0.14);
        }

        .supporter-thanks-brand svg {
            width: 17px;
            height: 17px;
            fill: currentColor;
        }

        .supporter-thanks-title-wrap {
            min-width: 0;
            display: grid;
            gap: 5px;
        }

        .supporter-thanks-kicker {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: #ff9f7c;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.8px;
            text-transform: uppercase;
        }

        .supporter-thanks-kicker svg {
            width: 11px;
            height: 11px;
            fill: currentColor;
            opacity: 0.94;
        }

        .supporter-thanks-body {
            display: grid;
            gap: 9px;
            color: #b6bdc9;
            font-size: 13px;
            line-height: 1.72;
        }

        .supporter-thanks-body p {
            margin: 0;
        }

        .supporter-thanks-sign {
            margin-top: 6px;
            color: #ffd4c3;
            font-size: 12px;
            font-weight: 700;
        }

        .supporter-thanks-btn {
            width: 100%;
            margin-top: 18px;
            background: linear-gradient(180deg, #f98f63 0%, #eb6f43 100%);
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,0.16),
                inset 0 -1px 0 rgba(0,0,0,0.18),
                0 10px 28px rgba(241,91,43,0.24);
        }

        .supporter-thanks-btn::before {
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;
        }

        .supporter-thanks-btn:hover {
            background: linear-gradient(180deg, #ff9e76 0%, #f2784d 100%);
            box-shadow:
                0 14px 34px rgba(241,91,43,0.3),
                inset 0 1px 0 rgba(255,255,255,0.12);
        }

        .supporter-thanks-btn:active {
            box-shadow: none;
        }

        .supporter-redeem-row {
            align-items: stretch;
        }

        .supporter-activate-btn {
            min-width: 124px;
            border-color: rgba(244,122,85,0.22);
            color: #ffb397;
        }

        .supporter-activate-btn:hover {
            border-color: rgba(244,122,85,0.38);
            color: #ffd4c3;
        }

        .supporter-status {
            margin-top: 8px;
            min-height: 18px;
            color: var(--muted);
            font-size: 11.5px;
            line-height: 1.4;
        }

        .supporter-status-inline {
            margin-top: 10px;
            padding-top: 2px;
        }

        .supporter-status.is-active { color: #ffc7b0; }
        .supporter-status.is-error { color: rgba(255,120,130,0.95); }
        .supporter-theme-btn.is-locked {
            position: relative;
            color: rgba(255,207,189,0.88);
        }

        @media (max-width: 620px) {
            .preview-top {
                align-items: stretch;
            }

            .hud-preset-grid {
                grid-template-columns: 1fr;
            }

            .hud-preset-button {
                grid-column: auto;
            }
        }

        .preview.is-compact-mode #t-chip-bar {
            display: none;
        }

        .preview.is-mini-mode #t-chip-wl,
        .preview.is-mini-mode #t-chip-rr,
        .preview.is-mini-mode #t-chip-kd,
        .preview.is-mini-mode #t-chip-bar {
            display: none;
        }

        .preview.is-mini-mode #t-col-accent-lbl,
        .preview.is-mini-mode #t-col-win-lbl,
        .preview.is-mini-mode #t-col-loss-lbl {
            display: none;
        }

        .preview.is-mini-mode #kdColorBtn {
            display: none;
        }

        .new-color-fields,
        .slim-color-fields,
        .mini-color-fields {
            display: none;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .preview.is-new-mode .new-color-fields {
            display: contents;
        }

        .preview.is-slim-mode .slim-color-fields {
            display: contents;
        }

        .preview.is-mini-mode .mini-color-fields {
            display: contents;
        }

        .mini-top-color-field {
            display: none;
        }

        .mini-top-color-field[hidden] {
            display: none !important;
        }

        .preview.is-mini-mode.mini-top-enabled .mini-top-color-field:not([hidden]) {
            display: inline-flex;
        }

        .new-only-control {
            display: none;
        }

        .new-only-control[hidden] {
            display: none !important;
        }

        .preview.is-new-mode .new-only-control:not([hidden]),
        .preview.is-slim-mode .new-only-control:not([hidden]),
        .preview.is-mini-mode .new-only-control:not([hidden]) {
            display: inline-flex;
        }

        .mini-only-control {
            display: none;
        }

        .mini-only-control[hidden] {
            display: none !important;
        }

        .preview.is-mini-mode .mini-only-control:not([hidden]) {
            display: inline-flex;
        }

        .preview-live {
            display: flex;
            align-items: center;
            gap: 7px;
        }


        .status-chip {
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11px;
            font-weight: 500;
            padding: 4px 10px;
            border-radius: 6px;
            background: rgba(255,255,255,0.03);
            border: 1px solid var(--border2);
            color: var(--muted);
        }

        .hud-stage {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            background: rgba(0,0,0,0.15);
        }

        /* ─ HUD Screen (preview) ─────────────────────  */

        .hud-screen {
            width: 100%;
            aspect-ratio: 16 / 9;
            position: relative;
            overflow: hidden;
            border-radius: 8px;
            border: 1px solid rgba(255,255,255,0.07);
            background:
                radial-gradient(ellipse 80% 60% at 50% 50%, rgba(20,30,50,0.9) 0%, transparent 75%),
                radial-gradient(ellipse 50% 40% at 15% 85%, rgba(0,190,255,0.05) 0%, transparent 55%),
                linear-gradient(160deg, #0c1422 0%, #060a10 45%, #0e0808 100%);
        }

        /* grid lines like in-game */
        .hud-screen::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image:
                linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
            background-size: 40px 40px;
            pointer-events: none;
        }

        /* bottom vignette to draw eye to HUD */
        .hud-screen::after {
            content: '';
            position: absolute;
            inset: 0;
            background:
                radial-gradient(ellipse 70% 55% at 22% 88%, rgba(0,180,255,0.06) 0%, transparent 60%),
                linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 40%);
            pointer-events: none;
        }


        /* ─ Demo HUD (matches real widget style) ─────  */

        .demo-hud {
            position: absolute;
            bottom: 14px;
            left: 16px;
            z-index: 2;
            font-family: 'Bebas Neue', sans-serif;
            filter: drop-shadow(0 4px 16px rgba(0,0,0,0.95));
            animation: hudEnter 0.7s cubic-bezier(0.22,1,0.36,1) 0.4s both;
        }

        @keyframes hudEnter {
            from { opacity: 0; transform: translateY(-6px); }
            to   { opacity: 1; transform: none; }
        }

        .demo-rank-row {
            display: flex;
            align-items: center;
            gap: 9px;
        }

        .demo-rank-icon {
            width: 46px;
            height: 46px;
            border-radius: 4px;
            display: grid;
            place-items: center;
            background: linear-gradient(135deg, rgba(0,190,255,0.25), rgba(0,100,200,0.12));
            border: 1px solid rgba(0,190,255,0.45);
            box-shadow: 0 0 18px rgba(0,190,255,0.15);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 13px;
            font-weight: 700;
            color: rgba(100,215,255,0.95);
            animation: iconGlow 3s ease-in-out infinite;
        }

        @keyframes iconGlow {
            0%, 100% { box-shadow: 0 0 14px rgba(0,190,255,0.12); }
            50%       { box-shadow: 0 0 24px rgba(0,190,255,0.32); }
        }

        .demo-rank-text { line-height: 1; }

        .demo-rank-name {
            display: block;
            font-size: clamp(22px, 3.8vw, 36px);
            color: #fff;
            letter-spacing: 0.5px;
            white-space: nowrap;
        }

        .demo-rr {
            font-size: clamp(16px, 2.5vw, 24px);
            color: var(--gold);
            margin-left: 4px;
        }

        .demo-bar-wrap {
            margin: 6px 0 5px;
            height: 6px;
            background: rgba(0,0,0,0.6);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 2px;
            overflow: hidden;
            transform: skewX(-8deg);
        }

        .demo-bar-fill {
            height: 100%;
            width: 68%;
            background: linear-gradient(90deg, #c47a00, var(--gold), #ffd060);
            box-shadow: 0 0 12px rgba(240,165,0,0.7);
            transform-origin: left;
            animation: barFill 1.6s cubic-bezier(0.22,1,0.36,1) 0.5s both;
        }

        @keyframes barFill {
            from { width: 0%; opacity: 0.5; }
            to   { width: 68%; opacity: 1; }
        }

        .demo-stats {
            display: flex;
            align-items: center;
            gap: 0;
            font-size: clamp(14px, 2.2vw, 22px);
            color: #fff;
            white-space: nowrap;
        }

        .demo-sep { color: rgba(255,255,255,0.28); margin: 0 6px; }
        .demo-green { color: var(--green); }
        .demo-red   { color: var(--red); }
        .demo-cyan  { color: var(--cyan); }

        /* ─ Crosshair ───────────────────────────────  */

        /* Soft radial glow that lifts the widget out of the dark stage */
        .hud-glow {
            position: absolute;
            inset: 0;
            background:
                radial-gradient(ellipse 38% 28% at 22% 16%, rgba(255,210,140,0.07) 0%, transparent 70%),
                radial-gradient(ellipse 30% 22% at 22% 16%, rgba(0,210,255,0.04)  0%, transparent 75%);
            pointer-events: none;
            z-index: 0;
        }

        /* Skeleton loader — visible until iframe finishes its first load */
        .hud-skeleton {
            position: absolute;
            top: 6%;
            left: 4%;
            width: 36%;
            height: 18%;
            z-index: 2;
            pointer-events: none;
            display: flex;
            flex-direction: column;
            gap: 7px;
            justify-content: center;
            opacity: 1;
            transition: opacity 0.35s ease;
        }
        .hud-skeleton.is-hidden { opacity: 0; }
        .skel-row { display: flex; gap: 8px; align-items: center; }
        .skel-block {
            background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%);
            background-size: 200% 100%;
            border-radius: 4px;
            animation: skelShimmer 1.5s ease-in-out infinite;
        }
        .skel-icon { width: 26%; height: 36px; flex-shrink: 0; }
        .skel-name { flex: 1; height: 22px; }
        .skel-bar  { width: 100%; height: 8px; }
        .skel-stats { width: 80%; height: 16px; }
        @keyframes skelShimmer {
            0%, 100% { background-position: 100% 0; }
            50%      { background-position: 0 0; }
        }

        .hud-crosshair {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 22px;
            height: 22px;
            pointer-events: none;
            z-index: 1;
            opacity: 0.05;
        }

        .hud-crosshair::before,
        .hud-crosshair::after {
            content: '';
            position: absolute;
            background: #fff;
        }

        /* vertical bar */
        .hud-crosshair::before {
            width: 1px;
            height: 100%;
            left: 50%;
            top: 0;
            transform: translateX(-50%);
        }

        /* horizontal bar */
        .hud-crosshair::after {
            height: 1px;
            width: 100%;
            top: 50%;
            left: 0;
            transform: translateY(-50%);
        }

        /* ─ Preview tip — bulb hint completing the right card ─ */
        .preview-tip {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 14px 22px;
            border-top: 1px solid var(--border);
            background: linear-gradient(180deg, rgba(0,212,255,0.018), transparent 80%);
            color: var(--soft);
            font-size: 12.5px;
            line-height: 1.4;
        }
        .preview-tip-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: rgba(251,191,36,0.10);
            color: var(--gold);
            flex-shrink: 0;
        }
        .preview-tip-icon svg {
            width: 12px;
            height: 12px;
            stroke: currentColor;
            stroke-width: 1.8;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .preview-tip strong {
            color: var(--text);
            font-weight: 600;
        }

        /* hidden locale anchors */
        .locale-anchor { display: none !important; }

        /* ─ Page enter animations ───────────────────  */

        @keyframes enterUp {
            from { opacity: 0; transform: translateY(14px); }
            to   { opacity: 1; transform: none; }
        }

        .topbar  { animation: enterUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.05s both; }
        .generator { animation: enterUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.15s both; }
        .preview   { animation: enterUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.25s both; }

        /* ─ Footer ───────────────────────────────────  */

        .app-footer {
            margin-top: auto;
            margin-left: calc(50% - 50vw);
            margin-right: calc(50% - 50vw);
            width: 100vw;
            padding: 8px 0 0;
            border-top: 1px solid rgba(255,255,255,0.055);
        }

        .footer-inner {
            width: min(1160px, calc(100% - 48px));
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .author-chip {
            font-size: 11px;
            color: rgba(146,153,166,0.68);
        }

        .author-chip strong { color: var(--soft); font-weight: 600; }
        .heart { color: var(--red); }

        .footer-links {
            display: flex;
            align-items: center;
            gap: 5px;
            position: relative;
            padding-left: 0;
        }

        .icon-link {
            width: 24px;
            height: 24px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid rgba(255,255,255,0.07);
            border-radius: 6px;
            color: rgba(146,153,166,0.66);
            background: rgba(255,255,255,0.02);
            transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
        }

        .icon-link svg { width: 12px; height: 12px; fill: currentColor; }
        .icon-link:hover { transform: translateY(-1px); }
        .icon-link.twitch { color: #9299a6; }
        .icon-link.twitch:hover   { color: #9146FF; border-color: rgba(145,70,255,0.35); }
        .icon-link.telegram:hover { color: #2AABEE; border-color: rgba(42,171,238,0.35); }
        .icon-link.da:hover       { color: #FF7315; border-color: rgba(255,115,21,0.35); }
        .boosty-link {
          display: inline-flex; align-items: center; gap: 5px;
          height: 24px; padding: 0 8px;
          border-radius: 6px;
          color: #f47a55;
          border: 1px solid rgba(241,91,43,0.35);
          background: rgba(241,91,43,0.08);
          font-family: 'Inter', system-ui, sans-serif;
          font-size: 10.5px; font-weight: 700;
          text-decoration: none;
          transition: all 0.18s;
        }
        .boosty-link:hover { background: rgba(241,91,43,0.15); border-color: rgba(241,91,43,0.6); color: #f99070; transform: translateY(-1px); }
        .boosty-link svg { width: 10px; height: 10px; fill: currentColor; flex-shrink: 0; }
        .tg-updates-link {
          display: inline-flex; align-items: center; gap: 5px;
          height: 24px; padding: 0 8px;
          border: 1px solid rgba(41,182,246,0.22);
          border-radius: 6px;
          color: rgba(100,200,245,0.80);
          background: rgba(41,182,246,0.05);
          font-family: 'Inter', system-ui, sans-serif;
          font-size: 10.5px; font-weight: 700;
          text-decoration: none;
          transition: all 0.18s;
        }
        .tg-updates-link:hover { border-color: rgba(41,182,246,0.5); color: #29b6f6; background: rgba(41,182,246,0.1); transform: translateY(-1px); }
        .tg-updates-link svg {
            width: 11px;
            height: 11px;
            fill: currentColor;
            flex-shrink: 0;
        }
        .boosty-link svg { width: 11px; height: 11px; fill: currentColor; flex-shrink: 0; }

        /* ─ Portal tooltip ─ */
        #tt {
            position: fixed;
            z-index: 99999;
            pointer-events: none;
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11.5px;
            font-weight: 500;
            letter-spacing: 0.2px;
            color: var(--text);
            background: linear-gradient(180deg, #1a1c20 0%, #121419 100%);
            border: 1px solid var(--border2);
            border-radius: 7px;
            padding: 6px 10px;
            box-shadow:
                0 8px 22px rgba(0,0,0,0.55),
                0 0 0 1px rgba(255,255,255,0.02) inset;
            white-space: nowrap;
            opacity: 0;
            transition: opacity 0.16s ease, transform 0.18s ease;
            transform: translateY(4px);
        }
        #tt.tt-visible {
            opacity: 1;
            transform: translateY(0);
        }

        /* ─ Toast ────────────────────────────────────  */

        .toast {
            position: fixed;
            left: 50%;
            bottom: 36px;
            transform: translate(-50%, 24px);
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 12px 18px 12px 14px;
            background: linear-gradient(180deg, #15171b, #0f1014);
            border: 1px solid rgba(0,234,97,0.26);
            border-radius: 12px;
            color: var(--text);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 0.2px;
            box-shadow:
                0 14px 36px rgba(0,0,0,0.55),
                0 0 0 1px rgba(0,234,97,0.10) inset,
                0 0 24px rgba(0,234,97,0.18);
            opacity: 0;
            pointer-events: none;
            z-index: 9999;
            transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22,1,0.36,1);
        }

        .toast.toast-show {
            opacity: 1;
            transform: translate(-50%, 0);
        }

        .toast-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: rgba(0,234,97,0.14);
            color: var(--green);
            flex-shrink: 0;
        }

        .toast-icon svg {
            width: 13px;
            height: 13px;
            stroke: currentColor;
            stroke-width: 2.6;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .toast.toast-error {
            border-color: rgba(255,70,85,0.32);
            box-shadow:
                0 14px 36px rgba(0,0,0,0.55),
                0 0 0 1px rgba(255,70,85,0.10) inset,
                0 0 24px rgba(255,70,85,0.20);
        }

        .toast.toast-error .toast-icon {
            background: rgba(255,70,85,0.14);
            color: var(--red);
        }

        /* ─ Modals ───────────────────────────────────  */

        .modal-overlay {
            position: fixed;
            inset: 0;
            z-index: 50;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(0,0,0,0.75);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.2s, visibility 0.2s;
        }

        .modal-overlay.active { opacity: 1; visibility: visible; }

        .modal {
            width: min(540px, 100%);
            max-height: min(700px, calc(100vh - 48px));
            overflow: auto;
            padding: 28px;
            background: #14141a;
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 16px;
            box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
            animation: modalIn 0.22s cubic-bezier(0.22,1,0.36,1);
        }

        @keyframes modalIn {
            from { opacity: 0; transform: scale(0.96) translateY(8px); }
            to   { opacity: 1; transform: none; }
        }

        .key-help-modal { width: min(440px, 100%); }

        .modal-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 20px;
        }

        .modal h3 {
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 17px;
            font-weight: 700;
            color: var(--text);
            letter-spacing: -0.3px;
        }

        .modal-close {
            width: 28px;
            height: 28px;
            border-radius: 7px;
            border: 1px solid var(--border2);
            color: var(--soft);
            font-size: 16px;
            display: grid;
            place-items: center;
            flex-shrink: 0;
            transition: border-color 0.18s, color 0.18s, background 0.18s;
        }

        .modal-close:hover {
            border-color: rgba(255,255,255,0.2);
            color: var(--text);
            background: rgba(255,255,255,0.05);
        }

        .modal ol:not(.modal-steps), .modal ul:not(.modal-steps) {
            padding-left: 18px;
            color: var(--soft);
            font-size: 14px;
            line-height: 1.75;
        }

        .modal li { margin-bottom: 6px; }
        .modal a { color: var(--red); }
        .modal a:hover { text-decoration: underline; }

        /* Key help modal */
        .key-help-intro { margin-bottom: 16px; }

        .modal-trust {
            display: inline-flex;
            align-items: flex-start;
            gap: 9px;
            padding: 9px 13px;
            border: 1px solid rgba(0,234,97,0.12);
            border-radius: 8px;
            background: rgba(0,234,97,0.04);
            color: rgba(160,175,160,0.85);
            font-size: 12.5px;
            line-height: 1.55;
        }

        .modal-trust svg {
            width: 14px; height: 14px;
            flex-shrink: 0;
            color: var(--green);
            margin-top: 2px;
        }

        /* Key-help inherits .modal-steps / .modal-step from the shared block above */

        .link-inline {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            color: var(--red);
            font-weight: 600;
        }

        .link-inline:hover { color: #ff6b78; text-decoration: underline; }

        .help-brand {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            color: #fff;
            font-weight: 600;
        }

        .discord-brand {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 11px 4px 7px;
            border-radius: 7px;
            background: rgba(88,101,242,0.12);
            border: 1px solid rgba(88,101,242,0.25);
            color: #9aa3fc;
            font-size: 13px;
            transition: background 0.15s, border-color 0.15s;
            vertical-align: middle;
        }

        .discord-brand:hover {
            background: rgba(88,101,242,0.2);
            border-color: rgba(88,101,242,0.4);
        }

        .discord-brand strong { color: #b4baff; font-weight: 600; }

        .help-logo {
            display: inline-grid;
            place-items: center;
            width: 16px; height: 16px;
            color: #7289da;
        }

        .help-logo svg { width: 16px; height: 16px; fill: currentColor; }

        /* ─ Unified modal step style (FAQ + Key help) ─ */
        .modal-steps {
            display: grid;
            gap: 8px;
            counter-reset: mstep;
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .modal-step {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 11px 14px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: rgba(255,255,255,0.018);
            counter-increment: mstep;
            transition: border-color 0.15s, background 0.15s;
        }
        .modal-step:hover {
            border-color: var(--border2);
            background: rgba(255,255,255,0.03);
        }
        .modal-step::before {
            content: counter(mstep);
            flex-shrink: 0;
            width: 24px;
            height: 24px;
            display: grid;
            place-items: center;
            border-radius: 50%;
            border: 1px solid rgba(0,212,255,0.30);
            background: rgba(0,212,255,0.07);
            color: var(--cyan);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11px;
            font-weight: 700;
            box-shadow: 0 0 8px rgba(0,212,255,0.10);
            margin-top: 1px;
        }
        .modal-step-text {
            font-size: 13px;
            line-height: 1.6;
            color: var(--soft);
            padding-top: 2px;
        }
        /* Direct-child strong = inline code-style (e.g. name#tag, API key).
           Nested strong (inside .help-brand etc.) keeps its own styling. */
        .modal-step-text > strong {
            color: var(--text);
            font-family: 'JetBrains Mono', ui-monospace, monospace;
            font-size: 12px;
            padding: 1px 5px;
            background: rgba(0,212,255,0.06);
            border: 1px solid rgba(0,212,255,0.15);
            border-radius: 4px;
        }
        /* ─ Preview controls ────────────────────────  */

        .preview-controls {
            padding: 18px 22px 20px;
            border-top: 1px solid var(--border);
            background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent 60%);
            display: grid;
            gap: 18px;
        }

        .preview-controls-head {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 12px;
        }

        .preview-controls-title {
            font-size: 12px;
            font-weight: 800;
            letter-spacing: 1.2px;
            text-transform: uppercase;
            color: rgba(235,240,248,0.84);
        }


        /* Vertical layout: label above its items */
        .pctrl-group {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .pctrl-items {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        /* backward compat */
        .pctrl-row {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        /* Stronger, anchored category label with accent stripe */
        .pctrl-label {
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 1.4px;
            text-transform: uppercase;
            color: rgba(220, 230, 240, 0.78);
            display: inline-flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }
        .pctrl-label::before {
            content: '';
            display: inline-block;
            width: 3px;
            height: 13px;
            border-radius: 2px;
            background: rgba(255,255,255,0.65);
            box-shadow: 0 0 6px rgba(255,255,255,0.18);
        }
        /* Each group gets its own accent: visibility = cyan, colors = gold */
        .pctrl-group--colors .pctrl-label::before {
            background: var(--gold);
            box-shadow: 0 0 6px rgba(251,191,36,0.35);
        }
        .pctrl-group--colors .pctrl-label {
            color: rgba(255, 220, 170, 0.85);
        }
        .pctrl-group--vis .pctrl-label {
            color: rgba(220, 230, 240, 0.84);
        }

        .pctrl-sep {
            width: 1px;
            height: 18px;
            background: var(--border2);
            flex-shrink: 0;
            margin: 0 4px;
            opacity: 0.7;
        }

        /* ─ Vis chips (redesigned) ───────────────────  */

        /* ─ Preview iframe ──────────────────────────  */

        .preview-frame {
            position: absolute;
            top: 0; left: 0;
            width: 860px; height: 483px;
            border: none;
            background: transparent;
            transform-origin: top left;
            pointer-events: none;
            /* Начальный scale — JS уточнит после layout.
               Без него виджет (bottom: 14px) уходит за пределы и скрывается overflow. */
            transform: scale(0.75);
        }

        /* ─ Rank selector in preview header ─────────  */

        .rank-pick {
            height: 26px;
            padding: 0 20px 0 8px;
            border: 1px solid var(--border2);
            border-radius: 6px;
            background: var(--surface2);
            color: var(--soft);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11px;
            font-weight: 600;
            -webkit-appearance: none;
            appearance: none;
            cursor: pointer;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.25)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 6px center;
            outline: none;
            transition: border-color 0.18s, color 0.18s;
        }

        .rank-pick:hover, .rank-pick:focus { border-color: rgba(255,255,255,0.2); color: var(--text); }
        .rank-pick option { background: #1a1a1d; }

        /* ─ Customization panel ──────────────────────  */

        .custom-panel {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid var(--border);
            display: grid;
            gap: 14px;
        }

        .custom-row {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .custom-label {
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 10px;
            font-weight: 600;
            color: var(--muted);
            letter-spacing: 0.6px;
            text-transform: uppercase;
            min-width: 54px;
            flex-shrink: 0;
        }

        /* Pill checkbox chip */
        .vis-chip {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            height: 30px;
            padding: 0 12px;
            border: 1px solid var(--border2);
            border-radius: 8px;
            background: var(--surface2);
            color: var(--soft);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            user-select: none;
            transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
        }

        .vis-chip:hover {
            border-color: rgba(255,255,255,0.2);
            color: var(--text);
            background: rgba(255,255,255,0.04);
        }

        .vis-chip input { position: absolute; opacity: 0; width: 0; height: 0; }

        /* Dot indicator */
        .cdot {
            width: 6px; height: 6px;
            border-radius: 50%;
            background: rgba(255,255,255,0.12);
            flex-shrink: 0;
            transition: background 0.15s, box-shadow 0.15s;
        }

        .vis-chip:has(input:checked) {
            border-color: rgba(255,255,255,0.32);
            color: rgba(250,251,252,0.98);
            background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.065));
            box-shadow:
                0 0 0 1px rgba(255,255,255,0.055) inset,
                0 1px 0 rgba(255,255,255,0.05) inset;
        }

        /* Hover on already-checked chip */
        .vis-chip:has(input:checked):hover {
            border-color: rgba(255,255,255,0.42);
            background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.085));
            box-shadow:
                0 0 0 1px rgba(255,255,255,0.08) inset,
                0 8px 18px rgba(0,0,0,0.20);
            transform: translateY(-1px);
        }

        .vis-chip:has(input:checked) .cdot {
            background: var(--text);
            box-shadow: 0 0 7px rgba(255,255,255,0.58);
        }

        /* ─ K/D color modal trigger — styled as a chip cousin ─── */
        .kd-modal-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            height: 30px;
            padding: 0 12px;
            border: 1px solid var(--border2);
            border-radius: 8px;
            background: var(--surface2);
            color: var(--soft);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
        }

        .kd-modal-btn:hover {
            border-color: rgba(255,255,255,0.22);
            color: var(--text);
            background: rgba(255,255,255,0.045);
            box-shadow: 0 8px 18px rgba(0,0,0,0.18);
            transform: translateY(-1px);
        }

        .kd-modal-btn:hover svg { color: var(--text); opacity: 1; }

        .kd-modal-btn.active {
            border-color: rgba(255,255,255,0.26);
            color: var(--text);
            background: rgba(255,255,255,0.07);
        }

        .kd-modal-btn svg {
            width: 12px; height: 12px;
            color: var(--soft);
            opacity: 0.75;
            transition: color 0.15s, opacity 0.15s;
        }
        .kd-modal-btn .kd-arrow {
            font-size: 10px;
            opacity: 0.55;
            margin-left: -2px;
        }

        /* Color picker — modern swatch style */
        .color-field {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            height: 30px;
            padding: 0 12px 0 7px;
            border: 1px solid var(--border2);
            border-radius: 8px;
            background: var(--surface2);
            cursor: pointer;
            transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
        }

        .color-field::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: var(--cf-color, transparent);
            opacity: 0.07;
            pointer-events: none;
            transition: opacity 0.15s;
        }

        .color-field:hover {
            border-color: rgba(255,255,255,0.28);
            background: rgba(255,255,255,0.045);
            box-shadow: 0 8px 18px rgba(0,0,0,0.18), 0 0 0 3px rgba(255,255,255,0.018);
            transform: translateY(-1px);
        }

        .color-field:hover::before { opacity: 0.12; }

        /* Hide native picker visuals, keep it clickable */
        .color-field input[type="color"] {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer;
            border: 0;
            padding: 0;
            background: none;
            min-height: 0;
            outline: none;
        }

        /* Custom swatch dot */
        .cf-swatch {
            width: 18px;
            height: 18px;
            border-radius: 5px;
            background: var(--cf-color, #888);
            box-shadow:
                inset 0 0 0 1px rgba(255,255,255,0.2),
                0 1px 2px rgba(0,0,0,0.4),
                0 0 0 0 var(--cf-color);
            flex-shrink: 0;
            transition: box-shadow 0.2s;
        }

        .color-field:hover .cf-swatch {
            box-shadow:
                inset 0 0 0 1px rgba(255,255,255,0.3),
                0 1px 3px rgba(0,0,0,0.5),
                0 0 8px var(--cf-color);
        }

        .color-field span {
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11.5px;
            font-weight: 600;
            color: var(--soft);
            white-space: nowrap;
            position: relative;
        }

        .color-field:hover span { color: var(--text); }

        /* Larger swatch variant for K/D modal rows */
        .color-field--lg { height: 34px; padding: 0 12px 0 8px; gap: 9px; }
        .color-field--lg .cf-swatch { width: 22px; height: 22px; border-radius: 6px; }
        .color-field--lg span { font-size: 11px; font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0.5px; }

        .reset-btn {
            height: 30px;
            padding: 0 12px;
            border: 1px solid rgba(255,70,85,0.18);
            border-radius: 8px;
            color: rgba(255,150,158,0.72);
            background: rgba(255,70,85,0.03);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11.5px;
            font-weight: 600;
            transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
        }

        .reset-btn:hover {
            border-color: rgba(255,70,85,0.42);
            color: rgba(255,200,205,1);
            background: rgba(255,70,85,0.09);
            transform: translateY(-1px);
            box-shadow: 0 0 14px rgba(255,70,85,0.18);
        }

        .adv-btn {
            height: 28px;
            padding: 0 10px;
            border: 1px solid rgba(240,165,0,0.2);
            border-radius: 7px;
            color: rgba(240,165,0,0.7);
            background: rgba(240,165,0,0.04);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11px;
            font-weight: 600;
            transition: border-color 0.15s, color 0.15s, background 0.15s;
        }

        .adv-btn:hover {
            border-color: rgba(240,165,0,0.4);
            color: var(--gold);
            background: rgba(240,165,0,0.08);
        }

        /* Advanced colors modal — compact */
        .adv-color-body { display: grid; gap: 6px; }

        .adv-color-item {
            display: grid;
            grid-template-columns: 1fr auto;
            align-items: center;
            gap: 12px;
            padding: 9px 12px;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: rgba(255,255,255,0.018);
            transition: border-color 0.15s, background 0.15s;
        }

        .adv-color-item:hover {
            border-color: var(--border2);
            background: rgba(255,255,255,0.03);
        }

        .adv-color-info {
            display: flex;
            align-items: baseline;
            gap: 8px;
            flex-wrap: wrap;
            min-width: 0;
        }

        .adv-color-info strong {
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 12.5px;
            font-weight: 700;
            line-height: 1.2;
        }

        .adv-color-info p {
            font-size: 11px;
            color: var(--muted);
            margin: 0;
            line-height: 1.5;
        }

        .adv-color-item .color-field--lg {
            flex-shrink: 0;
        }

        .adv-color-item .color-field--lg span {
            font-size: 10.5px;
            font-family: monospace;
            letter-spacing: 0.3px;
            color: var(--muted);
        }


        /* ─ Basic / Advanced color accordion ────────  */

        .color-adv-toggle {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            height: 30px;
            padding: 0 10px;
            border: 1px solid var(--border2);
            border-radius: 8px;
            background: var(--surface2);
            color: var(--soft);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 11.5px;
            font-weight: 600;
            transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
        }

        .color-adv-toggle:hover {
            border-color: rgba(255,255,255,0.28);
            color: var(--text);
            background: rgba(255,255,255,0.045);
            transform: translateY(-1px);
        }

        .color-adv-toggle.open {
            border-color: rgba(240,165,0,0.38);
            color: var(--gold);
            background: rgba(240,165,0,0.06);
        }

        .color-adv-toggle.open:hover {
            border-color: rgba(240,165,0,0.6);
        }

        /* Show toggle only for modes that have extra color fields */
        #colorAdvToggle {
            display: inline-flex;
        }

        .color-adv-chevron {
            width: 12px;
            height: 12px;
            flex-shrink: 0;
            transition: transform 0.22s ease;
        }

        .color-adv-toggle.open .color-adv-chevron {
            transform: rotate(180deg);
        }

        /* Grid-based smooth collapse */
        .color-adv-panel {
            display: grid;
            grid-template-rows: 0fr;
            transition: grid-template-rows 0.22s ease;
        }

        .color-adv-panel.open {
            grid-template-rows: 1fr;
        }

        .color-adv-panel-inner {
            overflow: hidden;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
            min-height: 0;
            padding-top: 0;
            transition: padding-top 0.22s ease;
        }

        .color-adv-panel.open .color-adv-panel-inner {
            padding-top: 6px;
        }
        /* ─ Responsive ───────────────────────────────  */

        @media (max-width: 900px) {
            .nav-inner {
                height: auto;
                min-height: 56px;
                padding-top: 10px;
                padding-bottom: 10px;
                flex-wrap: wrap;
            }
            .nav-menu {
                order: 3;
                width: 100%;
                justify-content: flex-start;
                overflow-x: auto;
                scrollbar-width: none;
            }
            .nav-menu::-webkit-scrollbar { display: none; }
            .workspace { grid-template-columns: 1fr; }
            .preview { min-height: auto; }
        }

        @media (min-width: 861px) and (max-height: 980px) {
            .app {
                padding: 12px 0 8px;
                gap: 10px;
            }
        }

        @media (max-height: 860px) and (min-width: 861px) {
            .app {
                padding: 12px 0 8px;
                gap: 10px;
            }
        }

        @media (max-height: 760px) and (min-width: 861px) {
            .app {
                padding: 10px 0 6px;
                gap: 8px;
            }
        }

        @media (max-width: 560px) {
            .nav-inner { padding-left: 16px; padding-right: 16px; }
            .nav-link, .nav-lang { height: 32px; padding: 0 10px; font-size: 11px; }
            .nav-link svg, .nav-lang svg { width: 13px; height: 13px; }
            .nav-lang { height: 30px; min-width: 56px; padding: 0 11px; }
            .nav-lang svg { width: 12px; height: 12px; }
            .nav-boosty { height: 30px; }
            .app { width: calc(100% - 24px); padding: 24px 0 20px; }
            .topbar { align-items: flex-start; flex-direction: column; }
            .generator { padding: 20px; }
            .quick-steps { display: none; }
            .field-row { grid-template-columns: 1fr; }
        }

        /* ── Page exit transition ── */
        .app { transition: opacity 0.2s ease, transform 0.2s ease; }
        .app.is-leaving { opacity: 0; transform: translateY(-6px); pointer-events: none; }

        /* ── Empty state для превью ── */
        .preview-empty {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            color: var(--muted);
            font-size: 12.5px;
            font-weight: 500;
            text-align: center;
            line-height: 1.6;
            z-index: 3;
            pointer-events: none;
            transition: opacity 0.25s ease;
        }
        .preview-empty svg {
            width: 32px; height: 32px;
            stroke: currentColor; fill: none;
            stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
            opacity: 0.35;
        }
        .preview-empty.is-hidden { opacity: 0; visibility: hidden; }

        /* ── Form panel — red accent ── */
        .card.generator {
            border-color: rgba(255,70,85,0.22);
            box-shadow: 0 0 32px rgba(255,70,85,0.06), inset 0 0 0 1px rgba(255,255,255,0.015);
        }

        /* ── Preview panel — cyan accent ── */
        .card.preview {
            border-color: rgba(0,212,255,0.20);
            box-shadow: 0 0 32px rgba(0,212,255,0.06), inset 0 0 0 1px rgba(255,255,255,0.015);
        }

        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
            }
        }
        .copy-nudge {
          display: none; align-items: center; gap: 9px;
          margin-top: 12px; padding: 10px 14px; border-radius: 8px;
          background: rgba(241,91,43,0.08); border: 1px solid rgba(241,91,43,0.22);
          font-size: 12px; color: rgba(255,255,255,0.55); animation: fadeUp 0.35s ease;
        }
        .copy-nudge.visible { display: flex; }
        .copy-nudge svg { width: 13px; height: 13px; fill: #f47a55; flex-shrink: 0; }
        .copy-nudge a { color: #f47a55; text-decoration: none; font-weight: 600; }
        .copy-nudge a:hover { text-decoration: underline; }
