:root {
    --bg-main: #f0f8ff;
    --text-main: #333;
    --dola-color: #3b82f6; /* Xanh dương */
    --dola-dark: #2563eb;
    --louis-color: #f97316; /* Cam */
    --louis-dark: #ea580c;
    --wrong-color: #ef4444;
    --success-color: #22c55e;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-image: radial-gradient(#e0f2fe 2px, transparent 2px);
    background-size: 30px 30px;
}

#app {
    background: white;
    width: 100%;
    max-width: 480px;
    min-height: 80vh;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    padding: 30px 20px;
}

.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.4s ease-out;
}

.screen.active {
    display: flex;
}

/* === WELCOME SCREEN === */
.title {
    text-align: center;
    font-size: 32px;
    font-weight: 900;
    color: #f59e0b;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px #fcd34d;
}

.subtitle {
    text-align: center;
    font-size: 18px;
    margin-bottom: 30px;
    color: #6b7280;
}

.character-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

.btn-select {
    border: none;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
}

.btn-select.dola {
    background: linear-gradient(135deg, var(--dola-color), #60a5fa);
    box-shadow: 0 6px 0 var(--dola-dark);
}

.btn-select.louis {
    background: linear-gradient(135deg, var(--louis-color), #fb923c);
    box-shadow: 0 6px 0 var(--louis-dark);
}

.btn-select:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 transparent;
}

.avatar {
    font-size: 48px;
    margin-bottom: 10px;
}

.name {
    font-size: 24px;
    font-weight: 900;
}

.level {
    font-size: 16px;
    opacity: 0.9;
}

/* === GAME SCREEN === */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.btn-back {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 700;
    color: #6b7280;
    cursor: pointer;
}

.progress {
    font-size: 16px;
    font-weight: 700;
    background: #f3f4f6;
    padding: 5px 15px;
    border-radius: 20px;
    color: #374151;
}

.question-container {
    background: #f8fafc;
    border: 3px solid #e2e8f0;
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    margin-bottom: 30px;
    flex: 1;
}

#question-text {
    font-size: 22px;
    line-height: 1.4;
    color: #1e293b;
    margin-bottom: 20px;
}

.image-container {
    font-size: 60px;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.answer-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#answer-input {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    border: 3px solid #cbd5e1;
    border-radius: 15px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

#answer-input:focus {
    border-color: var(--dola-color);
}

.shake {
    animation: shake 0.5s;
    border-color: var(--wrong-color) !important;
}

#btn-submit {
    background: var(--dola-color);
    color: white;
    border: none;
    padding: 18px;
    font-size: 20px;
    font-weight: 900;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--dola-dark);
    transition: transform 0.1s, box-shadow 0.1s;
}

#btn-submit:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 transparent;
}

/* === THEME COLORS DYNAMIC === */
.theme-dola #app { border-top: 10px solid var(--dola-color); }
.theme-dola #btn-submit { background: var(--dola-color); box-shadow: 0 5px 0 var(--dola-dark); }
.theme-dola #answer-input:focus { border-color: var(--dola-color); }

.theme-louis #app { border-top: 10px solid var(--louis-color); }
.theme-louis #btn-submit { background: var(--louis-color); box-shadow: 0 5px 0 var(--louis-dark); }
.theme-louis #answer-input:focus { border-color: var(--louis-color); }

/* === SUCCESS SCREEN === */
#success-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.treasure-icon {
    font-size: 80px;
    margin: 30px 0;
    animation: bounce 2s infinite;
}

.reward {
    font-size: 20px;
    color: #475569;
    margin-bottom: 40px;
    line-height: 1.5;
    background: #fef3c7;
    padding: 20px;
    border-radius: 15px;
    border: 2px dashed #f59e0b;
}

.btn-restart {
    background: #10b981;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 5px 0 #059669;
}

.btn-restart:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 transparent;
}

/* === MODAL === */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 85%;
    max-width: 350px;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

#modal-title {
    font-size: 24px;
    color: var(--success-color);
    margin-bottom: 10px;
}

#modal-message {
    font-size: 18px;
    color: #475569;
    margin-bottom: 25px;
}

.btn-modal {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* CSS Confetti setup for success screen */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    animation: fall 3s linear infinite;
}
@keyframes fall {
    0% { transform: translateY(-100vh) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}
