/* Layout ogólny */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #e5e7eb;
    color: #111827;
    margin: 0;
    padding: 20px;

    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Sticky top-nav inspirowany GeoGuessr */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #111827;
    /* ciemny granat */
    border-radius: 0 0 14px 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    margin: -20px -20px 24px -20px;
    /* żeby pasek sięgał do krawędzi */
    padding: 0 20px;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 6px;
}

.nav-logo {
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f9fafb;
    font-size: 14px;
}

.nav-links a {
    margin-left: 14px;
    padding: 7px 14px;
    border-radius: 999px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: #e5e7eb;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover {
    background: rgba(255, 75, 75, 0.12);
    border-color: rgba(255, 75, 75, 0.6);
    color: #fff;
}

.nav-links a.active {
    background: #ff4b4b;
    /* czerwony GeoGuessr */
    border-color: #ff4b4b;
    color: #fff;
}

/* Nagłówki */
h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

h2 {
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 22px;
}

h3 {
    margin-top: 15px;
    margin-bottom: 8px;
    font-size: 18px;
}

/* Tabele */
.group-table,
.match-table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.group-table th,
.group-table td,
.match-table th,
.match-table td,
.admin-table th,
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    font-size: 14px;
}

.group-table th,
.match-table th,
.admin-table th {
    background: #111827;
    /* spójne z navem */
    color: #f9fafb;
    font-weight: 600;
    border-bottom: 3px solid #ff4b4b;
    /* czerwony akcent */
}

.group-table tr:nth-child(even) td,
.match-table tr:nth-child(even) td,
.admin-table tr:nth-child(even) td {
    background: #f9fafb;
}

/* Pasek rundy w terminarzu */
.round-row td {
    background: #ffe8e8;
    font-weight: 600;
    text-align: left;
    font-size: 14px;
}

.round-row small {
    font-weight: normal;
    color: #4b5563;
}

/* Formularze, przyciski */
button,
input,
select {
    font-family: inherit;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 8px;
    outline: none;
    min-width: 80px;
    background: #f9fafb;
}

input:focus,
select:focus {
    border-color: #ff4b4b;
    box-shadow: 0 0 0 1px rgba(255, 75, 75, 0.35);
    background: #ffffff;
}

button {
    border: none;
    border-radius: 999px;
    padding: 7px 16px;
    cursor: pointer;
    background: #ff4b4b;
    color: white;
    font-weight: 600;
    transition: background 0.15s ease, transform 0.05s ease;
}

button:hover {
    background: #e03535;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Błędy, linki */
.error {
    color: #b91c1c;
    font-weight: 600;
    margin-bottom: 10px;
}

a {
    color: #ff4b4b;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Formularz logowania */
form {
    max-width: 320px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

form input {
    width: 100%;
    margin-bottom: 10px;
}

/* Responsywność */
@media (max-width: 768px) {
    body {
        margin: 0;
        padding: 10px;
        max-width: 100%;
    }

    .top-nav {
        margin: 0 0 16px 0;
        border-radius: 0 0 12px 12px;
        padding: 0 10px;
    }

    .nav-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .nav-links a {
        margin-left: 0;
        margin-right: 8px;
    }

    .group-table,
    .match-table,
    .admin-table {
        font-size: 13px;
    }
}

/* Okienko informacyjne o systemie */
.info-box {
    background: #111827;
    color: #f9fafb;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.info-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #ff4b4b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}

.info-content strong {
    display: block;
    margin-bottom: 4px;
}

/* Drabinka (diagram) – kolumny schodzące do środka */
.bracket {
    display: flex;
    gap: 24px;
    margin-top: 18px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.bracket-round {
    flex: 0 0 220px;
}

.bracket-round h4 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #374151;
}

/* Kafelki meczów */
.bracket-match {
    background: #ffffff;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    font-size: 13px;
    border-left: 3px solid #ff4b4b;
}

.bracket-match strong {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.bracket-match span {
    display: block;
    color: #111827;
}

/* Kafelki w kolejnych rundach "bliżej środka" */
.round-1 .bracket-match {
    margin-bottom: 10px;
}

.round-2 .bracket-match {
    margin-top: 24px;
    margin-bottom: 32px;
}

.round-3 .bracket-match {
    margin-top: 56px;
    margin-bottom: 40px;
}

.round-4 .bracket-match {
    margin-top: 90px;
}

/* Finał i mecz o 3. miejsce – mocniej podkreślone */
.bracket-match.final {
    border-left-width: 5px;
    background: #fff5f5;
}

.bracket-match.third {
    border-left-style: dashed;
}

/* Dolna drabinka trochę ciaśniejsza */
.bracket-loss {
    margin-top: 10px;
}

/* Responsywność */
@media (max-width: 768px) {
    .bracket-round {
        flex: 0 0 200px;
    }
}