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

body {
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

#app {
    min-height: 100vh;
}

.page {
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
}

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

.container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
}

.avatar {
    font-size: 32px;
}

.avatar.clickable {
    cursor: pointer;
    transition: transform 0.3s;
}

.avatar.clickable:hover {
    transform: scale(1.2);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-in;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 15px;
    font-size: 32px;
}

h2 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 24px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: bold;
    color: #555;
    font-size: 16px;
}

input[type="text"],
input[type="password"] {
    padding: 15px;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.avatar-option {
    font-size: 40px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 15px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    border: 3px solid transparent;
    position: relative;
}

.avatar-option:hover {
    transform: scale(1.1);
    background: #e8e8e8;
}

.avatar-option.selected {
    border-color: #667eea;
    background: #e8eaff;
    transform: scale(1.1);
}

.avatar-option.locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.avatar-option.locked:hover {
    transform: none;
    background: #f5f5f5;
}

.lock-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 4px;
    border-radius: 5px;
    font-weight: bold;
}

.avatar-option.unlocked {
    animation: unlockPulse 0.6s ease-out;
}

@keyframes unlockPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-small {
    padding: 10px 20px;
    font-size: 14px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-large {
    width: 100%;
    padding: 20px;
    font-size: 20px;
}

.link-text {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.link-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.link-text a:hover {
    text-decoration: underline;
}

.stars-display {
    text-align: center;
    margin: 30px 0;
}

.star-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.big-number {
    font-size: 72px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.label {
    font-size: 18px;
    color: #666;
    font-weight: bold;
}

.progress-section {
    margin: 30px 0;
}

.progress-text {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #555;
    margin-bottom: 15px;
}

.progress-bar-container {
    display: flex;
    gap: 8px;
    width: 100%;
    margin: 15px 0;
}

.progress-segment {
    flex: 1;
    height: 50px;
    background: #e0e0e0;
    border-radius: 10px;
    transition: all 0.5s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
}

.progress-segment.filled {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 4px 10px rgba(74, 222, 128, 0.4);
    transform: scale(1.05);
}

.progress-segment.filled::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.challenges-section {
    margin: 30px 0;
}

.challenges-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-trips-section {
    margin: 30px 0;
}

.recent-trips-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.recent-trip-item {
    padding: 15px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.recent-trip-item:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.recent-trip-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.recent-trip-info {
    flex: 1;
}

.recent-trip-type {
    font-weight: bold;
    font-size: 14px;
}

.recent-trip-time {
    font-size: 12px;
    color: #888;
}

.recent-trip-star {
    color: #ffd700;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.challenge-item {
    padding: 15px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(240, 147, 251, 0.3);
}

.challenge-item.completed {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 4px 10px rgba(74, 222, 128, 0.3);
}

.challenge-info {
    flex: 1;
}

.challenge-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.challenge-progress {
    font-size: 14px;
    opacity: 0.9;
}

.challenge-reward {
    font-size: 24px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.travel-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.travel-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    border: none;
    border-radius: 20px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.travel-btn:hover {
    transform: translateX(10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.travel-btn.green {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: white;
}

.travel-btn.red {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    color: white;
}

.travel-icon {
    font-size: 48px;
}

.travel-label {
    flex: 1;
    text-align: left;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.history-item {
    padding: 20px;
    background: #f5f5f5;
    border-radius: 15px;
    border-left: 5px solid #667eea;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.history-item.star-earned {
    background: #fff9e6;
    border-left-color: #ffd700;
}

.history-date {
    font-size: 14px;
    color: #888;
    flex-shrink: 0;
    min-width: 120px;
}

.history-content {
    flex: 1;
    font-weight: bold;
    font-size: 16px;
}

.delete-btn {
    background: #ff6b6b;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.delete-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.delete-btn:active {
    transform: scale(0.95);
}

.history-content {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 18px;
}

.stars-earned {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 15px;
    color: #333;
}

.stars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 15px;
}

.star-item {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3);
    animation: starPop 0.5s ease-out;
    animation-fill-mode: backwards;
}

.star-item .star-icon {
    font-size: 40px;
    margin-bottom: 5px;
}

.star-item .star-number {
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

@keyframes starPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.history-section {
    margin-top: 30px;
}

.history-section h2 {
    margin-bottom: 15px;
}

/* Animation Overlay */
.animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.animated-icon {
    position: absolute;
    font-size: 80px;
    animation: slideAcross 2s ease-in-out forwards;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

@keyframes slideAcross {
    0% {
        left: -100px;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateY(-50%) rotate(360deg) scale(1.2);
    }
    90% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 100px);
        top: 50%;
        transform: translateY(-50%) rotate(720deg);
        opacity: 0;
    }
}

.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
}

.celebration-text {
    font-size: 48px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    animation: celebrationPop 1.5s ease-out forwards;
}

@keyframes celebrationPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
        opacity: 1;
    }
    70% {
        transform: scale(1.1) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0;
    }
}

/* Sparkle animations */
.sparkle {
    position: absolute;
    font-size: 24px;
    pointer-events: none;
    animation: sparkleFloat 1.5s ease-out forwards;
}

@keyframes sparkleFloat {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(1.5) rotate(360deg);
        opacity: 0;
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: none;
    animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Mobile-friendly responsive design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 14px;
    }

    .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .avatar-option {
        font-size: 32px;
        padding: 10px;
    }

    .btn {
        padding: 18px 25px;
        font-size: 18px;
        min-height: 50px;
    }

    .btn-large {
        padding: 22px;
        font-size: 20px;
        min-height: 60px;
    }

    .travel-btn {
        padding: 20px;
        font-size: 20px;
        min-height: 80px;
    }

    .travel-icon {
        font-size: 40px;
    }

    .travel-label {
        font-size: 20px;
    }

    input[type="text"],
    input[type="password"] {
        padding: 18px;
        font-size: 18px;
        min-height: 50px;
    }

    .progress-segment {
        height: 40px;
    }

    .big-number {
        font-size: 60px;
    }

    .animated-icon {
        font-size: 60px;
    }

    .celebration-text {
        font-size: 36px;
    }

    .stars-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
        padding: 15px;
    }

    .star-item .star-icon {
        font-size: 32px;
    }

    .delete-btn {
        padding: 8px 10px;
        font-size: 18px;
    }

    .history-item {
        flex-wrap: wrap;
        padding: 15px;
    }

    .history-date {
        min-width: 100px;
        font-size: 12px;
    }

    .recent-trip-item {
        padding: 12px;
        gap: 10px;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    h1 {
        font-size: 24px;
    }

    .container {
        padding: 15px;
        margin: 5px;
    }

    .avatar-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .travel-icon {
        font-size: 36px;
    }

    .big-number {
        font-size: 48px;
    }
}

