.Home {
    grid-template-columns: 70% 30%;
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "profile profile"
        "game stats"
        "random stats";
}

.ProfileCard {
    grid-area: profile;
    display: flex;
    align-items: center;
    gap: 1em;
    max-width: 100%; 
    min-width: 0;

}

.ProfilePicture {
    position: relative;
    width: 4em;
    height: 4em;
    border-radius: 50%;
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
}

.ProfilePicture:hover {
    transform: scale(1.05);
}

.ProfilePicture::after {
    content: "";
    position: absolute;
    bottom: 0em;
    right: 0em;
    width: 1.3em;
    height: 1.3em;
    background-image: url("../icons/dice.png");
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 70%;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.ProfilePicture:hover::after {
    opacity: 1;
}

.ProfilePicture.rotate {
    transform: rotateY(180deg);
    transition: transform 0.4s ease;
}

.ProfilePicture.rotate::after {
    opacity: 0;
}

.ProfilePicture.Mage {
    background-image: url("../icons/profiles/Mage.png");
}
.ProfilePicture.Guerrier {
    background-image: url("../icons/profiles/Guerrier.png");
}
.ProfilePicture.Garde {
    background-image: url("../icons/profiles/Garde.png");
}
.ProfilePicture.Espionne {
    background-image: url("../icons/profiles/Espionne.png");
}
.ProfilePicture.Soigneuse {
    background-image: url("../icons/profiles/Soigneuse.png");
}
.ProfilePicture.Noble {
    background-image: url("../icons/profiles/Noble.png");
}
.ProfilePicture.Navigateur {
    background-image: url("../icons/profiles/Navigateur.png");
}
.ProfilePicture.Poete {
    background-image: url("../icons/profiles/Poete.png");
}
.ProfilePicture.Pretresse {
    background-image: url("../icons/profiles/Pretresse.png");
}


.ScoreBadge {
    display: inline-block;
    background: #ffcc00;
    padding: 4px 12px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 5px;
    font-size: 14px;
}

.GamePanel {
    grid-area: game;
}
.RandomGame {
    grid-area: random;
}

.PrivateGame,
.RandomGame,
.Stats {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.PrivateGame > h2,
.RandomGame > h2,
.StatsInfo > h2 {
    margin-top: 0;
    color: #413f3f;
    font-size: 1.5em;
    font-weight: 600;
}

.PrivateGame > span,
.RandomGame > span,
.StatsInfo > span {
    color: #757070;
    font-size: 1em;
    font-weight: 400;
    margin-bottom: 1em;
}

.StatsInfo {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.PrivateGame > h2::before {
    content: "";
    background-image: url("../icons/add-user.png");
    width: 1.2em;
    height: 1.2em;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0.5em;
    vertical-align: middle;
}

.RandomGame > h2::before {
    content: "";
    background-image: url("../icons/game-controller.png");
    width: 1.2em;
    height: 1.2em;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0.5em;
    vertical-align: middle;
}

.ScoreBadge::before {
    content: "";
    background-image: url("../icons/trophy.png");
    width: 1em;
    height: 1em;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0.5em;
    vertical-align: middle;
}

button {
    padding: 14px 18px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

button:hover {
    transform: translateY(-0.1em);
    box-shadow: 0 0.5em 1.5em rgba(0, 0, 0, 0.1);
}

.JoinGame {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#create {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: #11a944;
    color: white;
}

#create::before {
    content: "";
    width: 1.2em;
    height: 1.2em;
    background-image: url("../icons/play-button.png");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0.5em;
}

#searchWithCode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1d6ff2;
    color: white;
}

#search {
    width: 100%;
    background: #a800ff;
    color: white;
}

input {
    padding: 12px;
    width: 80%;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
}

.separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
}

.separator::before,
.separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.3);
}

.Stats {
    grid-area: stats;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.StatItem {
    background: #e7e7eb;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.StatItem .label {
    font-size: 1em;
    color: #555;
}

.StatItem .value {
    font-size: 2em;
    font-weight: 700;
    color: #1c1c1c;
}

.ProfileNameWrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    flex: 0 1 70%;
    max-width: 100%;
    min-width: 0; 
}

.ProfileName {
    font-size: 1.3em;
    font-weight: 600;
    cursor: pointer;
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    max-width: 100%;     
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0; 
}

#pseudoInput {
    padding: 0em;
    font-size: 1.3em;
    border: 0em solid #ffffff;
    border-radius: 0em;
    margin-top: 0em;
    font-weight: 600;
    outline: none;
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    height: 1em;
    min-width: 2em;
}

.ProfileName {
    cursor: pointer;
}

.RandomIcon {
    transform: rotate(90deg);
    margin-left: 0.2em;
    font-size: 1.2em;
    user-select: none;
    cursor: pointer;
    display: inline-block;
}

@keyframes spinUp {
    0% {
        transform: rotate(90deg) translateY(0);
    }
    100% {
        transform: rotate(450deg) translateX(-4px);
    }
}

.RandomIcon:hover {
    animation: spinUp 0.4s ease-out forwards;
}

#pseudoInput {
    transition: all 0.3s ease;
}

.ProfileInfo {
    display: inline-flex;
    flex-direction: column;
    align-content: center;
    gap: 0.5em;
    min-width: 0;
    max-width: 90%;
}

#pseudoInput::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0%;
    background-color: #55575a;
    transition: width 0.3s ease;
}

#pseudoInput:not(.hidden):focus::after {
    width: 100%;
}

.MenuWaiting {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-content: center;
    gap: 30px;
}

.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    margin-top: 20px;
}
