:root {
    --tlo: #111214;
    --panel: #1e1f22;
    --panel-2: #2b2d31;
    --linia: #3a3c42;
    --tekst: #f2f3f5;
    --szary: #a5a9b1;
    --akcent: #5865f2;
    --akcent-jasny: #7983f5;
    --zloto: #f0b232;
    --srebro: #c0c7d1;
    --braz: #d18b4b;
    --promien: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--tlo);
    color: var(--tekst);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

.kontener { width: min(920px, 100% - 32px); margin-inline: auto; }

/* ---------- nagłówek ---------- */

.naglowek {
    background: var(--panel);
    border-bottom: 1px solid var(--linia);
    position: sticky; top: 0; z-index: 10;
}
.naglowek__wnetrze { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; }
.menu { display: flex; gap: 4px; }
.menu a { padding: 8px 14px; border-radius: 8px; color: var(--szary); font-weight: 600; font-size: .95rem; }
.menu a:hover { background: var(--panel-2); color: var(--tekst); }
.menu a.aktywny { background: var(--akcent); color: #fff; }

/* ---------- awatary ---------- */

.awatar {
    --r: 40px;
    position: relative;
    flex: none;
    width: var(--r); height: var(--r);
    border-radius: 50%;
    background: var(--akcent);
    display: inline-grid; place-items: center;
    overflow: hidden;
}
.awatar::before { content: attr(data-litera); font-weight: 700; color: #fff; font-size: calc(var(--r) * .42); }
.awatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.awatar--maly { --r: 34px; }
.awatar--duzy { --r: 84px; }
.awatar--profil { --r: 112px; box-shadow: 0 0 0 5px var(--akcent); }

/* ---------- nagłówek strony i statystyki ---------- */

.hero { padding: 40px 0 8px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 4vw, 2.3rem); }
.hero p { margin: 0; color: var(--szary); }

.statystyki { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 24px 0; }
.kafel { background: var(--panel); border: 1px solid var(--linia); border-radius: var(--promien); padding: 16px 18px; display: flex; flex-direction: column; }
.kafel__liczba { font-size: 1.5rem; font-weight: 800; }
.kafel__opis { color: var(--szary); font-size: .88rem; }

.znaczek {
    display: inline-block;
    background: rgba(88, 101, 242, .18);
    color: var(--akcent-jasny);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}
.znaczek--duzy { font-size: .9rem; padding: 4px 12px; }
.znaczek--szary { background: var(--panel-2); color: var(--szary); }

/* ---------- podium ---------- */

.podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas: "drugi pierwszy trzeci";
    align-items: end;
    gap: 14px;
    margin: 32px 0 28px;
}
.podium__miejsce {
    background: var(--panel);
    border: 1px solid var(--linia);
    border-radius: var(--promien);
    padding: 22px 12px 18px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center;
    transition: transform .15s, border-color .15s;
}
.podium__miejsce:hover { transform: translateY(-3px); border-color: var(--akcent); }
.podium__miejsce--1 { grid-area: pierwszy; padding-top: 36px; border-color: var(--zloto); background: linear-gradient(180deg, rgba(240,178,50,.14), var(--panel) 60%); }
.podium__miejsce--2 { grid-area: drugi; }
.podium__miejsce--3 { grid-area: trzeci; }
.podium__miejsce--1 .awatar { box-shadow: 0 0 0 4px var(--zloto); }
.podium__miejsce--2 .awatar { box-shadow: 0 0 0 4px var(--srebro); }
.podium__miejsce--3 .awatar { box-shadow: 0 0 0 4px var(--braz); }
.podium__medal { font-size: 1.8rem; line-height: 1; }
.podium__nazwa { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__punkty { color: var(--szary); font-weight: 600; }

/* ---------- tabela ---------- */

.tabela { display: flex; flex-direction: column; gap: 6px; margin-bottom: 40px; }
.wiersz {
    display: grid;
    grid-template-columns: 52px 40px 1fr auto auto;
    align-items: center;
    gap: 14px;
    background: var(--panel);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 16px;
}
.wiersz:hover { border-color: var(--linia); background: var(--panel-2); }
.wiersz__miejsce { color: var(--szary); font-weight: 700; }
.wiersz--top .wiersz__miejsce { color: var(--zloto); }
.wiersz__nazwa { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiersz__nazwa small { color: var(--szary); font-weight: 400; margin-left: 6px; }
.wiersz__punkty { font-weight: 800; text-align: right; min-width: 90px; }
.wiersz__punkty small { color: var(--szary); font-weight: 600; }

.pusto { color: var(--szary); text-align: center; padding: 48px 0; }

/* ---------- profil ---------- */

.wstecz { display: inline-block; margin: 28px 0 16px; color: var(--akcent-jasny); font-weight: 600; }
.wstecz:hover { text-decoration: underline; }

.karta { background: var(--panel); border: 1px solid var(--linia); border-radius: 18px; padding: 28px; margin-bottom: 40px; }
.karta__gora { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.karta__gora h1 { margin: 0 0 8px; font-size: 1.9rem; word-break: break-word; }
.karta__gora .znaczek { margin-right: 6px; }
.karta__miejsce { margin-left: auto; font-size: 2.4rem; font-weight: 800; color: var(--akcent-jasny); text-align: right; line-height: 1.1; }
.karta__miejsce small { display: block; font-size: .75rem; color: var(--szary); letter-spacing: .1em; }

.postep { margin-top: 28px; }
.postep__opis { display: flex; justify-content: space-between; gap: 12px; color: var(--szary); font-size: .92rem; margin-bottom: 8px; flex-wrap: wrap; }
.postep__opis b { color: var(--tekst); }
.postep__pasek { height: 14px; background: var(--tlo); border-radius: 999px; overflow: hidden; }
.postep__wypelnienie { height: 100%; background: linear-gradient(90deg, var(--akcent), var(--akcent-jasny)); border-radius: 999px; }

.statystyki--karta { margin-bottom: 0; }
.statystyki--karta .kafel { background: var(--panel-2); border-color: transparent; }

.stopka { color: var(--szary); font-size: .85rem; text-align: center; padding: 24px 0 40px; }

/* ---------- telefony ---------- */

@media (max-width: 640px) {
    .menu a { padding: 6px 10px; font-size: .88rem; }
    .logo span:last-child { display: none; }
    .podium { gap: 8px; }
    .podium__miejsce { padding: 16px 6px 12px; }
    .awatar--duzy { --r: 60px; }
    .podium .znaczek { display: none; }
    .wiersz { grid-template-columns: 36px 36px 1fr auto; gap: 10px; padding: 10px 12px; }
    .wiersz .awatar { --r: 36px; }
    .wiersz__ranga { display: none; }
    .wiersz__punkty { min-width: 0; }
    .karta { padding: 20px; }
    .karta__miejsce { margin-left: 0; text-align: left; }
}
