* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f0f0f0;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

h1 {
    margin-bottom: 20px;
    color: #333;
}

.hprc-container {
    position: relative;
    margin: 0 auto;
    max-width: 400px;
}

.hprc-image {
    width: 100%;
    height: auto;
    display: block;
}

.input-overlay {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    text-align: center;
}

#character-input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 2px solid #333;
    border-radius: 4px;
    font-size: 16px;
}

#recover-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
}

#recover-button:hover {
    background-color: #45a049;
}

#characters-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
    gap: 15px;
}

.playground-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px;
}

#characters-playground {
    width: 100%;
    height: 400px;
    background-color: #e0e0e0;
    border: 3px solid #333;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.chat-container {
    width: 100%;
    height: 200px;
    border: 3px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ccc;
}

#chat-input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
}

#send-chat {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

#send-chat:hover {
    background-color: #45a049;
}

.character {
    width: 70px;
    height: 70px;
    object-fit: contain;
    position: absolute;
    transition: transform 0.3s ease, left 0.5s, top 0.5s;
    cursor: pointer;
    animation: popIn 0.5s;
}

.character-speech-bubble {
    position: absolute;
    background-color: white;
    border: 2px solid #333;
    border-radius: 10px;
    padding: 5px 10px;
    max-width: 150px;
    font-size: 12px;
    z-index: 10;
    animation: fadeIn 0.3s;
    text-align: left;
}

.character-speech-bubble:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #333 transparent transparent;
}

.error-message {
    color: red;
    margin-top: 10px;
    font-weight: bold;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}