@import url('https://fonts.googleapis.com/css2?family=Anton&family=Barlow:ital,wght@0,400;0,500;0,600;0,700;0,800;1,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap');
@import url('https://fonts.googleapis.com/css2?family=League+Gothic&display=swap');

/* =========================================================
   Polish Fans Rework — fundament (tokeny, typografia, UI)
   ========================================================= */

:root {
    --ink:        #0a0b0c;
    --ink-alt:    #101314;
    --ink-dark:   #060708;
    --panel:      #14181a;
    --panel-2:    #191e20;
    --cream:      #f3efe6;
    --red:        #e21d2c;
    --red-soft:   #ff5e69;
    --red-deep:   #8e1019;
    --line:       rgba(243, 239, 230, .14);
    --line-soft:  rgba(243, 239, 230, .08);
    --muted:      rgba(243, 239, 230, .62);
    --muted-2:    rgba(243, 239, 230, .42);

    --shell:      1200px;
    --radius:     4px;

    --display: 'League Gothic';
    --body:    'Barlow', -apple-system, 'Segoe UI', Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    -webkit-text-size-adjust: 100%;
    /* Pozwala animować przejście do wysokości auto (rozwijanie FAQ). */
    interpolate-size: allow-keywords;
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--cream);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

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

:focus-visible {
    outline: 2px solid var(--red-soft);
    outline-offset: 3px;
}

/* ---------- Layout ---------- */

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: 28px;
}

.section {
    padding: 110px 0;
    position: relative;
}

.section--alt  { background: var(--ink-alt); }
.section--dark { background: var(--ink-dark); }

.section + .section { border-top: 1px solid var(--line-soft); }

/* ---------- Typografia ---------- */

.section-head {
    max-width: 640px;
    margin: 0 auto 52px;
    text-align: center;
}

.section-head--left {
    margin-left: 0;
    margin-right: 0;
    text-align: left;
    max-width: 760px;
}

.section-head h2 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(38px, 5.6vw, 66px);
    line-height: .92;
    letter-spacing: .01em;
    text-transform: uppercase;
    margin: 0;
}

.section-head p {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 15px;
    max-width: 56ch;
}

h1, h2, h3 { text-wrap: balance; }

/* ---------- Przyciski ---------- */

.button {
    --btn-shadow: var(--red-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 26px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--red);
    color: #fff;
    font: 800 12.5px/1 var(--body);
    letter-spacing: .14em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--btn-shadow);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

.button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--btn-shadow);
}

.button:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--btn-shadow); }

.button--roblox { background: var(--red); }

.button--ghost {
    background: transparent;
    border-color: rgba(243, 239, 230, .5);
    color: var(--cream);
    box-shadow: none;
}

.button--ghost:hover {
    background: var(--cream);
    color: var(--ink);
    transform: none;
    box-shadow: none;
}

.button--block { width: 100%; }

.button[disabled],
.button.is-disabled {
    opacity: .45;
    pointer-events: none;
    box-shadow: none;
}

/* ---------- Tagi / drobne ---------- */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(10, 11, 12, .5);
    backdrop-filter: blur(4px);
}

.tag--live {
    border-color: rgba(226, 29, 44, .55);
    color: #ffd7da;
    background: rgba(226, 29, 44, .16);
}

.tag--live::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 0 rgba(226, 29, 44, .7);
    animation: pf-pulse 1.8s infinite;
}

@keyframes pf-pulse {
    70%  { box-shadow: 0 0 0 8px rgba(226, 29, 44, 0); }
    100% { box-shadow: 0 0 0 0 rgba(226, 29, 44, 0); }
}

/* ---------- Pola formularza ---------- */

.input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, .35);
    color: var(--cream);
    font: 700 15px/1.2 var(--body);
    font-variant-numeric: tabular-nums;
    transition: border-color .15s ease, background .15s ease;
}

.input:focus {
    border-color: var(--red);
    background: rgba(0, 0, 0, .55);
    outline: none;
}

.chip {
    padding: 12px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font: 800 11px/1 var(--body);
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: .15s ease;
}

.chip:hover { border-color: var(--red); color: var(--cream); }

/* ---------- Alerty ---------- */

.alert {
    padding: 14px 18px;
    border-left: 4px solid var(--red);
    border-radius: var(--radius);
    background: rgba(226, 29, 44, .1);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 22px;
}

.alert--ok {
    border-color: #2fbf71;
    background: rgba(47, 191, 113, .12);
}

/* ---------- Belka górna ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 78px;
    background: rgba(10, 11, 12, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
}

/* pełna szerokość paska, treść nadal w gridzie strony */
.topbar.shell { max-width: none; padding-inline: max(28px, calc((100vw - var(--shell)) / 2 + 28px)); }

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

/*
 * Logo w pasku (public/images/logo.png — przycięte do samej grafiki,
 * 333x156, przezroczyste tło). Rozmiar steruje jedna zmienna.
 */
.brand__logo {
    --brand-logo-h: 56px;
    display: block;
    height: var(--brand-logo-h);
    width: auto;
    object-fit: contain;
}

.crest {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: var(--red);
    color: #fff;
    font: 400 19px/1 var(--display);
    letter-spacing: .04em;
    clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
}

.brand-text {
    display: grid;
    line-height: 1;
}

.brand-text strong {
    font: 400 20px/1 var(--display);
    letter-spacing: .05em;
    text-transform: uppercase;
}

.brand-text span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--red-soft);
    margin-top: 3px;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 26px;
}

/*
 * Zwykłe linki nawigacji. Pigułka konta (.topuser) jest tu wyłączona —
 * bez :not() reguła `.topnav a` (0,1,1) wygrywała z `.topuser` (0,1,0)
 * i kasowała jej padding, kolor oraz doklejała czerwone podkreślenie.
 */
.topnav a:not(.topuser) {
    position: relative;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
    padding: 4px 0;
    transition: color .15s ease;
}

.topnav a:not(.topuser)::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--red);
    transition: width .2s ease;
}

.topnav a:not(.topuser):hover { color: var(--cream); }
.topnav a:not(.topuser):hover::after { width: 100%; }

.topnav a:not(.topuser).is-active { color: var(--cream); }
.topnav a:not(.topuser).is-active::after { width: 100%; }

/* ---------- Konto w pasku ---------- */

.topuser {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    background: rgba(243, 239, 230, .04);
    text-decoration: none;
    color: var(--cream);
    transition: border-color .15s ease, background .15s ease;
}

.topuser:hover {
    border-color: rgba(226, 29, 44, .55);
    background: rgba(226, 29, 44, .1);
}

.topuser img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--panel-2);
    object-fit: cover;
}

.topuser__text {
    display: grid;
    line-height: 1.15;
}

.topuser__text b {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    max-width: 15ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Saldo z DataStore — odświeżane w tle co 15 sekund (public/js/balance.js). */
.topuser__balance {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .04em;
    color: var(--red-soft);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transition: color .25s ease;
}

.linklike {
    background: none;
    border: 0;
    padding: 0;
    color: var(--muted);
    font: 800 11px/1 var(--body);
    letter-spacing: .16em;
    text-transform: uppercase;
    cursor: pointer;
}

.linklike:hover { color: var(--red-soft); }

/* ---------- Stopka ---------- */

.footer {
    padding: 34px 0 38px;
    background: var(--ink-dark);
    border-top: 1px solid var(--line-soft);
    text-align: center;
    color: var(--muted-2);
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 26px;
    margin-bottom: 20px;
}

.footer__links a {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
    transition: color .15s ease;
}

.footer__links a:hover,
.footer__links a.is-active { color: var(--red-soft); }

.footer__note {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.9;
    letter-spacing: .14em;
    text-transform: uppercase;
}

/* ---------- Responsywność bazowa ---------- */

@media (max-width: 860px) {
    .brand__logo { --brand-logo-h: 44px; }
    .shell { padding-inline: 20px; }
    .topbar.shell { padding-inline: 20px; }
    .section { padding: 74px 0; }
    .topnav { gap: 16px; }
    .topnav a { font-size: 10px; letter-spacing: .12em; }
}

/* Zalogowany pasek jest szerszy o awatar i saldo — chowamy linki wcześniej. */
@media (max-width: 1080px) {
    .topbar--auth .topnav a:nth-child(3),
    .topbar--auth .topnav a:nth-child(4) { display: none; }
}

@media (max-width: 880px) {
    .topbar--auth .topnav a:nth-child(5) { display: none; }
}

@media (max-width: 620px) {
    .topnav a:nth-child(3),
    .topnav a:nth-child(4) { display: none; }
}

/* Na wąskim ekranie zostaje samo saldo — nazwa gracza jest i tak na jego profilu. */
@media (max-width: 480px) {
    .topuser__text b { display: none; }
    .topuser img { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
