/* login page overrides */
#loginPage .popup-header{
    align-items: center;
}

#loginPage .popup-title{
    flex: 1; 
    text-align: center;
}

#loginPage .popup-body{
    background-color: var(--color-darker-bg);
}

#loginPage #auth-ui{
    align-items: center;
    text-align: center;
    font-size: 1.2em;
}

#loginPage #auth-ui input{
    font-size: 1.0em;
    line-height: 1.0em;
    padding: 8px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
}

#loginPage .popup-body button {
    font-size: 1.0em;
    line-height: 1.0em;
    padding: 8px;
    border-radius: 10px;
    width: 100%;
    margin-bottom: 20px;
    background-color: var(--color-button-bg);
    color: var(--color-button-text);
    border-color: var(--color-button-border);
}

#loginPage .popup-body button.disabled {
    background-color: var(--color-button-bg-disabled);
    color: var(--color-button-text-disabled);
    display: none;
}

/* account section */

.accountSection input{
    font-size: 1.0em;
    line-height: 1.0em;
    padding: 8px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.accountSection button {
    font-size: 1.0em;
    line-height: 1.0em;
    padding: 8px;
    border-radius: 10px;
    margin-bottom: 20px;
    background-color: var(--color-button-bg);
    color: var(--color-button-text);
    border-color: var(--color-button-border);
}

.accountSection .float-bottom{
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    padding: 12px;
    background-color: var(--color-darker-bg);
}

#loginPage .popup-body #delete-user {
    font-size: 1.2em;
    line-height: 1.2em;
    padding: 8px;
    border-radius: 10px;
    margin: 0px;
    position: absolute;
    bottom: 20px;
    left: 30px;
    right: 30px;
    width: unset;
    background-color: red;
    color: white;
}

#loginPage .popup-body #delete-user.disabled {
    background-color: #331111;
    color: #444;
    border-color: #331111;
    display: none;;
}

/* competition header */

.competition-header-container {
    margin: auto;
    text-align: center;
}

.competition-header, .competition-header-season, .competition-header-next, .competition-header-detailed{
    font-size: var(--font-size-competition-header);
}

/* top circle */

.top-circle {
    position: relative;
    margin: 20px auto;
    width: 130px;
    height: 130px;
    flex: 0 0 auto;
    background: var(--color-circle);
    color: var(--color-circle-text);
    border-radius: 50%;
    border-width: 10px;
    border-style: solid;
    border-color: var(--color-circle-border);
    overflow: visible;
}

.top-circle.gold {
    border-color: gold;
}

.top-circle.silver {
    border-color: silver;
}

.top-circle.bronze {
    border-color: #cd7f32;
}

.top-circle.league {
    border: 0;
    width: 150px;
    height: 150px;
}

.top-circle.predict-show {
    border: 0;
    width: 150px;
    height: 150px;
    background: var(--color-primary);
    color: var(--color-primary-opposite);
    position: relative;
    overflow: hidden;
}

.top-circle.predict-show.predicted {
    background: var(--color-circle);
    color: var(--color-circle-text);
}

.predicted-show {
    display: none;
}

.predicted .predicted-show {
    display: inline-block;
}   

.predicted .predicted-hide {
    display: none;
}   

.top-circle.predict-show.getting-close::after {
    content: "";
    position: absolute;
    top: 0; left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0) 100%
    );
    animation: shimmer 3.5s infinite;
    pointer-events: none;
    z-index: 2;
    border-radius: 50%;
}

@keyframes shimmer {
    0% {
        left: -75%;
    }
    57% {
        left: 125%;
    }
    100% {
        left: 125%; /* Hold at the end for the pause */
    }
}

.top-circle .predict-now-text {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.5rem;
}

.top-circle .next-timer {
    margin-top: 5px;
    font-size: 1.2rem;
    line-height: 1.3rem;
}

.top-circle-inner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;    /* Vertical centering */
    justify-content: center;
}

.top-circle-content {

}

.competition-game-week-status {
    font-size: 1rem;
    font-weight: 600;
}

.competition-game-week-points, .competition-season-week-points {
    font-size: 2rem;
    .points{
        font-size: 0.8rem;
        font-weight: 600;
    }
} 

.competition-season-medal-area {
    display: flex;
    gap: 6px; /* or whatever spacing you want */
    align-items: center;
    color: var(--color-circle)
}

.competition-season-medal {
    display: inline-flex;      /* inline-flex allows them to sit side by side */
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin: 3px;               /* optional: space between medals */
    vertical-align: middle; 
    border-radius: 20px;   /* aligns with text if mixed */
}

.competition-season-medal.gold {
    background: gold;
}

.competition-season-medal.silver {
    background: silver;
}

.competition-season-medal.bronze {
    background: #cd7f32;
}

.leaderboard-table {
        max-width: 300px;
}

.leaderboard-header {
    background: var(--color-bg-top-nav, #fff);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.leaderboard-footer {
    background: var(--color-bg-top-nav, #fff);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    height:20px;
    margin-top: 0;
}

/* Autosize Rank column */
.leaderboard-table th:nth-child(1),
.leaderboard-table td:nth-child(1) {
    width: 50px;
    max-width: 50px;
    min-width: 50px;
}

/* Fixed width Player column with ellipsis */
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
    width: 160px;
    max-width: 160px;
    min-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fixed width Points column */
.leaderboard-table th:nth-child(3),
.leaderboard-table td:nth-child(3) {
    width: 50px;
    max-width: 50px;
    min-width: 50px;
}

/* main prediction toggle */

.predict .predict-hide {
    display: none;
}

.not-predict .predict-show {
    display: none;
}

/* predict page */
/* LOGIN POPUP SLIDE FROM TOP */
#predictPage {
    display: none;
    position: absolute;
    z-index: 2000;
    left: 0; right: 0; top: 0; bottom: 0;
}
#predictPage.active {
    display: block;
}
#predictPage .popup-content {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translate(-50%, -100%);
    transition: transform 0.4s cubic-bezier(.77,0,.18,1);
}
#predictPage.active .popup-content {
    transform: translate(-50%, 00px); /* Slides down into view */
}

#scoreSelectPopup button:not(#scoreSelectCancel){
    margin: 3px; width:35px; height:35px; border-radius: 20px;
    border: none;
    color: var(--color-text);
    background-color: var(--color-bg);
    font-size: 1.2em;
}

#scoreSelectPopup button#scoreSelectCancel{
    margin-top: 10px; 
    border: none;
    background-color: transparent;
}

/*prediction match table styles */

.match-table {
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
}

.match-table table {
    border-radius: 16px;
    overflow: hidden;
    /* For some browsers, you may also need: */
    border-collapse: separate;
    border-spacing: 0;
}

.match-table table,
.match-table th,
.match-table td,
.match-table tr {
    border: none !important;
    box-shadow: none !important;
    background: var(--color-bg-table, #fff);
    text-overflow: unset;
}

/* Remove outline if any */
.match-table th:focus,
.match-table td:focus {
    outline: none !important;
}

.match-table td.versus {
    padding:0;
    background: #fff;
}

.match-table th {
    height:0;
}

.match-table tr.match-date td {
    font-size: 0.6em;
    height: 16px;
    padding: 0;
    border: none;
    line-height: 16px;
}

.match-table tr.match-details td {
    height: 28px;
    padding: 0 0.25em;
    line-height: 28px;
}

.match-table thead tr.match-details td {
    height: 10px;
    line-height: 10px;
}

.match-table .match-details .team {
    font-weight: 400;
}

.match-table .match-details .score {
    font-size: 1.4rem;
    font-weight: 600;
    width:20px;
    text-align: center;
}

.match-table .score-input {
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    border: none;
    background: #eee;
    outline: none;
    appearance: textfield;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    border-radius: 6px;
    width: 20px;
    height: 28px
}

.match-table #match-table-body .match-details .score{
    background-color: var(--color-lifted-bg-table);
}

.match-table .match-details .versus {
    font-size: 1.0rem;
    width:10px;
    opacity: 0.75;
}

.match-table tr.form-bar td {
    height: 2px;
    padding: 0;
    line-height: 2px;
}

.match-table tr.form-bar td[colspan] {
    background: none;
}

.match-table tr.form-bar .form-bar-inner {
    height: 8px; /* or 0.5px, but 2px is more reliably visible */
    background: none;
    width: 100%;
    margin: 0 auto;
    border-radius: 2px;
    font-size: 0;
}

.match-table tr.form-bar .form-bar-segment {
    height: 2px;
    padding: 0;
    display: inline-block;
    width: 33.33%;
    margin: 0;
    vertical-align: top;
}

.match-table tr.form-bar .form-bar-segment.home-win {
    background: var(--color-home-win, #0f0);
}

.match-table tr.form-bar .form-bar-segment.draw {
    background: var(--color-draw, #666);
}

.match-table tr.form-bar .form-bar-segment.away-win {
    background: var(--color-away-win, #f00);
}

.match-table tr.match-spacer td {
    height: 8px;
    padding: 0;
    line-height: 8px;
}

/* analysis table styles */

.analysis-table-container {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100vw;
    overflow: auto;
}

.analysis-table th,
.analysis-table td {
    padding: 0.5em 0.25em;
    text-align: center;
    z-index: 1;
}

.analysis-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    text-align: left;
    font-weight: 400;
    padding: 0.5em;
    border-spacing: 0 !important;
    background: #fafafa;
}

.analysis-table tr:nth-child(odd) .sticky-col:not(.sticky-header) {
    background: var(--color-bg-table, #fff);
}

.analysis-table tr:nth-child(even) .sticky-col:not(.sticky-header) {
    background: var(--color-bg-table2, #f0f0f0);
}

/* Remove all borders first */
.analysis-table {    
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.analysis-table,
.analysis-table th,
.analysis-table td,
.analysis-table tr {
   
}

/* Add only vertical gridlines (right border for each cell except the last) */
.analysis-table th,
.analysis-table td {
    border-right: 1px solid var(--color-border-analysis-table);
}

/* Remove the right border from the last cell in each row */
.analysis-table th:last-child,
.analysis-table td:last-child {
    border-right: none;
}

.analysis-table tr:nth-child(odd) {
    background: var(--color-bg-table, #fff);
}

.analysis-table tr:nth-child(even) {
    background: var(--color-bg-table2, #f0f0f0);
}

.analysis-table .match-column {
    width: 50px;
    min-width: 50px;
}

.analysis-table .player-column {
    width: 120px;
    min-width: 120px;
    max-width: 150px;
}

.analysis-table #analysis-table-body .player-column {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analysis-table tr {
    color: var(--color-table);
}

.small-match-result {
    text-align: center;
    font-size: 0.8rem;
    line-height: 0.8rem;
    margin-bottom: 8px;
}

.small-match-result .versus {
    font-size: 0.6rem;
    line-height: 0.6rem;
    opacity: 0.75;
}

.analysis-table .scoreline {
    font-size: 1.2rem;
    line-height: 1.2rem;
    text-align: center;
}

.analysis-table .points-score {
    background: #888;
    color: #fff;
    border-radius: 20px;
    font-size: 0.8rem;
    width: 30px;
    margin: auto;
    margin-bottom: 3px;
}

.analysis-table .sticky-header {
    position: sticky;
    top: 0;
    background: var(--color-bg-top-nav, #fff);
    color: var(--color-table-header, #fff);
    z-index: 3;
    font-weight: 600;
}

.analysis-table .sticky-col.sticky-header {
    z-index: 4;
    font-weight: 400;
}

/* this for the add-group page */

#addGroupPage {
    display: none;
    position: absolute;
    z-index: 2000;
    left: 0; right: 0; top: 0; bottom: 0;
}
#addGroupPage.active {
    display: block;
}
#addGroupPage .popup-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(.77,0,.18,1), opacity 0.3s;
    width: 100%;
    height: 100%;
}
#addGroupPage.active .popup-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

#addGroupPage .add-group-content {
    padding: 1em;
}

#addGroupPage #group-name-input {
    font-size: 1.2em;
    padding: 10px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
}

#addGroupPage #add-group-button {
    font-size: 1.2em;
    padding: 10px;
    border-radius: 10px;
    width: 100%;
    margin-bottom: 20px;
    background-color: var(--color-button-bg);
    color: var(--color-button-text);
    border-color: var(--color-button-border);
}

#addGroupPage #add-group-button.disabled {
    background-color: var(--color-button-bg-disabled);
    color: var(--color-button-text-disabled);
}

#addGroupPage .group-added-content {
    margin: 15px;
}

#addGroupPage #added-group-name {
    font-weight: 600;
}

#addGroupPage #added-group-link {
    font-weight: 600;
    background-color: var(--color-button-text);
    color: var(--color-button-bg);
    border-radius: 10px;
    margin-top: 10px;
    width:100%;
    word-break: break-all;
}

#addGroupPage #copy-group-link-btn {
    font-weight: 600;
    background-color: var(--color-button-bg);
    color: var(--color-button-text);
    padding: 10px;
    border-radius: 10px;
    margin-top: 10px;
    width:100%;
    box-sizing: border-box; 
}

/* this for the manage-group page */

#manageGroupPage {
    display: none;
    position: absolute;
    z-index: 2000;
    left: 0; right: 0; top: 0; bottom: 0;
}
#manageGroupPage.active {
    display: block;
}
#manageGroupPage .popup-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(.77,0,.18,1), opacity 0.3s;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}
#manageGroupPage .popup-body {
    height: 100%;
    display: flex;
    flex-direction: column;
}
#manageGroupPage.active .popup-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

#manageGroupPage .manage-group-content {
    padding: 1em;
    padding-bottom: 0;
    flex: 0 0 auto;
}

#manageGroupPage .detail-group-content {
    padding: 1em;
    flex: 1 1 0%;   /* take up remaining space */
    min-height: 0;  /* allow to shrink if needed */
    display: flex;
    flex-direction: column;
}

#manageGroupPage .detail-group-title {
    flex: 0 0 auto;
}
#manageGroupPage .detail-group-members {
    flex: 1 1 0%;
}
#manageGroupPage .detail-group-button {
    flex: 0 0 auto;
}
#manageGroupPage #manage-group-name-input {
    font-size: 1.2em;
    padding: 10px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
}

#manageGroupPage #change-group-name-button {
    font-size: 1.2em;
    padding: 10px;
    border-radius: 10px;
    width: 100%;
    margin-bottom: 20px;
    background-color: var(--color-button-bg);
    color: var(--color-button-text);
    border-color: var(--color-button-border);
}

#manageGroupPage #change-group-name-button.disabled {
    background-color: var(--color-button-bg-disabled);
    color: var(--color-button-text-disabled);
}


#manageGroupPage #manage-group-link {
    font-weight: 600;
    background-color: var(--color-button-text);
    color: var(--color-button-bg);
    border-radius: 10px;
    margin-top: 10px;
    width:100%;
    word-break: break-all;
}

#manageGroupPage #copy-manage-group-link-btn {
    font-size: 1.2em;
    font-weight: 600;
    background-color: var(--color-button-bg);
    color: var(--color-button-text);
    padding: 10px;
    border-radius: 10px;
    margin-top: 10px;
    width:100%;
    box-sizing: border-box; 
}

#manageGroupPage #detail-group-members {
    overflow-y: auto;
}

#manageGroupPage #leave-group-button {
    font-size: 1.2em;
    font-weight: 600;
    background-color: red;
    color: var(--color-text);
    padding: 10px;
    border-radius: 10px;
    margin-top: 20px;
    width:100%;
    box-sizing: border-box; 
}

#manageGroupPage .section-table {
    padding: 0;
}

#manageGroupPage .admin-badge {
    color: var(--color-text); 
    background: var(--color-bg); 
    border-radius:4px; 
    padding:2px 6px; 
    font-size:0.8em; 
    margin-left:8px;
    position: relative;
    top: -1px;
}

/* admin section */
#admin-games{
    margin-top: 20px;
}

#admin-games td{
    padding-bottom: 10px;
}
