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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #F5F5DC 0%, #E8DCC4 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    color: #C8A882;
    font-size: 2em;
}

.coin-display {
    font-size: 1.3em;
    font-weight: bold;
    color: #F4D35E;
    background: #2C2416;
    padding: 10px 20px;
    border-radius: 25px;
}

.coin-icon {
    font-size: 1.2em;
}

.menu-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

#daySelector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

#daySelector button {
    background: #C8A882;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s;
}

#daySelector button:hover {
    background: #B08968;
    transform: scale(1.05);
}

#currentDay {
    font-size: 1.5em;
    font-weight: bold;
    color: #C8A882;
    min-width: 100px;
    text-align: center;
}

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.puzzle-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    border: 2px solid #E0E0E0;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    text-align: center;
}

.puzzle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    border-color: #C8A882;
}

.puzzle-card.completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
}

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

.puzzle-card h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.puzzle-card p {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.puzzle-reward {
    color: #F4D35E;
    font-weight: bold;
    margin-top: 10px;
}

.checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
}

.brunch-status {
    margin-top: 30px;
    padding: 20px;
    background: #FFF9E6;
    border-radius: 10px;
    text-align: center;
}

.progress-bar {
    background: #E0E0E0;
    height: 25px;
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    background: linear-gradient(90deg, #F4D35E 0%, #F39C12 100%);
    height: 100%;
    width: 0%;
    transition: width 0.5s;
}

.stats {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.stat-item {
    background: white;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 1.1em;
}

/* Puzzle Screen Styles */
.puzzle-container {
    max-width: 600px;
    margin: 0 auto;
}

.puzzle-header {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.puzzle-title {
    font-size: 1.5em;
    color: #C8A882;
}

.puzzle-controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary {
    background: #4A90E2;
    color: white;
}

.btn-primary:hover {
    background: #357ABD;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #F39C12;
    color: white;
}

.btn-warning:hover {
    background: #E67E22;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.timer {
    font-size: 1.2em;
    font-weight: bold;
    color: #E07A5F;
}

.puzzle-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    font-weight: bold;
    animation: slideIn 0.3s, slideOut 0.3s 2.7s;
    z-index: 1000;
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(400px); opacity: 0; }
}

/* Onboarding Overlay */
#onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#onboarding-overlay.hidden {
    display: none;
}

#onboarding-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90vw;
    text-align: center;
    position: relative;
    animation: modalFadeIn 0.5s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.onboarding-screen {
    display: none;
}

.onboarding-screen.active {
    display: block;
    animation: screenFadeIn 0.5s ease-in-out;
}

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

.onboarding-title {
    font-size: 2.5em;
    color: #C8A882;
    margin-bottom: 30px;
    animation: titleFadeIn 0.8s ease-out;
}

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

.onboarding-subtitle {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 30px;
}

.onboarding-text {
    font-size: 1.1em;
    color: #666;
    line-height: 1.6;
    margin-top: 20px;
}

.cafe-illustration {
    width: 300px;
    height: 300px;
    margin: 30px auto;
    background: linear-gradient(135deg, #FFF9F0 0%, #FFE4D9 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    animation: illustrationScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes illustrationScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.cafe-items {
    display: flex;
    gap: 30px;
    font-size: 4em;
}

.cafe-item {
    animation: itemFloat 2s ease-in-out infinite;
}

.cafe-item.coffee {
    animation-delay: 0s;
}

.cafe-item.croissant {
    animation-delay: 0.3s;
}

.cafe-item.puzzle {
    animation-delay: 0.6s;
}

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

.puzzle-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px auto;
    max-width: 300px;
}

.preview-icon {
    font-size: 3em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 15px;
    animation: iconPulse 2s ease-in-out infinite;
}

.preview-icon:nth-child(1) { animation-delay: 0s; }
.preview-icon:nth-child(2) { animation-delay: 0.2s; }
.preview-icon:nth-child(3) { animation-delay: 0.4s; }
.preview-icon:nth-child(4) { animation-delay: 0.6s; }
.preview-icon:nth-child(5) { animation-delay: 0.8s; }

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.cafe-scene {
    width: 400px;
    height: 200px;
    margin: 20px auto;
    background: linear-gradient(135deg, #f5e6d3 0%, #d4c5b0 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

.decoration-items {
    display: flex;
    gap: 40px;
    font-size: 3.5em;
}

.decoration {
    animation: decorationPop 1s ease-out forwards;
    opacity: 0;
}

.decoration:nth-child(1) { animation-delay: 0.3s; }
.decoration:nth-child(2) { animation-delay: 0.5s; }
.decoration:nth-child(3) { animation-delay: 0.7s; }

@keyframes decorationPop {
    0% { opacity: 0; transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.benefits-list {
    list-style: none;
    font-size: 1.2em;
    color: #333;
    margin-top: 30px;
    text-align: left;
    display: inline-block;
}

.benefits-list li {
    margin-bottom: 12px;
}

.progress-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 30px 0 20px 0;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s;
}

.dot.active {
    background: #667eea;
    transform: scale(1.3);
}

.nav-buttons {
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.btn-onboarding {
    flex: 1;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary-onboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary-onboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary-onboard {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-secondary-onboard:hover {
    background: rgba(102, 126, 234, 0.1);
}

.skip-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    transition: color 0.3s;
}

.skip-btn:hover {
    color: #666;
}

.hidden {
    display: none !important;
}

/* Enhanced Puzzle Card States */
.puzzle-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    border: 3px solid #E0E0E0;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    text-align: center;
}

/* Incomplete State - Bright + Glowing + Pulse */
.puzzle-card:not(.completed):not(.locked) {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    animation: cardPulse 2s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
    }
}

.puzzle-card:not(.completed):not(.locked):hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.4);
    border-color: #764ba2;
}

/* Completed State - Dimmed + Checkmark + No Pulse */
.puzzle-card.completed {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #4caf50;
    opacity: 0.7;
    animation: none !important;
    cursor: default;
}

.puzzle-card.completed:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.puzzle-card.completed .checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4caf50;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    font-weight: bold;
    animation: checkmarkPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkmarkPop {
    0% { transform: scale(0) rotate(-45deg); }
    100% { transform: scale(1) rotate(0); }
}

/* Locked State - Grayscale + Lock Icon */
.puzzle-card.locked {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    border-color: #9e9e9e;
    filter: grayscale(100%);
    cursor: not-allowed;
    opacity: 0.5;
}

.puzzle-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.8em;
}

/* Enhanced Progress Bar with Spring Easing + Sparkle Trail */
.progress-fill {
    background: linear-gradient(90deg, #F4D35E 0%, #F39C12 100%);
    height: 100%;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: visible;
}

.progress-fill::after {
    content: '✨';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    animation: sparkleTrail 0.6s ease-in-out infinite;
}

@keyframes sparkleTrail {
    0%, 100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-50%) scale(1.3);
    }
}

/* Coin Reward Animation */
@keyframes coinFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.3);
    }
}

.coin-fly {
    position: fixed;
    font-size: 2em;
    pointer-events: none;
    z-index: 10000;
    animation: coinFly 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes coinPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.coin-display.coin-animate {
    animation: coinPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Number Counter Animation (Odometer Effect) */
@keyframes numberIncrement {
    0% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.coin-display.counting #coinBalance {
    animation: numberIncrement 0.3s ease-out;
}

/* Responsive */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .puzzle-grid {
        grid-template-columns: 1fr;
    }
    
    .stats {
        flex-direction: column;
    }
    
    #onboarding-content {
        padding: 30px 20px;
    }
    
    .cafe-illustration, .cafe-scene {
        width: 90%;
        max-width: 300px;
    }
    
    .puzzle-preview-grid {
        max-width: 250px;
    }
}

/* ===== CAFÉ DECORATION SYSTEM ===== */
.decoration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.decoration-item {
    background: #F9F9F9;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.decoration-item:hover {
    transform: translateY(-5px);
    border-color: #C8A882;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.decoration-item button {
    background: #C8A882;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.decoration-item button:hover {
    background: #A68A6A;
}

.cafe-decoration {
    transition: transform 0.2s;
}

.cafe-decoration:hover {
    transform: scale(1.2);
}

.cafe-decoration:active {
    cursor: grabbing;
}

#cafeCanvas {
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}
