@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=MedievalSharp&display=swap');

/* Root variables for colors, fonts, and themes */
:root {
    --title-font: "MedievalSharp", cursive;
    /* Font for titles */
    --text-font: "IM Fell English", serif;
    /* Font for general text */
    --background: #3a3a3a;
    /* General background color */
    --character-background: #3a3a3a;
    /* Background color for characters */
    --active-button-color: #771104;
    /* Color for active buttons */
    --tutorial-button-color: #1a76d2;
    /* Color for tutorial buttons */
}

/* Global reset to remove default margins, paddings, and set box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Start Page and General Design */
body {
    height: 100vh;
    /* Full viewport height */
    display: flex;
    justify-content: center;
    align-items: center;
    background: url("../images/background/background-three.webp") no-repeat center center / cover;
    /* Background image */
}

/* Title font style */
.title-font {
    font-family: var(--title-font);
}

/* General text font style */
.text-font {
    font-family: var(--text-font);
}

/* Button styling */
button {
    font-size: 1rem;
    background-color: var(--background);
    /* Uses the defined background color */
    color: #fff;
    /* White text color */
    border: 2px solid #2b2b2b;
    /* Dark border */
    border-radius: 5px;
    /* Rounded edges */
    padding: 0.125rem 1.25rem;
    /* Padding for button spacing */
    text-shadow: 1px 1px 2px #000;
    /* Adds a shadow effect to text */
    cursor: pointer;
    /* Shows pointer cursor on hover */
    transition: all 0.3s ease;
    /* Smooth transition effect */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    /* Shadow effect for depth */
}

/* Button hover effect */
button:hover {
    /* background-color: #4a4e44;  Previous hover background color */
    color: #e5e5e5;
    /* Lighter text color on hover */
    border-color: #67a667;
    /* Green border on hover */
    transform: scale(1.05);
    /* Slightly enlarges button */
}

/* Button click (active) effect */
button:active {
    transform: scale(0.8);
    /* Shrinks button when clicked */
    background-color: #2e2e2e;
    /* Darker background when pressed */
}

/* Outer container box */
.outer-box {
    display: flex;
    flex-direction: column;
    /* Aligns items vertically */
    justify-content: space-around;
    /* Spacing between items */
    align-items: center;
    width: 31.25rem;
    /* Fixed width */
    height: 36.25rem;
    /* Fixed height */
    border: 1px solid black;
    /* Black border */
    background-color: #f5f5dcf2;
    /* Light beige background */
    padding: 0 0 1.25rem 0;
    /* Padding at the bottom */
}

/* Title box for layout organization */
.title-box {
    display: flex;
    justify-content: space-between;
    /* Evenly spaces elements */
    align-items: center;
    width: 90%;
    gap: 20%;
    /* Adds spacing between elements */
    font-family: var(--title-font);
    /* Uses the title font */
    padding: 0.75rem 0;
    /* Adds padding */
}

/* Centered item within the title box */
#middle-item {
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    /* Prevents text from wrapping */
}

#right-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

#toggle-music-button {
    font-size: 0.9rem;
    padding: 0.2rem;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: black;
    border-radius: 50%;
}

/* Loading Screen - A full-screen overlay for loading animations */
#loading-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 97%;
    height: 97%;
    background-color: rgba(0, 0, 0, 0.99);
    /* Almost fully black background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Ensures it appears above other elements */
    font-size: 2rem;
    color: white;
    font-family: var(--title-font);
    /* Uses title font */
    transform: translate(-50%, -50%);
    /* Centers the loading screen */
    opacity: 0;
    /* Initially hidden */
    visibility: hidden;
}

/* When loading screen is active, it becomes visible */
#loading-screen.active {
    opacity: 1;
    visibility: visible;
}

/* Start Items - Input field and start button */
#player-name-input,
#start-button {
    margin: 0.125rem;
    /* Adds spacing between elements */
}

/* Start button styling */
#start-button {
    background-color: var(--active-button-color);
    /* Uses defined button color */
    text-shadow: none;
    /* Removes text shadow for better readability */
}

/* Wrapper for input fields to center them */
.input-wrapper {
    display: flex;
    flex-direction: column;
    /* Stack elements vertically */
    align-items: center;
    justify-content: center;
    height: 80%;
    width: 60%;
}

/* Container for the input field */
.input-container {
    position: relative;
    width: 100%;
}

/* Input field styling */
#player-name-input {
    width: 100%;
    padding: 5px;
    font-size: 0.8rem;
    border: 1px solid #ccc;
    /* Light gray border */
    border-radius: 5px;
    /* Slightly rounded edges */
}

/* Placeholder text color, adjustable via CSS variable */
#player-name-input::placeholder {
    color: var(--placeholder-color, gray);
}

/* Middle Section - Display area for game information and UI elements */
.display-box {
    position: relative;
    padding: 0.625rem;
}

/* Display box with column layout */
.display-box-flex-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid black;
    width: 90%;
    height: 60%;
}

/* Display box with row layout */
.display-box-flex-row {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid black;
    width: 90%;
    height: 60%;
    gap: 1.5rem;
    /* Adds spacing between items */
}

/* Button Display Section */
/* General styling for buttons and their container */

/* Button box with a row layout */
.button-box-flex-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    /* Adds spacing between buttons */
    border: 1px solid black;
    width: 90%;
    height: 25%;
}

/* Button box with a column layout */
.button-box-flex-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    /* Smaller spacing for column layout */
    border: 1px solid black;
    width: 90%;
    height: 25%;
}

/* General button box styling */
.button-box {
    padding: 0.3rem;
    /* Adds padding around the button box */
}

/* Display Section with JavaScript Manipulation */
/* General styling */

/* Close button for pop-ups or menus */
.close-button {
    background-color: red;
    /* Red background for visibility */
    color: white;
    /* White text for contrast */
    border: none;
    /* Removes default border */
    padding: 0.3rem 0.6rem;
    /* Adds padding for better clickability */
    font-size: 1rem;
    /* Standard button font size */
    cursor: pointer;
    /* Changes cursor to pointer on hover */
    border-radius: 5px;
    /* Slightly rounded edges */
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
}

/* Close button hover effect */
.close-button:hover {
    background-color: darkred;
    /* Darker red for hover effect */
}

/* General styling for player menu and tutorial window */
.player-menu-display,
.tutorial-window {
    width: 90%;
    height: 90%;
    padding: 1.25rem;
    /* Adds internal spacing */
    background-color: rgba(0, 0, 0, 0.95);
    /* Semi-transparent dark background */
    color: white;
    /* White text for readability */
    text-align: center;
    /* Centers text */
    border: 2px solid #fff;
    /* White border for contrast */
    border-radius: 10px;
    /* Rounded edges */
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.5);
    /* Adds shadow for depth */

    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    gap: 0.625rem;
    /* Adds spacing between elements */

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Centers the element */
}

/* Player menu allows scrolling if content overflows */
.player-menu-display {
    overflow-x: hidden;
    overflow-y: scroll;
}

/* Display settings for menu items */
.player-menu-item-display {
    justify-content: space-between;
    padding: 1.25rem 1.25rem 0.313rem 1.25rem;
    /* Adds padding around menu items */
}

/* Tutorial section */

/* Inner tutorial button inside the game UI */
#inner-info-button {
    background-color: var(--tutorial-button-color);
    /* Uses the defined tutorial button color */
    text-shadow: none;
    /* Removes text shadow */
    font-weight: 400;
    /* Normal font weight */
}

/* Information icon used for tutorial or help sections */
#information-icon {
    font-size: 1.5rem;
    /* Increases the size of the info icon */
}

/* Info Button - Used for tutorial or help sections */
#info-button {
    background-color: var(--tutorial-button-color);
    /* Uses predefined tutorial button color */
    border: none;
    /* Removes default border */
    border-radius: 50%;
    /* Makes the button circular */
    cursor: pointer;
    /* Changes cursor to pointer on hover */
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Icon inside the info button */
#info-button i {
    font-size: 1.5rem;
    /* Adjusts icon size */
    color: inherit;
    /* Inherits the color from the parent */
}

/* Removes the default outline when the button is focused */
#info-button:focus {
    outline: none;
}

/* Changes icon color when hovered */
#info-button:hover i {
    color: #ccc;
    /* Light gray color for hover effect */
}

/* Tutorial Window Styling */
.tutorial-window {
    justify-content: space-evenly;
    /* Distributes content evenly */
}

/* Container for tutorial navigation buttons */
.next-slide-button-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    /* Adds spacing between buttons */
}

/* Styling for next/previous tutorial slide buttons */
.next-slide-button {
    min-width: 2.4rem;
    min-height: 2.4rem;
    font-size: 1.2rem;
    text-align: center;
    border-radius: 50%;
    /* Circular buttons */
    padding: 0;
}

/* Reset Button - Used for restarting the game */
#restart-button {
    background-color: #DAA520;
    /* Gold color */
    color: #000;
    /* Black text for contrast */
    border: 2px solid #8B7500;
    /* Dark gold border */
    box-shadow: 0 0 5px rgba(218, 165, 32, 0.7);
    /* Soft glow effect */
    transition: transform 0.2s, box-shadow 0.2s;
    /* Smooth scaling and shadow effect */
}

/* Reset Button Hover Effect */
#restart-button:hover {
    transform: scale(1.1);
    /* Slightly enlarges the button */
    box-shadow: 0 0 15px rgba(218, 165, 32, 1);
    /* Stronger glow effect */
}

/* Confirmation Window - Displayed when asking the user for confirmation */
.confirm-window {
    width: 80%;
    height: 80%;
    padding: 1.25rem;
    background-color: rgba(0, 0, 0, 0.8);
    /* Dark, semi-transparent background */
    color: white;
    /* White text for contrast */
    text-align: center;
    /* Centers text */
    border: 2px solid #fff;
    /* White border */
    border-radius: 10px;
    /* Rounded edges */
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.5);
    /* Adds depth with shadow */

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.625rem;
    /* Adds spacing between elements */

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Centers the confirmation window */
}

/* Buttons inside the confirmation window */
.no-reset-button,
.yes-reset-button {
    width: 60%;
    /* Sets the width of confirmation buttons */
}

/* Character Selection - Styling for class selection buttons */
.class-button {
    background-color: var(--active-button-color);
    /* Uses predefined active button color */
}

/* Fighting Sequence - Display container for the battle */
.fight-sequenz-display {
    width: 80%;
    height: 80%;
    border: 1px solid black;
    /* Black border for visibility */
}

/* Monster Image - Styling for the displayed enemy */
.monster-image {
    width: 80%;
    height: 80%;
    border-radius: 5%;
    /* Slightly rounded corners */
}

/* Player Menu - Contains player-related options */
/* Inside Player Menu */
.player-menu-display-option {
    display: flex;
    flex-wrap: nowrap;
    /* Prevents wrapping of elements */
    justify-content: center;
    align-items: center;
    font-size: 0.5rem;
    /* Small font size */
    gap: 0.8rem;
    /* Spacing between elements */
}

/* Button inside the player menu window */
.player-inner-menu-button {
    margin-bottom: 10px;
    /* Adds spacing below */
}

/* Styling for each selectable item inside the player menu */
.player-menu-item {
    font-size: 1rem;
    position: relative;
    cursor: pointer;
    /* Indicates interactivity */
}

/* Hover description box for player menu items */
#hover-description-box {
    font-family: var(--text-font);
    font-size: 1rem;
    max-width: 200px;
    word-wrap: break-word;
    /* Ensures long words do not overflow */
}

/* Player Menu Buttons */
.player-menu-button {
    width: 5rem;
    height: 3.5rem;
    padding: 0.313rem;
    text-align: center;
}

/* Fighting Styles Section - Contains different combat styles */
.fighting-styles-container {
    width: 100%;
    font-size: 0.7rem;
}

/* Fighting Style Option Divs */
.fighting-styles-divs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Attributes Menu - List of player stats */
.stats-list {
    list-style-type: none;
    /* Removes bullet points */
}

/* Item Menu - Display box for equipped items */
.equipped-item-box {
    width: 100%;
    border: 2px white solid;
    height: 40%;
}

/* Reward Sequence - Container for selecting rewards */
#reward-container {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 95%;
}

/* Reward Button - Styling for selecting a reward */
.reward-button {
    background-color: #DAA520;
    /* Gold color for a premium feel */
    color: black;
    text-shadow: none;
    font-weight: 600;
    width: 6rem;
    padding: 5px;
    text-align: center;
}

.reward-display {
    justify-content: start;
}

/* Class display */
.class-display-option,
.reward-display-option {
    height: 90%;
    background-color: var(--background);
    border: solid 0.5px black;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    padding: 0.625rem 0 0 0;
    margin: 0.625rem;
}

.class-display-option {
    height: 95%;
}

.class-item-box {
    height: 90%;
    display: flex;
}

/* class Images */
.class-image,
.reward-image {
    width: 80%;
    border-radius: 10%;
}

.class-title,
.reward-title {
    color: #fff;
    padding: 0.438rem 0;
}

/* Reward Section */
.reward-title {
    font-size: 1rem;
    text-align: center;
}

.class-description,
.reward-description {
    font-size: 1rem;
    color: #e1e1e1;
    text-align: center;
    padding: 0.438rem 0;
    overflow-y: scroll;
}

/* Scrollbar */

::-webkit-scrollbar {
    width: 0.2rem;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 10px;
}


.event-display,
.display-box,
#player-name-input,
.button-box,
.upper-section,
button {
    font-family: var(--text-font);
}

/* Footer*/
#main-footer {
    background-color: #2b2b2b;
    color: #d4d4d4;
    padding: 1rem 0;
    font-family: var(--text-font);
    text-align: center;
    border-top: 2px solid #4a4e44;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.5);
    border-radius: 0 0 10px 10px;
}


#main-footer p {
    margin: 0;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px #000;
    letter-spacing: 0.5px;
}

#main-footer p:hover {
    color: #67a667;
    transition: color 0.3s ease;
}

/* Hide Items */
.hidden {
    display: none !important;
}

.disabled {
    cursor: not-allowed;
    color: gray;
}

@media only screen and (max-width: 600px) {
    body {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100vh;
        margin: 0;
        padding: 0;
        background: url("../images/background/background-three.webp") no-repeat center center / cover;
    }

    .outer-box {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 90vw;
        height: 95vh;
        padding: 1rem;
        background-color: rgba(245, 245, 220, 0.95);
        border-radius: 15px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
        margin: auto;
    }

    #loading-screen {
        width: 99%;
        height: 99%;

    }

    #middle-item {
        flex-grow: 1;
        text-align: center;
    }

    .display-box {
        width: 100%;
        padding: 1rem;
        text-align: center;
        border-top: 2px solid #000;
        border-bottom: 2px solid #000;
        margin-bottom: 1rem;
    }

    .display-box-flex-column {
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }

    .button-box {
        display: flex;
        justify-content: space-evenly;
        width: 100%;
        padding: 1rem;
    }

    .button-box>h2 {
        font-size: 1.2rem;
        margin-bottom: 1px;
    }

    .reward-display-option {
        width: 30%;
        height: 90%;
        padding: 1rem;
        background-color: rgba(58, 58, 58, 0.9);
        border-radius: 10px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
        text-align: center;
        color: #d4d4d4;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .class-display-option {
        width: 30%;
        height: 100%;
        padding: 1rem;
        background-color: rgba(58, 58, 58, 0.9);
        border-radius: 10px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
        text-align: center;
        color: #d4d4d4;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .start-item+button {
        padding: 0.2rem 1rem
    }

    .reward-image,
    .class-image {
        width: 100%;
        height: auto;
        max-width: 100px;
        border-radius: 10px;
        margin-bottom: 1rem;
    }

    .reward-image {
        min-width: 70px;
    }

    .reward-title {
        font-size: 0.9rem;
        padding: 0;
    }

    button {
        font-size: 1rem;
        padding: 0.6rem 1.2rem;
        border-radius: 8px;
    }

    #player-name-input {
        width: 100%;
        max-width: 300px;
        font-size: 0.8rem;
        padding: 0.4rem;
        border-radius: 6px;
        border: 1px solid #ccc;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    h1,
    h2,
    h3 {
        margin: 0.3rem 0;
        text-align: center;
    }

    h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .class-image,
    .reward-image {
        margin: 0;
    }

    .class-title+h3 {
        margin: 0;
    }

    .class-description {
        overflow-y: scroll;
    }

    #main-footer {
        width: 100vw;
        margin-top: 1rem;
        border-radius: 0px;
    }
}

@media only screen and (max-width: 410px) {
    .class-display-option {
        height: 95%;
        margin: 0.3rem;
    }

    .class-item-box {
        height: 100%;
    }

    .reward-display-option {
        width: 34%;
        margin: 0.3rem;
    }

    .button-box {
        justify-content: center;
    }

    .button-box-flex-row {
        gap: 0.5rem;
    }

    .monster-image {
        width: 100%;
    }
}

@media only screen and (max-width: 370px) {
    .class-item-box {
        justify-content: center;
        gap: 0;
    }

    .class-display-option {
        width: 30%;
        margin: 0.1rem;
    }

    .button-box-flex-row {
        gap: 0.2rem;
    }
}

@media only screen and (max-width: 350px) {
    .class-item-box {
        justify-content: center;
        gap: 0;
    }

    .class-display-option {
        width: 30%;
        margin: 0.1rem;
    }

    .monster-image {
        width: 100%;
        height: 65%;
    }

    button {
        padding: 0.6rem 0.9rem;
    }
}