* { box-sizing: border-box; }
body {
    background: radial-gradient(circle at center, #fff0f3 0%, #ffc2d1 100%);
    font-family: 'Quicksand', sans-serif;
    color: #590d22;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.layout-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    align-items: stretch;
}

/* Khối giao diện chung */
.panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(255, 77, 109, 0.15);
    border: 3px solid #ffb3c1;
    padding: 30px;
}

/* Phần Game (Rộng hơn) */
.game-container {
    flex: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 500px;
}

/* Phần Chat (Hẹp hơn) */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* Khung chat */
.chat-header { font-weight: 800; color: #ff4d6d; text-align: center; padding-bottom: 15px; border-bottom: 2px dashed #ffccd5; }
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
}
.chat-msg { padding: 10px 15px; border-radius: 20px; max-width: 85%; font-size: 0.95em; word-wrap: break-word;}
.chat-msg.me { background: #ff4d6d; color: white; align-self: flex-end; border-bottom-right-radius: 5px;}
.chat-msg.other { background: #fff0f3; color: #590d22; align-self: flex-start; border-bottom-left-radius: 5px; border: 1px solid #ffccd5;}
.chat-system { font-size: 0.8em; color: #a5a5a5; text-align: center; width: 100%; }

.chat-input-area { display: flex; gap: 10px; padding-top: 15px; }
.chat-input-area input { flex: 1; padding: 10px 15px; border: 2px solid #ffccd5; border-radius: 20px; outline: none; font-family: inherit;}
.chat-input-area button { background: #ff4d6d; color: white; border: none; padding: 0 20px; border-radius: 20px; font-weight: bold; cursor: pointer; }

/* Các phần tử Game */
h1 { margin-top: 0; font-size: 1.8em; color: #ff4d6d; }
h2 { font-weight: 700; font-size: 1.3em; margin-bottom: 25px; }
.badge { background: #ff4d6d; color: white; padding: 5px 15px; border-radius: 20px; font-size: 0.9em; display: inline-block; margin-bottom: 10px; }

#inputContainer { display: grid; gap: 15px; margin-bottom: 25px; }
.grid-2-cols { grid-template-columns: 1fr 1fr; }
.grid-1-col { grid-template-columns: 1fr; }

.option-card {
    background: #fff0f3; border: 2px solid #ffccd5; border-radius: 20px; padding: 15px;
    cursor: pointer; transition: all 0.2s ease; display: flex; flex-direction: column; align-items: center; font-weight: 700; color: #ff4d6d;
}
.option-card:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 179, 193, 0.4); }
.option-card.selected { background: #ff4d6d; color: white; border-color: #ff4d6d; transform: scale(1.02); }

.text-input { width: 100%; padding: 15px; border: 2px solid #ffccd5; border-radius: 20px; font-size: 1.1em; text-align: center; color: #ff4d6d; outline: none; font-family: inherit;}

.btn-primary { background: #ff4d6d; color: white; border: none; padding: 15px; font-size: 1.2em; font-weight: 800; border-radius: 30px; cursor: pointer; width: 100%; transition: all 0.3s; font-family: inherit;}
.btn-outline { background: transparent; color: #ff4d6d; border: 2px solid #ff4d6d; padding: 10px 20px; border-radius: 20px; cursor: pointer; font-family: inherit; font-weight: bold; margin-top: 15px;}

.spinner { border: 4px solid rgba(255, 77, 109, 0.2); border-top: 4px solid #ff4d6d; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.result-box { padding: 20px; background: #fff0f3; border-radius: 20px; border: 2px dashed #ffb3c1;}
.wait-msg { color: #ff4d6d; margin-top: 15px; font-weight: bold; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

/* Mobile Responsive */
@media (max-width: 768px) {
    .layout-wrapper { flex-direction: column; }
    .chat-messages { max-height: 250px; }
    .panel { padding: 20px; }
}
/* Nút điều khiển âm nhạc */
.music-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff4d6d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 77, 109, 0.4);
    transition: all 0.3s;
    z-index: 1000;
}
.music-btn:hover {
    transform: scale(1.1) translateY(-3px);
    background: #c9184a;
}