/* Round selector tabs (shown when multiple rounds are active) */
.round-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.round-selector-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
}
.round-selector-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}
.round-selector-btn.active {
    background-color: rgba(191, 22, 34, 0.5);
    border-color: #BF1622;
    cursor: default;
}

.header-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 20px;
    margin-top: 20px;
}
.round-title, .match-details-title {
    text-align: center;
    color: #fff;
    font-size: 2em;
    font-weight: 500;
    margin: 0;
}
.match-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}
.match-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 13px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-size: 1.2em;
    padding-left: 20px;
    padding-right: 20px;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
}
.match-item:hover {
    text-decoration: none;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
    transition: transform 0.3s ease;
}
.team {
    display: flex;
    align-items: center;
    flex-grow: 1;
}
.team-left {
    justify-content: flex-start;
    gap: 10px;
}
.team-right {
    justify-content: flex-end;
    gap: 10px;
}
.team-logo {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}
.team-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.team-name {
    font-weight: bold;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100px;
    text-align: right;
}
.team-right .team-name {
     text-align: left;
}
.match-time-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}
.match-time {
    font-weight: normal;
    font-size: 0.7em;
    text-align: center;
}
.match-date {
    font-size: 0.7em;
    text-align: center;
}
.match-item.selected {
    background-color: rgba(191, 22, 34, 0.4);
    border-color: rgba(191, 22, 34, 0.25);
}
.match-item .checkmark-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    color: #BF1622;
    font-size: 1em;
    display: none;
}
.match-item.selected .checkmark-icon {
    display: block;
}
@media (max-width: 767px) {
    .round-title {
        font-size: 1.5em;
    }
    .match-grid {
        grid-template-columns: 1fr;
    }
    .match-item {
        font-size: 1em;
    }
}
.match-grid.odd-count .match-item:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    max-width: calc(50% - 5px);
}
@media (max-width: 767px) {
    .match-grid.odd-count .match-item:last-child {
        justify-self: stretch;
        max-width: 100%;
    }
}
.match-details-container {
    display: none;
    flex-direction: column;
    align-items: center;
}
.back-button {
    background-color: #BF1622;
    border: none;
    color: #fff;
    padding: 4px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    align-self: flex-end;
    position: absolute;
    right: 0;
    display: none;
    transition: background-color 0.3s ease;
    transform: translate(-5px, 0px);
}

@media (max-width: 767px) {

  .back-button {
    padding: 6px 12px;
    font-size: 0.9em;
    transform: translate(-6px, 0px);
}

  .instructions-content .back-button {
    display: inline-block !important;
  }

}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* More specific rule to prevent .week-navigation button from overriding .back-button */
.week-navigation .back-button {
    background-color: #BF1622 !important;
    border: none !important;
    color: #fff !important;
    padding: 4px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 1em !important;
    opacity: 1 !important;
    transition: background-color 0.3s ease !important;
}

.week-navigation .back-button:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

@media (max-width: 767px) {
    .week-navigation .back-button {
        padding: 6px 12px !important;
        font-size: 0.9em !important;
    }
}

.match-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    max-width: 650px;
    gap: 15px; /* Added gap for spacing */
}
.match-header .team-info {
    flex-grow: 1;
    text-align: center;
    cursor: pointer;
    transition: color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 5px;
}
.match-header .team-info.active {
    color: #fff;
    background-color: rgba(191, 22, 34, 0.25);
}
.match-header .team-info:not(.active) {
    color: #999;
    opacity: 0.8;
}
.match-header .team-info:not(.active) .team-name {
    color: #999;
}
.match-header .team-logo {
    width: 40px;
    height: 40px;
}
.match-header .match-time-info .match-data {
    font-size: 0.8em;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
}
.match-header .match-time-info .match-time {
    font-size: 0.7em;
    color: #fff;
    font-weight: normal;
}
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    width: 100%;
}
.player-card {
    background-color: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 0px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
   
    font-size: 1em;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: background-color 0.3s, border-color 0.3s;
}
.player-card:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.player-card.selected {
    background-color: rgba(191, 22, 34, 0.4);
    border-color: rgba(191, 22, 34, 0.25);
}
.player-card .checkmark-icon {
    position: absolute;
top: 3px;
right: 4px;
color: #BF1622;
font-size: 1em;
    display: none;
}
.player-card.selected .checkmark-icon {
    display: block;
}
.player-card .left-section {
    display: flex;
    align-items: center;
    gap: 15px;
}
.player-card .player-photo {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 5px;
}
.player-card .player-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}
.player-card .player-name {
    font-weight: bold;
    font-size: 1.1em;
    margin: 0;
    white-space: nowrap;
    display: flex;
    align-items: baseline;
    gap: 5px;
}
.player-card .player-nationality-inline {
    font-size: 0.7em;
    font-weight: normal;
    opacity: 0.8;
    display: none;
}
.player-card .player-position {
    font-size: 0.9em;
    opacity: 0.8;
    margin: 0;
    white-space: nowrap;
}
.player-card .right-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    flex-shrink: 0;
}
.player-card .player-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
}
@media (max-width: 767px) {
    .player-grid {
        grid-template-columns: 1fr;
    }
}


.submit-button {
    display: none;
    background-color: #BF1622;
    border: none;
    color: white;
    padding: 5px 34px;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 0px;
    transition: background-color 0.3s ease;
    width: 100%;
    max-width: 236px;
    text-transform: uppercase;
    font-weight: 500;
    margin-top: 9px;
}

.submit-button:hover {
    background-color: #a6121e;
}
/* Style for the container outside <main> */
#selected-players-container {
    margin-top: 0px;
    padding: 13px 0;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background-color: rgba(0,0,0,0.9);
    box-shadow: 0 4-8px rgba(0, 0, 0, 0.2);
    position: fixed;
    width: 100%;
    max-width: 100%;
    bottom: 0px;
    left: 0px;
}

.cart-title {
    width: 100%;
    text-align: center;
    color: #fff;
    font-size: 1.2em;
    font-weight: 500;
    margin-bottom: 10px;
    margin-top: 5px
}

/* Updated Swiper styles */
.swiper-container {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    padding: 10px 15px; 
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
}

.prediction-card {
    background-color: rgba(255, 255, 255, 0.08);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    width: 100px; /* Small fixed width for cards */
}

.prediction-card:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.predicted-player-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;

}

.predicted-player-name {
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.message-text {
color: #ccc;
text-align: center;
padding: 0px;
width: 100%;
}

/* Player nudge/vibrate animation */
@keyframes nudge-vibrate {
0% { transform: translateX(0); }
25% { transform: translateX(-2px); }
50% { transform: translateX(2px); }
75% { transform: translateX(-2px); }
100% { transform: translateX(0); }
}

.vibrate-active {
animation: nudge-vibrate 0.2s linear infinite;
}

#details-time {
font-weight: 100;
font-size: 14px;
}


.leaderboard-container {

    margin-bottom: 250px;
}


@media (max-width: 767px) {
.team-name {
    width: 73px;
}

.match-item{
    padding-left: 0px;
    padding-right: 0px;
}

.team-name {
    font-size: 0.8em;
}

#details-date{
  font-size: 10px;
}

.match-header .team-logo {
    width: 25px;
    height: 25px;
}
.match-header {
    font-size: 11px;
}
#details-time {
    font-size: 11px;
}
.player-card .player-name {
    font-size: 12px;
}

.cart-title {
    font-size: 1em;
    font-weight: bold;
    margin-bottom:0px
}

.leaderboard-container {
    margin-bottom: 250px;
}

#selected-players-container {
    padding-left: 10px;
    padding-right: 10px;
}

.prediction-card {
    background-color: rgba(255, 255, 255, 0);
}

.player-card .player-position {
    font-size: 10px;
}

}
.placeholder-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    /*background-color: rgba(255, 255, 255, 0.1);*/
    display: flex;
    align-items: center;
    justify-content: center;
}
.placeholder-avatar i {
    font-size: 50px;
    color: #ccc;
    opacity:0.5
}
.instructions-note {
    color: #a0a0a0;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
    text-align: center;
}

/* New CSS for the flying element animation */
.flying-prediction {
    position: fixed;
    border-radius: 50%;
    background-color: #BF1622;
    z-index: 10000;
    box-shadow: 0 0 15px rgba(191, 22, 34, 0.7);
    transition: all 0.5s cubic-bezier(0.6, -0.28, 0.74, 0.05); /* Aggressive curve for a "swoosh" effect */
    opacity: 1;
    pointer-events: none; /* Ensure it doesn't interfere with clicks */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Initial size */
    width: 30px;
    height: 30px;
}

/* Submission Countdown Timer */
.submission-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1em;
    color: #fff;
    margin-top: 10px;
    justify-content: center;
}

.submission-countdown i {
    font-size: 1.2em;
}

#countdown-timer {
    font-weight: bold;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
}

@media (max-width: 767px) {
    .submission-countdown {
        font-size: 1em;
        gap: 3px;
        flex-wrap: wrap;
        margin-top: 5px;
        margin-bottom: 15px;
    }

    .submission-countdown i {
        font-size: 0.9em;
    }

    #countdown-timer {
        font-size: 0.85em;
    }

    #countdown-text {
        font-size: 0.75em;
    }

    .instructions-note {
        font-size: 0.7em;
        margin-bottom: 8px;
        padding: 5px;
    }
}
