body, html {
    background-color: #242328;
}

main {
    background-color: #FFFFFF;
}

header {
    background-color: #242328;
    -webkit-box-shadow: 0 2px 1px 0px #000;
    box-shadow: 0 2px 1px 0px #000;
    position: relative;
    z-index: 1;
}

#homepage-intro {
    background: url('../images/hero-bg.jpg') no-repeat center center / cover;
}

#homepage-intro .statistics {
    background-color: #fff;
    border: .1rem solid #ebe5eb;
    border-radius: 1.2rem;
    box-shadow: 0px 0px 5px rgb(0, 0, 0);
}

#homepage-intro .statistics ul li:not(:last-child) {
    margin-bottom: 0.5rem;
}

#homepage-intro .statistics ul li .stats-title {
    font-size: 0.8rem;
    line-height: 0.8rem;
    font-weight: 600;
    word-break: break-word;
}

#homepage-intro .statistics ul li .stats-value {
    font-size: 1.2rem;
    line-height: 1.2rem;
    margin-bottom: .2rem;
    font-weight: 800;
}

#homepage-intro .statistics .stats-player-name {
    color: #242328;
    text-decoration: none;
    font-weight: 800;
}

#homepage-intro .statistics .stats-player-first {
    font-size: 1.2rem;
    line-height: 1.2rem
}

#homepage-intro .statistics .stats-player-last {
    font-size: 2rem;
    line-height: 2rem
}

#homepage-intro .statistics .stats-player-points-label {
    font-size: 0.8rem;
    line-height: 1.2rem;
    font-weight: 600;
}

#homepage-intro .statistics .stats-player-points {
    font-size: 2rem;
    line-height: 2rem;
    font-weight: 800;
}

#homepage-intro .statistics .btn {
    font-weight: 600;
    border: .1rem solid #ebe5eb;
}

#homepage-intro .statistics .btn.btn-warning {
    border: .1rem solid #242328;
}

#homepage-intro h1, #homepage-intro p {
    text-shadow: 1px 1px 2px #242328;
}

#next-matches .card {
    border-radius: 1.2rem;
    border: 0;
    background: #f5f2f5;
}

#next-matches .card .card-header {
    border: .1rem solid #242328;
    border-top-left-radius: 1.2rem;
    border-top-right-radius: 1.2rem;
    background-color: #242328;
    color: #ffffff;
}

#next-matches .card .card-header .card-title {
    font-size: 1.6rem;
    font-weight: 800;
    padding: 6px 12px;
}

#next-matches .card .card-header .btn {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 600;
}

#next-matches .card .card-body {
    border: .1rem solid #ebe5eb;
    border-bottom-left-radius: 1.2rem;
    border-bottom-right-radius: 1.2rem;
}

#next-matches .swiper .card.match {
    border-radius: 0;
}

#next-matches .swiper .card.match .card-body {
    background: #ffffff;
    border-radius: 0;
    border-bottom: 0;
}

#next-matches .swiper .card.match .card-footer {
    background: #fff;
    border: .1rem solid #ebe5eb;
    border-bottom-left-radius: 1.2rem;
    border-bottom-right-radius: 1.2rem;
}

#next-matches .swiper .card.match .card-footer .btn {
    font-weight: 600;
    font-size: 0.9rem;
}

#next-matches .swiper .card.match .card-body .card-versus {
    font-size: 1.3rem;
    font-weight: 800;
    color: #242328;
}

#next-matches .swiper .card.match .card-body .card-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: #242328;
}

#next-matches .swiper .card.match .card-body .card-time {
    border: .1rem solid #ebe5eb;
    width: auto;
    padding: 0 5px;
    display: inline-block;
    font-size: 1.2rem;
    margin: 0 auto 10px;
    font-weight: 600;
}

#next-matches .swiper .swiper-pagination-bullet-active {
    background: #242328;
}

#next-matches .swiper-pagination {
    position: relative;
}

#player-ranking h4 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #242328;
}

#player-ranking .top-wrapper {
    border: .1rem solid #ebe5eb;
    border-radius: 1.2rem;
}

#player-ranking .top-wrapper .top-hero {
    font-weight: 400;
    border-radius: 1.2rem;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

#player-ranking .top-wrapper .top-hero.t-liverpool {
    background: linear-gradient(284.38deg, #911712, #dc0714);
}

#player-ranking .top-wrapper .top-hero.t-arsenal {
    background: linear-gradient(284.38deg, #be000a, #ff0203);
}

#player-ranking .top-wrapper .top-hero.t-manchester-city {
    background: linear-gradient(284.38deg, #6a9bc2, #98c5e9);
}

#player-ranking .top-wrapper .top-hero.t-manchester-united {
    background: linear-gradient(284.38deg, #b40808, #ea0c0c);
}

#player-ranking .top-wrapper .top-hero.t-chelsea {
    background: linear-gradient(284.38deg, #1934be, #2145f6);
}

#player-ranking .top-wrapper .top-hero.t-tottenham {
    background: linear-gradient(284.38deg, #ffffff, #e3e3e3);
}

#player-ranking .top-wrapper .top-hero.t-nottingham-forest {
    background: linear-gradient(284.38deg, #c2112e, #d93d56);
}

#player-ranking .top-wrapper .top-hero.t-bournemouth {
    background: linear-gradient(284.38deg, #af0c13, #df1e26);
}

#player-ranking .top-wrapper .top-hero.t-newcastle-united {
    background: linear-gradient(284.38deg, #231f20, #444041);
}

#player-ranking .top-wrapper .top-hero.t-fulham {
    background: linear-gradient(284.38deg, #ffffff, #e3e3e3);
}

#player-ranking .top-wrapper .top-hero.t-aston-villa {
    background: linear-gradient(284.38deg, #7d1142, #a6245f);
}

#player-ranking .top-wrapper .top-hero.t-brighton-and-hove-albion {
    background: linear-gradient(284.38deg, #0054a6, #1471cc);
}

#player-ranking .top-wrapper .top-hero.t-brentford {
    background: linear-gradient(284.38deg, #c10000, #ff1c24)
}

#player-ranking .top-wrapper .top-hero.t-crystal-palace {
    background: linear-gradient(284.38deg, #093466, #0d5dba)
}

#player-ranking .top-wrapper .top-hero.t-everton {
    background: linear-gradient(284.38deg, #00019e, #3334b1)
}

#player-ranking .top-wrapper .top-hero.t-west-ham-united {
    background: linear-gradient(284.38deg, #6f2130, #963849)
}

#player-ranking .top-wrapper .top-hero.t-wolverhampton-wanderers {
    background: linear-gradient(284.38deg, #ffca5e, #f99808)
}

#player-ranking .top-wrapper .top-hero.t-ipswich-town {
    background: linear-gradient(284.38deg, #0d4dde, #0333a0)
}

#player-ranking .top-wrapper .top-hero.t-leicester-city {
    background: linear-gradient(284.38deg, #0b56a4, #003090)
}

#player-ranking .top-wrapper .top-hero.t-southampton {
    background: linear-gradient(284.38deg, #fc2651, #c80028)
}

#player-ranking .top-wrapper .top-hero.t-tottenham *, #player-ranking .top-wrapper .top-hero.t-fulham *, #player-ranking .top-wrapper .top-hero.t-wolverhampton-wanderers * {
    color: #242328 !important;
}

#player-ranking .top-wrapper .top-hero .top-position {
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
}

#player-ranking .top-wrapper .top-hero .top-player-name {
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

#player-ranking .top-wrapper .top-hero .top-player-first {
    font-size: 1rem;
    line-height: 1rem;
}

#player-ranking .top-wrapper .top-hero .top-player-last {
    font-size: 1.5rem;
    line-height: 1.5rem;
}

#player-ranking .top-wrapper .top-hero .top-player-points {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 2.4rem;
    color: #FFFFFF;
}

#player-ranking .top-wrapper .top-player-row {
    display: flex;
    align-items: center;
    padding: .8rem .8rem .8rem 1.2rem;
    justify-content: space-between;
    border-bottom: .1rem solid #ebe5eb;
    color: #242328;
}

#player-ranking .top-wrapper .top-player-row .top-position {
    font-weight: 600;
    font-size: 0.8rem;
    min-width: 1rem;
}

#player-ranking .top-wrapper .top-player-row .top-badge img {
    width: 2.2rem;
    height: 2.2rem;
}

#player-ranking .top-wrapper .top-player-row .top-player-info {
    display: flex;
    align-items: center;
}

#player-ranking .top-wrapper .top-player-row .top-player-text {
    display: flex;
    flex-direction: column;
}

#player-ranking .top-wrapper .top-player-row .top-player-text .top-player-firstname {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 0.8rem;
}

#player-ranking .top-wrapper .top-player-row .top-player-text .top-player-lastname {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2rem;
}

#player-ranking .top-wrapper .top-player-row .top-player-text .top-player-team {
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 0.8rem;
}

#player-ranking .top-wrapper .top-player-row .top-player-stats {
    font-size: 1.4rem;
    font-weight: 800;
}

#homepage-intro .statistics .overall-tooltip {
    font-weight: 800;
    color: #242328;
    background: #ffc107;
    width: 100%;
    display: block;
    margin-top: 0px;
    box-shadow: 0 0px 5px 2px #ffc170;
    border-radius: 5px;
    font-size: 17px;
    padding: 0px 0 4px;
    line-height: 1.3;
}

#homepage-intro table {
    border: 0 solid transparent;
    background-color: transparent;
    margin: 0 auto;
}

#homepage-intro table td {
    border: 0 solid transparent;
    background-color: transparent;
    font-weight: 800;
    color: #E5E7EB;
    text-shadow: 2px 2px 2px #242328;
    font-size: 17px;
    line-height: 11px;
    padding: 8px 0;
}

#homepage-intro .my-xi {
    font-weight: 800;
    color: #E5E7EB;
    text-shadow: 2px 2px 2px #242328;
    font-size: 24px;
    line-height: 1;
}

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-login {
    background-color: #f2f3f4;
    height: 100vh;
}

.page-login .container {
    height: 200px;
    top: 50%;
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
}

.topbar {
    background-color: #000;
    color: #fff;
    padding: 10px 0;
}

.navbar .container {
    z-index: 1;
}

.navbar img {
    width: 100px;
    margin: 0 auto;
}

.navbar ul li {
    margin: 0 15px;
}

.navbar ul li a {
    color: #fff;
    line-height: 1.8rem;
    font-weight: bold;
}

.navbar ul li a:hover {
    color: #ffc64d;
}

.navbar ul li a.active {
    background: #ff0;
    color: #143cdb;
    border-radius: 20px;
}

.navbar-expand-lg .navbar-nav .nav-link {
    padding: 7px 15px;
}

/* GENERAL */
.gray-background {
    background-color: #f5f2f5;
}

.btn.btn-primary {
    background-color: #242328;
    font-weight: 600;
    font-size: 18px;
    border-color: #242328;
    justify-content: center;
    align-content: center;
    height: fit-content;
    align-self: center;
}

/* GROUP TABLE */

.group-table {
    border: .1rem solid #ebe5eb;
    border-radius: 19px;
    font-size: 16px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.group-table > :not(caption) > * > * {
    color: #242328;
}

.group-table th, .group-table td {
    font-size: 16px;
}

.group-table th:first-child {
    font-size: 20px;
    font-weight: 600
}

.group-table th:not(:first-child) {
    text-align: center;
}

.group-table th:not(:first-child,:last-child) {
    color: #505B73;
    font-weight: 400
}

.group-table td:not(:nth-child(2)) {
    font-weight: 500;
    text-align: center;
}

.group-table tbody tr:last-child, .group-table tbody tr:last-child td {
    border: 0;
}

/* Group Card Flip Animation */
.group-wrapper {
    perspective: 1000px;
    position: relative;
}

.group-table-card {
    position: relative;
    width: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.group-table-card.flipped {
    transform: rotateY(180deg);
}

.group-table-front,
.group-table-back {
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    position: relative;
}

.group-table-front {
    display: block;
}

.group-table-back {
    display: none;
    transform: rotateY(180deg);
}

.group-table-back tr:last-child td {
    height: 81px;
    vertical-align: middle;
}

.group-table-card.flipped .group-table-front {
    display: none;
}

.group-table-card.flipped .group-table-back {
    display: block;
}

/* Sortable Teams Styles */
.sortable-teams .drag-handle {
    cursor: grab;
    color: #6c757d;
    transition: color 0.2s;
}

.sortable-teams .drag-handle:hover {
    color: #212529;
}

.sortable-teams .drag-handle:active {
    cursor: grabbing;
}

.sortable-teams .drag-handle[style*="not-allowed"] {
    cursor: not-allowed !important;
    opacity: 0.5;
}

.sortable-teams .drag-handle[style*="not-allowed"]:hover {
    color: #6c757d;
}

.sortable-teams tr {
    transition: background-color 0.2s;
}

.sortable-teams tr:hover {
    background-color: #f8f9fa;
}

/* SortableJS ghost element */
.sortable-ghost {
    opacity: 0.4;
    background-color: #e9ecef !important;
}

/* SortableJS drag element */
.sortable-drag {
    opacity: 1;
    cursor: grabbing !important;
}

/* Position numbers */
.position-number {
    font-weight: 600;
    color: #6c757d;
    width: 40px;
}

/* TOURNAMENT PAGE */
#tournament-title {
    background-color: #FFFFFF;
}

#tournament-title h3 {
    line-height: 1;
}

#tournament-title small {
    font-weight: 700;
    color: #242328;
    font-size: 1rem;
}

#tournament-navigation {
    background-color: #e9e7ea;
    border-bottom: 1px solid #d8d5d8;
}

#tournament-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 32px
}

#tournament-navigation ul li {
    position: relative;
}

#tournament-navigation ul li:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -16px; /* половината от gap */
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background-color: #d0ccd2;
}

#tournament-navigation ul li a {
    display: inline-block;
    padding: 7px 0; /* прави навигацията висока */
    color: #242328;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s ease;
}

#tournament-navigation ul li a:hover {
    color: #000;
}

#tournament-navigation ul li a.active {
    position: relative;
}

#tournament-navigation ul li a.active::after, #tournament-navigation ul li a:hover::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 2px;
    background-color: #242328;
}

.tournament-countdown {
    display: flex;
}

.tournament-countdown .countdown-section {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.tournament-countdown .countdown-section .value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #242328;
}

#tournament-registration-notice {
    background-color: #f2f1f3;
    border-top: 1px solid #e3e0e6;
    border-bottom: 1px solid #dedbe1;
    color: #242328;
    font-weight: 500;
}

#tournament-registration-notice .title {
    font-size: 20px;
    font-weight: 600;
    color: #242328;
}

#tournament-registration-notice .subtitle {
    font-size: 14px;
    color: #6f6c72;
}

.tournament-fixtures h3 {
    font-size: 22px;
    font-weight: 600;
    color: #242328;
    margin-bottom: 1rem;
}

.tournament-fixtures .match-card {
    background-color: #ffffff;
    align-items: center;
    color: #242328;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    position: relative;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tournament-fixtures .match-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tournament-fixtures .match-card .match-body {
    align-items: center;
    align-self: stretch;
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 16px 0;
}

.tournament-fixtures .match-card .team {
    align-items: center;
    display: flex;
    flex: 1 0;
    gap: .5rem;
}

.tournament-fixtures .match-card .team.home {
    justify-content: end;
}

.tournament-fixtures .match-card .match-status {
    align-items: center;
    display: flex;
    gap: .25rem;
    justify-content: space-between;
    font-size: 22px;
    font-weight: 700;
}

.tournament-fixtures .match-card .match-footer ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 32px
}

.tournament-fixtures .match-card .match-footer ul li {
    position: relative;
    display: inline-block;
    color: #242328;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    transition: 0.2s ease;
    line-height: 33px;
}

.tournament-fixtures .match-card .match-footer ul li:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -16px; /* половината от gap */
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 20px;
    background-color: #d0ccd2;
}

.tournament-groups .group-registration td {
    padding: 3px;
    font-size: 14px;
    background-color: #f2f1f3;
}

.tournament-groups .group-registration-header th:first-child {
    vertical-align: middle;
    text-align: center;
    border-bottom: 0;
}

.tournament-groups .btn {
    font-size: 14px;
    max-width: min-content;
    margin: 0 auto;
    text-transform: uppercase;
    font-weight: 500;
}

.tournament-groups .group-registration td.active {
    padding: 3px;
    font-size: 14px;
    background-color: #198754;
}

.tournament-groups .group-registration td a {
    text-decoration: none;
    color: #242328;
    font-weight: 500;
}

.tournament-groups .group-registration td.active a {
    color: #fff;
    font-weight: 500;
}

.dark-title {
    font-weight: 800;
    color: #242328;
}

footer {
    background-color: #242328;
}

/* Match Card Flip Animation */
.match-card-wrapper {
    perspective: 1000px;
    position: relative;
}

.match-card {
    position: relative;
    width: 100%;
    transition: transform 0.6s;
}

.match-card.flipped {
    transform: rotateY(180deg);
}

.match-card-front,
.match-card-back {
    width: 100%;
    position: relative;
}

.match-card-front {
    display: block;
}

/* Match Badges (Prediction & Points) */
.match-badges {
    position: absolute;
    top: 0px;
    right: 0px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.match-badges .badge {
    font-size: 1rem;
    padding: 6px 10px;
    font-weight: 700;
    border-radius: 0;
}

.match-card-back {
    display: none;
    transform: rotateY(180deg);
}

.match-card.flipped .match-card-front {
    display: none;
}

.match-card.flipped .match-card-back {
    display: block;
}

.match-body .team img {
    max-width: 48px;
    max-height: 48px;
}

.match-body .match-status .score {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Prediction Inputs */
.match-status.prediction-inputs {
    gap: 8px;
}

.match-status.prediction-inputs input {
    width: 48px;
    height: 34px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 1px solid #dee2e6;
    border-radius: 0;
}

.match-status.prediction-inputs input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.match-status.prediction-inputs span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #666;
}

/* Prediction Actions */
.prediction-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.prediction-actions .btn {
    min-width: 100px;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .match-body {
        padding: 15px 10px;
    }

    .match-body .team img {
        max-width: 36px;
        max-height: 36px;
    }

    .match-body .team .fw-bold {
        font-size: 0.9rem;
    }

    .match-body .match-status {
        flex: 0 0 60px;
        font-size: 1.2rem;
    }

    .match-status.prediction-inputs input {
        width: 50px;
        height: 40px;
        font-size: 1.2rem;
    }

    .prediction-actions .btn {
        min-width: 80px;
        font-size: 0.875rem;
    }
}