/* Top clasament — the public page (/clasament, js/clasament.js). */
.cl-body {
    --cl-bg: #f7f4ee;
    --cl-surface: #ffffff;
    --cl-ink: #1f2430;
    --cl-muted: #5b6474;
    --cl-line: #e4ddd0;
    --cl-gold: #d97706;
    --cl-gold-soft: #fef3c7;
    --cl-me: #fff3cd;
    background: var(--cl-bg);
    color: var(--cl-ink);
}
body.dark-theme.cl-body {
    --cl-bg: #11151d;
    --cl-surface: #1a202b;
    --cl-ink: #eef1f6;
    --cl-muted: #a7b0bf;
    --cl-line: #2c3442;
    --cl-gold: #f59e0b;
    --cl-gold-soft: #3b2f12;
    --cl-me: #3a3214;
}
/* body already leaves 72px for the fixed navbar; the hero colour runs up under it */
.cl-main { padding-top: 0; }

.cl-hero { padding: 64px 0 34px; background: radial-gradient(ellipse at 15% 0%, rgba(245, 158, 11, .28), transparent 60%), linear-gradient(135deg, #3b1d06, #1f2937 70%); color: #fff; }
.cl-kicker { margin: 0 0 6px; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #fbbf24; }
.cl-hero h1 { margin: 0 0 14px; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.cl-hero h1 span { color: #fbbf24; }
.cl-lead { max-width: 760px; margin: 0; font-size: 1.05rem; opacity: .9; }
.cl-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.cl-stats li { padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; background: rgba(0, 0, 0, .2); font-size: .88rem; }
.cl-stats strong { font-size: 1rem; }

.cl-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 28px; padding-bottom: 12px; }
.cl-side { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 100px); padding: 14px; border: 1px solid var(--cl-line); border-radius: 18px; background: var(--cl-surface); }
.cl-search input, .cl-select { width: 100%; padding: 9px 12px; border: 1px solid var(--cl-line); border-radius: 12px; background: var(--cl-bg); color: var(--cl-ink); font: inherit; }
.cl-select { display: none; }
.cl-games { flex: 1; min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.cl-games button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: .92rem; text-align: left; cursor: pointer; }
.cl-games button:hover { background: var(--cl-gold-soft); }
.cl-games button[aria-current="true"] { background: var(--cl-gold); color: #1f1300; font-weight: 700; }
.cl-games .cl-games-all { font-weight: 800; }
.cl-games small { flex: none; font-size: .74rem; opacity: .7; }
.cl-games .cl-mine { margin-left: 4px; }

.cl-board { min-width: 0; padding: 20px; border: 1px solid var(--cl-line); border-radius: 18px; background: var(--cl-surface); box-shadow: 0 12px 34px rgba(20, 24, 33, .06); }
.cl-board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cl-board-head h2 { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.cl-board-sub { margin: 4px 0 0; color: var(--cl-muted); font-size: .92rem; }
.cl-play { flex: none; padding: 8px 16px; border-radius: 999px; background: var(--cl-gold); color: #1f1300 !important; font-weight: 800; text-decoration: none !important; white-space: nowrap; }
.cl-play[hidden], .cl-modes[hidden], .cl-me[hidden] { display: none !important; }
.cl-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.cl-modes button { padding: 6px 12px; border: 1px solid var(--cl-line); border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: .84rem; cursor: pointer; }
.cl-modes button[aria-selected="true"] { border-color: var(--cl-gold); background: var(--cl-gold-soft); font-weight: 700; }
.cl-modes small { opacity: .65; }
.cl-status { margin: 12px 0 8px; color: var(--cl-muted); font-size: .86rem; }

.cl-table-wrap { overflow-x: auto; }
.cl-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
.cl-table th { padding: 4px 10px; color: var(--cl-muted); font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.cl-table th.cl-num, .cl-table td.cl-num { text-align: right; white-space: nowrap; }
.cl-table td { padding: 9px 10px; border-top: 1px solid var(--cl-line); border-bottom: 1px solid var(--cl-line); background: var(--cl-bg); vertical-align: middle; }
.cl-table td:first-child { width: 54px; border-left: 1px solid var(--cl-line); border-radius: 12px 0 0 12px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.cl-table td:last-child { border-right: 1px solid var(--cl-line); border-radius: 0 12px 12px 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.cl-table tr.cl-top3 td { background: var(--cl-gold-soft); }
.cl-table tr.is-me td { border-color: var(--cl-gold); background: var(--cl-me); }
.cl-medal { font-size: 1.25rem; }
.cl-name { font-weight: 700; overflow-wrap: anywhere; }
.cl-places { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cl-places button { padding: 1px 8px; border: 1px solid var(--cl-line); border-radius: 999px; background: var(--cl-surface); color: inherit; font: inherit; font-size: .72rem; cursor: pointer; }
.cl-places button:hover { border-color: var(--cl-gold); }
.cl-empty td { padding: 22px; color: var(--cl-muted); text-align: center; border-radius: 12px !important; border: 1px dashed var(--cl-line) !important; }

.cl-me { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--cl-gold-soft); font-size: .92rem; }
.cl-me button { margin: 6px 6px 0 0; padding: 4px 12px; border: 1px solid var(--cl-gold); border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.cl-me form { display: flex; gap: 6px; margin-top: 8px; max-width: 420px; }
.cl-me input { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid var(--cl-line); border-radius: 10px; background: var(--cl-surface); color: var(--cl-ink); font: inherit; }
.cl-me .cl-error { display: block; margin-top: 4px; color: #dc2626; font-weight: 600; }
.cl-me .cl-note { display: block; margin-top: 4px; font-size: .78rem; opacity: .75; }

.cl-info { max-width: 900px; padding-top: 18px; padding-bottom: 48px; }
.cl-info h2 { font-size: 1.3rem; font-weight: 800; }
.cl-info li { margin-bottom: 6px; color: var(--cl-muted); }
.cl-info strong { color: var(--cl-ink); }

@media (max-width: 991px) {
    .cl-layout { grid-template-columns: minmax(0, 1fr); }
    .cl-side { position: static; max-height: none; padding: 0; border: 0; background: transparent; }
    .cl-search, .cl-games { display: none; }
    .cl-select { display: block; }
}
@media (max-width: 575px) {
    .cl-hero { padding: 44px 0 24px; }
    .cl-board { padding: 14px; }
    .cl-board-head { flex-direction: column; }
    .cl-table td { padding: 8px 6px; }
    .cl-table td:first-child { width: 40px; }
    .cl-hide-sm { display: none; }
}
/* the link to its twin page, Comunitate */
.cl-crosslink { margin: 1rem 0 0; }
.cl-crosslink a { display: inline-flex; align-items: center; padding: .45rem 1rem; border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; color: #fff; font-weight: 700; text-decoration: none; }
.cl-crosslink a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
