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

:root {
    --bg: #f8f9fa;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --text: #1a1a2e;
    --text-muted: #5a5a6e;
    --green: #538d4e;
    --green-bright: #6aaa64;
    --yellow: #c9b458;
    --yellow-bright: #d4c06a;
    --gray: #787c7e;
    --gray-light: #a0a4a8;
    --telegram: #2AABEE;
    --telegram-dark: #229ED9;
    --border: rgba(0, 0, 0, 0.08);
    --glow-green: rgba(83, 141, 78, 0.2);
    --glow-telegram: rgba(42, 171, 238, 0.2);
    --radius: 16px;
    --radius-sm: 8px;
    --container: 1140px;
    --font-heading: 'Unbounded', cursive;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 40px;
}

h1, h2, h3 {
    font-family: var(--font-heading);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 249, 250, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.header__inner {
    display: flex;
    align-items: center;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    margin-right: auto;
}

.logo__tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    transition: transform 0.2s;
}

.logo:hover .logo__tile {
    transform: scale(1.1);
}

.logo__tile--green { background: var(--green-bright); }
.logo__tile--yellow { background: var(--yellow); }
.logo__tile--gray { background: var(--gray); }

.nav {
    display: flex;
    gap: 28px;
    margin-right: 20px;
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    padding: 4px 0;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--green-bright);
    border-radius: 2px;
    transition: width 0.3s;
}

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

.nav a:hover::after {
    width: 100%;
}

.btn--play {
    padding: 8px 18px;
    font-size: 13px;
    font-family: var(--font-heading);
    font-weight: 700;
    background: var(--green-bright);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.btn--play:hover {
    background: var(--green);
    transform: scale(1.05);
}

.play-dropdown {
    position: relative;
}

.play-dropdown__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.play-dropdown.open .play-dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.play-dropdown__item {
    display: block;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.play-dropdown__item:hover {
    background: rgba(106, 170, 100, 0.1);
    color: var(--green);
}

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border);
    background: rgba(248, 249, 250, 0.95);
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 0;
    transition: color 0.2s;
}

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

.mobile-nav .btn {
    margin-top: 8px;
    text-align: center;
    color: #fff;
}

.mobile-nav .btn--outline {
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
    position: relative;
}

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

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

.btn--primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-bright) 100%);
    color: #fff;
    box-shadow: 0 4px 20px var(--glow-green);
}

.btn--primary:hover {
    box-shadow: 0 8px 32px var(--glow-green);
}

.btn--telegram {
    background: linear-gradient(135deg, var(--telegram-dark) 0%, var(--telegram) 100%);
    color: #fff;
    box-shadow: 0 4px 20px var(--glow-telegram);
}

.btn--telegram:hover {
    box-shadow: 0 8px 32px var(--glow-telegram);
}

.btn--outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
    box-shadow: none;
}

.btn--outline:hover {
    border-color: var(--green);
    color: var(--green);
    box-shadow: 0 4px 16px var(--glow-green);
}

.btn--large {
    padding: 14px 32px;
    font-size: 15px;
}

/* Hero */
.hero {
    position: relative;
    padding: 48px 0 40px;
    min-height: auto;
    display: flex;
    align-items: center;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(83, 141, 78, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(181, 159, 59, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.hero__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero__text {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 34px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #3a3a5e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.7;
}

.hero__buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.hero__tiles {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}

.hero__image {
    position: relative;
    z-index: 1;
    justify-self: end;
    animation: slideInRight 0.8s ease-out both;
    animation-delay: 0.3s;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.hero__image img {
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
}

.hero__text {
    position: relative;
    z-index: 1;
    animation: slideInLeft 0.6s ease-out both;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.hero__image img {
    width: 100%;
    max-width: 380px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
}

/* Tiles */
.tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    animation: flipIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.tile--small {
    width: 42px;
    height: 42px;
    font-size: 16px;
}

.tile--correct {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-bright) 100%);
    box-shadow: 0 4px 12px var(--glow-green);
}

.tile--present {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-bright) 100%);
    box-shadow: 0 4px 12px rgba(181, 159, 59, 0.3);
}

.tile--absent {
    background: var(--gray);
}

.tile:nth-child(1) { animation-delay: 0.1s; }
.tile:nth-child(2) { animation-delay: 0.2s; }
.tile:nth-child(3) { animation-delay: 0.3s; }
.tile:nth-child(4) { animation-delay: 0.4s; }
.tile:nth-child(5) { animation-delay: 0.5s; }

@keyframes flipIn {
    0% { transform: rotateX(90deg); opacity: 0; }
    40% { transform: rotateX(-10deg); }
    70% { transform: rotateX(5deg); }
    100% { transform: rotateX(0); opacity: 1; }
}

/* Inline tiles */
.inline-tile {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.inline-tile--correct { background: var(--green); }
.inline-tile--present { background: var(--yellow); color: #fff; }
.inline-tile--absent { background: var(--gray); }

/* Section headings */
.features h2,
.how-to-play h2,
.why-long h2,
.faq h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 56px;
    background: linear-gradient(135deg, #1a1a2e 0%, #4a4a6e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Features */
.features {
    padding: 100px 0;
    position: relative;
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: background 0.3s, border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(10px);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--green);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.feature-card__icon {
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* How to play */
.how-to-play {
    padding: 100px 0;
    position: relative;
}

.how-to-play::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(83, 141, 78, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.steps {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    transition: border-color 0.3s, transform 0.3s;
}

.step:hover {
    border-color: var(--green);
    transform: translateX(8px);
}

.step__number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-bright) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 900;
    color: #fff;
}

.step__content h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.step__content p {
    color: var(--text-muted);
    font-size: 14px;
}

.step__tiles {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Why long */
.why-long {
    padding: 100px 0;
}

.why-long__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 56px;
}

.why-card {
    text-align: center;
    padding: 40px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    transition: border-color 0.3s, transform 0.3s;
}

.why-card:hover {
    border-color: var(--yellow);
    transform: translateY(-4px);
}

.why-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
}

.why-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

.why-long__cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* FAQ */
.faq {
    padding: 100px 0;
    position: relative;
}

.faq::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 100%, rgba(181, 159, 59, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.faq__list {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.faq__item {
    border-bottom: 1px solid var(--border);
}

.faq__item summary {
    padding: 24px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.2s;
}

.faq__item summary:hover {
    color: var(--green-bright);
}

.faq__item summary::after {
    content: '+';
    font-size: 24px;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.faq__item[open] summary::after {
    transform: rotate(45deg);
    color: var(--green-bright);
}

.faq__item p {
    padding: 0 0 24px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* Footer */
.footer {
    padding: 0;
    border-top: 1px solid var(--border);
    position: relative;
}

.footer__top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding: 64px 0 48px;
    border-bottom: 1px solid var(--border);
}

.footer__brand .logo {
    margin-bottom: 16px;
}

.footer__tagline {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 280px;
}

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

.footer__nav h4 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer__nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer__nav a:hover {
    color: var(--green-bright);
}

.footer__cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.footer__cta p {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

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

.footer__buttons .btn {
    padding: 8px 16px;
    font-size: 12px;
}

.footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
}

.footer__copy {
    color: var(--gray-light);
    font-size: 13px;
}

.footer__bottom .footer__links {
    display: flex;
    gap: 24px;
}

.footer__bottom .footer__links a {
    color: var(--gray-light);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.footer__bottom .footer__links a:hover {
    color: var(--text-muted);
}

/* Legal pages */
.legal {
    padding: 48px 0 80px;
    max-width: 720px;
    margin: 0 auto;
}

.legal h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--text);
}

.legal__updated {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 40px;
}

.legal h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text);
}

.legal h3 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--text);
}

.legal p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.legal ul {
    list-style: none;
    padding: 0;
    margin-bottom: 12px;
}

.legal ul li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    padding-left: 16px;
    position: relative;
    margin-bottom: 4px;
}

.legal ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--green);
}

.legal a {
    color: var(--green);
    text-decoration: none;
}

.legal a:hover {
    text-decoration: underline;
}

.legal__contacts li::before {
    content: none;
}

.legal__contacts li {
    padding-left: 0;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children */
.reveal-stagger .feature-card,
.reveal-stagger .step,
.reveal-stagger .why-card,
.reveal-stagger .faq__item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal-stagger.visible .feature-card,
.reveal-stagger.visible .step,
.reveal-stagger.visible .why-card,
.reveal-stagger.visible .faq__item {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.visible .feature-card:nth-child(1),
.reveal-stagger.visible .step:nth-child(1),
.reveal-stagger.visible .why-card:nth-child(1),
.reveal-stagger.visible .faq__item:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.visible .feature-card:nth-child(2),
.reveal-stagger.visible .step:nth-child(2),
.reveal-stagger.visible .why-card:nth-child(2),
.reveal-stagger.visible .faq__item:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.visible .feature-card:nth-child(3),
.reveal-stagger.visible .step:nth-child(3),
.reveal-stagger.visible .why-card:nth-child(3),
.reveal-stagger.visible .faq__item:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger.visible .feature-card:nth-child(4),
.reveal-stagger.visible .step:nth-child(4),
.reveal-stagger.visible .why-card:nth-child(4),
.reveal-stagger.visible .faq__item:nth-child(4) { transition-delay: 0.2s; }

/* CTA pulse */
.hero__buttons .btn--primary {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 20px var(--glow-green); }
    50% { box-shadow: 0 4px 32px rgba(106, 170, 100, 0.5); }
}

/* Floating letters background */
.floating-letter {
    position: fixed;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.04);
    pointer-events: none;
    z-index: 0;
    animation: floatLetter 20s linear infinite;
}

@keyframes floatLetter {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 900px) {
    .hero__container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero__tiles {
        justify-content: center;
    }

    .hero__buttons {
        justify-content: center;
    }

    .hero__image {
        order: -1;
        justify-self: center;
    }

    .hero__image img {
        max-width: 360px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .why-long__grid {
        grid-template-columns: 1fr;
    }

    .footer__top {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .nav,
    .play-dropdown {
        display: none;
    }

    .burger {
        display: flex;
    }

    .hero {
        padding: 32px 0;
        min-height: auto;
    }

    .hero h1 {
        font-size: 22px;
    }

    .hero__subtitle {
        font-size: 15px;
    }

    .hero__tiles .tile {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .btn--large {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
    }

    .hero__buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .features__grid {
        grid-template-columns: 1fr;
    }

    .step {
        flex-direction: column;
        align-items: flex-start;
    }

    .step__tiles {
        margin-left: 0;
    }

    .features,
    .how-to-play,
    .why-long,
    .faq {
        padding: 60px 0;
    }

    .features h2,
    .how-to-play h2,
    .why-long h2,
    .faq h2 {
        font-size: 24px;
        margin-bottom: 36px;
    }

    .footer__top {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 40px 0 32px;
    }

    .footer__cta {
        align-items: stretch;
    }

    .footer__buttons {
        flex-direction: column;
    }

    .footer__bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer__bottom .footer__links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .floating-letter {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 22px;
    }

    .hero__tiles .tile {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    .container {
        padding: 0 16px;
    }

    .feature-card {
        padding: 24px;
    }
}