:root {
    --bg: #050b1a;
    --bg-card: rgba(20, 25, 35, 0.68);
    --bg-card-hover: rgba(30, 38, 55, 0.78);
    --border: rgba(255, 255, 255, 0.10);
    --text: #ffffff;
    --text-secondary: #8a96b3;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.30);
    --telegram: #2aabee;
    --telegram-hover: #1e8fc8;
    --logo-size: 92px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    background: var(--bg);
    min-height: 100vh;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    min-height: 100vh;
    padding: 0 0 60px;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

#shader-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

.docs-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.docs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: -6px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s var(--ease);
}

.logo:hover {
    opacity: 0.85;
}

.logo:active {
    transform: scale(0.98);
}

.logo-img {
    width: var(--logo-size);
    height: var(--logo-size);
    object-fit: contain;
    display: block;
    margin-right: -34px;
    filter: drop-shadow(0 0 18px rgba(59, 130, 246, 0.55));
}

.logo-text {
    font-weight: 900;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.8px;
    color: var(--text);
}

.docs-back {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.15s var(--ease);
    margin-right: 4px;
}

.docs-back:hover {
    background: var(--bg-card-hover);
    border-color: rgba(59, 130, 246, 0.4);
}

.docs-back:active {
    transform: scale(0.92);
}

.docs-back svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s var(--ease);
}

.docs-back:hover svg {
    transform: translateX(-1px);
}

.docs-heading {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.6px;
    margin: 8px 0 4px;
    padding: 0 2px;
    color: var(--text);
}

.docs-subheading {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 4px;
    padding: 0 2px;
    line-height: 1.5;
}

.docs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.docs-item {
    background: linear-gradient(180deg, rgba(30, 38, 55, 0.72) 0%, rgba(20, 25, 35, 0.68) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    transition: border-color 0.3s var(--ease), transform 0.25s var(--ease), box-shadow 0.3s var(--ease);
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    will-change: transform, box-shadow;
}

.docs-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.10), transparent);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s var(--ease);
}

.docs-item:hover {
    border-color: rgba(59, 130, 246, 0.30);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.docs-item.open {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
    transform: translateY(0);
}

.docs-item-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 18px 20px;
    background: transparent;
    border: 0;
    color: var(--text);
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    letter-spacing: 0.1px;
    position: relative;
    z-index: 2;
    transition: background 0.2s var(--ease);
}

.docs-item-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.docs-item-header:active {
    background: rgba(255, 255, 255, 0.04);
}

.docs-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease);
}

.docs-item.open .docs-item-icon {
    transform: scale(1.05);
}

.docs-item-icon svg {
    width: 18px;
    height: 18px;
}

.docs-item-icon.faq     { background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(56, 189, 248, 0.28); }
.docs-item-icon.faq svg     { stroke: #38bdf8; }
.docs-item-icon.bonus   { background: rgba(236, 72, 153, 0.14); border: 1px solid rgba(236, 72, 153, 0.28); }
.docs-item-icon.bonus svg   { stroke: #f472b6; }
.docs-item-icon.agree   { background: rgba(59, 130, 246, 0.14);  border: 1px solid rgba(59, 130, 246, 0.28); }
.docs-item-icon.agree svg   { stroke: #60a5fa; }
.docs-item-icon.secure  { background: rgba(16, 185, 129, 0.14); border: 1px solid rgba(16, 185, 129, 0.28); }
.docs-item-icon.secure svg  { stroke: #34d399; }
.docs-item-icon.private { background: rgba(139, 92, 246, 0.14); border: 1px solid rgba(139, 92, 246, 0.28); }
.docs-item-icon.private svg { stroke: #a78bfa; }

.docs-item-title {
    flex: 1;
}

.docs-item-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: transform 0.4s var(--ease-out), color 0.3s var(--ease);
    flex-shrink: 0;
}

.docs-item-chevron svg {
    width: 100%;
    height: 100%;
}

.docs-item.open .docs-item-chevron {
    transform: rotate(180deg);
    color: #60a5fa;
}

.docs-item-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s var(--ease-out);
    position: relative;
    z-index: 1;
}

.docs-item.open .docs-item-body {
    grid-template-rows: 1fr;
}

.docs-item-body > * {
    overflow: hidden;
    min-height: 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 16px 20px;
}

.faq-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px 15px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid rgba(56, 189, 248, 0.55);
    border-radius: 12px;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.faq-item:hover {
    background: rgba(0, 0, 0, 0.30);
    border-left-color: rgba(56, 189, 248, 0.85);
    transform: translateX(2px);
}

.faq-q {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.faq-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 7px;
    margin-top: 1px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 6px;
    color: #38bdf8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums;
}

.faq-q-text {
    flex: 1;
    min-width: 0;
}

.faq-a {
    display: flex;
    flex-direction: column;
    margin-left: 38px;
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.05) 0%, rgba(34, 197, 94, 0.02) 100%);
    border: 1px solid rgba(34, 197, 94, 0.22);
    border-left: 3px solid rgba(34, 197, 94, 0.65);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.faq-a::before {
    content: '';
    position: absolute;
    top: 16px;
    left: -7px;
    width: 11px;
    height: 11px;
    background: rgba(34, 197, 94, 0.05);
    border-left: 1px solid rgba(34, 197, 94, 0.22);
    border-bottom: 1px solid rgba(34, 197, 94, 0.22);
    transform: rotate(45deg);
}

.faq-a-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.10) 0%, rgba(34, 197, 94, 0.03) 100%);
    border-bottom: 1px solid rgba(34, 197, 94, 0.14);
}

.faq-a-reply {
    flex-shrink: 0;
    color: #4ade80;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.75;
    margin-right: -2px;
}

.faq-avatar {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
    color: #052e16;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(34, 197, 94, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.faq-a-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.faq-a-name {
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.1px;
}

.faq-a-role {
    color: #4ade80;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    opacity: 0.95;
}

.faq-a-badge {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 800;
    color: #4ade80;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 7px;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.32);
    border-radius: 5px;
    white-space: nowrap;
}

.faq-a-body {
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.55;
    padding: 10px 12px 12px;
}

.html-body {
    padding: 6px 20px 22px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.65;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin: 0 14px;
    padding-top: 16px;
}

.html-body > *:first-child {
    margin-top: 0;
}

.html-body h4 {
    color: var(--text);
    font-size: 14.5px;
    font-weight: 600;
    margin: 18px 0 8px;
    letter-spacing: 0.1px;
}

.html-body p {
    margin: 0 0 12px;
}

.html-body p:last-child {
    margin-bottom: 0;
}

.html-body ul {
    margin: 0 0 12px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.html-body li {
    line-height: 1.6;
}

.html-body li::marker {
    color: #60a5fa;
}

.html-body b {
    color: var(--text);
    font-weight: 600;
}

.docs-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.tg-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    padding: 8px 14px 8px 8px;
    background: linear-gradient(135deg, #2aabee 0%, #1e8fc8 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease), filter 0.25s var(--ease);
    box-shadow: 0 4px 14px rgba(42, 171, 238, 0.25);
    position: relative;
    overflow: hidden;
}

.tg-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.30), transparent);
    pointer-events: none;
}

.tg-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(42, 171, 238, 0.40);
    filter: brightness(1.05);
}

.tg-btn:active {
    transform: scale(0.97);
}

.tg-btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tg-btn-icon svg {
    width: 16px;
    height: 16px;
    fill: #ffffff;
}

.tg-btn-text {
    line-height: 1;
    white-space: nowrap;
}

.tg-btn-arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.85;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
    margin-left: 2px;
}

.tg-btn-arrow svg {
    width: 100%;
    height: 100%;
}

.tg-btn:hover .tg-btn-arrow {
    transform: translateX(2px);
    opacity: 1;
}

.docs-footer {
    margin-top: 16px;
    padding: 16px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0.7;
}

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

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

.docs-header {
    animation: docsFadeInHeader 0.4s var(--ease) backwards;
}

.docs-shell > *:not(.docs-header) {
    animation: docsFadeIn 0.5s var(--ease) backwards;
}

.docs-shell > *:nth-child(1) { animation-delay: 0.05s; }
.docs-shell > *:nth-child(2) { animation-delay: 0.10s; }
.docs-shell > *:nth-child(3) { animation-delay: 0.15s; }
.docs-shell > *:nth-child(4) { animation-delay: 0.20s; }
.docs-shell > *:nth-child(5) { animation-delay: 0.25s; }

@media (max-width: 480px) {
    .docs-shell { padding: 20px 16px 0; }
    :root { --logo-size: 76px; }
    .logo-text { font-size: 28px; }
    .logo-img { margin-right: -28px; }
    .docs-heading { font-size: 26px; }
    .docs-item-header { padding: 16px 16px; font-size: 15px; }
    .faq-list { padding: 4px 12px 18px; }
    .faq-item { padding: 12px 14px; gap: 8px; }
    .faq-q { font-size: 13.5px; gap: 10px; }
    .faq-num { min-width: 26px; height: 22px; font-size: 10.5px; padding: 0 6px; }
    .faq-a { margin-left: 0; }
    .faq-a::before { display: none; }
    .faq-a-head { padding: 6px 10px; gap: 7px; }
    .faq-a-reply { font-size: 13px; }
    .faq-avatar { width: 22px; height: 22px; font-size: 9px; }
    .faq-a-name { font-size: 11.5px; }
    .faq-a-role { font-size: 8.5px; letter-spacing: 0.3px; }
    .faq-a-badge { font-size: 8px; padding: 2px 6px; letter-spacing: 0.8px; }
    .faq-a-body { padding: 8px 10px 10px; font-size: 13px; line-height: 1.5; }
    .html-body { padding: 6px 16px 20px; margin: 0 12px; }
    .tg-btn { font-size: 13.5px; padding: 7px 12px 7px 7px; }
    .tg-btn-icon { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
