/* 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 .lower {
    position: absolute;
    left: 1em;
    right: 1em;
    bottom: 10px;
}

#loginPage .popup-body button.other-button {

    background-color: transparent;
    color: var(--color-button-bg);
    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: 8px;
    right: 8px;
    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);
}

/* high score button */

.high-score-button-container {
    position: relative;
    width: 100%;
    height: 0;
}

.high-score-button-container.hidden {
    display: none;
}

.high-score-button {
    position: absolute;
    background-color: var(--color-circle);
    z-index: 10;
    left: 20px;
    width: 50px;
    top: -10px;
    border: 1px solid var(--color-button-bg);
    color: var(--color-button-bg);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-size: 0.8em;
    line-height: 1em;
    font-weight: 600;
    cursor: pointer;
}

.high-score-close {
    position: absolute;
    right: 13px;
    top: 5px;
}

.high-score-button .display-if-active {
    display: none;
}

.high-score-button.opened{
    width:unset;
    right: 20px;
    font-size: 1.2em;
    line-height: 1.4em;
    padding: 20px;
    background-color: var(--color-circle);
}

.high-score-button.opened .display-if-active {
    display: block;
}

.high-score-button.opened .display-if-inactive {
    display: none;
}


/* medal table button */

.medal-table-button-container {
    position: relative;
    width: 100%;
    height: 0;
}

.medal-table-button-container.hidden {
    display: none;
}

.medal-table-button {
    position: absolute;
    background-color: var(--color-circle);
    z-index: 10;
    right: 20px;
    width: 50px;
    top: -10px;
    border: 1px solid var(--color-button-bg);
    color: var(--color-button-bg);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-size: 0.8em;
    line-height: 1em;
    font-weight: 600;
    cursor: pointer;
}

.medal-table-close {
    position: absolute;
    right: 13px;
    top: 5px;
}

.medal-table-button .display-if-active {
    display: none;
}

.medal-table-button.opened{
    left: 20px;
    width: unset;
    font-size: 1.2em;
    line-height: 1.4em;
    padding: 20px;
    background-color: var(--color-circle);
}

.medal-table-button.opened .display-if-active {
    display: block;
}

.medal-table-button.opened .display-if-inactive {
    display: none;
}


/* 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: #dd9f52;
}

.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-game-week-finished.gold {
    color: gold;
}

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

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

.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;
}

.competition-group-name {
    color: var(--color-primary);
}

/* 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;
}

.leaderboard-table td:nth-child(3).season {
    text-align: right;
    padding-right: 5px;
    position:relative;
    overflow:visible
}

.leaderboard-table .total-points-score {
    border-radius: 20px;
    width:fit-content;
    padding: 0px 8px;
    display: inline-block;
}

/* stacked medal circles placed left of player name */
.medal-stack {
  position:absolute;
  left:-4px;
  top:0.5px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 18px;
  margin-right: -3px;
  font-size: 8px;
  font-weight: 600;
  vertical-align: middle;
  line-height: 11px;
  padding: 0;
  text-align: center;
}

.medal-stack .medal {
  min-width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0.5px 0;
  background: rgba(0,0,0,0.12);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06) inset;
  transition: opacity .2s, transform .15s;
  opacity: 0;
}

/* active (has at least one) styles */
.medal-stack .medal[data-count]:not([data-count="0"]) { opacity: 1; }


/* colours */
.medal-stack .medal.gold { background: gold; }
.medal-stack .medal.silver { background: silver; }
.medal-stack .medal.bronze { background: #dd9f52; }

/* small adjustment for the current-user cell so the medal stack aligns */
.current-user { align-items: center; gap: 6px; }
/* ensure non-current rows keep alignment */
.table .player-column td, .section-table .player-column { vertical-align: middle; }

/* high score table */

.high-score-table {
    width: 100%;
    padding-top: 20px;
    font-weight: 400;
    font-size: 1em;
    margin-left: -10px;
    margin-right: -10px;
}

.high-score-table table {
    width: 100%;
    padding-top: 0;
}

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

/* Player column with ellipsis */
.high-score-table th:nth-child(2),
.high-score-table td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* Fixed width Week column */
.high-score-table th:nth-child(4),
.high-score-table td:nth-child(4) {
    width: 50px;
    max-width: 50px;
    min-width: 50px;
    font-size: 0.6em;
    text-align: left;
}

.high-score-table tr {
    height: 34px;
}

.high-score-table tbody tr {
    color: var(--color-text);
}

/* medal table */

.medal-table {
    width: 100%;
    padding-top: 20px;
    font-weight: 400;
    font-size: 1em;
    overflow-x: auto; 
    box-sizing: border-box;
}

.medal-table table {
    width: 100%;
    padding-top: 0;
    table-layout: fixed;
}


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

/* Player column with ellipsis */
.medal-table th:nth-child(2),
.medal-table td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fixed width Medal column */
.medal-table th:nth-child(3),
.medal-table td:nth-child(3) {
    width: 40px;
    max-width: 40px;
    min-width: 40px;
}

.medal-table th:nth-child(4),
.medal-table td:nth-child(4) {
    width: 40px;
    max-width: 40px;
    min-width: 40px;
}

.medal-table th:nth-child(5),
.medal-table td:nth-child(5) {
    width: 40px;
    max-width: 40px;
    min-width: 40px;
}

.medal-table tr {
    height: 34px;
}

.medal-table tbody tr {
    color: var(--color-text);
}

.medal-table-medal {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--color-table);
    font-size: 0.8em;
}

.medal-table-medal.gold {
    background: gold;
}

.medal-table-medal.silver {
    background: silver;
}

.medal-table-medal.bronze {
    background: #dd9f52;
}

/* 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;
    position: relative;
}

.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-details {
  position: relative; /* make row the containing block for absolute child */
}

/* button styling and absolute placement */
.view-prediction-points-button {
  position: absolute;
  right: 8px;                 /* distance from right edge of row */
  top: 50%;
  transform: translateY(-50%); /* vertically centre */
  z-index: 10;
  width: 20px;
  height: 20px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-primary-opposite);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  pointer-events: auto;
  display: none;
}

.view-prediction-points-button.show {
    display: inline-block;
}

.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: 3px;
    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 .total-points-score {
    background: #888;
    color: #fff;
    border-radius: 20px;
    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;
}

/* then the popup version */

.popup-modal .score-points-header {
    padding: 1em;
}

.popup-modal .prediction-line {
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
}

.popup-modal .teams {
    text-align: center;
    width: 100%;
    font-weight: 600;
}

.popup-modal .teams .score {
    font-size: 1.6rem;
    width: 50px;
    text-align: center;
    display: inline-block;
    position: relative;
    top: 0.2rem;
}

.popup-modal .teams .home-team {
    display: inline-block;
    width: 100px;
    text-align: right;
}
.popup-modal .teams .away-team {
    display: inline-block;
    width: 100px;
    text-align: left;
}

.popup-modal .analysis-table {
    width: auto;
    margin: auto;
}

.popup-modal .analysis-table table {
    table-layout: fixed; /* forces fixed column widths */
    border-collapse: collapse;
}

.popup-modal .analysis-table thead {
    display: none;
}

.popup-modal .analysis-table td.points-cell {
    width: 50px;
    max-width: 50px;
    min-width: 50px;
    /*box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: middle;
    text-align: center;*/
}

/* 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 0;
}

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

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

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

/* full-width Public / Private toggle */
.toggle-row { width:100%; box-sizing:border-box; margin:0.6rem 0; display:flex; align-items:center; margin-bottom: 25px;}
.toggle-full { display:block; width:100%; max-width:480px; }
.toggle-full input { display:none; }

.toggle-track {
  position:relative;
  width:100%;
  height:44px;
  border-radius:22px;
  background:#e6e6e6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:4px;
  box-sizing:border-box;
  user-select:none;
  cursor:pointer;
  font-weight:600;
}

.toggle-option {
  z-index:1;
  flex:1;
  text-align:center;
  color:#666;
  font-size:0.95rem;
  pointer-events:none;
}

/* knob occupies half width and slides left/right */
.toggle-knob {
  position:absolute;
  top:4px;
  left:4px;
  width:calc(50% - 4px);
  height:calc(100% - 8px);
  border-radius:20px;
  background:var(--color-green, #136e30);
  transition: transform .18s ease, background .18s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transform: translateX(0);
  z-index:0;
}

/* text contrast when option active */
.toggle-option.public { color:#fff; }
.toggle-full input:checked + .toggle-track .toggle-option.public { color: #666; }
.toggle-full input:checked + .toggle-track .toggle-option.private { color: #fff; }

/* move knob to right when checked */
.toggle-full input:checked + .toggle-track .toggle-knob {
  transform: translateX(100%);
}

/* responsive max width */
@media (max-width:420px) {
  .toggle-track { height:40px; }
  .toggle-knob { border-radius:18px; }
  .toggle-option { font-size:0.9rem; }
}

#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 following section */
/* league list: left = handle (above) + name, right = fixed-width follow button */
.league-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  box-sizing: border-box;
}

/* left column: stacked handle above name, takes remaining space and scrolls horizontally if content is wide */
.league-name-and-handle {
  flex: 1 1 auto;      /* take remaining space */
  min-width: 0;        /* allow proper flex shrinking */
  display: flex;
  flex-direction: column;
  overflow-x: auto;    /* horizontal scrolling when text too long */
  -webkit-overflow-scrolling: touch;
}

/* each line doesn't wrap so the container can scroll horizontally */
.league-handle,
.league-name {
  white-space: nowrap;
  display: inline-block;
  padding-right: 8px;  /* breathing room for scroll */
  overflow: visible;
  text-overflow: clip;
}

/* visual styles (adjust to your theme) */
.league-handle {
  font-family: monospace;
  font-size: 0.9rem;
}
.league-name {
  font-weight: 600;
  font-size: 1rem;
  margin-top: 4px;
}

/* follow button: fixed width on the right */
.follow-league-button {
  flex: 0 0 100px;
  width: 100px;
  height: 36px;
  align-self: center;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background: var(--color-primary, #2b8cf5);
  font-weight: 600;
}

.follow-league-button.unfollow {
    background: var(--color-red, #e02424);
}

/* optional: hide native scrollbar but keep scrollability (modern browsers) */
.league-name-and-handle::-webkit-scrollbar { height: 8px; }
.league-name-and-handle::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 6px; }

/* league list: left = handle (above) + name, right = fixed-width follow button */
.league-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  box-sizing: border-box;
}

/* left column: stacked handle above name, takes remaining space and scrolls horizontally if content is wide */
.league-name-and-handle {
  flex: 1 1 auto;      /* take remaining space */
  min-width: 0;        /* allow proper flex shrinking */
  display: flex;
  flex-direction: column;
  overflow-x: auto;    /* horizontal scrolling when text too long */
  -webkit-overflow-scrolling: touch;
}

/* each line doesn't wrap so the container can scroll horizontally */
.league-handle,
.league-name {
  white-space: nowrap;
  display: inline-block;
  padding-right: 8px;  /* breathing room for scroll */
  overflow: visible;
  text-overflow: clip;
}

/* visual styles (adjust to your theme) */
.league-handle {
  font-family: monospace;
  font-size: 0.9rem;
}
.league-name {
  font-weight: 600;
  font-size: 1rem;
  margin-top: 4px;
}

/* follow button: fixed width on the right */
.follow-league-button {
  flex: 0 0 90px;
  width: 90px;
  height: 36px;
  align-self: center;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background: var(--color-green, green);
  color: #fff;
  font-weight: 600;
}

/* optional: hide native scrollbar but keep scrollability (modern browsers) */
.league-name-and-handle::-webkit-scrollbar { height: 8px; }
.league-name-and-handle::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 6px; }


/* 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 #manage-group-handle-section {
    margin-top: 30px;
}

#manageGroupPage #manage-group-handle {
    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 #unfollow-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;
}

/* updating name section */
#update-name-message {
    display: none;
    padding: 0px;
}

#update-name-message.success {

}

#update-name-message.error {
    color: #ff4444;
}
