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

body {
    font-family: 'Comic Sans MS', 'Chalkboard', 'Arial', sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #ffe0f0 50%, #f0e6ff 100%);
    min-height: 100vh;
    color: #5a4a6a;
}

/* Sparkle animation background */
.sparkles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 80% 70%, rgba(255, 105, 180, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
    animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

header {
    background: linear-gradient(135deg, #ff9ecd 0%, #ffb6e6 100%);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
    position: relative;
    z-index: 10;
}

header h1 {
    color: #fff;
    font-size: 2.5em;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.coin-display {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    display: inline-block;
    padding: 10px 25px;
    border-radius: 50px;
    font-size: 1.3em;
    font-weight: bold;
    color: #8b6914;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
    margin-top: 10px;
}

.coin-icon {
    font-size: 1.4em;
    margin-right: 5px;
}

/* Navigation Tabs */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
}

.tab-btn {
    padding: 12px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #e6d5f5 0%, #f0e6ff 100%);
    color: #7a6a8a;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.3);
}

.tab-btn.active {
    background: linear-gradient(135deg, #ff9ecd 0%, #ffb6e6 100%);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Habits Section */
.habits-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.2);
}

.habits-container h2 {
    color: #ff69b4;
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.date-display {
    text-align: center;
    color: #9a8aaa;
    font-size: 1.1em;
    margin-bottom: 25px;
}

.habit-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.habit-item {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #fff5fb 0%, #fff0f8 100%);
    border-radius: 15px;
    padding: 15px 20px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.habit-item:hover {
    border-color: #ffb6e6;
    transform: translateX(5px);
}

.habit-item.completed {
    background: linear-gradient(135deg, #d4f8d4 0%, #e8f8e8 100%);
    border-color: #90ee90;
}

.habit-icon {
    font-size: 2.5em;
    margin-right: 15px;
}

.habit-info {
    flex: 1;
}

.habit-info h3 {
    color: #6a5a7a;
    font-size: 1.2em;
    margin-bottom: 3px;
}

.habit-info p {
    color: #9a8aaa;
    font-size: 0.95em;
}

.habit-reward {
    font-weight: bold;
    color: #ffd700;
    font-size: 1.1em;
    margin-right: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.check-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #ffb6e6;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.check-btn:hover {
    background: #ffb6e6;
    transform: scale(1.1);
}

.check-btn.checked {
    background: linear-gradient(135deg, #90ee90 0%, #7fdd7f 100%);
    border-color: #5cb85c;
}

.check-btn.checked .check-icon {
    color: white;
}

.check-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Progress Section */
.progress-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 240, 250, 0.8);
    border-radius: 15px;
    text-align: center;
}

.progress-section h3 {
    color: #ff69b4;
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid #ffb6e6;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9ecd 0%, #ffb6e6 50%, #ff69b4 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

#progress-text {
    color: #8a7a9a;
    font-weight: bold;
}

.reset-btn {
    margin-top: 20px;
    padding: 10px 25px;
    background: linear-gradient(135deg, #e6d5f5 0%, #f0e6ff 100%);
    border: none;
    border-radius: 20px;
    color: #7a6a8a;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #d5c4e5 0%, #e0d6f0 100%);
}

/* Dress Up Section */
.dressup-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.2);
}

.dressup-container h2 {
    color: #ff69b4;
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.drag-hint {
    text-align: center;
    color: #9a8aaa;
    font-size: 0.95em;
    margin-bottom: 20px;
    font-style: italic;
}

.princess-display {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.princess-avatar {
    position: relative;
    width: 200px;
    height: 250px;
    background: linear-gradient(135deg, #ffeef8 0%, #ffe0f0 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.2);
}

.princess-base {
    font-size: 6em;
}

.clothing-layer {
    position: absolute;
    font-size: 3em;
    transition: opacity 0.3s ease;
    cursor: move;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    z-index: 10;
}

.clothing-layer:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(255, 105, 180, 0.5));
}

.clothing-layer:active {
    cursor: grabbing;
}

/* Default positions - will be overridden by saved positions */
#hair-layer { top: 10px; left: 70px; }
#dress-layer { bottom: 30px; left: 70px; }
#shoes-layer { bottom: 0px; left: 70px; }
#accessory-layer { top: 60px; right: 20px; }

.wardrobe {
    margin-top: 20px;
}

.wardrobe-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    position: relative;
}

.wardrobe h3 {
    color: #9a8aaa;
    text-align: center;
    margin: 0;
}

.reset-positions-btn {
    background: linear-gradient(135deg, #e6d5f5 0%, #f0e6ff 100%);
    border: 2px solid #d5c4e5;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reset-positions-btn:hover {
    transform: rotate(180deg) scale(1.1);
    background: linear-gradient(135deg, #ff9ecd 0%, #ffb6e6 100%);
    border-color: #ff9ecd;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 20px;
    border: 2px solid #e6d5f5;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #7a6a8a;
}

.category-btn:hover, .category-btn.active {
    background: linear-gradient(135deg, #e6d5f5 0%, #f0e6ff 100%);
    border-color: #d5c4e5;
}

.wardrobe-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.wardrobe-item {
    aspect-ratio: 1;
    background: white;
    border: 2px solid #f0e6ff;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wardrobe-item:hover {
    transform: scale(1.1);
    border-color: #ff9ecd;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.2);
}

.wardrobe-item.equipped {
    background: linear-gradient(135deg, #d4f8d4 0%, #e8f8e8 100%);
    border-color: #90ee90;
}

/* Shop Section */
.shop-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.2);
}

.shop-container h2 {
    color: #ff69b4;
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.shop-intro {
    text-align: center;
    color: #9a8aaa;
    margin-bottom: 30px;
}

.shop-section {
    margin-bottom: 30px;
}

.shop-section h3 {
    color: #8a7a9a;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid #ffb6e6;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.shop-item {
    background: white;
    border: 2px solid #f0e6ff;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.shop-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 105, 180, 0.2);
    border-color: #ffb6e6;
}

.shop-item.owned {
    background: linear-gradient(135deg, #e8f8e8 0%, #d4f8d4 100%);
    border-color: #90ee90;
}

.shop-item-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.shop-item-name {
    font-weight: bold;
    color: #6a5a7a;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.shop-item-price {
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 10px;
}

.buy-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: none;
    border-radius: 15px;
    color: #8b6914;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buy-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.buy-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.owned-label {
    color: #5cb85c;
    font-weight: bold;
}

/* Celebration Animation */
.celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1000;
}

.celebration-text {
    font-size: 3em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: celebrate 1s ease-out forwards;
}

@keyframes celebrate {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: scale(1) translateY(-100px);
    }
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(-100px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f0e6ff;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #ffb6e6;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff9ecd;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .tab-btn {
        padding: 10px 20px;
        font-size: 0.95em;
    }
    
    .habit-item {
        flex-wrap: wrap;
    }
    
    .habit-reward {
        width: 100%;
        margin: 5px 0;
    }
}
