/* User progress bar row and label styles */
#user-progress {
    width: 100%;
}

#current-lobby-settings {
    display: none;
    flex-wrap: nowrap;
    /* gap: 1rem; */
    flex-direction: row;
    width: min(100%,95vw);
    padding: 1rem 2rem;
    border: 1px solid var(--4);
}

#reload-prompts {
    display: none;
    padding: 1rem;
    flex-direction: row;
    flex-basis: 100%;
    justify-content: center;
}
.user-progress-wins {
    font-size: 2.5rem;
    margin: 0rem 1rem;
}
.user-progress-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0;
    gap: 0rem;
    width: 28rem;
}
.user-progress-name {
    font-size: 1.2rem;
    width: auto;
    padding-right: 0.8rem;
    /* margin: 0.2rem 0.8rem; */
}
.user-progress-score {
    min-width: 2.5rem;
    text-align: right;
}
#rainbow_text_animated {
    color: var(--emphasis-color) !important;
}

#timer-display {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    min-width: 5.5rem;
    display: flex;
    justify-content: center;
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.user-progress-bar-outer {
        background-color: var(--grayed-out-background);
        height: 2.2rem;
        width: 40vw;
        border-radius: 0;
        overflow: hidden;
        position: relative;
        flex: none;
}

.user-progress-bar-inner {
        background-color: var(--text-color);
        height: 100%;
        width: 0%;
        transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
}
.user-progress-score {
        min-width: 2.5rem;
        text-align: right;
}

#game-global {
    display: none;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    /* border-top: 1px solid var(--border-color); */
}


html {
    --text-size: 1.4rem;
}

#game-container {
    display: flex;
    height: 100vh;
    min-width: 0;
    padding: 0;
    justify-content: center;
    width: 40rem;
    justify-content: space-around;
    flex-direction: column;
}

#user-progress-container {
    /* flex: 0 1 0; */
    display: flex;
    padding: 0rem 1.5rem;
    flex-direction: column;
    /* border-left: 2px solid var(--border-color); */
}

#game-upper {
    margin: 0 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 36rem;
    gap: 1rem;
}

#game {
    margin: 0 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 36rem;
    gap: 1rem;
}

#current-lobby {
    font-family: 'Courier New', Courier, monospace;
}

#current-lobby-code {
    display: inline;
}

#current-start-target, #current-lobby {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    width: 100%;
    text-align: left;
}

.active-lobby-title {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 2rem 0.5rem 0.5rem 0;
    color: var(--grayed-out-color);
}

#lobby-list, #user-list {
    font-size: var(--text-size);
    color: var(--text-color);
    width: min(100%, 36rem);
    margin-bottom: 0.5rem;
}

#total-rounds {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 10rem;
}

#user-list-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#surrender-game {
    position: absolute;
    left: 10;
    top: 10;
    background: transparent;
    color: var(--grayed-out-color);
    border: none;
    outline: 1px solid var(--border-color);
    font-size: var(--button-font-size, 1.5rem);
}

#start-game {
    margin-top: 2rem;
    min-height: 48px;
    min-width: 160px;
    width: 100%;
    max-width: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--button-font-size, 1.5rem);
    background: var(--4green);
    color: var(--text-color);
    cursor: pointer;
    border: none;
    border-radius: 8px;
    transition: background 0.2s, border 0.2s;
}

#start-game:hover, #start-game:focus {
    background: var(--4green-emph);
}
/* 
#user-progress {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: 80vh;
    background: var(--background-color);
    border-style: solid;
    border-width: 1px 0 1px 1px;
    border-color: var(--border-color);
    box-shadow: -2px 0 8px rgba(0,0,0,0.04);
    z-index: 20;
    padding: 2rem 1.2rem 2rem 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
} */

#target {
    font-size: 1.8rem;
    color: var(--text-color);
    /* margin: 1rem 0 1rem; */
    width: 100%;
    text-align: center;
}

#wordspace {
    height: auto !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    padding: 0 !important;
    margin: 2rem 0 !important;
}

#wordspace table {
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    border-collapse: collapse;
}

#wordspace td {
    border: none;
    padding: 0.5rem 1.4rem;
    min-width: 3em;
    text-align: center;
    font-size: min(5vw, 2.4rem);
}


#wordspace a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s;
    display: inline-block;
}

#wordspace a.link--starting {
    pointer-events: none;
}
#wordspace a:hover {
    color: var(--hover-color);
    text-decoration: none;
}

#wordspace a:active {
    /* transition: transform 0.3s; */
    transform: scale(0.88);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.race-container {
    display: flex;
    max-width: 52rem;
    width: 42rem;
    flex-direction: column;
    align-items: center;
    /* overflow-y: scroll; */
    width: 100%;
    /* height: 800px; */
    height: auto;
}

.left-align-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.join-lobby-container {
    display: flex; 
    gap: 0rem;
    width: 100%;
}

#create-lobby{
    width: 100%;
}

#join-lobby{
    border-left: none;
}

#create-lobby, #join-lobby {
    min-height: 56px;
    min-width: 12rem;
    /* width: 100%; */
    /* max-width: 400px; */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-size: var(--button-font-size, 2rem);
    background: var(--4green);
    color: var(--text-color);
    cursor: pointer;
    border: 1px solid var(--border-color);
    outline: none;
    transition: background 0.2s, border 0.2s;
}

#join-lobby:hover, #join-lobby:focus, #create-lobby:hover, #create-lobby:focus {
    background: var(--4green-emph);
}


.group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    width: min(36rem, 90vw);
}

label { 
    font-size: 1.4rem;
    color: var(--text-color);
    margin: 0 0;
}
input {
    font-size: 1.8rem !important;
    padding: 0.8rem;
    width: 100%;
    min-width: 200px;
    max-width: 400px;
    color: var(--text-color);
    background: transparent;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}
#current-lobby-display{
    display: none;
}
#username-lobby {
    width: 36rem;
    max-width: 90vw;
    /* flex-wrap: wrap; */
    /* max-width: 40rem;
    width: 40rem; */
}
.grayed-out-color{
    color: var(--grayed-out-color);
}
#lobby-code-label, #username-label, .start-label, .target-label {
    font-style: italic;
    margin: 0 0;
    display: inline-block;
    color: var(--grayed-out-color);
}

#current-prompts-container {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    justify-content: space-between;
    width: min(24rem, 90vw);
    max-width: min(26rem, 90vw);
}

#current-starts, #current-targets {
    flex-basis: 50%;
    font-size: 1.8rem;
    color: var(--text-color);
    margin: 0 0;
    min-width: 8rem;
}

.start-label, .target-label {
    display: block;
    font-size: 1.4rem;
}

.start-entry, .target-entry{
    margin: 0 0;
    display: block;
}


#username-display {
    font-size: 1.8em;
    margin: 0 0;
}
#username:focus ,#join-code:focus, #lobby-code:focus {
    border: 1.5px solid #888;
    outline: none;
}

#help-button {
    display: inline-block;
}

#lobby-info {
    margin-top: 3rem;
}

.results-title-divider {
    opacity: 0.3;
}
.results-title-container{
    display: flex;
    align-content: center;
    justify-content: center;
    align-items: center;
    font-size: 2.9rem;
    font-weight: 400;
    width: 100vw;   
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
    margin: 1rem 0;
    gap: 2rem;
    padding: 0.25rem 0;
    opacity: 0.5;
    
}

.results-title {
    display: inline-block;
    font-size: 2.4rem;
    font-weight: 400;
    font-style:italic;
    margin: 0 0;
}

#lobby-subtitle {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0 0.5rem 2.5rem 0;
    color: var(--grayed-out-color);
}

#lobby-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
}

#user-list-title {
    font-style: italic;
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--grayed-out-color);
}


.square-btn:hover, .square-btn:focus {
    background: #f0f4f8;
    border: 2px solid #222;
}

#current-start-target, #current-lobby, #lobby-list, #user-list {
    width: 100%;
    margin: 0 auto;
}

#current-start-target, #total-rounds-container {
    flex:1
}

#total-rounds-container{
    /* min-width: 8rem; */
}

.total-rounds-label, #user-list-title {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--grayed-out-color);
    margin: 0 0 0.5rem;
}

.total-rounds-option {
    padding: 0.4rem;
    cursor: pointer;
}

.total-rounds-option.selected {
    /* border: 2px solid #007BFF;  */
    border: 2px solid var(--grayed-out-color); 
}

.selected-option {
    color: var(--text-color);
    padding: 0.4rem;
    border: 1px solid var(--text-color);
    border-radius: 6px;
}

.total-rounds-options {
    display: flex;
    justify-content: space-between;
    /* width: 20vw; */
    font-size: 1.4rem;
    color: var(--text-color);
    margin-top: 0rem;
}

#finish-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(42rem, 90vw);
    padding: 2rem 0rem;
}

#play-again-button {
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* padding: 1rem; */
    margin: 0.2rem 0 0.4rem;
    transition: opacity 0.2s;
}

#play-again-button:hover {
    opacity: 0.7;
}

.play-icon {
    margin-bottom: -0.8rem;
}

.hidden {
  opacity: 0;
  display: none;
  visibility: hidden;
}

.play-again-text {
    font-size: 1rem;
    color: var(--hover-color);
    font-style: italic;
}

#new-prompts {
    background:none; 
    border:none;
    cursor:pointer; 
    padding:0; 
    outline: none;
    color: var(--text-color);
}

.user-winner {
    border: 1px solid var(--text-color);
}

.user-score-card {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem;
    width: 100%;
    justify-content: space-around;
}

.user-score-name {
    font-size: 2.2rem;
    font-weight: 500;
}

.user-score-name p {
    display:inline;
}

.user-score-name .icon svg {
  vertical-align: middle;
  height: 1em;
}


.user-score-wins {
    font-weight: 400;
    color: var(--grayed-out-color);
    padding: 0.3rem 0;
    font-size: 1.8rem;
    opacity: 0.7;
    font-style: italic;
}

input[type=range] {
    -webkit-appearance: none; /* Override default look */
    appearance: none;
    border: none;
    width: 100%; /* Full-width */
    background: transparent;
    padding: 1.5rem 0;
    outline: none; /* Remove outline on focus */
}

#back-arrow {
    /* display: none; */
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    z-index: 10;
}

/* Webkit browsers (Chrome, Safari, Edge) */
input[type=range]::-webkit-slider-runnable-track {
    height: 2px;
    background: var(--grayed-out-color)
}

/* Firefox */
input[type=range]::-moz-range-track {
    height: 2px;
    background: var(--grayed-out-color);
}

/* IE */
input[type=range]::-ms-fill-lower,
input[type=range]::-ms-fill-upper {
    height: 2px;
    background: var(--grayed-out-color);
    border-radius: 5px;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 5px !important;
    height: 25px; /* Increase height for better centering */
    margin-top: -12px; /* Vertically center thumb on 8px track */
    background: var(--grayed-out-color);
    cursor: pointer;
}

.rounds-lobby-container {
    display: flex;
    flex: none;
    flex-wrap: wrap;
}

@media (max-width: 992px) {
    #game-container {
        display: flex;
        height: 100vh;
        min-width: 0;
        padding: 0;
        justify-content: center;
        width: 40rem;
        flex-direction: column;
    }
    #back-arrow {
        position: absolute;
        left: -0.8rem;
        top: 1rem;
        font-size: 2rem;
        outline: none;
        /* box-shadow: none; */
        background: none;
        border: none;
        color: var(--text-color);
        cursor: pointer;
        z-index: 10;
    }

    #current-prompts-container {
        padding: 0rem;
        justify-content: center;
    }

    #reload-prompts {
        padding: 4rem 0rem 4rem 0rem;
    }

    #current-prompts-container div {
        min-width: none;
        flex-basis: auto;
    }
    #username-display, #current-lobby{
        font-size: 1.3rem;
    }

    #current-starts, #current-targets {
        font-size: 1.3rem;
    }
    .user-progress-row {
        width: auto;
    }
    #lobby-info {
        margin-top: 0rem;
        display: flex;
        width: 90vw;
        flex-direction: column;
        /* justify-content: center; */
        /* align-content: flex-start; */
        align-items: center;
    }
    .user {
        font-size: 1.3rem;
    }
    #lobby-list {
        width: 30rem;
    }
    #join-lobby {
        min-width: 7rem;
    }
    /* .join-lobby-container {
        width: 90vw;
    } */
    /* #username-lobby {
        flex-wrap: wrap;
    } */
    #current-lobby-settings {
        flex-wrap: wrap;
        justify-content: center;
    }
    .user-progress-bar-outer{
    /* width: 40vw; */
    }
}