/* ============================================
   CHLASTMAPA
   Light craft theme — warm paper, terracotta accents
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&family=Outfit:wght@300;400;500;600&display=swap');

:root {
    --cream: #faf7f2;
    --warm-white: #ffffff;
    --paper: #f5f0e8;
    --sand: #e8e0d4;

    --ink: #1a1612;
    --ink-light: #3d3529;
    --ink-muted: #7a7062;
    --ink-faint: #b0a898;
    --ink-ghost: #d4cec4;

    --terra: #b83a14;
    --terra-dark: #932f10;
    --terra-light: #e8693f;
    --terra-bg: #fdf0ec;

    --forest: #2d6a4f;
    --forest-bg: #ecf5f0;

    --border: #e2dbd0;
    --border-light: #ede8e0;

    --radius: 8px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(26,22,18,.06);
    --shadow-md: 0 2px 8px rgba(26,22,18,.08), 0 1px 3px rgba(26,22,18,.06);
    --shadow-lg: 0 8px 24px rgba(26,22,18,.1);

    --ease: cubic-bezier(.25,.1,.25,1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    line-height: 1.2;
    color: var(--ink);
}

a { color: var(--terra); text-decoration: none; }
a:hover { color: var(--terra-dark); }

::selection { background: var(--terra); color: #fff; }

img { max-width: 100%; }

/* ---- Navbar ---- */

.nav {
    background: var(--warm-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
}
.nav-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fraunces', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink) !important;
}
.nav-brand svg { color: var(--terra); }

.nav-links {
    display: flex;
    gap: 2px;
    list-style: none;
    padding: 0;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    color: var(--ink-muted) !important;
    transition: all .15s var(--ease);
}
.nav-link:hover { color: var(--ink) !important; background: var(--paper); }
.nav-link.active { color: var(--terra) !important; background: var(--terra-bg); }
.nav-link svg { width: 16px; height: 16px; }

/* Nav menu (desktop: flex row, mobile: slide-down panel) */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: space-between;
    margin-left: 24px;
}
.nav-menu-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-menu-divider { display: none; }
.nav-auth-btns { display: flex; gap: 6px; }

/* Language Switcher */
.lang-switch { margin-right: 8px; }
.lang-select {
    padding: 5px 10px;
    font-size: .78rem;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--warm-white);
    color: var(--ink-muted);
    cursor: pointer;
    appearance: auto;
    transition: border-color .15s;
}
.lang-select:focus { outline: none; border-color: var(--terra); }
.lang-select:hover { border-color: var(--ink-ghost); color: var(--ink); }

/* User dropdown — click based */
.nav-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s;
}
.nav-user:hover { border-color: var(--border); }
.nav-user.open { border-color: var(--border); background: var(--paper); }
.nav-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-avatar-ph {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--terra);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
}
.nav-user-name {
    font-size: .875rem;
    font-weight: 500;
    color: var(--ink);
}
.nav-chevron {
    width: 14px; height: 14px;
    color: var(--ink-faint);
    transition: transform .2s;
}
.nav-user.open .nav-chevron { transform: rotate(180deg); }

.dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--warm-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    min-width: 190px;
    box-shadow: var(--shadow-lg);
    z-index: 999;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    color: var(--ink-muted);
    font-size: .875rem;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--paper); color: var(--ink); }
.dropdown-sep { height: 1px; background: var(--border-light); margin: 4px 0; }
.dropdown svg { width: 15px; height: 15px; }

/* Mobile nav */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--ink-muted);
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}
.nav-toggle-close { display: none; }

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

    .nav-menu {
        display: none;
        position: fixed;
        top: 64px;
        left: 0; right: 0; bottom: 0;
        flex-direction: column;
        background: var(--warm-white);
        margin: 0;
        padding: 16px 20px;
        gap: 0;
        overflow-y: auto;
        z-index: 100;
        border-top: 1px solid var(--border);
        justify-content: flex-start;
    }
    .nav-menu.open { display: flex; }

    .nav-links {
        flex-direction: column;
        gap: 2px;
        width: 100%;
        padding: 0;
    }
    .nav-link {
        padding: 12px 14px;
        font-size: .95rem;
    }

    .nav-menu-divider {
        display: block;
        height: 1px;
        background: var(--border-light);
        margin: 12px 0;
        width: 100%;
    }

    .nav-menu-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    .lang-switch { margin: 0; }
    .lang-select { width: 100%; padding: 10px 14px; font-size: .9rem; }

    .nav-user {
        width: 100%;
        padding: 10px 14px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }
    .nav-user-name { display: block; }

    .dropdown {
        position: static;
        box-shadow: none;
        border: none;
        padding: 4px 0 0 42px;
        min-width: 0;
    }

    .nav-auth-btns {
        flex-direction: column;
        gap: 8px;
    }
    .nav-auth-btns .btn { justify-content: center; padding: 12px; font-size: .9rem; }
}

/* ---- Container ---- */

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

.page {
    padding: 40px 0 80px;
    min-height: calc(100vh - 64px - 60px);
}

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s var(--ease);
    text-decoration: none;
    line-height: 1.4;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--terra);
    color: #fff;
    border-color: var(--terra);
}
.btn-primary:hover { background: var(--terra-dark); border-color: var(--terra-dark); color: #fff; }

.btn-outline {
    background: var(--warm-white);
    color: var(--ink);
    border-color: var(--border);
}
.btn-outline:hover { border-color: var(--ink-ghost); background: var(--paper); color: var(--ink); }

.btn-ghost {
    background: none;
    color: var(--ink-muted);
    border: none;
    padding: 9px 14px;
}
.btn-ghost:hover { color: var(--ink); background: var(--paper); }

.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 13px 26px; font-size: .95rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Cards ---- */

.card {
    background: var(--warm-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .2s var(--ease), border-color .2s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border); }
.card-body { padding: 22px; }
.card-img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    padding: 20px;
    background: var(--paper);
}

/* ---- Grid ---- */

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

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

/* ---- Hero ---- */

.hero {
    text-align: center;
    padding: 72px 0 56px;
}
.hero h1 {
    font-size: 3rem;
    margin-bottom: 14px;
    font-weight: 300;
    font-style: italic;
    letter-spacing: -0.02em;
}
.hero h1 em {
    font-weight: 600;
    font-style: normal;
    color: var(--terra);
}
.hero p {
    font-size: 1.1rem;
    color: var(--ink-muted);
    max-width: 460px;
    margin: 0 auto 28px;
    line-height: 1.7;
}
.hero-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ---- Stats ---- */

.stat-card {
    background: var(--warm-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}
.stat-val {
    font-family: 'Fraunces', serif;
    font-size: 2.2rem;
    font-weight: 300;
    color: var(--terra);
}
.stat-lbl {
    font-size: .75rem;
    font-weight: 600;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 4px;
}

/* ---- Section Header ---- */

.sh {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 22px;
}
.sh h1, .sh h2, .sh h3 { margin: 0; }
.sh h1 { font-size: 2rem; }

/* ---- Badges ---- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.badge svg { width: 11px; height: 11px; }
.badge-terra { background: var(--terra-bg); color: var(--terra); }
.badge-stone { background: var(--paper); color: var(--ink-muted); }
.badge-green { background: var(--forest-bg); color: var(--forest); }

/* ---- Stars ---- */

.stars { display: inline-flex; gap: 1px; color: var(--terra); }
.stars svg { width: 15px; height: 15px; }
.star-off { color: var(--ink-ghost); }

/* ---- Tables ---- */

.tbl-wrap {
    background: var(--warm-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
table th {
    text-align: left;
    padding: 10px 16px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
}
table td {
    padding: 11px 16px;
    font-size: .875rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--ink-light);
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: rgba(0,0,0,.015); }

/* ---- Filter Bar ---- */

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.fi {
    flex: 1;
    min-width: 160px;
    padding: 9px 14px;
    background: var(--warm-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .875rem;
    color: var(--ink);
    transition: border-color .15s;
}
.fi:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-bg); }
select.fi { appearance: auto; }

/* ---- Forms ---- */

.fg { margin-bottom: 18px; }
.fl {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--ink-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.finput {
    width: 100%;
    padding: 10px 14px;
    background: var(--warm-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .9rem;
    color: var(--ink);
    transition: border-color .15s;
}
.finput:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-bg); }
textarea.finput { resize: vertical; min-height: 80px; }
select.finput { appearance: auto; width: 100%; box-sizing: border-box; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---- Auth Card ---- */

.auth-wrap { max-width: 440px; margin: 56px auto; }
.auth-wrap .card-body { padding: 36px; }
.auth-wrap h2 { text-align: center; margin: 0 0 6px; font-size: 1.6rem; }
.auth-sub { text-align: center; color: var(--ink-muted); margin-bottom: 28px; font-size: .9rem; }
.auth-sep {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    color: var(--ink-faint);
    font-size: .8rem;
}
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px;
    background: var(--warm-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--ink);
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}
.btn-google:hover { border-color: var(--ink-ghost); background: var(--paper); color: var(--ink); }

/* ---- Alert ---- */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .875rem;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; }
.alert-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* ---- Rating Card ---- */

.rc {
    background: var(--warm-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin-bottom: 10px;
    transition: box-shadow .2s;
}
.rc:hover { box-shadow: var(--shadow-sm); }
.rc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.rc-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rc-av {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--sand);
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
}
.rc-meta {
    font-size: .78rem;
    color: var(--ink-faint);
    margin-top: 10px;
    display: flex;
    gap: 14px;
}
.rc-meta span { display: flex; align-items: center; gap: 4px; }
.rc-meta svg { width: 13px; height: 13px; }

/* ---- Breadcrumb ---- */

.bc {
    display: flex;
    gap: 6px;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
    font-size: .85rem;
    color: var(--ink-faint);
}
.bc a { color: var(--ink-muted); }
.bc a:hover { color: var(--terra); }
.bc svg { width: 14px; height: 14px; }

/* ---- Profile ---- */

.prof-card {
    text-align: center;
    padding: 36px 22px;
}
.prof-av {
    width: 96px; height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--terra);
    margin-bottom: 14px;
}
.prof-av-ph {
    width: 96px; height: 96px;
    border-radius: 50%;
    background: var(--terra);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 14px;
}

/* ---- Leaderboard ---- */

.lb-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--border-light);
}
.lb-row:last-child { border-bottom: none; }
.lb-rank {
    font-family: 'Fraunces', serif;
    font-size: 1.2rem;
    color: var(--ink-faint);
    min-width: 28px;
    text-align: center;
}
.lb-row:nth-child(1) .lb-rank { color: #d97706; }
.lb-row:nth-child(2) .lb-rank { color: #6b7280; }
.lb-row:nth-child(3) .lb-rank { color: #92400e; }
.lb-user { display: flex; align-items: center; gap: 10px; flex: 1; }
.lb-pts {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem;
    color: var(--terra);
}

/* ---- Map ---- */

#map { border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.map-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: .8rem;
    color: var(--ink-muted);
}
.map-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

/* ---- Pagination ---- */

.pag {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 28px;
    list-style: none;
    padding: 0;
}
.pag a, .pag span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: var(--radius);
    font-size: .85rem;
    font-weight: 500;
    color: var(--ink-muted);
    border: 1px solid var(--border);
    transition: all .15s;
}
.pag a:hover { background: var(--paper); color: var(--ink); border-color: var(--border); }
.pag .active { background: var(--terra); color: #fff; border-color: var(--terra); }
.pag svg { width: 15px; height: 15px; }

/* ---- Footer ---- */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--warm-white);
    padding: 40px 0 0;
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 32px;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }
.footer-brand p { max-width: 280px; line-height: 1.6; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links-title {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--ink-faint); margin-bottom: 4px;
}
.footer-links a { font-size: .85rem; color: var(--ink-muted); }
.footer-links a:hover { color: var(--terra); }
.footer-company p { line-height: 1.7; }
.footer-socials { display:flex; gap:10px; margin-top:12px; }
.footer-socials a {
    display:flex; align-items:center; justify-content:center;
    width:32px; height:32px; border-radius:50%;
    background:var(--paper); color:var(--ink-faint);
    transition:all .15s;
}
.footer-socials a:hover { background:var(--terra); color:#fff; }
.footer-copy {
    border-top: 1px solid var(--border-light);
    margin-top: 28px;
    padding: 16px 0;
    text-align: center;
    font-size: .75rem;
    color: var(--ink-faint);
}

/* ---- Cookie Banner ---- */

.cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 380px;
}
.cookie-inner {
    background: var(--warm-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 8px 30px rgba(26,22,18,.12);
}

/* ---- Legal Pages ---- */

.legal-page {
    max-width: 700px;
    margin: 0 auto;
}
.legal-page h1 { font-size: 2rem; margin-bottom: 8px; }
.legal-page h3 {
    font-size: 1.1rem;
    margin: 28px 0 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}
.legal-page h3:first-of-type { border-top: none; padding-top: 0; }
.legal-page p { font-size: .9rem; color: var(--ink-light); line-height: 1.7; }
.legal-page ul { padding-left: 20px; margin: 10px 0; }
.legal-page li { font-size: .9rem; color: var(--ink-light); line-height: 1.7; margin-bottom: 4px; }
.legal-rights { display: flex; flex-direction: column; gap: 12px; }
.legal-right {
    background: var(--paper);
    border-radius: var(--radius);
    padding: 14px 18px;
}
.legal-right strong { font-size: .9rem; color: var(--ink); }
.legal-right p { font-size: .85rem; margin: 4px 0 0; }

/* ---- Utils ---- */

.text-muted { color: var(--ink-muted); }
.text-faint { color: var(--ink-faint); }
.text-terra { color: var(--terra); }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .75rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.fw-500 { font-weight: 500; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.anim { animation: fadeUp .45s var(--ease) both; }
.anim-d1 { animation-delay: .08s; }
.anim-d2 { animation-delay: .16s; }
.anim-d3 { animation-delay: .24s; }
