/* ==========================================================================
   ГСЧ — дизайн-система
   1. Токены и сброс          6. Формы и контролы
   2. Типографика             7. Инструменты: результат, статистика
   3. Раскладка               8. Виджеты (монета, кости, колесо, карты…)
   4. Шапка и меню            9. Подвал, реклама, поиск, тосты
   5. Кнопки и бейджи        10. Анимации и адаптив
   ========================================================================== */

/* 1. Токены ---------------------------------------------------------------- */

:root {
    --bg-rgb: 6, 7, 14;
    --bg: #06070e;
    --bg-2: #0a0c17;
    --card-rgb: 16, 18, 32;
    --card: rgba(16, 18, 32, 0.72);
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-3: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.08);
    --border-2: rgba(255, 255, 255, 0.14);
    --text: #f2f3fa;
    --dim: #a9aec6;
    --muted: #767d9b;

    --violet: #8b5cf6;
    --violet-2: #a78bfa;
    --cyan: #22d3ee;
    --pink: #f472b6;
    --lime: #a3e635;
    --amber: #fbbf24;
    --red: #f87171;
    --green: #34d399;
    --sky: #38bdf8;
    --accent: var(--violet);

    --grad-brand: linear-gradient(120deg, #a78bfa 0%, #22d3ee 52%, #a3e635 100%);
    --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #6366f1 46%, #22d3ee 100%);
    --grad-text: linear-gradient(100deg, #c4b5fd 0%, #67e8f9 45%, #bef264 100%);

    --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Segoe UI Variable Display", "Inter", "SF Pro Display", -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "Cascadia Code", ui-monospace, "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

    --shell: 1200px;
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius: 18px;
    --radius-sm: 13px;
    --radius-pill: 999px;

    --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
    --shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 0 1px rgba(139, 92, 246, 0.24), 0 26px 70px -32px rgba(139, 92, 246, 0.65);

    --ease: cubic-bezier(0.22, 0.85, 0.28, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --header-h: 70px;
}

[data-theme="light"] {
    --bg-rgb: 236, 238, 247;
    --bg: #eceef7;
    --bg-2: #e3e6f2;
    --card-rgb: 255, 255, 255;
    --card: rgba(255, 255, 255, 0.94);
    --surface: rgba(255, 255, 255, 0.55);
    --surface-2: rgba(17, 20, 45, 0.05);
    --surface-3: rgba(17, 20, 45, 0.09);
    --border: rgba(16, 20, 45, 0.10);
    --border-2: rgba(16, 20, 45, 0.18);
    --text: #11142b;
    --dim: #4e5474;
    --muted: #7b81a0;

    --violet: #7048e8;
    --violet-2: #6d3ff2;
    --cyan: #0e9db5;
    --pink: #db2777;
    --lime: #65a30d;
    --amber: #d97706;
    --red: #dc2626;
    --green: #059669;
    --sky: #0284c7;

    --grad-brand: linear-gradient(120deg, #7c3aed 0%, #0891b2 52%, #65a30d 100%);
    --grad-primary: linear-gradient(135deg, #7048e8 0%, #4338ca 46%, #0891b2 100%);
    --grad-text: linear-gradient(100deg, #6d28d9 0%, #0e7490 48%, #4d7c0f 100%);

    --shadow-lg: 0 40px 90px -50px rgba(30, 27, 75, 0.4);
    --shadow: 0 18px 44px -26px rgba(30, 27, 75, 0.32);
    --shadow-glow: 0 0 0 1px rgba(112, 72, 232, 0.2), 0 26px 60px -34px rgba(112, 72, 232, 0.4);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(46% 38% at 12% 4%, rgba(139, 92, 246, 0.20), transparent 62%),
        radial-gradient(40% 34% at 88% 10%, rgba(34, 211, 238, 0.14), transparent 64%),
        radial-gradient(48% 42% at 62% 96%, rgba(163, 230, 53, 0.09), transparent 66%),
        var(--bg);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 68px 68px;
    mask-image: radial-gradient(70% 60% at 50% 0%, #000 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000 20%, transparent 100%);
}

[data-theme="light"] body::before {
    background:
        radial-gradient(46% 38% at 10% 2%, rgba(124, 58, 237, 0.14), transparent 60%),
        radial-gradient(40% 34% at 92% 8%, rgba(8, 145, 178, 0.10), transparent 62%),
        radial-gradient(48% 42% at 60% 98%, rgba(101, 163, 13, 0.08), transparent 64%),
        var(--bg);
}

[data-theme="light"] body::after {
    background-image:
        linear-gradient(to right, rgba(16, 20, 45, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(16, 20, 45, 0.045) 1px, transparent 1px);
}

img,
svg { max-width: 100%; }

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button { cursor: pointer; }

::selection {
    background: rgba(139, 92, 246, 0.35);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--violet-2);
    outline-offset: 3px;
    border-radius: 6px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: -0.18em;
    flex: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translate(-50%, -160%);
    z-index: 200;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
    transition: transform 0.2s var(--ease);
}

.skip-link:focus { transform: translate(-50%, 0); }

/* 2. Типографика ---------------------------------------------------------- */

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.025em;
    margin: 0;
}

p { margin: 0; }

.mono {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.tnum { font-variant-numeric: tabular-nums; }

.grad-text {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent, var(--violet-2));
}

.eyebrow__icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--accent, var(--violet)) 16%, transparent);
    color: var(--accent, var(--violet-2));
}

[data-theme="dark"] .eyebrow__icon { background: rgba(255, 255, 255, 0.06); }

.eyebrow__icon .icon { width: 15px; height: 15px; }

/* 3. Раскладка ------------------------------------------------------------ */

.shell {
    width: 100%;
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    position: relative;
    padding: clamp(48px, 6vw, 88px) 0;
}

.section--tight { padding: clamp(36px, 5vw, 64px) 0; }

.section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 34px;
}

.section__title {
    font-size: clamp(26px, 3.4vw, 40px);
    margin-top: 10px;
}

.section__lead {
    margin-top: 12px;
    max-width: 56ch;
    color: var(--dim);
    font-size: 15.5px;
}

.section__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--dim);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s var(--ease), gap 0.2s var(--ease);
}

.section__link:hover { color: var(--text); gap: 12px; }

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

.row--between { justify-content: space-between; }

.stack {
    display: grid;
    gap: 14px;
}

.grow { flex: 1 1 auto; }

.divider {
    height: 1px;
    background: var(--border);
    border: 0;
    margin: 0;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 36px; }

/* 4. Шапка ---------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid transparent;
    background: rgba(var(--bg-rgb), 0.72);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
    transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.topbar.is-scrolled {
    border-bottom-color: var(--border);
    box-shadow: 0 18px 40px -30px rgba(0, 0, 0, 0.9);
}

.topbar__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex: none;
}

.brand__mark {
    width: 38px;
    height: 38px;
    display: block;
    filter: drop-shadow(0 6px 18px rgba(139, 92, 246, 0.35));
    transition: transform 0.5s var(--ease);
}

.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.04); }

.brand__mark svg { display: block; width: 100%; height: 100%; }

.brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand__text strong {
    font-size: 19px;
    letter-spacing: 0.02em;
}

.brand__text small {
    font-size: 10.5px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 3px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 14px;
}

.nav__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 13px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--dim);
    font-size: 14.5px;
    font-weight: 550;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav__link:hover,
.nav__link.is-active {
    color: var(--text);
    background: var(--surface-2);
}

.nav__caret {
    width: 15px;
    height: 15px;
    transition: transform 0.25s var(--ease);
}

.nav__link[aria-expanded="true"] .nav__caret { transform: rotate(180deg); }

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Переключатель языка */

.lang { position: relative; }

.lang__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 11px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--dim);
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.lang__toggle::-webkit-details-marker { display: none; }
.lang__toggle .icon { width: 16px; height: 16px; }

.lang__toggle:hover,
.lang[open] .lang__toggle {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border-2);
}

.lang__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 80;
    min-width: 186px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--border-2);
    background: rgba(var(--bg-rgb), 0.98);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
    animation: megaIn 0.16s var(--ease-out);
}

.lang__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 13px;
    color: var(--dim);
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.lang__link:hover,
.lang__link.is-active { background: var(--surface-2); color: var(--text); }

.lang__link small { font-size: 10.5px; color: var(--muted); }

.mobile-menu__lang {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.lang--block { width: 100%; }
.lang--block .lang__toggle { width: 100%; height: 44px; justify-content: center; }
.lang--block .lang__menu { left: 0; right: auto; width: 100%; }

.i18n-note {
    display: flex;
    gap: 8px;
    max-width: 760px;
    margin-top: 16px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px dashed var(--border-2);
    background: var(--surface);
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--muted);
}

.i18n-note .icon { width: 15px; height: 15px; flex: none; margin-top: 1px; }

.icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--dim);
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.icon-btn:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border-2);
    transform: translateY(-1px);
}

.icon-btn__kbd {
    position: absolute;
    right: -3px;
    bottom: -3px;
    padding: 1px 4px;
    border-radius: 5px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    font: 600 9px/1.3 var(--mono);
    color: var(--muted);
}

.theme-toggle__icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}

[data-theme="dark"] .theme-toggle__icon--sun { opacity: 0; transform: rotate(-70deg) scale(0.5); }
[data-theme="dark"] .theme-toggle__icon--moon { opacity: 1; transform: none; }
[data-theme="light"] .theme-toggle__icon--sun { opacity: 1; transform: none; }
[data-theme="light"] .theme-toggle__icon--moon { opacity: 0; transform: rotate(70deg) scale(0.5); }

.topbar__burger { display: none; }

/* Мега-меню */

.mega {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    border-bottom: 1px solid var(--border);
    background: rgba(var(--bg-rgb), 0.96);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow-lg);
    animation: megaIn 0.22s var(--ease-out);
}

.mega__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 30px;
    padding-top: 28px;
    padding-bottom: 30px;
}

.mega__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 26px;
}

.mega__title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--muted);
}

.mega__title .icon { width: 14px; height: 14px; }

.mega__title--gap { margin-top: 22px; }

.mega__link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 9px;
    margin-left: -9px;
    border-radius: 12px;
    transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.mega__link:hover {
    background: var(--surface-2);
    transform: translateX(2px);
}

.mega__link strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.mega__link small {
    display: block;
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 1px;
}

.mega__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent, var(--violet)) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent, var(--violet)) 24%, transparent);
    color: var(--accent, var(--violet-2));
}

[data-theme="dark"] .mega__icon {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.07);
    color: var(--accent, var(--violet-2));
}

.mega__icon .icon { width: 18px; height: 18px; }

.mega__promo {
    position: relative;
    overflow: hidden;
    align-self: start;
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        radial-gradient(120% 100% at 100% 0%, rgba(163, 230, 53, 0.14), transparent 60%),
        radial-gradient(120% 100% at 0% 100%, rgba(139, 92, 246, 0.18), transparent 60%),
        var(--surface);
}

.mega__promo-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    right: -50px;
    top: -60px;
    border-radius: 50%;
    background: rgba(163, 230, 53, 0.3);
    filter: blur(50px);
    pointer-events: none;
}

.mega__promo-title {
    position: relative;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.mega__promo-text {
    position: relative;
    margin: 8px 0 16px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--dim);
}

/* Мобильное меню */

.mobile-menu {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 55;
    overflow-y: auto;
    background: rgba(var(--bg-rgb), 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    animation: fadeIn 0.2s var(--ease);
}

.mobile-menu__inner {
    display: grid;
    gap: 4px;
    padding: 20px 22px 60px;
}

.mobile-menu__title {
    margin: 18px 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.mobile-menu__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 8px;
    margin: 0 -8px;
    border-radius: 12px;
    font-size: 15px;
}

.mobile-menu__link small {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.mobile-menu__link:hover { background: var(--surface-2); }

/* 5. Кнопки и бейджи ------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
        border-color 0.18s var(--ease), box-shadow 0.25s var(--ease), color 0.18s var(--ease);
}

.btn .icon { width: 18px; height: 18px; }

.btn:hover { transform: translateY(-1px); }

.btn:active { transform: translateY(0) scale(0.985); }

.btn[disabled],
.btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn--primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 12px 34px -14px rgba(99, 102, 241, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--primary:hover {
    box-shadow: 0 18px 44px -16px rgba(99, 102, 241, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn--soft {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

.btn--soft:hover { background: var(--surface-3); border-color: var(--border-2); }

.btn--ghost {
    color: var(--dim);
}

.btn--ghost:hover { color: var(--text); background: var(--surface-2); }

.btn--outline {
    border-color: var(--border-2);
    color: var(--text);
}

.btn--outline:hover { background: var(--surface-2); }

.btn--danger { color: var(--red); }
.btn--danger:hover { background: rgba(248, 113, 113, 0.12); }

.btn--sm { padding: 9px 15px; font-size: 13px; }
.btn--sm .icon { width: 16px; height: 16px; }

.btn--lg { padding: 16px 28px; font-size: 16px; }
.btn--block { width: 100%; }

.btn--icon { padding: 10px; width: 40px; height: 40px; border-radius: 12px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--dim);
    white-space: nowrap;
}

.badge .icon { width: 14px; height: 14px; }

.badge--ok {
    color: var(--green);
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.24);
}

.badge--warn {
    color: var(--amber);
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.24);
}

.badge--accent {
    color: var(--violet-2);
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.26);
}

.badge--glass {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .badge--glass { background: rgba(17, 20, 45, 0.04); }

kbd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font: 600 11px/1.4 var(--mono);
    color: var(--dim);
}

/* 6. Формы ---------------------------------------------------------------- */

.field { display: grid; gap: 8px; }

.field__label {
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--dim);
}

.field__hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.input,
.textarea,
.select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

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

.input:hover,
.textarea:hover,
.select:hover { border-color: var(--border-2); }

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.55);
    background: var(--surface-2);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}

.textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.55;
    font-family: var(--font);
}

.textarea--mono { font-family: var(--mono); font-size: 13.5px; }

.select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767d9b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.input-wrap { position: relative; display: flex; align-items: center; }

.input-wrap .input { padding-right: 52px; }

.input-wrap .suffix {
    position: absolute;
    right: 13px;
    font-size: 12.5px;
    color: var(--muted);
    pointer-events: none;
}

/* Сегментированный переключатель */

.seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.seg__btn {
    padding: 8px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--dim);
    font-size: 13.5px;
    font-weight: 600;
    transition: color 0.18s var(--ease), background-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

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

.seg__btn.is-active {
    background: var(--surface-3);
    color: var(--text);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

[data-theme="light"] .seg__btn.is-active {
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 20, 45, 0.12);
}

/* Переключатель */

.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--dim);
    user-select: none;
}

.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch__track {
    position: relative;
    width: 42px;
    height: 24px;
    flex: none;
    border-radius: 999px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    transition: background-color 0.22s var(--ease), border-color 0.22s var(--ease);
}

.switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--dim);
    transition: transform 0.24s var(--ease), background-color 0.22s var(--ease);
}

.switch input:checked + .switch__track {
    background: rgba(139, 92, 246, 0.35);
    border-color: rgba(139, 92, 246, 0.55);
}

.switch input:checked + .switch__track::after {
    transform: translateX(18px);
    background: #fff;
}

.switch input:focus-visible + .switch__track {
    outline: 2px solid var(--violet-2);
    outline-offset: 3px;
}

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

.checkbox input {
    width: 17px;
    height: 17px;
    accent-color: var(--violet);
    cursor: pointer;
}

/* Ползунок */

.range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--violet), var(--cyan));
    outline: none;
    cursor: pointer;
}

.range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--violet);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    cursor: grab;
}

.range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--violet);
    cursor: grab;
}

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

.range-row .range { flex: 1 1 auto; min-width: 0; }

.range-row output {
    min-width: 62px;
    padding: 3px 8px;
    border-radius: 8px;
    background: var(--surface-2);
    font: 600 13px/1.5 var(--mono);
    text-align: center;
    white-space: nowrap;
}

/* Чипсы */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--dim);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.18s var(--ease);
}

.chip:hover { color: var(--text); border-color: var(--border-2); transform: translateY(-1px); }

.chip.is-active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

/* 7. Инструменты: каркас -------------------------------------------------- */

.tool-hero {
    padding: 22px 0 30px;
}

.tool-hero__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-top: 24px;
}

.tool-hero__main { max-width: 720px; }

.tool-hero__title {
    margin-top: 12px;
    font-size: clamp(30px, 4.6vw, 52px);
}

.tool-hero__lead {
    margin-top: 14px;
    max-width: 62ch;
    color: var(--dim);
    font-size: 16px;
}

.tool-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 6px;
}

.breadcrumbs { font-size: 12.5px; color: var(--muted); }

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; }

.breadcrumbs li + li::before {
    content: "›";
    color: var(--muted);
    opacity: 0.6;
}

.breadcrumbs a { transition: color 0.16s var(--ease); }
.breadcrumbs a:hover { color: var(--text); }

.tool-layout {
    display: grid;
    grid-template-columns: 372px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    padding-bottom: clamp(48px, 6vw, 80px);
}

.tool-layout--wide { grid-template-columns: minmax(0, 1fr); }

.tool-layout__aside {
    display: grid;
    gap: 16px;
    position: sticky;
    top: calc(var(--header-h) + 16px);
}

.tool-layout__main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.panel {
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.panel__title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.panel__title .icon { width: 17px; height: 17px; color: var(--muted); }

.panel__hint { font-size: 12px; color: var(--muted); }

.panel__body { padding: 20px; display: grid; gap: 16px; }

.panel__foot {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.012);
}

.note {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--dim);
}

.note .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }

.note--info {
    border-color: rgba(56, 189, 248, 0.24);
    background: rgba(56, 189, 248, 0.07);
}

.note--info .icon { color: var(--sky); }

.note--warn {
    border-color: rgba(251, 191, 36, 0.26);
    background: rgba(251, 191, 36, 0.07);
}

.note--warn .icon { color: var(--amber); }

/* Результат */

.result {
    position: relative;
    display: grid;
    place-items: center;
    gap: 12px;
    padding: clamp(26px, 4vw, 44px) 20px;
    min-height: 210px;
    text-align: center;
    background:
        radial-gradient(90% 120% at 50% 0%, rgba(139, 92, 246, 0.13), transparent 65%),
        transparent;
}

.result__value {
    font-family: var(--mono);
    font-size: clamp(38px, 8vw, 84px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    word-break: break-word;
}

.result__value.is-small { font-size: clamp(24px, 4vw, 40px); }

.result__value:empty { display: none; }

.result__note { font-size: 13.5px; color: var(--muted); }

.result__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.num {
    min-width: 58px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-family: var(--mono);
    font-size: clamp(18px, 2.4vw, 26px);
    font-weight: 700;
    letter-spacing: -0.02em;
    animation: popIn 0.4s var(--ease-out) backwards;
}

.num:nth-child(2n) { animation-delay: 0.04s; }
.num:nth-child(3n) { animation-delay: 0.08s; }
.num:nth-child(4n) { animation-delay: 0.12s; }

/* Статистика */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
    gap: 10px;
}

.stat {
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
}

.stat__value {
    display: block;
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.stat__label {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    letter-spacing: 0.03em;
    color: var(--muted);
}

.meter {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}

.meter__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--violet), var(--cyan));
    transition: width 0.5s var(--ease);
}

.meter--split { display: flex; }
.meter--split .meter__fill { border-radius: 0; }
.meter--split .meter__fill:first-child { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.meter--split .meter__fill:last-child { background: linear-gradient(90deg, #22d3ee, #67e8f9); }

/* Списки и история */

.list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.list__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    transition: background-color 0.15s var(--ease);
}

.list__row:hover { background: var(--surface); }

.list__row:nth-child(odd) { background: rgba(255, 255, 255, 0.012); }

.list__row .mono { color: var(--muted); font-size: 12px; }

.history {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.history__item {
    padding: 5px 9px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font: 600 12px/1.4 var(--mono);
    color: var(--dim);
}

.empty {
    padding: 26px 18px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    border: 1px dashed var(--border-2);
    border-radius: var(--radius-sm);
}

/* Загрузка */

.spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

.loading {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--dim);
    font-size: 13.5px;
}

.is-hidden { display: none !important; }

/* 8. Виджеты -------------------------------------------------------------- */

/* Монета */

.coin-stage {
    display: grid;
    place-items: center;
    gap: 18px;
    padding: 24px 0 10px;
}

.coin {
    width: clamp(132px, 20vw, 176px);
    height: clamp(132px, 20vw, 176px);
    perspective: 900px;
    cursor: pointer;
}

.coin__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s var(--ease-out);
    will-change: transform;
}

.coin__face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background:
        radial-gradient(circle at 32% 26%, #fde68a 0%, #fbbf24 34%, #d97706 68%, #92400e 100%);
    box-shadow:
        inset 0 6px 14px rgba(255, 255, 255, 0.55),
        inset 0 -8px 18px rgba(120, 53, 15, 0.55),
        0 18px 40px -18px rgba(251, 191, 36, 0.7);
    border: 3px solid #b45309;
}

.coin__face::after {
    content: "";
    position: absolute;
    inset: 13px;
    border-radius: 50%;
    border: 2px dashed rgba(120, 53, 15, 0.35);
}

.coin__face--tails { transform: rotateY(180deg); }

.coin__label {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 62%;
    height: 62%;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #fef3c7, #f59e0b 70%);
    color: #7c2d12;
    font-family: var(--font-display);
    font-size: clamp(38px, 6vw, 54px);
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 3px 8px rgba(255, 255, 255, 0.5), inset 0 -4px 10px rgba(146, 64, 14, 0.4);
}

.coin--flip .coin__inner { animation: coinFlip 1.2s var(--ease) both; }

.coin.is-heads .coin__inner { transform: rotateY(0deg); }
.coin.is-tails .coin__inner { transform: rotateY(180deg); }

.coin__status {
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.coin-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.coin-mini {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #fde68a, #d97706);
    color: #7c2d12;
    font: 700 12px/1 var(--font-display);
    box-shadow: inset 0 -2px 4px rgba(120, 53, 15, 0.45);
    animation: popIn 0.3s var(--ease-out) backwards;
}

.coin-mini--t { background: radial-gradient(circle at 34% 30%, #e2e8f0, #94a3b8); color: #1e293b; }

/* Кости */

.dice-stage {
    display: grid;
    place-items: center;
    padding: clamp(22px, 4vw, 38px) 16px;
    min-height: 200px;
}

.dice-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.die {
    position: relative;
    width: clamp(62px, 8vw, 84px);
    height: clamp(62px, 8vw, 84px);
    border-radius: 18px;
    background: linear-gradient(150deg, #ffffff 0%, #eef0f8 58%, #d7dbea 100%);
    box-shadow:
        inset 0 -6px 12px rgba(90, 100, 140, 0.16),
        inset 0 3px 4px rgba(255, 255, 255, 0.9),
        0 16px 30px -14px rgba(0, 0, 0, 0.65);
    color: #171a2e;
    display: grid;
    place-items: center;
    transition: transform 0.3s var(--ease);
}

[data-theme="light"] .die {
    box-shadow:
        inset 0 -6px 12px rgba(90, 100, 140, 0.16),
        inset 0 3px 4px rgba(255, 255, 255, 0.9),
        0 14px 26px -16px rgba(30, 27, 75, 0.5);
}

.die--rolling { animation: dieRoll 0.5s var(--ease) infinite; }

.die__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 68%;
    height: 68%;
    gap: 6%;
}

.pip {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    transition: background-color 0.12s linear;
}

.pip.is-on {
    background: #171a2e;
    box-shadow: inset 0 -1px 2px rgba(255, 255, 255, 0.35);
}

.die--num {
    background: linear-gradient(150deg, #8b5cf6, #4338ca);
    color: #fff;
    font-family: var(--mono);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    box-shadow:
        inset 0 -6px 14px rgba(0, 0, 0, 0.28),
        inset 0 3px 6px rgba(255, 255, 255, 0.28),
        0 16px 34px -14px rgba(99, 102, 241, 0.8);
}

.die__total {
    display: block;
    margin-top: 4px;
    text-align: center;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

/* Колесо */

.wheel-stage {
    display: grid;
    gap: 18px;
    place-items: center;
    padding: 20px 0;
}

.wheel-wrap {
    position: relative;
    width: min(100%, 440px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.wheel__canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow:
        0 0 0 8px rgba(255, 255, 255, 0.05),
        0 0 0 9px rgba(255, 255, 255, 0.09),
        0 30px 70px -30px rgba(0, 0, 0, 0.9);
    display: block;
}

.wheel__pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-top: 24px solid var(--amber);
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
    z-index: 2;
}

.wheel__hub {
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 35% 30%, #fff, #cbd5e1);
    color: #0b1020;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
    border: 0;
    z-index: 3;
    cursor: pointer;
    transition: transform 0.2s var(--ease);
}

.wheel__hub:hover { transform: scale(1.06); }

.wheel-result {
    min-height: 44px;
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.wheel-result strong {
    color: var(--violet-2);
    font-family: var(--font-display);
    font-size: 26px;
}

/* Лотерейные шары */

.balls {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.ball {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 26%, #ffffff, #e2e8f0 55%, #b6c0d4 100%);
    color: #141a2e;
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 700;
    box-shadow:
        inset 0 -4px 8px rgba(90, 100, 140, 0.28),
        inset 0 2px 3px rgba(255, 255, 255, 0.9),
        0 10px 20px -10px rgba(0, 0, 0, 0.7);
    animation: popIn 0.4s var(--ease-out) backwards;
}

.ball--red {
    background: radial-gradient(circle at 34% 26%, #fecaca, #ef4444 58%, #991b1b 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.ball--blue {
    background: radial-gradient(circle at 34% 26%, #bae6fd, #38bdf8 58%, #075985 100%);
    color: #fff;
}

.ball--green {
    background: radial-gradient(circle at 34% 26%, #bbf7d0, #34d399 58%, #065f46 100%);
    color: #04231b;
}

.ball--sm { width: 34px; height: 34px; font-size: 12.5px; }

.ball--drawn { opacity: 0.35; }

.ball--win {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.6), 0 10px 24px -10px rgba(251, 191, 36, 0.8);
}

/* Рулетка */

.roulette-grid {
    display: grid;
    grid-template-columns: repeat(13, minmax(0, 1fr));
    gap: 5px;
}

.roulette-cell {
    aspect-ratio: 1.5;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--dim);
    transition: all 0.2s var(--ease);
}

.roulette-cell--red { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.28); color: #fca5a5; }
.roulette-cell--black { background: rgba(15, 23, 42, 0.6); border-color: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
.roulette-cell--green { background: rgba(52, 211, 153, 0.16); border-color: rgba(52, 211, 153, 0.3); color: #6ee7b7; }

.roulette-cell.is-last {
    transform: scale(1.14);
    box-shadow: 0 0 0 2px var(--amber);
    z-index: 2;
}

/* Карты */

.cards-stage { display: grid; gap: 20px; }

.board {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    min-height: 96px;
    align-items: center;
}

.pcard {
    position: relative;
    width: 62px;
    height: 88px;
    flex: none;
    border-radius: 9px;
    background: linear-gradient(160deg, #ffffff, #f1f3fa);
    border: 1px solid rgba(15, 23, 42, 0.14);
    color: #101526;
    box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.8);
    animation: cardIn 0.4s var(--ease-out) backwards;
    font-family: var(--font-display);
}

.pcard--red { color: #dc2626; }

.pcard--back {
    background:
        repeating-linear-gradient(45deg, #312e81 0 6px, #4338ca 6px 12px);
    border-color: rgba(255, 255, 255, 0.2);
    color: transparent;
}

.pcard--empty {
    background: transparent;
    border: 1px dashed var(--border-2);
    box-shadow: none;
    color: var(--muted);
    display: grid;
    place-items: center;
    font-size: 20px;
}

.pcard__corner {
    position: absolute;
    top: 4px;
    left: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    font-size: 12px;
    font-weight: 700;
}

.pcard__corner .suit { font-size: 11px; margin-top: 1px; }

.pcard__center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 26px;
}

.pcard__big {
    position: absolute;
    right: 5px;
    bottom: 3px;
    font-size: 30px;
    opacity: 0.16;
}

.hand {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

.hand__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
}

.hand__cards { display: flex; gap: 6px; }

.hand__rank {
    font-size: 12.5px;
    color: var(--violet-2);
    font-weight: 650;
}

.hand--winner { border-color: rgba(163, 230, 53, 0.5); box-shadow: 0 0 0 1px rgba(163, 230, 53, 0.25); }

/* Команды */

.teams {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.team {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    animation: popIn 0.4s var(--ease-out) backwards;
}

.team__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--team-accent, var(--violet)) 12%, transparent);
}

.team__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--team-accent, var(--violet-2));
}

.team__count { font-size: 11.5px; color: var(--muted); }

.team__list {
    margin: 0;
    padding: 8px 15px 14px;
    list-style: none;
    display: grid;
    gap: 7px;
    font-size: 13.5px;
}

.team__list li { display: flex; align-items: center; gap: 8px; }

.team__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--team-accent, var(--violet));
    flex: none;
}

/* Пароли */

.pw-list { display: grid; gap: 8px; }

.pw-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.pw-value {
    flex: 1;
    min-width: 0;
    font-family: var(--mono);
    font-size: 15px;
    letter-spacing: 0.01em;
    word-break: break-all;
}

.pw-item .icon-btn { width: 32px; height: 32px; border-radius: 9px; }

.strength { display: grid; gap: 7px; }

.strength__bar { display: flex; gap: 4px; }

.strength__seg {
    height: 6px;
    flex: 1;
    border-radius: 999px;
    background: var(--surface-3);
    transition: background-color 0.3s var(--ease);
}

.strength__seg.is-on { background: var(--green); }
.strength--weak .strength__seg.is-on { background: var(--red); }
.strength--fair .strength__seg.is-on { background: var(--amber); }
.strength--good .strength__seg.is-on { background: var(--lime); }

.strength__label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}

/* Цвет */

.color-hero {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 0;
    min-height: 260px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
}

.color-hero__swatch {
    min-height: 220px;
    display: grid;
    place-items: center;
    transition: background-color 0.4s var(--ease);
}

.color-hero__hex {
    font-family: var(--mono);
    font-size: clamp(22px, 4vw, 38px);
    font-weight: 700;
    color: #fff;
    mix-blend-mode: difference;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.color-hero__info {
    padding: 24px;
    display: grid;
    align-content: center;
    gap: 12px;
}

.color-meta {
    display: grid;
    gap: 8px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--dim);
}

.color-meta div { display: flex; justify-content: space-between; gap: 12px; }

.palette-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

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

.swatch__color {
    height: 76px;
    transition: background-color 0.3s var(--ease);
}

.swatch__hex {
    display: block;
    padding: 8px 10px;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--dim);
    text-align: center;
    letter-spacing: 0.02em;
}

/* Код/хеш */

.hashbox {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.22);
    font-family: var(--mono);
    font-size: 12.5px;
    word-break: break-all;
    color: var(--dim);
}

[data-theme="light"] .hashbox { background: rgba(17, 20, 45, 0.045); }

.hashbox__label {
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.hashbox__value { color: var(--text); }

/* Схема генератора и слои */

.flow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: clamp(18px, 3vw, 30px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background:
        radial-gradient(70% 120% at 50% 0%, rgba(139, 92, 246, 0.12), transparent 60%),
        radial-gradient(70% 120% at 50% 100%, rgba(34, 211, 238, 0.08), transparent 60%),
        var(--card);
}

.flow__col {
    display: grid;
    gap: 9px;
    flex: 1 1 190px;
    min-width: 180px;
    max-width: 260px;
}

.flow__node {
    position: relative;
    display: grid;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    --accent: var(--violet);
}

.flow__node strong { font-size: 13px; font-weight: 650; }

.flow__node small {
    font-size: 10.5px;
    color: var(--muted);
    font-family: var(--mono);
    line-height: 1.4;
    word-break: break-word;
}

.flow__icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
    border-radius: 9px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
}

.flow__icon .icon { width: 16px; height: 16px; }

.flow__node--violet { --accent: var(--violet-2); }
.flow__node--cyan { --accent: var(--cyan); }
.flow__node--lime { --accent: var(--lime); }
.flow__node--out { --accent: var(--dim); }

.flow__node--mix {
    --accent: var(--lime);
    flex: 0 1 230px;
    padding: 18px;
    background:
        radial-gradient(120% 120% at 0 0, rgba(163, 230, 53, 0.16), transparent 60%),
        radial-gradient(120% 120% at 100% 100%, rgba(139, 92, 246, 0.18), transparent 60%),
        var(--surface-2);
    border-color: rgba(163, 230, 53, 0.34);
    box-shadow: 0 0 0 1px rgba(163, 230, 53, 0.08), 0 24px 60px -34px rgba(163, 230, 53, 0.55);
}

.flow__pulse {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.6);
    animation: pulseDot 2.2s ease-out infinite;
}

.flow__arrow {
    display: grid;
    place-items: center;
    color: var(--muted);
    flex: none;
}

.flow__arrow .icon { width: 22px; height: 22px; }

.flow__note {
    margin-top: 14px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.6;
}

.layers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(262px, 1fr));
    gap: 14px;
}

.layer {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
}

.layer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.layer__num {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.layer__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
}

.layer__icon .icon { width: 19px; height: 19px; }

.layer h3 { font-size: 16.5px; }

.layer p { font-size: 13px; line-height: 1.62; color: var(--dim); }

.layer__tag {
    justify-self: start;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.two-col > * { min-width: 0; }

.table-wrap {
    margin-top: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.table {
    width: 100%;
    min-width: 460px;
    border-collapse: collapse;
    font-size: 12.5px;
}

.table th,
.table td {
    padding: 11px 13px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface);
}

.table tbody tr:last-child td { border-bottom: 0; }

.table td:first-child { color: var(--dim); white-space: nowrap; }

.table .is-good { color: var(--text); font-weight: 550; }

.test-progress { display: grid; gap: 7px; }

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.55); }
    70% { box-shadow: 0 0 0 9px rgba(163, 230, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0); }
}

/* Энтропия: три источника случайности */

.entropy {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        radial-gradient(120% 100% at 0% 0%, rgba(34, 211, 238, 0.09), transparent 58%),
        radial-gradient(120% 100% at 100% 100%, rgba(163, 230, 53, 0.08), transparent 58%),
        var(--surface);
}

.entropy__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.entropy__title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.entropy__title .icon { width: 14px; height: 14px; color: var(--cyan); }

.entropy__value {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--dim);
}

.entropy__note {
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted);
}

.entropy__sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.entropy__source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 10.5px;
    font-weight: 650;
    color: var(--muted);
    transition: all 0.3s var(--ease);
}

.entropy__source::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}

.entropy__source.is-on {
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.08);
    color: var(--green);
}

.entropy__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.entropy-status {
    font-size: 11.5px;
    color: var(--muted);
}

.entropy-status[data-source="beacon"] { color: var(--green); }

/* Diagram commit-reveal */

.commit-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid rgba(163, 230, 53, 0.24);
    background: rgba(163, 230, 53, 0.05);
}

.winners {
    display: grid;
    gap: 10px;
}

.winner-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    animation: popIn 0.5s var(--ease-out) backwards;
}

.winner-card__place {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 12px;
    background: var(--grad-primary);
    color: #fff;
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 700;
}

.winner-card__name { font-size: 15.5px; font-weight: 700; }

.winner-card__prize { font-size: 12px; color: var(--muted); }

.winner-card--gold .winner-card__place { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #422006; }

/* Диаграмма честности */

.fair {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    padding: clamp(24px, 4vw, 40px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background:
        radial-gradient(90% 120% at 100% 0%, rgba(163, 230, 53, 0.1), transparent 60%),
        radial-gradient(90% 120% at 0% 100%, rgba(139, 92, 246, 0.14), transparent 60%),
        var(--card);
    overflow: hidden;
}

.fair__steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }

.fair__step { display: flex; gap: 13px; }

.fair__num {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 10px;
    border: 1px solid var(--border-2);
    background: var(--surface-2);
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--lime);
}

.fair__step strong { display: block; font-size: 14.5px; margin-bottom: 3px; }
.fair__step p { font-size: 13px; color: var(--dim); line-height: 1.55; }

/* Графики */

.chart {
    position: relative;
    width: 100%;
    min-height: 200px;
}

.chart__svg { display: block; width: 100%; height: auto; overflow: visible; }

.chart__grid { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
[data-theme="light"] .chart__grid { stroke: rgba(16, 20, 45, 0.08); }

.chart__axis {
    fill: var(--muted);
    font-family: var(--font);
    font-size: 10px;
}

.chart__area { opacity: 0.16; }

.chart__line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.chart__dot { r: 3; stroke: var(--bg); stroke-width: 1.5; opacity: 0; transition: opacity 0.15s; }
.chart:hover .chart__dot { opacity: 1; }

.chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--dim);
}

.legend__item { display: inline-flex; align-items: center; gap: 6px; }

.legend__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dot, var(--violet));
}

.chart__tooltip {
    position: absolute;
    z-index: 5;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(8, 10, 20, 0.94);
    border: 1px solid var(--border-2);
    font-size: 11.5px;
    color: #fff;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -120%);
    transition: opacity 0.12s;
    white-space: nowrap;
}

.chart__tooltip.is-visible { opacity: 1; }

.chart__empty {
    display: grid;
    place-items: center;
    min-height: 200px;
    border: 1px dashed var(--border-2);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 13px;
}

/* Билет лотереи */

.ticket {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    animation: popIn 0.4s var(--ease-out) backwards;
}

.ticket__label {
    min-width: 74px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* 9. Подвал, реклама, поиск, тосты --------------------------------------- */

.footer {
    position: relative;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    background: rgba(var(--bg-rgb), 0.6);
}

.footer__top {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
    gap: 40px;
    padding: 46px 0 36px;
}

.footer__about {
    margin-top: 16px;
    max-width: 36ch;
    font-size: 13px;
    line-height: 1.65;
    color: var(--muted);
}

.footer__note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--dim);
}

.footer__note .icon { width: 14px; height: 14px; color: var(--lime); }

.footer__cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.footer__col { display: grid; gap: 9px; align-content: start; }

.footer__title {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.footer__col a {
    font-size: 13px;
    color: var(--dim);
    transition: color 0.16s var(--ease), transform 0.16s var(--ease);
}

.footer__col a:hover { color: var(--text); }

.footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px 0 22px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
}

.footer__legal {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--muted);
}

.footer__legal strong { color: var(--dim); font-weight: 650; }

.footer__legal a {
    color: var(--dim);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer__legal a:hover { color: var(--text); }

/* Контекстная правовая пометка на «игорных» инструментах */
.legal-note {
    display: flex;
    gap: 10px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(251, 191, 36, 0.26);
    background: rgba(251, 191, 36, 0.06);
    font-size: 12px;
    line-height: 1.55;
    color: var(--dim);
}

.legal-note .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--amber); }

.legal-note strong { color: var(--text); font-weight: 650; }

.legal-note a { color: var(--violet-2); text-decoration: underline; text-underline-offset: 2px; }

.footer__meta { display: flex; align-items: center; gap: 12px; }

.li-counter { display: inline-flex; opacity: 0.75; transition: opacity 0.2s; }
.li-counter:hover { opacity: 1; }

.ad-slot {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 96px;
    margin: 8px 0 20px;
    padding: 26px 0 0;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}

.ad-slot--footer { margin: 0 0 24px; }

.ad-slot__label {
    position: absolute;
    top: 7px;
    left: 12px;
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.7;
}

.ad-slot .adsbygoogle { width: 100%; }

/* Поиск (command palette) */

.palette {
    width: min(620px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 120px));
    padding: 0;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    background: rgba(var(--bg-rgb), 0.97);
    -webkit-backdrop-filter: blur(26px);
    backdrop-filter: blur(26px);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    overflow: hidden;
}

.palette::backdrop {
    background: rgba(3, 4, 10, 0.62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.palette__panel { display: flex; flex-direction: column; max-height: inherit; }

.palette__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.palette__head .icon { color: var(--muted); }

.palette__input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: 16px;
    outline: none;
}

.palette__close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
}

.palette__list {
    overflow-y: auto;
    padding: 8px;
    display: grid;
    gap: 2px;
}

.palette__item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 11px;
    cursor: pointer;
    transition: background-color 0.12s var(--ease);
}

.palette__item:hover,
.palette__item.is-active { background: var(--surface-2); }

.palette__item strong { font-size: 14px; font-weight: 600; }
.palette__item small { display: block; font-size: 11.5px; color: var(--muted); }

.palette__empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13.5px; }

.palette__foot {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--muted);
}

/* Тосты */

.toast-wrap {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 120;
    display: grid;
    gap: 8px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-2);
    background: rgba(var(--bg-rgb), 0.96);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    font-size: 13.5px;
    animation: toastIn 0.3s var(--ease-out);
}

.toast .icon { width: 17px; height: 17px; color: var(--lime); flex: none; }
.toast--error .icon { color: var(--red); }
.toast.is-out { animation: toastOut 0.25s var(--ease) forwards; }

.confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 110;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* 9a. Главная: hero ------------------------------------------------------- */

.hero {
    position: relative;
    padding: clamp(38px, 5.5vw, 74px) 0 clamp(10px, 1.6vw, 22px);
    overflow: hidden;
}

.hero__grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
    gap: clamp(30px, 4.5vw, 62px);
    align-items: center;
}

.hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
}

.hero__orb--1 {
    width: 340px;
    height: 340px;
    left: -120px;
    top: -60px;
    background: rgba(139, 92, 246, 0.4);
    animation: floatOrb 16s ease-in-out infinite;
}

.hero__orb--2 {
    width: 280px;
    height: 280px;
    right: -100px;
    top: 40px;
    background: rgba(34, 211, 238, 0.28);
    animation: floatOrb 20s ease-in-out infinite reverse;
}

.hero__orb--3 {
    width: 240px;
    height: 240px;
    left: 38%;
    bottom: -140px;
    background: rgba(163, 230, 53, 0.18);
    animation: floatOrb 24s ease-in-out infinite;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 14px 6px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-2);
    background: var(--surface);
    font-size: 12px;
    font-weight: 600;
    color: var(--dim);
}

.hero__badge .live-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lime);
    margin-left: 4px;
    box-shadow: 0 0 0 4px rgba(163, 230, 53, 0.16);
}

.hero__badge .live-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(163, 230, 53, 0.5);
    animation: pulseRing 2.4s ease-out infinite;
}

.hero__title {
    margin-top: 20px;
    font-size: clamp(35px, 5.2vw, 67px);
    line-height: 1.03;
    letter-spacing: -0.042em;
    font-weight: 800;
}

.hero__title span { display: block; }

.hero__lead {
    margin-top: 20px;
    max-width: 53ch;
    font-size: clamp(15px, 1.5vw, 17px);
    line-height: 1.62;
    color: var(--dim);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.hero__trust {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.trust__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
}

.trust__item .icon { width: 15px; height: 15px; color: var(--lime); }

/* Быстрый генератор в hero */

.quick {
    position: relative;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-2);
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(34, 211, 238, 0.1), transparent 58%),
        radial-gradient(120% 90% at 0% 100%, rgba(139, 92, 246, 0.16), transparent 58%),
        rgba(var(--card-rgb), 0.82);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 20px;
    overflow: hidden;
}

.quick::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.4), transparent 40%, rgba(34, 211, 238, 0.28));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.quick__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.quick__label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.quick__label .icon { width: 14px; height: 14px; color: var(--violet-2); }

.quick__tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .quick__tabs { background: rgba(17, 20, 45, 0.05); }

.quick__tab {
    padding: 6px 11px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    transition: color 0.16s var(--ease), background-color 0.16s var(--ease);
}

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

.quick__tab.is-active {
    background: var(--surface-3);
    color: var(--text);
}

.quick__body { padding-top: 16px; }

.quick__pane { display: none; }
.quick__pane.is-active { display: grid; gap: 12px; animation: fadeIn 0.25s var(--ease); }

.quick__result {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 112px;
    padding: 10px;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border);
}

[data-theme="light"] .quick__result { background: rgba(17, 20, 45, 0.035); }

.quick__result-value {
    font-family: var(--mono);
    font-size: clamp(36px, 5.6vw, 54px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    word-break: break-word;
    text-align: center;
}

.quick__result-note { font-size: 11.5px; color: var(--muted); text-align: center; }

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

.quick__row .input { flex: 1; min-width: 0; padding: 10px 12px; font-size: 14px; }

.quick__row .btn { flex: none; }

.quick__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 12px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--muted);
}

.quick__foot a { color: var(--dim); display: inline-flex; align-items: center; gap: 5px; }
.quick__foot a:hover { color: var(--text); }

.quick__foot a .icon { width: 14px; height: 14px; }

.quick__coin {
    width: 92px;
    height: 92px;
    margin: 6px auto;
    cursor: default;
}

.quick__coin .coin__label { font-size: 30px; }
.quick__coin .coin__face { border-width: 2px; }
.quick__coin .coin__face::after { inset: 8px; }

.die--sm {
    width: 54px;
    height: 54px;
    border-radius: 14px;
}

.die--sm .die__grid { width: 66%; height: 66%; }

.quick__choice {
    min-height: 92px;
    font-size: 14px;
    padding: 10px 12px;
}

/* 9b. Каталог ------------------------------------------------------------- */

.catalog__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
    gap: 14px;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 21px;
    min-height: 208px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.tool-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(130% 110% at 0% 0%, color-mix(in srgb, var(--accent, var(--violet)) 16%, transparent), transparent 58%);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
    pointer-events: none;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent, var(--violet)) 42%, var(--border));
    box-shadow: 0 34px 64px -46px color-mix(in srgb, var(--accent, var(--violet)) 80%, transparent);
}

.tool-card:hover::before { opacity: 1; }

.tool-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.tool-card__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    border: 1px solid color-mix(in srgb, var(--accent, var(--violet)) 26%, transparent);
    background: color-mix(in srgb, var(--accent, var(--violet)) 13%, transparent);
    color: var(--accent, var(--violet-2));
    transition: transform 0.3s var(--ease);
}

.tool-card:hover .tool-card__icon { transform: scale(1.06) rotate(-4deg); }

.tool-card__icon .icon { width: 23px; height: 23px; }

.tool-card__badge {
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.tool-card__title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.018em;
    line-height: 1.3;
}

.tool-card__desc {
    font-size: 13px;
    line-height: 1.55;
    color: var(--dim);
    flex: 1;
}

.tool-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 11px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--muted);
}

.tool-card__arrow {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--dim);
    transition: all 0.25s var(--ease);
}

.tool-card__arrow .icon { width: 15px; height: 15px; }

.tool-card:hover .tool-card__arrow {
    background: var(--accent, var(--violet));
    color: #0a0c17;
    transform: translateX(3px);
}

/* 9c. Секции -------------------------------------------------------------- */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
    gap: 14px;
}

.feature {
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.feature:hover { border-color: var(--border-2); transform: translateY(-2px); }

.feature__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    border: 1px solid color-mix(in srgb, var(--accent, var(--violet)) 26%, transparent);
    background: color-mix(in srgb, var(--accent, var(--violet)) 12%, transparent);
    color: var(--accent, var(--violet-2));
    margin-bottom: 14px;
}

.feature h3 { font-size: 16px; margin-bottom: 7px; }

.feature p { font-size: 13px; line-height: 1.6; color: var(--dim); }

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
    gap: 14px;
}

.step {
    position: relative;
    padding: 24px 22px 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

.step__num {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    border: 1px solid var(--border-2);
    background: var(--surface-2);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--violet-2);
    margin-bottom: 14px;
}

.step h3 { font-size: 16px; margin-bottom: 7px; }

.step p { font-size: 13px; line-height: 1.6; color: var(--dim); }

.cta-band {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 22px;
    padding: clamp(26px, 4vw, 40px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(163, 230, 53, 0.22);
    background:
        radial-gradient(90% 140% at 100% 0%, rgba(163, 230, 53, 0.14), transparent 58%),
        radial-gradient(90% 140% at 0% 100%, rgba(139, 92, 246, 0.18), transparent 58%),
        var(--card);
    overflow: hidden;
}

.cta-band__title {
    font-size: clamp(22px, 2.8vw, 32px);
    letter-spacing: -0.03em;
    max-width: 24ch;
}

.cta-band__text { margin-top: 8px; color: var(--dim); font-size: 14px; max-width: 46ch; }

.faq {
    display: grid;
    gap: 10px;
    max-width: 900px;
}

.faq details {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 0 18px;
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.faq details[open] { border-color: var(--border-2); background: var(--surface-2); }

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 600;
    list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
    content: "+";
    font-family: var(--mono);
    font-size: 18px;
    color: var(--muted);
    transition: transform 0.25s var(--ease);
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq__a {
    padding: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--dim);
    max-width: 72ch;
}

.faq__a a { color: var(--violet-2); }

/* Страница «О проекте» */

.prose {
    max-width: 760px;
    display: grid;
    gap: 16px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--dim);
}

.prose h2 {
    margin-top: 22px;
    font-size: clamp(21px, 2.4vw, 27px);
    color: var(--text);
}

.prose h3 { margin-top: 12px; font-size: 17px; color: var(--text); }

.prose strong { color: var(--text); }

.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

.prose a { color: var(--violet-2); text-decoration: underline; text-underline-offset: 3px; }

.prose code {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface-3);
    font-family: var(--mono);
    font-size: 0.9em;
    color: var(--text);
}

/* 10. Анимации ------------------------------------------------------------ */

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes toastOut {
    to { opacity: 0; transform: translateY(10px) scale(0.97); }
}

@keyframes coinFlip {
    0% { transform: rotateY(0) translateY(0) scale(1); }
    30% { transform: rotateY(720deg) translateY(-46px) scale(1.05); }
    60% { transform: rotateY(1440deg) translateY(-58px) scale(1.04); }
    100% { transform: rotateY(1800deg) translateY(0) scale(1); }
}

@keyframes dieRoll {
    0% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-16px) rotate(9deg) scale(1.04); }
    50% { transform: translateY(0) rotate(0deg) scale(0.98); }
    75% { transform: translateY(-7px) rotate(-7deg) scale(1.02); }
    100% { transform: translateY(0) rotate(0deg) scale(1); }
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(-12px) rotate(-4deg); }
    to { opacity: 1; transform: none; }
}

/* Появление блоков при скролле */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.is-in { opacity: 1; transform: none; }

/* Адаптив --------------------------------------------------------------- */

@media (max-width: 1100px) {
    .mega__inner { grid-template-columns: minmax(0, 1fr); }
    .mega__promo { display: none; }
    .mega__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .tool-layout { grid-template-columns: minmax(0, 1fr); }
    .tool-layout__aside { position: static; }
    .footer__top { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav { display: none; }
    .topbar__burger { display: inline-grid; }
    .topbar__cta { display: none; }
    .two-col { grid-template-columns: minmax(0, 1fr); }
    .flow { flex-direction: column; align-items: stretch; }
    .flow__col { max-width: none; }
    .flow__arrow { transform: rotate(90deg); align-self: center; }
    .flow__node--mix { flex: none; }
}

@media (max-width: 760px) {
    .shell { padding: 0 18px; }
    .topbar__actions { gap: 6px; }
    .icon-btn__kbd { display: none; }
    .hero__grid { grid-template-columns: minmax(0, 1fr); }
    .tool-hero__row { flex-direction: column; align-items: flex-start; gap: 18px; }
    .section__head { flex-direction: column; align-items: flex-start; gap: 14px; }
    .fair { grid-template-columns: minmax(0, 1fr); }
    .color-hero { grid-template-columns: minmax(0, 1fr); }
    .footer__bottom { flex-direction: column; align-items: flex-start; }
    .roulette-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .pcard { width: 52px; height: 74px; }
    .pcard__center { font-size: 20px; }
    .pcard__big { font-size: 22px; }
}

@media (max-width: 480px) {
    body { font-size: 15px; }
    .brand__text small { display: none; }
    .result { min-height: 170px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ball { width: 40px; height: 40px; font-size: 14px; }
    .footer__cols { grid-template-columns: minmax(0, 1fr); }
    .hero__actions { flex-direction: column; align-items: stretch; }
    .hero__actions .btn { width: 100%; }
    .hero__title { font-size: clamp(31px, 9vw, 42px); }
}

/* Меньше движения */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}
