/* Mobile-first optimized CSS */

:root {
    --primary: #292929;
    --accent: #fe792f;
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --error: #ef4444;
    --success: #22c55e;

    --header-h: 64px; /* высота шапки на мобиле */
}

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

:focus-visible {
    outline: 2px solid rgba(254, 121, 47, 0.9);
    outline-offset: 2px;
}

body {
    font-family: "Unbounded", sans-serif;
    background-color: var(--primary);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    background-image: radial-gradient(rgba(254, 121, 47, 0.1) 1px, transparent 1px);
    background-size: 8px 28px;

    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.9rem;
}

.stat-num {
    color: #fe792f;
}


.players {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 600;
    position: absolute;
    right: .001rem;
    top: 50%;
    transform: translateY(-50%)
}

.players__icon {
    width: 17px;
    height: 16px
}

.players__title {
    font-size: 1rem
}

.players__value {
    display: flex;
    align-items: center;
    background-color: rgba(0,0,0,.25);
    padding: 4px 8px;
    border-radius: 12px
}

.players__value-current,.players__value-max {
    font-weight: 700
}

.players__value-separator {
    margin: 0 4px;
    color: rgba(255,255,255,.5)
}


/* Header */
header {
    background-color: rgba(26, 26, 26, 0.5);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);

    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.15rem;
    z-index: 101;
}

/* Nav */
nav {
    position: fixed;
    inset: 0;
    top: var(--header-h);
    right: 0;
    width: 100%;
    height: calc(100vh - var(--header-h));

    background-color: var(--primary);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;

    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 99;

    padding: 1.25rem;
}

nav.active {
    transform: translateX(0);
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;

    font-size: 1.15rem;
    width: 100%;
    text-align: center;

    padding: 0.25rem 0.15rem;
}

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

/* Mobile menu button */
.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;

    padding: 0.5rem;
    border-radius: 0.6rem;

    z-index: 101;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Desktop-only button block (в index.html это desktop-buttons) */
.desktop-buttons {
    display: none;
}

/* Buttons */
.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.8rem 1rem;
    border-radius: 0.6rem;
    text-decoration: none;
    cursor: pointer;

    font-family: "Unbounded", sans-serif;
    font-weight: 500;
    white-space: nowrap;

    min-height: 44px; /* удобно на смартфонах */

    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    border: 0;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--text);
}

.btn-primary:hover {
    background-color: rgba(254, 121, 47, 0.9);
    transform: translateY(-1px);
}

.btn-outline {
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--accent);
    color: var(--text);
}

/* Home */
.home {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 0;
}

.title-3d {
    font-size: 2.2rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1.25rem;
    cursor: default;
    user-select: none;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    align-items: stretch;
    justify-content: center;
}

.buttons a {
    width: 100%;
    text-align: center;
}

/* Get Started */
.get-started {
    padding: 2.5rem 0;
}

.get-started h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.75rem;
}

.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.step-card {
    background-color: rgba(26, 26, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    border-radius: 0.95rem;
    transition: transform 0.2s ease;
}

.step-card h3 {
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.step-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Payment */
.payment {
    padding: 2.5rem 0;
}

.payment-form {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;

    background-color: rgba(26, 26, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    border-radius: 0.95rem;
}

.payment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.payment-header h1 {
    font-size: 1.6rem;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(34, 197, 94, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
}

.secure-text {
    color: var(--success);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
}

.payment-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.input-group input {
    width: 100%;
    padding: 0.95rem 2.75rem 0.95rem 2.7rem;
    background-color: rgba(26, 26, 26, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.6rem;
    color: var(--text);

    font-family: "Unbounded", sans-serif;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.input-group input:invalid {
    border-color: var(--error);
}

/* Tooltip: будет работать только если .error-tooltip сразу после input (adjacent sibling) */
.error-tooltip {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: help;

    opacity: 0;
    transition: opacity 0.2s ease;
}

.input-group input:invalid + .error-tooltip {
    opacity: 1;
}

.error-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;

    background-color: var(--error);
    color: var(--text);

    padding: 0.45rem 0.6rem;
    border-radius: 0.35rem;

    font-size: 0.8rem;
    white-space: nowrap;

    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.input-group input:invalid + .error-tooltip::before {
    opacity: 1;
    transform: translateY(0);
}

.terms {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding-top: 0.25rem;
    flex-wrap: wrap;
}

.terms-link {
    color: var(--accent);
    text-decoration: underline;
}

/* Payment Error */
.payment-error {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 0;
}

.error-content {
    text-align: center;
    max-width: 600px;
    padding: 0 0.75rem;
}

.error-content h1 {
    font-size: 2.1rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.error-content h1::after {
    content: "";
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--error);
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.error-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-direction: column;
}

.error-buttons a {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    text-align: center;
}

/* Footer */
footer {
    background-color: rgba(26, 26, 26, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.75rem 0;
    margin-top: auto;
}

footer .container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.footer-section h3 {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.contact-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Desktop overrides */
@media (min-width: 769px) {
    :root {
        --header-h: 80px;
    }

    .menu-toggle {
        display: none;
    }

    /* nav: на десктопе не фиксируем, чтобы не перекрывал контент */
    nav {
        position: static;
        inset: auto;
        transform: none;
        width: auto;
        height: auto;

        background: transparent;

        flex-direction: row;
        justify-content: center;
        padding: 0;
        gap: 2rem;
    }

    nav.active {
        transform: none;
    }

    nav a {
        font-size: 1rem;
        width: auto;
        text-align: left;
        padding: 0;
    }

    .desktop-buttons {
        display: block;
    }

    .title-3d {
        font-size: 4rem;
        margin-bottom: 2rem;
    }

    .home {
        padding: 4rem 0;
    }

    .buttons {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
    }

    .buttons a {
        width: auto;
        text-align: center;
    }

    .get-started {
        padding: 4rem 0;
    }

    .get-started h1 {
        font-size: 2.5rem;
        margin-bottom: 3rem;
    }

    .steps {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }

    .step-card {
        padding: 2rem;
        border-radius: 1rem;
    }

    .payment {
        padding: 4rem 0;
    }

    .payment-form {
        padding: 2rem;
        border-radius: 1rem;
    }

    .payment-header h1 {
        font-size: 2rem;
    }

    .payment-error {
        padding: 4rem 0;
    }

    .error-content h1 {
        font-size: 2.5rem;
    }

    .error-buttons {
        flex-direction: row;
        gap: 1rem;
    }

    footer .container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 2rem;
    }
}

/* Hover effects only when appropriate */
@media (hover: hover) and (pointer: fine) {
    .title-3d:hover {
        transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
        transition: transform 0.3s ease;
    }

    .step-card:hover {
        transform: translateY(-5px);
    }

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}