/* General Styles */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: "Barlow", serif;
    background: url('/images/parchment-texture.jpeg') center/cover no-repeat fixed;
    color: #3b2214;
    text-align: center;
}

h1 {
    font-family: "EB Garamond", serif;
    font-size: 4rem;
    margin: 0.3em;
}

p {
    font-size: 1.2rem;
    font-style: italic;
}

/* Medieval Button Styles */
button {
    background-color: #d2b48c;
    border: 2px solid #8b4513;
    border-radius: 10px;
    padding: 15px 30px;
    margin: 0.7em;
    font-size: 1.1rem;
    font-family: "EB Garamond", serif;
    color: #3e2c1a;
    cursor: pointer;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

button:hover {
    background-color: #b8860b;
    border-color: #654321;
    color: white;
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95); /* Slightly shrink on click */
}

button:disabled {
    background-color: #a9a9a9;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Specific Button Styles */
#difficulty-buttons button {
    width: 10rem;
    height: 4rem;
    font-size: 1.1rem;
    font-weight: 800;
}

#mode-buttons button {
    width: 10rem;
    height: 4rem;
    font-size: 1.1rem;
    font-weight: 800;
}

#mode-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
}

.back-button {
    background: transparent;
    color: #64330f;
    font-size: 1rem;
    padding: 8px 15px;
    border: 2px solid #8b4513;
    border-radius: 5px;
    margin-top: 15px;
    cursor: pointer;
    transition: 0.3s;
}

.back-button:hover {
    background: #a0522d;
    color: white;
}

#restart {
    background: #8B4513;
    color: white;
    font-size: 1.1rem;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    margin-top: 15px;
    cursor: pointer;
    transition: 0.3s;
}

#restart:hover {
    background: #a0522d;
}

#mode-selection, #difficulty-selection, #game-container {
    width: 100%;
    max-width: 44rem;
    margin: auto; /* Center horizontally */
}

/* Mode and Difficulty Selection Containers */
#mode-selection, #difficulty-selection {
    background: rgba(255, 245, 230, 0.9);
    padding-top: 2.5em;
    padding-bottom: 3.5em;
    border: 3px solid #8B4513;
    border-radius: 10px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* Game Container */
#game-container {
    max-width: 700px;
    margin: auto;
    background: rgba(255, 245, 230, 0.9);
    padding: 20px;
    border: 3px solid #8B4513;
    border-radius: 10px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
}

#progress-bar {
    width: 100%;
    height: 10px;
    background: transparent;
    border: 2px solid #6b3d1f;
    border-radius: 5px;
    margin-top: 15px;
    margin-bottom: 15px;
    overflow: hidden;
}

#progress {
    height: 100%;
    width: 0%;
    background: #8B4513;
    border-radius: 2px;
    transition: width 0.3s ease;
}

#quote-container {
    padding: 15px;
    border: 2px solid #6b3d1f;
    border-radius: 5px;
    background: rgba(255, 235, 205, 0.8);
    text-align: left;
    line-height: 1.6;
    max-height: 138px;
    overflow-y: auto;
}

#quote span {
    font-weight: lighter;
}

#quote div {
    margin: 0;
    padding: 0;
}

#quote {
    color: gray;
    margin: 0;
    padding: 0;
    font-size: 1.4rem;
}

.correct {
    color: black;
}

.incorrect {
    color: red;
    text-decoration: underline;
}

.active {
    border-left: 2px solid black;
    animation: blink 0.6s infinite;
}

@keyframes blink {
    50% { border-color: transparent; }
}

#stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Modal Background */
#results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal Content */
#results-content {
    background: rgba(255, 245, 230, 0.95);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 3px solid #8B4513;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 400px;
}

/* Close Button */
#close-modal {
    background: #8B4513;
    color: white;
    font-size: 1rem;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    margin-top: 15px;
    cursor: pointer;
    transition: 0.3s;
}

#close-modal:hover {
    background: #a0522d;
}