:root {
    /* Chủ đề mặc định: Khu Vườn Thiền (Zen Garden) */
    --primary-color: #5d8a66;
    --primary-hover: #4a6e52;
    --bg-gradient: linear-gradient(135deg, #f0f4f1 0%, #d9e2d5 100%);
    --text-color: #3e4a3f;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(93, 138, 102, 0.2);
    --error-color: #b35a5a;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    transition: all 1s ease-in-out;
}

[data-theme="ocean"] {
    --primary-color: #5a8fb3;
    --primary-hover: #46718e;
    --bg-gradient: linear-gradient(135deg, #f0f7f9 0%, #d5e6ed 100%);
    --text-color: #3b4e5a;
}

[data-theme="sunset"] {
    --primary-color: #d17a5a;
    --primary-hover: #a86248;
    --bg-gradient: linear-gradient(135deg, #fdf4f0 0%, #efddd5 100%);
    --text-color: #5a463b;
}

[data-theme="lavender"] {
    --primary-color: #6e5ba3; /* Lavender Đậm - Contrast 4.5:1 */
    --primary-hover: #544380; /* Tím Đêm - Contrast 7:1 */
    --bg-gradient: linear-gradient(135deg, #f8f6fb 0%, #e9e4f5 100%);
    --text-color: #2d2438; /* Obsidian Purple */
}

[data-theme="cosmic"] {
    --primary-color: #a389d4; /* Glowing Nebula */
    --primary-hover: #826ab1; /* Stellar Purple */
    --bg-gradient: linear-gradient(135deg, #0f0a1a 0%, #1a1429 100%);
    --text-color: #f1ecf7;
    --card-bg: rgba(255, 255, 255, 0.08);
    --border-color: rgba(163, 137, 212, 0.2);
}

[data-theme="cherry-blossom"] {
    --primary-color: #d17a96;
    --primary-hover: #a8627a;
    --bg-gradient: linear-gradient(135deg, #fdf0f4 0%, #efd5dc 100%);
    --text-color: #5a3b46;
}

[data-theme="aurora"] {
    --primary-color: #4CAF50;
    --primary-hover: #388E3C;
    --bg-gradient: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 50%, #92fe9d 100%);
    --text-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.15);
    --border-color: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    line-height: 1.7; /* Tối ưu cho tiếng Việt */
}

.garden-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    box-shadow: var(--shadow);
    padding: 3rem;
    width: 90%;
    max-width: 520px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

/* Screens */
.screen {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.hidden {
    display: none !important;
}

/* Header & Typography */
h1 {
    font-family: 'Lora', serif;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 2.4rem;
    font-weight: 600;
    font-style: italic;
    letter-spacing: -0.01em;
}
p {
    margin-bottom: 1.8rem;
    font-size: 1.05rem;
    opacity: 0.85;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Auth Box */
.auth-box {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="password"] {
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid var(--border-color);
    border-radius: 18px;
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}
input[type="password"]:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 5px rgba(93, 138, 102, 0.1);
}

.primary-btn, .secondary-btn, .icon-btn, .water-btn, .reset-btn {
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn, .water-btn {
    background: var(--primary-color);
    color: white;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}
.primary-btn:hover, .water-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

.secondary-btn {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-color);
    padding: 0.9rem 1.4rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
}
.secondary-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.icon-btn {
    background: rgba(0, 0, 0, 0.03);
    color: inherit;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--border-color);
}
.icon-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.reset-btn {
    background: none;
    opacity: 0.5;
    padding: 0.6rem 1rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}
.reset-btn:hover {
    opacity: 1;
    color: var(--error-color);
}

.error-text {
    color: var(--error-color);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Stats & Tree */
.stats {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.4);
    padding: 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-color);
}

.tree-stage {
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 3.5rem;
    position: relative;
}

#tree-emoji {
    font-size: 7rem;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.08));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.ground {
    width: 140px;
    height: 14px;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    margin-top: -10px;
}

/* Quote Card */
.quote-card {
    background: rgba(255, 255, 255, 0.5);
    padding: 2.5rem;
    border-radius: 24px;
    margin-bottom: 3.5rem;
    position: relative;
    border: 1px dashed var(--border-color);
    transition: all 0.4s ease;
}

.quote-icon {
    font-size: 2.5rem;
    opacity: 0.1;
    position: absolute;
    top: 10px;
    left: 20px;
    font-family: serif;
}
.quote-icon.right {
    top: auto;
    bottom: -15px;
    left: auto;
    right: 20px;
}

#quote-text {
    font-family: 'Lora', serif;
    font-size: 1.25rem;
    color: inherit;
    margin: 0;
    line-height: 1.8;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 28px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.modal-content h3 {
    font-family: 'Lora', serif;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.modal-content input {
    width: 100%;
    margin: 1.5rem 0;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

footer {
    margin-top: 3rem;
    font-size: 0.9rem;
    opacity: 0.5;
    font-style: italic;
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15) translateY(-10px); }
}
.tree-bounce {
    animation: bounce 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive */
@media (max-width: 480px) {
    .garden-container { padding: 2rem 1.5rem; }
    h1 { font-size: 1.9rem; }
    #tree-emoji { font-size: 5.5rem; }
    .stats { flex-direction: column; gap: 0.6rem; }
}