/* app/static/css/public.css - landing + rules pages */
body.public-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-page main {
    flex: 1;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.site-name {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-nav > a {
    color: var(--text-2);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.site-nav > a:hover {
    color: var(--text);
}

.site-nav .nav-cta {
    color: var(--brass-ink);
    background: linear-gradient(180deg, var(--brass-2), var(--brass));
    padding: 8px 14px;
    border-radius: 999px;
}

.site-nav .nav-cta:hover {
    color: var(--brass-ink);
}

/* Hero */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 420px);
    gap: 40px;
    align-items: center;
    padding: 40px 0 56px;
}

.hero h1 {
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.hero-lead {
    margin-top: 16px;
    font-size: 18px;
    color: var(--text-2);
    max-width: 580px;
}

.pills {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.pills li {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(67, 183, 122, 0.12);
    border: 1px solid rgba(67, 183, 122, 0.35);
    font-size: 14px;
    font-weight: 600;
}

.pills i {
    color: var(--success);
    margin-right: 4px;
}

.hero-cards {
    position: relative;
    height: 190px;
    margin-top: 30px;
}

.hero-cards .hc {
    --w: 104px;
    position: absolute;
    left: 110px;
    bottom: 0;
    width: var(--w);
    height: calc(var(--w) * 1.5983);
    border-radius: 9px;
    background: #fbf8ef url('/static/images/double.png') no-repeat;
    background-size: calc(var(--w) * 8) calc(var(--w) * 1.5983 * 4);
    background-position: calc(var(--col) * var(--w) * -1) calc(var(--row) * var(--w) * 1.5983 * -1);
    transform-origin: 50% 120%;
    transform: rotate(var(--r));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.hero-play {
    padding: 24px;
}

.play-title {
    font-size: 24px;
    text-align: center;
    margin-bottom: 16px;
}

/* Sections */
.section {
    padding: 36px 0;
    border-top: 1px solid var(--border);
}

.section > h2 {
    font-size: clamp(26px, 3.4vw, 34px);
    margin-bottom: 20px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.feature {
    padding: 20px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
}

.feature i {
    font-size: 22px;
    color: var(--brass-2);
}

.feature h3 {
    font-size: 19px;
    margin: 10px 0 6px;
}

.feature p {
    color: var(--text-2);
    font-size: 15px;
}

.howto {
    display: grid;
    gap: 10px;
    padding-left: 22px;
    color: var(--text-2);
    font-size: 16px;
    max-width: 760px;
}

.howto li::marker {
    color: var(--brass-2);
    font-weight: 700;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--brass-2);
    font-weight: 700;
    text-decoration: none;
}

.faq {
    display: grid;
    gap: 10px;
    max-width: 820px;
}

.faq details {
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 18px;
}

.faq summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
}

.faq details p {
    margin-top: 10px;
    color: var(--text-2);
}

.cta-band {
    text-align: center;
}

.cta-band p {
    color: var(--text-2);
    margin-bottom: 18px;
}

.cta-btn {
    display: inline-flex;
    width: auto;
    text-decoration: none;
    padding: 14px 28px;
}

/* Rules page */
.rules-page h1 {
    font-size: clamp(32px, 4.5vw, 48px);
}

.rules-body {
    margin-top: 24px;
    max-width: 820px;
    padding: 24px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
}

.rules-cta {
    margin-top: 24px;
}

.site-footer {
    text-align: center;
    padding: 26px 16px 36px;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

.site-footer a {
    color: var(--text-2);
}

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 16px;
    }

    .hero-cards {
        display: none;
    }
}

@media (max-width: 520px) {
    .site-nav > a:not(.nav-cta) {
        display: none;
    }

    .site-name {
        font-size: 22px;
    }
}

/* Leaderboard */
.lb-wrap {
    margin-top: 24px;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.lb {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.lb th,
.lb td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.lb th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lb .lb-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lb-rank {
    width: 48px;
    font-weight: 800;
    color: var(--text-2);
}

.lb-player {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--brass-2), var(--brass));
    color: var(--brass-ink);
    font-weight: 700;
}

.lb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lb-name {
    font-weight: 700;
}

.lb-wins {
    color: var(--brass-2);
    font-weight: 800;
}

.lb tr.me td {
    background: rgba(216, 167, 72, 0.12);
}

.lb tr.lb-gap td {
    text-align: center;
    color: var(--muted);
    padding: 4px;
}

.lb-legend {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.lb-empty {
    margin-top: 24px;
    padding: 28px;
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-2);
}

.rules-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.lb-google {
    width: auto;
    display: inline-flex;
}

@media (max-width: 600px) {
    .lb th:nth-child(5),
    .lb td:nth-child(5) {
        display: none;
    }

    .lb th,
    .lb td {
        padding: 10px 8px;
    }
}

/* Admin statistics */
.stats-page h2 {
    font-size: 24px;
    margin: 34px 0 0;
}

.stats-range {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.stats-range a {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}

.stats-range a.on {
    color: var(--brass-ink);
    background: linear-gradient(180deg, var(--brass-2), var(--brass));
    border-color: transparent;
}

.stats-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.stats-tile {
    padding: 14px 16px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
}

.stats-tile strong {
    display: block;
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stats-tile span {
    color: var(--muted);
    font-size: 13px;
}

.stats-days td {
    position: relative;
}

.stats-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: var(--w);
    background: var(--brass);
    border-radius: 2px;
}

.stats-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0 24px;
}

/* Alias pages (Faraón, Prší) */
.section-text,
.section-lead {
    max-width: 760px;
    color: var(--text-2);
    font-size: 16px;
}

.section-text + .section-text {
    margin-top: 12px;
}

.section-lead {
    margin-bottom: 18px;
}

.alias-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.alias-link {
    display: block;
    color: var(--text);
    text-decoration: none;
}

.alias-link:hover {
    border-color: var(--border-strong);
}

.alias-link h3 {
    margin-top: 0;
}

.alias-link h3 i {
    font-size: 14px;
    margin-left: 4px;
}

.cmp-wrap {
    margin-top: 0;
    max-width: 860px;
}

.lb.cmp th,
.lb.cmp td {
    white-space: normal;
    vertical-align: top;
}

.lb.cmp tbody th {
    color: var(--text);
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
}

.lb.cmp td:last-child {
    color: var(--brass-2);
    font-weight: 600;
}

.rules-faq-title {
    font-size: 26px;
    margin: 32px 0 16px;
}

.lb-title {
    font-size: 26px;
    margin-top: 34px;
}

.lb-title + .lb-wrap,
.lb-title + .lb-empty {
    margin-top: 14px;
}

.lb-sub {
    margin-top: 4px;
}

.lb-rank-title {
    display: block;
    color: var(--brass-2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
