.bg-animation::before {
    animation: bgFloat 20s ease-in-out infinite;
}


.bg-animation::after {
    animation: meshRotate 30s linear infinite;
}

@keyframes meshRotate {
    0% { 
        transform: rotate(0deg);
    }
    100% { 
        transform: rotate(360deg);
    }
}

@keyframes bgFloat {
    0%, 100% {
        transform: scale(1) translate(0, 0);
    }
    50% {
        transform: scale(1.06) translate(2%, -2%);
    }
}

.hero {
    min-height: 72vh;
    padding-top: 104px;
    padding-bottom: 64px;
}

.stats-section {
    padding: 72px 0;
    background: var(--dark);
    color: white;
    text-align: center;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.stat-item {
    animation: fadeInUp 0.6s ease both;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: block;
    color: #fff;
}

.stat-label {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    opacity: 0.6;
}

.games-section {
    padding: 120px 0;
    background: var(--light-secondary);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-title {
    font-size: clamp(2rem, 3.4vw, 2.85rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
    color: var(--ink);
}

.section-subtitle {
    font-size: 1.12rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: 580px;
    margin: 0 auto;
}

.games-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}


.how-to-play-section {
    padding: 120px 0;
    background: var(--light);
}

.how-to-play-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.step-card {
    text-align: center;
    padding: 44px 32px;
    background: var(--light);
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    box-shadow: var(--shadow-sm);
}

.step-card:hover {
    transform: translateY(-8px);
    border-color: var(--hairline-strong);
    box-shadow: var(--shadow-lg);
}

.step-number {
    width: 76px;
    height: 76px;
    margin: 0 auto 24px;
    background: var(--dark);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 800;
    color: white;
    box-shadow: var(--shadow-md);
}

.step-card h4 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--dark);
}

.step-card p {
    color: var(--gray);
    line-height: 1.6;
}


.features-section {
    padding: 120px 0;
    background: var(--light-tertiary);
}

.features-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.feature-card {
    background: var(--light);
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    padding: 48px 40px;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.05), transparent);
    transition: left 0.6s ease;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--hairline-strong);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 28px;
    background: var(--dark);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    color: #fff;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotateY(15deg);
}

.feature-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark);
}

.feature-card p {
    color: var(--gray);
    line-height: 1.7;
    font-size: 1.05rem;
}

.cta-section {
    padding: 100px 0;
    background: var(--light-secondary);
    text-align: center;
}

.cta-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.cta-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 25px;
    background: linear-gradient(135deg, var(--dark), var(--gray-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cta-text {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 40px;
}


/* Hero backdrop (blueprint grid, geometric shapes, particles) now lives in
   main.css so it is shared by every hero page. */

.footer-bg {
    animation: footerBgFloat 25s ease-in-out infinite;
}

@keyframes footerBgFloat {
    0%, 100% { transform: scale(1) rotate(0deg); }
    33% { transform: scale(1.1) rotate(120deg); }
    66% { transform: scale(0.9) rotate(240deg); }
}

.animate-on-scroll {
    transition-delay: var(--delay, 0s);
}

/* ── Sign-Up Section ──────────────────────────────────── */
.signup-section {
    padding: 100px 20px;
    background: var(--dark);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.signup-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 15% 50%, rgba(37, 99, 235, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 85% 30%, rgba(6, 182, 212, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.signup-container {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.signup-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin: 0 auto 28px;
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.45);
    animation: signupIconFloat 4s ease-in-out infinite;
}

@keyframes signupIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.signup-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
}

.signup-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.7;
    margin-bottom: 36px;
}

.signup-perks {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.signup-perk {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.signup-perk i {
    color: var(--accent-green);
    font-size: 0.9rem;
}

@media screen and (max-width:1536px) {
    .hero {
        min-height: 72vh;
        padding-bottom: 56px;
    }
}

@media screen and (max-width: 600px) {
    .hero { min-height: 64vh; padding-top: 92px; }
}

/* ============================================================
   SPLIT HERO (home page only) — copy left, animated board right
   ============================================================ */

.hero--split {
    text-align: left;
    padding-top: 64px;
    padding-bottom: 72px;
    min-height: calc(88vh - 84px);
}

.hero-inner {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.06fr 0.94fr;
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
}

.hero--split .hero-badge {
    gap: 10px;
    background: rgba(255, 255, 255, 0.8);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    animation: heroDotPulse 2.2s ease-out infinite;
    flex-shrink: 0;
}

@keyframes heroDotPulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
    70%  { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero--split h1 {
    font-size: clamp(2.4rem, 4.6vw, 4rem);
    line-height: 1.06;
    margin-bottom: 22px;
}

/* Gradient accent word is now global (main.css) — nothing to override here. */

.hero--split .hero-subtitle {
    margin-left: 0;
    margin-right: 0;
    max-width: 520px;
}

.hero--split .hero-cta {
    justify-content: flex-start;
    animation-delay: 0.55s;
}

/* Brand-gradient CTA, home hero only */
.btn-brand {
    background: var(--grad-brand);
    color: #fff;
    box-shadow: var(--shadow-brand);
    background-size: 150% 150%;
    background-position: 0% 50%;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background-position 0.4s ease;
}

.btn-brand:hover {
    background-position: 100% 50%;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.38);
}

.btn-brand i { font-size: 0.82rem; }

/* Trust / proof row under the CTAs */
.hero-proof {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-top: 38px;
    animation: fadeInUp 0.8s ease 0.75s both;
}

.hero-proof-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-proof-item strong {
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.hero-proof-item span {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 500;
}

.hero-proof-sep {
    width: 1px;
    height: 34px;
    background: var(--hairline-strong);
}

/* ── Right column: floating puzzle board ── */

.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.9s ease 0.45s both;
}

.hero-board-glow {
    position: absolute;
    width: 130%;
    height: 130%;
    background:
        radial-gradient(ellipse 55% 55% at 42% 40%, rgba(37, 99, 235, 0.18) 0%, transparent 65%),
        radial-gradient(ellipse 45% 50% at 68% 66%, rgba(6, 182, 212, 0.16) 0%, transparent 65%);
    filter: blur(6px);
    pointer-events: none;
}

.hero-board {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--hairline);
    border-radius: 26px;
    box-shadow: var(--shadow-xl), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    backdrop-filter: blur(14px);
    transform: perspective(1100px) rotateX(5deg) rotateY(-7deg) rotate(1.5deg);
    animation: heroBoardFloat 7s ease-in-out infinite;
}

@keyframes heroBoardFloat {
    0%, 100% { transform: perspective(1100px) rotateX(5deg) rotateY(-7deg) rotate(1.5deg) translateY(0); }
    50%      { transform: perspective(1100px) rotateX(5deg) rotateY(-7deg) rotate(1.5deg) translateY(-12px); }
}

.hero-tile {
    width: clamp(74px, 7.6vw, 104px);
    height: clamp(74px, 7.6vw, 104px);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.5rem, 2vw, 2rem);
    animation: heroTileBob 5s ease-in-out infinite;
}

.hero-tile:nth-child(1) { animation-delay: 0.0s; }
.hero-tile:nth-child(2) { animation-delay: 0.6s; }
.hero-tile:nth-child(3) { animation-delay: 1.2s; }
.hero-tile:nth-child(4) { animation-delay: 1.8s; }
.hero-tile:nth-child(5) { animation-delay: 2.4s; }
.hero-tile:nth-child(6) { animation-delay: 3.0s; }
.hero-tile:nth-child(7) { animation-delay: 3.6s; }
.hero-tile:nth-child(8) { animation-delay: 4.2s; }
.hero-tile:nth-child(9) { animation-delay: 4.8s; }

@keyframes heroTileBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

.t-plain {
    background: var(--light-secondary);
    border: 1px solid var(--hairline);
    color: var(--gray-light);
}

.t-digit {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink-soft);
}

.t-xo { color: var(--accent-red); }

.t-brand {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.t-cta {
    background: var(--grad-cta);
    color: #fff;
    box-shadow: var(--shadow-cta);
    animation: heroTilePop 5s ease-in-out infinite;
}

@keyframes heroTilePop {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.07); }
}

.t-cyan  { background: rgba(6, 182, 212, 0.12);  border: 1px solid rgba(6, 182, 212, 0.25);  color: var(--accent-cyan); }
.t-green { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.25); color: var(--accent-green); }
.t-amber { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.28); color: var(--accent); }

/* Floating status chips over the board */
.hero-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink-soft);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    white-space: nowrap;
    z-index: 2;
}

.hero-chip-1 {
    top: 4%;
    right: -2%;
    animation: heroChipFloat 6s ease-in-out infinite;
}

.hero-chip-1 i { color: var(--accent); }

.hero-chip-2 {
    bottom: 7%;
    left: -4%;
    animation: heroChipFloat 6s ease-in-out 3s infinite;
}

.hero-chip-2 i { color: var(--primary); }

@keyframes heroChipFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}

/* ── Split-hero responsive ── */
@media screen and (max-width: 980px) {
    .hero--split { text-align: center; padding-top: 40px; min-height: 0; }
    .hero-inner { grid-template-columns: 1fr; gap: 56px; }
    .hero--split .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero--split .hero-cta { justify-content: center; }
    .hero-proof { justify-content: center; }
    .hero-visual { max-width: 420px; margin: 0 auto; }
    .hero--split .scroll-indicator { display: none; }
}

@media screen and (max-width: 480px) {
    .hero-proof { gap: 14px; }
    .hero-chip-1 { right: 0; }
    .hero-chip-2 { left: 0; }
    .hero-tile { border-radius: 14px; }
    .hero-board { gap: 10px; padding: 16px; border-radius: 20px; }
}

/* ============================================================
   FEATURED GAMES — instant-play grid under the hero
   ============================================================ */

.featured-section {
    padding: 110px 0 100px;
    background: var(--light-secondary);
    position: relative;
}

.featured-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.featured-section .section-header { margin-bottom: 56px; }

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.game-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 26px 24px 22px;
    background: var(--light);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.game-tile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tint, var(--primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-tile:hover {
    transform: translateY(-6px);
    border-color: var(--hairline-strong);
    box-shadow: var(--shadow-lg);
}

.game-tile:hover::after { opacity: 1; }

.game-tile-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--tint, var(--primary));
    background: color-mix(in srgb, var(--tint, var(--primary)) 11%, transparent);
    border: 1px solid color-mix(in srgb, var(--tint, var(--primary)) 22%, transparent);
    transition: transform 0.3s ease;
}

.game-tile:hover .game-tile-icon { transform: scale(1.08) rotate(-4deg); }

.game-tile-body h3 {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.game-tile-body p {
    font-size: 0.87rem;
    line-height: 1.55;
    color: var(--muted);
}

.game-tile-tag {
    align-self: flex-start;
    margin-top: auto;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: var(--light-tertiary);
    border: 1px solid var(--hairline);
    padding: 4px 10px;
    border-radius: var(--r-pill);
}

.game-tile-arrow {
    position: absolute;
    top: 26px;
    right: 22px;
    font-size: 0.8rem;
    color: var(--tint, var(--primary));
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.game-tile:hover .game-tile-arrow {
    opacity: 1;
    transform: translateX(0);
}

.featured-more {
    text-align: center;
    margin-top: 44px;
}

.featured-more-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: var(--r-pill);
    background: var(--dark);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background 0.25s ease;
}

.featured-more-link:hover {
    transform: translateY(-3px);
    background: var(--dark-secondary);
    box-shadow: var(--shadow-lg);
}

.featured-more-link i {
    font-size: 0.8rem;
    transition: transform 0.25s ease;
}

.featured-more-link:hover i { transform: translateX(3px); }

@media screen and (max-width: 1100px) {
    .featured-grid { grid-template-columns: repeat(3, 1fr); }
}

@media screen and (max-width: 820px) {
    .featured-grid { grid-template-columns: repeat(2, 1fr); }
    .featured-section { padding: 80px 0 72px; }
}

@media screen and (max-width: 480px) {
    .featured-grid { grid-template-columns: 1fr; gap: 14px; }
}
