/* ========================= */
/* GLOBAL */
/* ========================= */

body {
    margin: 0;
    padding: 0;
    background-color: #0d0d0d;
    color: #e2d6b5;
    font-family: 'Georgia', 'Times New Roman', serif;
}

/* ========================= */
/* HOME SCREEN - RELOADED */
/* ========================= */

#menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;

    background: radial-gradient(circle, rgba(27, 20, 20, 1) 0%, rgba(10, 10, 10, 1) 100%);
}

#gameTitle-container {
    margin-bottom: 25px;
    text-align: center;
}

#gameTitle-container h1 {
    font-size: 4.5rem;
    margin: 0;
    color: #cd1616;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 3px 3px 0px #000, 0 0 20px rgba(205, 22, 22, 0.4);
}

#rules-container {
    width: 100%;
    max-width: 550px;
    text-align: center;
    margin-bottom: 40px;
    font-style: italic;
    color: #a39674;
    line-height: 1.6;
}

#pseudo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-bottom: 35px;
}

#pseudo-container p {
    margin: 0;
    width: 100%;
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

#pseudo-input {
    padding: 12px 20px;
    border-radius: 4px;
    border: 2px solid #5a1212;
    background-color: #1a1515;
    color: #e2d6b5;
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#pseudo-input:focus {
    border-color: #cd1616;
    box-shadow: 0 0 10px rgba(205, 22, 22, 0.5);
}

#start-btn {
    padding: 16px 40px;
    border: 2px solid #a52b2b;
    border-radius: 4px;
    background-color: #5a1212;
    color: #e2d6b5;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

#start-btn:hover {
    background-color: #cd1616;
    color: #fff;
    border-color: #ff4d4d;
    box-shadow: 0 0 20px rgba(205, 22, 22, 0.6);
    transform: translateY(-2px);
}

#start-btn:active {
    transform: translateY(1px);
}

/* ========================= */
/* GAME SCREEN */
/* ========================= */

#game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
    box-sizing: border-box;
    background: radial-gradient(circle, rgba(27, 20, 20, 1) 0%, rgba(10, 10, 10, 1) 100%);
}


/* ========================= */
/* TOP BAR (HUD) */
/* ========================= */

#stats-container {
    width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    font-size: 1.2rem;
    margin-bottom: 25px;
    padding: 15px 25px;
    background-color: rgba(26, 21, 21, 0.85);
    border: 2px solid #5a1212;
    border-radius: 10px;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#room {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.6rem;
    font-weight: bold;
    color: #cd1616;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#timer,
#score {
    color: #a39674;
    letter-spacing: 1px;
}


/* ========================= */
/* FIGHT AREA */
/* ========================= */

#fight-container {
    background-image: url("img/dungeonBackground.png");
    background-repeat: repeat;
    background-size: auto;
    image-rendering: pixelated;

    width: 900px;
    height: 480px;
    background-color: #1a1a1a;
    border: 3px solid #5a1212;
    border-radius: 16px;
    padding: 30px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}


/* ========================= */
/* PLAYER / ENEMY */
/* ========================= */

#player-container,
#enemy-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

#player-Img-Container,
#enemy-Img-Container {
    height: 55%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#player-container img,
#enemy-container img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0px 8px 6px rgba(0, 0, 0, 0.6));
}


/* ========================= */
/* NAMES & DATAS */
/* ========================= */

#player-datas-container,
#enemy-datas-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#player-container p,
#enemy-container p {
    margin: 0;
    font-size: 1.6rem;
    font-weight: bold;
    color: #e2d6b5;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#player-datas-container p:last-child {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #f0ead6;
    margin-top: 10px;
    min-height: 40px;
    display: block;
    width: 100%;
    word-wrap: break-word;
    text-align: center;
}

#enemy-datas-container p:last-child {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #f0ead6;
    margin-top: 10px;
    min-height: 40px;
    display: block;
    width: 100%;
    word-wrap: break-word;
    text-align: center;
}


/* ========================= */
/* HP BARS */
/* ========================= */

#player-hp,
#enemy-hp {
    width: 180px;
    height: 24px;
    background-color: #5a1212;
    border: 2px solid #000;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    font-size: 0.9rem;
    font-weight: bold;
    color: #fff;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
}


/* ========================= */
/* BUTTONS (ACTION AREA) */
/* ========================= */

#buttons-container {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

#buttons-container button {
    padding: 10px 18px;
    border: 2px solid #a52b2b;
    border-radius: 4px;
    background-color: #5a1212;
    color: #e2d6b5;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

#buttons-container button:hover {
    background-color: #cd1616;
    color: #fff;
    border-color: #ff4d4d;
    transform: translateY(-2px);
}

#buttons-container button:active {
    transform: translateY(1px);
}

/* ========================= */
/* SCORE SCREEN */
/* ========================= */

#score-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: radial-gradient(circle, rgba(27, 20, 20, 1) 0%, rgba(10, 10, 10, 1) 100%);
}

/* RESULTATS STYLISÉS */

#result-container {
    text-align: center;
    margin-bottom: 35px;
}

#result-container p:first-child {
    font-size: 3.5rem;
    font-weight: bold;
    color: #cd1616;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #000, 0 0 15px rgba(205, 22, 22, 0.4);
}

#result-container p:not(:first-child) {
    font-size: 1.2rem;
    color: #a39674;
    margin: 8px 0;
    letter-spacing: 1px;
}

#ranking-container {
    width: 100%;
    max-width: 600px;
    text-align: center;
    background-color: rgba(26, 21, 21, 0.85);
    border: 2px solid #5a1212;
    border-radius: 8px;
    padding: 25px;
    box-sizing: border-box;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    margin-bottom: 30px;
}

#ranking-container h2 {
    font-size: 2rem;
    color: #e2d6b5;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px #000;
}

#ranking-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem;
}

#ranking-container th,
#ranking-container td {
    border-bottom: 1px solid #3a2020;
    padding: 14px 20px;
    color: #e2d6b5;
    text-align: center;
}

#ranking-container th {
    background-color: #311111;
    color: #cd1616;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1px;
    border-bottom: 2px solid #5a1212;
}

#ranking-container tr:nth-child(even) td {
    background-color: rgba(20, 15, 15, 0.4);
}

#ranking-container tr:first-of-type+tr td {
    color: #fff;
    font-weight: bold;
}


/* BOUTONS DE L'ÉCRAN DES SCORES */

#score-buttons-container {
    display: flex;
    gap: 20px;
}

#score-container button {
    padding: 14px 30px;
    border: 2px solid #a52b2b;
    border-radius: 4px;
    background-color: #5a1212;
    color: #e2d6b5;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

#score-container button:hover {
    background-color: #cd1616;
    color: #fff;
    border-color: #ff4d4d;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(205, 22, 22, 0.4);
}

#score-container button:active {
    transform: translateY(1px);
}