:root {
    --bg: #050608;
    --bg-elevated: #0c0f14;
    --bg-card: #11151c;
    --text: #e8eaef;
    --text-muted: #9aa3b2;
    --accent: #e8c547;
    --accent-hover: #f0d56a;
    --accent-soft: rgba(232, 197, 71, 0.12);
    --line: rgba(255, 255, 255, 0.08);
    --info: #2a6fb0;
    --info-bg: rgba(42, 111, 176, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    --container: 1120px;
    --font:
        'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto,
        'Helvetica Neue', Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

/* Entry gate: puzzle before site content */
html:not(.gate-ok) {
    overflow: hidden;
    height: 100%;
}

html.gate-ok {
    overflow: auto;
    height: auto;
}

html.gate-ok #site-gate {
    display: none !important;
}

.site-gate {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: radial-gradient(ellipse 120% 80% at 50% 20%, rgba(232, 197, 71, 0.08), transparent),
        linear-gradient(180deg, #030405 0%, #050608 100%);
    border-bottom: 3px solid rgba(232, 197, 71, 0.35);
}

.site-gate-inner {
    width: 100%;
    max-width: 440px;
}

.site-gate .captcha-card {
    max-width: none;
    margin: 0;
    box-shadow: var(--shadow);
}

.site-gate .captcha-card h2 {
    font-size: 1.35rem;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.55em;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2rem, 4.2vw, 3.15rem);
}

h2 {
    font-size: clamp(1.55rem, 2.8vw, 2.15rem);
}

h3 {
    font-size: 1.2rem;
}

p {
    margin: 0 0 1em;
    color: var(--text-muted);
}

p:last-child {
    margin-bottom: 0;
}

.site-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* —— Very visible free-play warning —— */
.alert-free {
    position: relative;
    z-index: 1;
    background: linear-gradient(90deg, #e8c547 0%, #f5d45c 50%, #e8c547 100%);
    color: #0a0a0a;
    text-align: center;
    font-weight: 800;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    letter-spacing: 0.02em;
    padding: 0.75rem 1rem;
    border-bottom: 3px solid #0a0a0a;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.alert-free strong {
    display: inline-block;
    margin: 0 0.15em;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 6, 8, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    font-weight: 700;
    font-size: 0.95rem;
}

.brand-mark img {
    width: 40px;
    height: 40px;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.nav-main ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    align-items: center;
}

.nav-main a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nav-main a:hover,
.nav-main a.is-active {
    color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: #0a0a0a;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #0a0a0a;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Hero */
.hero {
    position: relative;
    padding: 3.5rem 1.25rem 4rem;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(232, 197, 71, 0.12), transparent),
        linear-gradient(180deg, #0a0c10 0%, var(--bg) 100%),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.03) 0,
            rgba(255, 255, 255, 0.03) 1px,
            transparent 1px,
            transparent 48px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.02) 0,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 48px
        );
    pointer-events: none;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: var(--container);
    margin: 0 auto;
    text-align: center;
}

.badge-pill {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(232, 197, 71, 0.35);
}

.hero h1 {
    color: var(--text);
}

.hero h1 .gold {
    color: var(--accent);
}

.hero-lead {
    max-width: 640px;
    margin: 0 auto 2rem;
    font-size: 1.05rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 720px;
    margin: 0 auto;
}

.stat {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
}

.stat strong {
    display: block;
    color: var(--accent);
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
}

.stat span {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Info strip */
.info-strip {
    max-width: var(--container);
    margin: 0 auto 3rem;
    padding: 0 1.25rem;
}

.info-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.15rem 1.35rem;
    border-radius: var(--radius);
    background: var(--info-bg);
    border: 1px solid rgba(42, 111, 176, 0.45);
}

.info-box .icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--info);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
}

.info-box p {
    color: var(--text);
    margin: 0;
    font-size: 0.95rem;
}

/* Sections */
.section {
    padding: 3.5rem 1.25rem;
}

.section-head {
    max-width: var(--container);
    margin: 0 auto 2rem;
    text-align: center;
}

.section-head h2 {
    color: var(--text);
}

.section-head p {
    max-width: 560px;
    margin: 0 auto;
}

/* Game cards */
.games-grid {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

a.game-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.game-card:hover .game-card-top h3 {
    color: var(--accent);
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(232, 197, 71, 0.35);
}

.game-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--line);
}

.game-card-top h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text);
}

.live-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(46, 160, 100, 0.2);
    color: #5ed69a;
    border: 1px solid rgba(94, 214, 154, 0.35);
}

.game-thumb-wrap {
    position: relative;
    height: 220px;
    background: #080a0d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.game-card p {
    padding: 1rem 1.1rem 1.25rem;
    margin: 0;
    font-size: 0.92rem;
}

.section-cta {
    text-align: center;
    margin-top: 2.25rem;
}

/* Features */
.features-grid {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.feature-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.35rem;
    text-align: center;
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    background: var(--accent-soft);
    border: 1px solid rgba(232, 197, 71, 0.25);
    display: grid;
    place-items: center;
    font-size: 1.35rem;
}

.feature-card h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    margin: 0;
}

/* Puzzle captcha (gate + inline if used) */
.captcha-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.35rem 1.75rem;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.captcha-card h2,
.captcha-card h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.captcha-card > p {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.puzzle-box {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 1rem;
    user-select: none;
    touch-action: none;
}

.puzzle-viewport {
    position: relative;
    height: 140px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--line);
    background: #0a0c10;
}

.puzzle-viewport img.puzzle-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    opacity: 0.38;
    filter: grayscale(0.25);
}

.puzzle-slot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 100%;
    max-height: 140px;
    border: 2px dashed rgba(232, 197, 71, 0.55);
    border-radius: 10px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 1;
}

.puzzle-piece {
    position: absolute;
    top: 0;
    left: var(--piece-x, 8px);
    width: 56px;
    height: 100%;
    border-radius: 10px;
    cursor: grab;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    border: 2px solid var(--accent);
    overflow: hidden;
    z-index: 2;
}

.puzzle-piece.is-dragging {
    cursor: grabbing;
    z-index: 5;
}

.puzzle-piece img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    pointer-events: none;
}

.puzzle-status {
    font-weight: 700;
    font-size: 0.9rem;
    min-height: 1.4em;
}

.puzzle-status.ok {
    color: #5ed69a;
}

.puzzle-status.err {
    color: #e07a7a;
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--bg-elevated);
    border-top: 1px solid var(--line);
    padding: 1rem 1.25rem;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
}

.cookie-banner.is-visible {
    display: flex;
}

.cookie-banner p {
    margin: 0;
    flex: 1;
    min-width: 200px;
    max-width: 560px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cookie-actions {
    display: flex;
    gap: 0.65rem;
}

.btn-small {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
}

/* Footer */
.site-footer {
    margin-top: auto;
    background: #030405;
    border-top: 1px solid var(--line);
}

.footer-main {
    max-width: var(--container);
    margin: 0 auto;
    padding: 3rem 1.25rem 2rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.footer-brand img {
    width: 44px;
    height: 44px;
}

.footer-brand p {
    font-size: 0.92rem;
    max-width: 320px;
}

.footer-col h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-support {
    border-top: 1px solid var(--line);
    background: var(--bg-elevated);
}

.footer-support-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.footer-support .shield {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(42, 111, 176, 0.25);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.footer-support p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.partner-row {
    max-width: var(--container);
    margin: 0 auto;
    padding: 1.75rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--line);
}

.partner-row a {
    display: block;
    opacity: 0.75;
    transition: opacity 0.15s ease;
    filter: grayscale(1);
}

.partner-row a:hover {
    opacity: 1;
    filter: grayscale(0);
}

.partner-row img {
    height: 36px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.footer-bottom {
    padding: 1rem 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container);
    margin: 0 auto;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-foot {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    border: 1px solid var(--line);
    color: var(--text-muted);
}

/* Inner pages */
.page-hero {
    padding: 2.5rem 1.25rem 2rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
}

.page-hero-inner {
    max-width: var(--container);
    margin: 0 auto;
}

.page-hero h1 {
    color: var(--text);
}

.page-content {
    max-width: var(--container);
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

.page-content h2 {
    color: var(--text);
    margin-top: 1.75rem;
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content ul {
    color: var(--text-muted);
    padding-left: 1.25rem;
}

.page-content li {
    margin-bottom: 0.5rem;
}

@media (max-width: 960px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-main {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(5, 6, 8, 0.98);
        border-bottom: 1px solid var(--line);
        padding: 1rem 1.25rem 1.25rem;
        display: none;
    }

    .nav-main.is-open {
        display: block;
    }

    .nav-main ul {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

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

    .footer-main {
        grid-template-columns: 1fr;
    }

    .header-actions .btn {
        display: none;
    }
}

@media (max-width: 520px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

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