/* =========================================
   ZMIENNE I RESET BAZOWY
   ========================================= */
   :root {
    --primary: #10b981;        /* Nowoczesny, świeży zielony */
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --secondary: #3b82f6;      /* Akcentowy niebieski */
    --bg-color: #f3f4f6;       /* Szare tło aplikacji */
    --surface: #ffffff;        /* Kolor kart */
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --line-bracket: #cbd5e1;
    --match-height: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* =========================================
   UKŁAD GŁÓWNY (FLEXBOX)
   ========================================= */
.app-container {
    display: flex;
    flex-direction: row;
    gap: 24px;
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
    flex: 1; 
}

.app-main {
    flex: 1;
    min-width: 0; 
    display: flex;
    flex-direction: column;
}

.app-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* =========================================
   KOMPONENTY: KARTY I SEKCJE
   ========================================= */
.card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 24px;
    width: 100%;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.view-section { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header { margin-bottom: 20px; }
.section-header h2 { font-size: 1.8rem; font-weight: 800; }

.flex-grid-2 { display: flex; gap: 20px; }
.flex-grid-2 > * { flex: 1; min-width: 0; }

.info-box, .alert-box {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
}
.info-box { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-box.warning { background: #fffbeb; border: 1px dashed #fcd34d; color: #92400e; text-align: center; }

/* =========================================
   NAGŁÓWEK APLIKACJI
   ========================================= */
.app-header {
    background: var(--surface); border-bottom: 1px solid var(--border-color);
    padding: 12px 24px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}

.header-left, .header-right { display: flex; align-items: center; gap: 16px; }
.logo { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); }
.tournament-badge {
    background: var(--primary-light); color: var(--primary-dark); padding: 4px 12px;
    border-radius: 999px; font-size: 0.8rem; font-weight: 700; border: 1px solid #6ee7b7;
    max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.main-nav { display: flex; gap: 8px; }
.nav-link {
    background: none; border: none; padding: 8px 16px; font-size: 0.95rem;
    font-weight: 600; color: var(--text-muted); cursor: pointer; border-radius: 8px; transition: all 0.2s;
}
.nav-link:hover:not(.disabled) { background: var(--bg-color); color: var(--primary-dark); }
.nav-link.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-link.disabled { opacity: 0.4; cursor: not-allowed; }
.user-info { font-size: 0.9rem; font-weight: 500; }

/* =========================================
   PRZYCISKI I FORMULARZE
   ========================================= */
.btn {
    font-family: inherit; font-weight: 600; padding: 8px 16px; border-radius: 8px;
    cursor: pointer; border: 1px solid transparent; transition: all 0.2s;
    font-size: 0.95rem; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: var(--bg-color); }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-huge { padding: 16px 32px; font-size: 1.1rem; border-radius: 12px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* FIX: Obsługa klas generowanych dynamicznie w JS (np. przycisk Usuń) */
.btn-auth {
    font-family: inherit; font-weight: 600; padding: 6px 14px; border-radius: 8px;
    cursor: pointer; border: 1px solid transparent; background: var(--primary); color: white;
    transition: all 0.2s; font-size: 0.85rem;
}
.btn-auth:hover { background: var(--primary-dark); }
.btn-auth.outline {
    background: transparent; border-color: #ef4444; color: #ef4444; /* Czerwony obrys dla niszczenia */
}
.btn-auth.outline:hover { background: #fee2e2; }

/* Formularze flex */
.flex-form {
    display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
}
.flex-form input { flex: 1; min-width: 200px; margin-bottom: 0 !important; }

/* Obsługa nowego turnieju (Siatka Punktacji z JS) */
.scoring-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}
.scoring-box legend {
    padding: 0 8px;
    font-weight: 700;
    color: var(--text-main);
}
.scoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}
.scoring-grid label {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.scoring-grid input {
    margin-top: 6px;
}

.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-main); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px;
    font-family: inherit; font-size: 0.95rem; background: #fafafa; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); background: white;
}

.password-wrapper { position: relative; display: flex; align-items: center;}
.toggle-password { position: absolute; right: 12px; cursor: pointer; opacity: 0.6; user-select: none; }
.toggle-password:hover { opacity: 1; }

.subtle-link { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.subtle-link:hover { color: var(--primary); text-decoration: underline; }

/* =========================================
   ZAKŁADKI (TABS)
   ========================================= */
.tabs {
    display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; gap: 16px;
}
.tab-button { /* Zmieniono z powrotem na tab-button żeby JS mógł je chwycić */
    background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 4px;
    font-size: 0.95rem; font-weight: 600; color: var(--text-muted); cursor: pointer; margin-bottom: -1px;
}
.tab-button:hover { color: var(--primary); }
.tab-button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* =========================================
   HERO POWITALNE I AUTH
   ========================================= */
.welcome-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); color: white; padding: 60px 30px;
    border-radius: 16px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.welcome-hero p { max-width: 600px; margin: 15px auto 30px; font-size: 1.1rem; color: #cbd5e1; }
.hero-actions {
    display: flex;
    flex-wrap: wrap;       /* Pozwala przyciskom zejść do nowej linii */
    gap: 12px;             /* Odstęp między przyciskami (w pionie i w poziomie) */
    justify-content: center;
}
.auth-card { max-width: 400px; margin: 40px auto; }
.auth-links { text-align: center; margin-top: 15px; }

/* =========================================
   TABELE
   ========================================= */
.table-responsive { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; text-align: left; }
.data-table th {
    background: #f8fafc; padding: 12px 16px; color: var(--text-muted); font-weight: 600;
    text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; border-bottom: 2px solid var(--border-color);
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.data-table tr:hover { background: #f8fafc; }
.data-table tr.is-active-tournament { background: var(--primary-light); }

/* FIX: Stylowanie linków do dashboardu z nazwami turniejów */
.data-table a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}
.data-table a:hover { color: var(--primary); text-decoration: underline; }

/* =========================================
   TYPOWANIE: GRUPY, 3 MIEJSCE I ZAPIS
   ========================================= */
.groups-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}
.group-card { border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; }
.group-title { text-align: center; font-weight: bold; margin-bottom: 10px; color: var(--primary-dark); }
.team-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px; font-size: 0.9rem; border-bottom: 1px solid #f1f5f9;
}
.team-row:nth-child(2), .team-row:nth-child(3) { background: #f0fdf4; font-weight: 600; }
.team-row:nth-child(4) { background: #fffbeb; font-weight: 600; }
.btn-move { background: var(--bg-color); border: none; padding: 2px 6px; border-radius: 4px; cursor: pointer; }
.btn-move:hover { background: #cbd5e1; }

.third-place-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;}
.third-place-counter { background: var(--bg-color); padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: bold; }
.third-place-counter.full { background: var(--primary); color: white; }

.third-place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.third-card {
    border: 2px solid var(--border-color); border-radius: 8px; padding: 10px; text-align: center;
    cursor: pointer; user-select: none; transition: all 0.2s;
}
.third-card:hover { border-color: #9ca3af; }
.third-card.selected { border-color: var(--primary); background: var(--primary-light); }
.tc-group { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 2px; }
.tc-team { font-weight: 700; font-size: 0.9rem; }

/* FIX: Wyśrodkowanie przycisku zapisu */
.save-action-area {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    margin-top: 10px;
}

/* =========================================
   TYPOWANIE: DRABINKA (PEŁEN CSS)
   ========================================= */
.bracket-scroll-area {
    width: 100%; overflow-x: auto; overflow-y: visible; padding-bottom: 20px; -webkit-overflow-scrolling: touch;
}
.bracket-wrapper {
    display: flex; min-width: 1000px; padding: 40px 20px 20px 20px; background: #f8fafc; border-radius: 12px;
}
.round-column {
    display: flex; flex-direction: column; justify-content: center; flex: 1; margin: 0 15px; position: relative;
}
.round-title {
    position: absolute; top: -30px; left: 0; width: 100%; text-align: center; font-weight: 700;
    color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase;
}

.match-card {
    width: 100%; height: var(--match-height); display: flex; flex-direction: column; justify-content: center;
    position: relative; z-index: 1;
}

.round-r32 .match-card { margin: 10px 0; }
.round-r16 .match-card { margin: 52px 0; }
.round-qf  .match-card { margin: 136px 0; }
.round-sf  .match-card { margin: 304px 0; }
.round-f   .match-card { margin: 640px 0; }

.match-content {
    background: white; border: 1px solid var(--border-color); border-radius: 6px; width: 100%; height: 100%;
    display: flex; flex-direction: column; overflow: hidden; position: relative; z-index: 2;
}

.match-card::after {
    content: ''; position: absolute; right: -15px; top: 50%; width: 15px; height: 2px; background: var(--line-bracket);
    transform: translateY(-50%); z-index: -1;
}
.match-card.has-connector::before {
    content: ''; position: absolute; left: -16px; top: 50%; width: 16px; transform: translateY(-50%);
    border-left: 2px solid var(--line-bracket); background-image: linear-gradient(var(--line-bracket), var(--line-bracket));
    background-size: 100% 2px; background-position: center; background-repeat: no-repeat; z-index: -1;
}

.round-r32 .match-card.has-connector::before { display: none; }
.round-r16 .match-card.has-connector::before { height: 84px; }
.round-qf  .match-card.has-connector::before { height: 168px; }
.round-sf  .match-card.has-connector::before { height: 336px; }
.round-f   .match-card.has-connector::before { height: 672px; }

.team-slot {
    flex: 1; padding: 0 8px; display: flex; align-items: center; cursor: pointer; font-size: 0.85rem;
}
.team-slot:first-child { border-bottom: 1px solid #f1f5f9; }
.team-slot:hover { background: #f8fafc; }
.team-slot.winner { background: var(--primary); color: white; font-weight: bold; }
.slot-label { font-weight: bold; margin-right: 6px; color: #94a3b8; font-size: 0.75rem; }
.team-slot.winner .slot-label { color: #d1fae5; }

.champion-box {
    background: #fef08a; border: 2px solid #eab308; color: #854d0e; padding: 15px; text-align: center;
    border-radius: 8px; font-weight: bold; opacity: 0.5; transform: scale(0.95); transition: 0.3s;
}
.champion-box.active { opacity: 1; transform: scale(1.05); }

.third-place-box {
    position: absolute; bottom: 0px; left: 50%; transform: translateX(-50%); background: white;
    border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; width: 100%; text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05); /* Dodaje delikatny cień, żeby boks fajnie odstawał */
}
.third-title { 
    font-size: 0.75rem; 
    font-weight: bold; 
    color: var(--text-muted); 
    margin-bottom: 8px; 
    text-transform: uppercase;
}

.bracket-wrapper.locked { opacity: 0.5; filter: grayscale(100%); pointer-events: none; }
.locked-visual .team-slot { cursor: default; }
.locked-visual .team-slot:hover { background: transparent; }

.correct-pick { background-color: var(--primary-light) !important; color: var(--primary-dark) !important; font-weight:bold;}
.wrong-pick { background-color: #fee2e2 !important; color: #b91c1c !important; }
.champion-box.correct-pick { background: #86efac !important; border-color: #22c55e !important;}
.champion-box.wrong-pick { background: #fca5a5 !important; border-color: #ef4444 !important; color: #7f1d1d;}

/* =========================================
   WYNIKI - SYMULACJA PUNKTÓW (TOGGLE)
   ========================================= */
.toggle-container { display: flex; align-items: center; gap: 8px; }
.toggle-label { font-size: 0.85rem; font-weight: bold; color: var(--text-muted); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }
.badge-sim { background: #fef08a; color: #a16207; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; border: 1px solid #fde047; }
body.results-sim-on .bracket-wrapper { border: 2px solid #fde047; background: #fffbeb;}

/* =========================================
   STOPKA Z BIBIARTS
   ========================================= */
.app-footer {
    background: var(--surface); border-top: 1px solid var(--border-color); padding: 20px 24px; margin-top: 40px;
}
.footer-content {
    max-width: 1500px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;
}
.copyright { color: var(--text-muted); font-size: 0.9rem; }
.author { color: var(--primary-dark); font-weight: 800; }
.donate-area { display: flex; align-items: center; gap: 12px; }
.donate-text { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.btn-donate {
    background: #ffd814; color: #0f1111; font-weight: 700; border-radius: 999px; padding: 8px 16px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn-donate:hover { background: #f7ca00; transform: translateY(-1px); }

/* =========================================
   REKLAMY (SIDEBAR I MOBILE)
   ========================================= */
   .ad-placeholder {
    background: var(--bg-color); border: 2px dashed #cbd5e1; display: flex; align-items: center;
    justify-content: center; color: #94a3b8; font-size: 0.85rem; font-weight: bold; margin-top: 15px; border-radius: 8px;
}
.ad-placeholder.square { height: 250px; }
.ad-placeholder.tall { height: 600px; }
.ad-placeholder.banner { height: 60px; margin-top: 0; } /* Nowy rozmiar dla telefonów */

/* Domyślnie ukrywamy małe banery mobilne na dużych ekranach */
.mobile-ad-container {
    display: none;
}

/* =========================================
   RESPONSYWNOŚĆ (SMARTFONY I TABLETY)
   ========================================= */
@media (max-width: 900px) {
    .app-container { flex-direction: column; padding: 12px; gap: 16px; }
    .flex-grid-2 { flex-direction: column; }
    /* Ukrywamy wielki panel boczny na telefonach */
    .app-sidebar { display: none; }

    /* Włączamy widoczność małych banerów */
    .mobile-ad-container { display: block; width: 100%; }
    .mobile-ad-top { margin-bottom: 4px; }
    .mobile-ad-bottom { margin-top: 4px; }

    .app-header { flex-direction: column; padding: 12px; gap: 12px; position: static; }
    .header-left { width: 100%; justify-content: space-between; }
    .tournament-badge { max-width: 140px; }
    .main-nav {
        width: 100%;
        display: flex;
        flex-wrap: nowrap; /* Twardy zakaz łamania wierszy */
        overflow-x: auto; /* Pozwala przewijać palcem, gdy brakuje miejsca */
        justify-content: space-between; /* Rozkłada 4 przyciski równomiernie */
        gap: 4px;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch; /* Bardzo płynne przewijanie na iOS */
        scrollbar-width: none; /* Ukrywa suwak w Firefox */
    }

    /* Ukrywa suwak w Chrome/Safari/Edge, zostawiając samą funkcję scrolla */
    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        white-space: nowrap; /* Zabrania łamania tekstu wewnątrz samego przycisku */
        padding: 8px 10px;
        font-size: 0.85rem; /* Minimalnie mniejsza czcionka, żeby łatwiej weszły na ekran */
        flex: 1; /* Pozwala przyciskom równo podzielić dostępną szerokość */
        text-align: center;
    }    .header-right { width: 100%; justify-content: space-between; border-top: 1px solid var(--border-color); padding-top: 12px; }
    .data-table th, .data-table td { white-space: nowrap; }
    .footer-content { justify-content: center; text-align: center; flex-direction: column; }
}

/* =========================================
   PIGUŁKI INFORMACYJNE (Bages / Pills)
   ========================================= */
   .active-pill {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #6ee7b7;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Warianty kolorystyczne */
.active-pill.role-admin { background: #fef08a; color: #854d0e; border-color: #fde047; }
.active-pill.role-user { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.active-pill.competition { background: #f3e8ff; color: #6b21a8; border-color: #d8b4fe; }

/* =========================================
   NOWE ELEMENTY POWITANIA (LISTY, WIDEO, STOPKA)
   ========================================= */
   .feature-list {
    list-style: none;
    margin-top: 15px;
}
.feature-list li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
}
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* Proporcje 16:9 dla YouTube */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #e5e7eb;
    border: 1px solid var(--border-color);
}
.video-placeholder, .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: bold;
    text-align: center;
    padding: 20px;
}

.footer-links {
    display: flex;
    gap: 15px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--primary);
}

/* =========================================
   ROZWIJANE POLA (EXPAND / DETAILS) - Wersja "Delikatna"
   ========================================= */

/* Nadpisanie stylu .info-box dla wersji details, aby zmniejszyć wysokość ogólną */
details.info-box.expandable-box {
    padding: 6px 12px; /* Zmniejszone dopełnienie pionowe (było 10px), poziome zostaje */
    margin-bottom: 12px; /* Mniejszy odstęp na dole między blokami */
}

details.expandable-box {
    cursor: pointer;
    transition: all 0.3s ease;
}

details.expandable-box summary {
    list-style: none; /* Ukrywa domyślną strzałkę przeglądarki */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: normal; /* Pozwalamy tekstowi wewnątrz summary być bold jeśli trzeba, lub nadpiszemy to niżej */
    outline: none;
    user-select: none; /* Zapobiega zaznaczaniu tekstu przy szybkim klikaniu */
    /* Jeśli w HTML jest <strong>Jak to działa?</strong>, to poniższa linia sprawi, że tekst
       nie będzie aż tak pogrubiony (mniej "ciężki") */
    color: #475569; /* Delikatniejszy kolor tytułu niż domyślny info-box */
}

details.expandable-box summary::-webkit-details-marker {
    display: none; /* Dla starszych wersji Chrome/Safari */
}

/* Nasza własna, animowana strzałka - mniejsza i delikatniejsza */
details.expandable-box summary::after {
    content: "▼";
    font-size: 0.7em; /* Zmniejszona (była 0.8em) */
    transition: transform 0.3s ease;
    opacity: 0.5; /* Jeszcze delikatniejsza, jaśniejsza (była 0.7) */
    margin-left: 10px; /* Odstęp od tekstu */
}

/* Odwrócenie strzałki po rozwinięciu */
details.expandable-box[open] summary::after {
    transform: rotate(180deg);
}

/* Wygląd treści po rozwinięciu - KLUCZOWE ZMIANY DLA WYSOKOŚCI */
.expandable-content {
    margin-top: 6px; /* Znacznie zmniejszony odstęp od góry (był 12px) */
    padding-top: 6px; /* Znacznie zmniejszony padding od góry (był 12px) */
    border-top: 1px solid rgba(0, 0, 0, 0.05); /* Jaśniejsza, bardziej subtelna linia (była 0.1) */
    line-height: 1.4; /* Nieco ciaśniejsza linia tekstu, aby zyskać miejsce (była 1.5) */
    font-size: 0.9em; /* Zmniejszony font wewnątrz (był domyślny info-box, ok. 0.9em, może być 0.95em if info-box is 1em) */
    color: #64748b; /* Lżejszy kolor dla samej treści */
}

/* =========================================
   KLIKALNE WIERSZE W TABELACH
   ========================================= */
   .data-table tr.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Nieco ciemniejszy szary przy najechaniu, żeby wyraźnie było widać co klikamy */
.data-table tr.clickable-row:hover {
    background-color: #e2e8f0; 
}

/* Pogrubienie i kolor nazwy turnieju (zamiast dawnego linka) */
.data-table tr.clickable-row td:first-child {
    font-weight: 700;
    color: var(--primary-dark);
}

/* Nowy, zgrabny układ punktacji w szczegółach turnieju */
.scoring-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.scoring-summary-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    width: 100%; /* Tytuł nad plakietkami */
    margin-bottom: 4px;
}

.scoring-badge {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.scoring-badge .round-name {
    color: var(--text-muted);
}

.scoring-badge .points-val {
    font-weight: 800;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 1px 6px;
    border-radius: 4px;
}