:root {
    --bg: #f5f1ea;
    --card-bg: #ffffff;
    --card-border: #e8e2d6;
    --text: #1a1815;
    --text-muted: #6b6459;
    --accent: #b8763a;
    --accent-bg: #fbeee0;
    --pill-secondary-bg: #f0ebe1;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-pill: 999px;
    --shadow: 0 10px 30px rgba(26, 24, 21, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.4;
}

a { color: inherit; text-decoration: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0;
    border-bottom: 1px solid var(--card-border);
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
}
.logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text);
    display: inline-block;
}
.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
    font-size: 15px;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.tg-icon { width: 18px; height: 18px; vertical-align: -4px; margin-right: 2px; }
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--card-border); }
.btn-secondary:hover { background: var(--pill-secondary-bg); }
.btn-small { padding: 9px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Hero */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 64px 0;
}
.hero-eyebrow {
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 14px;
}
.hero h1 {
    font-size: 46px;
    line-height: 1.1;
    margin: 0 0 20px;
}
.hero p {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 460px;
    margin: 0 0 28px;
}
.hero-actions { display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.hero-proof { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-muted); }
.hero-image-wrap {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 420px;
    background: linear-gradient(135deg, #e9e2d3, #d8cfb9);
}
.hero-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Avatar stack */
.avatar-stack { display: flex; }
.avatar-stack .avatar, .avatar-stack .avatar-img {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--pill-secondary-bg);
    border: 2px solid #fff;
    margin-left: -10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    overflow: hidden;
    object-fit: cover;
}
.avatar-stack .avatar:first-child, .avatar-stack .avatar-img:first-child { margin-left: 0; }

.avatar-img { object-fit: cover; }
.avatar-initial { background: var(--pill-secondary-bg); }

.organizer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    font-size: 13px;
    color: var(--text-muted);
}
.organizer-row .avatar-img, .organizer-row .avatar {
    width: 24px; height: 24px; border-radius: 50%; object-fit: cover;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; background: var(--pill-secondary-bg); color: var(--text-muted);
    flex-shrink: 0;
}

/* Sections */
.section { padding: 8px 0 48px; }
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}
.section-header h2 { font-size: 20px; margin: 0; }
.section-header a { color: var(--accent); font-size: 14px; font-weight: 600; }

.games-clubs-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

/* Match card */
.match-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.match-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 18px;
}
.match-card h3 { font-size: 16px; margin: 0 0 4px; }
.match-card .meta { font-size: 13px; color: var(--text-muted); margin: 6px 0; display: flex; align-items: center; gap: 6px; }
.match-card .players-row { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; }
.match-card .players-count { font-size: 13px; color: var(--text-muted); }

/* Club card (sidebar list) */
.club-list { display: flex; flex-direction: column; gap: 14px; }
.club-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px;
}
.club-card .club-thumb {
    width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
    background: var(--pill-secondary-bg);
}
.club-card .club-name { font-weight: 600; font-size: 14px; }
.club-card .club-address { font-size: 12px; color: var(--text-muted); }
.club-card .club-count { margin-left: auto; text-align: right; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.club-card .club-count b { color: var(--text); }

/* Grid of clubs on /clubs page */
.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* Club rotator (главная, сайдбар "Популярные клубы") — столбик, но видно только 3
   за раз, набор автоматически меняется по таймеру (см. app.js). */
.club-rotator-item { display: none; animation: club-fade-in 0.4s ease; }
.club-rotator-item.is-active { display: block; }
@keyframes club-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bottom CTA */
.cta-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 56px;
}
.cta-banner p { margin: 0; font-size: 16px; }

/* Ad slot placeholder */
.ad-slot {
    border: 1px dashed var(--card-border);
    border-radius: var(--radius-md);
    padding: 28px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Forms */
.form-card {
    max-width: 480px;
    margin: 48px auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 32px;
}
.form-card h1 { font-size: 22px; margin: 0 0 24px; }
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-field input, .form-field select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    font-size: 15px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
}
.form-error {
    background: var(--accent-bg);
    color: var(--accent);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 18px;
}
.form-notice { font-size: 13px; color: var(--text-muted); margin-top: 14px; }

.empty-state { color: var(--text-muted); font-size: 14px; padding: 24px 0; }

.site-footer {
    border-top: 1px solid var(--card-border);
    padding: 24px 0 40px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; }
    .games-clubs-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 34px; }
    .nav-links { display: none; }
}
