/* ── RC Flyer Monthly Stats — Share Page ───────────────────────────────────── */

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

.rcfms-share-page {
    max-width: 520px;
    margin: 0 auto;
    padding: 24px 16px 56px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #1a1a2e;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */

.rcfms-share-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 32px rgba(62, 144, 208, 0.15);
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.rcfms-share-header {
    background: linear-gradient(135deg, #3E90D0 0%, #1a6aad 100%);
    padding: 36px 28px 32px;
    text-align: center;
    color: #ffffff;
}

.rcfms-share-avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.rcfms-avatar-img,
.rcfms-avatar-initials {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    display: block;
    object-fit: cover;
}

.rcfms-avatar-initials {
    background: rgba(255, 255, 255, 0.25);
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    line-height: 74px;
    text-align: center;
}

.rcfms-avatar-badge {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    position: absolute;
    bottom: -4px;
    right: -4px;
    border: 2px solid #3E90D0;
    display: block;
}

.rcfms-share-name {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 4px;
}

.rcfms-share-period {
    font-size: 18px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
}

.rcfms-share-sub {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 8px;
}

/* ── Stat Grid ────────────────────────────────────────────────────────────── */

.rcfms-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    background: #f0f7fc;
    border-bottom: 1px solid #e0eaf5;
}

.rcfms-stat-item {
    padding: 20px 6px;
    text-align: center;
    border-right: 1px solid #deeaf7;
}

.rcfms-stat-item:last-child {
    border-right: none;
}

.rcfms-stat-value {
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 800;
    color: #3E90D0;
    line-height: 1;
}

.rcfms-stat-label {
    font-size: 10px;
    color: #aaaaaa;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 5px;
}

/* ── Sections ─────────────────────────────────────────────────────────────── */

.rcfms-section {
    padding: 18px 24px;
    border-bottom: 1px solid #f0f4f8;
}

.rcfms-section:last-child {
    border-bottom: none;
}

.rcfms-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #3E90D0;
    margin-bottom: 12px;
}

.rcfms-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #555555;
    padding: 5px 0;
}

.rcfms-row strong {
    color: #1a1a2e;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 8px;
}

/* ── Row Thumbnails ───────────────────────────────────────────────────────── */

.rcfms-row-thumb {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.rcfms-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.rcfms-thumb-placeholder {
    background: #f0f7fc;
    font-size: 18px;
    line-height: 36px;
    text-align: center;
}

/* ── Streak Badge ─────────────────────────────────────────────────────────── */

.rcfms-streak-badge {
    margin: 0 24px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 1.5px solid #fcd34d;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #b45309;
    text-align: center;
    margin-bottom: 4px;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */

.rcfms-badges-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rcfms-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f7fc;
    border-radius: 10px;
    padding: 10px 12px;
}

.rcfms-badge-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.rcfms-badge-label {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ── Leaderboard ──────────────────────────────────────────────────────────── */

.rcfms-row-me {
    color: #3E90D0 !important;
    font-weight: 700;
}

.rcfms-row-me strong {
    color: #3E90D0 !important;
}

.rcfms-my-rank {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #3E90D0;
    padding: 8px 12px;
    background: #f0f7fc;
    border-radius: 8px;
    text-align: center;
}

.rcfms-my-rank.rcfms-top3 {
    background: #d1fae5;
    color: #065f46;
}

/* ── Motivation ───────────────────────────────────────────────────────────── */

.rcfms-motivation {
    padding: 18px 24px;
    font-size: 14px;
    color: #777777;
    font-style: italic;
    line-height: 1.65;
    text-align: center;
    border-top: 1px solid #f0f4f8;
}

/* ── Empty State ──────────────────────────────────────────────────────────── */

.rcfms-share-empty {
    padding: 40px 24px;
    text-align: center;
    font-size: 15px;
    color: #aaaaaa;
}

/* ── Share Actions ────────────────────────────────────────────────────────── */

.rcfms-share-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.rcfms-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.rcfms-btn:active {
    transform: scale(0.98);
}

.rcfms-btn-primary {
    background: linear-gradient(135deg, #3E90D0 0%, #1a6aad 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(62, 144, 208, 0.35);
}

.rcfms-btn-secondary {
    background: #f0f6ff;
    color: #3E90D0;
    border: 1.5px solid #c5ddf0;
}

/* ── Error State ──────────────────────────────────────────────────────────── */

.rcfms-share-error {
    background: #fff5f5;
    border: 1.5px solid #fca5a5;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: #991b1b;
    font-size: 14px;
    margin: 24px 0;
}

/* ── Powered By ───────────────────────────────────────────────────────────── */

.rcfms-powered {
    text-align: center;
    font-size: 12px;
    color: #cccccc;
    margin-top: 16px;
}

.rcfms-powered a {
    color: #3E90D0;
    text-decoration: none;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 380px) {
    .rcfms-stat-grid {
        grid-template-columns: 1fr 1fr;
    }
    .rcfms-stat-item:nth-child(2) {
        border-right: none;
    }
    .rcfms-stat-item:nth-child(3) {
        border-top: 1px solid #deeaf7;
    }
    .rcfms-stat-item:nth-child(4) {
        border-top: 1px solid #deeaf7;
        border-right: none;
    }
}
