/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
    /* Colors */
    --bg-gradient-start: #FFF5F7;
    --bg-gradient-mid: #F8F3FF;
    --bg-gradient-end: #F0F8FF;

    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.5);

    --primary-pink: #FF5C8D;
    --primary-pink-hover: #FF7BA5;
    --primary-pink-light: #FFE5EE;

    --text-primary: #2D3748;
    --text-secondary: #718096;
    --text-light: #A0AEC0;

    --shadow-soft: 0 8px 32px rgba(255, 92, 141, 0.12);
    --shadow-medium: 0 12px 40px rgba(0, 0, 0, 0.08);

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;

    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Font */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-primary);
    background-image: url('image/image\ (1).png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    color: var(--text-primary);
    padding: var(--spacing-md);
    padding-bottom: 150px;
    /* Space for fixed status bar */
    overflow-x: hidden;
}

/* ========================================
   Card Styles
   ======================================== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.garden-card {
    border: 1px solid rgba(139, 195, 74, 0.35);
    background: rgba(255, 255, 255, 0.85);
}



.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.title-icon {
    width: 24px;
    height: 24px;
}

/* ========================================
   Garden Store
   ======================================== */
.store-card {
    background: linear-gradient(to right,
            rgba(255, 235, 245, 0.7) 0%,
            rgba(250, 240, 255, 0.7) 50%,
            rgba(230, 245, 255, 0.7) 100%);
    padding: 16px 18px;
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 2px 12px rgba(150, 150, 200, 0.08);
}

.title-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.pts-badge {
    background: rgba(255, 250, 230, 0.9);
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(255, 159, 77, 0.2);
}

.coin-icon {
    width: 16px;
    height: 16px;
}

.pts-text {
    color: #FF9F4D;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 12px;
    padding: 2px 0 4px;
}

.store-item {
    background: transparent;
    border: none;
    padding: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.flower-icon {
    width: 45px;
    height: 45px;
    object-fit: contain;
    margin-bottom: 1px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.flower-name {
    font-size: 11px;
    font-weight: 700;
    color: #2D3748;
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
}

.flower-price {
    font-size: 9px;
    font-weight: 600;
    color: #718096;
    margin-bottom: 4px;
}

.redeem-btn {
    background: linear-gradient(135deg, #FF5C8D 0%, #FF8FB5 100%);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 5px 8px;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(255, 92, 141, 0.25);
    width: 100%;
}

.redeem-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(255, 92, 141, 0.35);
}

.redeem-btn:active:not(.disabled) {
    transform: translateY(0);
}

.redeem-btn.disabled {
    background: linear-gradient(135deg, #D0D5DD 0%, #E5E7EB 100%);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ========================================
   Garden Section
   ======================================== */
.garden-title-area {
    flex: 1;
}

.garden-subtitle {
    display: none;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.weather-badge {
    display: none;
    background: rgba(74, 158, 255, 0.1);
    color: #4A9EFF;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    align-items: center;
    gap: 4px;
}

.garden-display {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(139, 195, 74, 0.08);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.garden-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}

.sun-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    animation: sunRotate 20s linear infinite;
    filter: drop-shadow(0 4px 12px rgba(255, 200, 0, 0.5));
}

@keyframes sunRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.garden-hint {
    display: none;
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    margin-top: var(--spacing-sm);
    font-style: italic;
}

/* ========================================
   Bottom Status Bar (Sticky)
   ======================================== */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-top: 0.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px 24px 0 0;
    padding: 10px var(--spacing-sm);
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.06);
    z-index: 1000;
}

.status-title {
    display: none;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 8px;
    text-align: left;
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(248, 250, 252, 0.6);
    border-radius: var(--radius-md);
}

.user-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user1-avatar {
    background: linear-gradient(135deg, #E8F4F8 0%, #C5E3ED 100%);
}

.user2-avatar {
    background: linear-gradient(135deg, #F0E8F4 0%, #DCC5E8 100%);
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #CBD5E0;
    border: 2px solid white;
    border-radius: 50%;
}

.online-indicator.active {
    background: #48BB78;
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.2);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.user-stats {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.divider {
    margin: 0 3px;
    opacity: 0.5;
    font-size: 8px;
}

.reward-btn {
    background: linear-gradient(135deg, #FF5C8D 0%, #FF8FB5 100%);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 7px 14px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 92, 141, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.reward-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 92, 141, 0.4);
}

.reward-btn.disabled {
    background: linear-gradient(135deg, #CBD5E0 0%, #E2E8F0 100%);
    box-shadow: none;
    cursor: not-allowed;
}

.reward-text {
    display: block;
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--spacing-lg);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-medium);
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.modal-reward {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--primary-pink-light);
    border-radius: var(--radius-md);
}

.reward-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-pink);
}

.modal-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.modal-btn {
    background: linear-gradient(135deg, #FF5C8D 0%, #FF8FB5 100%);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 4px 12px rgba(255, 92, 141, 0.3);
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 92, 141, 0.4);
}

/* ========================================
   Toast
   ======================================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0;
    z-index: 3000;
    transition: all 0.3s ease;
}

.toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 390px) {
    body {
        padding: var(--spacing-sm);
    }

    .store-grid {
        gap: var(--spacing-sm);
    }

    .flower-name {
        font-size: 12px;
    }

    .user-stats {
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    body {
        max-width: 390px;
        margin: 0 auto;
    }

    .status-bar {
        max-width: 390px;
        left: 50%;
        transform: translateX(-50%);
    }
}