/* Warm Organic Theme */
:root {
    --bg-color: #F5F5F0;
    --text-color: #1C1917;
    --accent-color: #5A5A40; /* Sage */
    --gold-color: #D4AF37;
    --white: #FFFFFF;
    --stone-100: #F5F5F4;
    --stone-200: #E7E5E4;
    --stone-400: #A8A29E;
    --stone-500: #78716C;
    --red-400: #F87171;
    
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem 5rem 1rem;
}

/* Onboarding */
#onboarding {
    position: fixed;
    inset: 0;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
}

.onboarding-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 2.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.icon-box {
    width: 6rem;
    height: 6rem;
    background: var(--white);
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: rotate(3deg);
}

.btn-primary {
    width: 100%;
    padding: 1.25rem;
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: 1.25rem;
    font-weight: 700;
    font-size: 1.125rem;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary:active {
    transform: scale(0.98);
}

.avatar-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding: 0.5rem;
}

.avatar-option {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    object-fit: cover;
}

.avatar-option.selected {
    border-color: var(--accent-color);
    transform: scale(1.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

input[type="text"] {
    width: 100%;
    padding: 1.25rem;
    background: var(--stone-100);
    border: 1px solid var(--stone-200);
    border-radius: 1.25rem;
    margin-bottom: 2rem;
    font-weight: 700;
    outline: none;
}

/* Header */
header {
    margin-bottom: 2rem;
}

.profile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-main {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    position: relative;
}

.level-badge {
    position: absolute;
    bottom: -0.25rem;
    right: -0.25rem;
    background: var(--accent-color);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.points-display {
    text-align: right;
}

.points-value {
    color: var(--gold-color);
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: flex-end;
}

.progress-container {
    background: var(--stone-200);
    height: 0.5rem;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.5s ease-out;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    color: var(--stone-400);
    font-weight: 700;
    text-transform: uppercase;
}

/* Badges */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.badge-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.badge-item {
    flex-shrink: 0;
    width: 5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.3;
    filter: grayscale(1);
}

.badge-item.unlocked {
    opacity: 1;
    filter: grayscale(0);
}

.badge-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.badge-name {
    font-size: 0.625rem;
    font-weight: 700;
    text-align: center;
}

/* Missions */
.mission-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: 1.5rem;
    border: 1px solid var(--stone-200);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.mission-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mission-card.completed {
    opacity: 0.6;
    background: var(--stone-100);
    cursor: default;
}

.mission-card.completed:hover {
    transform: none;
    box-shadow: none;
}

.mission-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.category-tag {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mission-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.mission-desc {
    font-size: 0.75rem;
    color: var(--stone-500);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 450px;
    border-radius: 2rem 2rem 0 0;
    padding: 2rem;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

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

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--stone-400);
}

/* Utils */
.hidden { display: none !important; }
.no-scrollbar::-webkit-scrollbar { display: none; }
