:root {
    --bg: linear-gradient(135deg, #6a11cb, #2575fc);
    --card-bg: #ffffff;
    --text: #333;
    --accent: #6a11cb;
    --input-border: #bba8ff;
}

body.dark {
    --bg: linear-gradient(135deg, #1f1c2c, #928dab);
    --card-bg: #2c2c34;
    --text: #f1eaff;
    --accent: #c7b3ff;
    --input-border: #6a4c93;
}

body {
    margin: 0;
    font-family: "Poppins", sans-serif;
    background: var(--bg);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.5s;
}

.container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
    width: 350px;
    animation: fadeIn 0.8s ease;
    transition: 0.5s;
}

h1 {
    color: var(--text);
    margin-bottom: 20px;
    font-size: 26px;
}

/* SAISIE MANUELLE */
#manualDate {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#manualDate input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--input-border);
    font-size: 16px;
    background: transparent;
    color: var(--text);
}

button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    transform: scale(1.05);
}

#result {
    margin-top: 20px;
    font-size: 20px;
    color: var(--text);
    font-weight: bold;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.5s;
}

#result.show {
    opacity: 1;
    transform: translateY(0);
}

/* NPC Message */
#npcMessage {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text);
    font-style: italic;
    opacity: 0;
    transition: 0.5s;
}
#npcMessage.show {
    opacity: 1;
}

/* Theme button */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: white;
    transition: 0.3s;
}

/* Wrapper emoji + barre */
#xpEmojiWrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

#ageEmoji {
    font-size: 32px;
    filter: contrast(200%) saturate(150%) brightness(90%);
    image-rendering: pixelated;
}

#xpBarContainer {
    flex: 1;
    height: 14px;
    background: #222;
    border: 2px solid #555;
    border-radius: 8px;
    overflow: hidden;
}

#xpBar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff00, #55ff55);
    transition: width 1s ease-out;
}

/* Layout horizontal : calculatrice + robot */
#layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
}

/* Zone du robot */
#robotSide {
    width: 420px;
    height: 420px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-right: -120px;
}

/* Robot Spline */
#robot3D {
    width: 100%;
    height: 100%;
    transform: scale(1.4);
    transition: 0.3s ease;
}

/* Animation quand on calcule */
#robot3D.bump {
    transform: scale(1.45);
}

/* --- FORMAT TÉLÉPHONE --- */
@media (max-width: 600px) {

    #layout {
        flex-direction: column;
        gap: 20px;
    }

    .container {
        width: 90%;
        max-width: 350px;
    }

    #robotSide {
        width: 260px;
        height: 260px;
        margin-right: 0;
        justify-content: center;
    }

    #robot3D {
        transform: scale(1);
    }
}
