* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #0f0f12;
    --bg-card: #1a1a20;
    --bg-card-light: #22222b;
    --bg-hover: #25252e;
    --primary: #04AA6D;
    --primary-dark: #028a59;
    --primary-glow: rgba(4, 170, 109, 0.3);
    --text-main: #f0f0f0;
    --text-muted: #aaa;
    --border: #2c2c34;
    --border-light: #3a3a44;
    --danger: #e74c3c;
    --warning: #f39c12;
}

html {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding: 10px;
}

/* =========================
   HEADER
========================= */
.header {
    position: relative;
    background-image: url("https://i.ibb.co/C5nvXWkr/banner.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center 35%;
    height: 280px;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.loginbutton {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 12px;
    color: white;
    padding: 12px 20px;
    font-size: 16px;
    display: inline-block;
    white-space: nowrap;
    margin: 4px;
    cursor: pointer;
    transition: 0.3s;
}

.loginbutton:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--primary-glow);
}

/* =========================
   LICZNIK - ELEGANCKI (ŻÓŁTY, NEONOWY)
========================= */
.countdown-box {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffd700;
    padding: 10px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    margin: 10px auto;
    display: inline-block;
    border: 1px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    font-family: monospace;
    letter-spacing: 1px;
}

.countdown-wrapper {
    text-align: center;
    margin-bottom: 10px;
}

/* =========================
   MENU
========================= */
.menu ul {
    list-style-type: none;
    background-color: #1a1a1a;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
}

.menu li {
    border-right: 1px solid #333;
}

.menu li:last-child {
    border-right: none;
}

.menu li a {
    display: block;
    color: white !important;
    text-align: center;
    padding: 16px 20px;
    transition: 0.3s;
    text-decoration: none !important;
}

.menu li a:hover {
    background-color: var(--primary);
    color: white !important;
}

/* =========================
   LINKI W TABELI - BRAK PODKREŚLENIA PO NAJEŻDŻANIU
========================= */
a {
    color: inherit;
    text-decoration: none;
}

.table1 a, .table3 a {
    color: inherit;
    text-decoration: none;
}

.table1 a:hover, .table3 a:hover {
    color: inherit;
    text-decoration: none;
}

/* =========================
   TABELE
========================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
}

table.table1,
table.table2,
table.table3 {
    background-color: #1e1e1e;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

table.table1 th,
table.table1 td,
table.table2 th,
table.table2 td,
table.table3 th,
table.table3 td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #333;
}

table.table1 th,
table.table3 th {
    background-color: #04AA6D;
    color: white;
    position: sticky;
    top: 0;
    z-index: 2;
}

table.table1 tr:hover,
table.table3 tr:hover {
    background-color: #2a2a2a;
}

/* TOP3 - BIAŁY TEKST */
table.table1 tr:nth-child(2) {
    background-color: #ffd700;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

table.table1 tr:nth-child(2) a {
    color: white !important;
}

table.table1 tr:nth-child(3) {
    background-color: #c0c0c0;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

table.table1 tr:nth-child(3) a {
    color: white !important;
}

table.table1 tr:nth-child(4) {
    background-color: #cd7f32;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

table.table1 tr:nth-child(4) a {
    color: white !important;
}

/* =========================
   KARTY MECZÓW
========================= */
.match-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 18px 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.match-card:hover {
    border-color: var(--primary);
    background: var(--bg-card-light);
}

.match-info {
    flex: 2;
    min-width: 200px;
}

.match-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.match-teams {
    font-size: 1.1rem;
    font-weight: bold;
}

.match-teams b {
    color: var(--primary);
}

.match-actions {
    flex: 1;
    text-align: right;
    min-width: 160px;
}

.bet-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 40px;
    transition: 0.2s;
}

.bet-button:hover {
    transform: scale(1.02);
    box-shadow: 0 3px 12px var(--primary-glow);
    color: white;
    text-decoration: none;
}

.update-button {
    display: inline-block;
    background: var(--warning);
    color: white;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 40px;
    margin-top: 8px;
}

.update-button:hover {
    color: white;
    text-decoration: none;
}

.add-match-button {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 40px;
    margin-top: 20px;
}

.add-match-button:hover {
    color: white;
    text-decoration: none;
}

/* Twoje typy */
.your-bets-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.your-bets-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 20px;
}

.bets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.bet-badge {
    background: var(--bg-card-light);
    border-radius: 30px;
    padding: 10px 24px;
    font-size: 0.95rem;
    width: auto;
    min-width: 250px;
    text-align: center;
}

.bet-badge b {
    color: var(--primary);
}

.no-bets {
    background: rgba(243, 156, 18, 0.1);
    border: 1px dashed var(--warning);
    border-radius: 16px;
    padding: 20px;
    color: var(--warning);
}

/* =========================
   PRZEŁĄCZNIK TYPÓW
========================= */
.excel-switch {
    margin: 20px 0 25px 0;
    background: var(--bg-card);
    border-radius: 50px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.switch-group-full {
    width: 100%;
    border-bottom: 1px solid var(--border);
}

.switch-group-full .switch-label {
    display: block;
    text-align: center;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    background: var(--bg-card-light);
    color: var(--text-muted);
}

.switch-row {
    display: flex;
    flex-wrap: wrap;
}

.switch-group {
    flex: 1;
    min-width: 100px;
}

.switch-input {
    display: none;
}

.switch-label {
    display: block;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    background: var(--bg-card-light);
    color: var(--text-muted);
    margin: 2px;
    border-radius: 40px;
}

.switch-input:checked + .switch-label {
    background: var(--primary);
    color: white;
}

.switch-label:hover {
    background: var(--bg-hover);
    color: white;
}

/* Tabele w bets.html */
.bet-table-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.bet-table-container.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.excel-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--bg-card);
}

.excel-table th {
    background: var(--primary-dark);
    color: white;
    padding: 12px;
    border: 1px solid var(--border);
    text-align: center;
}

.excel-table td {
    padding: 10px;
    border: 1px solid var(--border);
    text-align: center;
    color: var(--text-main);
}

.excel-table tbody tr:hover {
    background: var(--bg-hover);
}

.match-container {
    margin-bottom: 40px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.match-header h2 {
    margin: 0 0 10px 0;
    color: var(--primary);
}

.info-text {
    background: var(--primary-dark);
    padding: 10px 24px;
    border-radius: 40px;
    display: inline-block;
    margin-bottom: 25px;
}

/* Style dla bet.html */
.bet-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}
.bet-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.bet-team {
    flex: 1;
    min-width: 150px;
    text-align: center;
}
.team-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-card);
    color: white;
    border-radius: 12px;
}
.bet-input {
    width: 120px;
    height: 120px;
    font-size: 3rem;
    text-align: center;
    font-weight: bold;
    border: 3px solid var(--primary);
    border-radius: 20px;
    background: white;
    color: var(--bg-dark);
}
.bet-vs {
    font-size: 2rem;
    font-weight: bold;
    color: var(--danger);
    background: var(--bg-card);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.bet-submit {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
}

/* Responsywność */
@media screen and (max-width: 900px) {
    .header {
        height: 180px;
    }
    .menu ul {
        flex-direction: column;
    }
    .menu li {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #333;
    }
    .match-card {
        flex-direction: column;
        text-align: center;
    }
    .match-actions {
        text-align: center;
    }
}

@media screen and (max-width: 600px) {
    .header {
        height: 150px;
    }
    table.table1 th, table.table1 td {
        padding: 10px;
        font-size: 13px;
    }
    .bet-badge {
        font-size: 0.85rem;
        padding: 8px 16px;
    }
    .countdown-box {
        font-size: 0.7rem;
        padding: 6px 12px;
    }
}
/* ========================================
   STYLE DLA STRONY LONGTerm (TYPY DŁUGOTERMINOWE)
   ======================================== */

.longterm-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 30px;
    max-width: 600px;
    margin: 20px auto;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.longterm-title {
    color: var(--primary);
    font-size: 1.6rem;
    margin-bottom: 25px;
    text-align: center;
    font-weight: bold;
}

.longterm-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.form-group label {
    font-weight: bold;
    color: var(--text-main);
    font-size: 1rem;
}

.longterm-input {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.longterm-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.longterm-input::placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.save-button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.your-current-bets {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.current-title {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.current-bet-item {
    background: var(--bg-dark);
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bet-label {
    font-weight: bold;
    color: var(--text-muted);
}

.bet-value {
    color: var(--primary);
    font-weight: bold;
    font-size: 1rem;
}

/* Zwykłe tło, brak border-left, brak gradientu */
.info-box-plain {
    background: var(--bg-dark);
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Wersja po starcie - pełna szerokość */
.longterm-card-full {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 30px;
    margin: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    width: calc(100% - 40px);
    max-width: none;
}

.longterm-header {
    text-align: center;
    margin-bottom: 25px;
}

/* Tabela na całą szerokość */
.table-wrapper-full {
    overflow-x: auto;
    width: 100%;
}

.longterm-table-full {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-dark);
    border-radius: 16px;
    overflow: hidden;
}

.longterm-table-full th {
    background: var(--primary-dark);
    color: white;
    padding: 14px;
    text-align: left;
    font-weight: bold;
}

.longterm-table-full td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.longterm-table-full tbody tr:hover {
    background: var(--bg-hover);
}

.username-cell b {
    color: var(--primary);
}

.scorer-cell .bet-value,
.winner-cell .bet-value {
    color: var(--text-main);
    font-weight: normal;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Responsywność */
@media (max-width: 768px) {
    .longterm-card {
        padding: 20px;
        margin: 10px;
    }
    
    .longterm-card-full {
        padding: 20px;
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .longterm-title {
        font-size: 1.3rem;
    }
    
    .longterm-table-full th,
    .longterm-table-full td {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .current-bet-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .longterm-card {
        padding: 15px;
    }
    
    .longterm-card-full {
        padding: 15px;
    }
    
    .save-button {
        padding: 12px 20px;
        font-size: 1rem;
    }
}


/* ========================================
   AKTYWNA STRONA W MENU
   ======================================== */
.menu li a.active {
    background-color: var(--primary);
    color: white !important;
    font-weight: bold;
}

/* ========================================
   WYRÓŻNIENIE ZALOGOWANEGO UŻYTKOWNIKA W TABELI
   ======================================== */
.table1 tr.current-user {
    border-left: 4px solid var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
    position: relative;
}

.table1 tr.current-user:nth-child(2),
.table1 tr.current-user:nth-child(3),
.table1 tr.current-user:nth-child(4) {
    background-color: inherit;
}

.table1 tr.current-user td:first-child {
    border-left: none;
}

/* ========================================
   PROCENTY TYPÓW - NEUTRALNE (SZARE)
   ======================================== */
.bet-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 10px 0 15px 0;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: normal;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.stat-percent {
    font-weight: bold;
    color: var(--text-main);
    font-size: 1rem;
}

/* ========================================
   NIEROZPOCZĘTE MECZE - ŁADNIEJSZE
   ======================================== */
.match-container-upcoming {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.match-container-upcoming:hover {
    border-color: var(--primary);
    background: var(--bg-card-light);
    transform: translateY(-2px);
}

.upcoming-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.upcoming-teams {
    font-size: 1.2rem;
    font-weight: bold;
}

.upcoming-teams b {
    color: var(--primary);
}

.upcoming-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.upcoming-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.bets-count {
    background: var(--bg-dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.bets-count span {
    color: var(--primary);
    font-weight: bold;
}

.missing-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.missing-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.missing-user {
    display: inline-block;
    background: var(--bg-dark);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--warning);
}

.complete {
    color: var(--primary);
    font-size: 0.85rem;
}

/* ========================================
   BETS.HTML - WERSJA MOBILNA (PRZYCISKI I PROCENTY W JEDNYM RZĘDZIE)
   ======================================== */

/* Przyciski przełącznika - zawsze w jednej linii */
.switch-row {
    display: flex;
    flex-wrap: nowrap;  /* ZAMIENIAMY z wrap na nowrap */
    justify-content: center;
}

.switch-group {
    flex: 1;
    min-width: 0;  /* Pozwala na ściśnięcie przycisków */
}

.switch-label {
    display: block;
    text-align: center;
    padding: 10px 6px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    background: var(--bg-card-light);
    color: var(--text-muted);
    margin: 2px;
    border-radius: 40px;
    white-space: nowrap;  /* Tekst w jednej linii */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Procenty - zawsze w jednej linii */
.bet-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 15px 0;
    flex-wrap: nowrap;  /* ZAMIENIAMY z wrap na nowrap */
}

.stat-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: normal;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}

.stat-percent {
    font-weight: bold;
    color: var(--text-main);
    font-size: 0.85rem;
}

/* Responsywność dla małych ekranów */
@media screen and (max-width: 768px) {
    .switch-label {
        padding: 8px 4px;
        font-size: 0.7rem;
    }
    
    .stat-badge {
        padding: 3px 6px;
        font-size: 0.65rem;
    }
    
    .stat-percent {
        font-size: 0.75rem;
    }
    
    .bet-stats {
        gap: 5px;
    }
}

@media screen and (max-width: 600px) {
    .switch-label {
        padding: 6px 3px;
        font-size: 0.65rem;
    }
    
    .stat-badge {
        padding: 2px 5px;
        font-size: 0.6rem;
    }
    
    .stat-percent {
        font-size: 0.7rem;
    }
}

@media screen and (max-width: 480px) {
    .switch-label {
        padding: 5px 2px;
        font-size: 0.6rem;
    }
    
    .stat-badge {
        padding: 2px 4px;
        font-size: 0.55rem;
    }
}




/* Wymuszenie układu poziomego */
@media screen and (max-width: 700px) {
    .bet-container {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .bet-team {
        min-width: auto;
        flex: 1;
    }
    
    .bet-input {
        width: 100%;
        max-width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .bet-vs {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }
}


/* ========================================
   PRZYCISKI SORTOWANIA W LONGTEM
   ======================================== */
.sort-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sort-btn {
    background: var(--bg-dark);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ========================================
   WARNING BOX W UPDATE
   ======================================== */
.warning-box {
    background: rgba(243, 156, 18, 0.15);
    border: 1px solid var(--warning);
    border-radius: 16px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    color: var(--warning);
}

.back-button {
    display: inline-block;
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: 40px;
    text-decoration: none;
    margin-top: 20px;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: var(--bg-hover);
    color: white;
    text-decoration: none;
}