:root {
    --primary-dark: #10403B;
    --primary-teal: #127369;
    --muted-sage: #8AA6A3;
    --slate-grey: #4C5958;
    --light-grey: #BFBFBF;
    --white: #ffffff;
    --bg-teal-soft: #f0fdfa;
}

html, body {
    font-family: 'Inter', sans-serif;
    background-color: #fcfcfc;
    color: var(--primary-dark);
}

h1, h2, h3, .navbar-brand {
    font-family: 'Montserrat', sans-serif;
}

h1:focus {
    outline: none;
}

/* HIDE MOBILE ELEMENTS ON DESKTOP */
.navbar-toggler, .mobile-bottom-nav {
    display: none;
}

/* Nowoczesne style dla przycisków w top-bar */
.top-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.top-row .btn-outline-primary {
    color: var(--primary-teal);
    border-color: var(--primary-teal);
}

.top-row .btn-outline-primary:hover {
    background-color: var(--primary-teal);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(18, 115, 105, 0.15);
}

.top-row .btn-primary {
    background-color: var(--primary-teal);
    border-color: var(--primary-teal);
    color: white;
}

.top-row .btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 64, 59, 0.2);
}

.top-row .btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

/* Kontrast dla punktów i odznak */
.badge-points {
    background-color: var(--primary-teal) !important;
    color: white !important;
    font-weight: 800;
    font-size: 1rem !important;
    padding: 0.5rem 1rem !important;
}

/* Statusy meczów w typowaniu */
.card-bet-placed {
    border-left: 8px solid var(--primary-teal) !important;
    background-color: #f0f9f8 !important;
}

.card-bet-missing {
    border-left: 8px solid var(--light-grey) !important;
}

/* System Toastów */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-item {
    min-width: 300px;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    border-left: 6px solid var(--primary-teal);
    animation: slideIn 0.3s ease-out forwards;
}

.toast-success { border-left-color: #28a745; }
.toast-error { border-left-color: #dc3545; }
.toast-info { border-left-color: var(--primary-teal); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Skeleton Screen Effect */
.skeleton {
    background: #e0e0e0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 1rem; margin-bottom: 0.5rem; width: 100%; }
.skeleton-title { height: 2rem; margin-bottom: 1rem; width: 60%; }
.skeleton-card { height: 200px; border-radius: 15px; }
.skeleton-row { height: 50px; margin-bottom: 5px; }

/* Dashboard Hub Styles */
.dashboard-banner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-teal) 100%);
    border-radius: 24px;
    color: white;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 2.5rem;
}

.dashboard-banner::after {
    content: "\f56b"; /* Kod ikony bi-soccer-ball */
    font-family: "bootstrap-icons";
    position: absolute;
    right: -20px;
    bottom: -50px;
    font-size: 18rem;
    opacity: 0.1;
    color: white;
    transform: rotate(-15deg);
    pointer-events: none;
}

.mini-game-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #eee;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.mini-game-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}

.match-locked {
    opacity: 0.7;
    filter: grayscale(0.5);
    cursor: not-allowed;
}

a, .btn-link {
    color: var(--primary-teal);
    text-decoration: none !important;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none !important;
}

.btn-primary {
    color: var(--white) !important;
    background-color: var(--primary-teal);
    border-color: var(--primary-teal);
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    color: var(--white) !important;
}

.btn-outline-danger:hover {
    background-color: #dc3545 !important;
    color: white !important;
}

.content {
    padding-top: 2rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljc3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Nowoczesne karty gier */
.game-card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    background-color: var(--primary-dark);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.text-teal {
    color: var(--primary-teal) !important;
}

.btn-teal {
    background-color: var(--primary-teal) !important;
    color: white !important;
    border: none !important;
}

.btn-teal:hover {
    background-color: var(--primary-dark) !important;
    color: white !important;
}

.bg-teal-soft {
    background-color: var(--bg-teal-soft) !important;
}

.border-teal {
    border-color: var(--primary-teal) !important;
}

.nav-link i {
    width: 1.5rem;
    margin-right: 0.5rem;
    text-align: center;
}

/* MOBILE BOTTOM NAV */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(85px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    box-shadow: 0 -8px 30px rgba(0,0,0,0.08);
    z-index: 1050;
    justify-content: space-around;
    align-items: flex-start;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 12px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    transition: all 0.2s ease;
    flex: 1;
}

.mobile-nav-item i {
    font-size: 1.7rem;
    margin-bottom: -1px;
    transition: transform 0.2s;
}

.mobile-nav-item span {
    margin-top: 0;
    display: block;
}

.mobile-nav-item.active {
    color: var(--primary-teal);
}

.mobile-nav-item.active i {
    transform: translateY(-3px);
}

/* GLOBAL ROUNDING ENFORCEMENT */
.card {
    background-color: var(--white);
    border: 1px solid rgba(0,0,0,0.05) !important;
    border-radius: 24px !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #edf2f7 !important;
    color: var(--primary-dark);
    font-weight: 600;
}

.rounded-4 {
    border-radius: 24px !important;
}

.rounded-pill {
    border-radius: 50rem !important;
}

.alert {
    border-radius: 20px !important;
}

.nav-pills .nav-link {
    border-radius: 50px !important;
}

.form-control, .form-select {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 0.25rem rgba(18, 115, 105, 0.15);
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 641px) {
    .sidebar {
        display: none;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    main {
        padding-bottom: calc(95px + env(safe-area-inset-bottom)); /* Space for bottom nav */
    }

    .top-row {
        height: calc(3.5rem + env(safe-area-inset-top)) !important;
        padding: env(safe-area-inset-top) 1rem 0 1rem !important;
        background: rgba(255, 255, 255, 0.9) !important;
        backdrop-filter: blur(10px);
        position: sticky;
        top: 0;
        z-index: 1000;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .top-row .fw-bold {
        font-size: 0.85rem !important;
    }

    .dashboard-banner {
        padding: 1.5rem !important;
        border-radius: 20px !important;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .dashboard-banner h1 {
        font-size: 1.4rem !important;
    }

    .content {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 1rem !important;
    }

    .card {
        margin-bottom: 1rem !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.04) !important;
    }

    /* Lepsze odstępy dla kontenera głównego */
    .container, .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* RESPONSIVE LEADERBOARD TABLE */
@media (max-width: 641px) {
    .table-responsive table thead {
        display: none;
    }

    .table-responsive table, 
    .table-responsive table tbody, 
    .table-responsive table tr, 
    .table-responsive table td {
        display: block;
        width: 100%;
    }

    .table-responsive table tr {
        margin-bottom: 0.75rem;
        background: white;
        border-radius: 16px;
        padding: 1rem;
        position: relative;
        box-shadow: 0 2px 8px rgba(0,0,0,0.03);
        border: 1px solid #f0f0f0;
    }

    .table-responsive table td {
        text-align: left !important;
        padding: 0.2rem 0 !important;
        border: none !important;
    }

    /* Pozycja gracza */
    .table-responsive table td:first-child {
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: auto;
        font-weight: 800;
        color: var(--primary-teal);
        background: var(--bg-teal-soft);
        padding: 0.2rem 0.6rem !important;
        border-radius: 8px;
    }

    /* Nazwa gracza */
    .table-responsive table td:nth-child(2) {
        font-size: 1.05rem;
        font-weight: 700;
        padding-right: 3rem !important;
    }

    /* Punkty */
    /* Stylizacja komunikatu o ponownym łączeniu */
    #components-reconnect-modal {
        background-color: rgba(255, 255, 255, 0.9) !important;
        backdrop-filter: blur(5px);
        z-index: 9999 !important;
    }

    #components-reconnect-modal h5::before {
        content: "Utracono połączenie. ";
        display: block;
        margin-bottom: 10px;
    }

    #components-reconnect-modal h5 {
        font-size: 0 !important;
    }

    #components-reconnect-modal h5::after {
        content: "Próbuję połączyć ponownie...";
        font-size: 1rem !important;
        font-weight: bold;
        color: var(--primary-dark);
    }

    .components-reconnect-show #components-reconnect-modal,
    .components-reconnect-failed #components-reconnect-modal,
    .components-reconnect-rejected #components-reconnect-modal {
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }

    /* Ukrycie oryginalnych przycisków i tekstu */
    #components-reconnect-modal div {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .table-responsive table td:nth-child(3) {
        font-size: 0.9rem;
        color: #64748b;
    }
    
    .table-responsive table td:nth-child(3)::before {
        content: "Punkty: ";
        font-weight: 600;
    }
}
