body {
    font-family: Arial, sans-serif;
    margin: 20px;
}

h1 {
    text-align: center;
    color: #333;
}

.book-title, .popup-book-title, .custom-button {
    border: 2px solid #007BFF;
    border-radius: 5px;
    padding: 10px;
    display: flex;
    align-items: center;
}

.book-title {
    flex-wrap: wrap;
    margin-bottom: 20px;
    cursor: pointer;
}

.popup-book-title {
    justify-content: center;
    flex-wrap: wrap;
    max-width: 90vw;
    width: auto;
    margin-bottom: 20px;
    white-space: normal;
    text-align: center;
    display: block;
    cursor: default;
}

.book-title:hover {
    background-color: #f0f8ff;
    cursor: pointer;
}

.custom-button:hover {
    background-color: #f0f8ff;
}

.word-container, .popup-book-title .word {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 10px;
    max-width: 20vw;
}

.word-container img, .popup-book-title .word img {
    width: min(20vw, 100px);
    height: auto;
    border-radius: 5px;
    margin-bottom: 5px;
}

.word-container span, .popup-book-title .word span {
    font-size: min(4vw, 18px);
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 90vw;
    width: auto;
    text-align: center;
}

.popup h2 {
    margin-top: 0;
    text-align: center;
}

.popup .custom-button {
    cursor: grab;
}

.overlay, #overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

#indietro {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 10px 20px;
    background-color: white;
    color: black;
    font-size: 18px;
    font-weight: bold;
    border-radius: 10px;
    border: 5px solid olivedrab;
    cursor: grab;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

#indietro:hover {
    background-color: rgba(106, 142, 35, 0.315);
}

.button-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-content: center;
    max-width: 400px;
    margin: 20px auto;
}

.custom-button {
    background-color: #ffffff;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
}

.custom-button img {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.custom-button span {
    display: block;
    margin-top: 5px;
    font-size: 14px;
}
