:root {
    --bg-body: #0f172a;
    --bg-gradient: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    --bg-gradient-size: 400% 400%;
    --glass-bg: #eee1e148;
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(255, 255, 255, 0.37);
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #000000;
    --primary: #09ffd6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: #796de7ce;
    background-size: var(--bg-gradient-size);
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.theme-normal { 
    --bg-gradient: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab); 
    --primary: #3b82f6; 
    --primary-glow: rgba(59,130,246,0.5); 
}
body.theme-dark { 
    --bg-gradient: linear-gradient(-45deg, #1e293b, #0f172a, #334155, #1e293b); 
    --primary: #8b5cf6; 
    --primary-glow: rgba(139,92,246,0.5); 
}
body.theme-light { 
    --bg-gradient: linear-gradient(-45deg, #e2e8f0, #f8fafc, #cbd5e1, #e2e8f0); 
    --text-primary: #0f172a; 
    --text-secondary: #334155; 
    --glass-bg: rgba(255,255,255,0.6); 
    --glass-border: rgba(15,23,42,0.1); 
    --primary: #7c3aed; 
    --primary-glow: rgba(124,58,237,0.4); 
}
body.theme-glass { 
    --bg-gradient: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #1e293b); 
    --primary: #00f2ff; 
    --primary-glow: rgba(0,242,255,0.4); 
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
}

.app-wrapper { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
    min-height: 100vh; 
}

.profile-banner {
    position: relative;
    height: 260px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(135deg, #8b5cf6, #ec4899, #00f2ff);
    background-size: 200% 200%;
    animation: bannerShift 15s ease infinite;
    box-shadow: 0 15px 50px rgba(139, 92, 246, 0.3);
}

@keyframes bannerShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.banner-overlay { 
    position: absolute; 
    inset: 0; 
    background: rgba(0,0,0,0.3); 
}
.banner-content { 
    position: relative; 
    z-index: 2; 
    display: flex; 
    align-items: flex-end; 
    gap: 25px; 
    padding: 30px; 
    width: 100%; 
}

.avatar-container { 
    position: relative; 
}
.avatar {
    width: 110px; 
    height: 110px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255,255,255,0.5);
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 3.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.avatar-edit {
    position: absolute; 
    bottom: 0; 
    right: 0;
    width: 34px; 
    height: 34px;
    border-radius: 50%;
    background: white; 
    border: none;
    cursor: pointer; 
    font-size: 1rem;
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: var(--transition);
}
.avatar-edit:hover { 
    transform: scale(1.1); 
}

.banner-info h1 { 
    font-size: 2.2rem; 
    font-weight: 800; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.3); 
}
.banner-info p { 
    font-size: 1.1rem; 
    opacity: 0.9; 
    text-shadow: 0 1px 5px rgba(0,0,0,0.3); 
    margin-top: 5px; 
}

.profile-main { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}
.profile-card { 
    padding: 25px; 
    animation: fadeIn 0.6s ease; 
}
.profile-card:nth-child(3) { 
    grid-column: 1 / -1; 
}
.card-title { 
    font-size: 1.2rem; 
    font-weight: 700; 
    margin-bottom: 20px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid var(--glass-border); 
}

.form-group { 
    margin-bottom: 18px; 
}
.form-group label { 
    display: block; 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: var(--text-muted); 
    margin-bottom: 8px; 
}
.text-input { 
    width: 100%; 
    padding: 12px 16px; 
    background: rgba(255,255,255,0.05); 
    border: 1px solid var(--glass-border); 
    border-radius: var(--radius-md); 
    color: var(--text-primary); 
    font-size: 1rem; 
    transition: var(--transition); 
    font-family: inherit; 
    resize: vertical; 
}
.text-input:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 15px var(--primary-glow); 
}

.primary-btn { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 12px 24px; 
    border-radius: 30px; 
    font-weight: 700; 
    cursor: pointer; 
    font-size: 0.95rem; 
    transition: var(--transition); 
}
.primary-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 0 20px var(--primary-glow); 
}

.color-grid { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
}
.color-swatch { 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    cursor: pointer; 
    border: 3px solid transparent; 
    transition: var(--transition); 
}
.color-swatch:hover { 
    transform: scale(1.15); 
}
.color-swatch.active { 
    border-color: white; 
    box-shadow: 0 0 12px rgba(255,255,255,0.5); 
}

.emoji-grid { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
}
.emoji-option { 
    width: 44px; 
    height: 44px; 
    border-radius: var(--radius-sm); 
    background: rgba(255,255,255,0.06); 
    border: 2px solid transparent; 
    cursor: pointer; 
    font-size: 1.5rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: var(--transition); 
}
.emoji-option:hover { 
    background: rgba(255,255,255,0.12); 
    transform: scale(1.1); 
}
.emoji-option.active { 
    border-color: var(--primary); 
    box-shadow: 0 0 10px var(--primary-glow); 
}

.achievements-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    gap: 15px; 
}
.achievement { 
    padding: 20px; 
    text-align: center; 
    background: rgba(255,255,255,0.04); 
    border-radius: var(--radius-md); 
    border: 1px solid var(--glass-border); 
    transition: var(--transition); 
}
.achievement.unlocked { 
    border-color: var(--primary); 
    box-shadow: 0 0 15px var(--primary-glow); 
    background: rgba(139,92,246,0.1); 
}
.ach-icon { 
    font-size: 2rem; 
    display: block; 
    margin-bottom: 10px; 
}
.ach-name { 
    display: block; 
    font-weight: 600; 
    margin-bottom: 8px; 
}
.ach-status { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: var(--text-muted); 
    font-weight: 700; 
}
.ach-status.unlocked { 
    color: var(--success); 
}
.ach-status.locked { 
    color: var(--text-muted); 
    opacity: 0.6; 
}

.theme-menu { 
    position: fixed; 
    top: 70px; 
    right: 20px; 
    background: rgba(15,23,42,0.95); 
    backdrop-filter: blur(15px); 
    border: 1px solid var(--glass-border); 
    border-radius: var(--radius-lg); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
    z-index: 1000; 
    padding: 10px; 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-10px); 
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1); 
}
.theme-menu:not(.hidden) { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0); 
}
.theme-menu button { 
    width: 100%; 
    text-align: left; 
    padding: 12px 15px; 
    background: transparent; 
    border: none; 
    color: var(--text-secondary); 
    cursor: pointer; 
    border-radius: var(--radius-sm); 
    transition: var(--transition); 
    font-size: 1rem; 
}
.theme-menu button:hover { 
    background: rgba(255,255,255,0.1); 
    color: white; 
    transform: translateX(5px); 
}

.toast-container { 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    z-index: 2000; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}
.toast { 
    padding: 16px 24px; 
    background: rgba(15,23,42,0.95); 
    backdrop-filter: blur(10px); 
    color: white; 
    border-radius: var(--radius-md); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
    border-left: 4px solid var(--primary); 
    animation: slideInRight 0.4s cubic-bezier(0.175,0.885,0.32,1.275); 
    max-width: 350px; 
    font-weight: 500; 
}
.toast.success { 
    border-left-color: var(--success); 
}
.toast.error { 
    border-left-color: var(--danger); 
}
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.05); 
}
::-webkit-scrollbar-thumb { 
    background: rgba(255,255,255,0.2); 
    border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: rgba(255,255,255,0.3); 
}

@media (max-width: 1024px) {
    .profile-main { grid-template-columns: 1fr; }
    .profile-card:nth-child(3) { grid-column: auto; }
    .banner-content { flex-direction: column; align-items: center; text-align: center; }
}
@media (max-width: 768px) {
    .profile-banner { height: 320px; }
    .avatar { width: 90px; height: 90px; font-size: 2.8rem; }
    .banner-info h1 { font-size: 1.6rem; }
}